content
stringlengths
7
1.05M
""" Copyright (c) Facebook, Inc. and its affiliates. """ BEFORE = """ <!-- Bootstrap v3.0.3 --> <link href="https://s3.amazonaws.com/mturk-public/bs30/css/bootstrap.min.css" rel="stylesheet" /> <section class="container" id="Other" style="margin-bottom:15px; padding: 10px 10px; font-family: Verdana, Geneva, sans-serif; color:#333333; font-size:0.9em;"> <div class="row col-xs-12 col-md-12"><!-- Instructions --> <div class="panel panel-primary"> <div class="panel-heading"><strong>Instructions</strong></div> <div class="panel-body" style="font-size:14px;"> <h1><strong>Split a composite command into individual commands.</strong></h1> <p>Please help us split a command into individual single commands. The command shown to you here is given to an AI assistant. You will be shown a command that possibly has a sequence or list of single commands and your task is to give us multiple single complete actions that are intended by the command shown to you.</p> &nbsp; <p><b>When splitting the commands, please only use the exact words shown in the original command.</b></p> <p>Few valid examples below:</p> <p>For <b>&quot;build a castle and then come back here&quot;</b> the answer is the following:</p> <ul> <li>&quot;build a castle&quot; and</li> <li>&quot;come back here&quot;</li> </ul> <p>&nbsp;</p> <p>For <b>&quot;destroy the roof and build a stone ceiling in its place&quot;</b> the answer is the following:</p> <ul> <li>&quot;destroy the roof&quot; and</li> <li>&quot;build a stone ceiling in its place&quot;</li> </ul> <p>&nbsp;</p> <p>For <b>&quot;move to the door and open it&quot;</b> the answer is the following:</p> <ul> <li>&quot;move to the door&quot; and</li> <li>&quot;open it&quot;</li> </ul> <p>&nbsp;</p> <p>For <b>&quot;i want you to undo the last two spawns and try again with new spawns&quot; </b></p> <ul> <li>&quot;i want you to undo the last two spawns&quot; and</li> <li>&quot;try again with new spawns&quot;</li> </ul> <p>&nbsp;</p> <p>For <b>&quot;can you turn around and start moving to the left&quot; </b></p> <ul> <li>&quot;can you turn around&quot; and</li> <li>&quot;start moving to the left&quot;</li> </ul> <p>&nbsp;</p> <p>Note that:<br /> <b>1. Some commands might have more than two splits. We&#39;ve given you three more optional boxes.</b><br /> <b>2. Make sure that the commands you enter in text boxes are single and complete sentences using the exact words written in the original command.</b><br /> <b>3. Please copy and use the exact words shown in the original commands. Do not rephrase the sentences.</b></p> </div> </div> <div class="well" style="position:sticky;position:-webkit-sticky;top:0;z-index:9999"> <h2><strong>Command:</strong> <b id="sentence"></b></h2> </div> <!-- Content Body --> <section> """ BETWEEN = """ <section> <fieldset> <div class="input-group"><span style="font-family: verdana, geneva, sans-serif;font-size: 18px;">The individual commands.&nbsp;</span> <p>Command 1<textarea class="form-control" cols="150" name="command_1" rows="2"></textarea></p> <p>Command 2<textarea class="form-control" cols="150" name="command_2" rows="2"></textarea></p> <p>Command 3 (optional)<textarea class="form-control" cols="150" name="command_3" rows="2"></textarea></p> <p>Command 4 (optional)<textarea class="form-control" cols="150" name="command_4" rows="2"></textarea></p> <p>Command 5 (optional)<textarea class="form-control" cols="150" name="command_5" rows="2"></textarea></p> </div> </fieldset> """ AFTER = """ </section> <!-- End Content Body --> </div> </section> <style type="text/css">fieldset { padding: 10px; background:#fbfbfb; border-radius:5px; margin-bottom:5px; } </style> <script src="https://code.jquery.com/jquery.js"></script> <script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> """ if __name__ == "__main__": # XML: yes, gross, I know. but Turk requires XML for its API, so we deal print( """ <HTMLQuestion xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2011-11-11/HTMLQuestion.xsd"> <HTMLContent><![CDATA[ """ ) print(BEFORE) print( """ <script type='text/javascript' src='https://s3.amazonaws.com/mturk-public/externalHIT_v1.js'></script> <form name='mturk_form' method='post' id='mturk_form' action='https://workersandbox.mturk.com/mturk/externalSubmit'><input type='hidden' value='' name='assignmentId' id='assignmentId'/> """ ) print(BETWEEN) print( """ <p><input type='submit' id='submitButton' value='Submit' /></p></form> <script language='Javascript'> turkSetAssignmentID(); const queryString = window.location.search; console.log(queryString); let urlParams = new URLSearchParams(queryString); const sentence = urlParams.get('sentence'); document.getElementById("sentence").innerHTML=sentence; </script> """ ) print(AFTER) print( """ ]]> </HTMLContent> <FrameHeight>600</FrameHeight> </HTMLQuestion> """ )
class Logger(object): """ La classe modellizza un logger, per generare un file di testo di output """ def __init__(self, fp): self.fp = open(fp, 'w') def log(self, msg): self.fp.write(msg + '\n') def close(self): self.fp.close()
#!/usr/bin/python # -*- coding: utf-8 -*- # cython: language_level=2, boundscheck=False class NoValidVersion(Exception): pass class VersionZero(Exception): pass class ExceededPaddingVersion(Exception): pass class NoVersionNumber(Exception): pass
""" Various container utilities """ def get_from_dict(d, path): """ Extract a value pointed by ``path`` from a nested dict. Example: >>> d = { ... "path": { ... "to": { ... "item": "value" ... } ... } ... } >>> get_from_dict(d, "/path/to/item") 'value' """ components = [c for c in path.split("/") if c] if not len(components): raise ValueError("empty path") try: c = d[components.pop(0)] while components: c = c[components.pop(0)] except KeyError: raise ValueError("invalid path: %s" % path) return c
name = input("[>] Enter name: ") email = input("[>] Enter email: ") if "@" not in name and "@" in email: print("[+] OK") elif "@" not in name and "@" not in email: print("[-] Incorrect email") elif "@" in name and "@" in email: print("[-] Incorrect login") elif "@" in name and "@" not in email: print("[-] Incorrect data")
# # PySNMP MIB module CISCO-ROUTE-POLICIES-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ROUTE-POLICIES-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:54: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) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, ModuleIdentity, MibIdentifier, TimeTicks, Integer32, Unsigned32, Counter64, ObjectIdentity, NotificationType, iso, Counter32, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "ModuleIdentity", "MibIdentifier", "TimeTicks", "Integer32", "Unsigned32", "Counter64", "ObjectIdentity", "NotificationType", "iso", "Counter32", "IpAddress") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") ciscoRoutePoliciesMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 578)) ciscoRoutePoliciesMIB.setRevisions(('2006-08-18 00:00',)) if mibBuilder.loadTexts: ciscoRoutePoliciesMIB.setLastUpdated('200608180000Z') if mibBuilder.loadTexts: ciscoRoutePoliciesMIB.setOrganization('Cisco Systems, Inc. ') ciscoRoutePoliciesMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 578, 0)) ciscoRoutePoliciesMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 578, 1)) ciscoRoutePoliciesMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 578, 2)) crpPolicies = ObjectIdentity((1, 3, 6, 1, 4, 1, 9, 9, 578, 1, 1)) if mibBuilder.loadTexts: crpPolicies.setStatus('current') crpPolicyIfIndex = ObjectIdentity((1, 3, 6, 1, 4, 1, 9, 9, 578, 1, 1, 1)) if mibBuilder.loadTexts: crpPolicyIfIndex.setStatus('current') mibBuilder.exportSymbols("CISCO-ROUTE-POLICIES-MIB", ciscoRoutePoliciesMIB=ciscoRoutePoliciesMIB, ciscoRoutePoliciesMIBObjects=ciscoRoutePoliciesMIBObjects, PYSNMP_MODULE_ID=ciscoRoutePoliciesMIB, crpPolicyIfIndex=crpPolicyIfIndex, ciscoRoutePoliciesMIBConform=ciscoRoutePoliciesMIBConform, crpPolicies=crpPolicies, ciscoRoutePoliciesMIBNotifs=ciscoRoutePoliciesMIBNotifs)
# Copyright 2018-2020 Stanislav Pidhorskyi # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== def find_maximum(f, min_x, max_x, epsilon=1e-5): def binary_search(l, r, fl, fr, epsilon): mid = l + (r - l) / 2 fm = f(mid) binary_search.eval_count += 1 if (fm == fl and fm == fr) or r - l < epsilon: return mid, fm if fl > fm >= fr: return binary_search(l, mid, fl, fm, epsilon) if fl <= fm < fr: return binary_search(mid, r, fm, fr, epsilon) p1, f1 = binary_search(l, mid, fl, fm, epsilon) p2, f2 = binary_search(mid, r, fm, fr, epsilon) if f1 > f2: return p1, f1 else: return p2, f2 binary_search.eval_count = 0 best_th, best_value = binary_search(min_x, max_x, f(min_x), f(max_x), epsilon) # print("Found maximum %f at x = %f in %d evaluations" % (best_value, best_th, binary_search.eval_count)) return best_th, best_value
class GPIOBus(object): """ This is a helper class for when your pins don't line up with ports. """ def __init__(self, pins): self.pins = pins self.width = len(pins) self.max = pow(2, len(pins)) - 1 def write(self, value): if value > self.max: raise AttributeError('{} pins is not enough to represent {}'.format(len(self.pins), value)) for i in range(0, len(self.pins)): self.pins[i].write(value & (1 << i) > 0) def read(self): result = 0 for i in range(0, len(self.pins)): result <<= 1 result |= self.pins[i].read() return result
#!/usr/bin/env python3 ''' homework/data_structure/1_17_k_fib.py count the $(m)th $(k)-Fibonacci number with time complexity of O(n) ''' class FibCache: ''' Acts like heap? Make sure you DON'T re-use the instance! ''' def __init__(self, k): ''' initialize FibCache instance ''' self._max_size = k # pop size self._cursor = 0 # get order self._cache = [] # actual cache # allocate cache space for _ in range(k-1): self._cache.append(0) self._cache.append(1) def _reset(self): ''' init _cache to all 0s NOTE: FibCache can be reused ''' # reset cache for i in range(self._max_size-1): self._cache[i] = 0 self._cache[-1] = 1 # reset cursor self._cursor = 0 def append(self, val): ''' append to LOGICAL tail of cache depricate useless fibonacci value automatically ''' self._cache[self._cursor % self._max_size] = val self._cursor += 1 def _reduce_sum(self): ''' a fancier way of saying - SUM from fib_k(n-1) to fib_k(n-k) ''' return sum(self._cache) def run(self, tgt): ''' starts the calculation session, gives you the result ''' if self._cursor: self._reset() # if not first run -> clean-up if tgt < self._max_size-1: return 0 if tgt == self._max_size-1: return 1 for _ in range(self._max_size, tgt): self.append(self._reduce_sum()) return self._reduce_sum() # the moment of TRUTH! if __name__ == '__main__': k = int(input('k = ')) m = int(input('m = ')) print(FibCache(k).run(m))
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] for number in numbers: # Lewatkan loop untuk angka yang dapat di bagi 3 if number % 3 == 0: continue print(number)
# Conner Skoumal # Matchmaker Lite print("") print("Matchmaker 2021") print("") print("[[Your instruction here.]]") print("") userResponse1 = int(input("Ironclad Robotics rocks!")) desiredResponse1 = 5 compatibility1 = 5 - abs(userResponse1 - desiredResponse1) print("Question 1 Compatibility: " + str(compatibility1)) print("") userResponse2 = int(input("Sports are the best!")) desiredResponse2 = 1 compatibility2 = 5 - abs(userResponse2 - desiredResponse2) print("Question 2 Compatibility: " + str(compatibility2)) print("") totalCompatibility = (compatibility1 + compatibility2) * 10 print("Total Compatability: " + str(totalCompatibility)) print("")
def main(): print("Please enter a sentence: ") user_sentence = input() str_for_checking = prepare_str_for_palindrome_checking(user_sentence) res = is_palindrome(str_for_checking) if(res == True): print("Your sentence is a palindrome") else: print(("Your sentence is not a palindrome")) def prepare_str_for_palindrome_checking(s): only_letters_str = keep_only_letters(s) return only_letters_str.lower() def keep_only_letters(s): res_str = '' for char in s: if char.isalpha() == True: res_str = res_str + char return res_str def is_palindrome(s): rev_s = reverse_str(s) if(s == rev_s): return True else: return False def reverse_str(s): res_str = '' for char in s: res_str = char + res_str return res_str main()
#kpbochenek@gmail.com def swap_sort(array): array = list(array[:]) result = [] for i in range(1, len(array)): j = i-1 k = i while j >= 0 and array[j] > array[k]: array[k], array[j] = array[j], array[k] result.append("%d%d" % (j, k)) j -= 1 k -= 1 return ",".join(result) if __name__ == '__main__': # These "asserts" using only for self-checking and not necessary for auto-testing def check_solution(f, indata): result = f(indata) array = list(indata[:]) la = len(array) if not isinstance(result, str): print("The result should be a string") return False actions = result.split(",") if result else [] for act in actions: if len(act) != 2 or not act.isdigit(): print("The wrong action: {}".format(act)) return False i, j = int(act[0]), int(act[1]) if i >= la or j >= la: print("Index error: {}".format(act)) return False if abs(i - j) != 1: print("The wrong action: {}".format(act)) return False array[i], array[j] = array[j], array[i] if len(actions) > (la * (la - 1)) // 2: print("Too many actions. BOOM!") return False if array != sorted(indata): print("The array is not sorted. BOOM!") return False return True assert check_solution(swap_sort, (6, 4, 2)), "Reverse simple" assert check_solution(swap_sort, (1, 2, 3, 4, 5)), "All right!" assert check_solution(swap_sort, (1, 2, 3, 5, 3)), "One move"
name = "Fahad Hafeez" print(len(name)) if len(name) < 3: print("Name must be at least 3 characters long") elif len(name) > 50: print("Name must be a maximum of 50 characters long") else: print("Name looks good")
#!/usr/bin/env python3 def MakeCaseAgnostic(choices): def find_choice(choice): for key, item in enumerate(choice.lower() for choice in choices): if choice.lower() == item: return choices[key] return choice return find_choice
# Author:周健伟 # 每个用户登录三次,登录成功 #则显示欢迎登录,三次登录失败则 #将该用户锁定。将登录用户从文件中读出, #锁起来的用户也保存在文件中 def login(filename): userName = [] passWord = [] try: data = open(filename) for each_line in data: (username,password)=each_line.strip().split(",") userName.append(username) passWord.append(password) can_login = {} for i in range(0, len(userName)): can_login[userName[i]] = passWord[i] return can_login except IOError as err: print("File open error") finally: data.close() def lock(filename,username): try: data=open(filename,'a') data.write("\n"+username) except IOError as error: print("写入文件失败") finally: data.close() def get_lock_name(filename): lockname=[] data=open(filename) for each_line in data: lockname.append(each_line.strip()) return lockname login_user_passwd=login("username_and_passwd.txt") count=0 while count < 3: temp_username=input("请输入用户名:") temp_password=input("请输入密 码:") if temp_username in get_lock_name("lockusername.txt"): print("你输入的用户已被锁定...") break if temp_username in login_user_passwd.keys(): if login_user_passwd[temp_username]==temp_password : print("welcome ",temp_username) break else: print("sorry,your username or password is not true...") else: print("your username does not exist") count += 1 else: lock("lockusername.txt",temp_username) print("your username is locked....")
class Config(object): def __init__(self): # model params self.model = "AR" self.nsteps = 10 # equivalent to x_len self.msteps = 7 self.nbins = 4 self.attention_size = 16 self.num_filters = 32 self.kernel_sizes = [3] self.l2_lambda = 1e-3 self.hidden_units = 512 self.num_heads = 8 # data params self.data_path = '../data/18579_12_2mins.csv' self.nfeatures = 8 self.x_len = self.nsteps self.y_len = 1 self.mem_len = self.msteps self.foresight = 0 self.dev_ratio = 0.1 self.test_len = 7 self.seed = None # train params self.lr = 1e-3 self.num_epochs = 200 self.batch_size = 32 self.dropout = 0.9 self.nepoch_no_improv = 5 self.clip = 5 self.desc = self._desc() self.allow_gpu = True def _desc(self): desc = "" for mem, val in self.__dict__.items(): desc += mem + ":" + str(val) + ", " return desc if __name__ == "__main__": config = Config() print(config.desc)
# General info COMPANY_NAME = "Shore East" SITENAME = "Cloudy Memory" EMAIL_PREFIX = "[ %s ] " % SITENAME APPNAME = "cloudmemory-app" BASE = "http://%s.appspot.com" % APPNAME API_AUTH = "waywayb4ck" PLAY_STORE_LINK = "" DAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] # Branding CL_PRIMARY = "#409777" CL_PRIMARY_DK = "#275D4A" # Emails APP_OWNER = "onejgordon@gmail.com" # This should be an owner of the cloud project INSTALL_PW = "REPLACEWITHYOURPASSWORD" ADMIN_EMAIL = APP_OWNER ERROR_EMAIL = APP_OWNER NOTIF_EMAILS = [APP_OWNER] SENDER_EMAIL = "%s Notifications <noreply@%s.appspotmail.com>" % (SITENAME, APPNAME) GA_ID = "" SVC_DATA_MCKEY = "%s:%s" # svc:date MEMCACHE_EXPIRE_SECS = 60*60*3 # Flags DEBUG_API = False TEST_VERSIONS = ["test"] MAX_REQUEST_SECONDS = 40 class SERVICE(): # Service Keys GMAIL = "g_mail" GCAL = "g_calendar" GTASKS = "g_tasks" GDRIVE = "g_drive" NYT_NEWS = "nyt_news" # Statuses NOT_LOADED = 0 LOADING = 1 ERROR = 2 LOADED = 3 # Item Types EMAIL = 1 EVENT = 2 PHOTO = 3 TASK = 4 DOCUMENT = 5 NEWS = 6 # Sync with AppConstants SCOPES = { GMAIL: "https://mail.google.com/", GTASKS: "https://www.googleapis.com/auth/tasks.readonly", GCAL: "https://www.googleapis.com/auth/calendar.readonly", GDRIVE: "https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/drive.photos.readonly" } DEFAULT = [] class ERROR(): OK = 0 UNAUTHORIZED = 1 BAD_TOKEN = 2 USER_NOT_FOUND = 3 MALFORMED = 4 AUTH_FAILED = 5 SENSOR_NOT_FOUND = 6 OTHER = 99 LABELS = {OK: "OK", UNAUTHORIZED: "Unauthorized", BAD_TOKEN: "Bad Token", USER_NOT_FOUND: "User not found", MALFORMED: "Malformed Request!", AUTH_FAILED: "Auth failed"} class USER(): USER = 1 ADMIN = 2 LABELS = {USER: "User", ADMIN: "Admin"} COUNTRIES = [ ("US","United States"), ("AF","Afghanistan"), ("AX","Aland Islands"), ("AL","Albania"), ("DZ","Algeria"), ("AS","American Samoa"), ("AD","Andorra"), ("AO","Angola"), ("AI","Anguilla"), ("AQ","Antarctica"), ("AG","Antigua and Barbuda"), ("AR","Argentina"), ("AM","Armenia"), ("AW","Aruba"), ("AU","Australia"), ("AT","Austria"), ("AZ","Azerbaijan"), ("BS","Bahamas"), ("BH","Bahrain"), ("BD","Bangladesh"), ("BB","Barbados"), ("BY","Belarus"), ("BE","Belgium"), ("BZ","Belize"), ("BJ","Benin"), ("BM","Bermuda"), ("BT","Bhutan"), ("BO","Bolivia, Plurinational State of"), ("BQ","Bonaire, Sint Eustatius and Saba"), ("BA","Bosnia and Herzegovina"), ("BW","Botswana"), ("BV","Bouvet Island"), ("BR","Brazil"), ("IO","British Indian Ocean Territory"), ("BN","Brunei Darussalam"), ("BG","Bulgaria"), ("BF","Burkina Faso"), ("BI","Burundi"), ("KH","Cambodia"), ("CM","Cameroon"), ("CA","Canada"), ("CV","Cape Verde"), ("KY","Cayman Islands"), ("CF","Central African Republic"), ("TD","Chad"), ("CL","Chile"), ("CN","China"), ("CX","Christmas Island"), ("CC","Cocos (Keeling) Islands"), ("CO","Colombia"), ("KM","Comoros"), ("CG","Congo"), ("CD","Congo, the Democratic Republic of the"), ("CK","Cook Islands"), ("CR","Costa Rica"), ("CI","Cote d'Ivoire"), ("HR","Croatia"), ("CU","Cuba"), ("CW","Curacao"), ("CY","Cyprus"), ("CZ","Czech Republic"), ("DK","Denmark"), ("DJ","Djibouti"), ("DM","Dominica"), ("DO","Dominican Republic"), ("EC","Ecuador"), ("EG","Egypt"), ("SV","El Salvador"), ("GQ","Equatorial Guinea"), ("ER","Eritrea"), ("EE","Estonia"), ("ET","Ethiopia"), ("FK","Falkland Islands (Malvinas)"), ("FO","Faroe Islands"), ("FJ","Fiji"), ("FI","Finland"), ("FR","France"), ("GF","French Guiana"), ("PF","French Polynesia"), ("TF","French Southern Territories"), ("GA","Gabon"), ("GM","Gambia"), ("GE","Georgia"), ("DE","Germany"), ("GH","Ghana"), ("GI","Gibraltar"), ("GR","Greece"), ("GL","Greenland"), ("GD","Grenada"), ("GP","Guadeloupe"), ("GU","Guam"), ("GT","Guatemala"), ("GG","Guernsey"), ("GN","Guinea"), ("GW","Guinea-Bissau"), ("GY","Guyana"), ("HT","Haiti"), ("HM","Heard Island and McDonald Islands"), ("VA","Holy See (Vatican City State)"), ("HN","Honduras"), ("HK","Hong Kong"), ("HU","Hungary"), ("IS","Iceland"), ("IN","India"), ("ID","Indonesia"), ("IR","Iran, Islamic Republic of"), ("IQ","Iraq"), ("IE","Ireland"), ("IM","Isle of Man"), ("IL","Israel"), ("IT","Italy"), ("JM","Jamaica"), ("JP","Japan"), ("JE","Jersey"), ("JO","Jordan"), ("KZ","Kazakhstan"), ("KE","Kenya"), ("KI","Kiribati"), ("KP","Korea, Democratic People's Republic of"), ("KR","Korea, Republic of"), ("KW","Kuwait"), ("KG","Kyrgyzstan"), ("LA","Lao People's Democratic Republic"), ("LV","Latvia"), ("LB","Lebanon"), ("LS","Lesotho"), ("LR","Liberia"), ("LY","Libya"), ("LI","Liechtenstein"), ("LT","Lithuania"), ("LU","Luxembourg"), ("MO","Macao"), ("MK","Macedonia, the former Yugoslav Republic of"), ("MG","Madagascar"), ("MW","Malawi"), ("MY","Malaysia"), ("MV","Maldives"), ("ML","Mali"), ("MT","Malta"), ("MH","Marshall Islands"), ("MQ","Martinique"), ("MR","Mauritania"), ("MU","Mauritius"), ("YT","Mayotte"), ("MX","Mexico"), ("FM","Micronesia, Federated States of"), ("MD","Moldova, Republic of"), ("MC","Monaco"), ("MN","Mongolia"), ("ME","Montenegro"), ("MS","Montserrat"), ("MA","Morocco"), ("MZ","Mozambique"), ("MM","Myanmar"), ("NA","Namibia"), ("NR","Nauru"), ("NP","Nepal"), ("NL","Netherlands"), ("NC","New Caledonia"), ("NZ","New Zealand"), ("NI","Nicaragua"), ("NE","Niger"), ("NG","Nigeria"), ("NU","Niue"), ("NF","Norfolk Island"), ("MP","Northern Mariana Islands"), ("NO","Norway"), ("OM","Oman"), ("PK","Pakistan"), ("PW","Palau"), ("PS","Palestinian Territory, Occupied"), ("PA","Panama"), ("PG","Papua New Guinea"), ("PY","Paraguay"), ("PE","Peru"), ("PH","Philippines"), ("PN","Pitcairn"), ("PL","Poland"), ("PT","Portugal"), ("PR","Puerto Rico"), ("QA","Qatar"), ("RE","Reunion"), ("RO","Romania"), ("RU","Russian Federation"), ("RW","Rwanda"), ("BL","Saint Barthelemy"), ("SH","Saint Helena, Ascension and Tristan da Cunha"), ("KN","Saint Kitts and Nevis"), ("LC","Saint Lucia"), ("MF","Saint Martin (French part)"), ("PM","Saint Pierre and Miquelon"), ("VC","Saint Vincent and the Grenadines"), ("WS","Samoa"), ("SM","San Marino"), ("ST","Sao Tome and Principe"), ("SA","Saudi Arabia"), ("SN","Senegal"), ("RS","Serbia"), ("SC","Seychelles"), ("SL","Sierra Leone"), ("SG","Singapore"), ("SX","Sint Maarten (Dutch part)"), ("SK","Slovakia"), ("SI","Slovenia"), ("SB","Solomon Islands"), ("SO","Somalia"), ("ZA","South Africa"), ("GS","South Georgia and the South Sandwich Islands"), ("SS","South Sudan"), ("ES","Spain"), ("LK","Sri Lanka"), ("SD","Sudan"), ("SR","Suriname"), ("SJ","Svalbard and Jan Mayen"), ("SZ","Swaziland"), ("SE","Sweden"), ("CH","Switzerland"), ("SY","Syrian Arab Republic"), ("TW","Taiwan, Province of China"), ("TJ","Tajikistan"), ("TZ","Tanzania, United Republic of"), ("TH","Thailand"), ("TL","Timor-Leste"), ("TG","Togo"), ("TK","Tokelau"), ("TO","Tonga"), ("TT","Trinidad and Tobago"), ("TN","Tunisia"), ("TR","Turkey"), ("TM","Turkmenistan"), ("TC","Turks and Caicos Islands"), ("TV","Tuvalu"), ("UG","Uganda"), ("UA","Ukraine"), ("AE","United Arab Emirates"), ("GB","United Kingdom"), ("UM","United States Minor Outlying Islands"), ("UY","Uruguay"), ("UZ","Uzbekistan"), ("VU","Vanuatu"), ("VE","Venezuela, Bolivarian Republic of"), ("VN","Viet Nam"), ("VG","Virgin Islands, British"), ("VI","Virgin Islands, U.S."), ("WF","Wallis and Futuna"), ("EH","Western Sahara"), ("YE","Yemen"), ("ZM","Zambia"), ("ZW","Zimbabwe") ]
# # PySNMP MIB module HUAWEI-MUSA-MA5100-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-MUSA-MA5100-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:32:50 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint") musa, = mibBuilder.importSymbols("HUAWEI-MIB", "musa") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Unsigned32, Gauge32, ObjectIdentity, Counter32, TimeTicks, IpAddress, MibIdentifier, Counter64, Bits, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, ModuleIdentity, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Gauge32", "ObjectIdentity", "Counter32", "TimeTicks", "IpAddress", "MibIdentifier", "Counter64", "Bits", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "ModuleIdentity", "NotificationType") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") class DisplayString(OctetString): pass hwMa5100Mib = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5)) hwMusaSysMib = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1)) hwMusaDevice = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1)) hwMusaEndOfMib = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 100)) hwMusaSysDate = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 9), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSysDate.setStatus('mandatory') hwMusaSysTime = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 10), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSysTime.setStatus('mandatory') hwMusaSysCpuRatio = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSysCpuRatio.setStatus('mandatory') hwMusaHostVersion = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 12), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaHostVersion.setStatus('mandatory') hwMusaResetSys = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 13), Integer32()).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaResetSys.setStatus('mandatory') hwMusaIpAddr = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 14), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaIpAddr.setStatus('mandatory') hwMusaIpMask = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 15), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaIpMask.setStatus('mandatory') hwMusaGatewayIpAddr = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 16), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaGatewayIpAddr.setStatus('mandatory') hwMusaMacAddr = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 17), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaMacAddr.setStatus('mandatory') hwMusaIpAddrPermitTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 18), ) if mibBuilder.loadTexts: hwMusaIpAddrPermitTable.setStatus('mandatory') hwMusaIpAddrPermitEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 18, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaIpPermitTableId")) if mibBuilder.loadTexts: hwMusaIpAddrPermitEntry.setStatus('mandatory') hwMusaIpPermitTableId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 18, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaIpPermitTableId.setStatus('mandatory') hwMusaIpAddrPermitOper = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 18, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("add", 0), ("del", 1), ("modify", 2), ("query", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaIpAddrPermitOper.setStatus('mandatory') hwMusaPermitBeginIp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 18, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaPermitBeginIp.setStatus('mandatory') hwMusaPermitEndIp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 18, 1, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaPermitEndIp.setStatus('mandatory') hwMusaPermitIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 18, 1, 5), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaPermitIpMask.setStatus('mandatory') hwMusaIpAddrRejectTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 19), ) if mibBuilder.loadTexts: hwMusaIpAddrRejectTable.setStatus('mandatory') hwMusaIpAddrRejectEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 19, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaIpRejectTableId")) if mibBuilder.loadTexts: hwMusaIpAddrRejectEntry.setStatus('mandatory') hwMusaIpRejectTableId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 19, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaIpRejectTableId.setStatus('mandatory') hwMusaIpAddrRejectOper = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 19, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("add", 0), ("del", 1), ("modify", 2), ("query", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaIpAddrRejectOper.setStatus('mandatory') hwMusaRejectBeginIp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 19, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaRejectBeginIp.setStatus('mandatory') hwMusaRejectEndIp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 19, 1, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaRejectEndIp.setStatus('mandatory') hwMusaRejectIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 19, 1, 5), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaRejectIpMask.setStatus('mandatory') hwMusaAtmIpAddr = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 20), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaAtmIpAddr.setStatus('mandatory') hwMusaAtmIpMask = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 21), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaAtmIpMask.setStatus('mandatory') hwMusaMtu = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 22), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaMtu.setStatus('mandatory') hwMusaOpticConvergentRate = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 23), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaOpticConvergentRate.setStatus('mandatory') hwMusaCellbusID = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ma5100", 1), ("ma5103", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaCellbusID.setStatus('mandatory') hwMusaResetSlaveMMX = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("loaddata", 1), ("noloaddata", 2)))).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaResetSlaveMMX.setStatus('mandatory') hwMusaBiosVersion = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 26), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaBiosVersion.setStatus('mandatory') hwMusaEthernetFirewall = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaEthernetFirewall.setStatus('mandatory') hwMusaNmsPvcConfTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3), ) if mibBuilder.loadTexts: hwMusaNmsPvcConfTable.setStatus('mandatory') hwMusaNmsPvcConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaNmsPvcIndex")) if mibBuilder.loadTexts: hwMusaNmsPvcConfEntry.setStatus('mandatory') hwMusaNmsPvcIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 1), Integer32()) if mibBuilder.loadTexts: hwMusaNmsPvcIndex.setStatus('mandatory') hwMusaNmsRelayVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsRelayVpi.setStatus('mandatory') hwMusaNmsRelayVci = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsRelayVci.setStatus('mandatory') hwMusaNmsIp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsIp.setStatus('mandatory') hwMusaNmsPvcOper = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("add", 0), ("del", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsPvcOper.setStatus('mandatory') hwMusaNmsRxTraffic = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 8), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsRxTraffic.setStatus('mandatory') hwMusaNmsTxTraffic = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 9), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsTxTraffic.setStatus('mandatory') hwMusaNmsSarVci = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 10), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsSarVci.setStatus('mandatory') hwMusaNmsLLCVC = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("llc", 1), ("vc", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsLLCVC.setStatus('mandatory') hwMusaNmsENCAP = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("eipoa", 0), ("e1483B", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsENCAP.setStatus('mandatory') hwMusaNmsFrameId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 14), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsFrameId.setStatus('mandatory') hwMusaNmsSlotId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 15), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsSlotId.setStatus('mandatory') hwMusaNmsPortVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 3, 1, 16), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsPortVlanId.setStatus('mandatory') hwMusaNmsParaConfTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5), ) if mibBuilder.loadTexts: hwMusaNmsParaConfTable.setStatus('mandatory') hwMusaNmsParaConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaNmsID")) if mibBuilder.loadTexts: hwMusaNmsParaConfEntry.setStatus('mandatory') hwMusaNmsID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))) if mibBuilder.loadTexts: hwMusaNmsID.setStatus('mandatory') hwMusaNmsOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 4, 5))).clone(namedValues=NamedValues(("add", 0), ("del", 1), ("modify", 2), ("active", 4), ("deactive", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsOperState.setStatus('mandatory') hwMusaNmsName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5, 1, 3), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsName.setStatus('mandatory') hwMusaNmsIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5, 1, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsIpAddr.setStatus('mandatory') hwMusaGetCommunity = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5, 1, 5), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaGetCommunity.setStatus('mandatory') hwMusaSetCommunity = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5, 1, 6), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSetCommunity.setStatus('mandatory') hwMusaTrapPort = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaTrapPort.setStatus('mandatory') hwMusaGetSetPort = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5, 1, 8), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaGetSetPort.setStatus('mandatory') hwMusaNmsStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("active", 1), ("deactive", 2), ("commfail", 3), ("uninstall", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaNmsStatus.setStatus('mandatory') hwMusaNmsStyle = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 5, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("bandin", 0), ("bandout", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaNmsStyle.setStatus('mandatory') hwMusaSlotGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6)) hwMusaShelf = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 1)) hwMusaFrame = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 2)) hwMusaSlot = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3)) hwMusaShelfNumber = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaShelfNumber.setStatus('mandatory') hwMusaShelfConfTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 1, 2), ) if mibBuilder.loadTexts: hwMusaShelfConfTable.setStatus('mandatory') hwMusaShelfConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 1, 2, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaShelfIndex")) if mibBuilder.loadTexts: hwMusaShelfConfEntry.setStatus('mandatory') hwMusaShelfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 1, 2, 1, 1), Integer32()) if mibBuilder.loadTexts: hwMusaShelfIndex.setStatus('mandatory') hwMusaShelfType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("other", 1), ("empty", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaShelfType.setStatus('mandatory') hwMusaShelfName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 1, 2, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaShelfName.setStatus('mandatory') hwMusaFrameNumbers = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaFrameNumbers.setStatus('mandatory') hwMusaFrameNumber = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 2, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaFrameNumber.setStatus('mandatory') hwMusaFrameConfTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 2, 2), ) if mibBuilder.loadTexts: hwMusaFrameConfTable.setStatus('mandatory') hwMusaFrameConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 2, 2, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaShelfIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaFrameIndex")) if mibBuilder.loadTexts: hwMusaFrameConfEntry.setStatus('mandatory') hwMusaFrameIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 2, 2, 1, 1), Integer32()) if mibBuilder.loadTexts: hwMusaFrameIndex.setStatus('mandatory') hwMusaFrameType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("other", 1), ("empty", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaFrameType.setStatus('mandatory') hwMusaFrameName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 2, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaFrameName.setStatus('mandatory') hwMusaSlotNumbers = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSlotNumbers.setStatus('mandatory') hwMusaFrameBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 2, 2, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaFrameBandWidth.setStatus('mandatory') hwMusaFrameUsedBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 2, 2, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaFrameUsedBandWidth.setStatus('mandatory') hwMusaSlotNumber = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSlotNumber.setStatus('mandatory') hwMusaSlotConfTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2), ) if mibBuilder.loadTexts: hwMusaSlotConfTable.setStatus('mandatory') hwMusaSlotConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaFrameIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSlotIndex")) if mibBuilder.loadTexts: hwMusaSlotConfEntry.setStatus('mandatory') hwMusaSlotIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))) if mibBuilder.loadTexts: hwMusaSlotIndex.setStatus('mandatory') hwMusaSlotCardType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 25))).clone(namedValues=NamedValues(("null", 0), ("mmx", 1), ("smx", 2), ("adl", 3), ("lanb", 4), ("lana", 5), ("cesa", 6), ("cesb", 7), ("spl", 8), ("fra", 9), ("adlb", 10), ("unknown", 11), ("splb", 12), ("sep", 13), ("smxa", 14), ("smxb", 15), ("pots", 16), ("splc", 18), ("lan", 19), ("adlc", 21), ("adld", 25)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSlotCardType.setStatus('mandatory') hwMusaSlotCardSerial = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSlotCardSerial.setStatus('mandatory') hwMusaSlotCardVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSlotCardVersion.setStatus('mandatory') hwMusaSlotIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 5), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSlotIpAddress.setStatus('mandatory') hwMusaSlotCardAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13))).clone(namedValues=NamedValues(("noinstall", 0), ("normal", 1), ("fault", 2), ("mainnormal", 3), ("mainfault", 4), ("baknormal", 5), ("bakfault", 6), ("forbid", 7), ("config", 8), ("online", 10), ("none", 11), ("commok", 12), ("commfail", 13)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSlotCardAdminStatus.setStatus('mandatory') hwMusaSlotCardOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("del", 0), ("add", 1), ("reset", 2), ("use", 3), ("nouse", 4), ("inverse", 5), ("mmxswitchover", 6), ("delmmxsubboard", 7), ("addaiusubboard", 8), ("delaiusubboard", 9)))).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaSlotCardOperStatus.setStatus('mandatory') hwMusaSlotDescript = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSlotDescript.setStatus('mandatory') hwMusaBoardCellLossPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("low", 0), ("high", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaBoardCellLossPriority.setStatus('mandatory') hwMusaBoardMaxBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("b-155M", 0), ("b-80M", 1), ("b-20M", 2), ("b-4M", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaBoardMaxBandwidth.setStatus('mandatory') hwMusaCpuOccupyRate = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaCpuOccupyRate.setStatus('mandatory') hwMusaQueryMemory = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 12), DisplayString()).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaQueryMemory.setStatus('mandatory') hwMusaLoadProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0))).clone(namedValues=NamedValues(("tftp", 0)))).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaLoadProtocol.setStatus('mandatory') hwMusaLoadContent = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(6, 8, 7))).clone(namedValues=NamedValues(("program", 6), ("data", 8), ("fpga", 7)))).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaLoadContent.setStatus('mandatory') hwMusaLoadTftpServerIp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 15), IpAddress()).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaLoadTftpServerIp.setStatus('mandatory') hwMusaLoadFileName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 16), DisplayString()).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaLoadFileName.setStatus('mandatory') hwMusaLoadOperType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("load", 0), ("upback", 1), ("downback", 2), ("rollback", 3), ("clearflash", 4)))).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaLoadOperType.setStatus('mandatory') hwMusaSlotUpBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 18), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSlotUpBandWidth.setStatus('mandatory') hwMusaSlotDownBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 19), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSlotDownBandWidth.setStatus('mandatory') hwMusaSlotUsedUpBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 20), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSlotUsedUpBandWidth.setStatus('mandatory') hwMusaSlotUsedDownBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSlotUsedDownBandWidth.setStatus('mandatory') hwMusaSlotUpPracticalBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 22), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSlotUpPracticalBandWidth.setStatus('mandatory') hwMusaSlotDownPracticalBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 6, 3, 2, 1, 23), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaSlotDownPracticalBandWidth.setStatus('mandatory') hwMusaOamGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7)) hwMusaOimPhyTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1), ) if mibBuilder.loadTexts: hwMusaOimPhyTable.setStatus('mandatory') hwMusaOimPhyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaFrameIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSlotIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwOIMPortIndex")) if mibBuilder.loadTexts: hwMusaOimPhyEntry.setStatus('mandatory') hwOIMPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: hwOIMPortIndex.setStatus('mandatory') hwMusaSetSrcLoop = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("notloop", 0), ("loop", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSetSrcLoop.setStatus('mandatory') hwMusaSetLineLoop = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("notloop", 0), ("loop", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSetLineLoop.setStatus('mandatory') hwMusaSetUtopiaLoop = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("notloop", 0), ("loop", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSetUtopiaLoop.setStatus('mandatory') hwMusaInsertLOF = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("notinsert", 0), ("insert", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaInsertLOF.setStatus('mandatory') hwMusaInsertLOS = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("notinsert", 0), ("insert", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaInsertLOS.setStatus('mandatory') hwMusaInsertBIP1 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 7), Integer32()).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaInsertBIP1.setStatus('mandatory') hwMusaInsertBIP2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 8), Integer32()).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaInsertBIP2.setStatus('mandatory') hwMusaInsertBIP3 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 9), Integer32()).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaInsertBIP3.setStatus('mandatory') hwMusaInsertLAIS = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("notinsert", 0), ("insert", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaInsertLAIS.setStatus('mandatory') hwMusaInsertPAIS = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("notinsert", 0), ("insert", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaInsertPAIS.setStatus('mandatory') hwMusaInsertLRDI = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("notinsert", 0), ("insert", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaInsertLRDI.setStatus('mandatory') hwMusaOimOpticTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2), ) if mibBuilder.loadTexts: hwMusaOimOpticTable.setStatus('mandatory') hwMusaOimOpticEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaFrameIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSlotIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwOIMPortIndex")) if mibBuilder.loadTexts: hwMusaOimOpticEntry.setStatus('mandatory') hwMusaQueryCurBIP1 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurBIP1.setStatus('mandatory') hwMusaQueryCurBIP2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurBIP2.setStatus('mandatory') hwMusaQueryCurBIP3 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurBIP3.setStatus('mandatory') hwMusaQueryCurLFEBE = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurLFEBE.setStatus('mandatory') hwMusaQueryCurPFEBE = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurPFEBE.setStatus('mandatory') hwMusaQueryCurSendCellNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurSendCellNum.setStatus('mandatory') hwMusaQueryCurReceiveCellNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurReceiveCellNum.setStatus('mandatory') hwMusaQueryCurCorrectHECNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurCorrectHECNum.setStatus('mandatory') hwMusaQueryCurNonCorrectHECNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurNonCorrectHECNum.setStatus('mandatory') hwMusaQueryCurLOCDNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurLOCDNum.setStatus('mandatory') hwMusaQueryCurUnmatchCellNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurUnmatchCellNum.setStatus('mandatory') hwMusaQueryCurOOFNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaQueryCurOOFNum.setStatus('mandatory') hwMusaClearAllAlarmStat = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 13), Integer32()).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaClearAllAlarmStat.setStatus('mandatory') hwMusaClearOIMErrEventStat = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 7, 2, 1, 14), Integer32()).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaClearOIMErrEventStat.setStatus('mandatory') hwMusaWarningCtrlTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 9), ) if mibBuilder.loadTexts: hwMusaWarningCtrlTable.setStatus('mandatory') hwMusaWarningCtrlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 9, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaWarningID")) if mibBuilder.loadTexts: hwMusaWarningCtrlEntry.setStatus('mandatory') hwMusaWarningID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 9, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaWarningID.setStatus('mandatory') hwMusaWarningLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 9, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("notify", 0), ("normal", 1), ("serious", 2), ("fatal", 3), ("default", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaWarningLevel.setStatus('mandatory') hwMusaWarningNmsCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 9, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("off", 0), ("on", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaWarningNmsCtrl.setStatus('mandatory') hwMusaWarningTerminalCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 9, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("off", 0), ("on", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaWarningTerminalCtrl.setStatus('mandatory') hwMusaWarningIsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 9, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("off", 0), ("on", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaWarningIsCount.setStatus('mandatory') hwMusaWarn15MinThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 9, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaWarn15MinThreshold.setStatus('mandatory') hwMusaWarn24HourThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 9, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaWarn24HourThreshold.setStatus('mandatory') hwMusaWarningDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 9, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaWarningDesc.setStatus('mandatory') hwMusaWarningEngDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 9, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaWarningEngDesc.setStatus('mandatory') hwMusaSysRouteTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 10), ) if mibBuilder.loadTexts: hwMusaSysRouteTable.setStatus('mandatory') hwMusaSysRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 10, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSysRouteIndex")) if mibBuilder.loadTexts: hwMusaSysRouteEntry.setStatus('mandatory') hwMusaSysRouteIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 10, 1, 1), Integer32()) if mibBuilder.loadTexts: hwMusaSysRouteIndex.setStatus('mandatory') hwMusaDstIp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 10, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDstIp.setStatus('mandatory') hwMusaDstIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 10, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDstIpMask.setStatus('mandatory') hwMusaGateIp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 10, 1, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaGateIp.setStatus('mandatory') hwMusaSysRouteOper = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 10, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("add", 0), ("del", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSysRouteOper.setStatus('mandatory') hwMusaLoadRateTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 11), ) if mibBuilder.loadTexts: hwMusaLoadRateTable.setStatus('mandatory') hwMusaLoadRateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 11, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaFrameIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSlotIndex")) if mibBuilder.loadTexts: hwMusaLoadRateEntry.setStatus('mandatory') hwMusaLoadRate = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 11, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaLoadRate.setStatus('mandatory') hwMusaLoadType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 11, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("noOper", 0), ("backData", 1), ("dumpData", 2), ("loadData", 3), ("loadProc", 4), ("loadFpga", 5), ("program", 6), ("fpga", 7), ("data", 8)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaLoadType.setStatus('mandatory') hwMusaTrafficTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13), ) if mibBuilder.loadTexts: hwMusaTrafficTable.setStatus('mandatory') hwMusaTrafficEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaTrafficIndex")) if mibBuilder.loadTexts: hwMusaTrafficEntry.setStatus('mandatory') hwMusaTrafficIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5000))) if mibBuilder.loadTexts: hwMusaTrafficIndex.setStatus('mandatory') hwMusaTrafficType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14))).clone(namedValues=NamedValues(("noclpnoscr", 1), ("clpnotaggingnoscr", 2), ("clptaggingnoscr", 3), ("noclpscr", 4), ("clpnotaggingscr", 5), ("clptaggingscr", 6), ("clpnotaggingmcr", 7), ("clptransparentnoscr", 8), ("clptransparentscr", 9), ("noclptaggingnoscr", 10), ("noclpnoscrcdvt", 11), ("noclpscrcdvt", 12), ("clpnotaggingscrcdvt", 13), ("clptaggingscrcdvt", 14)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaTrafficType.setStatus('mandatory') hwMusaServiceClass = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3, 4, 6))).clone(namedValues=NamedValues(("cbr", 2), ("rtVBR", 3), ("nrtVBR", 4), ("ubr", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaServiceClass.setStatus('mandatory') hwMusaRefCount = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaRefCount.setStatus('mandatory') hwMusaRecordState = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("disable", 0), ("enable", 1), ("module", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaRecordState.setStatus('mandatory') hwMusaClp01pcr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaClp01pcr.setStatus('mandatory') hwMusaClp0pcr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaClp0pcr.setStatus('mandatory') hwMusaClp01scr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 8), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaClp01scr.setStatus('mandatory') hwMusaClp0scr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 9), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaClp0scr.setStatus('mandatory') hwMusaMbs = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 10), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaMbs.setStatus('mandatory') hwMusaMcr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 11), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaMcr.setStatus('mandatory') hwMusaCDVT = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 12), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaCDVT.setStatus('mandatory') hwMusaOperat = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("add", 0), ("del", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaOperat.setStatus('mandatory') hwMusaNextTrafficIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 13, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaNextTrafficIndex.setStatus('mandatory') hwMusaCampusPvcConfTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15), ) if mibBuilder.loadTexts: hwMusaCampusPvcConfTable.setStatus('mandatory') hwMusaCampusPvcConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaFrameIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSlotIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaVlanId"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaVlanIciIndex")) if mibBuilder.loadTexts: hwMusaCampusPvcConfEntry.setStatus('mandatory') hwMusaVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaVlanId.setStatus('mandatory') hwMusaVlanIciIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaVlanIciIndex.setStatus('mandatory') hwMusaAdlPortCount = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaAdlPortCount.setStatus('mandatory') hwMusaAdlFrameId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaAdlFrameId.setStatus('mandatory') hwMusaAdlSlotId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaAdlSlotId.setStatus('mandatory') hwMusaAdlPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaAdlPortId.setStatus('mandatory') hwMusaAdlVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 127))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaAdlVpi.setStatus('mandatory') hwMusaAdlVci = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(32, 127))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaAdlVci.setStatus('mandatory') hwMusaToLanTrafficId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1, 9), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaToLanTrafficId.setStatus('mandatory') hwMusaFromLanTrafficId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1, 10), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaFromLanTrafficId.setStatus('mandatory') hwMusaAdlPortOperat = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 15, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("add", 0), ("del", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaAdlPortOperat.setStatus('mandatory') hwMusaOpticBandwidthTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 17), ) if mibBuilder.loadTexts: hwMusaOpticBandwidthTable.setStatus('mandatory') hwMusaOpticBandwidthEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 17, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaFrameIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSlotIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwOIMPortIndex")) if mibBuilder.loadTexts: hwMusaOpticBandwidthEntry.setStatus('mandatory') hwMusaUpOpticMainBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 17, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaUpOpticMainBandWidth.setStatus('mandatory') hwMusaDnOpticMainBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 17, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDnOpticMainBandWidth.setStatus('mandatory') hwMusaCurUsedUpBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 17, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaCurUsedUpBandWidth.setStatus('mandatory') hwMusaCurUsedDownBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 17, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaCurUsedDownBandWidth.setStatus('mandatory') hwMusaUpReservedBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 17, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaUpReservedBandWidth.setStatus('mandatory') hwMusaDownReservedBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 17, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDownReservedBandWidth.setStatus('mandatory') hwMusaUpPracticalBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 17, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaUpPracticalBandWidth.setStatus('mandatory') hwMusaDownPracticalBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 17, 1, 8), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDownPracticalBandWidth.setStatus('mandatory') hwMusaTrafficCbrPcrTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 18), ) if mibBuilder.loadTexts: hwMusaTrafficCbrPcrTable.setStatus('mandatory') hwMusaTrafficCbrPcrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 18, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaCbrPcrIndex")) if mibBuilder.loadTexts: hwMusaTrafficCbrPcrEntry.setStatus('mandatory') hwMusaCbrPcrIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 18, 1, 1), Integer32()) if mibBuilder.loadTexts: hwMusaCbrPcrIndex.setStatus('mandatory') hwMusaCbrPcrValue = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 18, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaCbrPcrValue.setStatus('mandatory') hwMusaCbrPcrRefCount = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 18, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaCbrPcrRefCount.setStatus('mandatory') hwMusaTrafficRtvbrScrTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 19), ) if mibBuilder.loadTexts: hwMusaTrafficRtvbrScrTable.setStatus('mandatory') hwMusaTrafficRtvbrScrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 19, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaRtvbrScrIndex")) if mibBuilder.loadTexts: hwMusaTrafficRtvbrScrEntry.setStatus('mandatory') hwMusaRtvbrScrIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 19, 1, 1), Integer32()) if mibBuilder.loadTexts: hwMusaRtvbrScrIndex.setStatus('mandatory') hwMusaRtvbrScrValue = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 19, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaRtvbrScrValue.setStatus('mandatory') hwMusaRtvbrScrRefCount = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 19, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaRtvbrScrRefCount.setStatus('mandatory') hwMusaPvcTrafficStatisTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 21), ) if mibBuilder.loadTexts: hwMusaPvcTrafficStatisTable.setStatus('mandatory') hwMusaPvcTrafficStatisEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 21, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSPvcIndex")) if mibBuilder.loadTexts: hwMusaPvcTrafficStatisEntry.setStatus('mandatory') hwMusaUpStreamTrafficRx = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 21, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaUpStreamTrafficRx.setStatus('mandatory') hwMusaUpStreamTrafficTx = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 21, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaUpStreamTrafficTx.setStatus('mandatory') hwMusaDownStreamTrafficRx = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 21, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaDownStreamTrafficRx.setStatus('mandatory') hwMusaDownStreamTrafficTx = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 21, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaDownStreamTrafficTx.setStatus('mandatory') hwMusaAllPvcConfTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22), ) if mibBuilder.loadTexts: hwMusaAllPvcConfTable.setStatus('mandatory') hwMusaAllPvcConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaTypeOfPvcPvp"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaCidIndex")) if mibBuilder.loadTexts: hwMusaAllPvcConfEntry.setStatus('mandatory') hwMusaCidIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaCidIndex.setStatus('mandatory') hwMusaSrcFrameId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcFrameId.setStatus('mandatory') hwMuasSrcSlotId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMuasSrcSlotId.setStatus('mandatory') hwMusaSrcPortVlanVccId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcPortVlanVccId.setStatus('mandatory') hwMusaSrcOnuId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcOnuId.setStatus('mandatory') hwMusaSrcBoardVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcBoardVpi.setStatus('mandatory') hwMusaSrcBoardVci = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcBoardVci.setStatus('mandatory') hwMusaSrcPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("uni", 0), ("sdt", 1), ("udt", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcPortType.setStatus('mandatory') hwMusaSrcCescChannelId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 9), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcCescChannelId.setStatus('mandatory') hwMusaSrcCescChannelBitmap = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 10), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcCescChannelBitmap.setStatus('mandatory') hwMusaSrcCescFillDegree = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(20, 47))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcCescFillDegree.setStatus('mandatory') hwMusaSrcFrcDlciType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcFrcDlciType.setStatus('mandatory') hwMusaSrcFrcIwfType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("network11", 0), ("service", 1), ("hdlc", 2), ("networkN1", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcFrcIwfType.setStatus('mandatory') hwMusaSrcFrcActiveStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("block", 0), ("unblock", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcFrcActiveStatus.setStatus('mandatory') hwMusaSrcFrcFreeBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 15), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcFrcFreeBandwidth.setStatus('mandatory') hwMusaSrcApcConnectAttribute = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 16), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcApcConnectAttribute.setStatus('mandatory') hwMusaSrcCescV35N = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 17), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcCescV35N.setStatus('mandatory') hwMusaDestFrameId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 20), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestFrameId.setStatus('mandatory') hwMusaDestSlotId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 21), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestSlotId.setStatus('mandatory') hwMusaDestPortVlanVccId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 22), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestPortVlanVccId.setStatus('mandatory') hwMusaDestOnuId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 23), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestOnuId.setStatus('mandatory') hwMusaDestBoardVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 24), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestBoardVpi.setStatus('mandatory') hwMusaDestBoardVci = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 25), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestBoardVci.setStatus('mandatory') hwMusaDestPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("uni", 0), ("sdt", 1), ("udt", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestPortType.setStatus('mandatory') hwMusaDestCescChannelId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 27), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestCescChannelId.setStatus('mandatory') hwMusaDestCescChannelBitmap = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 28), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestCescChannelBitmap.setStatus('mandatory') hwMusaDestCescFillDegree = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 29), Integer32().subtype(subtypeSpec=ValueRangeConstraint(20, 47))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestCescFillDegree.setStatus('mandatory') hwMusaDestFrcDlciType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 30), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestFrcDlciType.setStatus('mandatory') hwMusaDestFrcIwfType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("network11", 0), ("service", 1), ("hdlc", 2), ("networkN1", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestFrcIwfType.setStatus('mandatory') hwMusaDestFrcActiveStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("block", 0), ("unblock", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestFrcActiveStatus.setStatus('mandatory') hwMusaDestFrcFreeBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 33), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestFrcFreeBandwidth.setStatus('mandatory') hwMusaDestApcConnectAttribute = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 34), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestApcConnectAttribute.setStatus('mandatory') hwMusaDestCescV35N = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 35), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestCescV35N.setStatus('mandatory') hwMusaSrcToDestTraffic = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 38), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaSrcToDestTraffic.setStatus('mandatory') hwMusaDestToSrcTraffic = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 39), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaDestToSrcTraffic.setStatus('mandatory') hwMusaAllPvcOperater = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 40), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("add", 0), ("del", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaAllPvcOperater.setStatus('mandatory') hwMusaTypeOfPvcPvp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 41), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("pvc", 0), ("pvp", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaTypeOfPvcPvp.setStatus('mandatory') hwMusaPvcPvpState = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 22, 1, 42), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("normal", 1), ("invalid", 2), ("delete", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaPvcPvpState.setStatus('mandatory') hwMusaPvcCidTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 23), ) if mibBuilder.loadTexts: hwMusaPvcCidTable.setStatus('mandatory') hwMusaPvcCidEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 23, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaFrameIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSlotIndex"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSrcPortVlanVccId"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSrcOnuId"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSrcBoardVpi"), (0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaSrcBoardVci")) if mibBuilder.loadTexts: hwMusaPvcCidEntry.setStatus('mandatory') hwMusaPvcCid = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 23, 1, 1), Counter32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwMusaPvcCid.setStatus('mandatory') hwMusaPatchOperateTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 24), ) if mibBuilder.loadTexts: hwMusaPatchOperateTable.setStatus('mandatory') hwMusaPatchOperateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 24, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaPatchIdIndex")) if mibBuilder.loadTexts: hwMusaPatchOperateEntry.setStatus('mandatory') hwMusaPatchIdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 24, 1, 1), Integer32()) if mibBuilder.loadTexts: hwMusaPatchIdIndex.setStatus('mandatory') hwMusaPatchLoadProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 24, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("tftp", 1)))).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaPatchLoadProtocol.setStatus('mandatory') hwMusaPatchLoadFilename = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 24, 1, 3), DisplayString()).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaPatchLoadFilename.setStatus('mandatory') hwMusaPatchLoadSerIp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 24, 1, 4), IpAddress()).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaPatchLoadSerIp.setStatus('mandatory') hwMusaPatchOper = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 24, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("activate", 1), ("deactivate", 2), ("load", 3), ("remove", 4), ("run", 5)))).setMaxAccess("writeonly") if mibBuilder.loadTexts: hwMusaPatchOper.setStatus('mandatory') hwMusaPatchTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 25), ) if mibBuilder.loadTexts: hwMusaPatchTable.setStatus('mandatory') hwMusaPatchEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 25, 1), ).setIndexNames((0, "HUAWEI-MUSA-MA5100-MIB", "hwMusaPatchIdIndex")) if mibBuilder.loadTexts: hwMusaPatchEntry.setStatus('mandatory') hwMusaPatchShowIdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 25, 1, 1), Integer32()) if mibBuilder.loadTexts: hwMusaPatchShowIdIndex.setStatus('mandatory') hwMusaPatchCRC = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 25, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaPatchCRC.setStatus('mandatory') hwMusaPatchType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 25, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("c-Commonpatch", 1), ("t-Temporarypatch", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaPatchType.setStatus('mandatory') hwMusaPatchState = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 25, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("run", 1), ("activate", 2), ("deactivate", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaPatchState.setStatus('mandatory') hwMusaPatchCodeAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 25, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaPatchCodeAddress.setStatus('mandatory') hwMusaPatchCodeLength = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 25, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaPatchCodeLength.setStatus('mandatory') hwMusaPatchDataAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 25, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaPatchDataAddress.setStatus('mandatory') hwMusaPatchDataLength = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 25, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaPatchDataLength.setStatus('mandatory') hwMusaPatchFunctionNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 1, 25, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMusaPatchFunctionNumber.setStatus('mandatory') hwMa5100EndOfMib = MibScalar((1, 3, 6, 1, 4, 1, 2011, 2, 6, 5, 100, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMa5100EndOfMib.setStatus('mandatory') mibBuilder.exportSymbols("HUAWEI-MUSA-MA5100-MIB", hwMusaSrcApcConnectAttribute=hwMusaSrcApcConnectAttribute, hwMusaResetSys=hwMusaResetSys, hwMusaWarningID=hwMusaWarningID, hwMusaOimOpticTable=hwMusaOimOpticTable, hwMusaDestFrameId=hwMusaDestFrameId, hwMusaMcr=hwMusaMcr, hwMusaTrafficEntry=hwMusaTrafficEntry, hwMusaFrameUsedBandWidth=hwMusaFrameUsedBandWidth, hwMusaTrafficTable=hwMusaTrafficTable, hwMusaInsertLAIS=hwMusaInsertLAIS, hwMusaShelfType=hwMusaShelfType, hwMusaIpAddrRejectOper=hwMusaIpAddrRejectOper, hwMusaQueryCurNonCorrectHECNum=hwMusaQueryCurNonCorrectHECNum, hwMusaLoadOperType=hwMusaLoadOperType, hwMusaDestBoardVpi=hwMusaDestBoardVpi, hwMusaPatchEntry=hwMusaPatchEntry, hwMusaSrcBoardVci=hwMusaSrcBoardVci, hwMusaShelfConfTable=hwMusaShelfConfTable, hwMusaClp0pcr=hwMusaClp0pcr, hwMusaInsertBIP1=hwMusaInsertBIP1, hwMusaInsertLOS=hwMusaInsertLOS, hwMusaVlanIciIndex=hwMusaVlanIciIndex, hwMusaWarn24HourThreshold=hwMusaWarn24HourThreshold, hwMusaDestFrcIwfType=hwMusaDestFrcIwfType, hwMusaPatchLoadProtocol=hwMusaPatchLoadProtocol, hwMusaEndOfMib=hwMusaEndOfMib, hwMusaIpAddr=hwMusaIpAddr, hwMusaOperat=hwMusaOperat, hwMusaSrcFrcDlciType=hwMusaSrcFrcDlciType, hwMusaSrcFrcIwfType=hwMusaSrcFrcIwfType, hwMusaMtu=hwMusaMtu, hwMusaEthernetFirewall=hwMusaEthernetFirewall, hwMusaCpuOccupyRate=hwMusaCpuOccupyRate, hwMusaClearOIMErrEventStat=hwMusaClearOIMErrEventStat, hwMusaVlanId=hwMusaVlanId, hwMusaFrameConfEntry=hwMusaFrameConfEntry, hwMusaDestApcConnectAttribute=hwMusaDestApcConnectAttribute, hwMusaTypeOfPvcPvp=hwMusaTypeOfPvcPvp, hwMusaDestCescChannelId=hwMusaDestCescChannelId, hwMusaShelfConfEntry=hwMusaShelfConfEntry, hwMusaUpOpticMainBandWidth=hwMusaUpOpticMainBandWidth, hwMusaSysTime=hwMusaSysTime, hwMusaSysRouteOper=hwMusaSysRouteOper, hwMusaPatchOper=hwMusaPatchOper, hwMusaInsertLRDI=hwMusaInsertLRDI, hwMusaOimPhyEntry=hwMusaOimPhyEntry, hwMusaDownStreamTrafficRx=hwMusaDownStreamTrafficRx, hwMusaSlotIndex=hwMusaSlotIndex, hwMusaUpStreamTrafficTx=hwMusaUpStreamTrafficTx, hwMusaFrameConfTable=hwMusaFrameConfTable, hwMusaQueryCurBIP1=hwMusaQueryCurBIP1, hwMusaInsertBIP3=hwMusaInsertBIP3, hwMusaPatchTable=hwMusaPatchTable, hwMusaSrcPortVlanVccId=hwMusaSrcPortVlanVccId, hwMusaClp01pcr=hwMusaClp01pcr, hwMusaQueryCurUnmatchCellNum=hwMusaQueryCurUnmatchCellNum, hwMusaCampusPvcConfTable=hwMusaCampusPvcConfTable, hwMusaSlotConfTable=hwMusaSlotConfTable, hwMusaSysRouteTable=hwMusaSysRouteTable, hwMusaAllPvcConfTable=hwMusaAllPvcConfTable, hwMusaMbs=hwMusaMbs, hwMusaSetLineLoop=hwMusaSetLineLoop, hwMusaSlotNumber=hwMusaSlotNumber, hwOIMPortIndex=hwOIMPortIndex, hwMusaPatchOperateEntry=hwMusaPatchOperateEntry, hwMusaNmsName=hwMusaNmsName, hwMusaIpRejectTableId=hwMusaIpRejectTableId, hwMusaShelfName=hwMusaShelfName, hwMusaPvcCid=hwMusaPvcCid, hwMusaSlotCardVersion=hwMusaSlotCardVersion, hwMusaSrcFrcActiveStatus=hwMusaSrcFrcActiveStatus, hwMusaCurUsedUpBandWidth=hwMusaCurUsedUpBandWidth, hwMusaNmsFrameId=hwMusaNmsFrameId, hwMusaPvcTrafficStatisTable=hwMusaPvcTrafficStatisTable, hwMusaSlotDownPracticalBandWidth=hwMusaSlotDownPracticalBandWidth, hwMusaInsertBIP2=hwMusaInsertBIP2, hwMusaIpMask=hwMusaIpMask, hwMusaNmsIpAddr=hwMusaNmsIpAddr, hwMusaQueryCurSendCellNum=hwMusaQueryCurSendCellNum, hwMusaAdlSlotId=hwMusaAdlSlotId, hwMusaSlotUpPracticalBandWidth=hwMusaSlotUpPracticalBandWidth, hwMusaOimPhyTable=hwMusaOimPhyTable, hwMusaPatchLoadFilename=hwMusaPatchLoadFilename, hwMusaIpAddrPermitOper=hwMusaIpAddrPermitOper, DisplayString=DisplayString, hwMusaLoadTftpServerIp=hwMusaLoadTftpServerIp, hwMusaIpAddrPermitEntry=hwMusaIpAddrPermitEntry, hwMusaNmsTxTraffic=hwMusaNmsTxTraffic, hwMusaNextTrafficIndex=hwMusaNextTrafficIndex, hwMusaCbrPcrIndex=hwMusaCbrPcrIndex, hwMusaToLanTrafficId=hwMusaToLanTrafficId, hwMusaSlotUpBandWidth=hwMusaSlotUpBandWidth, hwMusaAdlPortCount=hwMusaAdlPortCount, hwMusaAdlPortId=hwMusaAdlPortId, hwMusaPatchCodeLength=hwMusaPatchCodeLength, hwMusaPatchDataLength=hwMusaPatchDataLength, hwMusaPermitEndIp=hwMusaPermitEndIp, hwMusaLoadContent=hwMusaLoadContent, hwMusaAllPvcConfEntry=hwMusaAllPvcConfEntry, hwMusaPvcCidEntry=hwMusaPvcCidEntry, hwMusaPvcPvpState=hwMusaPvcPvpState, hwMusaNmsRxTraffic=hwMusaNmsRxTraffic, hwMusaSlotUsedUpBandWidth=hwMusaSlotUsedUpBandWidth, hwMusaNmsPvcConfEntry=hwMusaNmsPvcConfEntry, hwMusaWarningTerminalCtrl=hwMusaWarningTerminalCtrl, hwMusaCellbusID=hwMusaCellbusID, hwMusaSrcCescChannelId=hwMusaSrcCescChannelId, hwMusaFrame=hwMusaFrame, hwMusaSlotCardOperStatus=hwMusaSlotCardOperStatus, hwMusaSrcFrameId=hwMusaSrcFrameId, hwMusaLoadRateTable=hwMusaLoadRateTable, hwMusaSrcFrcFreeBandwidth=hwMusaSrcFrcFreeBandwidth, hwMusaPatchType=hwMusaPatchType, hwMusaFrameType=hwMusaFrameType, hwMusaWarn15MinThreshold=hwMusaWarn15MinThreshold, hwMusaDestCescFillDegree=hwMusaDestCescFillDegree, hwMusaDestBoardVci=hwMusaDestBoardVci, hwMusaCurUsedDownBandWidth=hwMusaCurUsedDownBandWidth, hwMusaMacAddr=hwMusaMacAddr, hwMusaDestCescChannelBitmap=hwMusaDestCescChannelBitmap, hwMusaSysCpuRatio=hwMusaSysCpuRatio, hwMusaIpAddrPermitTable=hwMusaIpAddrPermitTable, hwMusaDestPortType=hwMusaDestPortType, hwMusaSlotDownBandWidth=hwMusaSlotDownBandWidth, hwMusaQueryCurLOCDNum=hwMusaQueryCurLOCDNum, hwMusaQueryCurBIP3=hwMusaQueryCurBIP3, hwMusaSysRouteEntry=hwMusaSysRouteEntry, hwMusaPatchShowIdIndex=hwMusaPatchShowIdIndex, hwMusaAtmIpAddr=hwMusaAtmIpAddr, hwMusaSrcCescV35N=hwMusaSrcCescV35N, hwMusaDestToSrcTraffic=hwMusaDestToSrcTraffic, hwMusaTrafficRtvbrScrEntry=hwMusaTrafficRtvbrScrEntry, hwMusaLoadType=hwMusaLoadType, hwMusaPatchIdIndex=hwMusaPatchIdIndex, hwMusaDownPracticalBandWidth=hwMusaDownPracticalBandWidth, hwMusaInsertPAIS=hwMusaInsertPAIS, hwMusaFrameBandWidth=hwMusaFrameBandWidth, hwMusaQueryCurPFEBE=hwMusaQueryCurPFEBE, hwMusaShelfNumber=hwMusaShelfNumber, hwMusaQueryMemory=hwMusaQueryMemory, hwMusaDestPortVlanVccId=hwMusaDestPortVlanVccId, hwMusaShelfIndex=hwMusaShelfIndex, hwMusaFrameIndex=hwMusaFrameIndex, hwMusaRefCount=hwMusaRefCount, hwMusaTrafficCbrPcrTable=hwMusaTrafficCbrPcrTable, hwMusaWarningDesc=hwMusaWarningDesc, hwMusaPermitIpMask=hwMusaPermitIpMask, hwMusaDestCescV35N=hwMusaDestCescV35N, hwMusaDnOpticMainBandWidth=hwMusaDnOpticMainBandWidth, hwMusaFromLanTrafficId=hwMusaFromLanTrafficId, hwMusaTrapPort=hwMusaTrapPort, hwMusaSrcCescFillDegree=hwMusaSrcCescFillDegree, hwMusaTrafficRtvbrScrTable=hwMusaTrafficRtvbrScrTable, hwMusaSrcPortType=hwMusaSrcPortType, hwMusaPatchCRC=hwMusaPatchCRC, hwMusaServiceClass=hwMusaServiceClass, hwMusaFrameName=hwMusaFrameName, hwMusaNmsPvcIndex=hwMusaNmsPvcIndex, hwMusaSlotNumbers=hwMusaSlotNumbers, hwMusaNmsRelayVpi=hwMusaNmsRelayVpi, hwMusaInsertLOF=hwMusaInsertLOF, hwMusaSlotIpAddress=hwMusaSlotIpAddress, hwMusaClp0scr=hwMusaClp0scr, hwMusaUpReservedBandWidth=hwMusaUpReservedBandWidth, hwMusaCbrPcrRefCount=hwMusaCbrPcrRefCount, hwMusaRtvbrScrRefCount=hwMusaRtvbrScrRefCount, hwMusaCidIndex=hwMusaCidIndex, hwMusaDestSlotId=hwMusaDestSlotId, hwMusaClp01scr=hwMusaClp01scr, hwMusaSlotGroup=hwMusaSlotGroup, hwMusaQueryCurBIP2=hwMusaQueryCurBIP2, hwMusaAdlPortOperat=hwMusaAdlPortOperat, hwMusaOpticConvergentRate=hwMusaOpticConvergentRate, hwMusaNmsParaConfTable=hwMusaNmsParaConfTable, hwMusaLoadRate=hwMusaLoadRate, hwMusaGatewayIpAddr=hwMusaGatewayIpAddr, hwMusaLoadFileName=hwMusaLoadFileName, hwMusaPvcTrafficStatisEntry=hwMusaPvcTrafficStatisEntry, hwMusaSlotCardAdminStatus=hwMusaSlotCardAdminStatus, hwMusaDestOnuId=hwMusaDestOnuId, hwMusaLoadRateEntry=hwMusaLoadRateEntry, hwMusaResetSlaveMMX=hwMusaResetSlaveMMX, hwMusaQueryCurOOFNum=hwMusaQueryCurOOFNum, hwMusaDestFrcActiveStatus=hwMusaDestFrcActiveStatus, hwMusaPatchLoadSerIp=hwMusaPatchLoadSerIp, hwMusaSetCommunity=hwMusaSetCommunity, hwMusaPatchDataAddress=hwMusaPatchDataAddress, hwMa5100EndOfMib=hwMa5100EndOfMib, hwMuasSrcSlotId=hwMuasSrcSlotId, hwMusaUpPracticalBandWidth=hwMusaUpPracticalBandWidth, hwMusaSlotUsedDownBandWidth=hwMusaSlotUsedDownBandWidth, hwMusaNmsStyle=hwMusaNmsStyle, hwMusaNmsENCAP=hwMusaNmsENCAP, hwMusaFrameNumber=hwMusaFrameNumber, hwMusaNmsParaConfEntry=hwMusaNmsParaConfEntry, hwMusaClearAllAlarmStat=hwMusaClearAllAlarmStat, hwMusaSrcOnuId=hwMusaSrcOnuId, hwMusaSrcCescChannelBitmap=hwMusaSrcCescChannelBitmap, hwMusaWarningLevel=hwMusaWarningLevel, hwMusaAllPvcOperater=hwMusaAllPvcOperater, hwMusaPatchState=hwMusaPatchState, hwMusaOpticBandwidthTable=hwMusaOpticBandwidthTable, hwMusaWarningEngDesc=hwMusaWarningEngDesc, hwMusaNmsIp=hwMusaNmsIp, hwMusaIpAddrRejectTable=hwMusaIpAddrRejectTable, hwMusaIpPermitTableId=hwMusaIpPermitTableId, hwMusaSlotCardType=hwMusaSlotCardType, hwMusaGetCommunity=hwMusaGetCommunity, hwMusaSetUtopiaLoop=hwMusaSetUtopiaLoop, hwMusaWarningCtrlEntry=hwMusaWarningCtrlEntry, hwMusaUpStreamTrafficRx=hwMusaUpStreamTrafficRx, hwMusaSlot=hwMusaSlot, hwMusaTrafficCbrPcrEntry=hwMusaTrafficCbrPcrEntry, hwMusaPvcCidTable=hwMusaPvcCidTable, hwMusaDevice=hwMusaDevice, hwMusaSetSrcLoop=hwMusaSetSrcLoop, hwMusaQueryCurCorrectHECNum=hwMusaQueryCurCorrectHECNum, hwMusaSlotCardSerial=hwMusaSlotCardSerial, hwMusaCbrPcrValue=hwMusaCbrPcrValue, hwMusaRtvbrScrValue=hwMusaRtvbrScrValue, hwMusaDstIp=hwMusaDstIp, hwMusaRtvbrScrIndex=hwMusaRtvbrScrIndex, hwMusaTrafficIndex=hwMusaTrafficIndex, hwMusaNmsSlotId=hwMusaNmsSlotId, hwMusaNmsRelayVci=hwMusaNmsRelayVci, hwMusaQueryCurReceiveCellNum=hwMusaQueryCurReceiveCellNum, hwMusaPatchFunctionNumber=hwMusaPatchFunctionNumber, hwMusaPermitBeginIp=hwMusaPermitBeginIp, hwMusaNmsPvcOper=hwMusaNmsPvcOper, hwMusaAdlVci=hwMusaAdlVci, hwMusaSlotConfEntry=hwMusaSlotConfEntry, hwMusaAtmIpMask=hwMusaAtmIpMask, hwMusaDstIpMask=hwMusaDstIpMask, hwMusaOpticBandwidthEntry=hwMusaOpticBandwidthEntry, hwMusaGetSetPort=hwMusaGetSetPort, hwMusaSlotDescript=hwMusaSlotDescript, hwMusaDownStreamTrafficTx=hwMusaDownStreamTrafficTx, hwMusaPatchOperateTable=hwMusaPatchOperateTable, hwMusaIpAddrRejectEntry=hwMusaIpAddrRejectEntry, hwMusaSysDate=hwMusaSysDate, hwMusaWarningIsCount=hwMusaWarningIsCount, hwMusaQueryCurLFEBE=hwMusaQueryCurLFEBE, hwMusaBiosVersion=hwMusaBiosVersion, hwMusaBoardCellLossPriority=hwMusaBoardCellLossPriority, hwMusaPatchCodeAddress=hwMusaPatchCodeAddress, hwMusaRejectBeginIp=hwMusaRejectBeginIp, hwMusaSysMib=hwMusaSysMib, hwMusaRecordState=hwMusaRecordState, hwMusaLoadProtocol=hwMusaLoadProtocol, hwMusaShelf=hwMusaShelf, hwMusaHostVersion=hwMusaHostVersion, hwMusaNmsSarVci=hwMusaNmsSarVci, hwMusaTrafficType=hwMusaTrafficType, hwMusaAdlVpi=hwMusaAdlVpi) mibBuilder.exportSymbols("HUAWEI-MUSA-MA5100-MIB", hwMusaSrcBoardVpi=hwMusaSrcBoardVpi, hwMa5100Mib=hwMa5100Mib, hwMusaRejectIpMask=hwMusaRejectIpMask, hwMusaCampusPvcConfEntry=hwMusaCampusPvcConfEntry, hwMusaNmsPortVlanId=hwMusaNmsPortVlanId, hwMusaGateIp=hwMusaGateIp, hwMusaRejectEndIp=hwMusaRejectEndIp, hwMusaSrcToDestTraffic=hwMusaSrcToDestTraffic, hwMusaNmsID=hwMusaNmsID, hwMusaWarningCtrlTable=hwMusaWarningCtrlTable, hwMusaSysRouteIndex=hwMusaSysRouteIndex, hwMusaCDVT=hwMusaCDVT, hwMusaDestFrcDlciType=hwMusaDestFrcDlciType, hwMusaOamGroup=hwMusaOamGroup, hwMusaBoardMaxBandwidth=hwMusaBoardMaxBandwidth, hwMusaWarningNmsCtrl=hwMusaWarningNmsCtrl, hwMusaDestFrcFreeBandwidth=hwMusaDestFrcFreeBandwidth, hwMusaNmsOperState=hwMusaNmsOperState, hwMusaNmsPvcConfTable=hwMusaNmsPvcConfTable, hwMusaAdlFrameId=hwMusaAdlFrameId, hwMusaNmsStatus=hwMusaNmsStatus, hwMusaNmsLLCVC=hwMusaNmsLLCVC, hwMusaOimOpticEntry=hwMusaOimOpticEntry, hwMusaFrameNumbers=hwMusaFrameNumbers, hwMusaDownReservedBandWidth=hwMusaDownReservedBandWidth)
class Solution: def countPairs(self, deliciousness: List[int]) -> int: """ A good meal is a meal that contains exactly two different food items with a sum of deliciousness equal to a power of two. You can pick any two different foods to make a good meal. Given an array of integers deliciousness where deliciousness[i] is the deliciousness of the i​​​​​​th​​​​​​​​ item of food, return the number of different good meals you can make from this list modulo 109 + 7. Note that items with different indices are considered different even if they have the same deliciousness value. """ possiblesum = [pow(2,i) for i in range(22,-1,-1)] cnt = collections.Counter(deliciousness) ans = 0 for val, count in cnt.items(): for onesum in possiblesum: if onesum<val*2: break if onesum-val in cnt: if val==onesum-val: ans += count*(count-1)/2 else: ans += count*cnt[onesum-val] return int(ans%(10**9+7))
class WeightRegularizerMixin: def __init__(self, regularizer=None, reg_weight=1, **kwargs): super().__init__(**kwargs) self.regularizer = regularizer self.reg_weight = reg_weight def regularization_loss(self, weights): if self.regularizer is None: return 0 return self.regularizer(weights) * self.reg_weight
def whatday(num): if num == 1: return "Sunday" elif num == 2: return "Monday" elif num == 3: return "Tuesday" elif num == 4: return "Wednesday" elif num == 5: return "Thursday" elif num == 6: return "Friday" elif num == 7: return "Saturday" else: return "Wrong, please enter a number between 1 and 7"
# rects using framebuf display.fill(0) for i in range(0, 15): j = 6 * i display.framebuf.fill_rect(j, j, 12, 12, i) display.framebuf.rect(90 - (j), j, 12, 12, i) display.show()
wildcards = dict() ## experiments x params x wildcards['/lustre/projects/project-broaddus/denoise_experiments/flower/e01/n2v2/'] = "mask_{n}_{m}/table.csv" wildcards['/lustre/projects/project-broaddus/denoise_experiments/flower/e01/n2gt/'] = "d{a}/table.csv" wildcards['/lustre/projects/project-broaddus/denoise_experiments/flower/e01/nlm/'] = "d{a}/table.csv" wildcards['/lustre/projects/project-broaddus/denoise_experiments/flower/e01/bm4d/'] = "d{a}/table.csv"
class AlmaException(Exception): class_message = "An exception occurred." def __init__(self, message=None, **kwargs): if message: self._message = message % kwargs else: self._message = self.class_message % kwargs def __repr__(self): return self._message def __str__(self): return self._message class SizeMustBeEqual(AlmaException): class_message = ("Vector size must be equal. " "Current sizes are not: " "%(size1)s != %(size2)s")
def test_get_wallet_not_authenticated(api_client): rsp = api_client.get("/api/wallet/") assert rsp.status_code == 401 def test_get_wallet_success(api_client, wallet): api_client.force_authenticate(wallet.user) rsp = api_client.get("/api/wallet/") assert rsp.status_code == 200 print(rsp.content) assert rsp.json() == { "id": wallet.id, "currencies": [ { "currency": "PLN", "amount": "100.00", }, { "currency": "EUR", "amount": "50.00", }, ], "stocks": [], }
STARTING_CHAR_FOR_SHAPE_NAME = "@" class Shape(object): def __init__(self, name, class_uri, statements): self._name = name self._class_uri = class_uri self._statements = statements @property def name(self): return self._name @property def class_uri(self): return self._class_uri def yield_statements(self): for a_statement in self._statements: yield a_statement def sort_statements(self, callback, reverse=False): self._statements.sort(key=lambda x :callback(x), reverse=reverse)
# # PySNMP MIB module CXLlcFrConv-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CXLlcFrConv-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:33:04 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion") cxLlcFrConv, Alias = mibBuilder.importSymbols("CXProduct-SMI", "cxLlcFrConv", "Alias") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Gauge32, Counter32, ModuleIdentity, IpAddress, iso, TimeTicks, NotificationType, Unsigned32, MibIdentifier, Integer32, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "Counter32", "ModuleIdentity", "IpAddress", "iso", "TimeTicks", "NotificationType", "Unsigned32", "MibIdentifier", "Integer32", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "Counter64") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") class MacAddress(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(6, 6) fixedLength = 6 class SubRef(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 255) llcfrcnvSysRouteConnectInterval = MibScalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 900)).clone(30)).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSysRouteConnectInterval.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSysRouteConnectInterval.setDescription('Determines the number of seconds between route connection attempts by the LLC-2 Frame Relay Convergence layer. Range of Values: 10 - 900 seconds Default Value: 30 seconds Configuration Changed: administrative') llcfrcnvMibLevel = MibScalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvMibLevel.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvMibLevel.setDescription('Used to determine current MIB module release supported by the agent. Object is in decimal.') llcfrcnvSapTable = MibTable((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10), ) if mibBuilder.loadTexts: llcfrcnvSapTable.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapTable.setDescription('This table contains configuration information for each LLC-2 Frame Relay Convergence layer SAP (service access point).') llcfrcnvSapEntry = MibTableRow((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1), ).setIndexNames((0, "CXLlcFrConv-MIB", "llcfrcnvSapNumber")) if mibBuilder.loadTexts: llcfrcnvSapEntry.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapEntry.setDescription('Defines a row in the llcfrcnvSapTable. Each row contains the objects which define a service access point.') llcfrcnvSapNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSapNumber.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapNumber.setDescription('Identifies this SAP (service access point) with a numerical value which must be unique for each LLC-2 Frame Relay Convergence SAP. Value 0 is allocated to the Public SAP (PSAP) used to interface with the FRIM module via IAM. The row associated with value 0 always exists and cannot be deleted. All other SAPs are used to communicate with other higher layer protocols.') llcfrcnvSapRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("invalid", 1), ("valid", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSapRowStatus.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapRowStatus.setDescription('Determines the status of the objects in a table row. Options: invalid (1): Row is flagged, after next reset the values will be disabled and the row is deleted from the table valid (2): Values are enabled Configuration Changed: administrative') llcfrcnvSapAlias = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 3), Alias()).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSapAlias.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapAlias.setDescription('Identifies this service access point by a textual name. Names must be unique across all service access points at all layers. Range of Values: 1 -16 alphanumeric characters (first character must be a letter) Default Value: none Configuration Changed: administrative') llcfrcnvSapSrcLlcSap = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 254)).clone(4)).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSapSrcLlcSap.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapSrcLlcSap.setDescription('Determines the source LLC-2 SAP address associated with this connection. Only even values are allowed (usually assigned as a multiple of 04 hexadecimal). This SAP address should not be confused with the internal SAP numbers used by the LLC-2 layer. Range of Values: 2 - 254 (even values only) Default Value: 4 Configuration Changed: administrative and operative') llcfrcnvSapDstLlcSap = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 254)).clone(4)).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSapDstLlcSap.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapDstLlcSap.setDescription('Determines the destination LLC-2 SAP address associated with this connection. Only even values are allowed (usually assigned as a multiple of 04 hexadecimal). This SAP address should not be confused with the internal SAP numbers used by the LLC-2 layer. Range of Values: 2 - 254 (even values only) Default Value: 4 Configuration Changed: administrative and operative') llcfrcnvSapRouteIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSapRouteIndex.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapRouteIndex.setDescription('Determines the route associated with this SAP (service access point). The value of this object is the llcfrcnvSRIndex which identifies the route in the llcfrcnvSysRouteTable. Multiple SAP entries may use the same system route provided that they have a different llcfrcnvSapSrcLlcSap-llcfrcnvSapDstLlcSap pair. Range of Values: 0 - 64 Note: A value of 0 indicates no route is selected. Default Value: none Related Objects: llcfrcnvSRIndex llcfrcnvSapSrcLlcSap llcfrcnvSapDstLlcSap Configuration Changed: administrative and operative') llcfrcnvSapControl = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("clearStats", 1)))).setMaxAccess("writeonly") if mibBuilder.loadTexts: llcfrcnvSapControl.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapControl.setDescription('Clears all objects that contain statistics for this service access point. Options: clearStats (1) Configuration Changed: administrative and operative') llcfrcnvSapState = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("offLine", 1), ("unbound", 2), ("bound", 3), ("connected", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSapState.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapState.setDescription('Indicates the status of the SAP (service access point). Options: offLine (1): Indicates that the SAP is not configured. unbound (2): Indicates that this SAP is not bound to its companion SAP. bound (3): Indicates that this SAP is bound to its companion SAP. connected (4):.Indicates that this SAP is bound and is available for data transfer.') llcfrcnvSapTxFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSapTxFrames.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapTxFrames.setDescription('Indicates the number of frames transmitted by this service access point.') llcfrcnvSapRxFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSapRxFrames.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapRxFrames.setDescription('Indicates the number of frames received by this service access point.') llcfrcnvSapTxOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSapTxOctets.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapTxOctets.setDescription('Indicates the number of octets transmitted by this service access point.') llcfrcnvSapRxOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSapRxOctets.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapRxOctets.setDescription('Indicates the number of octets received by this service access point.') llcfrcnvSapUnopenedServiceDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSapUnopenedServiceDiscards.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapUnopenedServiceDiscards.setDescription('Indicates the number of frames received and discarded by this service access point because there was no associated connection.') llcfrcnvSapTxResets = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSapTxResets.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapTxResets.setDescription('Indicates the number of connection reset requests issued from this service access point.') llcfrcnvSapRxResets = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSapRxResets.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapRxResets.setDescription('Indicates the number of connection reset requests/indications received by this service access point.') llcfrcnvSapHostMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 16), MacAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSapHostMacAddr.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapHostMacAddr.setDescription('This object specifies the MAC address of the host station to which the FR LLC-2 connection will be established - Used only for SNA BAN Transport. If this object is configured, then it is automatically assumed that BAN will be the SNA transport used. Otherwise, the SNA transport is BNN.') llcfrcnvSapCntrMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 10, 1, 17), MacAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSapCntrMacAddr.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSapCntrMacAddr.setDescription('This object specifies the MAC address of the work station which will be connected to the host - Used only for SNA BAN Transport. If this object is configured, then it is automatically assumed that BAN will be the SNA transport used. Otherwise, the SNA transport is BNN.') llcfrcnvSysRouteTable = MibTable((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11), ) if mibBuilder.loadTexts: llcfrcnvSysRouteTable.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSysRouteTable.setDescription('This table contains information about each LLC-2 FR Convergence system route.') llcfrcnvSysRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11, 1), ).setIndexNames((0, "CXLlcFrConv-MIB", "llcfrcnvSRIndex")) if mibBuilder.loadTexts: llcfrcnvSysRouteEntry.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSysRouteEntry.setDescription('Defines a row in the llcfrcnvSysRouteTable. Each row contains the objects which define an LLC-2 FR Convergence system route.') llcfrcnvSRIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSRIndex.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSRIndex.setDescription('A number that uniquely identifies each LLC-2 Frame Relay Convergence Route. Related Objects: llcfrcnvSapRouteIndex Range of Values: 0 - 64') llcfrcnvSRRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("invalid", 1), ("valid", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSRRowStatus.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSRRowStatus.setDescription('Determines the status of the objects in a table row. Options: invalid (1): Row is flagged, after next reset the values will be disabled and the row is deleted from the table valid (2): Values are enabled Default Value: none Configuration Changed: administrative') llcfrcnvSRDestAlias = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11, 1, 3), Alias()).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSRDestAlias.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSRDestAlias.setDescription('Identifies the textual name of the destination service this route connects to. The destination alias is the name of the Frame Relay layer outlet circuit (frpCircuitAlias). Range of Values: 1 -16 alphanumeric characters (first character must be a letter) Default Value: none Configuration Changed: administrative and operative') llcfrcnvSRControl = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("clearStats", 1)))).setMaxAccess("writeonly") if mibBuilder.loadTexts: llcfrcnvSRControl.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSRControl.setDescription('Permits control of a specific SAP (service access point). Options: clearStats (1): Clear all statistics stored by statistics objects. Configuration Changed: administrative and operative') llcfrcnvSRPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("discard", 1), ("forward", 2), ("priority-low", 3), ("priority-high", 4))).clone('forward')).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSRPriority.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSRPriority.setDescription('Determines the filtering/forwarding action and the forwarding priority for data sent from the STP bridge. Options: discard (1): Do not forward the data. forward (2): Forward the data. priority-low (3): Forward with a low priority (Frame Relay only). priority-high (4): Forward with a high priority (Frame Relay only). Default Value: forward (2) Configuration Changed: Administrative') llcfrcnvSRSubRef = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11, 1, 6), SubRef()).setMaxAccess("readwrite") if mibBuilder.loadTexts: llcfrcnvSRSubRef.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSRSubRef.setDescription('Specifies a reference number that uniquely identifies this route. This number is used by the FRIM (Frame Relay Interface Module) to identify routes using the same DLCI (enables PVC consolidation). This number must be unique for all routes sharing the same DLCI. Range of Values: 1 - 255 (when using PVC consolidation) 0 (when not using PVC consolidation) Default Value: 0 Configuration Changed: administrative and operative') llcfrcnvSRRouteStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("offLine", 1), ("notConnected", 2), ("inProgress", 3), ("connected", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSRRouteStatus.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSRRouteStatus.setDescription('Indicates the status of this route. Options: offLine (1): Indicates that the route is not configured. notConnected (2): Indicates that the remote destination may not exist, or has refused the connection. inProgress (3): Indicates that the connection is in the process of being established. This is a transient state. connected (4): Indicates that the connection is established and is ready for data transfer.') llcfrcnvSRClearStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("noFailure", 1), ("internalError", 2), ("remoteAllocFailure", 3), ("remoteNoAccess", 4), ("remotePvcDown", 5), ("remotePvcBusy", 6), ("localFcnFailure", 7), ("remoteFcnFailure", 8), ("remoteAliasNotFound", 9)))).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSRClearStatus.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSRClearStatus.setDescription('Indicates the status of a failed connection. The value of this object is only valid only between attempts to establish the route connection (llcfrcnvSRRouteStatus = notConnected), and may or may not change after successive failed attempts. Options: noFailure (1): Once a system route has been successfully connected, this value is maintained for the duration of the connection. internalError (2): An internal error has occurred. remoteAllocFailure (3): There is insufficient memory available for FRIM to establish this connection. remoteNoAccess (4): The requested frame relay service does not exist. remotePvcDown (5): The requested Frame Relay outlet circuit is down. remotePvcBusy (6): The requested Frame Relay outlet circuit is already connected. localFcnFailure (7): Flow control negotiation failed. remoteFcnFailure (8): Flow control negotiation failed at the Frame Relay layer. remoteAliasNotFound (9): The destination service alias (llcfrcnvSRDestAlias) does not exist.') llcfrcnvSROutSuccessfullConnects = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSROutSuccessfullConnects.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSROutSuccessfullConnects.setDescription('Indicates the number of successful connections originated for this route. An outgoing connection is always attempted from LLC-2 Frame Relay Convergence to FRIM.') llcfrcnvSROutUnsuccessfullConnects = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 6, 33, 11, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: llcfrcnvSROutUnsuccessfullConnects.setStatus('mandatory') if mibBuilder.loadTexts: llcfrcnvSROutUnsuccessfullConnects.setDescription('Indicates the number of unsuccessful connections originated for this route. An outgoing connection is always attempted from LLC-2 Frame Relay Convergence to FRIM.') mibBuilder.exportSymbols("CXLlcFrConv-MIB", llcfrcnvSapSrcLlcSap=llcfrcnvSapSrcLlcSap, llcfrcnvSysRouteEntry=llcfrcnvSysRouteEntry, llcfrcnvSapState=llcfrcnvSapState, llcfrcnvSapRxFrames=llcfrcnvSapRxFrames, llcfrcnvSapCntrMacAddr=llcfrcnvSapCntrMacAddr, llcfrcnvMibLevel=llcfrcnvMibLevel, llcfrcnvSysRouteTable=llcfrcnvSysRouteTable, llcfrcnvSRSubRef=llcfrcnvSRSubRef, llcfrcnvSROutSuccessfullConnects=llcfrcnvSROutSuccessfullConnects, llcfrcnvSRDestAlias=llcfrcnvSRDestAlias, llcfrcnvSapNumber=llcfrcnvSapNumber, llcfrcnvSapRouteIndex=llcfrcnvSapRouteIndex, llcfrcnvSapTable=llcfrcnvSapTable, llcfrcnvSapEntry=llcfrcnvSapEntry, llcfrcnvSapTxOctets=llcfrcnvSapTxOctets, MacAddress=MacAddress, llcfrcnvSapRxOctets=llcfrcnvSapRxOctets, llcfrcnvSapDstLlcSap=llcfrcnvSapDstLlcSap, llcfrcnvSapRxResets=llcfrcnvSapRxResets, llcfrcnvSysRouteConnectInterval=llcfrcnvSysRouteConnectInterval, llcfrcnvSapUnopenedServiceDiscards=llcfrcnvSapUnopenedServiceDiscards, llcfrcnvSapControl=llcfrcnvSapControl, llcfrcnvSRRouteStatus=llcfrcnvSRRouteStatus, llcfrcnvSapTxResets=llcfrcnvSapTxResets, llcfrcnvSROutUnsuccessfullConnects=llcfrcnvSROutUnsuccessfullConnects, llcfrcnvSapAlias=llcfrcnvSapAlias, SubRef=SubRef, llcfrcnvSRControl=llcfrcnvSRControl, llcfrcnvSRIndex=llcfrcnvSRIndex, llcfrcnvSRRowStatus=llcfrcnvSRRowStatus, llcfrcnvSapRowStatus=llcfrcnvSapRowStatus, llcfrcnvSapTxFrames=llcfrcnvSapTxFrames, llcfrcnvSRClearStatus=llcfrcnvSRClearStatus, llcfrcnvSRPriority=llcfrcnvSRPriority, llcfrcnvSapHostMacAddr=llcfrcnvSapHostMacAddr)
number = int(input("Input an int: ")) oddNum = 1 for x in range(number): print(oddNum) oddNum += 2
""" Tema: Listas, mutabilidad y clonacion. Curso: Pensamiento computacional. Plataforma: Platzi. Profesor: David Aroesti. Alumno: @edinsonrequena. """ a = [1, 2, 3] b = a print(b) print(id(a)) # Aca podemos ver como a y b estan en el mismo lugar de print(id(b)) # memoria, lo que quiere decir que son la misma lista. c = list(a) # Aca estamos clonando lo que hay en a en c. print(c) # Aca podemos ver que tienen los mismos elementos. print(id(c)) # Aca podemos ver que ocupan distintos lugares en memoria, lo que quiere decir que son listas distintas. a.append(5) # Modificamos a, lo que quiere decir que tambien se modifica b print(a) print(c) # Aca como podemos ver no se modifica c porque no ocupa el mismo lugar en memoria que a # ya que anteriormente habiamos clonado los elementos d = a [::] # Otra forma de clonar una lista en otra en donde le indicamos que lo hara desde el indice 0 hasta el ultimo. print(d) print(id(d)) # Aca podemos ver que ocupan distintos lugares en memoria, lo que quiere decir que si se modifica a no se modificara d. e = a [0:2] # Aca clonamos los elementos del 0 al 2 en el indice a print(e) print(id(e)) # Aca podemos ver que ocupa un lugar distinto en memoria.
"""Top-level package for webml.""" __author__ = """BlueML AI""" __email__ = 'james.liang.cje@gmail.com' __version__ = '0.1.0'
''' Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree. ''' # Definition for a binary tree node. class TreeNode(object): def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution(object): def __init__(self, ): self.node_set = {} def _get_node(self, node_val): if node_val in self.node_set: return self.node_set[node_val] else: self.node_set[node_val] = TreeNode(val=node_val) return self.node_set[node_val] def buildTree(self, preorder, inorder): """ :type preorder: List[int] :type inorder: List[int] :rtype: TreeNode """ if not inorder and not preorder: return que = [] que.append((inorder, preorder)) head_node = self._get_node(preorder[0]) while que: length = len(que) for _ in range(length): inorder, preorder = que.pop(0) root = self._get_node(preorder[0]) if len(inorder) == 1: continue for i, node in enumerate(inorder): if node == root.val: break left_inorder = inorder[:i] right_inorder = inorder[i + 1:] left_preorder = preorder[1:len(left_inorder) + 1] right_preorder = preorder[len(left_inorder) + 1:] if left_inorder: que.append((left_inorder, left_preorder)) root.left = self._get_node(left_preorder[0]) if right_inorder: que.append((right_inorder, right_preorder)) root.right = self._get_node(right_preorder[0]) return head_node
class IridaConnectionError(Exception): """ This error is thrown when the api cannot connect to the IRIDA api Either the server is unreachable or the credentials are invalid All calls to the api should expect this error """ pass
set1 = set() set1.add(1) set1.add(3) set1.add(1) set1.add(2) print(set1) set2 = set([1, 3, 5, 7, 9]) print(set2) # union print(set1 | set2) # intersection print(set1 & set2) # difference print(set1 - set2) set3 = {"a", "b"} print(set3) # immutable set set4 = frozenset([9, 10])
"""Setting file for the Cloud SQL guestbook""" CLOUDSQL_INSTANCE = 'ReplaceWithYourInstanceName' DATABASE_NAME = 'guestbook' USER_NAME = 'ReplaceWithYourDatabaseUserName' PASSWORD = 'ReplaceWithYourDatabasePassword'
# -------------- class_1=['Geoffrey Hinton', 'Andrew Ng', 'Sebastian Raschka', 'Yoshua Bengio'] class_2=['Hilary Mason','Carla Gentry', 'Corinna Cortes'] new_class=class_1+class_2 print(new_class) new_class.append('Peter Warden') print(new_class) new_class.remove('Carla Gentry') print(new_class) courses={'Math':65, 'English':70, 'History':80, 'French':70, 'Science':60} print(courses) total=sum(courses.values()) print(total) percentage=total*100/500 print(percentage) mathematics={'Geoffrey Hinton':78, 'Andrew Ng':95, 'Sebastian Raschka':65, 'Yoshua Benjio':50, 'Hilary Mason': 70, 'Corinna Cortes':66, 'Peter Warden':75} print(mathematics) topper=max(mathematics,key=mathematics.get) print(topper) last_name=topper.split()[1] first_name=topper.split()[0] full_name=last_name+" "+first_name certificate_name=full_name.upper() print(certificate_name)
def combo(ls, c): if c == 0: return [[]] l =[] for i in range(0, len(ls)): m = ls[i] remLst = ls[i + 1:] for p in combo(remLst, c-1): l.append([m]+p) return l a =str("input") n =int(input("combo :")) list_1 =[i for i in a] print("combination :",combo(list_1, n))
""" Sample module docstring """ def world(): """ Sample function docstring """ print('world')
# https://www.hackerrank.com/challenges/strange-code/problem def strangeCounter(t): k = 3 while t > k: t -= k k *= 2 return k - t + 1 if __name__ == '__main__': t0 = 6 assert strangeCounter(t0) == 4
SECRET_KEY = 'fake-key' INSTALLED_APPS = [ 'django_mercadopago', 'tests', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } ROOT_URLCONF = 'tests.urls' MERCADOPAGO = { 'autoprocess': False, 'base_host': 'http://localhost:8001', 'success_url': 'mp_success', # Inexistant 'failure_url': 'mp_failure', # Inexistant 'pending_url': 'mp_pending', # Inexistant }
def print_name(firstName, lastName, reverse=False): """ :param firstName: String first name :param lastName: String last name :param reverse: boolean :return: None """ if reverse: print(lastName, ',', firstName) else: print(firstName, lastName) print_name("Eric", "Grimson", True) print_name("Eric", "Grimson", False) print_name("Eric", "Grimson", reverse=False) # We can specify a parameter print_name("Eric", lastName="Grimson", reverse=False) # If we specify each param, then we can change the order print_name(lastName="Grimson", reverse=False, firstName="Erick") print_name("Erick", "Grimson") # If we specified a param in the function we can ignore that param
class PrivateMessage: def __init__(self, type, author, body, filename=None, waID=None, tgID=None): self.type = type self.author = author self.body = body self.waID = waID self.tgID = tgID self.filename = filename class GroupMessage: def __init__(self, type, author, body, title, filename=None, waID=None, tgID=None): self.type = type self.author = author self.body = body self.title = title self.waID = waID self.tgID = tgID self.filename = filename class CreateChat: def __init__(self, title, waID=None, tgID=None): self.title = title self.waID = waID self.tgID = tgID class UpdateChat: def __init__(self, title, picture, participants, waID=None, tgID=None): self.title = title self.picture = picture self.participants = participants self.waID = waID self.tgID = tgID
num01 = int(input('Digite um valor: ')) num02 = int(input('Digite outro valor: ')) soma = num01 + num02 print('A soma entre {} e {} é igual a {}!'.format(num01, num02, soma))
# Create phone number def create_phone_number(n): full_str = ''.join([str(numb) for numb in x]) return f'({full_str[0:3]})' + ' ' + f'{full_str[3:6]}' + '-' + f'{full_str[6:10]}' def create_phone_number_2(x): phone_number = "({}{}{}) {}{}{}-{}{}{}{}".format(*x) return phone_number
# -*- coding: utf-8 -*- def shape(src_str, prefix_str, suffix_str): prefix_pos = src_str.find(prefix_str); if prefix_pos == -1: return None; #endif prefix_pos = prefix_pos + len(prefix_str); temp_str = src_str[prefix_pos:]; suffix_pos = temp_str.find(suffix_str); if suffix_pos == -1: return None; #endif dest_str = temp_str[:suffix_pos]; return dest_str; #enddef if __name__ == '__main__': pass; #end
fileout = open("makeshingles.sh", "w") for i in range(1,57): if i >= 10: s = "0" + str(i) else: s = "00" + str(i) fileout.write("./a.out TEMPF/OUT-" + s + ".txt TEMPK/KEYWORDS-" + s + ".txt\n") fileout.close()
# O código a seguir determina se a pessoa tem idade ou não para votar # Este código é de minha autoria, portanto, difere do que é apresentado no livro (mais simples) ano = 2021 limite = 16 x = 0 y = 0 validos = [] nao_validos = [] while True: eleitor = input('Digite o nome do eleitor: \nOu digite S para encerrar:\n') if eleitor == 's' or (eleitor == 'S'): print('Eleitores verificados com sucesso!') print(f'Foram registrados {x} eleitores válidos e {y} eleitores abaixo da idade de votação!\n') print('Eleitores válidos registrados:') for eleitor in validos: print(eleitor) print('\nEleitores não válidos registrados:') for eleitor in nao_validos: print(eleitor) break else: nascimento_ano = int(input('Digite o ano de nascimento: \n')) idade = ano - nascimento_ano if (ano - nascimento_ano) >= 16: print(f'Você é maior de {limite} anos, portanto tem idade para votar!') validos.append(eleitor.title()) x += 1 else: print(f'Prezado cidadão por você ser menor de {limite} anos ainda não tem idade para votar') print(f'Sua idade é {idade} anos!') nao_validos.append(eleitor.title()) y += 1
""" n & (n - 1) == 0 """ class Solution(object): def isPowerOfTwo(self, n): if n == 0: return False return n & (n - 1) == 0 """ n&(-n) == n """ class Solution(object): def isPowerOfTwo(self, n): if n == 0: return False return n & (-n) == n """ log N """ class Solution(object): def isPowerOfTwo(self, n): if n == 0: return False while n % 2 == 0: n /= 2 return n == 1
# 0: 1: 2: 3: 4: # aaaa .... aaaa aaaa .... # b c . c . c . c b c # b c . c . c . c b c # .... .... dddd dddd dddd # e f . f e . . f . f # e f . f e . . f . f # gggg .... gggg gggg .... # # 5: 6: 7: 8: 9: # aaaa aaaa aaaa aaaa aaaa # b . b . . c b c b c # b . b . . c b c b c # dddd dddd .... dddd dddd # . f e f . f e f . f # . f e f . f e f . f # gggg gggg .... gggg gggg with open('input') as f: values = [line.split(' | ') for line in f.read().strip().split('\n')] # Part 1 count = 0 for _, outputs in values: for o in outputs.split(): count += len(o) in (2, 3, 4, 7) print(count) # 301 # Part 2 mapping = { 'abcefg': '0', 'cf': '1', 'acdeg': '2', 'acdfg': '3', 'bcdf': '4', 'abdfg': '5', 'abdefg': '6', 'acf': '7', 'abcdefg': '8', 'abcdfg': '9', } def decode_signals(signals): tr = {} signals = [set(s) for s in signals] zero_six_nine = list(filter(lambda x: len(x) == 6, signals)) one = next(filter(lambda x: len(x) == 2, signals)) two_three_five = list(filter(lambda x: len(x) == 5, signals)) four = next(filter(lambda x: len(x) == 4, signals)) six = next(filter(lambda x: len(one - x), zero_six_nine)) seven = next(filter(lambda x: len(x) == 3, signals)) eight = next(filter(lambda x: len(x) == 7, signals)) nine = next(filter(lambda x: not len(four - x), zero_six_nine)) zero = next(filter(lambda x: x is not six and x is not nine, zero_six_nine)) two_or_three = next(filter(lambda x: len(six - x) == 2, two_three_five)) tr[next(iter(seven - one))] = 'a' tr[next(iter(four - two_or_three - one))] = 'b' tr[next(iter(one - six))] = 'c' tr[next(iter(eight - zero))] = 'd' tr[next(iter(eight - nine))] = 'e' tr[next(iter(one - (one - six)))] = 'f' tr[next(iter(nine - four - seven))] = 'g' return tr def translate(outputs, tr): return int(''.join(mapping[''.join(sorted(tr[c] for c in o))] for o in outputs)) total = 0 for signals, outputs in values: total += translate(outputs.split(), decode_signals(signals.split())) print(total) # 908067
class Error (Exception): pass class NotEnoughPlayersError (Error): """ when too many cards have been drawn """ def __init__(self, message): self.message = "must have more than one player!" class BetTooSmallError (Error): """ too little has been bet """ def __init__(self, message): self.message = "you must bet at least as much as the prior bet increase!" class BetTooLargeError (Error): """ when the bet is larger than holdings """ def __init__(self, message): self.message = "you have bet more than what you have!"
def subset(array,n,ans): subs = [None]*n helper(n,array,subs,0,ans) return ans def helper(n,array,subs,i,ans): if i==n: lis=[] if any(subs): for j in range(len(subs)): if subs[j]!=None: lis.append(subs[j]) ans.append(lis) else: subs[i]=None helper(n,array,subs,i+1,ans) subs[i]=array[i] helper(n,array,subs,i+1,ans) ans=[] a = subset([1,2,3],3,ans) print(a)
''' Source : https://oj.leetcode.com/problems/maximum-subarray/ Author : Yuan Wang Date : 2018-05-28 /********************************************************************************** * * Find the contiguous subarray within an array (containing at least one number) * which has the largest sum. * * For example, given the array [−2,1,−3,4,−1,2,1,−5,4], * the contiguous subarray [4,−1,2,1] has the largest sum = 6. * * More practice: * * If you have figured out the O(n) solution, try coding another solution using * the divide and conquer approach, which is more subtle. * * **********************************************************************************/ ''' array=[-2,1,-3,4,-1,2,1,-5,4] #array=[4,-1,2] #array=[-1,-2] def maxSubArray(nums): """ :type nums: List[int] :rtype: int """ maxSoFar = nums[0] maxEndingHere = nums[0] for i in range(1,len(nums)): maxEndingHere = max(maxEndingHere+nums[i],nums[i]) maxSoFar = max(maxSoFar,maxEndingHere) print(maxEndingHere,maxSoFar) return maxSoFar def maxSubArrayB(nums): total = nums[0] if len(nums) == 1: return nums[0] for i in range(len(nums)): for j in range(1,len(nums)+1): sub_array = nums[i:j] if len(sub_array) != 0: sum_array = sum(sub_array) if sum_array > total: total = sum_array return total #DP, to check previous sum, reset it to 0 if it's less than 0 #O(n-1) time, O(1) space def maxSubArrayC(nums): res = nums[0] sum_array = nums[0] for i in range(1,len(nums)): #sum_array=max(sum_array,0)+nums[i] sum_array = 0+nums[i] if sum_array < 0 else sum_array+nums[i] res = max(res,sum_array) return res print(maxSubArrayC(array))
while True: username = input("Enter username: ") if username == 'pypy': break else: continue
lados = [float(x) for x in input().split()] lados.sort() lados = lados[::-1] a, b, c = list(lados) if a >= b + c: print('NAO FORMA TRIANGULO') else: if a ** 2 == b ** 2 + c ** 2: print('TRIANGULO RETANGULO') if a ** 2 > b ** 2 + c ** 2: print('TRIANGULO OBTUSANGULO') if a ** 2 < b ** 2 + c ** 2: print('TRIANGULO ACUTANGULO') if a == b == c: print('TRIANGULO EQUILATERO') if a == b != c or a != b == c or a == c != b: print('TRIANGULO ISOSCELES')
char = [] string = "ppphhpphhppppphhhhhhhpphhpppphhpphpp" for i in range(len(string)): if string[i] == 'p' or string[i] == 'P': char.append('P') else: char.append('H') print(char)
def pal(p): # str.isalpha is function form of the method .isalpha() np = list(filter(str.isalpha, p.lower())) # remove non-letters return np == np[::-1] and len(np) > 0 # check if palindrome # py.test exercise_10_26_16.py --cov=exercise_10_26_16.py --cov-report=html def test_pal(): assert pal('mom') assert pal('dog') is False assert pal('9874^&') is False assert pal("Go hang a salami I'm a lasagna hog.") if __name__ == '__main__': t = input("Text: ") print(pal(t))
class Student(object): def __init__(self,name,age,china,math,english): self.__name=name self.__age=age self.__c=china self.__m=math self.__e=english if self.__c<0 or self.__c>100 or self.__m<0 or self.__m>100 or self.__e<0 or self.__e>100: raise ValueError("数字不在有效内") def get_name(self): return str(self.__name) def get_age(self): return int(self.__age) def get_course(self): return max(self.__c,self.__m,self.__e) s=Student("huang",23,101,90,88) try: print("最高分是:{}".format(s.get_course())) except ValueError as e: print("exception:%s"%e)
# Desafio 1 n1 = float(input('Digite um número!! ')) n2 = float(input('Agora outro!!! ')) s = int( n1 / n2 ) print('A divisão entre {} e {} é {}'.format(n1, n2, s))
class ParkingSystem: # # Instance Variables (Accepted), O(1) time, O(1) space wrt addCar # def __init__(self, big: int, medium: int, small: int): # self.big = big # self.medium = medium # self.small = small # def addCar(self, carType: int) -> bool: # if carType == 1: # if self.big > 0: # self.big -= 1 # return True # elif carType == 2: # if self.medium > 0: # self.medium -= 1 # return True # else: # if self.small > 0: # self.small -= 1 # return True # return False # # Hashmap (Accepted), O(1) time and space wrt addCar # def __init__(self, big: int, medium: int, small: int): # self.spaces = {} # self.spaces[1] = big # self.spaces[2] = medium # self.spaces[3] = small # def addCar(self, carType: int) -> bool: # if self.spaces[carType] > 0: # self.spaces[carType] -= 1 # return True # return False # Array (Top Voted), O(1) time, O(1) space wrt addCar def __init__(self, big, medium, small): self.A = [big, medium, small] def addCar(self, carType): self.A[carType - 1] -= 1 return self.A[carType - 1] >= 0 # Your ParkingSystem object will be instantiated and called as such: # obj = ParkingSystem(big, medium, small) # param_1 = obj.addCar(carType)
numero = int(input("Introduzca el numero= ")) if numero >= 10: numero *= 3 print(numero) else: numero *=4 print(numero)
#Week1 #Exercise 1: Use input to ask name, age, and hometown. #Print Hello, my name is {}. I am {} years old and I live in {} name=input("Enter your name: ") age=input("Enter your age: ") hometown=input("Enter your hometown: ") print("Hello, my name is {}. I am {} years old and I live in {}".format(name, age, hometown)) #Exercise 2: Use input to ask 3 numbers #Print average of these 3 numbers number1=float(input("Enter your number1: ")) number2=float(input("Enter your number2: ")) number3=float(input("Enter your number3: ")) print((number1+number2+number3)/3) #Exercise 3: Use input to ask gpa of student #If gpa bigger than 9.0 print excellent #if gpa bigger than 6.5 print good #If gpa bigger than 5.0 print average #Else print Weak gpa=float(input("Your gpa: ")) if gpa>=9: print("excellent") elif gpa>=6.5: print("good") elif gpa>=5.0: print("average") #Exercise 4: Use input to ask a number #After that print result of number after going through flow chart in this link #https://drive.google.com/file/d/1CXpx60fYVfJGWxP79jlwADtn2aNjj1Ju/view?usp=sharing x=int(input("enter your number: ")) if(x<5): x=x*10 if(x<2): x=x-6 else: x=x+5 elif (x>10): x=x*x else: x=x*6 print(x) #Week2 #Exercise 5: Use input to ask number #Print every number divisible by three from 1 to this number number=int(input("Enter your number: ")) for i in range(1,number+1): if(i%3==0): print(i) #Exercise 6: Use input to ask number #Print yes if this number is a prime number, else print no #Method 1: prime=True number=int(input("Enter your number: ")) for i in range(2, number): if(number%i==0): prime = False break if prime==True: print("Yes") else: print("No") #Method 2: count=0 number=int(input("Enter your number: ")) for i in range(1, number+1): if(number%i==0): count+=1 if(count==2): print("Yes") else: print("No") #We have list zoo = ['cat', 'elephant', 'panda', 'lion'] #Exercise 7: Print the number of animal in zoo zoo = ['cat', 'elephant', 'panda', 'lion'] print(len(zoo)) #Exercise 8: Use input to ask a animal #If this animal is not already in zoo print zoo after adding this animal #Else print This animal already in zoo and ask again (#Hint: use while) repeat=True while repeat: animal=input("Enter your animal: ") if animal in zoo: print("This animal already in zoo") else: zoo.append(animal) repeat=False
class Solution: def binaryGap(self, N): """ :type N: int :rtype: int """ dis = 0 last = 0 now = 1 while N > 0: bit = N & 0x01 if bit == 1 and last == 0: last = now elif bit == 1: dis = max(dis, now - last) last = now N >>= 1 now += 1 return dis if __name__ == '__main__': solution = Solution() print(solution.binaryGap(22)) print(solution.binaryGap(5)) print(solution.binaryGap(6)) print(solution.binaryGap(8)) else: pass
# parsetab.py # This file is automatically generated. Do not edit. _tabversion = '3.2' _lr_method = 'LALR' _lr_signature = '\x126h\x8d\xec\x81\xa9\x13 O\x084\xd7\xbc\xd3\x17' _lr_action_items = {'RPAREN':([1,2,4,8,11,12,13,14,15,],[-1,-7,-6,13,-5,-4,-8,-2,-3,]),'DIVIDE':([1,2,4,11,12,13,14,15,],[6,-7,-6,-5,-4,-8,6,6,]),'NUMBER':([0,3,6,7,9,10,],[2,2,2,2,2,2,]),'TIMES':([1,2,4,11,12,13,14,15,],[7,-7,-6,-5,-4,-8,7,7,]),'PLUS':([1,2,4,5,8,11,12,13,14,15,],[-1,-7,-6,9,9,-5,-4,-8,-2,-3,]),'LPAREN':([0,3,6,7,9,10,],[3,3,3,3,3,3,]),'MINUS':([1,2,4,5,8,11,12,13,14,15,],[-1,-7,-6,10,10,-5,-4,-8,-2,-3,]),'$end':([1,2,4,5,11,12,13,14,15,],[-1,-7,-6,0,-5,-4,-8,-2,-3,]),} _lr_action = { } for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_action: _lr_action[_x] = { } _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'term':([0,3,9,10,],[1,1,14,15,]),'expression':([0,3,],[5,8,]),'factor':([0,3,6,7,9,10,],[4,4,11,12,4,4,]),} _lr_goto = { } for _k, _v in _lr_goto_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_goto: _lr_goto[_x] = { } _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> expression","S'",1,None,None,None), ('expression -> term','expression',1,'p_expression_term','/Users/a1070571/Documents/GitHub/muddy/src/muddy/muddy/language/compute.py',53), ('expression -> expression PLUS term','expression',3,'p_expression_plus','/Users/a1070571/Documents/GitHub/muddy/src/muddy/muddy/language/compute.py',57), ('expression -> expression MINUS term','expression',3,'p_expression_minus','/Users/a1070571/Documents/GitHub/muddy/src/muddy/muddy/language/compute.py',61), ('term -> term TIMES factor','term',3,'p_term_times','/Users/a1070571/Documents/GitHub/muddy/src/muddy/muddy/language/compute.py',65), ('term -> term DIVIDE factor','term',3,'p_term_divide','/Users/a1070571/Documents/GitHub/muddy/src/muddy/muddy/language/compute.py',69), ('term -> factor','term',1,'p_term_factor','/Users/a1070571/Documents/GitHub/muddy/src/muddy/muddy/language/compute.py',73), ('factor -> NUMBER','factor',1,'p_factor_num','/Users/a1070571/Documents/GitHub/muddy/src/muddy/muddy/language/compute.py',77), ('factor -> LPAREN expression RPAREN','factor',3,'p_factor_expr','/Users/a1070571/Documents/GitHub/muddy/src/muddy/muddy/language/compute.py',81), ]
# https://leetcode.com/problems/license-key-formatting/ class Solution: def licenseKeyFormatting(self, S, K): """ :type S: str :type K: int :rtype: str """ S = ''.join(s.upper() for s in S if s.isalnum()) first_group = len(S) % K out = [] is_first_group = first_group > 0 i = 0 for s in S: if is_first_group and i == first_group: is_first_group = False out.append('-') i = 0 if is_first_group: out.append(s) else: out.append(s) if i == K - 1: out.append('-') i = (i + 1) % K if out and out[-1] == '-': out.pop() return ''.join(out)
# # PySNMP MIB module PDN-SYSLOG-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PDN-SYSLOG-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:30:50 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint") entPhysicalIndex, = mibBuilder.importSymbols("ENTITY-MIB", "entPhysicalIndex") pdn_syslog, = mibBuilder.importSymbols("PDN-HEADER-MIB", "pdn-syslog") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") Integer32, TimeTicks, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Gauge32, Bits, ModuleIdentity, Counter64, Unsigned32, MibIdentifier, ObjectIdentity, Counter32, iso = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "TimeTicks", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Gauge32", "Bits", "ModuleIdentity", "Counter64", "Unsigned32", "MibIdentifier", "ObjectIdentity", "Counter32", "iso") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") pdnSyslog = ModuleIdentity((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1)) pdnSyslog.setRevisions(('2003-02-13 00:00', '2001-11-15 00:00', '2001-04-10 00:00', '2001-08-09 00:00', '2000-04-24 00:00', '2000-02-05 00:00',)) if mibBuilder.loadTexts: pdnSyslog.setLastUpdated('200302130000Z') if mibBuilder.loadTexts: pdnSyslog.setOrganization('Paradyne Networks MIB Working Group') pdnSyslogConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 14)) pdnSyslogStatus = MibScalar((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disable", 1), ("enable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pdnSyslogStatus.setStatus('current') pdnSyslogIPAddr = MibScalar((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: pdnSyslogIPAddr.setStatus('current') pdnSyslogLevel = MibScalar((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("emerg", 1), ("err", 2), ("norm", 3), ("info", 4))).clone('norm')).setMaxAccess("readwrite") if mibBuilder.loadTexts: pdnSyslogLevel.setStatus('deprecated') pdnSyslogPort = MibScalar((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 4), Integer32().clone(514)).setMaxAccess("readwrite") if mibBuilder.loadTexts: pdnSyslogPort.setStatus('current') pdnSyslogSeverityThreshold = MibScalar((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("emerg", 0), ("alert", 1), ("critical", 2), ("error", 3), ("warning", 4), ("notice", 5), ("info", 6), ("debug", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pdnSyslogSeverityThreshold.setStatus('current') pdnSyslogRemoteDaemon = MibScalar((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disable", 1), ("enable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pdnSyslogRemoteDaemon.setStatus('current') pdnSyslogTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 7), ) if mibBuilder.loadTexts: pdnSyslogTable.setStatus('current') pdnSyslogEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 7, 1), ).setIndexNames((0, "PDN-SYSLOG-MIB", "pdnSyslogNumber")) if mibBuilder.loadTexts: pdnSyslogEntry.setStatus('current') pdnSyslogNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 7, 1, 1), Integer32()) if mibBuilder.loadTexts: pdnSyslogNumber.setStatus('current') pdnSyslogMessage = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 7, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1024, 1024)).setFixedLength(1024)).setMaxAccess("readonly") if mibBuilder.loadTexts: pdnSyslogMessage.setStatus('current') pdnEntitySyslogTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 13), ) if mibBuilder.loadTexts: pdnEntitySyslogTable.setStatus('current') pdnEntitySyslogEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 13, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"), (0, "PDN-SYSLOG-MIB", "pdnEntitySyslogNumber")) if mibBuilder.loadTexts: pdnEntitySyslogEntry.setStatus('current') pdnEntitySyslogNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 13, 1, 1), Integer32()) if mibBuilder.loadTexts: pdnEntitySyslogNumber.setStatus('current') pdnEntitySyslogMessage = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 13, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1024, 1024)).setFixedLength(1024)).setMaxAccess("readonly") if mibBuilder.loadTexts: pdnEntitySyslogMessage.setStatus('current') pdnSyslogNumOfMsgInTable = MibScalar((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pdnSyslogNumOfMsgInTable.setStatus('current') pdnSyslogMaxTableSize = MibScalar((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pdnSyslogMaxTableSize.setStatus('current') pdnSyslogClearTable = MibScalar((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("noOp", 1), ("clear", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pdnSyslogClearTable.setStatus('current') pdnSyslogMsgToConsole = MibScalar((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disable", 1), ("enable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pdnSyslogMsgToConsole.setStatus('current') pdnSyslogRateLimiting = MibScalar((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disable", 1), ("enable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pdnSyslogRateLimiting.setStatus('current') pdnSyslogCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 14, 1)) pdnSyslogGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 14, 2)) pdnSyslogCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 14, 1, 1)).setObjects(("PDN-SYSLOG-MIB", "pdnSyslogGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): pdnSyslogCompliance = pdnSyslogCompliance.setStatus('current') pdnSyslogGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 14, 2, 1)).setObjects(("PDN-SYSLOG-MIB", "pdnSyslogStatus"), ("PDN-SYSLOG-MIB", "pdnSyslogIPAddr"), ("PDN-SYSLOG-MIB", "pdnSyslogPort"), ("PDN-SYSLOG-MIB", "pdnSyslogSeverityThreshold"), ("PDN-SYSLOG-MIB", "pdnSyslogRemoteDaemon"), ("PDN-SYSLOG-MIB", "pdnSyslogMessage"), ("PDN-SYSLOG-MIB", "pdnSyslogNumOfMsgInTable"), ("PDN-SYSLOG-MIB", "pdnSyslogMaxTableSize"), ("PDN-SYSLOG-MIB", "pdnSyslogClearTable"), ("PDN-SYSLOG-MIB", "pdnSyslogMsgToConsole"), ("PDN-SYSLOG-MIB", "pdnSyslogRateLimiting")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): pdnSyslogGroup = pdnSyslogGroup.setStatus('current') pdnSyslogOptionalGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 14, 2, 2)).setObjects(("PDN-SYSLOG-MIB", "pdnEntitySyslogMessage")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): pdnSyslogOptionalGroup = pdnSyslogOptionalGroup.setStatus('current') pdnSyslogDeprecatedGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 31, 14, 2, 3)).setObjects(("PDN-SYSLOG-MIB", "pdnSyslogLevel")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): pdnSyslogDeprecatedGroup = pdnSyslogDeprecatedGroup.setStatus('deprecated') mibBuilder.exportSymbols("PDN-SYSLOG-MIB", pdnSyslogRemoteDaemon=pdnSyslogRemoteDaemon, pdnSyslogLevel=pdnSyslogLevel, pdnEntitySyslogNumber=pdnEntitySyslogNumber, pdnSyslogCompliance=pdnSyslogCompliance, pdnSyslogOptionalGroup=pdnSyslogOptionalGroup, pdnSyslogSeverityThreshold=pdnSyslogSeverityThreshold, PYSNMP_MODULE_ID=pdnSyslog, pdnSyslogMaxTableSize=pdnSyslogMaxTableSize, pdnSyslogIPAddr=pdnSyslogIPAddr, pdnSyslogTable=pdnSyslogTable, pdnSyslogMessage=pdnSyslogMessage, pdnSyslogRateLimiting=pdnSyslogRateLimiting, pdnSyslogClearTable=pdnSyslogClearTable, pdnEntitySyslogEntry=pdnEntitySyslogEntry, pdnSyslogNumber=pdnSyslogNumber, pdnSyslogConformance=pdnSyslogConformance, pdnSyslogEntry=pdnSyslogEntry, pdnSyslogCompliances=pdnSyslogCompliances, pdnSyslogMsgToConsole=pdnSyslogMsgToConsole, pdnEntitySyslogTable=pdnEntitySyslogTable, pdnEntitySyslogMessage=pdnEntitySyslogMessage, pdnSyslogNumOfMsgInTable=pdnSyslogNumOfMsgInTable, pdnSyslogGroups=pdnSyslogGroups, pdnSyslog=pdnSyslog, pdnSyslogGroup=pdnSyslogGroup, pdnSyslogStatus=pdnSyslogStatus, pdnSyslogDeprecatedGroup=pdnSyslogDeprecatedGroup, pdnSyslogPort=pdnSyslogPort)
BASE_NAME = "GTR Tool Rack Stereo" BUFFER_SIZE = 255 def main(): log('\n') # Get the track name proj_index = 0 track_index = 0 track = RPR_GetTrack(proj_index, track_index) response = RPR_GetSetMediaTrackInfo_String(track, 'P_NAME', '', False) (succeeded, track, param_name, track_name, set_new_value) = response if not succeeded: log('Failed to get the name for the default track in the default project: {}'.format(response)) return log('Current track name: {}'.format(track_name)) current_preset_index = 1 # Check if the track name already has the base name if track_name.startswith(BASE_NAME): # Get the current index and increment it track_name_parts = track_name.split('_') if len(track_name_parts) != 2: log('Track name does not match the expected format: {}'.format(track_name)) else: current_preset_index = int(track_name_parts[1]) log('Current preset index: {}'.format(current_preset_index)) if current_preset_index < 1: log('Could not reliably parse the current preset index: {}'.format(current_preset_index)) current_preset_index = 1 else: current_preset_index += 1 # Now set the name track_name = '{}_{}'.format(BASE_NAME, current_preset_index) log('New track name: {}'.format(track_name)) response = RPR_GetSetMediaTrackInfo_String(track, 'P_NAME', track_name, True) (succeeded, track, param_name, track_name, set_new_value) = response if not succeeded: log('Failed to update the track name to the new name: {}'.format(response)) return log('Success!') def log(string): RPR_ShowConsoleMsg('{}{}'.format(string,'\n')) if __name__ == "__main__": main()
""" notation_instances.py """ population = [{ 'Name': 'Shlaer-Mellor', 'About': 'Source of Executable UML / xUML modeling semantics', 'Why use it': 'Designed for fast easy hand drawing.Great for whiteboards and notes!' }, { 'Name': 'Starr', 'About': 'Stealth mode! Mimimal drawing clutter to put the focus on the subject. Easy to draw online', 'Why use it': 'Stealth mode! Mimimal drawing clutter to put the focus on the subject. Easy to draw online' }, { 'Name': 'xUML', 'About': 'AKA, Executable UML. Usage of UML to represent executable semantics', 'Why use it': 'Standards conformance. You are showing diagram to someone who knows, uses or must use UML' }]
def isPrime(n): # 1 is not a prime number by definition if n < 2: return False return sum(d for d in xrange(2, n) if n % d == 0) == 0 def UnitTests(): assert isPrime(1) == False assert isPrime(2) == True assert isPrime(3) == True assert isPrime(4) == False assert isPrime(13) == True assert isPrime(23) == True assert isPrime(30011) == True assert isPrime(1009) == True assert isPrime(17 * 19) == False assert isPrime(16) == False assert isPrime(101) UnitTests()
""" 딕셔너리 구현하기 """ class Dict: def __init__(self): self.items = [None] * 8 def put(self, key, value): idx = hash(key) % len(self.items) self.items[idx] = value def get(self, key): idx = hash(key) % len(self.items) return self.items[idx] my_dict = Dict() my_dict.put("test", 3) value = my_dict.get("test") print(value)
# pylint: disable=missing-module-docstring __all__ = [ 'conftest', 'standard', 'test_main_layout', 'test_root_index', 'utils', ]
# Check input files to see if 200 sample id's match def main(): file_a = "1kg-200samples.tsv" file_b = "1000genomes.low_coverage.GRCh38DH.alignment.index" sample_ids_a = [] sample_ids_b = [] fh_a = open(file_a, "r") fh_a.readline() for line in fh_a: sample_id = line.strip().split("\t")[-1] sample_ids_a.append(sample_id) fh_b = open(file_b, "r") for line in fh_b: sample_id = line.rstrip().split("\t")[0].split("/")[-1].split(".")[0] sample_ids_b.append(sample_id) sorted_samples_a = ",".join(sorted(sample_ids_a)) sorted_samples_b = ",".join(sorted(sample_ids_b)) if sorted_samples_a == sorted_samples_b: print("EQUAL") else: print("NOT EQUAL") if __name__ == "__main__": main()
def solution(X, A): leaves = set(range(1, X+1)) for second, leaf in enumerate(A): if leaf in leaves: leaves.remove(leaf) if not leaves: return second return -1 def test_solution(): assert solution(5, [1, 3, 1, 4, 2, 3, 5, 4]) == 6
def frequency(lst, search_term): """Return frequency of term in lst. >>> frequency([1, 4, 3, 4, 4], 4) 3 >>> frequency([1, 4, 3], 7) 0 """ d = {} for x in lst: if x in d: d[x] = d[x] + 1 else: d[x] = 1 if search_term in d: return d[search_term] return 0
# -------------------- PATH --------------------- #ROOT_PATH = "/local/data2/pxu4/TypeClassification" ROOT_PATH = "." DATA_PATH = "%s/data" % ROOT_PATH ONTONOTES_DATA_PATH = "%s/OntoNotes" % DATA_PATH BBN_DATA_PATH="%s/BBN" % DATA_PATH LOG_DIR = "%s/log" % ROOT_PATH CHECKPOINT_DIR = "%s/checkpoint" % ROOT_PATH OUTPUT_DIR = "%s/output" % ROOT_PATH PKL_DIR='./pkl' EMBEDDING_DATA = "%s/glove.840B.300d.txt" % DATA_PATH testemb='testemb' prep='prep' # -------------------- DATA ---------------------- ONTONOTES_ALL = "%s/all.txt" % ONTONOTES_DATA_PATH ONTONOTES_TRAIN = "%s/train.txt" % ONTONOTES_DATA_PATH ONTONOTES_VALID = "%s/dev.txt" % ONTONOTES_DATA_PATH ONTONOTES_TEST = "%s/test.txt" % ONTONOTES_DATA_PATH ONTONOTES_TYPE = "%s/type.pkl" % ONTONOTES_DATA_PATH ONTONOTES_TRAIN_CLEAN = "%s/train_clean.tsv" % ONTONOTES_DATA_PATH ONTONOTES_TEST_CLEAN = "%s/test_clean.tsv" % ONTONOTES_DATA_PATH BBN_ALL = "%s/all.txt" % BBN_DATA_PATH BBN_TRAIN = "%s/train.txt" % BBN_DATA_PATH BBN_VALID = "%s/dev.txt" % BBN_DATA_PATH BBN_TEST = "%s/test.txt" % BBN_DATA_PATH BBN_TRAIN_CLEAN = "%s/train_clean.tsv" % BBN_DATA_PATH BBN_TEST_CLEAN = "%s/test_clean.tsv" % BBN_DATA_PATH BBN_TYPE = "%s/type.pkl" % BBN_DATA_PATH # --------------------- PARAM ----------------------- MAX_DOCUMENT_LENGTH = 30 MENTION_SIZE = 15 WINDOW_SIZE = 10 RANDOM_SEED = 2017
shift = 3 def magic(method, text): processed_text = "" for c in text: if c.isupper(): # find the position in 0-25 c_index = ord(c) - ord("A") # perform the shift if method == "Verschlusseln": new_index = (c_index + shift) % 26 if method == "Entschlüsseln": new_index = (c_index - shift) % 26 # convert to new character new_unicode = new_index + ord("A") new_character = chr(new_unicode) # append to encrypted string processed_text += new_character else: # since character is not uppercase, leave it as it is processed_text += c return processed_text def work(): # This is a dictionary representing options options = { 1: 'Verschlusseln', 2: 'Entschlüsseln' } question = "Was würdest du gern tun?\n\ 1) Verschlusseln\n\ 2) Entschlüsseln\n> " operation = '' while operation not in {1, 2}: operation = int(input(question)) text = input("Was ist der Text? > ") result = magic(options[operation], text.upper()) print("Ergebnis der {} ist: {}".format(options[operation], result)) def main(): work() while input("Noch einmal? > ").lower() == "ja": work() if __name__ == '__main__': main()
""" Reservoir sampling. Sample from stream of unknown length usage: from statistics import median res = initialize_res_samples(fields) num_samples = 50 random_generator = random.Random() random_generator.seed(42) for row_index, row in enumerate(stream): for field in fields: value = row[field] update_res_samples(res_samples, row_index, field, value, num_samples, random_generator) medians = {field: median(res_samples[field] for field in fields} """ def initialize_res_samples(fields): return {field: [] for field in fields} def update_res_samples(res_samples, row_index, field, value, num_samples, random_generator): """ Update reservoir samples :param res_samples: dicts of lists, instantiated with initialize_res_samples :param row_index: the index in the stream :param field: field that is being updated :param value: value for this field in this row :param num_samples: number of samples to keep for each field :param random_generator: random.Random() instance, be sure to set seed :return: """ if row_index < num_samples: res_samples[field].append(value) else: probability = num_samples/(row_index + 1) ramdom_number = random_generator.random() if ramdom_number < probability: index = random_generator.randint(0, num_samples - 1) res_samples[field][index] = value
s = 0 for i in range(5): a = int(input()) if a < 40: a = 40 s += a print(int(s / 5))
def fill_nan(df): # fill NaN in df sets and categorize columns datatype # adding missing column for the missing imputed values for column in df.columns: if column in numerical_feature_names: df[column+'_missing'] = df[column].isnull() mean = np.nanmean(df[column].values) df.loc[df[column].isnull(), column] = mean else: df.loc[df[column].isnull(), column] = "unknown" return df # Because otherwise the feature will be perfectly # linear and the regression will not be able to understand the different parameters def ensure_at_least_two_values_in_columns(df): number_un = df.nunique() >= 2 columns_with_at_least_two_entries = df.columns[number_un == True] df = df[columns_with_at_least_two_entries] return df ### remove similar features by only considering the most signaficant feature for similiar features def _features_explaining_output_without_similiar_features(dataframe_cleaned_of_nan, lower_threshold=0.65): """ removes the features too similiar too eachother but keeps one of these features to represent the output. This is choosen by explaintion of the output """ pairwise_explanation = pairwise_r2(dataframe_cleaned_of_nan) upper_threshold = 0.9999 ## now we are not interested in the y_column, in the pairwise matrix, this is why we take it from both axis pairwise_explanation.drop(self.y_output, axis=1, inplace=True) pairwise_explanation.drop(self.y_output, axis=0, inplace=True) features_that_are_similiar = pairwise_explanation.applymap(lambda x: x if (x > lower_threshold and x < upper_threshold) else None) feature_columns = [] columns_remove_due_to_similiarity = [] cols = features_that_are_similiar.columns cols_similiarity = defaultdict() for col in cols: similiar_features_to_column = features_that_are_similiar.unstack().dropna()[col].index.tolist() cols_similiar_to_eachother = [col] + similiar_features_to_column cols_similiar = defaultdict() ## need more than feature to be seperated if len(cols_similiar_to_eachother) > 1: explanation_of_output_from_similiar_features = r2_to_output(dataframe_cleaned_of_nan[self.y_output], dataframe_cleaned_of_nan[cols_similiar_to_eachother]) explanation_of_output = max(explanation_of_output_from_similiar_features) ## TODO: hardcoded value if explanation_of_output < 0.95: index_of_feature_to_keep = explanation_of_output_from_similiar_features.index(explanation_of_output) feature_to_keep = cols_similiar_to_eachother.pop(index_of_feature_to_keep) feature_columns.append(feature_to_keep) columns_remove_due_to_similiarity.append(cols_similiar_to_eachother) cols_similiarity[feature_to_keep] = cols_similiar_to_eachother if len(cols_similiar_to_eachother) == 1: if not dataframe_cleaned_of_nan[cols_similiar_to_eachother].empty: explanation_of_output = r2_to_output(dataframe_cleaned_of_nan[self.y_output], dataframe_cleaned_of_nan[cols_similiar_to_eachother]) else: explanation_of_output = [0] if explanation_of_output[0] > 0.95: columns_remove_due_to_similiarity.append(cols_similiar_to_eachother) cols_similiarity[cols_similiar_to_eachother[0]] = cols_similiar_to_eachother self.save_processed_dataset(self.dataset_data, cols_similiarity=cols_similiarity) # same feature can be explaining similiar attributes columns_remove_due_to_similiarity = [item for sublist in columns_remove_due_to_similiarity for item in sublist] cols_similiar_to_eachother = list(set(cols_similiar_to_eachother)) feature_columns = list(set(feature_columns)) columns_explaining_output = dataframe_cleaned_of_nan.drop(columns_remove_due_to_similiarity, axis=1).columns.tolist() columns_explaining_output.remove(self.y_output[0]) if self.mandatory_features: for col in self.mandatory_continous_feature_columns: if col not in columns_explaining_output: columns_explaining_output.append(col) self.save_processed_dataset(self.dataset_data, continuous_feature_columns=columns_explaining_output) return dataframe_cleaned_of_nan[columns_explaining_output]
metric_dimension = { "post_all_days": { "metric": [ "post_impressions_unique", "post_engaged_users", "post_impressions_paid_unique" ], "period": [ "lifetime", ], "date_window": "lifetime", "dimension": [ "post_id", "period" ] }, }
class Observable: def __init__(self): self.result = None def callback(self, result): self.result = result def format_response(self): results = [] for d in self.result.search.docs: for idx, match in enumerate(d.matches): score = match.score.value if score <= 0.0: continue results.append( {"match": match.text, "id": match.parent_id, "start": match.location[0], "end": match.location[1], "score": float(match.score.value)}) results = sorted(results, key=lambda x: x["score"]) return results
# Copyright 2014 Doug Latornell and The University of British Columbia # 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. """Python packaging metadata for ECget. """ __all__ = [ 'PROJECT', 'DESCRIPTION', 'VERSION', 'DEV_STATUS', ] PROJECT = 'ECget' DESCRIPTION = 'Get Environment Canada Weather & Hydrometric Data' VERSION = '0.5' DEV_STATUS = '4 - Beta'
# -*- coding: UTF-8 -*- logger.info("Loading 1 objects to table notes_eventtype...") # fields: id, name, remark, body loader.save(create_notes_eventtype(1,['System note', 'System note', 'System note'],u'',['', '', ''])) loader.flush_deferred_objects()
expected_output = { "bridge_domain": { 3051: { "number_of_ports_in_all": 2, "state": "UP", "member_ports": [ "vfi VPLS-3051 neighbor 192.168.36.220 3051", "GigabitEthernet0/0/3 service instance 3051", ], "mac_table": { "GigabitEthernet0/0/3.EFP3051": { "pseudoport": "GigabitEthernet0/0/3.EFP3051", "mac_address": { "0000.A0FF.0118": { "tag": "dynamic", "age": 3441, "aed": 0, "mac_address": "0000.A0FF.0118", "policy": "forward", }, "0000.A0FF.0077": { "tag": "dynamic", "age": 3426, "aed": 0, "mac_address": "0000.A0FF.0077", "policy": "forward", }, "0000.A0FF.011C": { "tag": "dynamic", "age": 3442, "aed": 0, "mac_address": "0000.A0FF.011C", "policy": "forward", }, "0000.A0FF.001F": { "tag": "dynamic", "age": 3416, "aed": 0, "mac_address": "0000.A0FF.001F", "policy": "forward", }, "0000.A0FF.0068": { "tag": "dynamic", "age": 3424, "aed": 0, "mac_address": "0000.A0FF.0068", "policy": "forward", }, "0000.A0FF.00C5": { "tag": "dynamic", "age": 3433, "aed": 0, "mac_address": "0000.A0FF.00C5", "policy": "forward", }, "0000.A0FF.0108": { "tag": "dynamic", "age": 3440, "aed": 0, "mac_address": "0000.A0FF.0108", "policy": "forward", }, "0000.A0FF.0010": { "tag": "dynamic", "age": 3415, "aed": 0, "mac_address": "0000.A0FF.0010", "policy": "forward", }, "0000.A0FF.000F": { "tag": "dynamic", "age": 3415, "aed": 0, "mac_address": "0000.A0FF.000F", "policy": "forward", }, "0000.A0FF.007F": { "tag": "dynamic", "age": 3426, "aed": 0, "mac_address": "0000.A0FF.007F", "policy": "forward", }, "0000.A0FF.007B": { "tag": "dynamic", "age": 3426, "aed": 0, "mac_address": "0000.A0FF.007B", "policy": "forward", }, "0000.A0FF.0087": { "tag": "dynamic", "age": 3427, "aed": 0, "mac_address": "0000.A0FF.0087", "policy": "forward", }, "0000.A0FF.00AA": { "tag": "dynamic", "age": 3430, "aed": 0, "mac_address": "0000.A0FF.00AA", "policy": "forward", }, "0000.A0FF.012C": { "tag": "dynamic", "age": 3443, "aed": 0, "mac_address": "0000.A0FF.012C", "policy": "forward", }, "0000.A0FF.00D0": { "tag": "dynamic", "age": 3434, "aed": 0, "mac_address": "0000.A0FF.00D0", "policy": "forward", }, "0000.A0FF.00F6": { "tag": "dynamic", "age": 3438, "aed": 0, "mac_address": "0000.A0FF.00F6", "policy": "forward", }, "0000.A0FF.00F7": { "tag": "dynamic", "age": 3438, "aed": 0, "mac_address": "0000.A0FF.00F7", "policy": "forward", }, "0000.A0FF.00F2": { "tag": "dynamic", "age": 3438, "aed": 0, "mac_address": "0000.A0FF.00F2", "policy": "forward", }, "0000.A0FF.0129": { "tag": "dynamic", "age": 3443, "aed": 0, "mac_address": "0000.A0FF.0129", "policy": "forward", }, }, } }, "aging_timer": 3600, "bd_domain_id": 3051, "split-horizon_group": { "0": { "num_of_ports": "1", "interfaces": ["GigabitEthernet0/0/3 service instance 3051"], } }, "mac_learning_state": "Enabled", } } }
# -*- coding: utf-8 -*- """ overholt ~~~~~~~~ overholt application package """
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'duplicate_names', 'type': 'shared_library', 'dependencies': [ 'one/sub.gyp:one', 'two/sub.gyp:two', ], }, ], }
class FinnHubAPI: TOKEN="yourTokenHere" # Get a FinHubb API from # https://finnhub.io/
""" Config for Reddit Giveaway I need some configuration, so that the script itself is more reusable. """ SUBMISSION = '40idxl' MATCH_TEXT = 'I would build'
WHITE_KING_MOVED = False BLACK_KING_MOVED = False BLACK_LEFT_ROOK_MOVED = False BLACK_RIGHT_ROOK_MOVED = False WHITE_LEFT_ROOK_MOVED = False WHITE_RIGHT_ROOK_MOVED = False """ all the above values are for determining whether these pieces moved or not in order to know if castling can be performed""" WHITE_DOWN = True # white pieces are positioned at the bottom of the board or not # These values are for testing. Allows me to easily initiate all the boards with the king/rook already seen as moved # so that castling cannot be done when testing custom boards test_board = [ ['□□', '□□', 'bq', '□□', 'bk', '□□', '□□', '□□'], ['br', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], # black pieces ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], # '□□' means empty square ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], ['□□', '□□', '□□', '□□', 'wk', '□□', '□□', '□□'], ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], # white pieces ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], [[True, True, True], [True, True, True], (-1, -1), WHITE_DOWN] ] test_board2 = [ ['□□', '□□', '□□', '□□', 'bk', '□□', '□□', '□□'], ['□□', '□□', 'br', '□□', '□□', '□□', '□□', '□□'], # black pieces ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], # '□□' means empty square ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], ['□□', '□□', 'wp', '□□', 'wk', '□□', '□□', '□□'], ['□□', '□□', 'wr', '□□', '□□', '□□', '□□', '□□'], ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], # white pieces ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], [[True, True, True], [True, True, True], (-1, -1), WHITE_DOWN] ] test_board3 = [ ['□□', '□□', 'br', '□□', 'bk', '□□', '□□', '□□'], ['□□', '□□', 'br', '□□', '□□', '□□', '□□', '□□'], # black pieces ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], # '□□' means empty square ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], ['□□', '□□', 'wp', '□□', 'wk', '□□', '□□', '□□'], ['□□', '□□', 'wr', '□□', '□□', '□□', '□□', '□□'], ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], # white pieces ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], [[True, True, True], [True, True, True], (-1, -1), WHITE_DOWN] ] class Logic: def __init__(self, dimension): """ :param dimension: the number of squares both horizontally and vertically """ self.board = [ ['br', 'bn', 'bb', 'bq', 'bk', 'bb', 'bn', 'br'], ['bp', 'bp', 'bp', 'bp', 'bp', 'bp', 'bp', 'bp'], # black pieces ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], # '□□' means empty square ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'], ['wp', 'wp', 'wp', 'wp', 'wp', 'wp', 'wp', 'wp'], # white pieces ['wr', 'wn', 'wb', 'wq', 'wk', 'wb', 'wn', 'wr'], [[WHITE_LEFT_ROOK_MOVED, WHITE_KING_MOVED, WHITE_RIGHT_ROOK_MOVED], [BLACK_LEFT_ROOK_MOVED, BLACK_KING_MOVED, BLACK_RIGHT_ROOK_MOVED], (-1, -1), WHITE_DOWN] # (Left Rook moved / King moved / Right Rook moved) for each color / Last double pawn move made coordinates ] # double pawn last move coordinates, white pieces are down self.dimension = dimension self.draw_by_repetition = False self.board_history = [test_board] self.promotion_chosen_piece = '□□' self.promotion_board = self.initialize_empty_board() self.promotion_screen = False self.promotion_row = -1 self.promotion_column = -1 self.future_board = self.initialize_empty_board() self.checkmated = False self.stalemated = False self.piece_selected = False self.selected_square_row = 0 self.selected_square_column = 0 self.selected_square_value = '' self.move_number = 1 self.turn = True # True means white to move and False means black to move self.square_size = 0 def move_or_select_piece(self, board, location, square_size, piece_selected, turn, ai): """ makes the actual move if a piece is selected, otherwise selects a piece :param board: the logical board :param location: the row and column in a tuplet :param square_size: the size of the square, for flexibility """ self.square_size = square_size column = location[0] row = location[1] square_value = (board[row])[column] if not piece_selected and not ai: if square_value != '□□': if (turn and square_value[0] == 'w') or (not turn and square_value[0] == 'b'): self.select_piece(board, row, column) # main.draw_possible_moves(screen, current_board, raw_to_matrix(raw_location)[0], # raw_to_matrix(raw_location)[1]) elif square_value[0] == self.selected_square_value[0] and not ai: self.select_piece(board, row, column) else: f_board = self.verify_move_final(board, row, column, self.selected_square_row, self.selected_square_column, ai, True) if f_board: self.transfer_board(board, f_board) self.move_number += 1 self.piece_selected = False self.board_history.append(f_board) self.transfer_board(self.board, board) self.transfer_board(test_board, self.board) # making the move itself self.turn = not self.turn color = 'w' if self.turn else 'b' if self.checkmate(board, color) == 1: self.checkmated = True print('CHECKMATE') elif self.checkmate(board, color) == 2: self.stalemated = True print('STALEMATE') elif len(self.board_history) > 8: if self.board_equals(self.board_history[-1], self.board_history[-5], self.board_history[-9]): self.draw_by_repetition = True return True return False def select_piece(self, board, row, column): self.piece_selected = True self.selected_square_row = row self.selected_square_column = column self.selected_square_value = (board[row])[column] def checkmate(self, board, color): """after each move, we call this function to verify if it's checkmate, stalemate or neither :param board: the logical board :param color: the color of the pieces that we need to verify""" checkmate_board = self.initialize_empty_board() self.transfer_board(checkmate_board, board) for piece in self.find_color_pieces(checkmate_board, color): for search_row in range(self.dimension): for search_column in range(self.dimension): if self.verify_move_final(checkmate_board, search_row, search_column, piece[0], piece[1], True, False): return 0 # NOT CHECKMATE (king_row, king_column) = self.find_king(board, color) if self.verify_piece_attacked(board, king_row, king_column, ((board[king_row])[king_column])[0]): return 1 # CHECKMATE else: return 2 # STALEMATE def board_equals(self, board1, board2, board3): """used for draw by repetition, to check if the same position is reached three times in a row :param board1: the first board we compare :param board1: the fifth board we compare :param board1: the ninth board we compare""" for row in range(self.dimension): if not(board1[row] == board2[row] == board3[row]): return False return True def print_board(self, board): for row in board: print(row) print('------------------') def verify_move_final(self, board, row, column, initial_row, initial_column, ai, actual_move): """after verifying if a move is legal from a basic point of view, we need to do additional checks, such as ally king being under attack after the move, activating the promotion board if necessary. After all these checks, the updated board is returned if the move is legal, otherwise the function returns False :param board: the logical board :param row: the row of the logical board location where the piece is to be moved :param column: the column of the logical board location where the piece is to be moved :param initial_row: the row of the initial piece location :param initial_column: the column of the initial piece location""" future_board = self.initialize_empty_board() # Used to verify if moving a piece will leave its king exposed self.transfer_board(future_board, board) if self.verify_move(future_board, row, column, initial_row, initial_column): (future_board[row])[column] = (future_board[initial_row])[initial_column] (future_board[initial_row])[initial_column] = '□□' # making the move on the future board to check if the king will be under attack after it (king_row, king_column) = self.find_king(future_board, (future_board[row])[column][0]) # finding the king of the same color as the selected piece if not self.verify_piece_attacked(future_board, king_row, king_column, ((future_board[king_row])[king_column])[0]): for search_column in range(self.dimension): if (future_board[7 * (not WHITE_DOWN)])[search_column] == 'wp': if not ai: if actual_move: self.promotion(board, 7 * (not WHITE_DOWN), search_column, initial_row, initial_column) else: (future_board[7 * (not WHITE_DOWN)])[search_column] = 'wq' if (future_board[7 * WHITE_DOWN])[search_column] == 'bp': if not ai: if actual_move: self.promotion(board, 7 * WHITE_DOWN, search_column, initial_row, initial_column) else: (future_board[7 * WHITE_DOWN])[search_column] = 'bq' if (future_board[row])[column] == 'wk': ((future_board[self.dimension])[0])[1] = True if (future_board[row])[column] == 'bk': ((future_board[self.dimension])[1])[1] = True """updating the board info if the king has moved""" return future_board return False def verify_move(self, board, row, column, initial_row, initial_column): """here we do basic validations for each king of piece :param board: the logical board :param row: the row of the logical board location where the piece is to be moved :param column: the column of the logical board location where the piece is to be moved :param initial_row: the row of the initial piece location :param initial_column: the column of the initial piece location""" row_distance = row - initial_row column_distance = column - initial_column chosen_piece = ((board[initial_row])[initial_column])[1] chosen_piece_color = ((board[initial_row])[initial_column])[0] if row < 0 or row > 7 or column < 0 or column > 7: return False # in case that the move is out of bounds, could happen when automatically attempting or checking moves if self.draw_by_repetition: return False if chosen_piece_color == ((board[row])[column])[0]: return False """can't capture its ally""" if chosen_piece == 'n': # ------------KNIGHT------------ if ((abs(row_distance) + abs(column_distance)) == 3) and ((abs(row_distance) * abs(column_distance)) == 2): (board[self.dimension])[2] = (-1, -1) # resetting en passant return True elif chosen_piece == 'p': # ------------PAWN-------------- if initial_row == 7 or initial_row == 0: return False last_double_pawn_move = (board[self.dimension])[2] if chosen_piece_color == 'w': # --------WHITE if row_distance == -1 + ((not WHITE_DOWN) * 2) and abs(column_distance) == 1: # capturing if (board[row])[column] != '□□': return True if last_double_pawn_move == (row + (1 - ((not WHITE_DOWN) * 2)), column): # en passant (board[row + 1 - ((not WHITE_DOWN) * 2)])[column] = '□□' # one of two exceptions when i modify the board while verifying return True # because it's the only move that doesn't capture on the square where it's moving if (board[initial_row - 1 + (not WHITE_DOWN) * 2])[column] != '□□': return False if row_distance == -1 + ((not WHITE_DOWN) * 2) and column == initial_column: (board[self.dimension])[2] = (-1, -1) # resetting en passant return True if initial_row == (7 * WHITE_DOWN) - 1 + ((not WHITE_DOWN) * 2): # if initial row, it can move two squares if (row_distance == -2 + ((not WHITE_DOWN) * 4)) and column_distance == 0 and (board[row])[column] == '□□': (board[self.dimension])[2] = (row, column) # updating the board info of the last double move return True else: # --------BLACK if row_distance == 1 - ((not WHITE_DOWN) * 2) and abs(column_distance) == 1: # capturing if (board[row])[column] != '□□': return True if last_double_pawn_move == (row - 1 + ((not WHITE_DOWN) * 2), column): # en passant (board[row - 1 + ((not WHITE_DOWN) * 2)])[column] = '□□' # the only exception when i modify the board while verifying, (board[self.dimension])[2] = (-1, -1) # resetting en passant return True # because it's the only move that doesn't capture on the square that's it's moving if (board[initial_row + 1 - (not WHITE_DOWN) * 2])[column] != '□□': return False if row_distance == 1 - ((not WHITE_DOWN) * 2) and column == initial_column: (board[self.dimension])[2] = (-1, -1) # resetting en passant return True if initial_row == (7 * (not WHITE_DOWN)) - 1 + (WHITE_DOWN * 2): if (row_distance == 2 - ((not WHITE_DOWN) * 4)) and column_distance == 0 and (board[row])[column] == '□□': (board[self.dimension])[2] = (row, column) # updating the board info of the last double move return True elif chosen_piece == 'k': # ------------KING------------ if abs(row_distance) < 2 and abs(column_distance) < 2: if chosen_piece_color == 'w': ((board[self.dimension])[0])[1] = True # notifying the board that the white king has moved and cant castle anymore elif chosen_piece_color == 'b': # the main board will be updated with this information only after the final_check_verification returns True ((board[self.dimension])[1])[1] = True (board[self.dimension])[2] = (-1, -1) # resetting en passant return True if chosen_piece_color == 'w' and not ((board[self.dimension])[0])[1]: if (row, column) == ((7 * WHITE_DOWN), 2) and not ((board[self.dimension])[0])[0]: # white king big castle pos1 = (board[row])[column - 1] pos2 = (board[row])[column] pos3 = (board[row])[column + 1] if pos1 == '□□' and pos2 == '□□' and pos3 == '□□': if not (self.verify_piece_attacked(board, row, column + 1, 'w') or self.verify_piece_attacked(board, row, column + 2, 'w')): (board[7 * WHITE_DOWN])[3] = (board[7 * WHITE_DOWN])[0] # considering that this is a special move where two pieces move at the same time, we will move one of them before the actual move happens (board[7 * WHITE_DOWN])[0] = '□□' (board[self.dimension])[2] = (-1, -1) # resetting en passant return 2 if (row, column) == (7 * WHITE_DOWN, 6) and not ((board[self.dimension])[0])[2]: # white king small castle pos1 = (board[row])[column - 1] pos2 = (board[row])[column] if pos1 == '□□' and pos2 == '□□': if not (self.verify_piece_attacked(board, row, column - 1, 'w') or self.verify_piece_attacked(board, row, column - 2, 'w')): (board[7 * WHITE_DOWN])[5] = (board[7 * WHITE_DOWN])[7] # considering that this is a special move where two pieces move at the same time, we will move one of them before the actual move happens (board[7 * WHITE_DOWN])[7] = '□□' ((board[self.dimension])[0])[1] = True ((board[self.dimension])[0])[2] = True (board[self.dimension])[2] = (-1, -1) # resetting en passant return 2 if chosen_piece_color == 'b' and not ((board[self.dimension])[1])[1]: if (row, column) == (7 * (not WHITE_DOWN), 2) and not ((board[self.dimension])[1])[0]: # black king big castle pos1 = (board[row])[column - 1] pos2 = (board[row])[column] pos3 = (board[row])[column + 1] if pos1 == '□□' and pos2 == '□□' and pos3 == '□□': if not (self.verify_piece_attacked(board, row, column + 1, 'b') or self.verify_piece_attacked(board, row, column + 2, 'b')): (board[7 * (not WHITE_DOWN)])[3] = (board[7 * (not WHITE_DOWN)])[0] # considering that this is a special move where two pieces move at the same time, we will move one of them before the actual move happens (board[7 * (not WHITE_DOWN)])[0] = '□□' ((board[self.dimension])[1])[1] = True ((board[self.dimension])[1])[0] = True (board[self.dimension])[2] = (-1, -1) # resetting en passant return 2 if (row, column) == (7 * (not WHITE_DOWN), 6) and not ((board[self.dimension])[1])[2]: # black king small castle pos1 = (board[row])[column - 1] pos2 = (board[row])[column] if pos1 == '□□' and pos2 == '□□': if not (self.verify_piece_attacked(board, row, column - 1, 'b') or self.verify_piece_attacked(board, row, column - 2, 'b')): (board[7 * (not WHITE_DOWN)])[5] = (board[7 * (not WHITE_DOWN)])[7] # considering that this is a special move where two pieces move at the same time, we will move one of them before the actual move happens (board[7 * (not WHITE_DOWN)])[7] = '□□' ((board[self.dimension])[1])[1] = True ((board[self.dimension])[1])[2] = True (board[self.dimension])[2] = (-1, -1) # resetting en passant return 2 elif chosen_piece == 'r': # ------------ROOK------------ if self.rook_move_validity(board, row, column, initial_row, initial_column): if (initial_row, initial_column) == (7 * WHITE_DOWN, 0): # left white rook ((board[self.dimension])[0])[0] = True if (initial_row, initial_column) == (7 * WHITE_DOWN, 7): # right white rook ((board[self.dimension])[0])[2] = True if (initial_row, initial_column) == (7 * (not WHITE_DOWN), 0): # left black rook ((board[self.dimension])[1])[0] = True if (initial_row, initial_column) == (7 * (not WHITE_DOWN), 7): # right black rook ((board[self.dimension])[1])[2] = True (board[self.dimension])[2] = (-1, -1) # resetting en passant return True return False elif chosen_piece == 'b': # ------------BISHOP------------ if self.bishop_move_validity(board, row, column, initial_row, initial_column): (board[self.dimension])[2] = (-1, -1) # resetting en passant return True return False elif chosen_piece == 'q': # ------------QUEEN------------ # for the queen we just validate as for a rook and a bishop combined rook_validation = self.rook_move_validity(board, row, column, initial_row, initial_column) bishop_validation = self.bishop_move_validity(board, row, column, initial_row, initial_column) if rook_validation or bishop_validation: (board[self.dimension])[2] = (-1, -1) # resetting en passant return True return False else: return False def verify_piece_attacked(self, board, row, column, piece_color): """used vor verifying if the king is under attack for certain moves: check by exposure, castling :param board: the logical board :param row: the row of the logical board location where the piece is to be moved :param column: the column of the logical board location where the piece is to be moved :param piece_color: the color of the piece we need to verify on""" verification_board = self.initialize_empty_board() self.transfer_board(verification_board, board) for search_row in range(self.dimension): for search_column in range(self.dimension): if (((verification_board[search_row])[search_column])[0] != piece_color) and (((verification_board[search_row])[search_column])[0] != '□'): if self.verify_move(verification_board, row, column, search_row, search_column): return True return False def transfer_board(self, board1, board2): """transferring a board's contents to another, not very efficient :param board1: the board where the content is copied :param board2: the board from which the content is copied""" for search_row in range(self.dimension): for search_column in range(self.dimension): (board1[search_row])[search_column] = (board2[search_row])[search_column] for i in range(2): for j in range(3): ((board1[self.dimension])[i])[j] = ((board2[self.dimension])[i])[j] (board1[self.dimension])[2] = (board2[self.dimension])[2] (board1[self.dimension])[3] = (board2[self.dimension])[3] """def transfer_board_efficient(self, board2): board1 = list(board2) return board1""" def initialize_empty_board(self): future_board = [0, 0, 0, 0, 0, 0, 0, 0, 0] for i in range(self.dimension): future_board[i] = ['□□', '□□', '□□', '□□', '□□', '□□', '□□', '□□'] # Used to verify if moving a piece will leave its king exposed future_board[self.dimension] = [[WHITE_LEFT_ROOK_MOVED, WHITE_KING_MOVED, WHITE_RIGHT_ROOK_MOVED], [BLACK_LEFT_ROOK_MOVED, BLACK_KING_MOVED, BLACK_RIGHT_ROOK_MOVED], (-1, -1), WHITE_DOWN] return future_board def find_king(self, board, color): """ :param board: the logical board :param color: the color of the king that needs to be found """ for search_row in range(self.dimension): # finding the king of the chosen color for search_column in range(self.dimension): if ((board[search_row])[search_column])[1] == 'k' and \ ((board[search_row])[search_column])[0] == color: king_row = search_row king_column = search_column return king_row, king_column def rook_move_validity(self, board, row, column, initial_row, initial_column): """starting from the coordinates where we want to move the rook, we go backwards towards the rook and check if there are any pieces in the way. And the move must be either on the same column, or the same row :param board: the logical board :param row: the row of the logical board location where the piece is to be moved :param column: the column of the logical board location where the piece is to be moved :param initial_row: the row of the initial piece location :param initial_column: the column of the initial piece location""" if column == initial_column: while (row != initial_row + 1) and (row != initial_row - 1): row = (row + 1 if row < initial_row else row - 1) if (board[row])[column] != '□□': return False return True if row == initial_row: while (column != initial_column + 1) and (column != initial_column - 1): column = (column + 1 if column < initial_column else column - 1) if (board[row])[column] != '□□': return False return True return False def bishop_move_validity(self, board, row, column, initial_row, initial_column): """ :param board: the logical board :param row: the row of the logical board location where the piece is to be moved :param column: the column of the logical board location where the piece is to be moved :param initial_row: the row of the initial piece location :param initial_column: the column of the initial piece location """ row_distance = row - initial_row column_distance = column - initial_column #I have discovered that the math equation is simply that the row distance must be equal to the column one, #and again we go backwards towards the bishop and check if there is any piece in the way if abs(row_distance) == abs(column_distance): while (row != (initial_row + 1)) and (row != (initial_row - 1)): row = (row + 1 if row < initial_row else row - 1) column = (column + 1 if column < initial_column else column - 1) if (board[row])[column] != '□□': return False return True return False def pawn_promotion(self, board, row, column, initial_row, initial_column): """promotion in the case of the ai, where it automatically gets a queen :param board: the logical board :param row: the row of the logical board location where the piece is to be moved :param column: the column of the logical board location where the piece is to be moved :param initial_row: the row of the initial piece location :param initial_column: the column of the initial piece location""" pawn_color = ((board[initial_row])[initial_column])[0] if pawn_color == 'w' and (row == (not (board[self.dimension])[3]) * (self.dimension - 1)): (board[row])[column] = 'wq' elif pawn_color == 'b' and row == ((board[self.dimension])[3]) * (self.dimension - 1): (board[row])[column] = 'bq' def promotion(self, board, row, column, initial_row, initial_column): """creating the additional backend board that is used for displaying the promotion screen :param board: the logical board :param row: the row of the logical board location where the piece is to be moved :param column: the column of the logical board location where the piece is to be moved :param initial_row: the row of the initial piece location :param initial_column: the column of the initial piece location""" color = ((board[initial_row])[initial_column])[0] promotion_board = self.initialize_empty_board() self.transfer_board(promotion_board, board) possible_promotions = ['q', 'r', 'b', 'n'] up_or_down = 1 if row == 0 else -1 for i in range(4): (promotion_board[row + i*up_or_down])[column] = color + possible_promotions[i] self.transfer_board(self.promotion_board, promotion_board) self.promotion_row = row self.promotion_column = column self.promotion_screen = True def choose_promotion(self, board, location): """updating the backend board when a piece is selected in the promotion screen :param board: the logical board "param location: tuple of the row and column of the chosen promoted piece""" row = location[1] column = location[0] if column == self.promotion_column: if self.promotion_row == 0: if row < 4: (board[self.promotion_row])[self.promotion_column] = (self.promotion_board[row])[column] self.promotion_screen = False return True if self.promotion_row == 7: if row >= 4: (board[self.promotion_row])[self.promotion_column] = (self.promotion_board[row])[column] self.promotion_screen = False return True return False def find_color_pieces(self, board, color): # returns the coordinates of the chosen color pieces """ :param board: the logical board :param color: the color of the king that needs to be found """ pieces_coordinates = [] for search_row in range(self.dimension): for search_column in range(self.dimension): piece = (board[search_row])[search_column] if piece[0] == color: pieces_coordinates.append((search_row, search_column)) return pieces_coordinates def get_board(self): return self.board
""" Abaixo de 200 minutos = R$0.20 por minuto Entre 200 e 400 minutos = R$0.18 por minuto Acima de 400 minutos = R$0.15 por minuto """ minutos = int(input('Quantos minutos você utilizou este mês: ')) if minutos < 200: preco = 0.20 else: if minutos < 400: preco = 0.18 else: preco = 0.15 print(f'Você vai pagar este mês: R${minutos * preco:6.2f}')
B = BLOCK_SIZE = 30 SURFACE_WIDTH = 300 SURFACE_HEIGHT = 600 S = [['.....', '.....', '..00.', '.00..', '.....'], ['.....', '..0..', '..00.', '...0.', '.....' ]] Z = [['.....', '.....', '.00..', '..00.', '.....'], ['.....', '..,0.', '..00.', '..0..', '.....' ]] I = [['.....', '..0..', '..0..', '..0..', '.....'], ['.....', '.....', '.000.', '.....', '.....' ]] O = [['.....', '.....', '.00..', '.00..', '.....']] J = [['.....', '.....', '.0...', '.000.', '.....'], ['.....', '..00.', '..0..', '..0..', '.....' ], ['.....', '.000.', '...0.', '.....', '.....' ], ['.....', '..0..', '..0..', '.00..', '.....' ],] L = [['.....', '...0.', '.000.', '.....', '.....'], ['.....', '..0..', '..0..', '..00.', '.....'], ['.....', '.....', '.000.', '.0...', '.....'], ['.....', '.00..', '..0..', '..0..', '.....']] T = [['.....', '..0..', '.000.', '.....', '.....'], ['.....', '..0..', '..00.', '..0..', '.....'], ['.....', '.....', '.000.', '..0..', '.....'], ['.....', '..0..', '.00..', '..0..', '.....']] SHAPES = [S, Z, I, O, L, T] # red green blue pink gray orange SHAPES_FILL = ['#f44336', '#4CAF50', '#2196F3', '#F50057', '#607D8B', '#FF9800']
lista = ('Lapis', 1.5, 'caneta', 2.5, 'caderno', 16.90, 'mochila', 67.99, 'livro', 37.89) print('-'*40) print(f'{"LISTA ESCOLAR":^40}') print('-'*40) for c in range(0, len(lista)): if c % 2 == 0: print(f'{lista[c]:.<30}', end=' ') else: print(f'R$ {lista[c]:.2f}') print('-'*40)
class WindowDatas(): def __init__(self): self.previousWindow = None self.nextWindow = None self.finalWindow = None self.accountDATA = None self.actions= None self.show= True self.database = None
# Flask Config Variables to be Auto-Loaded config = { 'flask': { 'SECRET_KEY': b'!T3DxK;L1jJGYf$', # Please change. See Flask for requirements. 'TESTING': True, 'TEMPLATES_AUTO_RELOAD': True, 'SERVER_NAME': 'flask.mvc' }, 'templating': { 'template_folder': 'application/views', 'static_folder': 'public/assets' } }
class FVTADD : def __init__(self): self.default = '' def runTest(self,self) : return TemplateTest.runTest(self) def tearDown(self,self) : return TemplateTest.tearDown(self) def setUp(self,self) : return TemplateTest.setUp(self) def chkSetUpCondition(self,self,fv,sv_ret,ctl_ret,sw_ret) : return TemplateTest.chkSetUpCondition(self,fv,sv_ret,ctl_ret,sw_ret)
class ITopBanner(Interface): """marker interface for Front Page""" class IThemeSpecific(Interface): """marker interface for theme layer"""
#Your task is to complete this function # function should strictly return a string else answer wont be printed def multiplyStrings(str1, str2): return str(int(str1) * int(str2))
#!/usr/bin/env python # # Copyright (c) 2015 Pavel Lazar pavel.lazar (at) gmail.com # # The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. ##################################################################### class EngineClientError(Exception): """ An exception in the EE client. """ pass
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # Prefixes CONSOLE_LOG_PREFIX = "LanguageWorkerConsoleLog" # Capabilities RAW_HTTP_BODY_BYTES = "RawHttpBodyBytes" TYPED_DATA_COLLECTION = "TypedDataCollection" RPC_HTTP_BODY_ONLY = "RpcHttpBodyOnly" RPC_HTTP_TRIGGER_METADATA_REMOVED = "RpcHttpTriggerMetadataRemoved" # Debug Flags PYAZURE_WEBHOST_DEBUG = "PYAZURE_WEBHOST_DEBUG" # Feature Flags (app settings) PYTHON_ROLLBACK_CWD_PATH = "PYTHON_ROLLBACK_CWD_PATH" # External Site URLs MODULE_NOT_FOUND_TS_URL = "https://aka.ms/functions-modulenotfound"
n = int(input()) res = 0 for i in range(n): res += int((input().strip())[:25]) print(str(res)[:10])
#Crie um programa que simule o funcionamento de um caixa eletrônico #no inicio pergunte ao usuário qual será o valor a se rsacado (valor inteiro) #o programa vai informar quantas cédulas de cada valor serão entregues #obs considere; R$ 20, R$50, R$ 10, R$ 1 valor = int(input('Que valor você quer sacar? R$ ')) total = valor ced = 50 totced = 0 while True: if total >= ced: total -= ced totced += 1 else: if totced > 0: print(f'Total de {totced} cédulas de r${ced}') if ced == 50: ced = 20 elif ced == 20: ced = 10 elif ced == 10: ced = 1 totced = 0 if total == 0: break