content
stringlengths
7
1.05M
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jan 29 21:10:52 2019 @author: felix """ def minimum_skew(genome): """ GC-skew such a useful tool for identifying the location of ori """ val = [0] j = 0 _min = 0 for i in genome: if i == 'C': j -= 1 if i == 'G': j += 1 val.append(j) _min = min(val) min_pos = list([x for x, i in enumerate(val) if i == _min]) return min_pos if __name__ == '__main__': with open('vibrio_cholerae.txt', 'r+') as file: genome = ''.join(file.readlines()) print(len(genome)) #genome='GATACACTTCCCGAGTAGGTACTG' print(list([str(i) for i in minimum_skew(genome)]))
class ComplexNumber(object): def __init__(self, real, imag): self.real = real self.imag = imag def __add__(self, other): return ComplexNumber(self.real+other.real, self.imag+other.imag) def __sub__(self, other): return ComplexNumber(self.real-other.real, self.imag-other.imag) def __mul__(self, other): r = self.real*other.real-(self.imag*other.imag) i = self.real*other.imag+self.imag*other.real return ComplexNumber(r, i) def __div__(self, other): conj = other.conjugate() numer = self*conj denom = float((other*conj).real) return ComplexNumber(numer.real/denom, numer.imag/denom) def conjugate(self): return ComplexNumber(self.real, -self.imag) def __repr__(self): return "{}{:+}i".format(self.real, self.imag) def norm(self): return ComplexNumber((self.real**2+self.imag**2)**.5, 0) def __eq__(self, other): return self.real == other.real and self.imag == other.imag def dist(self, other): return self.norm() - other.norm()
# https://leetcode.com/problems/first-bad-version/ # The isBadVersion API is already defined for you. # @param version, an integer # @return an integer # def isBadVersion(version): class Solution: def firstBadVersion(self, n): """ :type n: int :rtype: int """ if isBadVersion(1): return 1 low = 2 high = n while low <= high: middle = (low + high) // 2 if isBadVersion(middle) and not isBadVersion(middle - 1): return middle elif not isBadVersion(middle) and not isBadVersion(middle - 1): low = middle + 1 else: # isBadVersion(middle) and isBadVersion(middle - 1) high = middle - 1
"""# Providers Defines providers and related types used throughout the rules in this repository. Most users will not need to use these providers to simply create Xcode projects, but if you want to write your own custom rules that interact with these rules, then you will use these providers to communicate between them. """ InputFileAttributesInfo = provider( "Specifies how input files of a target are collected.", fields = { "other_collector": """\ An optional lambda that is passed the target being processed and returns a `list` of `File`s that will end up in `InputFilesInfo.other`. If any of the files are generated, they will also end up in `InputFilesInfo.generated`. """, "excluded": """\ A sequence of attribute names to not collect `File`s from. """, "hdrs": """\ A sequence of attribute names to collect `File`s from for the `InputFilesInfo.hdrs` field. """, "non_arc_srcs": """\ A sequence of attribute names to collect `File`s from for the `InputFilesInfo.non_arc_srcs` field. """, "srcs": """\ A sequence of attribute names to collect `File`s from for the `InputFilesInfo.srcs` field. """, }, ) XcodeProjInfo = provider( "Provides information needed to generate an Xcode project.", fields = { "defines": """\ A value returned from `_process_defines()` that contains the defines set by this target that should be propagated to dependent targets. """, "dependencies": """\ A `list` of target ids (see the `target` `struct`) that this target directly depends on. """, "inputs": """\ A value returned from `input_files.collect()`, that contains the input files for this target. It also includes the two extra fields that collect all of the generated `Files` and all of the `Files` that should be added to the Xcode project, but are not associated with any targets. """, "linker_inputs": "A `depset` of `LinkerInput`s for this target.", "potential_target_merges": """\ A `depset` of structs with 'src' and 'dest' fields. The 'src' field is the id of the target that can be merged into the target with the id of the 'dest' field. """, "required_links": """\ A `depset` of all static library files that are linked into top-level targets besides their primary top-level targets. """, "search_paths": """\ A value returned from `_process_search_paths()`, that contains the search paths needed by this target. These search paths should be added to the search paths of any target that depends on this target. """, "target": """\ A `struct` that contains information about the current target that is potentially needed by the dependent targets. """, "xcode_targets": """\ A `depset` of partial json `dict` strings (e.g. a single '"Key": "Value"' without the enclosing braces), which potentially will become targets in the Xcode project. """, }, ) XcodeProjOutputInfo = provider( "Provides information about the outputs of the `xcodeproj` rule.", fields = { "installer": "The xcodeproj installer", "root_dirs": "The root directories file", "spec": "The json spec", "xcodeproj": "The xcodeproj file", }, )
""" Utilities for visualization plugins. """ # ============================================================================= class OpenObject(dict): # note: not a Bunch # TODO: move to util.data_structures """ A dict that allows assignment and attribute retrieval using the dot operator. If an attribute isn't contained in the dict `None` is returned (no KeyError). JSON-serializable. """ def __getitem__(self, key): if key not in self: return None return super().__getitem__(key) def __getattr__(self, key): return self.__getitem__(key) # ------------------------------------------------------------------- misc # TODO: move to utils? def getattr_recursive(item, attr_key, *args): """ Allows dot member notation in attribute name when getting an item's attribute. NOTE: also searches dictionaries """ using_default = len(args) >= 1 default = args[0] if using_default else None for attr_key in attr_key.split('.'): try: if isinstance(item, dict): item = item.__getitem__(attr_key) else: item = getattr(item, attr_key) except (KeyError, AttributeError): if using_default: return default raise return item def hasattr_recursive(item, attr_key): """ Allows dot member notation in attribute name when getting an item's attribute. NOTE: also searches dictionaries """ if '.' in attr_key: attr_key, last_key = attr_key.rsplit('.', 1) item = getattr_recursive(item, attr_key, None) if item is None: return False attr_key = last_key try: if isinstance(item, dict): return item.__contains__(attr_key) else: return hasattr(item, attr_key) except (KeyError, AttributeError): return False return True
rec3 = 0 rec4 = 0 def hanoi3num(n, origem, destino, trabalho): global rec3 rec3 += 1 if n == 1: return rec3 hanoi3num(n-1, origem, trabalho, destino) hanoi3num(n-1, trabalho, destino, origem) return rec3 def hanoi4num(n, origem, destino, trabalho1, trabalho2): global rec4 if n == 0: return rec4 if n == 1: rec4 += 1 return rec4 hanoi4num(n-2, origem, trabalho1, trabalho2, destino) rec4 += 3 hanoi4num(n-2, trabalho1, destino, origem, trabalho2) return rec4 def gera_matriz(dim_colunas): global rec3 global rec4 matriz = [] linha1 = [] linha2 = [] for c in range(1, dim_colunas): linha1.append('%d' % c) for c in range(1, dim_colunas): rec3 = 0 rec4 = 0 qtd_rec3 = hanoi3num(c, 'A', 'C', 'B') qtd_rec4 = hanoi4num(c, 'A', 'D', 'B', 'C') dif = qtd_rec3 - qtd_rec4 linha2.append('%d' % dif) matriz.append(linha1) matriz.append(linha2) return matriz def escreve_matriz(matriz, n): for x in range(2): for y in range(n-1): print(matriz[x][y], end=" ") print() discos = int(input()) saida = gera_matriz(discos+1) escreve_matriz(saida, discos+1)
class Solution: def strMultiply(self, s, char): bonus = 0 n = int(char) newStr = '' for i in range(len(s) - 1, -1, -1): m = int(s[i]) result = n * m + bonus newChar, bonus = str(result % 10), result // 10 newStr = newChar + newStr if bonus == 0: return newStr else: return str(bonus) + newStr def strAdd(self, s1, s2, offset): bonus, loc2 = 0, len(s2) - 1 newStr = s1[len(s1) - offset:] for i in range(len(s1) - 1 - offset, -1, -1): result = int(s1[i]) + int(s2[loc2]) + bonus newChar, bonus = str(result % 10), result // 10 loc2 -= 1 newStr = newChar + newStr for i in range(loc2, -1, -1): result = int(s2[i]) + bonus newChar, bonus = str(result % 10), result // 10 newStr = newChar + newStr if bonus == 0: return newStr else: return str(bonus) + newStr def multiply(self, num1, num2): if num1 == "0" or num2 == "0": return "0" multiplySet = dict() result = self.strMultiply(num1, num2[-1]) multiplySet[num2[-1]] = result offset = 1 for i in range(len(num2) - 2, -1, -1): if num2[i] in multiplySet: subResult = multiplySet[num2[i]] else: subResult = self.strMultiply(num1, num2[i]) multiplySet[num2[i]] = subResult result = self.strAdd(result, subResult, offset) offset += 1 return result
# These commands are the saved state of coot. You can evaluate them # using "Calculate->Run Script...". #;;molecule-info: 0_PO4b.pdb #;;molecule-info: 1_PO4b.pdb #;;molecule-info: 2_PO4b.pdb #;;molecule-info: PO4.pdb #;;molecule-info: PO4_O.pdb #;;molecule-info: 0_PO4e.pdb #;;molecule-info: 1_PO4e.pdb #;;molecule-info: 2_PO4e.pdb #;;molecule-info: 0_ADPb.pdb #;;molecule-info: 2_PO4h.pdb #;;molecule-info: 1_PO4h.pdb #;;molecule-info: 2_ADPb.pdb #;;molecule-info: 0_PO4h.pdb set_graphics_window_size (1309, 1017) set_graphics_window_position (20, 20) set_display_control_dialog_position (1491, 37) vt_surface (2) set_clipping_front (-10.00) set_clipping_back (-10.00) set_map_radius (10.00) set_iso_level_increment ( 0.0500) set_diff_map_iso_level_increment ( 0.0050) set_colour_map_rotation_on_read_pdb (21.00) set_colour_map_rotation_on_read_pdb_flag (1) set_colour_map_rotation_on_read_pdb_c_only_flag (1) set_swap_difference_map_colours (0) set_background_colour ( 0.00, 0.00, 0.00) set_symmetry_size (13.00) set_symmetry_colour_merge ( 0.50) set_symmetry_colour ( 0.10, 0.20, 0.80) set_symmetry_atom_labels_expanded (0) set_active_map_drag_flag (1) set_show_aniso (0) set_aniso_probability (50.00) set_smooth_scroll_steps (40) set_smooth_scroll_limit (10.00) set_font_size (2) set_rotation_centre_size ( 0.10) set_do_anti_aliasing (0) set_default_bond_thickness (5) handle_read_draw_molecule ("0_PO4b.pdb") set_molecule_bonds_colour_map_rotation (0, 21.00) set_mol_displayed (0, 0) set_mol_active (0, 0) set_draw_hydrogens (0, 1) handle_read_draw_molecule ("1_PO4b.pdb") set_molecule_bonds_colour_map_rotation (1, 42.00) set_draw_hydrogens (1, 1) handle_read_draw_molecule ("2_PO4b.pdb") set_molecule_bonds_colour_map_rotation (2, 63.00) set_mol_displayed (2, 0) set_mol_active (2, 0) set_draw_hydrogens (2, 1) handle_read_draw_molecule ("/Users/stocklab/Documents/Callum/rt1NG/rt1/structureData/PO4.pdb") set_molecule_bonds_colour_map_rotation (3, 84.00) set_mol_displayed (3, 0) set_mol_active (3, 0) set_draw_hydrogens (3, 1) handle_read_draw_molecule ("/Users/stocklab/Documents/Callum/rt1NG/rt1/structureData/PO4_O.pdb") set_molecule_bonds_colour_map_rotation (4, 105.00) set_mol_displayed (4, 0) set_mol_active (4, 0) set_draw_hydrogens (4, 1) handle_read_draw_molecule ("0_PO4e.pdb") set_molecule_bonds_colour_map_rotation (5, 147.00) set_draw_hydrogens (5, 1) handle_read_draw_molecule ("1_PO4e.pdb") set_molecule_bonds_colour_map_rotation (6, 168.00) set_mol_displayed (6, 0) set_mol_active (6, 0) set_draw_hydrogens (6, 1) handle_read_draw_molecule ("2_PO4e.pdb") set_molecule_bonds_colour_map_rotation (7, 189.00) set_mol_displayed (7, 0) set_mol_active (7, 0) set_draw_hydrogens (7, 1) handle_read_draw_molecule ("0_ADPb.pdb") set_molecule_bonds_colour_map_rotation (8, 210.00) set_mol_displayed (8, 0) set_mol_active (8, 0) set_draw_hydrogens (8, 1) handle_read_draw_molecule ("2_PO4h.pdb") set_molecule_bonds_colour_map_rotation (9, 231.00) set_mol_displayed (9, 0) set_mol_active (9, 0) set_draw_hydrogens (9, 1) handle_read_draw_molecule ("1_PO4h.pdb") set_molecule_bonds_colour_map_rotation (10, 252.00) set_mol_displayed (10, 0) set_mol_active (10, 0) set_draw_hydrogens (10, 1) handle_read_draw_molecule ("2_ADPb.pdb") set_molecule_bonds_colour_map_rotation (11, 273.00) set_mol_displayed (11, 0) set_mol_active (11, 0) set_draw_hydrogens (11, 1) handle_read_draw_molecule ("0_PO4h.pdb") set_molecule_bonds_colour_map_rotation (12, 294.00) set_draw_hydrogens (12, 1) set_matrix (60.00) set_show_symmetry_master (0) set_go_to_atom_molecule (12) scale_zoom ( 0.51) set_rotation_centre (30.82, 5.32, 147.91) set_view_quaternion (-0.0927, -0.3578, -0.9256, -0.0821) post_display_control_window ()
#!/usr/bin/env python # coding: utf-8 # This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges). # # Solution Notebook # ## Problem: Find the length of the longest substring with at most k distinct characters. # # * [Constraints](#Constraints) # * [Test Cases](#Test-Cases) # * [Algorithm](#Algorithm) # * [Code](#Code) # * [Unit Test](#Unit-Test) # ## Constraints # # * Can we assume the inputs are valid? # * No # * Can we assume the strings are ASCII? # * Yes # * Is this case sensitive? # * Yes # * Is a substring a contiguous block of chars? # * Yes # * Do we expect an int as a result? # * Yes # * Can we assume this fits memory? # * Yes # ## Test Cases # # * None -> TypeError # * '', k = 3 -> 0 # * 'abcabcdefgghiij', k=3 -> 6 # * 'abcabcdefgghighij', k=3 -> 7 # ## Algorithm # # We'll use a `chars_to_index_map` dictionary: char (key) to index (val) map to maintain a sliding window. # # The index (val) will keep track of the character index in the input string. # # For each character in the string: # # * Add the char (key) and index (value) to the map # * If the length of our map is greater than k, then we'll need to eliminate one item # * Scan the map to find the lowest index and remove it # * The new lowest index will therefore be incremented by 1 # * The max length will be the current index minus the lower index + 1 # # Complexity: # * Time: O(n * k), where n is the number of chars, k is the length of the map due to the min() call # * Space: O(n) # ## Code # In[1]: class Solution(object): def longest_substr(self, string, k): if string is None: raise TypeError('string cannot be None') if k is None: raise TypeError('k cannot be None') low_index = 0 max_length = 0 chars_to_index_map = {} for index, char in enumerate(string): chars_to_index_map[char] = index if len(chars_to_index_map) > k: low_index = min(chars_to_index_map.values()) del chars_to_index_map[string[low_index]] low_index += 1 max_length = max(max_length, index - low_index + 1) return max_length # ## Unit Test # In[2]: get_ipython().run_cell_magic('writefile', 'test_longest_substr.py', "import unittest\n\n\nclass TestSolution(unittest.TestCase):\n\n def test_longest_substr(self):\n solution = Solution()\n self.assertRaises(TypeError, solution.longest_substr, None)\n self.assertEqual(solution.longest_substr('', k=3), 0)\n self.assertEqual(solution.longest_substr('abcabcdefgghiij', k=3), 6)\n self.assertEqual(solution.longest_substr('abcabcdefgghighij', k=3), 7)\n print('Success: test_longest_substr')\n\n\ndef main():\n test = TestSolution()\n test.test_longest_substr()\n\n\nif __name__ == '__main__':\n main()") # In[3]: get_ipython().run_line_magic('run', '-i test_longest_substr.py')
class DBPrefix: DATA_Block = b'\x01' DATA_Transaction = b'\x02' ST_Account = b'\x40' ST_Coin = b'\x44' ST_SpentCoin = b'\x45' ST_Validator = b'\x48' ST_Asset = b'\x4c' ST_Contract = b'\x50' ST_Storage = b'\x70' IX_HeaderHashList = b'\x80' SYS_CurrentBlock = b'\xc0' SYS_CurrentHeader = b'\xc1' SYS_Version = b'\xf0'
# # @lc app=leetcode.cn id=1 lang=python3 # # [1] 两数之和 # # https://leetcode-cn.com/problems/two-sum/description/ # # algorithms # Easy (43.97%) # Total Accepted: 226K # Total Submissions: 513.8K # Testcase Example: '[2,7,11,15]\n9' # # 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 # # 你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。 # # 示例: # # 给定 nums = [2, 7, 11, 15], target = 9 # # 因为 nums[0] + nums[1] = 2 + 7 = 9 # 所以返回 [0, 1] # # # class Solution: def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ tested_num = {} for i in range(len(nums)): n = nums[i] if target - n in tested_num: return [tested_num[target - n], i] tested_num[n] = i return [] if __name__ == "__main__": s = Solution() print(s.twoSum([3,2,4], 6))
""" The constants.py namespace contains constants used throughout the repo These values are assigned at the start of analysis using the "metadata.MetaData" class Set the values by populating the .xml or .xlsx file as per documentation """ # === runtime arguments === EXTRACT_OD = None ANALYZE_OD = None INPUT_FOLDER = None OUTPUT_FOLDER = None WORKFLOW = None METADATA_FILE = None DEBUG = None LOAD_REPORT = None # === constants parsed from metadata === # the constants below are all dictionaries params = { 'rows': None, 'columns': None, 'v_pitch': None, 'h_pitch': None, 'spot_width': None, 'bg_offset': None, 'bg_thickness': None, 'max_diam': None, 'min_diam': None, 'pixel_size_scienion': 0.0049, 'pixel_size_octopi': 0.00185, 'pixel_size': None, 'nbr_outliers': 1 } # a map between Image Name : well (row, col) IMAGE_TO_WELL = dict() # If there's a sheet in xlsx call 'rerun_wells', only those well names will be run RERUN = False RERUN_WELLS = [] # Column names for dataframe that holds all spot properties SPOT_DF_COLS = ['grid_row', 'grid_col', 'centroid_row', 'centroid_col', 'intensity_mean', 'intensity_median', 'bg_mean', 'bg_median', 'od_norm', 'bbox_row_min', 'bbox_row_max', 'bbox_col_min', 'bbox_col_max' ] # === array-constants === # the constants below are all np.ndarrays whose elements are "U100" strings SPOT_ID_ARRAY = None SPOT_TYPE_ARRAY = None FIDUCIAL_ARRAY = None ANTIGEN_ARRAY = None # ndarrays representing 96-well plates for each analysis type WELL_OD_ARRAY = None WELL_INT_ARRAY = None WELL_BG_ARRAY = None # === constants needed for workflows === # these values are extracted from the above ARRAYs # list of (column, row) fiducial locations FIDUCIALS = [] # list of int fiducial location in array. Example for 6x6 array: (0,0) = 0, (0,1) = 6, (5,5) = 35 FIDUCIALS_IDX = [] # values used by point_registration.py SPOT_DIST_PIX = int() SPOT_DIST_UM = int() STDS = [100, 100, 2, .01] # x, y, angle, scale NBR_PARTICLES = 4000 REG_DIST_THRESH = 100 MEAN_POINT = (0, 0) SCALE_MEAN = 1. ANGLE_MEAN = 0. # Requirement of minimum number of detected spots MIN_NBR_SPOTS = 5 # Minimum detected spot percentage of spot ROI area SPOT_MIN_PERCENT_AREA = .1 # constants for saving RUN_PATH = '' # Logger LOG_NAME = 'multisero.log' # template for writing OD, INT, BG worksheets WELL_OUTPUT_TEMPLATE = {'A': {1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None, 10: None, 11: None, 12: None}, 'B': {1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None, 10: None, 11: None, 12: None}, 'C': {1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None, 10: None, 11: None, 12: None}, 'D': {1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None, 10: None, 11: None, 12: None}, 'E': {1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None, 10: None, 11: None, 12: None}, 'F': {1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None, 10: None, 11: None, 12: None}, 'G': {1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None, 10: None, 11: None, 12: None}, 'H': {1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None, 10: None, 11: None, 12: None} }
#Programa que leia o nome de uma cidade e diga se ela começa ou não com santo cidade = input('Digite o nome de uma cidade:').title() splt = cidade.split() if splt[0] == 'Santo': print('{} começa com Santo.'.format(cidade)) else: print('{} não começa com Santo.'.format(cidade))
class Flight: def __init__(self, segments): """ Creates a new Flight wrapper object from an arbitrary number of segments. :param segments: a list of segments in this flight—normally just one. """ self.segments = segments def __repr__(self): stops = [self.segments[0].departure, self.segments[0].destination] for seg in self.segments[1:]: stops.append(seg.destination) return ' -> '.join(stops) @property def departure_point(self): return self.segments[0].departure @departure_point.setter def departure_point(self, val): dest = self.segments[0].destination self.segments[0] = Segment(departure=val, destination=dest) class Segment: def __init__(self, departure, destination): self.departure = departure self.destination = destination
#!/usr/bin/env python3 _DEFAULT_DEPENDENCIES = [ "packages/data/**/*", "packages/common/**/*", "packages/course-landing/**/*", "packages/{{site}}/**/*", "yarn.lock", ] _COURSE_LANDING_DEPENDENCIES = [ "packages/data/training/sessions.yml", "packages/data/training/recommendations/**/*", "packages/data/training/recommendations/**/*", "packages/data/training/pictures/**/*", "packages/common/**/*", "packages/course-landing/**/*", "packages/{{site}}/**/*", "yarn.lock", ] _ONDREJSIKA_THEME_DEPENDENCIES = [ "packages/data/**/*", "packages/common/**/*", "packages/ondrejsika-theme/**/*", "packages/{{site}}/**/*", "yarn.lock", ] _ONDREJSIKA_SINGLEPAGE_DEPENDENCIES = _ONDREJSIKA_THEME_DEPENDENCIES + [ "packages/ondrejsika-singlepage/**/*", ] PROD_SITES = { "sikalabs.com": { "dependencies": { "packages/common/**/*", "packages/{{site}}/**/*", "yarn.lock", } }, "trainera.de": { "dependencies": _ONDREJSIKA_THEME_DEPENDENCIES, "cloudflare_workers": True, }, "ondrej-sika.com": { "dependencies": _ONDREJSIKA_THEME_DEPENDENCIES, "cloudflare_workers": True, }, "ondrej-sika.cz": { "dependencies": _ONDREJSIKA_THEME_DEPENDENCIES, "cloudflare_workers": True, }, "ondrej-sika.de": { "dependencies": _ONDREJSIKA_SINGLEPAGE_DEPENDENCIES, "cloudflare_workers": True, }, "trainera.cz": { "dependencies": _ONDREJSIKA_THEME_DEPENDENCIES, "cloudflare_workers": True, }, "skolenie.kubernetes.sk": { "dependencies": _COURSE_LANDING_DEPENDENCIES, }, "ondrejsikalabs.com": { "dependencies": _DEFAULT_DEPENDENCIES, }, "training.kubernetes.is": { "dependencies": _COURSE_LANDING_DEPENDENCIES, }, "training.kubernetes.lu": { "dependencies": _COURSE_LANDING_DEPENDENCIES, }, "sika-kraml.de": { "dependencies": _DEFAULT_DEPENDENCIES, }, "sika-training.com": { "dependencies": _DEFAULT_DEPENDENCIES, }, "cal-api.sika.io": { "dependencies": _DEFAULT_DEPENDENCIES, }, "ccc.oxs.cz": { "dependencies": _DEFAULT_DEPENDENCIES, }, "sika.blog": { "dependencies": _DEFAULT_DEPENDENCIES, }, "static.sika.io": { "dependencies": _DEFAULT_DEPENDENCIES, }, "sikahq.com": { "dependencies": _DEFAULT_DEPENDENCIES, }, "ondrejsika.is": { "dependencies": _ONDREJSIKA_SINGLEPAGE_DEPENDENCIES, "cloudflare_workers": True, }, "skoleni.io": { "dependencies": _DEFAULT_DEPENDENCIES, "cloudflare_workers": True, }, } ALL_SITES = {} ALL_SITES.update(PROD_SITES) PRIORITY_SITES = ( "ondrej-sika.cz", "ondrej-sika.com", "trainera.cz", "skoleni.io", "trainera.de", ) SUFFIX = ".panda.k8s.oxs.cz" SITES = ALL_SITES.keys() out = [] out.append( """# Don't edit this file maually # This file is generated by ./generate-gitlab-ci.py image: ondrejsika/ci stages: - start - build_docker_priority - deploy_dev_priority - deploy_prod_priority - build_docker - deploy_dev - deploy_prod variables: DOCKER_BUILDKIT: '1' GIT_CLEAN_FLAGS: "-ffdx -e node_modules" start: stage: start script: echo "start job - you can't create empty child pipeline" """ ) def generate_dependencies(site): if site not in ALL_SITES: return """ - packages/data/**/* - packages/common/**/* - packages/course-landing/**/* - packages/{{site}}/**/* - yarn.lock""".replace( "{{site}}", site ) return "\n".join( (" - " + line).replace("{{site}}", site) for line in ALL_SITES[site]["dependencies"] ) for site in SITES: if site in ALL_SITES and ALL_SITES[site].get("cloudflare_workers"): pass else: out.append( """ %(site)s build docker: stage: build_docker%(priority_suffix)s image: ondrejsika/ci-node-docker needs: [] variables: GIT_CLEAN_FLAGS: none script: - yarn - rm -rf packages/%(site)s/out - yarn run static-%(site)s - docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD - cp ci/docker/* packages/%(site)s/ - docker build -t registry.sikahq.com/www/www/%(site)s:$CI_COMMIT_SHORT_SHA packages/%(site)s - rm packages/%(site)s/Dockerfile - rm packages/%(site)s/nginx-site.conf - docker push registry.sikahq.com/www/www/%(site)s:$CI_COMMIT_SHORT_SHA except: variables: - $EXCEPT_BUILD - $EXCEPT_BUILD_DOCKER only: changes: %(dependencies)s """ % { "site": site, "priority_suffix": "_priority" if site in PRIORITY_SITES else "", "dependencies": generate_dependencies(site), } ) if site in PROD_SITES: if PROD_SITES[site].get("cloudflare_workers"): out.append( """ %(site)s prod deploy cloudflare: image: node stage: deploy_prod%(priority_suffix)s script: - yarn - rm -rf packages/%(site)s/out - yarn run deploy-%(site)s except: variables: - $EXCEPT_DEPLOY - $EXCEPT_DEPLOY_K8S - $EXCEPT_DEPLOY_PROD - $EXCEPT_DEPLOY_PROD_K8S only: refs: - master changes: %(dependencies)s environment: name: k8s/prod/%(site)s url: https://%(site)s dependencies: [] """ % { "site": site, "suffix": SUFFIX, "name": site.replace(".", "-"), "priority_suffix": "_priority" if site in PRIORITY_SITES else "", "dependencies": generate_dependencies(site), } ) else: out.append( """ %(site)s prod deploy k8s: needs: - %(site)s build docker stage: deploy_prod%(priority_suffix)s variables: GIT_STRATEGY: none KUBECONFIG: .kubeconfig script: - echo $KUBECONFIG_FILECONTENT | base64 --decode > .kubeconfig - helm repo add ondrejsika https://helm.oxs.cz - helm upgrade --install %(name)s ondrejsika/one-image --set host=%(site)s --set image=$CI_REGISTRY_IMAGE/%(site)s:$CI_COMMIT_SHORT_SHA --set changeCause=job-$CI_JOB_ID - kubectl rollout status deploy %(name)s except: variables: - $EXCEPT_DEPLOY - $EXCEPT_DEPLOY_K8S - $EXCEPT_DEPLOY_PROD - $EXCEPT_DEPLOY_PROD_K8S only: refs: - master changes: %(dependencies)s environment: name: k8s/prod/%(site)s url: https://%(site)s dependencies: [] """ % { "site": site, "suffix": SUFFIX, "name": site.replace(".", "-"), "priority_suffix": "_priority" if site in PRIORITY_SITES else "", "dependencies": generate_dependencies(site), } ) with open(".gitlab-ci.generated.yml", "w") as f: f.write("".join(out))
class Board: """ Author: MBoss Date: Jan 17, 2018. Board class. Board data: 1=white, -1=black, 0=empty first dim is column , 2nd is row: pieces[1][7] is the square in column 2, at the opposite end of the board in row 8. Squares are stored and manipulated as (x,y) tuples. x is the column, y is the row. """ def __init__(self, n, n_in_row): """Set up initial board configuration.""" self.n = n self.n_in_row = n_in_row # Create the empty board array. self.pieces = [None]*self.n for i in range(self.n): self.pieces[i] = [0]*self.n # add [][] indexer syntax to the Board def __getitem__(self, index): return self.pieces[index] def get_legal_moves(self): """Returns all the legal moves for the given color. (1 for white, -1 for black) """ moves = set() # stores the legal moves. # Get all empty locations. for y in range(self.n): for x in range(self.n): if self[x][y] == 0: moves.add((x, y)) return list(moves) def has_legal_moves(self): """Returns True if has legal move else False """ # Get all empty locations. for y in range(self.n): for x in range(self.n): if self[x][y] == 0: return True return False def get_win_state(self): n = self.n_in_row for w in range(self.n): for h in range(self.n): if (w in range(self.n - n + 1) and self[w][h] != 0 and len(set(self[i][h] for i in range(w, w + n))) == 1): return True, self[w][h] if (h in range(self.n - n + 1) and self[w][h] != 0 and len(set(self[w][j] for j in range(h, h + n))) == 1): return True, self[w][h] if (w in range(self.n - n + 1) and h in range(self.n - n + 1) and self[w][ h] != 0 and len(set(self[w + k][h + k] for k in range(n))) == 1): return True, self[w][h] if (w in range(self.n - n + 1) and h in range(n - 1, self.n) and self[w][ h] != 0 and len(set(self[w + l][h - l] for l in range(n))) == 1): return True, self[w][h] if self.has_legal_moves(): return False, 0 return True, 0 def execute_move(self, move, color): """Perform the given move on the board; flips pieces as necessary. color gives the color pf the piece to play (1=white,-1=black) """ (x, y) = move assert self[x][y] == 0, f'invalid move {move}' self[x][y] = color
'''程序错误码''' OK = 0 # 正常 class LogicError(Exception): code = OK data = 'OK' def __init__(self, data=None): cls_name = self.__class__.__name__ self.data = data or cls_name def gen_logic_err(name, code): '''生成一个 LogicError 的子类 (LogicError 的工厂函数)''' err_cls = type(name, (LogicError,), {'code': code}) return err_cls VcodeSendErr = gen_logic_err('VcodeSendErr', 1000) # 验证码发送失败 VcodeErr = gen_logic_err('VcodeErr', 1001) # 验证码错误 LoginRequired = gen_logic_err('LoginRequired', 1002) # 需要用户登陆 ProfileErr = gen_logic_err('ProfileErr', 1003) # 用户资料表单数据错误 SidErr = gen_logic_err('SidErr', 1004) # SID 错误 StypeErr = gen_logic_err('StypeErr', 1005) # 滑动类型错误 SwipeRepeatErr = gen_logic_err('SwipeRepeatErr', 1006) # 重复滑动 RewindLimitErr = gen_logic_err('RewindLimitErr', 1007) # 反悔次数达到限制 RewindTimeout = gen_logic_err('RewindTimeout', 1008) # 反悔超时 NonSwipe = gen_logic_err('NonSwipe', 1009) # 当前还没有滑动记录 PermRequired = gen_logic_err('PermRequired', 1010) # 用户不具有某权限
class EthTokenTransferV2(object): def __init__(self): self.contract_address = None self.from_address = None self.to_address = None self.token_type = None self.token_id = None self.amount = None self.transaction_hash = None self.log_index = None self.block_number = None
""" tests module for the FIX-specific modules for the fixtest tool. Copyright (c) 2014 Kenn Takara See LICENSE for details """
class PlasterError(Exception): """ A base exception for any error generated by plaster. """ class InvalidURI(PlasterError, ValueError): """ Raised by :func:`plaster.parse_uri` when failing to parse a ``config_uri``. :ivar uri: The user-supplied ``config_uri`` string. """ def __init__(self, uri, message=None): if message is None: message = 'Unable to parse config_uri "{0}".'.format(uri) super(InvalidURI, self).__init__(message) self.message = message self.uri = uri class LoaderNotFound(PlasterError, ValueError): """ Raised by :func:`plaster.get_loader` when no loaders match the requested ``scheme``. :ivar scheme: The scheme being matched. :ivar protocols: Zero or more :term:`loader protocol` identifiers that were requested when finding a loader. """ def __init__(self, scheme, protocols=None, message=None): if message is None: scheme_msg = 'scheme "{0}"'.format(scheme) if protocols is not None: scheme_msg += ', protocol "{0}"'.format(', '.join(protocols)) message = ( 'Could not find a matching loader for the {0}.' .format(scheme_msg)) super(LoaderNotFound, self).__init__(message) self.message = message self.scheme = scheme self.protocols = protocols class MultipleLoadersFound(PlasterError, ValueError): """ Raised by :func:`plaster.get_loader` when more than one loader matches the requested ``scheme``. :ivar scheme: The scheme being matched. :ivar protocols: Zero or more :term:`loader protocol` identifiers that were requested when finding a loader. :ivar loaders: A list of :class:`plaster.ILoaderInfo` objects. """ def __init__(self, scheme, loaders, protocols=None, message=None): if message is None: scheme_msg = 'scheme "{0}"'.format(scheme) if protocols is not None: scheme_msg += ', protocol "{0}"'.format(', '.join(protocols)) loader_list = ', '.join(loader.scheme for loader in sorted( loaders, key=lambda v: v.scheme)) message = ( 'Multiple plaster loaders were found for {0}. ' 'Please specify a more specific config_uri. ' 'Matched loaders: {1}' ).format(scheme_msg, loader_list) super(MultipleLoadersFound, self).__init__(message) self.message = message self.scheme = scheme self.protocols = protocols self.loaders = loaders
# Aumentos múltiplos '''Escreva um programa que pergunte o salário de um funcionário e calcule o valor do seu aumento. Para salários superiores a R$ 1.250,00, calcule um aumento de 10%. Para os inferiores ou iguais, o aumento é de 15%''' salario = float(input('Informe o valor do seu salário atual: ')) print('O seu salário é de \033[1;30m''R${:.2f}\033[m'.format(salario)) if salario > 1250: aumento = salario * 0.10 else: aumento = salario * 0.15 print('Você receberá um aumento de \033[1;32m''R$ {:.2f}\033[m'.format(aumento)) novo = salario + aumento print('A partir de agora, o seu salário será de \033[1;30;42m''R$ {:.2f}\033[m'.format(novo)) print('\033[1;32m''PARABENS!')
print('Manipulando cadeias de textos ou caracteres') print('Operações de manipulação de textos') print('1º FATIAMENTO:') frase ='Curso em video' print(frase[9]) # aparecerá o corte de uma letra na posição indicada print(frase[:6]) # os dois pontos apresenta um intervalo atéa posição indicada print(frase[9:14]) # intervalos determinandos print(frase[6:22:2]) # aqui aparecerá caracteres pulando de 2 em 2. print(frase[4:]) # de uma posição inicial até... print(frase[9::]) print(frase[9::3]) print('2º ANÁLISE:') print(len(frase)) print(frase.count('o')) print(frase.count('o',0,15)) print(frase.find('deo')) print(frase.find("android")) print('curso' in frase) print('TRANSFORMAÇÃO') print(frase.replace('python','android')) print(frase.upper()) print(frase.lower())# tudo fica minusculo print(frase.capitalize()) # deica a primeira letra em maiuscula print(frase.title()) #a primeira letra de cada palavra da string vai ficar em maiusculo frase2 = ' aprenda python ' print(frase2) print(frase2.strip()) #tira os excessos dos espaços do lado print('DIVISÃO') print(frase.split()) #divição na string ultilizando os espaços print('JUNÇÃO') print('-'.join(frase))
class Node(object): def __init__(self, value=None, pointer=None): self.value = value self.pointer = None class Queue(object): def __init__(self): self.head = None self.tail = None def isEmpty(self): return not bool(self.head) def enqueue(self, value): node = Node(value) if not self.head: self.head = node self.tail = node else: if self.tail: self.tail.pointer = node self.tail = node def size(self): node = self.head count = 0 while node: count += 1 node = node.pointer return count def peek(self): return self.head.value def __repr__(self): items = [] node = self.head while node: items.append(node.value) node = node.pointer items.reverse() return '{}'.format(items) def dequeue(self): if self.head: value = self.head.value self.head = self.head.pointer return value else: print('Queue is empty') if __name__ == '__main__': queue = Queue() print(queue.isEmpty()) queue.enqueue(23) queue.enqueue(4) queue.enqueue(8) print("Size: ", queue.size()) print(queue) print("Peek: ", queue.peek()) print("Dequeue! ", queue.dequeue()) print(queue)
def reverseList(self, head: ListNode) -> ListNode: # begin with temporary node cur = ListNode(-1) # continue while list exists while head is not None: # create temp and make temp the new cur temp = ListNode(-1) cur.val = head.val temp.next = cur cur = temp head = head.next return cur.next
# terrascript/data/hashicorp/random.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:25:40 UTC) __all__ = []
class CommonRescale(): def get_factor(self, a): raise NotImplementedError def __call__(self, init, mask): init_copy = init.clone() init_copy[~mask] = 1e-12 return self.get_factor(init) / self.get_factor(init_copy) class L1GlobalRescale(CommonRescale): def get_factor(self, a): return a.abs().sum() class L2GlobalRescale(CommonRescale): def get_factor(self, a): return a.norm() class L1LocalRescale(CommonRescale): def get_factor(self, a): if len(a.shape) == 1: return a.abs() if len(a.shape) == 2: # Linear return a.abs().sum(dim=1, keepdims=True) if len(a.shape) == 4: # Conv2d return a.abs().sum(dim=(1, 2, 3), keepdims=True) class L2LocalRescale(CommonRescale): def get_factor(self, a): if len(a.shape) == 1: # Bias return a.abs() if len(a.shape) == 2: # Linear return a.norm(dim=1).unsqueeze(1) if len(a.shape) == 4: # Conv2d return a.reshape(a.shape[0], -1).norm(dim=1)[(..., None, None, None)]
# # PySNMP MIB module BEGEMOT-WIRELESS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BEGEMOT-WIRELESS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:20:14 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection") begemot, = mibBuilder.importSymbols("BEGEMOT-MIB", "begemot") InterfaceIndex, ifIndex = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex", "ifIndex") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Counter32, MibIdentifier, TimeTicks, Gauge32, Counter64, ModuleIdentity, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, mib_2, Bits, iso, IpAddress, ObjectIdentity, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "MibIdentifier", "TimeTicks", "Gauge32", "Counter64", "ModuleIdentity", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "mib-2", "Bits", "iso", "IpAddress", "ObjectIdentity", "NotificationType") MacAddress, RowStatus, TruthValue, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "RowStatus", "TruthValue", "TextualConvention", "DisplayString") begemotWlan = ModuleIdentity((1, 3, 6, 1, 4, 1, 12325, 1, 210)) begemotWlan.setRevisions(('2010-05-17 00:00',)) if mibBuilder.loadTexts: begemotWlan.setLastUpdated('201005170000Z') if mibBuilder.loadTexts: begemotWlan.setOrganization('The FreeBSD Foundation') class WlanMgmtReasonCode(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 32, 33, 34, 35, 36, 37, 38, 39)) namedValues = NamedValues(("unspecified", 1), ("authenticationExpire", 2), ("authenticationLeave", 3), ("associationExpire", 4), ("associationTooMany", 5), ("notAuthenticated", 6), ("notAssociated", 7), ("associationLeave", 8), ("associationNotAuthenticated", 9), ("dissassocPwrcapBad", 10), ("dissassocSuperchanBad", 11), ("ieInvalid", 13), ("micFailure", 14), ("fourWayHandshakeTimeout", 15), ("groupKeyUpdateTimeout", 16), ("ieIn4FourWayDiffers", 17), ("groupCipherInvalid", 18), ("pairwiseCiherInvalid", 19), ("akmpInvalid", 20), ("unsupportedRsnIeVersion", 21), ("invalidRsnIeCap", 22), ("dot1xAuthFailed", 23), ("cipherSuiteRejected", 24), ("unspeciffiedQos", 32), ("insufficientBw", 33), ("tooManyFrames", 34), ("outsideTxOp", 35), ("leavingQbss", 36), ("badMechanism", 37), ("setupNeeded", 38), ("timeout", 39)) class WlanMgmtMeshReasonCode(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)) namedValues = NamedValues(("peerLinkCancelled", 2), ("maxPeers", 3), ("cpViolation", 4), ("closeRcvd", 5), ("maxRetries", 6), ("confirmTimeout", 7), ("invalidGtk", 8), ("inconsistentParams", 9), ("invalidSecurity", 10), ("perrUnspecified", 11), ("perrNoFI", 12), ("perrDestUnreach", 13)) class WlanMgmtStatusCode(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 40, 41, 42, 43, 44, 45, 46)) namedValues = NamedValues(("success", 0), ("unspecified", 1), ("capabilitiesInfo", 10), ("notAssociated", 11), ("other", 12), ("algorithm", 13), ("sequence", 14), ("challenge", 15), ("timeout", 16), ("tooMany", 17), ("basicRate", 18), ("spRequired", 19), ("pbccRequired", 20), ("caRequired", 21), ("specMgmtRequired", 22), ("pwrcapRequire", 23), ("superchanRequired", 24), ("shortSlotRequired", 25), ("dssofdmRequired", 26), ("missingHTCaps", 27), ("invalidIE", 40), ("groupCipherInvalid", 41), ("pairwiseCipherInvalid", 42), ("akmpInvalid", 43), ("unsupportedRsnIEVersion", 44), ("invalidRsnIECap", 45), ("cipherSuiteRejected", 46)) class WlanRegDomainCode(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)) namedValues = NamedValues(("fcc", 1), ("ca", 2), ("etsi", 3), ("etsi2", 4), ("etsi3", 5), ("fcc3", 6), ("japan", 7), ("korea", 8), ("apac", 9), ("apac2", 10), ("apac3", 11), ("row", 12), ("none", 13), ("debug", 14), ("sr9", 15), ("xr9", 16), ("gz901", 17)) class WlanIfaceDot11nPduType(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3)) namedValues = NamedValues(("disabled", 0), ("rxOnly", 1), ("txOnly", 2), ("txAndRx", 3)) class WlanPeerCapabilityFlags(TextualConvention, Bits): status = 'current' namedValues = NamedValues(("ess", 1), ("ibss", 2), ("cfPollable", 3), ("cfPollRequest", 4), ("privacy", 5), ("shortPreamble", 6), ("pbcc", 7), ("channelAgility", 8), ("shortSlotTime", 9), ("rsn", 10), ("dsssofdm", 11)) class WlanIfPhyMode(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) namedValues = NamedValues(("auto", 1), ("dot11a", 2), ("dot11b", 3), ("dot11g", 4), ("fh", 5), ("turboA", 6), ("turboG", 7), ("sturboA", 8), ("dot11na", 9), ("dot11ng", 10), ("ofdmHalf", 11), ("ofdmQuarter", 12)) begemotWlanNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 0)) begemotWlanInterface = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1)) begemotWlanScanning = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2)) begemotWlanStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3)) begemotWlanWep = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4)) begemotWlanMACAccessControl = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 5)) begemotWlanMeshRouting = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6)) wlanInterfaceTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 1), ) if mibBuilder.loadTexts: wlanInterfaceTable.setStatus('current') wlanInterfaceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 1, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName")) if mibBuilder.loadTexts: wlanInterfaceEntry.setStatus('current') wlanIfaceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 1, 1, 1), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfaceIndex.setStatus('current') wlanIfaceName = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate") if mibBuilder.loadTexts: wlanIfaceName.setStatus('current') wlanParentIfName = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate") if mibBuilder.loadTexts: wlanParentIfName.setStatus('current') wlanIfaceOperatingMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("ibss", 0), ("station", 1), ("wds", 2), ("adhocDemo", 3), ("hostAp", 4), ("monitor", 5), ("meshPoint", 6), ("tdma", 7))).clone('station')).setMaxAccess("readcreate") if mibBuilder.loadTexts: wlanIfaceOperatingMode.setStatus('current') wlanIfaceFlags = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 1, 1, 5), Bits().clone(namedValues=NamedValues(("uniqueBssid", 1), ("noBeacons", 2), ("wdsLegacy", 3)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: wlanIfaceFlags.setStatus('current') wlanIfaceBssid = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 1, 1, 6), MacAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: wlanIfaceBssid.setStatus('current') wlanIfaceLocalAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 1, 1, 7), MacAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: wlanIfaceLocalAddress.setStatus('current') wlanIfaceStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 1, 1, 8), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: wlanIfaceStatus.setStatus('current') wlanIfaceState = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: wlanIfaceState.setStatus('current') wlanIfParentTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 2), ) if mibBuilder.loadTexts: wlanIfParentTable.setStatus('current') wlanIfParentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 2, 1), ) wlanInterfaceEntry.registerAugmentions(("BEGEMOT-WIRELESS-MIB", "wlanIfParentEntry")) wlanIfParentEntry.setIndexNames(*wlanInterfaceEntry.getIndexNames()) if mibBuilder.loadTexts: wlanIfParentEntry.setStatus('current') wlanIfParentDriverCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 2, 1, 1), Bits().clone(namedValues=NamedValues(("station", 1), ("ieee8023encap", 2), ("athFastFrames", 3), ("athTurbo", 4), ("ibss", 5), ("pmgt", 6), ("hostAp", 7), ("ahDemo", 8), ("swRetry", 9), ("txPmgt", 10), ("shortSlot", 11), ("shortPreamble", 12), ("monitor", 13), ("dfs", 14), ("mbss", 15), ("wpa1", 16), ("wpa2", 17), ("burst", 18), ("wme", 19), ("wds", 20), ("bgScan", 21), ("txFrag", 22), ("tdma", 23)))).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfParentDriverCapabilities.setStatus('current') wlanIfParentCryptoCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 2, 1, 2), Bits().clone(namedValues=NamedValues(("wep", 1), ("tkip", 2), ("aes", 3), ("aesCcm", 4), ("tkipMic", 5), ("ckip", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfParentCryptoCapabilities.setStatus('current') wlanIfParentHTCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 2, 1, 3), Bits().clone(namedValues=NamedValues(("ldpc", 1), ("chwidth40", 2), ("greenField", 3), ("shortGi20", 4), ("shortGi40", 5), ("txStbc", 6), ("delba", 7), ("amsdu7935", 8), ("dssscck40", 9), ("psmp", 10), ("fortyMHzIntolerant", 11), ("lsigTxOpProt", 12), ("htcAmpdu", 13), ("htcAmsdu", 14), ("htcHt", 15), ("htcSmps", 16), ("htcRifs", 17)))).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfParentHTCapabilities.setStatus('current') wlanIfaceConfigTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3), ) if mibBuilder.loadTexts: wlanIfaceConfigTable.setStatus('current') wlanIfaceConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1), ) wlanInterfaceEntry.registerAugmentions(("BEGEMOT-WIRELESS-MIB", "wlanIfaceConfigEntry")) wlanIfaceConfigEntry.setIndexNames(*wlanInterfaceEntry.getIndexNames()) if mibBuilder.loadTexts: wlanIfaceConfigEntry.setStatus('current') wlanIfacePacketBurst = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 1), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfacePacketBurst.setStatus('current') wlanIfaceCountryCode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3, 3)).setFixedLength(3)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceCountryCode.setStatus('current') wlanIfaceRegDomain = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 3), WlanRegDomainCode()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceRegDomain.setStatus('current') wlanIfaceDesiredSsid = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDesiredSsid.setStatus('current') wlanIfaceDesiredChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDesiredChannel.setStatus('current') wlanIfaceDynamicFreqSelection = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 6), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDynamicFreqSelection.setStatus('current') wlanIfaceFastFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 7), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceFastFrames.setStatus('current') wlanIfaceDturbo = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 8), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDturbo.setStatus('current') wlanIfaceTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 9), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceTxPower.setStatus('current') wlanIfaceFragmentThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(256, 2346)).clone(2346)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceFragmentThreshold.setStatus('current') wlanIfaceRTSThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2346)).clone(2346)).setUnits('bytes').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceRTSThreshold.setStatus('current') wlanIfaceWlanPrivacySubscribe = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 12), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceWlanPrivacySubscribe.setStatus('current') wlanIfaceBgScan = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 13), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceBgScan.setStatus('current') wlanIfaceBgScanIdle = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 14), Integer32().clone(250)).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceBgScanIdle.setStatus('current') wlanIfaceBgScanInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 15), Integer32().clone(300)).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceBgScanInterval.setStatus('current') wlanIfaceBeaconMissedThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(7)).setUnits('frames').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceBeaconMissedThreshold.setStatus('current') wlanIfaceDesiredBssid = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 17), MacAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDesiredBssid.setStatus('current') wlanIfaceRoamingMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("device", 1), ("auto", 2), ("manual", 3))).clone('auto')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceRoamingMode.setStatus('current') wlanIfaceDot11d = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 19), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11d.setStatus('current') wlanIfaceDot11h = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 20), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11h.setStatus('current') wlanIfaceDynamicWds = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 21), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDynamicWds.setStatus('current') wlanIfacePowerSave = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 22), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfacePowerSave.setStatus('current') wlanIfaceApBridge = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 23), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceApBridge.setStatus('current') wlanIfaceBeaconInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 24), Integer32().subtype(subtypeSpec=ValueRangeConstraint(25, 1000)).clone(100)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceBeaconInterval.setStatus('current') wlanIfaceDtimPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 25), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 15)).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDtimPeriod.setStatus('current') wlanIfaceHideSsid = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 26), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceHideSsid.setStatus('current') wlanIfaceInactivityProccess = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 27), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceInactivityProccess.setStatus('current') wlanIfaceDot11gProtMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("cts", 2), ("rtscts", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11gProtMode.setStatus('current') wlanIfaceDot11gPureMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 29), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11gPureMode.setStatus('current') wlanIfaceDot11nPureMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 30), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nPureMode.setStatus('current') wlanIfaceDot11nAmpdu = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 31), WlanIfaceDot11nPduType().clone('txAndRx')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nAmpdu.setStatus('current') wlanIfaceDot11nAmpduDensity = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(25, 25), ValueRangeConstraint(50, 50), ValueRangeConstraint(100, 100), ValueRangeConstraint(200, 200), ValueRangeConstraint(400, 400), ValueRangeConstraint(800, 800), ValueRangeConstraint(1600, 1600), ))).setUnits('1/100ths-of-microsecond').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nAmpduDensity.setStatus('current') wlanIfaceDot11nAmpduLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(8192, 8192), ValueRangeConstraint(16384, 16384), ValueRangeConstraint(32768, 32768), ValueRangeConstraint(65536, 65536), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nAmpduLimit.setStatus('current') wlanIfaceDot11nAmsdu = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 34), WlanIfaceDot11nPduType().clone('rxOnly')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nAmsdu.setStatus('current') wlanIfaceDot11nAmsduLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(3839, 3839), ValueRangeConstraint(7935, 7935), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nAmsduLimit.setStatus('current') wlanIfaceDot11nHighThroughput = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 36), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nHighThroughput.setStatus('current') wlanIfaceDot11nHTCompatible = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 37), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nHTCompatible.setStatus('current') wlanIfaceDot11nHTProtMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 38), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("rts", 2))).clone('rts')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nHTProtMode.setStatus('current') wlanIfaceDot11nRIFS = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 39), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nRIFS.setStatus('current') wlanIfaceDot11nShortGI = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 40), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nShortGI.setStatus('current') wlanIfaceDot11nSMPSMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 41), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("static", 2), ("dynamic", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceDot11nSMPSMode.setStatus('current') wlanIfaceTdmaSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 42), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceTdmaSlot.setStatus('current') wlanIfaceTdmaSlotCount = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 43), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceTdmaSlotCount.setStatus('current') wlanIfaceTdmaSlotLength = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 44), Integer32().subtype(subtypeSpec=ValueRangeConstraint(150, 65000)).clone(10000)).setUnits('microseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceTdmaSlotLength.setStatus('current') wlanIfaceTdmaBeaconInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 3, 1, 45), Integer32().clone(5)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfaceTdmaBeaconInterval.setStatus('current') wlanIfacePeerTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4), ) if mibBuilder.loadTexts: wlanIfacePeerTable.setStatus('current') wlanIfacePeerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName"), (0, "BEGEMOT-WIRELESS-MIB", "wlanIfacePeerAddress")) if mibBuilder.loadTexts: wlanIfacePeerEntry.setStatus('current') wlanIfacePeerAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfacePeerAddress.setStatus('current') wlanIfacePeerAssociationId = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfacePeerAssociationId.setStatus('current') wlanIfacePeerVlanTag = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4096))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfacePeerVlanTag.setStatus('current') wlanIfacePeerFrequency = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfacePeerFrequency.setStatus('current') wlanIfacePeerCurrentTXRate = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfacePeerCurrentTXRate.setStatus('current') wlanIfacePeerRxSignalStrength = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfacePeerRxSignalStrength.setStatus('current') wlanIfacePeerIdleTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 7), Integer32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfacePeerIdleTimer.setStatus('current') wlanIfacePeerTxSequenceNo = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfacePeerTxSequenceNo.setStatus('current') wlanIfacePeerRxSequenceNo = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfacePeerRxSequenceNo.setStatus('current') wlanIfacePeerTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfacePeerTxPower.setStatus('current') wlanIfacePeerCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 11), WlanPeerCapabilityFlags()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfacePeerCapabilities.setStatus('current') wlanIfacePeerFlags = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 4, 1, 12), Bits().clone(namedValues=NamedValues(("authorizedForData", 1), ("qosEnabled", 2), ("erpEnabled", 3), ("powerSaveMode", 4), ("authRefHeld", 5), ("htEnabled", 6), ("htCompat", 7), ("wpsAssoc", 8), ("tsnAssoc", 9), ("ampduRx", 10), ("ampduTx", 11), ("mimoPowerSave", 12), ("sendRts", 13), ("rifs", 14), ("shortGiHT20", 15), ("shortGiHT40", 16), ("amsduRx", 17), ("amsduTx", 18)))).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfacePeerFlags.setStatus('current') wlanIfaceChannelTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5), ) if mibBuilder.loadTexts: wlanIfaceChannelTable.setStatus('current') wlanIfaceChannelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName"), (0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceChannelId")) if mibBuilder.loadTexts: wlanIfaceChannelEntry.setStatus('current') wlanIfaceChannelId = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1536))) if mibBuilder.loadTexts: wlanIfaceChannelId.setStatus('current') wlanIfaceChannelIeeeId = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 256))).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfaceChannelIeeeId.setStatus('current') wlanIfaceChannelType = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("fhss", 1), ("dot11a", 2), ("dot11b", 3), ("dot11g", 4), ("tenMHz", 5), ("fiveMHz", 6), ("turbo", 7), ("ht", 8)))).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfaceChannelType.setStatus('current') wlanIfaceChannelFlags = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1, 4), Bits().clone(namedValues=NamedValues(("turbo", 1), ("cck", 2), ("ofdm", 3), ("spectrum2Ghz", 4), ("spectrum5Ghz", 5), ("passiveScan", 6), ("dynamicCckOfdm", 7), ("gfsk", 8), ("spectrum900Mhz", 9), ("dot11aStaticTurbo", 10), ("halfRate", 11), ("quarterRate", 12), ("ht20", 13), ("ht40u", 14), ("ht40d", 15), ("dfs", 16), ("xmit4ms", 17), ("noAdhoc", 18), ("noHostAp", 19), ("dot11d", 20)))).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfaceChannelFlags.setStatus('current') wlanIfaceChannelFrequency = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfaceChannelFrequency.setStatus('current') wlanIfaceChannelMaxRegPower = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfaceChannelMaxRegPower.setStatus('current') wlanIfaceChannelMaxTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfaceChannelMaxTxPower.setStatus('current') wlanIfaceChannelMinTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfaceChannelMinTxPower.setStatus('current') wlanIfaceChannelState = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1, 9), Bits().clone(namedValues=NamedValues(("radar", 1), ("cacDone", 2), ("interferenceDetected", 3), ("radarClear", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfaceChannelState.setStatus('current') wlanIfaceChannelHTExtension = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfaceChannelHTExtension.setStatus('current') wlanIfaceChannelMaxAntennaGain = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 5, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfaceChannelMaxAntennaGain.setStatus('current') wlanScanConfigTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 1), ) if mibBuilder.loadTexts: wlanScanConfigTable.setStatus('current') wlanScanConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 1, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName")) if mibBuilder.loadTexts: wlanScanConfigEntry.setStatus('current') wlanScanFlags = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 1, 1, 1), Bits().clone(namedValues=NamedValues(("noSelection", 1), ("activeScan", 2), ("pickFirst", 3), ("backgroundScan", 4), ("once", 5), ("noBroadcast", 6), ("noAutoSequencing", 7), ("flushCashe", 8), ("chechCashe", 9)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanScanFlags.setStatus('current') wlanScanDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanScanDuration.setStatus('current') wlanScanMinChannelDwellTime = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 1, 1, 3), Integer32()).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanScanMinChannelDwellTime.setStatus('current') wlanScanMaxChannelDwellTime = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 1, 1, 4), Integer32()).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanScanMaxChannelDwellTime.setStatus('current') wlanScanConfigStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown", 0), ("notStarted", 1), ("running", 2), ("finished", 3), ("cancel", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanScanConfigStatus.setStatus('current') wlanScanResultsTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 2), ) if mibBuilder.loadTexts: wlanScanResultsTable.setStatus('current') wlanScanResultsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 2, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName"), (0, "BEGEMOT-WIRELESS-MIB", "wlanScanResultID"), (0, "BEGEMOT-WIRELESS-MIB", "wlanScanResultBssid")) if mibBuilder.loadTexts: wlanScanResultsEntry.setStatus('current') wlanScanResultID = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 2, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanScanResultID.setStatus('current') wlanScanResultBssid = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 2, 1, 2), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanScanResultBssid.setStatus('current') wlanScanResultChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanScanResultChannel.setStatus('current') wlanScanResultRate = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 2, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanScanResultRate.setStatus('current') wlanScanResultNoise = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 2, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanScanResultNoise.setStatus('current') wlanScanResultBeaconInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 2, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanScanResultBeaconInterval.setStatus('current') wlanScanResultCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 2, 2, 1, 7), WlanPeerCapabilityFlags()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanScanResultCapabilities.setStatus('current') wlanIfRoamParamsTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 6), ) if mibBuilder.loadTexts: wlanIfRoamParamsTable.setStatus('current') wlanIfRoamParamsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 6, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName"), (0, "BEGEMOT-WIRELESS-MIB", "wlanIfRoamPhyMode")) if mibBuilder.loadTexts: wlanIfRoamParamsEntry.setStatus('current') wlanIfRoamPhyMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 6, 1, 1), WlanIfPhyMode()) if mibBuilder.loadTexts: wlanIfRoamPhyMode.setStatus('current') wlanIfRoamRxSignalStrength = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 6, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfRoamRxSignalStrength.setStatus('current') wlanIfRoamTxRateThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 6, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanIfRoamTxRateThreshold.setStatus('current') wlanIfTxParamsTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 7), ) if mibBuilder.loadTexts: wlanIfTxParamsTable.setStatus('current') wlanIfTxParamsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 7, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName"), (0, "BEGEMOT-WIRELESS-MIB", "wlanIfTxPhyMode")) if mibBuilder.loadTexts: wlanIfTxParamsEntry.setStatus('current') wlanIfTxPhyMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 7, 1, 1), WlanIfPhyMode()) if mibBuilder.loadTexts: wlanIfTxPhyMode.setStatus('current') wlanIfTxUnicastRate = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 7, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfTxUnicastRate.setStatus('current') wlanIfTxMcastRate = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 7, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfTxMcastRate.setStatus('current') wlanIfTxMgmtRate = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 7, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfTxMgmtRate.setStatus('current') wlanIfTxMaxRetryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 1, 7, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanIfTxMaxRetryCount.setStatus('current') wlanIfaceStatisticsTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1), ) if mibBuilder.loadTexts: wlanIfaceStatisticsTable.setStatus('current') wlanIfaceStatisticsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1), ) wlanInterfaceEntry.registerAugmentions(("BEGEMOT-WIRELESS-MIB", "wlanIfaceStatisticsEntry")) wlanIfaceStatisticsEntry.setIndexNames(*wlanInterfaceEntry.getIndexNames()) if mibBuilder.loadTexts: wlanIfaceStatisticsEntry.setStatus('current') wlanStatsRxBadVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 1), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxBadVersion.setStatus('current') wlanStatsRxTooShort = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 2), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxTooShort.setStatus('current') wlanStatsRxWrongBssid = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 3), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxWrongBssid.setStatus('current') wlanStatsRxDiscardedDups = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 4), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDiscardedDups.setStatus('current') wlanStatsRxWrongDir = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 5), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxWrongDir.setStatus('current') wlanStatsRxDiscardMcastEcho = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 6), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDiscardMcastEcho.setStatus('current') wlanStatsRxDiscardNoAssoc = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 7), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDiscardNoAssoc.setStatus('current') wlanStatsRxWepNoPrivacy = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 8), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxWepNoPrivacy.setStatus('current') wlanStatsRxWepUnencrypted = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 9), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxWepUnencrypted.setStatus('current') wlanStatsRxWepFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 10), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxWepFailed.setStatus('current') wlanStatsRxDecapsulationFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 11), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDecapsulationFailed.setStatus('current') wlanStatsRxDiscardMgmt = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 12), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDiscardMgmt.setStatus('current') wlanStatsRxControl = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 13), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxControl.setStatus('current') wlanStatsRxBeacon = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 14), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxBeacon.setStatus('current') wlanStatsRxRateSetTooBig = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 15), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxRateSetTooBig.setStatus('current') wlanStatsRxElemMissing = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 16), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxElemMissing.setStatus('current') wlanStatsRxElemTooBig = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 17), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxElemTooBig.setStatus('current') wlanStatsRxElemTooSmall = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 18), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxElemTooSmall.setStatus('current') wlanStatsRxElemUnknown = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 19), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxElemUnknown.setStatus('current') wlanStatsRxChannelMismatch = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 20), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxChannelMismatch.setStatus('current') wlanStatsRxDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 21), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDropped.setStatus('current') wlanStatsRxSsidMismatch = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 22), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxSsidMismatch.setStatus('current') wlanStatsRxAuthNotSupported = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 23), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxAuthNotSupported.setStatus('current') wlanStatsRxAuthFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 24), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxAuthFailed.setStatus('current') wlanStatsRxAuthCM = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 25), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxAuthCM.setStatus('current') wlanStatsRxAssocWrongBssid = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 26), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxAssocWrongBssid.setStatus('current') wlanStatsRxAssocNoAuth = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 27), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxAssocNoAuth.setStatus('current') wlanStatsRxAssocCapMismatch = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 28), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxAssocCapMismatch.setStatus('current') wlanStatsRxAssocNoRateMatch = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 29), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxAssocNoRateMatch.setStatus('current') wlanStatsRxBadWpaIE = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 30), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxBadWpaIE.setStatus('current') wlanStatsRxDeauthenticate = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 31), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDeauthenticate.setStatus('current') wlanStatsRxDisassociate = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 32), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDisassociate.setStatus('current') wlanStatsRxUnknownSubtype = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 33), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxUnknownSubtype.setStatus('current') wlanStatsRxFailedNoBuf = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 34), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxFailedNoBuf.setStatus('current') wlanStatsRxBadAuthRequest = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 35), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxBadAuthRequest.setStatus('current') wlanStatsRxUnAuthorized = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 36), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxUnAuthorized.setStatus('current') wlanStatsRxBadKeyId = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 37), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxBadKeyId.setStatus('current') wlanStatsRxCCMPSeqViolation = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 38), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxCCMPSeqViolation.setStatus('current') wlanStatsRxCCMPBadFormat = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 39), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxCCMPBadFormat.setStatus('current') wlanStatsRxCCMPFailedMIC = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 40), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxCCMPFailedMIC.setStatus('current') wlanStatsRxTKIPSeqViolation = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 41), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxTKIPSeqViolation.setStatus('current') wlanStatsRxTKIPBadFormat = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 42), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxTKIPBadFormat.setStatus('current') wlanStatsRxTKIPFailedMIC = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 43), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxTKIPFailedMIC.setStatus('current') wlanStatsRxTKIPFailedICV = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 44), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxTKIPFailedICV.setStatus('current') wlanStatsRxDiscardACL = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 45), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDiscardACL.setStatus('current') wlanStatsTxFailedNoBuf = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 46), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxFailedNoBuf.setStatus('current') wlanStatsTxFailedNoNode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 47), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxFailedNoNode.setStatus('current') wlanStatsTxUnknownMgmt = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 48), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxUnknownMgmt.setStatus('current') wlanStatsTxBadCipher = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 49), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxBadCipher.setStatus('current') wlanStatsTxNoDefKey = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 50), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxNoDefKey.setStatus('current') wlanStatsTxFragmented = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 51), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxFragmented.setStatus('current') wlanStatsTxFragmentsCreated = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 52), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxFragmentsCreated.setStatus('current') wlanStatsActiveScans = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 53), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsActiveScans.setStatus('current') wlanStatsPassiveScans = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 54), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsPassiveScans.setStatus('current') wlanStatsTimeoutInactivity = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 55), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTimeoutInactivity.setStatus('current') wlanStatsCryptoNoMem = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 56), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsCryptoNoMem.setStatus('current') wlanStatsSwCryptoTKIP = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 57), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsSwCryptoTKIP.setStatus('current') wlanStatsSwCryptoTKIPEnMIC = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 58), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsSwCryptoTKIPEnMIC.setStatus('current') wlanStatsSwCryptoTKIPDeMIC = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 59), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsSwCryptoTKIPDeMIC.setStatus('current') wlanStatsCryptoTKIPCM = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 60), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsCryptoTKIPCM.setStatus('current') wlanStatsSwCryptoCCMP = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 61), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsSwCryptoCCMP.setStatus('current') wlanStatsSwCryptoWEP = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 62), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsSwCryptoWEP.setStatus('current') wlanStatsCryptoCipherKeyRejected = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 63), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsCryptoCipherKeyRejected.setStatus('current') wlanStatsCryptoNoKey = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 64), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsCryptoNoKey.setStatus('current') wlanStatsCryptoDeleteKeyFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 65), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsCryptoDeleteKeyFailed.setStatus('current') wlanStatsCryptoUnknownCipher = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 66), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsCryptoUnknownCipher.setStatus('current') wlanStatsCryptoAttachFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 67), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsCryptoAttachFailed.setStatus('current') wlanStatsCryptoKeyFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 68), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsCryptoKeyFailed.setStatus('current') wlanStatsCryptoEnMICFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 69), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsCryptoEnMICFailed.setStatus('current') wlanStatsIBSSCapMismatch = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 70), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsIBSSCapMismatch.setStatus('current') wlanStatsUnassocStaPSPoll = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 71), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsUnassocStaPSPoll.setStatus('current') wlanStatsBadAidPSPoll = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 72), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsBadAidPSPoll.setStatus('current') wlanStatsEmptyPSPoll = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 73), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsEmptyPSPoll.setStatus('current') wlanStatsRxFFBadHdr = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 74), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxFFBadHdr.setStatus('current') wlanStatsRxFFTooShort = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 75), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxFFTooShort.setStatus('current') wlanStatsRxFFSplitError = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 76), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxFFSplitError.setStatus('current') wlanStatsRxFFDecap = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 77), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxFFDecap.setStatus('current') wlanStatsTxFFEncap = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 78), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxFFEncap.setStatus('current') wlanStatsRxBadBintval = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 79), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxBadBintval.setStatus('current') wlanStatsRxDemicFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 80), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDemicFailed.setStatus('current') wlanStatsRxDefragFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 81), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDefragFailed.setStatus('current') wlanStatsRxMgmt = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 82), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxMgmt.setStatus('current') wlanStatsRxActionMgmt = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 83), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxActionMgmt.setStatus('current') wlanStatsRxAMSDUTooShort = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 84), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxAMSDUTooShort.setStatus('current') wlanStatsRxAMSDUSplitError = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 85), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxAMSDUSplitError.setStatus('current') wlanStatsRxAMSDUDecap = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 86), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxAMSDUDecap.setStatus('current') wlanStatsTxAMSDUEncap = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 87), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxAMSDUEncap.setStatus('current') wlanStatsAMPDUBadBAR = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 88), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDUBadBAR.setStatus('current') wlanStatsAMPDUOowBar = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 89), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDUOowBar.setStatus('current') wlanStatsAMPDUMovedBAR = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 90), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDUMovedBAR.setStatus('current') wlanStatsAMPDURxBAR = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 91), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDURxBAR.setStatus('current') wlanStatsAMPDURxOor = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 92), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDURxOor.setStatus('current') wlanStatsAMPDURxCopied = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 93), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDURxCopied.setStatus('current') wlanStatsAMPDURxDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 94), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDURxDropped.setStatus('current') wlanStatsTxDiscardBadState = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 95), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxDiscardBadState.setStatus('current') wlanStatsTxFailedNoAssoc = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 96), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxFailedNoAssoc.setStatus('current') wlanStatsTxClassifyFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 97), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxClassifyFailed.setStatus('current') wlanStatsDwdsMcastDiscard = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 98), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsDwdsMcastDiscard.setStatus('current') wlanStatsHTAssocRejectNoHT = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 99), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsHTAssocRejectNoHT.setStatus('current') wlanStatsHTAssocDowngrade = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 100), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsHTAssocDowngrade.setStatus('current') wlanStatsHTAssocRateMismatch = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 101), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsHTAssocRateMismatch.setStatus('current') wlanStatsAMPDURxAge = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 102), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDURxAge.setStatus('current') wlanStatsAMPDUMoved = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 103), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDUMoved.setStatus('current') wlanStatsADDBADisabledReject = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 104), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsADDBADisabledReject.setStatus('current') wlanStatsADDBANoRequest = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 105), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsADDBANoRequest.setStatus('current') wlanStatsADDBABadToken = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 106), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsADDBABadToken.setStatus('current') wlanStatsADDBABadPolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 107), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsADDBABadPolicy.setStatus('current') wlanStatsAMPDUStopped = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 108), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDUStopped.setStatus('current') wlanStatsAMPDUStopFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 109), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDUStopFailed.setStatus('current') wlanStatsAMPDURxReorder = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 110), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDURxReorder.setStatus('current') wlanStatsScansBackground = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 111), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsScansBackground.setStatus('current') wlanLastDeauthReason = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 112), WlanMgmtReasonCode()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanLastDeauthReason.setStatus('current') wlanLastDissasocReason = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 113), WlanMgmtReasonCode()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanLastDissasocReason.setStatus('current') wlanLastAuthFailReason = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 114), WlanMgmtReasonCode()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanLastAuthFailReason.setStatus('current') wlanStatsBeaconMissedEvents = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 115), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsBeaconMissedEvents.setStatus('current') wlanStatsRxDiscardBadStates = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 116), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsRxDiscardBadStates.setStatus('current') wlanStatsFFFlushed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 117), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsFFFlushed.setStatus('current') wlanStatsTxControlFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 118), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsTxControlFrames.setStatus('current') wlanStatsAMPDURexmt = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 119), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDURexmt.setStatus('current') wlanStatsAMPDURexmtFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 120), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanStatsAMPDURexmtFailed.setStatus('current') wlanStatsReset = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 3, 1, 1, 121), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no-op", 1), ("clear", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanStatsReset.setStatus('current') wlanWepInterfaceTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4, 1), ) if mibBuilder.loadTexts: wlanWepInterfaceTable.setStatus('current') wlanWepInterfaceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4, 1, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName")) if mibBuilder.loadTexts: wlanWepInterfaceEntry.setStatus('current') wlanWepMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("off", 0), ("on", 1), ("mixed", 2))).clone('off')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanWepMode.setStatus('current') wlanWepDefTxKey = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4, 1, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanWepDefTxKey.setStatus('current') wlanWepKeyTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4, 2), ) if mibBuilder.loadTexts: wlanWepKeyTable.setStatus('current') wlanWepKeyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4, 2, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName"), (0, "BEGEMOT-WIRELESS-MIB", "wlanWepKeyID")) if mibBuilder.loadTexts: wlanWepKeyEntry.setStatus('current') wlanWepKeyID = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanWepKeyID.setStatus('current') wlanWepKeyLength = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanWepKeyLength.setStatus('current') wlanWepKeySet = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4, 2, 1, 3), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanWepKeySet.setStatus('current') wlanWepKeyHash = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4, 2, 1, 4), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanWepKeyHash.setStatus('current') wlanWepKeyStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 4, 2, 1, 5), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanWepKeyStatus.setStatus('current') wlanMACAccessControlTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 5, 1), ) if mibBuilder.loadTexts: wlanMACAccessControlTable.setStatus('current') wlanMACAccessControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 5, 1, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName")) if mibBuilder.loadTexts: wlanMACAccessControlEntry.setStatus('current') wlanMACAccessControlPolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 5, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 7))).clone(namedValues=NamedValues(("open", 0), ("allow", 1), ("deny", 2), ("radius", 7))).clone('open')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMACAccessControlPolicy.setStatus('current') wlanMACAccessControlNacl = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 5, 1, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMACAccessControlNacl.setStatus('current') wlanMACAccessControlFlush = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 5, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("no-op", 0), ("flush", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMACAccessControlFlush.setStatus('current') wlanMACAccessControlMACTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 5, 2), ) if mibBuilder.loadTexts: wlanMACAccessControlMACTable.setStatus('current') wlanMACAccessControlMACEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 5, 2, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName"), (0, "BEGEMOT-WIRELESS-MIB", "wlanMACAccessControlMAC")) if mibBuilder.loadTexts: wlanMACAccessControlMACEntry.setStatus('current') wlanMACAccessControlMAC = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 5, 2, 1, 1), MacAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMACAccessControlMAC.setStatus('current') wlanMACAccessControlMACStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 5, 2, 1, 2), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMACAccessControlMACStatus.setStatus('current') wlanMeshRoutingConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 1)) wlanMeshInterface = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2)) wlanMeshRoute = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 3)) wlanMeshStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4)) wlanMeshRouteProtocols = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5)) wlanMeshMaxRetries = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 1, 1), Integer32().clone(2)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshMaxRetries.setStatus('current') wlanMeshConfirmTimeout = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 1, 2), Integer32().clone(40)).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshConfirmTimeout.setStatus('current') wlanMeshHoldingTimeout = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 1, 3), Integer32().clone(40)).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshHoldingTimeout.setStatus('current') wlanMeshRetryTimeout = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 1, 4), Integer32().clone(40)).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshRetryTimeout.setStatus('current') wlanMeshInterfaceTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 1), ) if mibBuilder.loadTexts: wlanMeshInterfaceTable.setStatus('current') wlanMeshInterfaceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 1, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName")) if mibBuilder.loadTexts: wlanMeshInterfaceEntry.setStatus('current') wlanMeshId = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 1, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshId.setStatus('current') wlanMeshTTL = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 1, 1, 2), Integer32().clone(31)).setUnits('hops').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshTTL.setStatus('current') wlanMeshPeeringEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 1, 1, 3), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshPeeringEnabled.setStatus('current') wlanMeshForwardingEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 1, 1, 4), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshForwardingEnabled.setStatus('current') wlanMeshMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("unknown", 0), ("airtime", 1))).clone('airtime')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshMetric.setStatus('current') wlanMeshPath = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("unknown", 0), ("hwmp", 1))).clone('hwmp')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshPath.setStatus('current') wlanMeshRoutesFlush = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("no-op", 0), ("flush", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshRoutesFlush.setStatus('current') wlanMeshNeighborTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2), ) if mibBuilder.loadTexts: wlanMeshNeighborTable.setStatus('current') wlanMeshNeighborEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName"), (0, "BEGEMOT-WIRELESS-MIB", "wlanMeshNeighborAddress")) if mibBuilder.loadTexts: wlanMeshNeighborEntry.setStatus('current') wlanMeshNeighborAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNeighborAddress.setStatus('current') wlanMeshNeighborFrequency = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNeighborFrequency.setStatus('current') wlanMeshNeighborLocalId = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNeighborLocalId.setStatus('current') wlanMeshNeighborPeerId = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNeighborPeerId.setStatus('current') wlanMeshNeighborPeerState = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("idle", 0), ("openTx", 1), ("openRx", 2), ("confirmRx", 3), ("established", 4), ("closing", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNeighborPeerState.setStatus('current') wlanMeshNeighborCurrentTXRate = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNeighborCurrentTXRate.setStatus('current') wlanMeshNeighborRxSignalStrength = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNeighborRxSignalStrength.setStatus('current') wlanMeshNeighborIdleTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2, 1, 8), Integer32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNeighborIdleTimer.setStatus('current') wlanMeshNeighborTxSequenceNo = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNeighborTxSequenceNo.setStatus('current') wlanMeshNeighborRxSequenceNo = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 2, 2, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNeighborRxSequenceNo.setStatus('current') wlanMeshRouteTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 3, 1), ) if mibBuilder.loadTexts: wlanMeshRouteTable.setStatus('current') wlanMeshRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 3, 1, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName"), (0, "BEGEMOT-WIRELESS-MIB", "wlanMeshRouteDestination")) if mibBuilder.loadTexts: wlanMeshRouteEntry.setStatus('current') wlanMeshRouteDestination = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 3, 1, 1, 1), MacAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: wlanMeshRouteDestination.setStatus('current') wlanMeshRouteNextHop = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 3, 1, 1, 2), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshRouteNextHop.setStatus('current') wlanMeshRouteHops = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 3, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshRouteHops.setStatus('current') wlanMeshRouteMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 3, 1, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshRouteMetric.setStatus('current') wlanMeshRouteLifeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 3, 1, 1, 5), Unsigned32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshRouteLifeTime.setStatus('current') wlanMeshRouteLastMseq = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 3, 1, 1, 6), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshRouteLastMseq.setStatus('current') wlanMeshRouteFlags = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 3, 1, 1, 7), Bits().clone(namedValues=NamedValues(("valid", 1), ("proxy", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshRouteFlags.setStatus('current') wlanMeshRouteStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 3, 1, 1, 8), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanMeshRouteStatus.setStatus('current') wlanMeshStatsTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1), ) if mibBuilder.loadTexts: wlanMeshStatsTable.setStatus('current') wlanMeshStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName")) if mibBuilder.loadTexts: wlanMeshStatsEntry.setStatus('current') wlanMeshDroppedBadSta = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1, 1), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshDroppedBadSta.setStatus('current') wlanMeshDroppedNoLink = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1, 2), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshDroppedNoLink.setStatus('current') wlanMeshNoFwdTtl = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1, 3), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNoFwdTtl.setStatus('current') wlanMeshNoFwdBuf = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1, 4), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNoFwdBuf.setStatus('current') wlanMeshNoFwdTooShort = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1, 5), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNoFwdTooShort.setStatus('current') wlanMeshNoFwdDisabled = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1, 6), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNoFwdDisabled.setStatus('current') wlanMeshNoFwdPathUnknown = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1, 7), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshNoFwdPathUnknown.setStatus('current') wlanMeshDroppedBadAE = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1, 8), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshDroppedBadAE.setStatus('current') wlanMeshRouteAddFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshRouteAddFailed.setStatus('current') wlanMeshDroppedNoProxy = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1, 10), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshDroppedNoProxy.setStatus('current') wlanMeshDroppedMisaligned = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 4, 1, 1, 11), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshDroppedMisaligned.setStatus('current') wlanMeshProtoHWMP = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1)) wlanMeshHWMPConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 1)) wlanMeshHWMPInterface = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 2)) wlanMeshHWMPStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 3)) wlanHWMPRouteInactiveTimeout = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 1, 1), Integer32().clone(5000)).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanHWMPRouteInactiveTimeout.setStatus('current') wlanHWMPRootAnnounceInterval = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 1, 2), Integer32().clone(1000)).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanHWMPRootAnnounceInterval.setStatus('current') wlanHWMPRootInterval = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 1, 3), Integer32().clone(2000)).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanHWMPRootInterval.setStatus('current') wlanHWMPRootTimeout = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 1, 4), Integer32().clone(5000)).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanHWMPRootTimeout.setStatus('current') wlanHWMPPathLifetime = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 1, 5), Integer32().clone(500)).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanHWMPPathLifetime.setStatus('current') wlanHWMPReplyForwardBit = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 1, 6), Integer32().clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanHWMPReplyForwardBit.setStatus('current') wlanHWMPTargetOnlyBit = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanHWMPTargetOnlyBit.setStatus('current') wlanHWMPInterfaceTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 2, 1), ) if mibBuilder.loadTexts: wlanHWMPInterfaceTable.setStatus('current') wlanHWMPInterfaceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 2, 1, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName")) if mibBuilder.loadTexts: wlanHWMPInterfaceEntry.setStatus('current') wlanHWMPRootMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("disabled", 1), ("normal", 2), ("proactive", 3), ("rann", 4))).clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanHWMPRootMode.setStatus('current') wlanHWMPMaxHops = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 2, 1, 1, 2), Integer32().clone(31)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wlanHWMPMaxHops.setStatus('current') wlanMeshHWMPStatsTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 3, 1), ) if mibBuilder.loadTexts: wlanMeshHWMPStatsTable.setStatus('current') wlanMeshHWMPStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 3, 1, 1), ).setIndexNames((0, "BEGEMOT-WIRELESS-MIB", "wlanIfaceName")) if mibBuilder.loadTexts: wlanMeshHWMPStatsEntry.setStatus('current') wlanMeshHWMPWrongSeqNo = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 3, 1, 1, 1), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshHWMPWrongSeqNo.setStatus('current') wlanMeshHWMPTxRootPREQ = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 3, 1, 1, 2), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshHWMPTxRootPREQ.setStatus('current') wlanMeshHWMPTxRootRANN = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 3, 1, 1, 3), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshHWMPTxRootRANN.setStatus('current') wlanMeshHWMPProxy = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 210, 6, 5, 1, 3, 1, 1, 4), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: wlanMeshHWMPProxy.setStatus('current') mibBuilder.exportSymbols("BEGEMOT-WIRELESS-MIB", wlanMeshNeighborRxSequenceNo=wlanMeshNeighborRxSequenceNo, wlanIfaceHideSsid=wlanIfaceHideSsid, wlanIfacePeerIdleTimer=wlanIfacePeerIdleTimer, wlanStatsRxBadVersion=wlanStatsRxBadVersion, wlanIfaceDot11nAmpdu=wlanIfaceDot11nAmpdu, wlanStatsRxRateSetTooBig=wlanStatsRxRateSetTooBig, wlanIfaceFastFrames=wlanIfaceFastFrames, wlanIfRoamParamsEntry=wlanIfRoamParamsEntry, wlanStatsRxActionMgmt=wlanStatsRxActionMgmt, wlanStatsRxDiscardNoAssoc=wlanStatsRxDiscardNoAssoc, wlanIfaceBgScanIdle=wlanIfaceBgScanIdle, wlanStatsRxFFDecap=wlanStatsRxFFDecap, wlanStatsRxUnknownSubtype=wlanStatsRxUnknownSubtype, wlanStatsScansBackground=wlanStatsScansBackground, wlanStatsRxFFBadHdr=wlanStatsRxFFBadHdr, wlanIfaceState=wlanIfaceState, wlanMACAccessControlMACTable=wlanMACAccessControlMACTable, wlanIfaceTdmaBeaconInterval=wlanIfaceTdmaBeaconInterval, wlanMeshNoFwdDisabled=wlanMeshNoFwdDisabled, wlanIfaceChannelMaxTxPower=wlanIfaceChannelMaxTxPower, wlanMeshRoutingConfig=wlanMeshRoutingConfig, wlanIfaceRegDomain=wlanIfaceRegDomain, WlanMgmtReasonCode=WlanMgmtReasonCode, wlanStatsRxDropped=wlanStatsRxDropped, wlanIfaceRoamingMode=wlanIfaceRoamingMode, wlanIfaceDot11gPureMode=wlanIfaceDot11gPureMode, wlanScanResultBeaconInterval=wlanScanResultBeaconInterval, wlanIfaceStatisticsEntry=wlanIfaceStatisticsEntry, WlanRegDomainCode=WlanRegDomainCode, wlanStatsTxFailedNoNode=wlanStatsTxFailedNoNode, wlanStatsRxElemTooSmall=wlanStatsRxElemTooSmall, begemotWlanScanning=begemotWlanScanning, wlanIfaceChannelHTExtension=wlanIfaceChannelHTExtension, wlanStatsRxBadWpaIE=wlanStatsRxBadWpaIE, wlanMeshPath=wlanMeshPath, wlanIfParentTable=wlanIfParentTable, wlanMACAccessControlTable=wlanMACAccessControlTable, wlanStatsRxAuthCM=wlanStatsRxAuthCM, wlanStatsSwCryptoWEP=wlanStatsSwCryptoWEP, wlanIfaceConfigEntry=wlanIfaceConfigEntry, wlanStatsAMPDURxDropped=wlanStatsAMPDURxDropped, wlanScanResultBssid=wlanScanResultBssid, wlanMeshDroppedNoLink=wlanMeshDroppedNoLink, wlanMeshHWMPInterface=wlanMeshHWMPInterface, wlanIfaceFragmentThreshold=wlanIfaceFragmentThreshold, wlanHWMPInterfaceEntry=wlanHWMPInterfaceEntry, wlanMeshNoFwdPathUnknown=wlanMeshNoFwdPathUnknown, wlanScanFlags=wlanScanFlags, wlanScanResultsTable=wlanScanResultsTable, wlanStatsRxDiscardACL=wlanStatsRxDiscardACL, wlanMeshProtoHWMP=wlanMeshProtoHWMP, wlanStatsTxUnknownMgmt=wlanStatsTxUnknownMgmt, wlanIfaceDot11nPureMode=wlanIfaceDot11nPureMode, wlanIfaceDynamicWds=wlanIfaceDynamicWds, wlanIfacePeerVlanTag=wlanIfacePeerVlanTag, wlanStatsRxFFTooShort=wlanStatsRxFFTooShort, wlanStatsRxDefragFailed=wlanStatsRxDefragFailed, wlanScanResultChannel=wlanScanResultChannel, wlanStatsRxMgmt=wlanStatsRxMgmt, wlanIfaceBgScanInterval=wlanIfaceBgScanInterval, wlanIfaceDot11gProtMode=wlanIfaceDot11gProtMode, wlanStatsSwCryptoTKIP=wlanStatsSwCryptoTKIP, wlanStatsRxTKIPFailedICV=wlanStatsRxTKIPFailedICV, wlanStatsCryptoKeyFailed=wlanStatsCryptoKeyFailed, wlanIfacePeerTxSequenceNo=wlanIfacePeerTxSequenceNo, begemotWlanNotifications=begemotWlanNotifications, wlanIfParentEntry=wlanIfParentEntry, wlanStatsAMPDUStopFailed=wlanStatsAMPDUStopFailed, wlanMeshMaxRetries=wlanMeshMaxRetries, wlanStatsAMPDUOowBar=wlanStatsAMPDUOowBar, wlanIfacePeerFlags=wlanIfacePeerFlags, wlanStatsRxElemMissing=wlanStatsRxElemMissing, begemotWlanMACAccessControl=begemotWlanMACAccessControl, wlanStatsAMPDURxReorder=wlanStatsAMPDURxReorder, wlanMeshNeighborLocalId=wlanMeshNeighborLocalId, wlanMeshNeighborCurrentTXRate=wlanMeshNeighborCurrentTXRate, wlanStatsTxNoDefKey=wlanStatsTxNoDefKey, wlanWepKeyID=wlanWepKeyID, wlanMeshRouteTable=wlanMeshRouteTable, wlanStatsRxTooShort=wlanStatsRxTooShort, wlanIfaceDot11d=wlanIfaceDot11d, begemotWlanInterface=begemotWlanInterface, begemotWlanMeshRouting=begemotWlanMeshRouting, wlanMACAccessControlFlush=wlanMACAccessControlFlush, wlanStatsAMPDURxCopied=wlanStatsAMPDURxCopied, wlanIfaceChannelFlags=wlanIfaceChannelFlags, wlanScanResultCapabilities=wlanScanResultCapabilities, WlanIfPhyMode=WlanIfPhyMode, wlanStatsRxDemicFailed=wlanStatsRxDemicFailed, wlanMACAccessControlMACStatus=wlanMACAccessControlMACStatus, wlanIfacePowerSave=wlanIfacePowerSave, wlanIfacePeerTable=wlanIfacePeerTable, wlanMeshRouteProtocols=wlanMeshRouteProtocols, wlanWepMode=wlanWepMode, wlanIfaceDesiredBssid=wlanIfaceDesiredBssid, wlanStatsRxAssocWrongBssid=wlanStatsRxAssocWrongBssid, wlanIfRoamPhyMode=wlanIfRoamPhyMode, wlanMeshNeighborFrequency=wlanMeshNeighborFrequency, wlanScanConfigTable=wlanScanConfigTable, wlanIfaceDot11nShortGI=wlanIfaceDot11nShortGI, wlanWepKeyLength=wlanWepKeyLength, wlanMeshDroppedMisaligned=wlanMeshDroppedMisaligned, wlanMeshHWMPTxRootRANN=wlanMeshHWMPTxRootRANN, wlanStatsRxAuthNotSupported=wlanStatsRxAuthNotSupported, wlanStatsRxElemUnknown=wlanStatsRxElemUnknown, wlanStatsRxAssocNoAuth=wlanStatsRxAssocNoAuth, wlanHWMPRootMode=wlanHWMPRootMode, wlanLastDeauthReason=wlanLastDeauthReason, wlanIfacePeerCurrentTXRate=wlanIfacePeerCurrentTXRate, wlanIfTxParamsEntry=wlanIfTxParamsEntry, wlanIfaceDot11nAmpduDensity=wlanIfaceDot11nAmpduDensity, wlanIfacePeerAssociationId=wlanIfacePeerAssociationId, wlanHWMPTargetOnlyBit=wlanHWMPTargetOnlyBit, wlanIfaceApBridge=wlanIfaceApBridge, wlanInterfaceTable=wlanInterfaceTable, wlanStatsEmptyPSPoll=wlanStatsEmptyPSPoll, wlanStatsADDBABadPolicy=wlanStatsADDBABadPolicy, wlanStatsRxDisassociate=wlanStatsRxDisassociate, WlanMgmtMeshReasonCode=WlanMgmtMeshReasonCode, begemotWlan=begemotWlan, wlanMeshRouteFlags=wlanMeshRouteFlags, wlanMeshStatistics=wlanMeshStatistics, wlanLastAuthFailReason=wlanLastAuthFailReason, wlanScanConfigStatus=wlanScanConfigStatus, wlanMeshDroppedBadSta=wlanMeshDroppedBadSta, wlanWepInterfaceTable=wlanWepInterfaceTable, wlanStatsRxDeauthenticate=wlanStatsRxDeauthenticate, WlanPeerCapabilityFlags=WlanPeerCapabilityFlags, wlanStatsIBSSCapMismatch=wlanStatsIBSSCapMismatch, wlanIfTxParamsTable=wlanIfTxParamsTable, wlanStatsHTAssocDowngrade=wlanStatsHTAssocDowngrade, wlanMeshStatsTable=wlanMeshStatsTable, wlanMeshRouteDestination=wlanMeshRouteDestination, wlanMeshHWMPProxy=wlanMeshHWMPProxy, wlanIfTxUnicastRate=wlanIfTxUnicastRate, wlanMeshNeighborEntry=wlanMeshNeighborEntry, wlanStatsCryptoNoKey=wlanStatsCryptoNoKey, wlanIfaceInactivityProccess=wlanIfaceInactivityProccess, wlanIfaceName=wlanIfaceName, wlanIfaceChannelMinTxPower=wlanIfaceChannelMinTxPower, wlanIfTxMcastRate=wlanIfTxMcastRate, wlanIfRoamRxSignalStrength=wlanIfRoamRxSignalStrength, wlanLastDissasocReason=wlanLastDissasocReason, wlanIfaceChannelType=wlanIfaceChannelType, wlanScanResultID=wlanScanResultID, wlanIfaceDot11nAmsduLimit=wlanIfaceDot11nAmsduLimit, wlanMeshMetric=wlanMeshMetric, wlanStatsRxDiscardMcastEcho=wlanStatsRxDiscardMcastEcho, wlanStatsRxWepUnencrypted=wlanStatsRxWepUnencrypted, wlanMeshForwardingEnabled=wlanMeshForwardingEnabled, wlanIfaceConfigTable=wlanIfaceConfigTable, begemotWlanWep=begemotWlanWep, wlanMeshNoFwdTtl=wlanMeshNoFwdTtl, wlanMeshNoFwdBuf=wlanMeshNoFwdBuf, wlanMACAccessControlMAC=wlanMACAccessControlMAC, wlanStatsADDBABadToken=wlanStatsADDBABadToken, wlanMeshPeeringEnabled=wlanMeshPeeringEnabled, wlanIfaceBssid=wlanIfaceBssid, wlanIfaceChannelIeeeId=wlanIfaceChannelIeeeId, wlanIfaceChannelMaxRegPower=wlanIfaceChannelMaxRegPower, wlanScanMinChannelDwellTime=wlanScanMinChannelDwellTime, wlanMeshHoldingTimeout=wlanMeshHoldingTimeout, wlanStatsCryptoEnMICFailed=wlanStatsCryptoEnMICFailed, wlanWepKeySet=wlanWepKeySet, wlanScanConfigEntry=wlanScanConfigEntry, wlanStatsHTAssocRejectNoHT=wlanStatsHTAssocRejectNoHT, wlanStatsRxAssocNoRateMatch=wlanStatsRxAssocNoRateMatch, wlanIfParentDriverCapabilities=wlanIfParentDriverCapabilities, wlanMeshHWMPStatsEntry=wlanMeshHWMPStatsEntry, wlanIfaceDynamicFreqSelection=wlanIfaceDynamicFreqSelection, begemotWlanStatistics=begemotWlanStatistics, wlanStatsAMPDUBadBAR=wlanStatsAMPDUBadBAR, wlanIfaceDot11h=wlanIfaceDot11h, wlanIfaceBeaconMissedThreshold=wlanIfaceBeaconMissedThreshold, wlanMeshTTL=wlanMeshTTL, wlanMeshInterfaceTable=wlanMeshInterfaceTable, wlanMeshConfirmTimeout=wlanMeshConfirmTimeout, wlanStatsTxFragmented=wlanStatsTxFragmented, wlanStatsTxDiscardBadState=wlanStatsTxDiscardBadState, wlanIfaceStatisticsTable=wlanIfaceStatisticsTable, wlanIfaceChannelTable=wlanIfaceChannelTable, wlanMeshHWMPStatsTable=wlanMeshHWMPStatsTable, wlanWepKeyHash=wlanWepKeyHash, wlanMACAccessControlPolicy=wlanMACAccessControlPolicy, wlanMeshHWMPTxRootPREQ=wlanMeshHWMPTxRootPREQ, wlanStatsTimeoutInactivity=wlanStatsTimeoutInactivity, wlanWepKeyEntry=wlanWepKeyEntry, wlanIfaceCountryCode=wlanIfaceCountryCode, wlanIfacePeerFrequency=wlanIfacePeerFrequency, wlanStatsRxAMSDUSplitError=wlanStatsRxAMSDUSplitError, wlanStatsRxAMSDUTooShort=wlanStatsRxAMSDUTooShort, wlanHWMPReplyForwardBit=wlanHWMPReplyForwardBit, wlanIfRoamParamsTable=wlanIfRoamParamsTable, wlanStatsTxClassifyFailed=wlanStatsTxClassifyFailed, wlanIfaceDesiredChannel=wlanIfaceDesiredChannel, wlanIfaceStatus=wlanIfaceStatus, wlanStatsRxWrongDir=wlanStatsRxWrongDir, wlanIfTxMgmtRate=wlanIfTxMgmtRate, wlanMeshHWMPWrongSeqNo=wlanMeshHWMPWrongSeqNo, wlanHWMPRootInterval=wlanHWMPRootInterval, wlanMeshDroppedBadAE=wlanMeshDroppedBadAE, wlanHWMPRootAnnounceInterval=wlanHWMPRootAnnounceInterval, wlanStatsTxFailedNoBuf=wlanStatsTxFailedNoBuf, wlanStatsRxAMSDUDecap=wlanStatsRxAMSDUDecap, wlanStatsTxFailedNoAssoc=wlanStatsTxFailedNoAssoc, wlanStatsHTAssocRateMismatch=wlanStatsHTAssocRateMismatch, wlanIfaceDturbo=wlanIfaceDturbo, wlanScanDuration=wlanScanDuration, wlanInterfaceEntry=wlanInterfaceEntry, wlanIfaceDot11nAmsdu=wlanIfaceDot11nAmsdu, wlanMeshRoute=wlanMeshRoute, wlanIfaceTxPower=wlanIfaceTxPower, wlanIfaceDtimPeriod=wlanIfaceDtimPeriod, wlanHWMPMaxHops=wlanHWMPMaxHops, wlanIfRoamTxRateThreshold=wlanIfRoamTxRateThreshold, wlanStatsReset=wlanStatsReset, wlanStatsCryptoDeleteKeyFailed=wlanStatsCryptoDeleteKeyFailed, wlanIfaceChannelId=wlanIfaceChannelId, wlanStatsRxWrongBssid=wlanStatsRxWrongBssid, wlanStatsTxAMSDUEncap=wlanStatsTxAMSDUEncap, wlanMeshRouteNextHop=wlanMeshRouteNextHop, wlanStatsRxControl=wlanStatsRxControl, wlanStatsCryptoNoMem=wlanStatsCryptoNoMem, wlanStatsSwCryptoCCMP=wlanStatsSwCryptoCCMP, wlanIfaceLocalAddress=wlanIfaceLocalAddress, wlanStatsRxUnAuthorized=wlanStatsRxUnAuthorized, wlanStatsSwCryptoTKIPEnMIC=wlanStatsSwCryptoTKIPEnMIC, wlanStatsRxElemTooBig=wlanStatsRxElemTooBig, wlanIfaceBeaconInterval=wlanIfaceBeaconInterval, wlanIfaceTdmaSlotCount=wlanIfaceTdmaSlotCount, wlanStatsDwdsMcastDiscard=wlanStatsDwdsMcastDiscard, wlanWepDefTxKey=wlanWepDefTxKey, wlanStatsTxBadCipher=wlanStatsTxBadCipher, wlanIfaceTdmaSlotLength=wlanIfaceTdmaSlotLength, wlanStatsAMPDURxAge=wlanStatsAMPDURxAge, wlanIfacePeerRxSignalStrength=wlanIfacePeerRxSignalStrength, wlanWepKeyTable=wlanWepKeyTable, wlanStatsCryptoCipherKeyRejected=wlanStatsCryptoCipherKeyRejected, wlanMeshNeighborPeerId=wlanMeshNeighborPeerId, wlanMeshRouteHops=wlanMeshRouteHops, wlanMeshRouteAddFailed=wlanMeshRouteAddFailed, wlanStatsRxTKIPFailedMIC=wlanStatsRxTKIPFailedMIC, wlanMeshRouteLifeTime=wlanMeshRouteLifeTime, wlanIfaceDot11nHTProtMode=wlanIfaceDot11nHTProtMode, wlanStatsCryptoAttachFailed=wlanStatsCryptoAttachFailed, wlanStatsFFFlushed=wlanStatsFFFlushed, wlanStatsRxAssocCapMismatch=wlanStatsRxAssocCapMismatch, wlanIfaceTdmaSlot=wlanIfaceTdmaSlot, wlanMeshRouteStatus=wlanMeshRouteStatus, wlanHWMPPathLifetime=wlanHWMPPathLifetime, wlanIfacePeerRxSequenceNo=wlanIfacePeerRxSequenceNo, wlanMeshNeighborRxSignalStrength=wlanMeshNeighborRxSignalStrength, WlanMgmtStatusCode=WlanMgmtStatusCode, wlanScanResultsEntry=wlanScanResultsEntry) mibBuilder.exportSymbols("BEGEMOT-WIRELESS-MIB", wlanMeshHWMPStatistics=wlanMeshHWMPStatistics, wlanStatsRxSsidMismatch=wlanStatsRxSsidMismatch, wlanHWMPRouteInactiveTimeout=wlanHWMPRouteInactiveTimeout, wlanStatsTxFFEncap=wlanStatsTxFFEncap, wlanIfaceChannelEntry=wlanIfaceChannelEntry, wlanStatsBeaconMissedEvents=wlanStatsBeaconMissedEvents, wlanStatsRxDecapsulationFailed=wlanStatsRxDecapsulationFailed, wlanMeshNoFwdTooShort=wlanMeshNoFwdTooShort, wlanMeshId=wlanMeshId, wlanStatsRxBadKeyId=wlanStatsRxBadKeyId, wlanStatsCryptoUnknownCipher=wlanStatsCryptoUnknownCipher, wlanMACAccessControlNacl=wlanMACAccessControlNacl, wlanIfaceChannelFrequency=wlanIfaceChannelFrequency, wlanIfacePeerEntry=wlanIfacePeerEntry, wlanIfaceDot11nSMPSMode=wlanIfaceDot11nSMPSMode, wlanMACAccessControlMACEntry=wlanMACAccessControlMACEntry, wlanStatsRxTKIPSeqViolation=wlanStatsRxTKIPSeqViolation, wlanStatsRxDiscardMgmt=wlanStatsRxDiscardMgmt, wlanStatsTxFragmentsCreated=wlanStatsTxFragmentsCreated, wlanIfTxPhyMode=wlanIfTxPhyMode, wlanStatsRxBeacon=wlanStatsRxBeacon, wlanIfacePacketBurst=wlanIfacePacketBurst, wlanStatsAMPDURexmt=wlanStatsAMPDURexmt, wlanHWMPRootTimeout=wlanHWMPRootTimeout, wlanStatsRxFFSplitError=wlanStatsRxFFSplitError, wlanMeshInterface=wlanMeshInterface, wlanMeshNeighborIdleTimer=wlanMeshNeighborIdleTimer, wlanIfParentHTCapabilities=wlanIfParentHTCapabilities, wlanStatsRxDiscardedDups=wlanStatsRxDiscardedDups, wlanMeshRouteMetric=wlanMeshRouteMetric, wlanStatsRxChannelMismatch=wlanStatsRxChannelMismatch, WlanIfaceDot11nPduType=WlanIfaceDot11nPduType, wlanStatsAMPDURxOor=wlanStatsAMPDURxOor, wlanMeshInterfaceEntry=wlanMeshInterfaceEntry, wlanStatsRxWepFailed=wlanStatsRxWepFailed, wlanStatsAMPDUMoved=wlanStatsAMPDUMoved, wlanMeshNeighborPeerState=wlanMeshNeighborPeerState, wlanIfTxMaxRetryCount=wlanIfTxMaxRetryCount, wlanMeshRetryTimeout=wlanMeshRetryTimeout, wlanIfaceDot11nAmpduLimit=wlanIfaceDot11nAmpduLimit, wlanStatsRxBadAuthRequest=wlanStatsRxBadAuthRequest, PYSNMP_MODULE_ID=begemotWlan, wlanIfParentCryptoCapabilities=wlanIfParentCryptoCapabilities, wlanMeshNeighborAddress=wlanMeshNeighborAddress, wlanIfaceFlags=wlanIfaceFlags, wlanIfaceChannelState=wlanIfaceChannelState, wlanStatsAMPDURxBAR=wlanStatsAMPDURxBAR, wlanStatsRxCCMPFailedMIC=wlanStatsRxCCMPFailedMIC, wlanHWMPInterfaceTable=wlanHWMPInterfaceTable, wlanIfaceDot11nHighThroughput=wlanIfaceDot11nHighThroughput, wlanIfaceDot11nHTCompatible=wlanIfaceDot11nHTCompatible, wlanStatsUnassocStaPSPoll=wlanStatsUnassocStaPSPoll, wlanStatsRxCCMPBadFormat=wlanStatsRxCCMPBadFormat, wlanIfaceDesiredSsid=wlanIfaceDesiredSsid, wlanIfacePeerAddress=wlanIfacePeerAddress, wlanStatsAMPDUStopped=wlanStatsAMPDUStopped, wlanStatsAMPDURexmtFailed=wlanStatsAMPDURexmtFailed, wlanStatsRxFailedNoBuf=wlanStatsRxFailedNoBuf, wlanIfaceOperatingMode=wlanIfaceOperatingMode, wlanIfacePeerCapabilities=wlanIfacePeerCapabilities, wlanScanMaxChannelDwellTime=wlanScanMaxChannelDwellTime, wlanStatsSwCryptoTKIPDeMIC=wlanStatsSwCryptoTKIPDeMIC, wlanStatsADDBADisabledReject=wlanStatsADDBADisabledReject, wlanIfaceRTSThreshold=wlanIfaceRTSThreshold, wlanStatsRxWepNoPrivacy=wlanStatsRxWepNoPrivacy, wlanStatsActiveScans=wlanStatsActiveScans, wlanIfaceBgScan=wlanIfaceBgScan, wlanStatsRxDiscardBadStates=wlanStatsRxDiscardBadStates, wlanWepInterfaceEntry=wlanWepInterfaceEntry, wlanMeshRouteEntry=wlanMeshRouteEntry, wlanStatsRxAuthFailed=wlanStatsRxAuthFailed, wlanScanResultNoise=wlanScanResultNoise, wlanParentIfName=wlanParentIfName, wlanStatsAMPDUMovedBAR=wlanStatsAMPDUMovedBAR, wlanStatsRxCCMPSeqViolation=wlanStatsRxCCMPSeqViolation, wlanIfaceDot11nRIFS=wlanIfaceDot11nRIFS, wlanMeshRouteLastMseq=wlanMeshRouteLastMseq, wlanStatsRxTKIPBadFormat=wlanStatsRxTKIPBadFormat, wlanMACAccessControlEntry=wlanMACAccessControlEntry, wlanMeshDroppedNoProxy=wlanMeshDroppedNoProxy, wlanWepKeyStatus=wlanWepKeyStatus, wlanMeshRoutesFlush=wlanMeshRoutesFlush, wlanIfacePeerTxPower=wlanIfacePeerTxPower, wlanStatsCryptoTKIPCM=wlanStatsCryptoTKIPCM, wlanIfaceWlanPrivacySubscribe=wlanIfaceWlanPrivacySubscribe, wlanScanResultRate=wlanScanResultRate, wlanStatsADDBANoRequest=wlanStatsADDBANoRequest, wlanIfaceChannelMaxAntennaGain=wlanIfaceChannelMaxAntennaGain, wlanStatsTxControlFrames=wlanStatsTxControlFrames, wlanMeshStatsEntry=wlanMeshStatsEntry, wlanStatsPassiveScans=wlanStatsPassiveScans, wlanMeshNeighborTable=wlanMeshNeighborTable, wlanStatsRxBadBintval=wlanStatsRxBadBintval, wlanMeshHWMPConfig=wlanMeshHWMPConfig, wlanMeshNeighborTxSequenceNo=wlanMeshNeighborTxSequenceNo, wlanIfaceIndex=wlanIfaceIndex, wlanStatsBadAidPSPoll=wlanStatsBadAidPSPoll)
epochs = 7 tau = 1.0 dropout = 0.2 validation_split = None batch_size = 32 lengthscale = 0.01
# MEDIUM # TLE if decrement divisor only # Bit manipulation. # input: 100 / 3 # times = 0 # 3 << 0 = 3 # 3 << 1 = 6 # 3 << 2 = 12 # 3 << 3 = 24 # 3 << 4 = 48 # 3 << 5 = 96 # 3 << 6 = 192 => greater than dividend 100 => stop here # times -=1 because 3 << 6 is too big # result += 1 << times => divided by 32 # set dividend to dividend -= divisor << times # times O(log N) Space O(1) class Solution: def divide(self, dividend: int, divisor: int) -> int: if dividend == -2**31 and divisor == -1: return 2**31-1 if dividend == 0: return 0 sign = dividend>=0 and divisor>=0 or (dividend<0 and divisor<0) left,right = abs(dividend),abs(divisor) result = 0 while left>= right: count = 0 while left >= right<< count: count += 1 #print('count',count) # count -1 because right * count > left result += 1 << (count-1) #print("result",result) left -= right << (count-1) #print("dividend",left) return result if sign else -result
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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. # # NOTE: This class is auto generated by the jdcloud code generator program. class ClusterListNode(object): def __init__(self, id=None, name=None, dataCenter=None, recordId=None, monitorResourceId=None, status=None, errorMessage=None, createTime=None, payType=None, duration=None, outerIp=None): """ :param id: (Optional) 集群ID :param name: (Optional) 集群名称 :param dataCenter: (Optional) 集群所属地域 :param recordId: (Optional) 集群ID :param monitorResourceId: (Optional) 监控ID :param status: (Optional) 集群状态 :param errorMessage: (Optional) 错误信息 :param createTime: (Optional) 集群创建时间 :param payType: (Optional) 集群收费类型 :param duration: (Optional) 集群运行时间 :param outerIp: (Optional) 公网Ip """ self.id = id self.name = name self.dataCenter = dataCenter self.recordId = recordId self.monitorResourceId = monitorResourceId self.status = status self.errorMessage = errorMessage self.createTime = createTime self.payType = payType self.duration = duration self.outerIp = outerIp
def parse_data(data, objects_format, separator=" "): """ Takes a list of strings and a list of objects format and returns a list of objects formatted according to the objects format. Example: parse_data(['forward 10', 'left 90', 'right 90'], [{'key': 'command, 'format': str}, {'key': 'value', 'format': int}], " ") => [{'command': 'forward', 'value': 10}, {'command': 'left', 'value': 90}, {'command': 'right', 'value': 90}] """ result = [] for line in data: line_result = {} for i, value in enumerate(line.split(separator)): line_result[objects_format[i]["key"]] = objects_format[i]["format"](value) result.append(line_result) return result
class Test: def __init__(self): self.prop1 = None raise Exception('Interrupt init') def __del__(self): print('instance deleted') print(self.prop1) class Test2(Test): pass Test2()
def compress_image(image, n_colors=64): """Compress an image Parameters ========== image : numpy array array of shape (height, width, 3) with integer values between 0 and 255 n_colors : integer the number of colors in the final compressed image (i.e. the number of KMeans clusters to fit). Returns ======= new_image : numpy array array representing the new image, compressed via KMeans clustering. It has the same shape and dtype as the input image, but contains only ``n_colors`` distinct colors. """ X = image.reshape(-1, 3) / 255. model = KMeans(n_colors) labels = model.fit_predict(X) colors = model.cluster_centers_ new_image = colors[labels].reshape(image.shape) return (255 * new_image).astype(np.uint8) new_image = compress_image(china, 64) plt.imshow(new_image);
def custom_filter(record): info = record.INFO support = info['SU'][0] paired_end_support = info['PE'][0] split_read_support = info['SR'][0] if support > 10 and paired_end_support > 5 and split_read_support > 5: yield record
def from_socket(node, socket): pass
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Blackbox Hardware Driver', 'version': '1.0', 'category': 'Hardware Drivers', 'sequence': 6, 'summary': 'Hardware Driver for Belgian Fiscal Data Modules', 'website': 'https://www.odoo.com/page/point-of-sale', 'description': """ Fiscal Data Module Hardware Driver ================================== This module allows a Point Of Sale client to communicate with a connected Belgian Fiscal Data Module. """, 'author': 'OpenERP SA', 'depends': ['hw_proxy'], 'external_dependencies': {'python': ['serial']}, 'test': [ ], 'installable': True, 'auto_install': False, }
""" ---> Longest Consecutive Sequence ---> Medium """ class Solution: def longestConsecutive(self, nums) -> int: nums = set(nums) ans = 0 for num in nums: if num - 1 not in nums: curr = num while curr in nums: ans = max(ans, curr - num + 1) curr = curr + 1 return ans in_nums = [0, 3, 7, 2, 5, 8, 4, 6, 0, 1] a = Solution() print(a.longestConsecutive(in_nums)) """ For every number that doesn't have a number smaller than it find how many numbers are there in continuation with it """
frase = str(input('Digite uma frase: ')).strip().upper() palavras = frase.split() junto = ''.join(palavras) print('\033[32mVocê digitou a frase:\033[m {}.'.format(frase)) print('\033[32mVocê digitou a frase:\033[m {}.'.format(palavras)) print('\033[32mVocê digitou a frase:\033[m {}.'.format(junto)) inverso = '' for letra in range(len(junto)-1, -1, -1): inverso +=junto[letra] print(junto) print(inverso) if junto == inverso: print('A frase é um PALINDROMO.') else: print(junto, inverso, 'Não é um PALINDROMO.')
def append_helper(initial_list, append_this): if type(initial_list) is not list: raise TypeError("initial_list must be a list") if type(append_this) == list: return initial_list + append_this else: initial_list.append(append_this) return initial_list
# # Solution to Project Euler problem 6 # Copyright (c) Süleyman Onur Dinçel. All rights reserved. # # https://github.com/onurdincel/Project-Euler-Solutions # """The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)^2 = 55^2 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 2640. Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.""" def calculate(): n = 0 n1=0 for i in range(101): n+=i**2 for i in range(101): n1+=i return str(n1**2-n) if __name__ == "__main__": print(calculate())
def imageF(): image = imread(r"E:\Python Working\png") if __name__ =="__main__": imageF()
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file will contain the webui endpoints for the web Application Too small so moved for now. """
# Time: O(n) # Space: O(1) # We have two integer sequences A and B of the same non-zero length. # # We are allowed to swap elements A[i] and B[i]. # Note that both elements are in the same index position in their respective sequences. # # At the end of some number of swaps, A and B are both strictly increasing. # (A sequence is strictly increasing if and only if A[0] < A[1] < A[2] < ... < A[A.length - 1].) # # Given A and B, return the minimum number of swaps to make both sequences strictly increasing. # It is guaranteed that the given input always makes it possible. # # Example: # Input: A = [1,3,5,4], B = [1,2,3,7] # Output: 1 # Explanation: # Swap A[3] and B[3]. Then the sequences are: # A = [1, 3, 5, 7] and B = [1, 2, 3, 4] # which are both strictly increasing. # # Note: # - A, B are arrays with the same length, and that length will be in the range [1, 1000]. # - A[i], B[i] are integer values in the range [0, 2000]. class Solution(object): def minSwap(self, A, B): """ :type A: List[int] :type B: List[int] :rtype: int """ dp_no_swap, dp_swap = [0]*2, [1]*2 for i in xrange(1, len(A)): dp_no_swap[i%2], dp_swap[i%2] = float("inf"), float("inf") if A[i-1] < A[i] and B[i-1] < B[i]: dp_no_swap[i%2] = min(dp_no_swap[i%2], dp_no_swap[(i-1)%2]) dp_swap[i%2] = min(dp_swap[i%2], dp_swap[(i-1)%2]+1) if A[i-1] < B[i] and B[i-1] < A[i]: dp_no_swap[i%2] = min(dp_no_swap[i%2], dp_swap[(i-1)%2]) dp_swap[i%2] = min(dp_swap[i%2], dp_no_swap[(i-1)%2]+1) return min(dp_no_swap[(len(A)-1)%2], dp_swap[(len(A)-1)%2])
class IGetCurrencies: def __init__(self, data): self.success = data.get('success') self.message = data.get('message', '') self.currencies_raw = data.get('currencies', {}) self.earbuds = Currency(self.currencies_raw.get('earbuds', {})) self.keys = Currency(self.currencies_raw.get('keys', {})) self.metal = Currency(self.currencies_raw.get('metal', {})) self.hat = Currency(self.currencies_raw.get('hat', {})) class Currency: def __init__(self, data): self.name = data.get('name') self.quality = data.get('quality') self.priceindex = data.get('priceindex') self.single = data.get('single') self.round = data.get('round') self.craftable = data.get('craftable') self.defindex = data.get('defindex') self.active = data.get('active') self.price_raw = data.get('price') self.value = self.price_raw.get('value')
def pytest_benchmark_scale_unit(config, unit, benchmarks, best, worst, sort): """ To have custom time scaling do something like this: .. sourcecode:: python def pytest_benchmark_scale_unit(config, unit, benchmarks, best, worst, sort): if unit == 'seconds': prefix = '' scale = 1.0 elif unit == 'operations': prefix = 'K' scale = 0.001 else: raise RuntimeError("Unexpected measurement unit %r" % unit) return prefix, scale """ pass def pytest_benchmark_generate_machine_info(config): """ To completely replace the generated machine_info do something like this: .. sourcecode:: python def pytest_benchmark_generate_machine_info(config): return {'user': getpass.getuser()} """ pass def pytest_benchmark_update_machine_info(config, machine_info): """ If benchmarks are compared and machine_info is different then warnings will be shown. To add the current user to the commit info override the hook in your conftest.py like this: .. sourcecode:: python def pytest_benchmark_update_machine_info(config, machine_info): machine_info['user'] = getpass.getuser() """ pass def pytest_benchmark_generate_commit_info(config): """ To completely replace the generated commit_info do something like this: .. sourcecode:: python def pytest_benchmark_generate_commit_info(config): return {'id': subprocess.check_output(['svnversion']).strip()} """ pass def pytest_benchmark_update_commit_info(config, commit_info): """ To add something into the commit_info, like the commit message do something like this: .. sourcecode:: python def pytest_benchmark_update_commit_info(config, commit_info): commit_info['message'] = subprocess.check_output(['git', 'log', '-1', '--pretty=%B']).strip() """ pass def pytest_benchmark_group_stats(config, benchmarks, group_by): """ You may perform grouping customization here, in case the builtin grouping doesn't suit you. Example: .. sourcecode:: python @pytest.mark.hookwrapper def pytest_benchmark_group_stats(config, benchmarks, group_by): outcome = yield if group_by == "special": # when you use --benchmark-group-by=special result = defaultdict(list) for bench in benchmarks: # `bench.special` doesn't exist, replace with whatever you need result[bench.special].append(bench) outcome.force_result(result.items()) """ pass def pytest_benchmark_generate_json(config, benchmarks, include_data, machine_info, commit_info): """ You should read pytest-benchmark's code if you really need to wholly customize the json. .. warning:: Improperly customizing this may cause breakage if ``--benchmark-compare`` or ``--benchmark-histogram`` are used. By default, ``pytest_benchmark_generate_json`` strips benchmarks that have errors from the output. To prevent this, implement the hook like this: .. sourcecode:: python @pytest.mark.hookwrapper def pytest_benchmark_generate_json(config, benchmarks, include_data, machine_info, commit_info): for bench in benchmarks: bench.has_error = False yield """ pass def pytest_benchmark_update_json(config, benchmarks, output_json): """ Use this to add custom fields in the output JSON. Example: .. sourcecode:: python def pytest_benchmark_update_json(config, benchmarks, output_json): output_json['foo'] = 'bar' """ pass def pytest_benchmark_compare_machine_info(config, benchmarksession, machine_info, compared_benchmark): """ You may want to use this hook to implement custom checks or abort execution. ``pytest-benchmark`` builtin hook does this: .. sourcecode:: python def pytest_benchmark_compare_machine_info(config, benchmarksession, machine_info, compared_benchmark): if compared_benchmark["machine_info"] != machine_info: benchmarksession.logger.warn( "Benchmark machine_info is different. Current: %s VS saved: %s." % ( format_dict(machine_info), format_dict(compared_benchmark["machine_info"]), ) ) """ pass pytest_benchmark_scale_unit.firstresult = True pytest_benchmark_generate_commit_info.firstresult = True pytest_benchmark_generate_json.firstresult = True pytest_benchmark_generate_machine_info.firstresult = True pytest_benchmark_group_stats.firstresult = True
class TestFile(): test = temp def temp_method(): print('temp_method')
""" Vulnerabilities are divided into 2 main categories. MITRE Category -------------- Vulnerability that correlates to a method in the official MITRE ATT&CK matrix for kubernetes CVE Category ------------- "General" category definition. The category is usually determined by the severity of the CVE """ class MITRECategory: @classmethod def get_name(cls): """ Returns the full name of MITRE technique: <MITRE CATEGORY> // <MITRE TECHNIQUE> Should only be used on a direct technique class at the end of the MITRE inheritance chain. Example inheritance: MITRECategory -> InitialAccessCategory -> ExposedSensitiveInterfacesTechnique """ inheritance_chain = cls.__mro__ if len(inheritance_chain) >= 4: # -3 == index of mitreCategory class. (object class is first) mitre_category_class = inheritance_chain[-3] return f"{mitre_category_class.name} // {cls.name}" class CVECategory: @classmethod def get_name(cls): """ Returns the full name of the category: CVE // <CVE Category name> """ return f"CVE // {cls.name}" """ MITRE ATT&CK Technique Categories """ class InitialAccessCategory(MITRECategory): name = "Initial Access" class ExecutionCategory(MITRECategory): name = "Execution" class PersistenceCategory(MITRECategory): name = "Persistence" class PrivilegeEscalationCategory(MITRECategory): name = "Privilege Escalation" class DefenseEvasionCategory(MITRECategory): name = "Defense Evasion" class CredentialAccessCategory(MITRECategory): name = "Credential Access" class DiscoveryCategory(MITRECategory): name = "Discovery" class LateralMovementCategory(MITRECategory): name = "Lateral Movement" class CollectionCategory(MITRECategory): name = "Collection" class ImpactCategory(MITRECategory): name = "Impact" """ MITRE ATT&CK Techniques """ class GeneralSensitiveInformationTechnique(InitialAccessCategory): name = "General Sensitive Information" class ExposedSensitiveInterfacesTechnique(InitialAccessCategory): name = "Exposed sensitive interfaces" class MountServicePrincipalTechnique(CredentialAccessCategory): name = "Mount service principal" class ListK8sSecretsTechnique(CredentialAccessCategory): name = "List K8S secrets" class AccessContainerServiceAccountTechnique(CredentialAccessCategory): name = "Access container service account" class AccessK8sApiServerTechnique(DiscoveryCategory): name = "Access the K8S API Server" class AccessKubeletAPITechnique(DiscoveryCategory): name = "Access Kubelet API" class AccessK8sDashboardTechnique(DiscoveryCategory): name = "Access Kubernetes Dashboard" class InstanceMetadataApiTechnique(DiscoveryCategory): name = "Instance Metadata API" class ExecIntoContainerTechnique(ExecutionCategory): name = "Exec into container" class SidecarInjectionTechnique(ExecutionCategory): name = "Sidecar injection" class NewContainerTechnique(ExecutionCategory): name = "New container" class GeneralPersistenceTechnique(PersistenceCategory): name = "General Peristence" class HostPathMountPrivilegeEscalationTechnique(PrivilegeEscalationCategory): name = "hostPath mount" class PrivilegedContainerTechnique(PrivilegeEscalationCategory): name = "Privileged container" class ClusterAdminBindingTechnique(PrivilegeEscalationCategory): name = "Cluser-admin binding" class ARPPoisoningTechnique(LateralMovementCategory): name = "ARP poisoning and IP spoofing" class CoreDNSPoisoningTechnique(LateralMovementCategory): name = "CoreDNS poisoning" class DataDestructionTechnique(ImpactCategory): name = "Data Destruction" class GeneralDefenseEvasionTechnique(DefenseEvasionCategory): name = "General Defense Evasion" class ConnectFromProxyServerTechnique(DefenseEvasionCategory): name = "Connect from Proxy server" """ CVE Categories """ class CVERemoteCodeExecutionCategory(CVECategory): name = "Remote Code Execution (CVE)" class CVEPrivilegeEscalationCategory(CVECategory): name = "Privilege Escalation (CVE)" class CVEDenialOfServiceTechnique(CVECategory): name = "Denial Of Service (CVE)"
WORKER_THREAD = 'thread' WORKER_GREENLET = 'greenlet' WORKER_PROCESS = 'process' WORKER_TYPES = (WORKER_THREAD, WORKER_GREENLET, WORKER_PROCESS) class EmptyData(object): pass
description = 'RESI NICOS startup setup' group = 'basic' includes = ['system'] #, 'lakeshore', 'cascade', 'detector'] modules = ['nicos_mlz.resi.scan'] devices = dict( resi = device('nicos_mlz.resi.devices.residevice.ResiDevice', description = 'main RESI device', unit = 'special', ), theta = device('nicos_mlz.resi.devices.residevice.ResiVAxis', description = 'theta axis', basedevice = 'resi', mapped_axis = 'theta', unit = 'degree', ), omega = device('nicos_mlz.resi.devices.residevice.ResiVAxis', description = 'omega axis', basedevice = 'resi', mapped_axis = 'omega', unit = 'degree', ), phi = device('nicos_mlz.resi.devices.residevice.ResiVAxis', description = 'phi axis', basedevice = 'resi', mapped_axis = 'phi', unit = 'degree', ), chi = device('nicos_mlz.resi.devices.residevice.ResiVAxis', description = 'chi axis', basedevice = 'resi', mapped_axis = 'chi', unit = 'degree', ), Sample = device('nicos_mlz.resi.devices.residevice.ResiSample', description = 'currently used sample', basedevice = 'resi', ), ) startupcode = ''' hw = resi._hardware '''
def translate(phrase): translation = "" for letter in phrase: if letter in "AEIOUaeiou": if letter.isupper(): translation = translation + "M" else: translation = translation + "m" else: translation = translation + letter return translation print(translate(input("Enter a phrase: ")))
class Quote(object): def __init__(self, root, **kwargs): self._data = kwargs self._root = root def __getattr__(self, item): return self._data.get(item, None) def to_primitive(self): return self._data @staticmethod def from_primitive(root, primitive): if primitive['type'] == 'root_gadgets': return GadgetQuote(root, **primitive) if primitive['type'] == 'root_funeral': return GadgetQuote(root, **primitive) if primitive['type'] == 'root_term': return GadgetQuote(root, **primitive) def get_quote(self): response = self._root.post('quote', **self.to_primitive()) # TODO: add some error checking print("Response [%s] - %s" % (response.status_code, response.text)) if response.status_code != 200: raise AttributeError("Invalid Quote") return [QuotePackage(self._root, **x) for x in response.json()] class GadgetQuote(Quote): def __init__(self, root, model_name=None, make=None, model=None, type='root_gadgets'): opts = { 'type': type, 'model_name': model_name, 'make': make, 'model': model, } super(GadgetQuote, self).__init__(root, **opts) def set_requirements(self, serial_number): return {'serial_number': serial_number} class FuneralQuote(Quote): def __init__(self, root, cover_amount, has_spouse, number_of_children, extended_family_ages, type='root_funeral'): opts = { 'type': type, 'cover_amount': cover_amount, 'has_spouse': has_spouse, 'number_of_children': number_of_children, 'extended_family_ages': extended_family_ages } super(FuneralQuote, self).__init__(root, **opts) def set_requirements(self, spouse_id=None, children_ids=None, extended_family_ids=None): return {'spouse_id': spouse_id, 'children_ids': children_ids, 'extended_family_ids': extended_family_ids} class TermQuote(Quote): DURATION_1_YEAR = '1_year' DURATION_2_YEAR = '2_years' DURATION_5_YEAR = '5_years' DURATION_10_YEAR = '10_years' DURATION_15_YEAR = '15_years' DURATION_20_YEAR = '20_years' DURATION_LIFE = 'whole_life' GENDER_MALE = 'male' GENDER_FEMALE = 'female' EDUCATION_NO_MATRIC = 'grade_12_no_matric' EDUCATION_MATRIC = 'grade_12_matric' EDUCATION_DIPLOMA = 'diploma_or_btech' EDUCATION_UNDERGRADUATE = 'undergraduate_degree' EDUCATION_PROFESSIONAL = 'professional_degree' def __init__(self, root, cover_amount, cover_period, basic_income_per_month, education_status, smoker, gender, age, type='root_term'): opts = { 'type': type, 'cover_amount': cover_amount, 'cover_period': cover_period, 'basic_income_per_month': basic_income_per_month, 'education_status': education_status, 'smoker': smoker, 'gender': gender, 'age': age } super(TermQuote, self).__init__(root, **opts) def set_requirements(self): return {} class QuotePackage(object): def __init__(self, root, **primitive): self._root = root self._v = primitive self._application = {} def __getitem__(self, item): return self._v.get(item, None) def __getattr__(self, item): if item == "module": return Quote.from_primitive(self._root, self._v[item]) return self._v.get(item, None) def set_requirements(self, **kwargs): self._application = self.module.set_requirements(**kwargs) def get_requirements(self): return self._application
DEBUG = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', } } INSTALLED_APPS = [ 'django_nose', 'tests.testapp', ] ROOT_URLCONF = 'tests.urls' SECRET_KEY = "shh...it's a seakret" CACHES = { 'default': { 'BACKEND': 'redis_cache.RedisCache', 'LOCATION': '127.0.0.1:6381', 'OPTIONS': { 'DB': 15, 'PASSWORD': 'yadayada', 'PARSER_CLASS': 'redis.connection.HiredisParser', 'PICKLE_VERSION': 2, 'CONNECTION_POOL_CLASS': 'redis.ConnectionPool', 'CONNECTION_POOL_CLASS_KWARGS': { 'max_connections': 2, } }, }, } TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' MIDDLEWARE_CLASSES = tuple()
# Example test module for nose # run with: nosetests -v # or: nosetests -s # Simple test functions first: def test_ok(): print("test_ok") # def fail_test(): # print "fail_test: will always fail" # assert False # Private functions are however not recognized: def _test_notseen(): print("_test_notseen") assert False def _notseen_test(): print("_notseen_test") assert False # The following is reported as an ERROR (should have zero params): # def test_notreally(something): # assert False # test generators def test_evens(): for i in range(0, 5, 2): yield check_even, i def check_even(n): assert n % 2 == 0 # test with setup, teardown methods def setup_func(): "set up test fixtures" def teardown_func(): "tear down test fixtures" def test_with_setup(): "test ... " test_with_setup.setup = setup_func test_with_setup.teardown = teardown_func # or use decorator: @with_setup(setup_func, teardown_func) # requires: from nose import with_setup # module-level setup and teardown: def setup_module(module): print("") # this is to get a newline after the dots print("setup_module before anything in this file") def teardown_module(module): print("teardown_module after everything in this file") # test class class TestA: def setup(self): print("TestA:setup() before each test method") def teardown(self): print("TestA:teardown() after each test method") @classmethod def setup_class(cls): print("setup_class() before any methods in this class") @classmethod def teardown_class(cls): print("teardown_class() after any methods in this class") def test_numbers_5_6(self): print("test_numbers_5_6()") assert 5 * 6 == 30 def test_strings_b_2(self): print("test_strings_b_2()") assert "b" * 2 == "bb" # Optional API for cleaner output: # from nose.tools import assert_equal # from nose.tools import assert_not_equal # from nose.tools import assert_raises # from nose.tools import raises # Nose finds and runs unittests with no problem, and with no extra steps. # Nose can run doctests
#!/usr/bin/env python3 num = int(input()) if num % 3 == 0 and num % 5 == 0: print('fizzbuzz') elif num % 3 == 0: print("fizz") elif num % 5 == 0: print("buzz") else: print('you are wrong kiddo') # the point of fizzbuzz is to see if a number is divisible by 3 and 5, or just one, or neither. # for more info check out https://blog.codinghorror.com/why-cant-programmers-program/
class BuildError(Exception): def __init__(self, message: str): super().__init__(message) class MissedRequiredParamError(BuildError): def __init__(self, param_name: str): message = f'Required param "{param_name}" is missed' super().__init__(message) class FunctionNotExistError(BuildError): def __init__(self, function_name: str): message = f'Function "{function_name}" does not exist' super().__init__(message) class MissedItemError(BuildError): def __init__(self, item: str): message = f'Item "{item}" is missed. ' \ f'Check if function_path correct.' super().__init__(message) class UnsupportedDBDialectError(BuildError): def __init__(self, dialect: str): message = f'Dialect "{dialect}" is not supported. ' \ f'See SUPPORTED_DIALECTS.' super().__init__(message) class UnsupportedDBDriverError(BuildError): def __init__(self, driver_name: str): message = f'Driver "{driver_name}" is not supported. ' \ f'See SUPPORTED_DB_DRIVERS.' super().__init__(message) class WrongDriverForDialectError(BuildError): def __init__(self, driver_name: str, dialect: str): message = f'Driver "{driver_name}" ' \ f'cannot be used with {dialect}. ' \ f'See SUPPORTED_DB_DRIVERS.' super().__init__(message) class InvalidConfigError(BuildError): def __init__(self, config_path: str): message = f'Config path is invalid. ' \ f'"{config_path}" is incorrect value.' super().__init__(message)
def func(arg, opt=1, *args, **kwargs): print(arg, opt, args, kwargs) func(0) func(0, 10) func(0, 10, 20) func(0, 10, 20, 30) func(0, 10, 20, 30, key='value') func(0, 10, 20, 30, key='value', key2='v2')
# class definition class MyClass: pass # The __init__() Method # attributes # methods class People: def __init__(self, name, age): self.__name = name self.__age = age def sayhi(self): print("Hi, my name is %s, and I'm %s" % (self.__name, self.__age)) def get_age(self): return self.__age def set_age(self, num): if isinstance(num, int): if num > 0: self.__age = num return print('format error') # class instance someone = People(name='Jack', age=20) print(someone.get_age()) someone.set_age(num='ab') print(someone.get_age())
print('Opening dummy.txt') #open dummy.txt to read it as "in_stream" (in_stream is the variable) with open('dummy.txt', 'r') as in_stream: print('Opening output.txt') #open output.txt to write in it, call it "out_stream" with open('output.txt', 'w') as out_stream: #for every line in the dummy.txt input file #enumerate will keep it going line-by-line, but will return an index of the line called as well for line_index, line in enumerate(in_stream): #call the strip method on each line. This will remove whitespace at the end of each line. line = line.strip() #call the split method on each line. This splits the string into a list, where each word is one element in the list. word_list = line.split() #call the sort method on the list from the previous line. word_list.sort() #for every element of the word list, write it out to out_stream for word in word_list: out_stream.write('{0}\t{1}\n'.format(line_index, word)) print("Done!") print('dummy.txt is closed?', in_stream.closed) print('output.txt is clsoed?', out_stream.closed)
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ This module defines input/output functions. Text ---- .. automodule:: tunacell.io.text :members: Sniff ----- .. automodule:: tunacell.io.sniff :members: HDF5 ---- .. automodule:: tunacell.io.h5 :members: """
count = int(input()) numbers_list = [] for _x in range(count): numbers_list.append(int(input())) sum_numbers = 0 count_numbers = len(numbers_list) for x in numbers_list: sum_numbers += x mean = sum_numbers / count_numbers print(mean)
#! /usr/bin/env python3 AsciiBinFmt, AsciiGrayFmt, AsciiPixelFmt = range(1, 4) BinBinFmt, BinGrayFmt, BinPixelFmt = range(4, 7) ext = ["", "pbm", "pgm", "ppm", "pbm", "pgm", "ppm"] def isBinFmt(fmt): return fmt % 3 == 1 def isGrayFmt(fmt): return fmt % 3 == 2 def isPixelFmt(fmt): return fmt % 3 == 0 class Gen(): def __init__(self, width, height, fmt, maxval=255): self.width = width self.height = height self.fmt = fmt self.maxval = 1 if isBinFmt(fmt) else maxval def gen(self, x, y): wid = 1 xx, yy = x // wid, y // wid v = (xx + yy) % 2 # print (x, y, xx, yy, v) if v == 1: v = self.maxval return '%3d' % (v) def PPMHeader(width, height, fmt=AsciiPixelFmt, maxval=255): s = "P%d\n" % (fmt) s += "%d %d\n" % (width, height) if not isBinFmt(fmt): s += "%d\n" % (maxval) return s def main(w, h, fmt, GEN): g = GEN(w, h, fmt) with open("test." + ext[fmt], "w") as fp: print("width: %d height: %d fmt: %d" % (w, h, fmt)) fp.write(PPMHeader(w, h, fmt)) for i in range(h): for j in range(w): fp.write(" %s" % (g.gen(j, i))) fp.write("\n") if __name__ == "__main__": v = 64 w, h = v, v fmt = AsciiBinFmt main(w, h, fmt, Gen)
''' The function has been made even more general by parameterizing the size of one sub box. ''' def drawBox(length, cellSize): for i in range(length): printBoxLines(length, cellSize, "*", "---", 1) printBoxLines(length, cellSize, "|", " ", cellSize) printBoxLines(length, cellSize, "*", "---", 1) def printBoxLines(length, cellSize, char1, char2, n): for i in range(n): print((char1 + (char2 * cellSize)) * length + char1) drawBox(10, 1)
GRID_SIZE = 5 # Bingo numbers and grids. def get_b_and_g(lines): bingo_numbers = [] grids = [] is_first = True for line in lines: if is_first: bingo_numbers = [int(s) for s in line.split(",") if s.isdigit()] is_first = False continue if line == "": grids.append([]) else: grids[-1].extend([int(s) for s in line.split(" ") if s.isdigit()]) return (bingo_numbers, grids) # (win_order, win_numbers) def play_data(bingo_numbers, grids): grid_win_order = [] grid_win_numbers = [-1] * len(grids) # If a number is 5, It's a win. grid_rows = [[0] * GRID_SIZE for grid in grids] grid_cols = [[0] * GRID_SIZE for grid in grids] # I hate Python. # [[0] * 5] * 5 != [[0] * 5 for i in range(5)] for number in bingo_numbers: for gi, grid in enumerate(grids): if grid_win_numbers[gi] != -1: continue y = -1 for ci, cell in enumerate(grid): if ci % GRID_SIZE == 0: y += 1 if cell == number: x = ci - y * GRID_SIZE grid_rows[gi][x] += 1 grid_cols[gi][y] += 1 if grid_rows[gi][x] == GRID_SIZE \ or grid_cols[gi][y] == GRID_SIZE: grid_win_numbers[gi] = number grid_win_order.append(gi) break return (grid_win_order, grid_win_numbers) def part1(): with open("day04.input") as file: lines = file.read().split("\n") if lines[-1] == "": lines.pop() bingo_numbers, grids = get_b_and_g(lines) grid_win_order, grid_win_numbers = play_data(bingo_numbers, grids) # Print the first winner and the score. win_number = grid_win_numbers[grid_win_order[0]] win_bingo_numbers = bingo_numbers[:bingo_numbers.index(win_number) + 1] unmarked_sum = 0 for cell in grids[grid_win_order[0]]: if cell not in win_bingo_numbers: unmarked_sum += cell score = unmarked_sum * win_number print(f"[First board]") print(f"Board: {grid_win_order[0] + 1}") print(f"Score: {score}") def part2(): with open("day04.input") as file: lines = file.read().split("\n") if lines[-1] == "": lines.pop() bingo_numbers, grids = get_b_and_g(lines) grid_win_order, grid_win_numbers = play_data(bingo_numbers, grids) # Print the last winner and the score. win_number = grid_win_numbers[grid_win_order[-1]] win_bingo_numbers = bingo_numbers[:bingo_numbers.index(win_number) + 1] unmarked_sum = 0 for cell in grids[grid_win_order[-1]]: if cell not in win_bingo_numbers: unmarked_sum += cell score = unmarked_sum * win_number print(f"[Last board]") print(f"Board: {grid_win_order[-1] + 1}") print(f"Score: {score}") part1() part2()
# Even Fibonacci numbers # Each new term in the Fibonacci sequence is generated # by adding the previous two terms. By starting with # 1 and 2, the first 10 terms will be: # # 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... # # By considering the terms in the Fibonacci sequence # whose values do not exceed four million, find the sum # of the even-valued terms. # # This requires efficient Fibonacci generation: the classical # recursive solution of fib(n) = fib(n-1) + fib(n-2) will grow # at O(2^n) (or more precisely, O(fib(n)) complexity). # # We see that the other basic solution of simply iteratively # adding numbers will work. UPPER_BOUND = 4000000 def run(): even_fib_sum = 0 fib_last = 1 fib_current = 1 # Loop until fibonacci numbers get too large # Fibonacci computed iteratively while fib_current <= UPPER_BOUND: if fib_current % 2 == 0: even_fib_sum += fib_current fib_new = fib_last + fib_current fib_last = fib_current fib_current = fib_new print("The sum of even-valued fibonacci numbers not exceeding {0} is {1}".format(UPPER_BOUND, even_fib_sum)) # Sample Output: # The sum of even-valued fibonacci numbers not exceeding 4000000 is 4613732 # # Total running time for Problem2.py is 0.0001370123105817635 seconds
""" Lab 05: Mutable Sequences and Trees """ # Q1 def acorn_finder(t): """Returns True if t contains a node with the value 'acorn' and False otherwise. >>> scrat = tree('acorn') >>> acorn_finder(scrat) True >>> sproul = tree('roots', [tree('branch1', [tree('leaf'), tree('acorn')]), tree('branch2')]) >>> acorn_finder(sproul) True >>> numbers = tree(1, [tree(2), tree(3, [tree(4), tree(5)]), tree(6, [tree(7)])]) >>> acorn_finder(numbers) False """ if label(t)=='acorn': return True/Users/kk/Desktop/cs61a/lab05/lab05.py branch_list = [acorn_finder(b) for b in branches(t)] if True in branch_list: return True else: return False # Q2 def prune_leaves(t, vals): """Return a modified copy of t with all leaves that have a label that appears in vals removed. Return None if the entire tree is pruned away. >>> t = tree(2) >>> print(prune_leaves(t, (1, 2))) None >>> numbers = tree(1, [tree(2), tree(3, [tree(4), tree(5)]), tree(6, [tree(7)])]) >>> print_tree(numbers) 1 2 3 4 5 6 7 >>> print_tree(prune_leaves(numbers, (3, 4, 6, 7))) 1 2 3 5 6 """ #if it is a leaf and the label is in vals: return none #else: return the label() if is_leaf(t) and label(t) in vals: return None return tree(label(t),[prune_leaves(b,vals) for b in branches(t) if prune_leaves(b,vals)]) # else: # return None # return tree(label(t),[prune_leaves(b,vals) for b in branches(t)]) # print(' ' * indent + str(label(t))) # for b in branches(t): # print_tree(b, indent + 1) # Q3 def memory(n): """ >>> f = memory(10) >>> f(lambda x: x * 2) 20 >>> f(lambda x: x - 7) 13 >>> f(lambda x: x > 5) True """ def helper(fn): #fn is a lambda that will take in x, let x be nonlocal n n = fn(n) print(n),memory(n) # return helper that takes in a fn return lambda fn: helper(fn) # Tree ADT def tree(label, branches=[]): """Construct a tree with the given label value and a list of branches.""" for branch in branches: assert is_tree(branch), 'branches must be trees' return [label] + list(branches) def label(tree): """Return the label value of a tree.""" return tree[0] def branches(tree): """Return the list of branches of the given tree.""" return tree[1:] def is_tree(tree): """Returns True if the given tree is a tree, and False otherwise.""" if type(tree) != list or len(tree) < 1: return False for branch in branches(tree): if not is_tree(branch): return False return True def is_leaf(tree): """Returns True if the given tree's list of branches is empty, and False otherwise. """ return not branches(tree) def print_tree(t, indent=0): """Print a representation of this tree in which each node is indented by two spaces times its depth from the root. >>> print_tree(tree(1)) 1 >>> print_tree(tree(1, [tree(2)])) 1 2 >>> numbers = tree(1, [tree(2), tree(3, [tree(4), tree(5)]), tree(6, [tree(7)])]) >>> print_tree(numbers) 1 2 3 4 5 6 7 """ print(' ' * indent + str(label(t))) for b in branches(t): print_tree(b, indent + 1) def copy_tree(t): """Returns a copy of t. Only for testing purposes. >>> t = tree(5) >>> copy = copy_tree(t) >>> t = tree(6) >>> print_tree(copy) 5 """ return tree(label(t), [copy_tree(b) for b in branches(t)])
#!/usr/bin/env python # -*- coding: utf-8 -*- def f1(a,b,c=0,*args,**kwargs): print('a=',a,'b=',b,'c=',c,'args=',args,'kwargs=',kwargs) def f2(a,b,c=0,*,d,**kw): print('a=',a,'b=',b,'c=',c,'d=',d,'kw=',kw) #f1(1,2,3,'a','b',x=99) #f2(1,2,d=99,ext=None) args=(1,2,3,4) kw={'d':99,'x':'#'} f1(*args,**kw) args=(1,2,3) kw={'d':88,'*':'#'} f2(*args,**kw)
""" Proměnné Proměnné jsou objekty, datové typy jsou třídy. """ age = 36 # celé číslo, proměnná age je objekt třídy int bodyHeight = float(1.78) # reálné číslo (typ float), proměnná bodyHeight je objekt třídy float firstName, lastName = "Gal", 'Gadot' fullName = firstName + " " + lastName # operace sčítání řetězců fullName2 = "{} {}" # složené závorky pro formátování řetězce fullName2.format(firstName, lastName) # metoda format nahradí složené závorky hodnotami proměnných born = str("Petach Tikva, Izrael") # zadání datového typu proměnné pomocí tzv. castingu bestKnown = "Wonder Woman" # textový řetězec about = """ {} is an Israeli actress and model. At age 18, she was crowned Miss Israel 2004. She is {} of age and {} tall. She is best known as {}. """ # víceřádkový textový řetězec print(firstName[0]) print(lastName) print(born) print(bestKnown) print(about.format(fullName, age, bodyHeight, bestKnown)) print(type(firstName)) print(type(age)) print(type(bodyHeight))
#!/usr/bin/env python3 # # Copyright 2019 Vojtech Horky # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # """ Unit conversion utilities. """ class SmartUnit: """ Holds arbitrary value but formats it in a reasonable unit. """ def __init__(self, value, size, unit=''): self.value = value self.size = size self.unit = unit def get_reasonable_value_with_unit_(self): """ Does the actual conversion to a reasonable unit. """ units_1024 = ['K', 'M', 'G', 'T'] value = self.value if self.size in units_1024: value = value * (1024 ^ (units_1024.index(self.size) + 1)) unit = "" if value > 4096: value = value / 1024 unit = "K" if value > 4096: value = value / 1024 unit = "M" if value > 4096: value = value / 1024 unit = "G" return (value, unit) def __format__(self, format_name): value = self.value size = self.size if format_name == 'smart': (value, size) = self.get_reasonable_value_with_unit_() format_name = ':.0f' fmt = '{' + format_name + '}{}{}' return fmt.format(value, size, self.unit) def __rtruediv__(self, other): return float(self.value) / float(other) def __truediv__(self, other): return float(self.value) / float(other) def __float__(self): return float(self.value)
# Copyright 2015 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Rust rules for Bazel""" RUST_FILETYPE = FileType([".rs"]) A_FILETYPE = FileType([".a"]) LIBRARY_CRATE_TYPES = ["lib", "rlib", "dylib", "staticlib"] # Used by rust_doc HTML_MD_FILETYPE = FileType([".html", ".md"]) CSS_FILETYPE = FileType([".css"]) ZIP_PATH = "/usr/bin/zip" def _relative(src_path, dest_path): """Returns the relative path from src_path to dest_path.""" src_parts = src_path.split("/") dest_parts = dest_path.split("/") n = 0 done = False for src_part, dest_part in zip(src_parts, dest_parts): if src_part != dest_part: break n += 1 relative_path = "" for i in range(n, len(src_parts)): relative_path += "../" relative_path += "/".join(dest_parts[n:]) return relative_path def _create_setup_cmd(lib, deps_dir): """ Helper function to construct a command for symlinking a library into the deps directory. """ return ( "ln -sf " + _relative(deps_dir, lib.path) + " " + deps_dir + "/" + lib.basename + "\n" ) def _setup_deps(deps, name, working_dir, is_library=False): """ Walks through dependencies and constructs the necessary commands for linking to all the necessary dependencies. Args: deps: List of Labels containing deps from ctx.attr.deps. name: Name of the current target. working_dir: The output directory for the current target's outputs. is_library: True the current target is a rust_library target, False otherwise. Returns: Returns a struct containing the following fields: libs: transitive_libs: setup_cmd: search_flags: link_flags: """ deps_dir = working_dir + "/" + name + ".deps" setup_cmd = ["rm -rf " + deps_dir + "; mkdir " + deps_dir + "\n"] has_rlib = False has_native = False libs = set() transitive_libs = set() symlinked_libs = set() link_flags = [] for dep in deps: if hasattr(dep, "rust_lib"): # This dependency is a rust_library libs += [dep.rust_lib] transitive_libs += [dep.rust_lib] + dep.transitive_libs symlinked_libs += [dep.rust_lib] + dep.transitive_libs link_flags += [( "--extern " + dep.label.name + "=" + deps_dir + "/" + dep.rust_lib.basename )] has_rlib = True elif hasattr(dep, "cc"): if not is_library: fail("Only rust_library targets can depend on cc_library") # This dependency is a cc_library native_libs = A_FILETYPE.filter(dep.cc.libs) libs += native_libs transitive_libs += native_libs symlinked_libs += native_libs link_flags += ["-l static=" + dep.label.name] has_native = True else: fail(("rust_library" if is_library else "rust_binary and rust_test") + " targets can only depend on rust_library " + ("or cc_library " if is_library else "") + "targets") for symlinked_lib in symlinked_libs: setup_cmd += [_create_setup_cmd(symlinked_lib, deps_dir)] search_flags = [] if has_rlib: search_flags += ["-L dependency=%s" % deps_dir] if has_native: search_flags += ["-L native=%s" % deps_dir] return struct( libs = list(libs), transitive_libs = list(transitive_libs), setup_cmd = setup_cmd, search_flags = search_flags, link_flags = link_flags) def _get_features_flags(features): """ Constructs a string containing the feature flags from the features specified in the features attribute. """ features_flags = [] for feature in features: features_flags += ["--cfg feature=\\\"%s\\\"" % feature] return features_flags def _rust_toolchain(ctx): return struct( rustc_path = ctx.file._rustc.path, rustc_lib_path = ctx.files._rustc_lib[0].dirname, rustlib_path = ctx.files._rustlib[0].dirname, rustdoc_path = ctx.file._rustdoc.path) def _build_rustc_command(ctx, crate_name, crate_type, src, output_dir, depinfo, rust_flags=[]): """Builds the rustc command. Constructs the rustc command used to build the current target. Args: ctx: The ctx object for the current target. crate_type: The type of crate to build ("lib" or "bin") src: The File object for crate root source file ("lib.rs" or "main.rs") output_dir: The output directory for the target. depinfo: Struct containing information about dependencies as returned by _setup_deps Return: String containing the rustc command. """ # Paths to the Rust compiler and standard libraries. toolchain = _rust_toolchain(ctx) # Paths to cc (for linker) and ar cpp_fragment = ctx.fragments.cpp cc = cpp_fragment.compiler_executable ar = cpp_fragment.ar_executable # Currently, the CROSSTOOL config for darwin sets ar to "libtool". Because # rust uses ar-specific flags, use /usr/bin/ar in this case. # TODO(dzc): This is not ideal. Remove this workaround once ar_executable # always points to an ar binary. ar_str = "%s" % ar if ar_str.find("libtool", 0) != -1: ar = "/usr/bin/ar" # Construct features flags features_flags = _get_features_flags(ctx.attr.crate_features) return " ".join( ["set -e;"] + depinfo.setup_cmd + [ "LD_LIBRARY_PATH=%s" % toolchain.rustc_lib_path, "DYLD_LIBRARY_PATH=%s" % toolchain.rustc_lib_path, toolchain.rustc_path, src.path, "--crate-name %s" % crate_name, "--crate-type %s" % crate_type, "-C opt-level=3", "--codegen ar=%s" % ar, "--codegen linker=%s" % cc, "--codegen link-args='%s'" % ' '.join(cpp_fragment.link_options), "-L all=%s" % toolchain.rustlib_path, "--out-dir %s" % output_dir, "--emit=dep-info,link", ] + features_flags + rust_flags + depinfo.search_flags + depinfo.link_flags + ctx.attr.rustc_flags) def _find_crate_root_src(srcs, file_names=["lib.rs"]): """Finds the source file for the crate root.""" if len(srcs) == 1: return srcs[0] for src in srcs: if src.basename in file_names: return src fail("No %s source file found." % " or ".join(file_names), "srcs") def _crate_root_src(ctx, file_names=["lib.rs"]): if ctx.file.crate_root == None: return _find_crate_root_src(ctx.files.srcs, file_names) else: return ctx.file.crate_root def _rust_library_impl(ctx): """ Implementation for rust_library Skylark rule. """ # Find lib.rs lib_rs = _crate_root_src(ctx) # Validate crate_type crate_type = "" if ctx.attr.crate_type != "": if ctx.attr.crate_type not in LIBRARY_CRATE_TYPES: fail("Invalid crate_type for rust_library. Allowed crate types are: %s" % " ".join(LIBRARY_CRATE_TYPES), "crate_type") crate_type += ctx.attr.crate_type else: crate_type += "lib" # Output library rust_lib = ctx.outputs.rust_lib output_dir = rust_lib.dirname # Dependencies depinfo = _setup_deps(ctx.attr.deps, ctx.label.name, output_dir, is_library=True) # Build rustc command cmd = _build_rustc_command( ctx = ctx, crate_name = ctx.label.name, crate_type = crate_type, src = lib_rs, output_dir = output_dir, depinfo = depinfo) # Compile action. compile_inputs = ( ctx.files.srcs + ctx.files.data + depinfo.libs + depinfo.transitive_libs + [ctx.file._rustc] + ctx.files._rustc_lib + ctx.files._rustlib) ctx.action( inputs = compile_inputs, outputs = [rust_lib], mnemonic = 'Rustc', command = cmd, use_default_shell_env = True, progress_message = ("Compiling Rust library %s (%d files)" % (ctx.label.name, len(ctx.files.srcs)))) return struct( files = set([rust_lib]), crate_type = crate_type, crate_root = lib_rs, rust_srcs = ctx.files.srcs, rust_deps = ctx.attr.deps, transitive_libs = depinfo.transitive_libs, rust_lib = rust_lib) def _rust_binary_impl(ctx): """Implementation for rust_binary Skylark rule.""" # Find main.rs. main_rs = _crate_root_src(ctx, ["main.rs"]) # Output binary rust_binary = ctx.outputs.executable output_dir = rust_binary.dirname # Dependencies depinfo = _setup_deps(ctx.attr.deps, ctx.label.name, output_dir, is_library=False) # Build rustc command. cmd = _build_rustc_command(ctx = ctx, crate_name = ctx.label.name, crate_type = "bin", src = main_rs, output_dir = output_dir, depinfo = depinfo) # Compile action. compile_inputs = ( ctx.files.srcs + ctx.files.data + depinfo.libs + depinfo.transitive_libs + [ctx.file._rustc] + ctx.files._rustc_lib + ctx.files._rustlib) ctx.action( inputs = compile_inputs, outputs = [rust_binary], mnemonic = 'Rustc', command = cmd, use_default_shell_env = True, progress_message = ("Compiling Rust binary %s (%d files)" % (ctx.label.name, len(ctx.files.srcs)))) return struct(rust_srcs = ctx.files.srcs, crate_root = main_rs, rust_deps = ctx.attr.deps) def _rust_test_common(ctx, test_binary): """Builds a Rust test binary. Args: ctx: The ctx object for the current target. test_binary: The File object for the test binary. """ output_dir = test_binary.dirname if len(ctx.attr.deps) == 1 and len(ctx.files.srcs) == 0: # Target has a single dependency but no srcs. Build the test binary using # the dependency's srcs. dep = ctx.attr.deps[0] crate_type = dep.crate_type if hasattr(dep, "crate_type") else "bin" target = struct(name = dep.label.name, srcs = dep.rust_srcs, deps = dep.rust_deps, crate_root = dep.crate_root, crate_type = crate_type) else: # Target is a standalone crate. Build the test binary as its own crate. target = struct(name = ctx.label.name, srcs = ctx.files.srcs, deps = ctx.attr.deps, crate_root = _crate_root_src(ctx), crate_type = "lib") # Get information about dependencies depinfo = _setup_deps(target.deps, target.name, output_dir, is_library=False) cmd = _build_rustc_command(ctx = ctx, crate_name = test_binary.basename, crate_type = target.crate_type, src = target.crate_root, output_dir = output_dir, depinfo = depinfo, rust_flags = ["--test"]) compile_inputs = (target.srcs + depinfo.libs + depinfo.transitive_libs + [ctx.file._rustc] + ctx.files._rustc_lib + ctx.files._rustlib) ctx.action( inputs = compile_inputs, outputs = [test_binary], mnemonic = "RustcTest", command = cmd, use_default_shell_env = True, progress_message = ("Compiling Rust test %s (%d files)" % (ctx.label.name, len(target.srcs)))) def _rust_test_impl(ctx): """ Implementation for rust_test Skylark rule. """ _rust_test_common(ctx, ctx.outputs.executable) def _rust_bench_test_impl(ctx): """Implementation for the rust_bench_test Skylark rule.""" rust_bench_test = ctx.outputs.executable test_binary = ctx.new_file(ctx.configuration.bin_dir, "%s_bin" % rust_bench_test.basename) _rust_test_common(ctx, test_binary) ctx.file_action( output = rust_bench_test, content = " ".join([ "#!/bin/bash\n", "set -e\n", "%s --bench\n" % test_binary.short_path]), executable = True) runfiles = ctx.runfiles(files = [test_binary], collect_data = True) return struct(runfiles = runfiles) def _build_rustdoc_flags(ctx): """Collects the rustdoc flags.""" doc_flags = [] doc_flags += [ "--markdown-css %s" % css.path for css in ctx.files.markdown_css] if hasattr(ctx.file, "html_in_header"): doc_flags += ["--html-in-header %s" % ctx.file.html_in_header.path] if hasattr(ctx.file, "html_before_content"): doc_flags += ["--html-before-content %s" % ctx.file.html_before_content.path] if hasattr(ctx.file, "html_after_content"): doc_flags += ["--html-after-content %s"] return doc_flags def _rust_doc_impl(ctx): """Implementation of the rust_doc rule.""" rust_doc_zip = ctx.outputs.rust_doc_zip # Gather attributes about the rust_library target to generated rustdocs for. target = struct(name = ctx.attr.dep.label.name, srcs = ctx.attr.dep.rust_srcs, deps = ctx.attr.dep.rust_deps, crate_root = ctx.attr.dep.crate_root) # Find lib.rs lib_rs = (_find_crate_root_src(target.srcs, ["lib.rs", "main.rs"]) if target.crate_root == None else target.crate_root) # Get information about dependencies output_dir = rust_doc_zip.dirname depinfo = _setup_deps(target.deps, target.name, output_dir, is_library=False) # Rustdoc flags. doc_flags = _build_rustdoc_flags(ctx) # Build rustdoc command. toolchain = _rust_toolchain(ctx) docs_dir = rust_doc_zip.dirname + "/_rust_docs" doc_cmd = " ".join( ["set -e"] + depinfo.setup_cmd + [ "rm -rf %s;" % docs_dir, "mkdir %s;" % docs_dir, "LD_LIBRARY_PATH=%s" % toolchain.rustc_lib_path, "DYLD_LIBRARY_PATH=%s" % toolchain.rustc_lib_path, toolchain.rustdoc_path, lib_rs.path, "--crate-name %s" % target.name, "-L all=%s" % toolchain.rustlib_path, "-o %s" % docs_dir, ] + doc_flags + depinfo.search_flags + depinfo.link_flags + [ "&&", "(cd %s" % docs_dir, "&&", ZIP_PATH, "-qR", rust_doc_zip.basename, "$(find . -type f) )", "&&", "mv %s/%s %s" % (docs_dir, rust_doc_zip.basename, rust_doc_zip.path), ]) # Rustdoc action rustdoc_inputs = (target.srcs + depinfo.libs + [ctx.file._rustdoc] + ctx.files._rustc_lib + ctx.files._rustlib) ctx.action( inputs = rustdoc_inputs, outputs = [rust_doc_zip], mnemonic = 'Rustdoc', command = doc_cmd, use_default_shell_env = True, progress_message = ("Generating rustdoc for %s (%d files)" % (target.name, len(target.srcs)))) def _rust_doc_test_impl(ctx): """Implementation for the rust_doc_test rule.""" rust_doc_test = ctx.outputs.executable # Gather attributes about the rust_library target to generated rustdocs for. target = struct(name = ctx.attr.dep.label.name, srcs = ctx.attr.dep.rust_srcs, deps = ctx.attr.dep.rust_deps, crate_root = ctx.attr.dep.crate_root) # Find lib.rs lib_rs = (_find_crate_root_src(target.srcs, ["lib.rs", "main.rs"]) if target.crate_root == None else target.crate_root) # Get information about dependencies depinfo = _setup_deps(target.deps, target.name, working_dir=".", is_library=False) # Construct rustdoc test command, which will be written to a shell script # to be executed to run the test. toolchain = _rust_toolchain(ctx) doc_test_cmd = " ".join( ["#!/bin/bash\n"] + ["set -e\n"] + depinfo.setup_cmd + [ "LD_LIBRARY_PATH=%s" % toolchain.rustc_lib_path, "DYLD_LIBRARY_PATH=%s" % toolchain.rustc_lib_path, toolchain.rustdoc_path, lib_rs.path, ] + depinfo.search_flags + depinfo.link_flags) ctx.file_action(output = rust_doc_test, content = doc_test_cmd, executable = True) doc_test_inputs = (target.srcs + depinfo.libs + depinfo.transitive_libs + [ctx.file._rustdoc] + ctx.files._rustc_lib + ctx.files._rustlib) runfiles = ctx.runfiles(files = doc_test_inputs, collect_data = True) return struct(runfiles = runfiles) _rust_common_attrs = { "srcs": attr.label_list(allow_files = RUST_FILETYPE), "crate_root": attr.label(allow_files = RUST_FILETYPE, single_file = True), "data": attr.label_list(allow_files = True, cfg = DATA_CFG), "deps": attr.label_list(), "crate_features": attr.string_list(), "rustc_flags": attr.string_list(), } _rust_toolchain_attrs = { "_rustc": attr.label( default = Label("//tools/build_rules/rust:rustc"), executable = True, single_file = True), "_rustc_lib": attr.label( default = Label("//tools/build_rules/rust:rustc_lib")), "_rustlib": attr.label(default = Label("//tools/build_rules/rust:rustlib")), "_rustdoc": attr.label( default = Label("//tools/build_rules/rust:rustdoc"), executable = True, single_file = True), } _rust_library_attrs = _rust_common_attrs + { "crate_type": attr.string(), } rust_library = rule( _rust_library_impl, attrs = _rust_library_attrs + _rust_toolchain_attrs, outputs = { "rust_lib": "lib%{name}.rlib", }, fragments = ["cpp"], ) rust_binary = rule( _rust_binary_impl, executable = True, attrs = _rust_common_attrs + _rust_toolchain_attrs, fragments = ["cpp"], ) rust_test = rule( _rust_test_impl, executable = True, attrs = _rust_common_attrs + _rust_toolchain_attrs, test = True, fragments = ["cpp"], ) rust_bench_test = rule( _rust_bench_test_impl, executable = True, attrs = _rust_common_attrs + _rust_toolchain_attrs, test = True, fragments = ["cpp"], ) _rust_doc_common_attrs = { "dep": attr.label(mandatory = True), } _rust_doc_attrs = _rust_doc_common_attrs + { "markdown_css": attr.label_list(allow_files = CSS_FILETYPE), "html_in_header": attr.label(allow_files = HTML_MD_FILETYPE), "html_before_content": attr.label(allow_files = HTML_MD_FILETYPE), "html_after_content": attr.label(allow_files = HTML_MD_FILETYPE), } rust_doc = rule( _rust_doc_impl, attrs = _rust_doc_attrs + _rust_toolchain_attrs, outputs = { "rust_doc_zip": "%{name}-docs.zip", }, ) rust_doc_test = rule( _rust_doc_test_impl, attrs = _rust_doc_common_attrs + _rust_toolchain_attrs, executable = True, test = True, )
# Robot variable file using Python syntax # Installed browser selection # BROWSER = "chrome" # BROWSER = "firefox" BROWSER = "headlessfirefox" # Helmi login credentials: # replace <helmiurl> with your area specific value https://alue.helmi.fi # replace <user> and <pass> with your Helmi username and password HELMI_LOGIN_PAGE = "<helmiurl>" HELMI_USERNAME = "<user>" HELMI_PASSWORD = "<pass>" # Gmail credentials: # replace <email> with your Gmail account to use for sending email GMAIL_USERID = "<email>" # Email address for message reading # replace <email> with address that receives message emails HELMI_TARGET_EMAIL = "<email>"
print("000560_03_06_FuncAsObj.py") print() print("000560_03_06_ex01_") def shout(word): return word + "!" speak = shout output = speak ("lol") print(output) print() print("000560_03_06_ex01_functions_objects") # функции как объекты def myltiply(x,y): return x*y a=4 b=7 operation=myltiply print (operation(a,b)) print() print("000560_03_06_task01_functions_var") # переменной можно назначить функцию def shout(word): return word + '!' speak=shout output=speak("lol") print (output) print() print("000560_03_06_ex02_functions_args") # переменной можно назначить функцию def add(x,y): # функция принимает два аргумента, возвращает сумму return x + y # 15 # print(do_twice) def do_twice(func, x,y): # add -> func # функция do_twice вызывает add # функция принимает три аргумента return func(func(x,y), func(x,y)) # функция принимает 2 аргумента (просто вид двух аргументов) # Возвращает конкатенацию строк? a=5 b=10 print ("do_twice(add, a,b):", do_twice(add, a,b)) print() print("000560_03_06_task02_FuncAsObj") # Заполнив пропуски, назначьте функцию square в качестве аргумента фукнции test: def square(x): return x*x def test(func): print("square(2):", func) test(square(2))
class Solution: """ @param: s: A string @return: A string """ def reverseWords(self, s): return " ".join(list(filter(lambda x: x != "", s.split(" ")))[::-1])
class Solution: def printMinNumberForPattern(ob, S): # code here count = 1 stack = [] ans = "" for i in S: if i == "D": stack.append(count) count += 1 else: stack.append(count) count += 1 while stack: ans += str(stack.pop()) stack.append(count) while stack: ans += str(stack.pop()) # print(ans) return int(ans) #{ # Driver Code Starts #Initial Template for Python 3 if __name__ == '__main__': t = int(input()) for _ in range(t): S = str(input()) ob = Solution() print(ob.printMinNumberForPattern(S)) # } Driver Code Ends
# UNIDAD 06.D19 - D21 # Programación Orientada a Objetos (POO) print('\n\n---[Diapo 19]---------------------') print('POO - Constructor') class Galletita: sabor = 'Dulce' color = 'Negra' chips_chocolate = False def __init__(self): print('Se acaba de crear una galletita') mi_galletita = Galletita() print('\n\n---[Diapo 20.a]---------------------') print('POO - Constructor') class Galletita: chips_chocolate = False def __init__(self, sabor, color): self.sabor = sabor self.color = color print('Nueva galletita de {:7} y color {}'.format(self.sabor, self.color)) mi_galletita1 = Galletita('Dulce', 'Blanca') mi_galletita1 = Galletita('Salada', 'Marrón') mi_galletita1 = Galletita('Dulce', 'Verde') print('\n\n---[Diapo 20.a]---------------------') print('POO - Constructor - valores default') class Galletita: chips_chocolate = False def __init__(self, sabor = 'Dulce', color = 'Marrón'): self.sabor = sabor self.color = color print('Nueva galletita de {:7} y color {}'.format(self.sabor, self.color)) mi_galletita1 = Galletita('Dulce', 'Blanca') mi_galletita1 = Galletita('Salada', 'Marrón') mi_galletita1 = Galletita() print('\n\n---[Diapo 21]---------------------') print('POO - Constructor y Destructor') class Galletita: chips_chocolate = False def __init__(self, sabor = 'Dulce', color = 'Marrón'): self.sabor = sabor self.color = color print('Nueva galletita de {:7} y color {}'.format(self.sabor, self.color)) def __del__(self): print('Se está borrando la galletita de sabor', self.sabor) mi_galletita1 = Galletita('Dulce', 'Blanca') del(mi_galletita)
class Solution: def removeDuplicates(self, nums): if len(nums) == 0: return 0 nextAvail = 1 for i in range(1, len(nums)): if nums[i] == nums[nextAvail-1]: i += 1 else: nums[nextAvail] = nums[i] nextAvail += 1 continue return nextAvail
class Solution: def numberOfArithmeticSlices(self, nums: List[int]) -> int: dp = 0 ans = 0 n = len(nums) for i in range(2, n): pre = nums[i - 1] - nums[i - 2] now = nums[i] - nums[i - 1] if now == pre: dp += 1 ans += dp else: dp = 0 pre = now return ans
def findMax(some_dict): positions = set() # output variable max_value = -1 for k, v in some_dict.items(): if v == max_value: positions.add(k) if v > max_value: max_value = v positions = set() # output variable positions.add(k) return positions, max_value def getChangeTimes(cowLog: list, milkLog: dict) -> int: board, maxMilk = findMax(milkLog) count = 0 # return this for c in cowLog: milkLog[c[1]] += c[2] if c[1] in board: if c[2] < 0: if len(board) == 1: # the one cow on board decreased newBoard, maxMilk = findMax(milkLog) if newBoard != board: count += 1 board = newBoard else: # one cow on board just got bad board.remove(c[1]) count += 1 else: # one cow on board just got new record if len(board) != 1: board = set([c[1]]) count += 1 maxMilk = milkLog[c[1]] else: if milkLog[c[1]] > maxMilk: # one cow got new record maxMilk = milkLog[c[1]] board = set([c[1]]) count += 1 elif milkLog[c[1]] == maxMilk: # tied with old cow board.add(c[1]) count += 1 if count == 0: return 1 return count def main(inputFile, outputFile): measurementInput = open(inputFile, 'r') measurementOutput = open(outputFile, 'w') cowLog = [] milkLog = {} N, G = measurementInput.readline().strip().split() N, G = int(N), int(G) for _ in range(N): line = measurementInput.readline().strip().split() cow = int(line[1]) cowLog.append((int(line[0]), cow, int(line[2]),)) if cow not in milkLog: milkLog[cow] = G measurementOutput.write(str(getChangeTimes(sorted(cowLog), milkLog)) + '\n') measurementInput.close() measurementOutput.close() main('measurement.in', 'measurement.out')
""" Test all functionality related to authorization, e.g. logging in, logging out, registering etc. """ def test_nonexisting_account(client): response = client.get('/v0/whoami') assert response.status_code == 401 response = client.post('/v0/login', json={ 'username': 'a', 'password': 'a' }) assert response.status_code == 401 # can not see any content res = client.get('/v0/notes') assert res.status_code == 401 assert 'notes' not in res.get_json() def test_register(client): res = client.post('/v0/register', json={ 'username': 'a', 'password': 'a' }) assert res.status_code == 200 # assert cannot register twice res = client.post('/v0/register', json={ 'username': 'a', 'password': 'a' }) assert res.status_code >= 400 def test_login(client): # can now log in res = client.post('/v0/login', json={ 'username': 'a', 'password': 'a' }) assert res.status_code == 200 access_token, csrf_token = res.headers.get_all('Set-Cookie') assert 'HttpOnly' in access_token assert 'MaxAge' not in access_token # is now logged in res = client.get('/v0/whoami') assert res.status_code == 200 assert res.get_json()['username'] == 'a' # can now see content res = client.get('/v0/notes') assert res.status_code == 200 assert res.get_json()['notes'] is not None def test_persistent_login(client): res = client.post('/v0/login', json={ 'username': 'a', 'password': 'a', 'persistent': True }) access_token, csrf_token = res.headers.get_all('Set-Cookie') assert access_token.startswith('access_token_cookie') assert 'Max-Age=2592000' in access_token assert 'HttpOnly' in access_token def test_logout(client): # can now log out res = client.post('/v0/logout') assert res.status_code == 200 # is not logged in any more res = client.get('/v0/whoami') assert res.status_code == 401
def mdc(a,b): if a<b: return mdc(b,a) else: if b==0: return a else: return mdc(b, a % b) print(mdc(12,8)) print(mdc(12,10))
# -*- coding: utf-8 -*- ''' module used while testing mock hubs provided in 'testing'. ''' __contracts__ = ['testing'] def noparam(hub): pass def echo(hub, param): return param def signature_func(hub, param1, param2='default'): pass def attr_func(hub): pass attr_func.test = True attr_func.__test__ = True async def async_echo(hub, param): return param
def add(first,second): """Adds two numbers""" return first + second if __name__ == "__main__": add(2,3)
code = "he.elk.set.to" decode = code.split("e") print(decode[-1])
"""Infer read orientation from sample data.""" def infer(): """Main function coordinating the execution of all other functions. Should be imported/called from main app and return results to it. """ # implement me
# you can write to stdout for debugging purposes, e.g. # print("this is a debug message") def solution(M, A): hash = [0] * (M + 1) slices = 0 max_slices = 1000000000 head = 0 for tail in range(len(A)): while head < len(A) and ( not hash[A[head]]): hash[A[head]] = 1 slices += head - tail + 1 if slices > max_slices: return max_slices head += 1 hash[A[tail]] = False return slices solution(6, [3, 4, 5, 5, 2])
"""P7E10 VICTORIA PEÑAS Escribe un programa que te pida una palabra o número, pase por parámetro estos datos a una función, y ésta te diga si es o no palíndroma o capicúa. El programa principal imprimirá el resultado de la función: ':: significa dame la totalidad\del elemento, el -1 hacia atras' """ def comprobarPalindromo(valor): #Otra opción: #if secuencia[::-1] == secuencia[:]: --> [::-1] es para leer la variable al revés # return print("es capicua") #else: # return print("no es capicua") y = 1 for i in range(len(valor)//2): if valor[i]==valor[-y]: capicua="es capicua o palíndroma" else: capicua="no es capicua o palíndroma" break y+= 1 return print(capicua) secuencia=str(input("Dime algo: ")) comprobarPalindromo(secuencia)
""" Author: Alberto Marci """ class DecimalToRoman: # convert number from 0 to 9 def __zero_to_nine(self, number): if number == '0': return '' if number == '1': return 'I' if number == '2': return 'II' if number == '3': return 'III' if number == '4': return 'IV' if number == '5': return 'V' if number == '6': return 'VI' if number == '7': return 'VII' if number == '8': return 'VIII' if number == '9': return 'IX' # convert number from 10 to 90 def __ten_to_ninety(self, number): if number == '0': return '' if number == '1': return 'X' if number == '2': return 'XX' if number == '3': return 'XXX' if number == '4': return 'XL' if number == '5': return 'L' if number == '6': return 'LX' if number == '7': return 'LXX' if number == '8': return 'LXXX' if number == '9': return 'XC' # convert number from 100 to 900 def __one_hundred_to_nine_hundred(self, number): if number == '0': return '' if number == '1': return 'C' if number == '2': return 'CC' if number == '3': return 'CCC' if number == '4': return 'CD' if number == '5': return 'D' if number == '6': return 'DC' if number == '7': return 'DCC' if number == '8': return 'DCCC' if number == '9': return 'CM' # convert number from 1000 to 3000 def __one_thousand_to_three_thousand(self, number): if number == '1': return 'M' if number == '2': return 'MM' if number == '3': return 'MMM' # return roman string def integer_to_roman(self, number): tmp = str(number) str_len = len(tmp) if str_len == 1: return self.__zero_to_nine(tmp[0]) if str_len == 2: roman_str0 = self.__zero_to_nine(tmp[1]) roman_str1 = self.__ten_to_ninety(tmp[0]) return roman_str1 + roman_str0 if str_len == 3: roman_str0 = self.__zero_to_nine(tmp[2]) roman_str1 = self.__ten_to_ninety(tmp[1]) roman_str2 = self.__one_hundred_to_nine_hundred(tmp[0]) return roman_str2 + roman_str1 + roman_str0 if str_len == 4: roman_str0 = self.__zero_to_nine(tmp[3]) roman_str1 = self.__ten_to_ninety(tmp[2]) roman_str2 = self.__one_hundred_to_nine_hundred(tmp[1]) roman_str3 = self.__one_thousand_to_three_thousand(tmp[0]) return roman_str3 + roman_str2 + roman_str1 + roman_str0 def test(self): print(self.integer_to_roman(13)) print('-------------------------------------------') print(self.integer_to_roman(48)) print('-------------------------------------------') print(self.integer_to_roman(444)) print('-------------------------------------------') print(self.integer_to_roman(3444)) print('-------------------------------------------') print(self.integer_to_roman(3999)) print('-------------------------------------------') print(self.integer_to_roman(100)) # ---------------------------------------------------------------------------------------------------------------------- converter = DecimalToRoman() converter.test() print('-------------------------------------------') print('-------------------------------------------') print(converter.integer_to_roman(1234))
class Solution: def gameOfLife(self, board): """ :type board: List[List[int]] :rtype: void Do not return anything, modify board in-place instead. """ if not board: return board last = copy.deepcopy(board) for i in range(len(board)): for j in range(len(board[0])): cur_count = self.findCount(last, i, j) print(cur_count) if board[i][j] == 1: if cur_count < 2 or cur_count > 3: board[i][j] = 0 else: if cur_count == 3: board[i][j] = 1 def findCount(self, board, i, j): count = 0 if len(board) == 1 and len(board[0]) == 1: return 0 if len(board[0]) == 1: try: count += board[i][j-1] except: pass try: count += board[i][j+1] except: pass return count if len(board) == 1: try: count += board[i-1][j] except: pass try: count += board[i+1][j] except: pass return count if i > 0 and i < len(board)-1 and j > 0 and j < len(board[0])-1: count += board[i-1][j] count += board[i-1][j-1] count += board[i-1][j+1] count += board[i][j-1] count += board[i][j+1] count += board[i+1][j-1] count += board[i+1][j] count += board[i+1][j+1] return count if i == 0 and j == 0: count += board[i][j+1] count += board[i+1][j] count += board[i+1][j+1] return count if i == 0 and j == len(board[0])-1: count += board[i][j-1] count += board[i+1][j] count += board[i+1][j-1] return count if i == len(board)-1 and j == 0: count += board[i][j+1] count += board[i-1][j] count += board[i-1][j+1] return count if i == len(board)-1 and j == len(board[0])-1: count += board[i][j-1] count += board[i-1][j] count += board[i-1][j-1] return count if i == 0: count += board[i][j-1] count += board[i][j+1] count += board[i+1][j] count += board[i+1][j-1] count += board[i+1][j+1] return count if i == len(board)-1: count += board[i][j-1] count += board[i][j+1] count += board[i-1][j] count += board[i-1][j-1] count += board[i-1][j+1] return count if j == 0: count += board[i-1][j] count += board[i+1][j] count += board[i-1][j+1] count += board[i][j+1] count += board[i+1][j+1] return count if j == len(board[0])-1: count += board[i-1][j] count += board[i+1][j] count += board[i-1][j-1] count += board[i][j-1] count += board[i+1][j-1] return count
#less than operator print(4<10) # --- L1 print(10<4) # --- L2 print(4<4.0) # --- L3 print(4.0<4) # --- L4 print('python'<'Python') #--- L5 print('python'<'python') # --- L6 print('Python'<'python') #--- L7
DIGITS = "0123456789abcdef" def convert_base_stack(decimal_number, base): remainder_stack = [] while decimal_number > 0: remainder = decimal_number % base remainder_stack.append(remainder) decimal_number = decimal_number // base new_digits = [] while remainder_stack: new_digits.append(DIGITS[remainder_stack.pop()]) return "".join(new_digits) def convert_base_rec(decimal_number, base): if decimal_number < base: return DIGITS[decimal_number] return convert_base_rec(decimal_number // base, base) + DIGITS[decimal_number % base]
def add(a,b): return a+b def substract(a,b): return a * b ## Imagine I made a valid change def absolut(a,b): return np.abs(a,b)
class Solution: def findRestaurant(self, list1, list2): mp1, mp2 = {x: i for i, x in enumerate(list1)}, {x: i for i, x in enumerate(list2)} ans = [10 ** 4, []] for k, v in mp1.items(): if k in mp2 and v + mp2[k] == ans[0]: ans[1].append(k) elif k in mp2 and v + mp2[k] < ans[0]: ans = [v + mp2[k], [k]] return ans[1]
# Solution 1 # O(n) time / O(n) space def branchSums(root): sums = [] calculateBranchSums(root, 0, sums) return sums def calculateBranchSums(node, runningSum, sums): if node is None: return sums newRunningSum = runningSum + node.value if node.left is None and node.right is None: sums.append(newRunningSum) return calculateBranchSums(node.left, newRunningSum, sums) calculateBranchSums(node.right, newRunningSum, sums)
class Context(dict): """docstring for _Context""" def __init__(self, name, parameters={}, lifespan=5): self.name = name self.parameters = parameters self.lifespan = lifespan # def __getattr__(self, param): # if param in ['name', 'parameters', 'lifespan']: # return getattr(self, param) # return self.parameters[param] def set(self, param_name, value): self.parameters[param_name] = value def get(self, param): return self.parameters.get(param) def sync(self, context_json): self.__dict__.update(context_json) def __repr__(self): return self.name @property def serialize(self): return {"name": self.name, "lifespan": self.lifespan, "parameters": self.parameters} class ContextManager(): def __init__(self): self._cache = {} def add(self, *args, **kwargs): context = Context(*args, **kwargs) self._cache[context.name] = context return context def get(self, context_name, default=None): return self._cache.get(context_name, default) def set(self, context_name, param, val): context = self.get(context_name) context.set(param, val) return context def get_param(self, context_name, param): return self._cache[context_name].parameters[param] def update(self, contexts_json): for obj in contexts_json: context = Context(obj['name']) # TODO context.lifespan = obj['lifespan'] context.parameters = obj['parameters'] self._cache[context.name] = context @property def status(self): return { 'Active contexts': self.active, 'Expired contexts': self.expired, } @property def active(self): return [self._cache[c] for c in self._cache if self._cache[c].lifespan > 0] @property def expired(self): return [self._cache[c] for c in self._cache if self._cache[c].lifespan == 0]
def minInsertions(s: str) -> int: dp = [[0] * len(s) for _ in range(len(s))] for left in range(len(s) - 1, -1, -1): for right in range(0, len(s)): if left >= right: continue if s[left] == s[right]: dp[left][right] = dp[left+1][right-1] else: dp[left][right] = 1 + min(dp[left+1][right], dp[left][right-1]) return dp[0][len(s) - 1]
# -*- coding: UTF-8 -*- PROXYSOCKET = '' RETRY_TIMES = 5 HEADERS = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36', 'Accept': 'application/json,application/xml' } INPUT_FILE = 'dependencies/input.xlsx' API_DEBUG = True API_PORT = 5678 POST_TIME = 60
N = int(input("")) for x in range(0, N): if N > 0: s = input("") s = s.split() #separar if s[0] == s[1]: print("empate") else: if s[0] == "tesoura": if s[1] == "papel" or s[1] =="lagarto": print("rajesh") elif s[1] == "pedra" or s[1]=="spock": print("sheldon") elif s[0] == "papel": if s[1] == "pedra" or s[1] =="spock": print("rajesh") elif s[1] == "tesoura" or s[1]=="lagarto": print("sheldon") elif s[0] == "pedra": if s[1] == "lagarto" or s[1] =="tesoura": print("rajesh") elif s[1] == "spock" or s[1]=="papel": print("sheldon") elif s[0] == "lagarto": if s[1] == "spock" or s[1] =="papel": print("rajesh") elif s[1] == "pedra" or s[1]=="tesoura": print("sheldon") elif s[0] == "spock": if s[1] == "tesoura" or s[1] =="pedra": print("rajesh") elif s[1] == "lagarto" or s[1]=="papel": print("sheldon") else: print("invalido")
def extract_organization_id_from_request_query(request): return request.query_params.get('organization') or request.query_params.get('organization_id') def extract_organization_id_from_request_data(request) -> (int, bool): """ Returns the organization id from the request.data and a bool indicating if the key was present in the data (to distinguish between missing data and empty input value) :param request: :return: """ for source in (request.data, request.GET): if 'organization' in source: return source.get('organization'), True if 'organization_id' in request.data: return source.get('organization_id'), True return None, False
"""Provides the repository macro to import rocksdb.""" load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def repo(): """Imports rocksdb.""" ROCKSDB_VERSION = "6.15.5" ROCKSDB_SHA256 = "d7b994e1eb4dff9dfefcd51a63f86630282e1927fc42a300b93c573c853aa5d0" http_archive( name = "rocksdb", build_file = "//research/carls/third_party/rocksdb:rocksdb.BUILD", sha256 = ROCKSDB_SHA256, strip_prefix = "rocksdb-{version}".format(version = ROCKSDB_VERSION), url = "https://github.com/facebook/rocksdb/archive/v{version}.tar.gz".format(version = ROCKSDB_VERSION), ) # A dependency of rocksdb that is required for rocksdb::ClockCache. http_archive( name = "tbb", build_file = "//research/carls/third_party/rocksdb:tbb.BUILD", sha256 = "b182c73caaaabc44ddc5ad13113aca7e453af73c1690e4061f71dfe4935d74e8", strip_prefix = "oneTBB-2021.1.1", url = "https://github.com/oneapi-src/oneTBB/archive/v2021.1.1.tar.gz", ) http_archive( name = "gflags", sha256 = "ce2931dd537eaab7dab78b25bec6136a0756ca0b2acbdab9aec0266998c0d9a7", strip_prefix = "gflags-827c769e5fc98e0f2a34c47cef953cc6328abced", url = "https://github.com/gflags/gflags/archive/827c769e5fc98e0f2a34c47cef953cc6328abced.tar.gz", )
#=============================================================================== # Copyright 2020 Intel Corporation # # 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. #=============================================================================== load("@onedal//dev/bazel:utils.bzl", "utils", "paths") def _create_symlinks(repo_ctx, root, entries, substitutions={}): for entry in entries: entry_fmt = utils.substitude(entry, substitutions) src_entry_path = paths.join(root, entry_fmt) dst_entry_path = entry_fmt repo_ctx.symlink(src_entry_path, dst_entry_path) def _download(repo_ctx): output = repo_ctx.path("archive") repo_ctx.download_and_extract( url = repo_ctx.attr.url, sha256 = repo_ctx.attr.sha256, output = output, stripPrefix = repo_ctx.attr.strip_prefix, ) return str(output) def _prebuilt_libs_repo_impl(repo_ctx): root = repo_ctx.os.environ.get(repo_ctx.attr.root_env_var) if not root: if repo_ctx.attr.url: root = _download(repo_ctx) elif repo_ctx.attr.fallback_root: root = repo_ctx.attr.fallback_root else: fail("Cannot locate {} dependency".format(repo_ctx.name)) substitutions = { # TODO: Detect OS "%{os}": "lnx", } _create_symlinks(repo_ctx, root, repo_ctx.attr.includes, substitutions) _create_symlinks(repo_ctx, root, repo_ctx.attr.libs, substitutions) repo_ctx.template( "BUILD", repo_ctx.attr.build_template, substitutions = substitutions, ) def prebuilt_libs_repo_rule(includes, libs, build_template, root_env_var="", fallback_root="", url="", sha256="", strip_prefix=""): return repository_rule( implementation = _prebuilt_libs_repo_impl, environ = [ root_env_var, ], local = True, configure = True, attrs = { "root_env_var": attr.string(default=root_env_var), "fallback_root": attr.string(default=fallback_root), "url": attr.string(default=url), "sha256": attr.string(default=sha256), "strip_prefix": attr.string(default=strip_prefix), "includes": attr.string_list(default=includes), "libs": attr.string_list(default=libs), "build_template": attr.label(allow_files=True, default=Label(build_template)), } ) repos = struct( prebuilt_libs_repo_rule = prebuilt_libs_repo_rule, )
def intersects(line1, line2): def onSeg(p, q, r): if (q[0] <= max(p[0],r[0]) and q[0] >= min(p[0],r[0]) and q[0] <= max(p[1],r[1]) and q[1] >= min(p[1],r[1])): return True return False #0 -> colinear, 1 -> clockwise, 2 -> ccw def orientation(p,q,r): val = (q[1]-p[1]) * (r[0] - q[0]) - (q[0]-p[0]) * (r[1] - q[1]) if val == 0: return 0 if val > 0: return 1 return 2 p1 , q1 = line1 p2 , q2 = line2 o1 = orientation(p1, q1, p2) o2 = orientation(p1, q1, q2) o3 = orientation(p2, q2, p1) o4 = orientation(p2, q2, q1) x1, y1 = p1 x2, y2 = q1 x3, y3 = p2 x4, y4 = q2 if (o1 != o2 and o3 != o4): #general xd = (x1*y2 - y1*x2)*(x3-x4)-(x1-x2)*(x3*y4-y3*x4) xn = (x1-x2)*(y3-y4) - (y1-y2)*(x3-x4) yd = (x1*y2 - y1*x2)*(y3-y4)-(y1-y2)*(x3*y4-y3*x4) yn = (x1-x2)*(y3-y4) - (y1-y2)*(x3-x4) return (xd/xn , yd/yn) if (o1 == 0 and onSeg(p1,p2,q1)): #p2 lies on p1q1 return p2 if (o2 == 0 and onSeg(p1,q2,q1)): #q2 lies on p1q1 return q2 if (o3 == 0 and onSeg(p2,p1,q2)): #p1 lies on p2q2 return p1 if (o4 == 0 and onSeg(p2,q1,q2)): #q1 lies on p2q2 return q1 return (-1,-1)