content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
"""A module defining the third party dependency gn""" load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def gn_repositories(): maybe( new_git_repository, name = "gn", build_file = Label("//gn:BUILD.gn.bazel"), commit = "dfcbc6fed0a8352696f92d67ccad54048ad182b3", patch_args = [], patch_tool = "bash", patches = [Label("//gn:patch.gen_ninja.sh")], remote = "https://gn.googlesource.com/gn", shallow_since = "1612864120 +0000", )
"""A module defining the third party dependency gn""" load('@bazel_tools//tools/build_defs/repo:git.bzl', 'new_git_repository') load('@bazel_tools//tools/build_defs/repo:utils.bzl', 'maybe') def gn_repositories(): maybe(new_git_repository, name='gn', build_file=label('//gn:BUILD.gn.bazel'), commit='dfcbc6fed0a8352696f92d67ccad54048ad182b3', patch_args=[], patch_tool='bash', patches=[label('//gn:patch.gen_ninja.sh')], remote='https://gn.googlesource.com/gn', shallow_since='1612864120 +0000')
class Parser: def __init__(self, file_name): self.file_name = file_name self.tokens = self.load_tokens() def load_tokens(self): with open(self.file_name) as f: lines = map(lambda line: self.remove_comments(line).split(), f.readlines()) tokens = [line for line in lines if line != []] return tokens def remove_comments(self, line): j = 0 for i in range(1, len(line)): if line[j] == line[i] == "/": return line[:j] j += 1 return line def get_command(self): return self.tokens.pop(0) def has_more_commands(self): return self.tokens != [] if __name__ == "__main__": p = Parser("vm_example.vm") print(p.tokens)
class Parser: def __init__(self, file_name): self.file_name = file_name self.tokens = self.load_tokens() def load_tokens(self): with open(self.file_name) as f: lines = map(lambda line: self.remove_comments(line).split(), f.readlines()) tokens = [line for line in lines if line != []] return tokens def remove_comments(self, line): j = 0 for i in range(1, len(line)): if line[j] == line[i] == '/': return line[:j] j += 1 return line def get_command(self): return self.tokens.pop(0) def has_more_commands(self): return self.tokens != [] if __name__ == '__main__': p = parser('vm_example.vm') print(p.tokens)
def denominations(array): den_list = [] for i in range(len(array)): # since there is no coin with value 0 if i == 0: continue if array[i] > 0: if not den_list: den_list.append(i) continue if len(den_list) > 0: min_coins = get_min_coins(i, den_list) if min_coins != 0: den_list.append(i) return ", ".join([str(val) for val in den_list]) def get_min_coins(amount, denoms): print('amount', amount) print('denoms', denoms) if amount == 0: return 0 coins_used = None denom_to_use, index_cutoff = None, None for x, denom in enumerate(denoms): if amount >= denom: denom_to_use = denom index_cutoff = x break try: coins_used = amount // denom_to_use except TypeError: coins_used = None if coins_used is not None and amount - (denom_to_use * coins_used) in denoms: return coins_used + get_min_coins(amount - (denom_to_use * coins_used), denoms[index_cutoff + 1:]) else: return coins_used + get_min_coins(amount - denom_to_use, denoms[index_cutoff + 1:])
def denominations(array): den_list = [] for i in range(len(array)): if i == 0: continue if array[i] > 0: if not den_list: den_list.append(i) continue if len(den_list) > 0: min_coins = get_min_coins(i, den_list) if min_coins != 0: den_list.append(i) return ', '.join([str(val) for val in den_list]) def get_min_coins(amount, denoms): print('amount', amount) print('denoms', denoms) if amount == 0: return 0 coins_used = None (denom_to_use, index_cutoff) = (None, None) for (x, denom) in enumerate(denoms): if amount >= denom: denom_to_use = denom index_cutoff = x break try: coins_used = amount // denom_to_use except TypeError: coins_used = None if coins_used is not None and amount - denom_to_use * coins_used in denoms: return coins_used + get_min_coins(amount - denom_to_use * coins_used, denoms[index_cutoff + 1:]) else: return coins_used + get_min_coins(amount - denom_to_use, denoms[index_cutoff + 1:])
print("Interview by computer") name = input("your name : ") print(f"hello {name}") age = input("your age : ") favorite_color = input("your fav color : ") second_person_name_etc = input() # above is no an efficient way # Below is an efficient way (using Tuples) questions = ( "Your name: ", "Your age: ", "Favourite color: ", "Pet's name: ", ) answers = [] for question in questions: answers.append(input(question)) print(answers) # in the above program, input is tuple, and output is list # tuples are immutable # If you're never gonna change something after creating it, then it should be a tuple (so that it cannot be changed even accidentally)
print('Interview by computer') name = input('your name : ') print(f'hello {name}') age = input('your age : ') favorite_color = input('your fav color : ') second_person_name_etc = input() questions = ('Your name: ', 'Your age: ', 'Favourite color: ', "Pet's name: ") answers = [] for question in questions: answers.append(input(question)) print(answers)
class x: counter = 1 while x.counter < 10: x.counter = x.counter * 2 print(x.counter) del x.counter def f1(self, x, y): return min(x, x + y)
class X: counter = 1 while x.counter < 10: x.counter = x.counter * 2 print(x.counter) del x.counter def f1(self, x, y): return min(x, x + y)
class Solution: def validateStackSequences(self, pushed, popped): """ :type pushed: List[int] :type popped: List[int] :rtype: bool """ pushed.reverse() popped.reverse() ps = [] pp = [] i, j = 0, 0 while pushed or popped: _p = [] while pushed: _p.append(pushed.pop()) while _p and popped[-1] == _p[-1]: popped.pop() _p.pop() while _p: if popped[-1] == _p[-1]: popped.pop() else: return False return True if __name__ == "__main__": print(Solution().validateStackSequences([1, 2, 3, 4, 5], [4, 5, 3, 2, 1])) print(Solution().validateStackSequences([1, 2, 3, 4, 5], [4, 3, 5, 1, 2]))
class Solution: def validate_stack_sequences(self, pushed, popped): """ :type pushed: List[int] :type popped: List[int] :rtype: bool """ pushed.reverse() popped.reverse() ps = [] pp = [] (i, j) = (0, 0) while pushed or popped: _p = [] while pushed: _p.append(pushed.pop()) while _p and popped[-1] == _p[-1]: popped.pop() _p.pop() while _p: if popped[-1] == _p[-1]: popped.pop() else: return False return True if __name__ == '__main__': print(solution().validateStackSequences([1, 2, 3, 4, 5], [4, 5, 3, 2, 1])) print(solution().validateStackSequences([1, 2, 3, 4, 5], [4, 3, 5, 1, 2]))
#!/usr/bin/env python3 #-*- coding: utf-8 -*- def foo(s): return 10 / int(s) def bar(s): return foo(s) * 2 def main(): bar('0') main() print('runing is ok!')
def foo(s): return 10 / int(s) def bar(s): return foo(s) * 2 def main(): bar('0') main() print('runing is ok!')
class Solution(object): def buddyStrings(self, A, B): """ :type A: str :type B: str :rtype: bool """ if len(A) != len(B): return False A = list(A) diff = [] for i in range(len(A)): if A[i] != B[i]: diff.append(i) if len(set(A)) < len(A) and len(diff) == 0: return True return len(diff) == 2 and A[diff[0]] == B[diff[1]] and A[diff[1]] == B[diff[0]] A = "ab" B = "ba" print(Solution().buddyStrings(A, B))
class Solution(object): def buddy_strings(self, A, B): """ :type A: str :type B: str :rtype: bool """ if len(A) != len(B): return False a = list(A) diff = [] for i in range(len(A)): if A[i] != B[i]: diff.append(i) if len(set(A)) < len(A) and len(diff) == 0: return True return len(diff) == 2 and A[diff[0]] == B[diff[1]] and (A[diff[1]] == B[diff[0]]) a = 'ab' b = 'ba' print(solution().buddyStrings(A, B))
## foto_2 = ruleGMLString("""rule [ ruleID "foto O2 " # H-O-H + Hf -> H-O. + H. left [ node [ id 2 label "O" ] node [ id 3 label "H" ] edge [source 2 target 3 label "-"] node [ id 4 label "Hf" ] ] context [ node [ id 1 label "H" ] edge [source 1 target 2 label "-"] ] right [ node [ id 2 label "O." ] node [ id 3 label "H." ] ] ]""")
foto_2 = rule_gml_string('rule [\n\truleID "foto O2 " # H-O-H + Hf -> H-O. + H.\n\tleft [\n\n\t\tnode [ id 2 label "O" ]\n\t\tnode [ id 3 label "H" ]\t\n\t\tedge [source 2 target 3 label "-"]\n\t\tnode [ id 4 label "Hf" ] \t\t \n\t] \n\tcontext [\n\t\tnode [ id 1 label "H" ] \t\t\t\n\t\tedge [source 1 target 2 label "-"]\n\t] \n\tright [\n\t\tnode [ id 2 label "O." ]\n\t\tnode [ id 3 label "H." ]\t\n\t\n\t]\n\t\t\n\t\t \n]')
resnext_101_32_path = './pretrained/resnext_101_32x4d.pth' pretrained_res_best = './pretrained/res_best.pth' pretrained_vgg_best = './pretrained/vgg_best.pth' DUTDefocus = './datasets/DUTDefocus' CUHKDefocus = './datasets/CUHKDefocus'
resnext_101_32_path = './pretrained/resnext_101_32x4d.pth' pretrained_res_best = './pretrained/res_best.pth' pretrained_vgg_best = './pretrained/vgg_best.pth' dut_defocus = './datasets/DUTDefocus' cuhk_defocus = './datasets/CUHKDefocus'
class Solution: def possiblyEquals(self, s1: str, s2: str) -> bool: def getNums(s: str) -> Set[int]: nums = {int(s)} for i in range(1, len(s)): nums |= {x + y for x in getNums(s[:i]) for y in getNums(s[i:])} return nums def getNextLetterIndex(s: str, i: int) -> int: j = i while j < len(s) and s[j].isdigit(): j += 1 return j @lru_cache(None) def dp(i: int, j: int, paddingDiff: int) -> bool: """ Return True if s1[i:] matches s2[j:] with given padding difference i := s1's index j := s2's index paddingDiff := signed padding, if positive, s1 has a positive number of offset bytes relative to s2 """ if i == len(s1) and j == len(s2): return paddingDiff == 0 # add padding on s1 if i < len(s1) and s1[i].isdigit(): nextLetterIndex = getNextLetterIndex(s1, i) for num in getNums(s1[i:nextLetterIndex]): if dp(nextLetterIndex, j, paddingDiff + num): return True # add padding on s2 elif j < len(s2) and s2[j].isdigit(): nextLetterIndex = getNextLetterIndex(s2, j) for num in getNums(s2[j:nextLetterIndex]): if dp(i, nextLetterIndex, paddingDiff - num): return True # s1 has more padding, j needs to catch up elif paddingDiff > 0: if j < len(s2): return dp(i, j + 1, paddingDiff - 1) # s2 has more padding, i needs to catch up elif paddingDiff < 0: if i < len(s1): return dp(i + 1, j, paddingDiff + 1) # no padding difference, consume the next letter else: # paddingDiff == 0 if i < len(s1) and j < len(s2) and s1[i] == s2[j]: return dp(i + 1, j + 1, 0) return False return dp(0, 0, 0)
class Solution: def possibly_equals(self, s1: str, s2: str) -> bool: def get_nums(s: str) -> Set[int]: nums = {int(s)} for i in range(1, len(s)): nums |= {x + y for x in get_nums(s[:i]) for y in get_nums(s[i:])} return nums def get_next_letter_index(s: str, i: int) -> int: j = i while j < len(s) and s[j].isdigit(): j += 1 return j @lru_cache(None) def dp(i: int, j: int, paddingDiff: int) -> bool: """ Return True if s1[i:] matches s2[j:] with given padding difference i := s1's index j := s2's index paddingDiff := signed padding, if positive, s1 has a positive number of offset bytes relative to s2 """ if i == len(s1) and j == len(s2): return paddingDiff == 0 if i < len(s1) and s1[i].isdigit(): next_letter_index = get_next_letter_index(s1, i) for num in get_nums(s1[i:nextLetterIndex]): if dp(nextLetterIndex, j, paddingDiff + num): return True elif j < len(s2) and s2[j].isdigit(): next_letter_index = get_next_letter_index(s2, j) for num in get_nums(s2[j:nextLetterIndex]): if dp(i, nextLetterIndex, paddingDiff - num): return True elif paddingDiff > 0: if j < len(s2): return dp(i, j + 1, paddingDiff - 1) elif paddingDiff < 0: if i < len(s1): return dp(i + 1, j, paddingDiff + 1) elif i < len(s1) and j < len(s2) and (s1[i] == s2[j]): return dp(i + 1, j + 1, 0) return False return dp(0, 0, 0)
# Create veggies list veggies = ['tomato', 'spinach', 'pepper', 'pea'] print(veggies) # Remove first occurence of 'tomato' veggies.remove('tomato') print(veggies) # Append 'corn' veggies.append('corn') print(veggies) # Create meats list meats = ['chicken', 'beef', 'pork', 'fish'] print(meats) # Concatenate meats and veggies to create new foods list foods = meats + veggies print(foods) # Sort foods in place foods.sort() print(foods)
veggies = ['tomato', 'spinach', 'pepper', 'pea'] print(veggies) veggies.remove('tomato') print(veggies) veggies.append('corn') print(veggies) meats = ['chicken', 'beef', 'pork', 'fish'] print(meats) foods = meats + veggies print(foods) foods.sort() print(foods)
def test_something(): # (i'm going to delete this later, i just wanna make sure gh actions/etc. # is set up ok) assert 2 + 2 == 4
def test_something(): assert 2 + 2 == 4
# Write a function that receives 3 characters. Concatenate all the characters into one string and print it on the console. chr_1 = str(input()) chr_2 = str(input()) chr_3 = str(input()) print(chr_1+chr_2+chr_3)
chr_1 = str(input()) chr_2 = str(input()) chr_3 = str(input()) print(chr_1 + chr_2 + chr_3)
# This file is exec'd from settings.py, so it has access to and can # modify all the variables in settings.py. DEBUG = True # Make these unique, and don't share it with anybody. SECRET_KEY = "t6e%#%(w!lg1@1bk1$lhh%q_d4h&z*s3utakds-bzu-3b(bebe" NEVERCACHE_KEY = "dit-cgsc$(w%xx)z*=l1-1vtz%a6v1hwhv9jtlsm0_kcg(md0z" DATABASES = { "default": { # Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle". "ENGINE": "django.db.backends.sqlite3", # DB name or path to database file if using sqlite3. "NAME": "dev.db", # Not used with sqlite3. "USER": "", # Not used with sqlite3. "PASSWORD": "", # Set to empty string for localhost. Not used with sqlite3. "HOST": "", # Set to empty string for default. Not used with sqlite3. "PORT": "", } } ################### # DEPLOY SETTINGS # ################### # Domains for public site ALLOWED_HOSTS_PRODUCTION = ["example.com", ] # These settings are used by the default fabfile.py provided. # Check fabfile.py for defaults. FABRIC = { "DEPLOY_TOOL": "git", # Deploy with "git", "hg", or "rsync" "SSH_PASS": "yourpass", # SSH password (consider key-based authentication) "REPO_PATH": "git@github.com:linuxluigi/Django_CCTV.git", # Github Repo "SSH_USER": "pi", # VPS SSH username "HOSTS": ["django-cctv"], # The IP address of your VPS "DOMAINS": ALLOWED_HOSTS_PRODUCTION, # Edit domains in ALLOWED_HOSTS "REQUIREMENTS_PATH": "requirements.txt", # Project's pip requirements "LOCALE": "de_DE.UTF-8", # Should end with ".UTF-8" "DB_PASS": "h@cn8ExAvdFg!AFWyRULgOqdnXGS!@hcbEJumZSzoHL57Nrj7LwFaLtgo2UC", # Live database password "ADMIN_PASS": "3zX4sMLTbM@M5wxd4e39dCDp5cN!lBVOcFia$U8uJN9X4^r0comSY%1S^bigyo99!s&Yau", # Live admin user password "SECRET_KEY": SECRET_KEY, "NEVERCACHE_KEY": NEVERCACHE_KEY, "NGINX_AUTH_USER": "user", "NGINX_AUTH_PASS": "w4$Y%nMtu!W&04XiWPOFY6OZxVchx5", "CLOUDFLARE_ZONE": "example.com", "CLOUDFLARE_SUBDOMAIN": "cctv", "CLOUDFLARE_EMAIL": "name@server.com", "CLOUDFLARE_TOKEN": "0000000000000000000000000000000000000", }
debug = True secret_key = 't6e%#%(w!lg1@1bk1$lhh%q_d4h&z*s3utakds-bzu-3b(bebe' nevercache_key = 'dit-cgsc$(w%xx)z*=l1-1vtz%a6v1hwhv9jtlsm0_kcg(md0z' databases = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'dev.db', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': ''}} allowed_hosts_production = ['example.com'] fabric = {'DEPLOY_TOOL': 'git', 'SSH_PASS': 'yourpass', 'REPO_PATH': 'git@github.com:linuxluigi/Django_CCTV.git', 'SSH_USER': 'pi', 'HOSTS': ['django-cctv'], 'DOMAINS': ALLOWED_HOSTS_PRODUCTION, 'REQUIREMENTS_PATH': 'requirements.txt', 'LOCALE': 'de_DE.UTF-8', 'DB_PASS': 'h@cn8ExAvdFg!AFWyRULgOqdnXGS!@hcbEJumZSzoHL57Nrj7LwFaLtgo2UC', 'ADMIN_PASS': '3zX4sMLTbM@M5wxd4e39dCDp5cN!lBVOcFia$U8uJN9X4^r0comSY%1S^bigyo99!s&Yau', 'SECRET_KEY': SECRET_KEY, 'NEVERCACHE_KEY': NEVERCACHE_KEY, 'NGINX_AUTH_USER': 'user', 'NGINX_AUTH_PASS': 'w4$Y%nMtu!W&04XiWPOFY6OZxVchx5', 'CLOUDFLARE_ZONE': 'example.com', 'CLOUDFLARE_SUBDOMAIN': 'cctv', 'CLOUDFLARE_EMAIL': 'name@server.com', 'CLOUDFLARE_TOKEN': '0000000000000000000000000000000000000'}
lista = [] consoantes = 0 for i in range(10): lista.append(input("Digite uma letra: ").lower()) char = lista[i] if char not in ('a','e','i','o','u'): consoantes += 1 print(consoantes)
lista = [] consoantes = 0 for i in range(10): lista.append(input('Digite uma letra: ').lower()) char = lista[i] if char not in ('a', 'e', 'i', 'o', 'u'): consoantes += 1 print(consoantes)
# Copyright 2015 Ufora Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ TestScriptDefinition Models a single unit-test script and the resources required to execute it. """ class TestScriptDefinition: validMachineDescriptions = set(["any", "2core", "8core", "32core"]) def __init__(self, testName, testScriptPath, machineCount): self.testName = testName self.testScriptPath = testScriptPath for m in machineCount: assert isinstance(machineCount[m], int) assert machineCount[m] > 0 assert machineCount[m] < 100 assert m in TestScriptDefinition.validMachineDescriptions self.machineCount = machineCount def toJson(self): return { 'testName': self.testName, 'testScriptPath': self.testScriptPath, 'machineCount': self.machineCount } @staticmethod def fromJson(json): return TestScriptDefinition( json['testName'], json['testScriptPath'], json['machineCount'] ) def __repr__(self): return "TestScriptDefinition(%s,%s,%s)" % ( self.testName, self.testScriptPath, self.machineCount ) def isSingleMachineTest(self): return self.totalMachinesRequired() == 1 def totalMachinesRequired(self): return sum(self.machineCount.values()) def isSatisfiedBy(self, machineCount): for m in self.machineCount: if m not in machineCount or machineCount[m] < self.machineCount[m]: return False return True
""" TestScriptDefinition Models a single unit-test script and the resources required to execute it. """ class Testscriptdefinition: valid_machine_descriptions = set(['any', '2core', '8core', '32core']) def __init__(self, testName, testScriptPath, machineCount): self.testName = testName self.testScriptPath = testScriptPath for m in machineCount: assert isinstance(machineCount[m], int) assert machineCount[m] > 0 assert machineCount[m] < 100 assert m in TestScriptDefinition.validMachineDescriptions self.machineCount = machineCount def to_json(self): return {'testName': self.testName, 'testScriptPath': self.testScriptPath, 'machineCount': self.machineCount} @staticmethod def from_json(json): return test_script_definition(json['testName'], json['testScriptPath'], json['machineCount']) def __repr__(self): return 'TestScriptDefinition(%s,%s,%s)' % (self.testName, self.testScriptPath, self.machineCount) def is_single_machine_test(self): return self.totalMachinesRequired() == 1 def total_machines_required(self): return sum(self.machineCount.values()) def is_satisfied_by(self, machineCount): for m in self.machineCount: if m not in machineCount or machineCount[m] < self.machineCount[m]: return False return True
x = "Hello world Python" print(x) # ------------------------------ print("\nTypes of data:") print(type(42)) print(type(0b1010)) print(type(99111999111999111999111999)) print(type(3.14)) print(type('a')) print(type( (1,2,3) )) print(type( {} )) print(type( {1,2,3} )) print(type(["b", 42, 3.14])) class ClassName: pass obj = ClassName() def function_name(): pass def generator_name(): yield 1 gen = generator_name() print(type(ClassName)) print(type(obj)) print(type(function_name)) print(type(gen)) # ------------------------------ # a, b = 2, 5 # print(a, b) # tmp = a # a = b # b = tmp # print(a, b) # b = a + b # a = b - a # b = b - a # print(a, b) # a, b = b, a # print(a, b) #-------------------------------- print("\nArifmetics priority:") print("Exponent \t **") print("Unar minus \t -") print("Multiplication \t *") print("Division \t /") print("Floor div \t //") print("Modulus \t %") print("Addition \t +") print("Substraction \t -") #--------------------------------- print("\nConditions:") condition = 2 if condition==2 : print("If condition is 2") elif condition==1 : print("Elif condition is 1") else : print("Else condition ") #------------------------------------ print("\nLoops:") # loop while condition = True while condition : #iteration print("Loop While") condition = False else : print("Loop while else") # loop for print("For loop from 1 to 10:") #range(start, stop, step) n = range(1, 11, 1) for x in n : print(x, end=' ') #-------------------------------------------------------- print("\n\nLogic operations:") print("operator \t x \t y \t equals") # print("\n") print("not \t\t False \t \t %s" % (not False)) print("not \t\t True \t \t %s" % (not True)) # print("\n") print("and \t\t False \t False \t %s" % (False and False)) print("and \t\t True \t False \t %s" % (True and False)) print("and \t\t False \t True \t %s" % (False and True)) print("and \t\t True \t True \t %s" % (True and True)) # print("\n") print("or \t\t False \t False \t %s" % (False or False)) print("or \t\t True \t False \t %s" % (True or False)) print("or \t\t False \t True \t %s" % (False or True)) print("or \t\t True \t True \t %s" % (True or True)) # print("\n") print("is \t\t False \t False \t %s" % (False is False)) print("is \t\t True \t False \t %s" % (True is False)) print("is \t\t False \t True \t %s" % (False is True)) print("is \t\t True \t True \t %s" % (True is True)) # print("\n") print("\nBitwise operations:") # print("\n") print("<< \t\t 0b0 \t 0b0 \t %s" % (0b0 << 0b0)) print("<< \t\t 0b1 \t 0b0 \t %s" % (0b1 << 0b0)) print("<< \t\t 0b0 \t 0b1 \t %s" % (0b0 << 0b1)) print("<< \t\t 0b1 \t 0b1 \t %s" % (0b1 << 0b1)) # print("\n") print(">> \t\t 0b0 \t 0b0 \t %s" % (0b0 >> 0b0)) print(">> \t\t 0b1 \t 0b0 \t %s" % (0b1 >> 0b0)) print(">> \t\t 0b0 \t 0b1 \t %s" % (0b0 >> 0b1)) print(">> \t\t 0b1 \t 0b1 \t %s" % (0b1 >> 0b1)) # print("\n") print("& \t\t 0b0 \t 0b0 \t %s" % (0b0 & 0b0)) print("& \t\t 0b1 \t 0b0 \t %s" % (0b1 & 0b0)) print("& \t\t 0b0 \t 0b1 \t %s" % (0b0 & 0b1)) print("& \t\t 0b1 \t 0b1 \t %s" % (0b1 & 0b1)) # print("\n") print("| \t\t 0b0 \t 0b0 \t %s" % (0b0 | 0b0)) print("| \t\t 0b1 \t 0b0 \t %s" % (0b1 | 0b0)) print("| \t\t 0b0 \t 0b1 \t %s" % (0b0 | 0b1)) print("| \t\t 0b1 \t 0b1 \t %s" % (0b1 | 0b1)) # print("\n") print("^ \t\t 0b0 \t 0b0 \t %s" % (0b0 ^ 0b0)) print("^ \t\t 0b1 \t 0b0 \t %s" % (0b1 ^ 0b0)) print("^ \t\t 0b0 \t 0b1 \t %s" % (0b0 ^ 0b1)) print("^ \t\t 0b1 \t 0b1 \t %s" % (0b1 ^ 0b1)) # print("\n") print("~ \t\t 0b0 \t \t %s" % (~ 0b0)) print("~ \t\t 0b1 \t \t %s" % (~ 0b1)) # range #functions------------------------------------------------------ def hello_world(parameter = " native parameter"): """ Documentation function hello_world """ print("helloWorld function %s" % parameter) # pass func_hw = hello_world func_hw("parameter") def hello_world_1(name,separator): """ Documentation function hello_world_1 """ print("hello", "world", name, "NAME", sep=separator) hello_world_1("PYTHONIST",separator="_") #--arrays--as--list--type-------------------------- for x in ['h','e','l','l','o',' ','w','o','r','l','d',' ']: print(x, end='') for x in [1,2,3,4,5,6,7,8,9,10]: print(x, end=' ') print() arr_hw = ['h','e','l','l','o',' ','w','o','r','l','d',' '] for x in range(0, len(arr_hw), 1): print(x, arr_hw[x], sep='-', end=' ') print() List = list(['h','e','l','l','o',' ','w','o','r','l','d']) print(List) #--list comprehension------------------------------- A = [4, 5, 2, 7, 23, 13, 14, 54, 32, 7] B = [x**2 for x in A if x%2==0] print(B) print('\n') #------------------------------------------------- Arr = [] print("Array length before append: %s" % len(Arr)) print(Arr) Arr.append(5) print("Array length after append: %s" % len(Arr)) print(Arr) Arr.append(7) print("Array length before pop: %s" % len(Arr)) print(Arr) Arr.pop() print("Array length after pop: %s" % len(Arr)) print(Arr) #-----Classes and their objects---------------------- """ __init__() __reper__() """ #-----IO work with files-------------------------------- """ open() read() write() close() __enter__() __exit__() with open("text.txt", "w") as textfile: pass """ #---native--functions----------------------------------- """ print() type() bin() str() int() float() bool() len() lower() upper() isalpha() reverse() len() list() append() pop() index() insert() join() remove() # del arr['key'] del(some) sort() filter(lambda x: x == condition, inArrayOrString) enumerate() zip() min() max() abs() input() raw_input() dir() math.sqrt() """ #--popular--librarys------------------------------------ """ import datetime import math import random """
x = 'Hello world Python' print(x) print('\nTypes of data:') print(type(42)) print(type(10)) print(type(99111999111999111999111999)) print(type(3.14)) print(type('a')) print(type((1, 2, 3))) print(type({})) print(type({1, 2, 3})) print(type(['b', 42, 3.14])) class Classname: pass obj = class_name() def function_name(): pass def generator_name(): yield 1 gen = generator_name() print(type(ClassName)) print(type(obj)) print(type(function_name)) print(type(gen)) print('\nArifmetics priority:') print('Exponent \t **') print('Unar minus \t -') print('Multiplication \t *') print('Division \t /') print('Floor div \t //') print('Modulus \t %') print('Addition \t +') print('Substraction \t -') print('\nConditions:') condition = 2 if condition == 2: print('If condition is 2') elif condition == 1: print('Elif condition is 1') else: print('Else condition ') print('\nLoops:') condition = True while condition: print('Loop While') condition = False else: print('Loop while else') print('For loop from 1 to 10:') n = range(1, 11, 1) for x in n: print(x, end=' ') print('\n\nLogic operations:') print('operator \t x \t y \t equals') print('not \t\t False \t \t %s' % (not False)) print('not \t\t True \t \t %s' % (not True)) print('and \t\t False \t False \t %s' % (False and False)) print('and \t\t True \t False \t %s' % (True and False)) print('and \t\t False \t True \t %s' % (False and True)) print('and \t\t True \t True \t %s' % (True and True)) print('or \t\t False \t False \t %s' % (False or False)) print('or \t\t True \t False \t %s' % (True or False)) print('or \t\t False \t True \t %s' % (False or True)) print('or \t\t True \t True \t %s' % (True or True)) print('is \t\t False \t False \t %s' % (False is False)) print('is \t\t True \t False \t %s' % (True is False)) print('is \t\t False \t True \t %s' % (False is True)) print('is \t\t True \t True \t %s' % (True is True)) print('\nBitwise operations:') print('<< \t\t 0b0 \t 0b0 \t %s' % (0 << 0)) print('<< \t\t 0b1 \t 0b0 \t %s' % (1 << 0)) print('<< \t\t 0b0 \t 0b1 \t %s' % (0 << 1)) print('<< \t\t 0b1 \t 0b1 \t %s' % (1 << 1)) print('>> \t\t 0b0 \t 0b0 \t %s' % (0 >> 0)) print('>> \t\t 0b1 \t 0b0 \t %s' % (1 >> 0)) print('>> \t\t 0b0 \t 0b1 \t %s' % (0 >> 1)) print('>> \t\t 0b1 \t 0b1 \t %s' % (1 >> 1)) print('& \t\t 0b0 \t 0b0 \t %s' % (0 & 0)) print('& \t\t 0b1 \t 0b0 \t %s' % (1 & 0)) print('& \t\t 0b0 \t 0b1 \t %s' % (0 & 1)) print('& \t\t 0b1 \t 0b1 \t %s' % (1 & 1)) print('| \t\t 0b0 \t 0b0 \t %s' % (0 | 0)) print('| \t\t 0b1 \t 0b0 \t %s' % (1 | 0)) print('| \t\t 0b0 \t 0b1 \t %s' % (0 | 1)) print('| \t\t 0b1 \t 0b1 \t %s' % (1 | 1)) print('^ \t\t 0b0 \t 0b0 \t %s' % (0 ^ 0)) print('^ \t\t 0b1 \t 0b0 \t %s' % (1 ^ 0)) print('^ \t\t 0b0 \t 0b1 \t %s' % (0 ^ 1)) print('^ \t\t 0b1 \t 0b1 \t %s' % (1 ^ 1)) print('~ \t\t 0b0 \t \t %s' % ~0) print('~ \t\t 0b1 \t \t %s' % ~1) def hello_world(parameter=' native parameter'): """ Documentation function hello_world """ print('helloWorld function %s' % parameter) func_hw = hello_world func_hw('parameter') def hello_world_1(name, separator): """ Documentation function hello_world_1 """ print('hello', 'world', name, 'NAME', sep=separator) hello_world_1('PYTHONIST', separator='_') for x in ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', ' ']: print(x, end='') for x in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]: print(x, end=' ') print() arr_hw = ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', ' '] for x in range(0, len(arr_hw), 1): print(x, arr_hw[x], sep='-', end=' ') print() list = list(['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']) print(List) a = [4, 5, 2, 7, 23, 13, 14, 54, 32, 7] b = [x ** 2 for x in A if x % 2 == 0] print(B) print('\n') arr = [] print('Array length before append: %s' % len(Arr)) print(Arr) Arr.append(5) print('Array length after append: %s' % len(Arr)) print(Arr) Arr.append(7) print('Array length before pop: %s' % len(Arr)) print(Arr) Arr.pop() print('Array length after pop: %s' % len(Arr)) print(Arr) '\n\n__init__()\n__reper__()\n' '\nopen()\nread()\nwrite()\nclose()\n\n__enter__()\n__exit__()\n\nwith open("text.txt", "w") as textfile:\n\tpass\n' "\nprint()\n\ntype()\n\nbin()\nstr()\nint()\nfloat()\nbool()\n\nlen()\n\nlower()\nupper()\nisalpha()\nreverse()\n\nlen()\n\nlist()\nappend()\npop()\nindex()\ninsert()\njoin()\nremove() # del arr['key'] del(some)\nsort()\nfilter(lambda x: x == condition, inArrayOrString)\n\nenumerate()\nzip()\n\nmin()\nmax()\nabs()\n\ninput()\nraw_input()\n\n\ndir()\n\nmath.sqrt()\n" '\nimport datetime\nimport math \nimport random\n'
# -*- coding: utf-8 -*- """ Raw time-series data from BES detectors. BES detectors generate differential signals such that "zero signal" or "no light" corresponds to about -9.5 V. DC signal levels should be referenced to the "zero signal" output. "No light" shots (due to failed shutters) include 138545 and 138858, BES detector channels **do not** correspond to permanent measurement locations. BES sightlines observe fixed measurement locations, but sightline optical fibers can be coupled into any detector channel based upon experimental needs. Consequently, the measurement location of detector channels can change day to day. That said, **most** BES data from 2010 adhered to a standard configuration with channels 1-8 spanning the radial range R = 129-146 cm. """ description = __doc__ if __name__ == '__main__': print(description)
""" Raw time-series data from BES detectors. BES detectors generate differential signals such that "zero signal" or "no light" corresponds to about -9.5 V. DC signal levels should be referenced to the "zero signal" output. "No light" shots (due to failed shutters) include 138545 and 138858, BES detector channels **do not** correspond to permanent measurement locations. BES sightlines observe fixed measurement locations, but sightline optical fibers can be coupled into any detector channel based upon experimental needs. Consequently, the measurement location of detector channels can change day to day. That said, **most** BES data from 2010 adhered to a standard configuration with channels 1-8 spanning the radial range R = 129-146 cm. """ description = __doc__ if __name__ == '__main__': print(description)
"""Support for all kinds of Smappee plugs.""" class SmappeeActuator: """Representation of a Smappee Comfort Plug, Switch and IO module.""" def __init__(self, id, name, serialnumber, state_values, connection_state, type): # configuration details self._id = id self._name = name self._serialnumber = serialnumber self._state_values = state_values self._type = type # states self._connection_state = connection_state self._state = None # extract current state and possible values from state_values self._state_options = [] for state_value in self._state_values: self._state_options.append(state_value.get('id')) if state_value.get('current'): self._state = state_value.get('id') # aggregated values (only for Smappee Switch) self._consumption_today = None @property def id(self): return self._id @property def name(self): return self._name @property def serialnumber(self): return self._serialnumber @serialnumber.setter def serialnumber(self, serialnumber): self._serialnumber = serialnumber @property def state_values(self): return self._state_values @property def type(self): return self._type @property def connection_state(self): return self._connection_state @connection_state.setter def connection_state(self, connection_state): self._connection_state = connection_state @property def state(self): return self._state @state.setter def state(self, state): if state in ['ON', 'OFF']: # backwards compatibility (retained MQTT) state = f'{state}_{state}' self._state = state @property def state_options(self): return self._state_options @property def consumption_today(self): return self._consumption_today @consumption_today.setter def consumption_today(self, consumption_today): self._consumption_today = consumption_today
"""Support for all kinds of Smappee plugs.""" class Smappeeactuator: """Representation of a Smappee Comfort Plug, Switch and IO module.""" def __init__(self, id, name, serialnumber, state_values, connection_state, type): self._id = id self._name = name self._serialnumber = serialnumber self._state_values = state_values self._type = type self._connection_state = connection_state self._state = None self._state_options = [] for state_value in self._state_values: self._state_options.append(state_value.get('id')) if state_value.get('current'): self._state = state_value.get('id') self._consumption_today = None @property def id(self): return self._id @property def name(self): return self._name @property def serialnumber(self): return self._serialnumber @serialnumber.setter def serialnumber(self, serialnumber): self._serialnumber = serialnumber @property def state_values(self): return self._state_values @property def type(self): return self._type @property def connection_state(self): return self._connection_state @connection_state.setter def connection_state(self, connection_state): self._connection_state = connection_state @property def state(self): return self._state @state.setter def state(self, state): if state in ['ON', 'OFF']: state = f'{state}_{state}' self._state = state @property def state_options(self): return self._state_options @property def consumption_today(self): return self._consumption_today @consumption_today.setter def consumption_today(self, consumption_today): self._consumption_today = consumption_today
ninjas = ( ("Kakashi", ["Raiton", "Doton", "Suiton", "Katon"]), ("Tobirama", ["Suiton", "Doton"]), ("Minato", ["Raiton", "Katon", "Futon"]), ("Naruto", ["Futon"]) ) print(ninjas[0]) print(ninjas[2][1])
ninjas = (('Kakashi', ['Raiton', 'Doton', 'Suiton', 'Katon']), ('Tobirama', ['Suiton', 'Doton']), ('Minato', ['Raiton', 'Katon', 'Futon']), ('Naruto', ['Futon'])) print(ninjas[0]) print(ninjas[2][1])
username = "" password = "" studentPassword = ""
username = '' password = '' student_password = ''
""" Helpers for Python's logging. """ __all__ = ['BASE_LOGGING'] BASE_LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'default': { 'format': '%(asctime)s %(name)s %(levelname)s %(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S', }, }, 'handlers': { 'console': { 'class': 'logging.StreamHandler', 'level': 'NOTSET', 'formatter': 'default', }, }, 'root': { 'handlers': ['console'], 'level': 'INFO', }, } """ Default logging configuration. Defines top-level root logger, which forwards log messages onto console. """
""" Helpers for Python's logging. """ __all__ = ['BASE_LOGGING'] base_logging = {'version': 1, 'disable_existing_loggers': False, 'formatters': {'default': {'format': '%(asctime)s %(name)s %(levelname)s %(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S'}}, 'handlers': {'console': {'class': 'logging.StreamHandler', 'level': 'NOTSET', 'formatter': 'default'}}, 'root': {'handlers': ['console'], 'level': 'INFO'}} '\nDefault logging configuration. Defines top-level root logger, which\nforwards log messages onto console.\n'
def who_eats_who(zoo_input): animals = {'antelope': ['grass'], 'big-fish': ['little-fish'], 'bug': ['leaves'], 'bear': ['big-fish', 'bug', 'chicken', 'cow', 'leaves', 'sheep'], 'chicken': ['bug'], 'cow': ['grass'], 'fox': ['chicken', 'sheep'], 'giraffe': ['leaves'], 'lion': ['antelope', 'cow'], 'panda': ['leaves'], 'sheep': ['grass']} zoo = zoo_input.split(',') output = [] i = 0 while True: try: if i - 1 < 0: raise IndexError elif zoo[i - 1] in animals.get(zoo[i], []): output.append('{} eats {}'.format(zoo[i], zoo.pop(i - 1))) i = 0 elif zoo[i + 1] in animals.get(zoo[i], []): output.append('{} eats {}'.format(zoo[i], zoo.pop(i + 1))) i = 0 else: i += 1 except IndexError: try: if zoo[i + 1] in animals.get(zoo[i], []): output.append('{} eats {}'.format(zoo[i], zoo.pop(i + 1))) i = 0 elif i < len(zoo) + 1: i += 1 except IndexError: output.append(','.join(zoo)) break return [zoo_input] + output zoo_animals = "fox,bug,chicken,grass,sheep" expected = ["fox,bug,chicken,grass,sheep", "chicken eats bug", "fox eats chicken", "sheep eats grass", "fox eats sheep", "fox"]
def who_eats_who(zoo_input): animals = {'antelope': ['grass'], 'big-fish': ['little-fish'], 'bug': ['leaves'], 'bear': ['big-fish', 'bug', 'chicken', 'cow', 'leaves', 'sheep'], 'chicken': ['bug'], 'cow': ['grass'], 'fox': ['chicken', 'sheep'], 'giraffe': ['leaves'], 'lion': ['antelope', 'cow'], 'panda': ['leaves'], 'sheep': ['grass']} zoo = zoo_input.split(',') output = [] i = 0 while True: try: if i - 1 < 0: raise IndexError elif zoo[i - 1] in animals.get(zoo[i], []): output.append('{} eats {}'.format(zoo[i], zoo.pop(i - 1))) i = 0 elif zoo[i + 1] in animals.get(zoo[i], []): output.append('{} eats {}'.format(zoo[i], zoo.pop(i + 1))) i = 0 else: i += 1 except IndexError: try: if zoo[i + 1] in animals.get(zoo[i], []): output.append('{} eats {}'.format(zoo[i], zoo.pop(i + 1))) i = 0 elif i < len(zoo) + 1: i += 1 except IndexError: output.append(','.join(zoo)) break return [zoo_input] + output zoo_animals = 'fox,bug,chicken,grass,sheep' expected = ['fox,bug,chicken,grass,sheep', 'chicken eats bug', 'fox eats chicken', 'sheep eats grass', 'fox eats sheep', 'fox']
""" [7/30/2012] Challenge #83 [intermediate] (Indexed file search) https://www.reddit.com/r/dailyprogrammer/comments/xdx4o/7302012_challenge_83_intermediate_indexed_file/ For this challenge, write two programs: * 'index file1 file2 file3 ...' which creates an index of the words used in the given files (you can assume that they are plain text) * 'search word1 word2 ...' which prints the name of every file in the index that contains all of the words given. This program should use the index previously built to find the files very quickly. The speed of the "index" program doesn't matter much (i.e. you don't need to optimize it all that much), but "search" should finish very quickly, almost instantly. It should also scale very well, it shouldn't take longer to search an index of 10000 files compared to an index of 100 files. Google, after all, can handle the same task for billions/milliards* of documents, perhaps even trillions/billions! *(*\**see easy problem for explanation)* Index a folder where you have a lot of text files, which on my computer would probably mean the folders where I store the programs I've written. If you don't have a lot text files, head over to Project Gutenberg and go nuts. Good luck! * Thanks to [abecedarius](http://www.reddit.com/user/abecedarius) for suggesting this problem at /r/dailyprogrammer_ideas! If you have a problem that you think would be fun, head on over there and suggest it! """ def main(): pass if __name__ == "__main__": main()
""" [7/30/2012] Challenge #83 [intermediate] (Indexed file search) https://www.reddit.com/r/dailyprogrammer/comments/xdx4o/7302012_challenge_83_intermediate_indexed_file/ For this challenge, write two programs: * 'index file1 file2 file3 ...' which creates an index of the words used in the given files (you can assume that they are plain text) * 'search word1 word2 ...' which prints the name of every file in the index that contains all of the words given. This program should use the index previously built to find the files very quickly. The speed of the "index" program doesn't matter much (i.e. you don't need to optimize it all that much), but "search" should finish very quickly, almost instantly. It should also scale very well, it shouldn't take longer to search an index of 10000 files compared to an index of 100 files. Google, after all, can handle the same task for billions/milliards* of documents, perhaps even trillions/billions! *(*\\**see easy problem for explanation)* Index a folder where you have a lot of text files, which on my computer would probably mean the folders where I store the programs I've written. If you don't have a lot text files, head over to Project Gutenberg and go nuts. Good luck! * Thanks to [abecedarius](http://www.reddit.com/user/abecedarius) for suggesting this problem at /r/dailyprogrammer_ideas! If you have a problem that you think would be fun, head on over there and suggest it! """ def main(): pass if __name__ == '__main__': main()
class Subaccount(): def __init__(self, base): self.method = "" self.base = base def create(self, params={}): self.method = "createSubAccount" return self.base.request(self.method, params=params) def delete(self, params={}): self.method = "delSubAccount" return self.base.request(self.method, params=params) def fetch(self, params={}): self.method = "getSubAccounts" return self.base.request(self.method, params=params) def set(self, params={}): self.method = "setSubAccount" return self.base.request(self.method, params=params)
class Subaccount: def __init__(self, base): self.method = '' self.base = base def create(self, params={}): self.method = 'createSubAccount' return self.base.request(self.method, params=params) def delete(self, params={}): self.method = 'delSubAccount' return self.base.request(self.method, params=params) def fetch(self, params={}): self.method = 'getSubAccounts' return self.base.request(self.method, params=params) def set(self, params={}): self.method = 'setSubAccount' return self.base.request(self.method, params=params)
for x in range(3): print("Iteration" + str(x+1) + "of outer loop") for y in range(2): print(y+1) print("Out of inner loop") print("Out of outer loop")
for x in range(3): print('Iteration' + str(x + 1) + 'of outer loop') for y in range(2): print(y + 1) print('Out of inner loop') print('Out of outer loop')
s1=input() s2=input() s3=input() a = "".join(sorted(s1+s2)) b = "".join(sorted(s3)) if a==b: print("YES") else: print("NO")
s1 = input() s2 = input() s3 = input() a = ''.join(sorted(s1 + s2)) b = ''.join(sorted(s3)) if a == b: print('YES') else: print('NO')
p = 2 f = 1 MAXITER = 60000 def setup(): size(600, 600) this.surface.setTitle("Primzahl-Spirale") background(51) frameRate(1000) def draw(): colorMode(HSB) global p, f, i translate(width/2, height/2) noStroke() fill(p%255, 255, 255) # Satz von Wilson if f%p%2: x = p*sin(p)*0.005 y = p*cos(p)*0.005 ellipse(x, y, 2, 2) p += 1 f *= (p-2) if p > MAXITER: print("I did it, Babe!") noLoop()
p = 2 f = 1 maxiter = 60000 def setup(): size(600, 600) this.surface.setTitle('Primzahl-Spirale') background(51) frame_rate(1000) def draw(): color_mode(HSB) global p, f, i translate(width / 2, height / 2) no_stroke() fill(p % 255, 255, 255) if f % p % 2: x = p * sin(p) * 0.005 y = p * cos(p) * 0.005 ellipse(x, y, 2, 2) p += 1 f *= p - 2 if p > MAXITER: print('I did it, Babe!') no_loop()
lista=[1,2,3,4,5,6,7,8,8] l=len(lista) n=False for x in range(l): for y in range(l): if x!=y and lista[y]==lista[x]: n=True if n==True: print ('Yes') else: print('No')
lista = [1, 2, 3, 4, 5, 6, 7, 8, 8] l = len(lista) n = False for x in range(l): for y in range(l): if x != y and lista[y] == lista[x]: n = True if n == True: print('Yes') else: print('No')
class ConditionsMixin(object): conditions_url = 'conditions/conditions/' def list_conditions(self, **kwargs): return self.list(self.conditions_url, **kwargs) def index_conditions(self, **kwargs): kwargs.update({'list_route': 'index'}) return self.list(self.conditions_url, **kwargs) def retrieve_condition(self, pk): return self.retrieve(self.conditions_url, pk) def create_condition(self, data): return self.create(self.conditions_url, data) def update_condition(self, pk, data): return self.update(self.conditions_url, pk, data) def destroy_condition(self, pk): return self.destroy(self.conditions_url, pk)
class Conditionsmixin(object): conditions_url = 'conditions/conditions/' def list_conditions(self, **kwargs): return self.list(self.conditions_url, **kwargs) def index_conditions(self, **kwargs): kwargs.update({'list_route': 'index'}) return self.list(self.conditions_url, **kwargs) def retrieve_condition(self, pk): return self.retrieve(self.conditions_url, pk) def create_condition(self, data): return self.create(self.conditions_url, data) def update_condition(self, pk, data): return self.update(self.conditions_url, pk, data) def destroy_condition(self, pk): return self.destroy(self.conditions_url, pk)
# Copyright 2016 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Use this to run several variants of the tests. ALL_VARIANT_FLAGS = { "default": [[]], "future": [["--future"]], "liftoff": [["--liftoff"]], "minor_mc": [["--minor-mc"]], "stress": [["--stress-opt", "--always-opt"]], # TODO(6792): Write protected code has been temporary added to the below # variant until the feature has been enabled (or staged) by default. "stress_incremental_marking": [["--stress-incremental-marking", "--write-protect-code-memory"]], # No optimization means disable all optimizations. OptimizeFunctionOnNextCall # would not force optimization too. It turns into a Nop. Please see # https://chromium-review.googlesource.com/c/452620/ for more discussion. "nooptimization": [["--noopt"]], "stress_background_compile": [["--background-compile", "--stress-background-compile"]], "wasm_traps": [["--wasm_trap_handler", "--invoke-weak-callbacks", "--wasm-jit-to-native"]], } # FAST_VARIANTS implies no --always-opt. FAST_VARIANT_FLAGS = dict( (k, [[f for f in v[0] if f != "--always-opt"]]) for k, v in ALL_VARIANT_FLAGS.iteritems() ) ALL_VARIANTS = set(ALL_VARIANT_FLAGS.keys())
all_variant_flags = {'default': [[]], 'future': [['--future']], 'liftoff': [['--liftoff']], 'minor_mc': [['--minor-mc']], 'stress': [['--stress-opt', '--always-opt']], 'stress_incremental_marking': [['--stress-incremental-marking', '--write-protect-code-memory']], 'nooptimization': [['--noopt']], 'stress_background_compile': [['--background-compile', '--stress-background-compile']], 'wasm_traps': [['--wasm_trap_handler', '--invoke-weak-callbacks', '--wasm-jit-to-native']]} fast_variant_flags = dict(((k, [[f for f in v[0] if f != '--always-opt']]) for (k, v) in ALL_VARIANT_FLAGS.iteritems())) all_variants = set(ALL_VARIANT_FLAGS.keys())
wh = 4 wl = 4 pc = wh-1 for x in range(0,wh+1): pchar = ord('A') for y in range(0,(wh*wl*2)): if y%(wh*2)==pc or y%(wh*2)==wh+x: print(chr(pchar),end='') else: print(' ',end='') pchar+=1 if pchar>ord('Z'): pchar = pchar-26 pc-=1 print() """ PATTERN - 34 DE LM TU BC C F K N S V A D B G J O R W Z E A HI PQ XY F """
wh = 4 wl = 4 pc = wh - 1 for x in range(0, wh + 1): pchar = ord('A') for y in range(0, wh * wl * 2): if y % (wh * 2) == pc or y % (wh * 2) == wh + x: print(chr(pchar), end='') else: print(' ', end='') pchar += 1 if pchar > ord('Z'): pchar = pchar - 26 pc -= 1 print() '\nPATTERN - 34\n\n DE LM TU BC\n C F K N S V A D\n B G J O R W Z E\nA HI PQ XY F\n\n'
"""Module with exceptions for virtual machine and bytecode compiler.""" class BadOperationSize(Exception): """Bad operation size genegerated/written to bytecode."""
"""Module with exceptions for virtual machine and bytecode compiler.""" class Badoperationsize(Exception): """Bad operation size genegerated/written to bytecode."""
markup = var('Markup (%)', 0, '', number) if part.material: set_operation_name('{} Markup {}%'.format(part.material, markup)) markup_cost = get_price_value('--material--') * (markup / 100) PRICE = markup_cost DAYS = 0
markup = var('Markup (%)', 0, '', number) if part.material: set_operation_name('{} Markup {}%'.format(part.material, markup)) markup_cost = get_price_value('--material--') * (markup / 100) price = markup_cost days = 0
''' You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water. The area of an island is the number of cells with a value 1 in the island. Return the maximum area of an island in grid. If there is no island, return 0. Example: Input: grid = [[0,0,1,0,0,0,0,1,0,0,0,0,0], [0,0,0,0,0,0,0,1,1,1,0,0,0], [0,1,1,0,1,0,0,0,0,0,0,0,0], [0,1,0,0,1,1,0,0,1,0,1,0,0], [0,1,0,0,1,1,0,0,1,1,1,0,0], [0,0,0,0,0,0,0,0,0,0,1,0,0], [0,0,0,0,0,0,0,1,1,1,0,0,0], [0,0,0,0,0,0,0,1,1,0,0,0,0]] Output: 6 Explanation: The answer is not 11, because the island must be connected 4-directionally. Example: Input: grid = [[0,0,0,0,0,0,0,0]] Output: 0 Constraints: - m == grid.length - n == grid[i].length - 1 <= m, n <= 50 - grid[i][j] is either 0 or 1. ''' #Difficulty: Medium #728 / 728 test cases passed. #Runtime: 160 ms #Memory Usage: 16.3 MB #Runtime: 160 ms, faster than 23.97% of Python3 online submissions for Max Area of Island. #Memory Usage: 16.3 MB, less than 60.97% of Python3 online submissions for Max Area of Island. class Solution: def maxAreaOfIsland(self, grid: List[List[int]]) -> int: maxAreaOfIsland = 0 for i in range(len(grid)): for j in range(len(grid[i])): if grid[i][j] == 1: self.area = 0 self.dfs(grid, i, j) maxAreaOfIsland = max(maxAreaOfIsland, self.area) return maxAreaOfIsland def dfs(self, grid, row, col): if row < 0 or row > len(grid) - 1 or col < 0 or col > len(grid[row]) - 1 or grid[row][col] == 0: return grid[row][col] = 0 self.area += 1 self.dfs(grid, row, col - 1) self.dfs(grid, row - 1, col) self.dfs(grid, row, col + 1) self.dfs(grid, row + 1, col)
""" You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water. The area of an island is the number of cells with a value 1 in the island. Return the maximum area of an island in grid. If there is no island, return 0. Example: Input: grid = [[0,0,1,0,0,0,0,1,0,0,0,0,0], [0,0,0,0,0,0,0,1,1,1,0,0,0], [0,1,1,0,1,0,0,0,0,0,0,0,0], [0,1,0,0,1,1,0,0,1,0,1,0,0], [0,1,0,0,1,1,0,0,1,1,1,0,0], [0,0,0,0,0,0,0,0,0,0,1,0,0], [0,0,0,0,0,0,0,1,1,1,0,0,0], [0,0,0,0,0,0,0,1,1,0,0,0,0]] Output: 6 Explanation: The answer is not 11, because the island must be connected 4-directionally. Example: Input: grid = [[0,0,0,0,0,0,0,0]] Output: 0 Constraints: - m == grid.length - n == grid[i].length - 1 <= m, n <= 50 - grid[i][j] is either 0 or 1. """ class Solution: def max_area_of_island(self, grid: List[List[int]]) -> int: max_area_of_island = 0 for i in range(len(grid)): for j in range(len(grid[i])): if grid[i][j] == 1: self.area = 0 self.dfs(grid, i, j) max_area_of_island = max(maxAreaOfIsland, self.area) return maxAreaOfIsland def dfs(self, grid, row, col): if row < 0 or row > len(grid) - 1 or col < 0 or (col > len(grid[row]) - 1) or (grid[row][col] == 0): return grid[row][col] = 0 self.area += 1 self.dfs(grid, row, col - 1) self.dfs(grid, row - 1, col) self.dfs(grid, row, col + 1) self.dfs(grid, row + 1, col)
def teardown_function(function): pass def test(): pass
def teardown_function(function): pass def test(): pass
''' 937. Reorder Data in Log Files You have an array of logs. Each log is a space delimited string of words. For each log, the first word in each log is an alphanumeric identifier. Then, either: Each word after the identifier will consist only of lowercase letters, or; Each word after the identifier will consist only of digits. We will call these two varieties of logs letter-logs and digit-logs. It is guaranteed that each log has at least one word after its identifier. Reorder the logs so that all of the letter-logs come before any digit-log. The letter-logs are ordered lexicographically ignoring identifier, with the identifier used in case of ties. The digit-logs should be put in their original order. Return the final order of the logs. Example 1: Input: logs = ["dig1 8 1 5 1","let1 art can","dig2 3 6","let2 own kit dig","let3 art zero"] Output: ["let1 art can","let3 art zero","let2 own kit dig","dig1 8 1 5 1","dig2 3 6"] Constraints: 0 <= logs.length <= 100 3 <= logs[i].length <= 100 logs[i] is guaranteed to have an identifier, and a word after the identifier. ''' class Solution: def reorderLogFiles(self, logs: List[str]) -> List[str]: dig_log = [] let_log = [] for log in logs: if log.split(' ')[1].isalpha(): let_log.append(log) else: dig_log.append(log) # Sort the first part of letter logs let_log.sort(key=lambda x: x.split(' ')[0]) # Sort by remaining letter logs let_log.sort(key=lambda x: x.split(' ')[1:]) # Append the digit log let_log.extend(dig_log) return let_log
""" 937. Reorder Data in Log Files You have an array of logs. Each log is a space delimited string of words. For each log, the first word in each log is an alphanumeric identifier. Then, either: Each word after the identifier will consist only of lowercase letters, or; Each word after the identifier will consist only of digits. We will call these two varieties of logs letter-logs and digit-logs. It is guaranteed that each log has at least one word after its identifier. Reorder the logs so that all of the letter-logs come before any digit-log. The letter-logs are ordered lexicographically ignoring identifier, with the identifier used in case of ties. The digit-logs should be put in their original order. Return the final order of the logs. Example 1: Input: logs = ["dig1 8 1 5 1","let1 art can","dig2 3 6","let2 own kit dig","let3 art zero"] Output: ["let1 art can","let3 art zero","let2 own kit dig","dig1 8 1 5 1","dig2 3 6"] Constraints: 0 <= logs.length <= 100 3 <= logs[i].length <= 100 logs[i] is guaranteed to have an identifier, and a word after the identifier. """ class Solution: def reorder_log_files(self, logs: List[str]) -> List[str]: dig_log = [] let_log = [] for log in logs: if log.split(' ')[1].isalpha(): let_log.append(log) else: dig_log.append(log) let_log.sort(key=lambda x: x.split(' ')[0]) let_log.sort(key=lambda x: x.split(' ')[1:]) let_log.extend(dig_log) return let_log
def parenMenu(choices,prompt="> "): i = 0 for item in choices: i += 1 print("{!s}) {!s}".format(i,item)) while True: try: choice = int(raw_input(prompt)) choice -= 1 if choice in [x for x in range(0,len(choices))]: return choice except: continue
def paren_menu(choices, prompt='> '): i = 0 for item in choices: i += 1 print('{!s}) {!s}'.format(i, item)) while True: try: choice = int(raw_input(prompt)) choice -= 1 if choice in [x for x in range(0, len(choices))]: return choice except: continue
print('==============Calculadora de diretamente proporcional==============') num1=int(input('escolha o primeiro numeros:')) num2=int(input('escolha o segundo numeros:')) num3=int(input('escolha o terceiro numeros:')) total=int(input('qual o total:')) b=num2/num1 c=num3/num1 result=1+b+c result2=total/result result3=b*result2 result4=c*result2 print(num1,':',result2,'\t','//',num2,':',result3,'\t','//',num3,':',result4)
print('==============Calculadora de diretamente proporcional==============') num1 = int(input('escolha o primeiro numeros:')) num2 = int(input('escolha o segundo numeros:')) num3 = int(input('escolha o terceiro numeros:')) total = int(input('qual o total:')) b = num2 / num1 c = num3 / num1 result = 1 + b + c result2 = total / result result3 = b * result2 result4 = c * result2 print(num1, ':', result2, '\t', '//', num2, ':', result3, '\t', '//', num3, ':', result4)
class Sample: def __init__(self, num: int) -> None: self.num = num def __add__(self, other: "Sample") -> int: return self.num + other.num
class Sample: def __init__(self, num: int) -> None: self.num = num def __add__(self, other: 'Sample') -> int: return self.num + other.num
#!/usr/local/bin/python3.3 X = 88 print(X) def func(): global X X = 99 return func() print(X) y, z = 1, 2 def func2(): global x x = y + z return x print(func2()) y, z = 3, 4 print(func2())
x = 88 print(X) def func(): global X x = 99 return func() print(X) (y, z) = (1, 2) def func2(): global x x = y + z return x print(func2()) (y, z) = (3, 4) print(func2())
# -*- coding: utf-8 -*- ''' Some utilities .. moduleauthor:: David Marteau <david.marteau@mappy.com> ''' def enum(*sequential, **named): """ Create an enum type, as in the C language. You can, as i C, list names without any value, or set a value by using a named argument. But, of course, you cannot add unnamed arguments after named arguments... :param sequential: list of strings :param named: dictionnary of <strings:int value> :return: A new type created by using the params. :rtype: Enum """ enums = dict(zip(sequential, range(len(sequential))), **named) return type('Enum', (), enums) def signum(x): """ Give info about the sign of the given int. :param int x: Value whose sign is asked :return: -1 if the given value is negative, 0 if it is null, 1 if it is positive :rtype: int """ return -1 if x < 0 else 0 if x == 0 else 1 class lazyproperty(object): """ Meant to be used as decorator for lazy evaluation of an object attribute. Property should represent non-mutable data, as it replaces itself. """ def __init__(self, fget): self.fget = fget self.func_name = fget.__name__ self.__doc__ = fget.__doc__ def __get__(self, obj, cls): if obj is None: return None value = self.fget(obj) setattr(obj, self.func_name, value) return value
""" Some utilities .. moduleauthor:: David Marteau <david.marteau@mappy.com> """ def enum(*sequential, **named): """ Create an enum type, as in the C language. You can, as i C, list names without any value, or set a value by using a named argument. But, of course, you cannot add unnamed arguments after named arguments... :param sequential: list of strings :param named: dictionnary of <strings:int value> :return: A new type created by using the params. :rtype: Enum """ enums = dict(zip(sequential, range(len(sequential))), **named) return type('Enum', (), enums) def signum(x): """ Give info about the sign of the given int. :param int x: Value whose sign is asked :return: -1 if the given value is negative, 0 if it is null, 1 if it is positive :rtype: int """ return -1 if x < 0 else 0 if x == 0 else 1 class Lazyproperty(object): """ Meant to be used as decorator for lazy evaluation of an object attribute. Property should represent non-mutable data, as it replaces itself. """ def __init__(self, fget): self.fget = fget self.func_name = fget.__name__ self.__doc__ = fget.__doc__ def __get__(self, obj, cls): if obj is None: return None value = self.fget(obj) setattr(obj, self.func_name, value) return value
""" Strings for application and fuzzy vault modules """ # Application strings APP_WELCOME = "Welcome to the fuzzy vault fingerprint recognition application!" APP_CHOOSE_FUNCTION = "Please choose the functionality you want to use from the following list:" APP_FUNCTIONAILTIES = {'1': "Enroll new fingerprint", '2': "Verify fingerprint with ID", '3': "Exit"} APP_DESIRED_OPTION = "Please enter desired option: " APP_OPTION_FALSE = "The option you entered is not available." APP_BYE = "Bye bye!" # Enroll and verify fingerprint APP_NEW_ID = "Please enter your desired ID: " APP_ID_ERROR = "The ID you provided is not in the correct format. Please enter a number." APP_SCAN_FP = "Please put your finger on the fingerprint sensor." APP_ENROLL_SUCCESS = "Successfully enrolled fingerprint!" APP_VERIFY_SUCCESS = "Successfully matched fingerprint!" APP_VERIFY_FAILURE = "Failure in matching fingerprint..." APP_FV_SECRET = "Finished generating secret for fuzzy vault" APP_FV_GENERATED = "Finished generating fuzzy vault" APP_FV_SENT_DB = "Sent fuzzy vault to database" APP_RETRY_FP = "Fingerprint was not scanned appropriately, please try again..." APP_ERROR = "An error occurred! The option is not available!"
""" Strings for application and fuzzy vault modules """ app_welcome = 'Welcome to the fuzzy vault fingerprint recognition application!' app_choose_function = 'Please choose the functionality you want to use from the following list:' app_functionailties = {'1': 'Enroll new fingerprint', '2': 'Verify fingerprint with ID', '3': 'Exit'} app_desired_option = 'Please enter desired option: ' app_option_false = 'The option you entered is not available.' app_bye = 'Bye bye!' app_new_id = 'Please enter your desired ID: ' app_id_error = 'The ID you provided is not in the correct format. Please enter a number.' app_scan_fp = 'Please put your finger on the fingerprint sensor.' app_enroll_success = 'Successfully enrolled fingerprint!' app_verify_success = 'Successfully matched fingerprint!' app_verify_failure = 'Failure in matching fingerprint...' app_fv_secret = 'Finished generating secret for fuzzy vault' app_fv_generated = 'Finished generating fuzzy vault' app_fv_sent_db = 'Sent fuzzy vault to database' app_retry_fp = 'Fingerprint was not scanned appropriately, please try again...' app_error = 'An error occurred! The option is not available!'
""" https://leetcode.com/problems/employee-importance/ You are given a data structure of employee information, which includes the employee's unique id, his importance value and his direct subordinates' id. For example, employee 1 is the leader of employee 2, and employee 2 is the leader of employee 3. They have importance value 15, 10 and 5, respectively. Then employee 1 has a data structure like [1, 15, [2]], and employee 2 has [2, 10, [3]], and employee 3 has [3, 5, []]. Note that although employee 3 is also a subordinate of employee 1, the relationship is not direct. Now given the employee information of a company, and an employee id, you need to return the total importance value of this employee and all his subordinates. Example 1: Input: [[1, 5, [2, 3]], [2, 3, []], [3, 3, []]], 1 Output: 11 Explanation: Employee 1 has importance value 5, and he has two direct subordinates: employee 2 and employee 3. They both have importance value 3. So the total importance value of employee 1 is 5 + 3 + 3 = 11. Note: One employee has at most one direct leader and may have several subordinates. The maximum number of employees won't exceed 2000. """ # time complexity: O(n), space complexity: O(n) """ # Definition for Employee. class Employee: def __init__(self, id: int, importance: int, subordinates: List[int]): self.id = id self.importance = importance self.subordinates = subordinates """ class Solution: def getImportance(self, employees: List['Employee'], id: int) -> int: dic = dict() # employee id ==> list index for i in range(len(employees)): dic[employees[i].id] = i total = 0 queue = [id] while queue: employee = employees[dic[queue.pop(0)]] total += employee.importance if employee.subordinates: for i in employee.subordinates: queue.append(i) return total
""" https://leetcode.com/problems/employee-importance/ You are given a data structure of employee information, which includes the employee's unique id, his importance value and his direct subordinates' id. For example, employee 1 is the leader of employee 2, and employee 2 is the leader of employee 3. They have importance value 15, 10 and 5, respectively. Then employee 1 has a data structure like [1, 15, [2]], and employee 2 has [2, 10, [3]], and employee 3 has [3, 5, []]. Note that although employee 3 is also a subordinate of employee 1, the relationship is not direct. Now given the employee information of a company, and an employee id, you need to return the total importance value of this employee and all his subordinates. Example 1: Input: [[1, 5, [2, 3]], [2, 3, []], [3, 3, []]], 1 Output: 11 Explanation: Employee 1 has importance value 5, and he has two direct subordinates: employee 2 and employee 3. They both have importance value 3. So the total importance value of employee 1 is 5 + 3 + 3 = 11. Note: One employee has at most one direct leader and may have several subordinates. The maximum number of employees won't exceed 2000. """ '\n# Definition for Employee.\nclass Employee:\n def __init__(self, id: int, importance: int, subordinates: List[int]):\n self.id = id\n self.importance = importance\n self.subordinates = subordinates\n' class Solution: def get_importance(self, employees: List['Employee'], id: int) -> int: dic = dict() for i in range(len(employees)): dic[employees[i].id] = i total = 0 queue = [id] while queue: employee = employees[dic[queue.pop(0)]] total += employee.importance if employee.subordinates: for i in employee.subordinates: queue.append(i) return total
def fully_connected(qubits: int, *args, **kwargs): """ This function returns the value False. Use like any other function that creates and architecture when using analyse. """ return False
def fully_connected(qubits: int, *args, **kwargs): """ This function returns the value False. Use like any other function that creates and architecture when using analyse. """ return False
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def sumEvenGrandparent(self, root: TreeNode) -> int: ans = 0 def dfs(node, gp=None, p=None): if node is not None: if gp is not None and gp.val % 2 == 0: nonlocal ans ans += node.val dfs(node.left, p, node) dfs(node.right, p, node) dfs(root) return ans
class Solution: def sum_even_grandparent(self, root: TreeNode) -> int: ans = 0 def dfs(node, gp=None, p=None): if node is not None: if gp is not None and gp.val % 2 == 0: nonlocal ans ans += node.val dfs(node.left, p, node) dfs(node.right, p, node) dfs(root) return ans
# uncompyle6 version 2.9.10 # Python bytecode 2.6 (62161) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: c:\Temp\build\ZIBE\pyreadline\error.py # Compiled at: 2011-06-23 17:25:54 class ReadlineError(Exception): pass class GetSetError(ReadlineError): pass
class Readlineerror(Exception): pass class Getseterror(ReadlineError): pass
def page_layout(): response.headers['Content-Type']='text/css' boxes = get_boxes_on_page(request.vars.id) contents = "" for box in boxes : contents += ".cbox#c%(id)s { top:%(y)sem; left:%(x)sem; height:%(h)sem; width:%(w)sem; } \n"%dict(id=box.id, x=box.position_x, y=box.position_y, h=box.height, w=box.width) return dict(contents=contents)
def page_layout(): response.headers['Content-Type'] = 'text/css' boxes = get_boxes_on_page(request.vars.id) contents = '' for box in boxes: contents += '.cbox#c%(id)s { top:%(y)sem; left:%(x)sem; height:%(h)sem; width:%(w)sem; } \n' % dict(id=box.id, x=box.position_x, y=box.position_y, h=box.height, w=box.width) return dict(contents=contents)
############################################################################ # ##ABSOLUTE CORDINATE to screed CONVERSTION ############################################################################ def CorToSrc(x, y, ylen): i = ylen-1-y return(x, i) ############################################################################ # ##MATRIX TO ABSOLUTE CORDINATE CONVERSTION ############################################################################ def CorToMat(x, y, ylen): j = x i = ylen-1-y return(i, j) ############################################################################ # ##MATRIX TO ABSOLUTE CORDINATE CONVERSTION ############################################################################ def MatToCor(i, j, ylen): x = j y = ylen-1-i return (x, y) def giveAbsAngle(angle): if(angle < 0): return 360+angle elif(angle > 359): return angle-360 return angle
def cor_to_src(x, y, ylen): i = ylen - 1 - y return (x, i) def cor_to_mat(x, y, ylen): j = x i = ylen - 1 - y return (i, j) def mat_to_cor(i, j, ylen): x = j y = ylen - 1 - i return (x, y) def give_abs_angle(angle): if angle < 0: return 360 + angle elif angle > 359: return angle - 360 return angle
text = "The black cat climbed the green tree." print(text.index("c")) # 7 print(text.index("c", 8)) # 10 next c after index 8 print(text.index("gr", 8)) # 26 print(text.index("gr", 8, 16))
text = 'The black cat climbed the green tree.' print(text.index('c')) print(text.index('c', 8)) print(text.index('gr', 8)) print(text.index('gr', 8, 16))
class yin: pass class yang: def __del__(self): print("yang destruido") print("?")
class Yin: pass class Yang: def __del__(self): print('yang destruido') print('?')
"""Python hook that can be used to disable ignored rules in ZAP scans.""" def zap_started(zap, target): """This hook runs after the ZAP API has been successfully started. This is needed to disable passive scanning rules which we have set to IGNORE in the ZAP configuration files. Due to an unresolved issue with the scripts the HTML report generated will still include ignored passive rules so this allows us to ensure they never run and won't be present in the HTML report. https://github.com/zaproxy/zaproxy/issues/6291#issuecomment-725947370 https://github.com/zaproxy/zaproxy/issues/5212 """ # Active scan rules are ignored properly through the configuration file. # To see a list of all alerts and whether they are active or passive: # https://www.zaproxy.org/docs/alerts/ ignored_passive_scan_ids = [] # The `target` argument will contain the URL passed to the ZAP scripts, we # can use this to determine the appropriate rules to ignore. if 'web' in target or 'backend' in target: ignored_passive_scan_ids = [ 10036, # Server Leaks Version Information 10055, # CSP unsafe inline ] if 'frontend' in target: ignored_passive_scan_ids = [ 10020, # X-Frame-Option Header Not Set 10021, # X-Content-Type-Options Header Missing 10027, # Informational: Suspicious Comments 10036, # Server Leaks Version Information 10055, # CSP unsafe inline 10096, # Informational: Timestamp Disclosure - Unix 10109, # Modern Web Application 90022, # Application Error Disclosure ] for passive_scan_id in ignored_passive_scan_ids: # Use the ZAP Passive Scan API to disable ignored rules. # https://www.zaproxy.org/docs/api/#pscanactiondisablescanners # The ZAP scanner scripts do this only for active rules. # https://www.zaproxy.org/blog/2017-06-19-scanning-apis-with-zap/ zap.pscan.set_scanner_alert_threshold( id=passive_scan_id, alertthreshold='OFF' ) print(f'zap-hook disabled {len(ignored_passive_scan_ids)} passive rules')
"""Python hook that can be used to disable ignored rules in ZAP scans.""" def zap_started(zap, target): """This hook runs after the ZAP API has been successfully started. This is needed to disable passive scanning rules which we have set to IGNORE in the ZAP configuration files. Due to an unresolved issue with the scripts the HTML report generated will still include ignored passive rules so this allows us to ensure they never run and won't be present in the HTML report. https://github.com/zaproxy/zaproxy/issues/6291#issuecomment-725947370 https://github.com/zaproxy/zaproxy/issues/5212 """ ignored_passive_scan_ids = [] if 'web' in target or 'backend' in target: ignored_passive_scan_ids = [10036, 10055] if 'frontend' in target: ignored_passive_scan_ids = [10020, 10021, 10027, 10036, 10055, 10096, 10109, 90022] for passive_scan_id in ignored_passive_scan_ids: zap.pscan.set_scanner_alert_threshold(id=passive_scan_id, alertthreshold='OFF') print(f'zap-hook disabled {len(ignored_passive_scan_ids)} passive rules')
def dicts_from_table(keys, array_of_values): dicts = [] for values in array_of_values: dicts.append({key: value for key, value in zip(keys, values)}) return dicts
def dicts_from_table(keys, array_of_values): dicts = [] for values in array_of_values: dicts.append({key: value for (key, value) in zip(keys, values)}) return dicts
''' Backtracking: Backtracking is a general algorithm for finding all (or some) solutions to some computational problems, notably constraint satisfaction problems. Problem statement: Given a set of n integers, divide the set into 2 halves such a way that the difference of sum of 2 sets is minimum. Input formate: Line1: Number of test casses Line2: The length of the array Line3: space seperated array elements Output formate: The 2 array subsets Method: Backtracking Intuition: As there can be any possibility we try to check all the possible chances of forming subarrays according to the given possibility. We intent to form one subset and push the rest of the elements to the other subset. For every element that we iterate through there are 2 possibilities 1) Belongs to first subset 2) Dosent belong to first subset While iterating we also check for the best solution so far and update it. Argument: int,Array return: Array ''' def utilfun(arr,n,curr,num,sol,min_diff,sumn,curr_sum,pos): ''' Here the arr is the input and n is its size curr is an arr containing curr elements in first subset and num is the length sol is the final boolean arr; true means the element is in the first subset sumn is tracking the sum of the first subset ''' #Base Case1 :check if the array is out of bound if(pos==n): return #Base Case2 :check if the number of elements is not less than the number of elements int he solution if ((int(n/2)-num)>(n-pos)): return #case1: when current element is not in the solution utilfun(arr,n,curr,num,sol,min_diff,sumn,curr_sum,pos+1) #case2: when the current element belongs to first subset num+=1 curr_sum+=arr[pos] curr[pos]=True #checking if we got the desired subset array length if(num==int(n/2)): #checking if the solution is better or not so far if(abs(int(sumn/2)-curr_sum)<min_diff[0]): min_diff[0]=abs(int(sumn/2)-curr_sum) for i in range(n): sol[i]=curr[i] else: utilfun(arr,n,curr,num,sol,min_diff,sumn,curr_sum,pos+1) curr[pos]=False def tugofwar(arr,n): curr=[False]*n sol=[False]*n min_diff=[999999999] sumn=0 for i in range(n): sumn+=arr[i] utilfun(arr, n, curr, 0, sol, min_diff, sumn, 0, 0) return sol # driver code def main(): for _ in range(int(input())): n=int(input()) arr=list(map(int,input().split())) sol=tugofwar(arr, n) print("First subset is: ",end="") for i in range(n): if(sol[i]==True): print(arr[i],end=" ") print("\n") print("Second subset is: ",end="") for i in range(n): if(sol[i]==False): print(arr[i],end=" ") print("\n") if __name__ == '__main__': main() ''' Sample Input: 1 11 23 45 -34 12 0 98 -99 4 189 -1 4 Sample output: First Subset is: 45 -34 12 98 -1 Second subset is: 23 0 -99 4 189 4 Time Complexity: O(n^2) Space Complexity: O(n) '''
""" Backtracking: Backtracking is a general algorithm for finding all (or some) solutions to some computational problems, notably constraint satisfaction problems. Problem statement: Given a set of n integers, divide the set into 2 halves such a way that the difference of sum of 2 sets is minimum. Input formate: Line1: Number of test casses Line2: The length of the array Line3: space seperated array elements Output formate: The 2 array subsets Method: Backtracking Intuition: As there can be any possibility we try to check all the possible chances of forming subarrays according to the given possibility. We intent to form one subset and push the rest of the elements to the other subset. For every element that we iterate through there are 2 possibilities 1) Belongs to first subset 2) Dosent belong to first subset While iterating we also check for the best solution so far and update it. Argument: int,Array return: Array """ def utilfun(arr, n, curr, num, sol, min_diff, sumn, curr_sum, pos): """ Here the arr is the input and n is its size curr is an arr containing curr elements in first subset and num is the length sol is the final boolean arr; true means the element is in the first subset sumn is tracking the sum of the first subset """ if pos == n: return if int(n / 2) - num > n - pos: return utilfun(arr, n, curr, num, sol, min_diff, sumn, curr_sum, pos + 1) num += 1 curr_sum += arr[pos] curr[pos] = True if num == int(n / 2): if abs(int(sumn / 2) - curr_sum) < min_diff[0]: min_diff[0] = abs(int(sumn / 2) - curr_sum) for i in range(n): sol[i] = curr[i] else: utilfun(arr, n, curr, num, sol, min_diff, sumn, curr_sum, pos + 1) curr[pos] = False def tugofwar(arr, n): curr = [False] * n sol = [False] * n min_diff = [999999999] sumn = 0 for i in range(n): sumn += arr[i] utilfun(arr, n, curr, 0, sol, min_diff, sumn, 0, 0) return sol def main(): for _ in range(int(input())): n = int(input()) arr = list(map(int, input().split())) sol = tugofwar(arr, n) print('First subset is: ', end='') for i in range(n): if sol[i] == True: print(arr[i], end=' ') print('\n') print('Second subset is: ', end='') for i in range(n): if sol[i] == False: print(arr[i], end=' ') print('\n') if __name__ == '__main__': main() '\nSample Input:\n1\n11\n23 45 -34 12 0 98 -99 4 189 -1 4\n\nSample output:\nFirst Subset is: 45 -34 12 98 -1\nSecond subset is: 23 0 -99 4 189 4\n\nTime Complexity: O(n^2)\nSpace Complexity: O(n)\n'
# flake8: noqa # http://patorjk.com/software/taag/#p=display&f=Big&t=Monero # http://patorjk.com/software/taag/#p=display&f=Big&t=XMR.to __xmrto__ = ( " __ ____ __ _____ _ \n" " \ \ / / \/ | __ \ | | \n" " \ V /| \ / | |__) || |_ ___ \n" " > < | |\/| | _ / | __/ _ \ \n" " / . \| | | | | \ \ | || (_) | \n" " /_/ \_\_| |_|_| \_(_)__\___/ \n" ) __monero__ = ( " __ __ \n" " | \/ | \n" " | \ / | ___ _ __ ___ _ __ ___ \n" " | |\/| |/ _ \| '_ \ / _ \ '__/ _ \ \n" " | | | | (_) | | | | __/ | | (_) | \n" " |_| |_|\___/|_| |_|\___|_| \___/ \n" ) __complete__ = __xmrto__ + __monero__
__xmrto__ = ' __ ____ __ _____ _ \n \\ \\ / / \\/ | __ \\ | | \n \\ V /| \\ / | |__) || |_ ___ \n > < | |\\/| | _ / | __/ _ \\ \n / . \\| | | | | \\ \\ | || (_) | \n /_/ \\_\\_| |_|_| \\_(_)__\\___/ \n' __monero__ = " __ __ \n | \\/ | \n | \\ / | ___ _ __ ___ _ __ ___ \n | |\\/| |/ _ \\| '_ \\ / _ \\ '__/ _ \\ \n | | | | (_) | | | | __/ | | (_) | \n |_| |_|\\___/|_| |_|\\___|_| \\___/ \n" __complete__ = __xmrto__ + __monero__
#!/usr/bin/env python3 left = pd.DataFrame({'key1': ['foo', 'foo', 'bar'], 'key2': ['one', 'two', 'one'], 'lval': [1, 2, 3]}) right = pd.DataFrame({'key1': ['foo', 'foo', 'bar', 'bar'], 'key2': ['one', 'one', 'one', 'two'], 'rval': [4, 5, 6, 7]})
left = pd.DataFrame({'key1': ['foo', 'foo', 'bar'], 'key2': ['one', 'two', 'one'], 'lval': [1, 2, 3]}) right = pd.DataFrame({'key1': ['foo', 'foo', 'bar', 'bar'], 'key2': ['one', 'one', 'one', 'two'], 'rval': [4, 5, 6, 7]})
''' Kattis - peasoup Just check membership in set. Time: O(sum(m) + n), Space: O(m) ''' n = int(input()) for _ in range(n): m = int(input()) name = input() s = set(input() for i in range(m)) if "pea soup" in s and "pancakes" in s: print(name) exit() print("Anywhere is fine I guess")
""" Kattis - peasoup Just check membership in set. Time: O(sum(m) + n), Space: O(m) """ n = int(input()) for _ in range(n): m = int(input()) name = input() s = set((input() for i in range(m))) if 'pea soup' in s and 'pancakes' in s: print(name) exit() print('Anywhere is fine I guess')
#sel_muni_name = "Giv'atayim" sel_muni_name = "Rishon LeZiyyon" # RLZ analysis_locs = [ {'name': 'RLZ_center_HertzelxRothchild', 'loc': ['31.963961', '34.803033'] }, {'name': 'RLZ_Azrieli_Rishonim', 'loc': ['31.949232', '34.803299'] }, {'name': 'RLZ_Canyon_Hazahav', 'loc': ['31.990121', '34.774849'] }, {'name': 'Moshe_Dayan_Train_Station', 'loc': ['31.987453', '34.757259'] }, {'name': 'ramathahayal', 'loc': ['32.10959', '34.83878'] }, {'name': 'Tel_Aviv_City_Hall', 'loc': ['32.081656', '34.781205'] }, {'name': 'hashalom_Azrieli_Tel_Aviv', 'loc': ['32.073600', '34.790000'] } ] ''' {'name': 'RLZ_center_HertzelxRothchild', 'loc': ['31.963961', '34.803033'] }, {'name': 'RLZ_Azrieli_Rishonim', 'loc': ['31.949232', '34.803299'] } {'name': 'RLZ_Canyon_Hazahav', 'loc': ['31.990121', '34.774849'] }, {'name': 'RLZ_Ikea', 'loc': ['31.951411', '34.771101'] }, {'name': 'Moshe_Dayan_Train_Station', 'loc': ['31.987453', '34.757259'] }, {'name': 'Tel_Aviv_City_Hall', 'loc': ['32.081656', '34.781205'] }, {'name': 'hashalom_Azrieli_Tel_Aviv', 'loc': ['32.073600', '34.790000'] }, {'name': 'TAU', 'loc': ['32.11249', '34.80559'] }, {'name': 'ramathahayal', 'loc': ['32.10959', '34.83878'] }, ''' gtfsdate1 = '20190526' servicedate1 = '20190526' gtfsdate2 = '20210425' servicedate2 = '20210425' analysis_time = '080000' percentofarealist = ['25','50','75'] local_url = "http://localhost:9191/v1/coverage/" munifilein = 'built_area_in_muni2017simplifyed50.geojson' #On demand date on local pc get_service_date = 'on_demand' processedpath = 'processed' mobilitypath = 'mobility' # transit_time_map config default_coverage_name = 'default' secondary_custom_coverage_name = 'secondary-cov' on_demand_coverage_prefix = 'ondemand-' time_map_server_local_url = "http://localhost:9191/v1/coverage/"
sel_muni_name = 'Rishon LeZiyyon' analysis_locs = [{'name': 'RLZ_center_HertzelxRothchild', 'loc': ['31.963961', '34.803033']}, {'name': 'RLZ_Azrieli_Rishonim', 'loc': ['31.949232', '34.803299']}, {'name': 'RLZ_Canyon_Hazahav', 'loc': ['31.990121', '34.774849']}, {'name': 'Moshe_Dayan_Train_Station', 'loc': ['31.987453', '34.757259']}, {'name': 'ramathahayal', 'loc': ['32.10959', '34.83878']}, {'name': 'Tel_Aviv_City_Hall', 'loc': ['32.081656', '34.781205']}, {'name': 'hashalom_Azrieli_Tel_Aviv', 'loc': ['32.073600', '34.790000']}] "\n {'name': 'RLZ_center_HertzelxRothchild', 'loc': ['31.963961', '34.803033'] },\n {'name': 'RLZ_Azrieli_Rishonim', 'loc': ['31.949232', '34.803299'] }\n {'name': 'RLZ_Canyon_Hazahav', 'loc': ['31.990121', '34.774849'] },\n {'name': 'RLZ_Ikea', 'loc': ['31.951411', '34.771101'] }, \n {'name': 'Moshe_Dayan_Train_Station', 'loc': ['31.987453', '34.757259'] }, \n {'name': 'Tel_Aviv_City_Hall', 'loc': ['32.081656', '34.781205'] }, \n {'name': 'hashalom_Azrieli_Tel_Aviv', 'loc': ['32.073600', '34.790000'] }, \n {'name': 'TAU', 'loc': ['32.11249', '34.80559'] }, \n {'name': 'ramathahayal', 'loc': ['32.10959', '34.83878'] }, \n" gtfsdate1 = '20190526' servicedate1 = '20190526' gtfsdate2 = '20210425' servicedate2 = '20210425' analysis_time = '080000' percentofarealist = ['25', '50', '75'] local_url = 'http://localhost:9191/v1/coverage/' munifilein = 'built_area_in_muni2017simplifyed50.geojson' get_service_date = 'on_demand' processedpath = 'processed' mobilitypath = 'mobility' default_coverage_name = 'default' secondary_custom_coverage_name = 'secondary-cov' on_demand_coverage_prefix = 'ondemand-' time_map_server_local_url = 'http://localhost:9191/v1/coverage/'
class HumioException(Exception): pass class HumioConnectionException(HumioException): pass class HumioHTTPException(HumioException): def __init__(self, message, status_code=None): self.message = message self.status_code = status_code class HumioTimeoutException(HumioException): pass class HumioConnectionDroppedException(HumioException): pass class HumioQueryJobExhaustedException(HumioException): pass class HumioQueryJobExpiredException(HumioException): pass
class Humioexception(Exception): pass class Humioconnectionexception(HumioException): pass class Humiohttpexception(HumioException): def __init__(self, message, status_code=None): self.message = message self.status_code = status_code class Humiotimeoutexception(HumioException): pass class Humioconnectiondroppedexception(HumioException): pass class Humioqueryjobexhaustedexception(HumioException): pass class Humioqueryjobexpiredexception(HumioException): pass
def fails(): x = 1 / 0 try: fails() except Exception as e: print(type(e)) print(e) print(e.args)
def fails(): x = 1 / 0 try: fails() except Exception as e: print(type(e)) print(e) print(e.args)
# # PySNMP MIB module A3COM-HUAWEI-BLG-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-HUAWEI-BLG-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 16:49:09 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) # h3cCommon, = mibBuilder.importSymbols("A3COM-HUAWEI-OID-MIB", "h3cCommon") ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, Unsigned32, ObjectIdentity, IpAddress, ModuleIdentity, Counter64, TimeTicks, iso, MibIdentifier, NotificationType, Integer32, Counter32, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "Unsigned32", "ObjectIdentity", "IpAddress", "ModuleIdentity", "Counter64", "TimeTicks", "iso", "MibIdentifier", "NotificationType", "Integer32", "Counter32", "Bits") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") h3cBlg = ModuleIdentity((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108)) h3cBlg.setRevisions(('2009-09-15 11:11',)) if mibBuilder.loadTexts: h3cBlg.setLastUpdated('200909151111Z') if mibBuilder.loadTexts: h3cBlg.setOrganization('H3C Technologies Co., Ltd.') class CounterClear(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("cleared", 1), ("nouse", 2)) h3cBlgObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1)) h3cBlgStatsTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1), ) if mibBuilder.loadTexts: h3cBlgStatsTable.setStatus('current') h3cBlgStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1), ).setIndexNames((0, "A3COM-HUAWEI-BLG-MIB", "h3cBlgIndex")) if mibBuilder.loadTexts: h3cBlgStatsEntry.setStatus('current') h3cBlgIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: h3cBlgIndex.setStatus('current') h3cBlgGroupTxPacketCount = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: h3cBlgGroupTxPacketCount.setStatus('current') h3cBlgGroupRxPacketCount = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: h3cBlgGroupRxPacketCount.setStatus('current') h3cBlgGroupTxByteCount = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: h3cBlgGroupTxByteCount.setStatus('current') h3cBlgGroupRxByteCount = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 5), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: h3cBlgGroupRxByteCount.setStatus('current') h3cBlgGroupCountClear = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 6), CounterClear()).setMaxAccess("readwrite") if mibBuilder.loadTexts: h3cBlgGroupCountClear.setStatus('current') mibBuilder.exportSymbols("A3COM-HUAWEI-BLG-MIB", h3cBlg=h3cBlg, h3cBlgObjects=h3cBlgObjects, h3cBlgStatsEntry=h3cBlgStatsEntry, h3cBlgGroupTxPacketCount=h3cBlgGroupTxPacketCount, h3cBlgGroupRxByteCount=h3cBlgGroupRxByteCount, PYSNMP_MODULE_ID=h3cBlg, CounterClear=CounterClear, h3cBlgGroupTxByteCount=h3cBlgGroupTxByteCount, h3cBlgIndex=h3cBlgIndex, h3cBlgStatsTable=h3cBlgStatsTable, h3cBlgGroupRxPacketCount=h3cBlgGroupRxPacketCount, h3cBlgGroupCountClear=h3cBlgGroupCountClear)
(h3c_common,) = mibBuilder.importSymbols('A3COM-HUAWEI-OID-MIB', 'h3cCommon') (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_size_constraint, single_value_constraint, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueSizeConstraint', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (mib_scalar, mib_table, mib_table_row, mib_table_column, gauge32, unsigned32, object_identity, ip_address, module_identity, counter64, time_ticks, iso, mib_identifier, notification_type, integer32, counter32, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Gauge32', 'Unsigned32', 'ObjectIdentity', 'IpAddress', 'ModuleIdentity', 'Counter64', 'TimeTicks', 'iso', 'MibIdentifier', 'NotificationType', 'Integer32', 'Counter32', 'Bits') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') h3c_blg = module_identity((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108)) h3cBlg.setRevisions(('2009-09-15 11:11',)) if mibBuilder.loadTexts: h3cBlg.setLastUpdated('200909151111Z') if mibBuilder.loadTexts: h3cBlg.setOrganization('H3C Technologies Co., Ltd.') class Counterclear(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('cleared', 1), ('nouse', 2)) h3c_blg_objects = mib_identifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1)) h3c_blg_stats_table = mib_table((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1)) if mibBuilder.loadTexts: h3cBlgStatsTable.setStatus('current') h3c_blg_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1)).setIndexNames((0, 'A3COM-HUAWEI-BLG-MIB', 'h3cBlgIndex')) if mibBuilder.loadTexts: h3cBlgStatsEntry.setStatus('current') h3c_blg_index = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))) if mibBuilder.loadTexts: h3cBlgIndex.setStatus('current') h3c_blg_group_tx_packet_count = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 2), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: h3cBlgGroupTxPacketCount.setStatus('current') h3c_blg_group_rx_packet_count = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 3), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: h3cBlgGroupRxPacketCount.setStatus('current') h3c_blg_group_tx_byte_count = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 4), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: h3cBlgGroupTxByteCount.setStatus('current') h3c_blg_group_rx_byte_count = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 5), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: h3cBlgGroupRxByteCount.setStatus('current') h3c_blg_group_count_clear = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 108, 1, 1, 1, 6), counter_clear()).setMaxAccess('readwrite') if mibBuilder.loadTexts: h3cBlgGroupCountClear.setStatus('current') mibBuilder.exportSymbols('A3COM-HUAWEI-BLG-MIB', h3cBlg=h3cBlg, h3cBlgObjects=h3cBlgObjects, h3cBlgStatsEntry=h3cBlgStatsEntry, h3cBlgGroupTxPacketCount=h3cBlgGroupTxPacketCount, h3cBlgGroupRxByteCount=h3cBlgGroupRxByteCount, PYSNMP_MODULE_ID=h3cBlg, CounterClear=CounterClear, h3cBlgGroupTxByteCount=h3cBlgGroupTxByteCount, h3cBlgIndex=h3cBlgIndex, h3cBlgStatsTable=h3cBlgStatsTable, h3cBlgGroupRxPacketCount=h3cBlgGroupRxPacketCount, h3cBlgGroupCountClear=h3cBlgGroupCountClear)
""" Time Complexity """ def bubble_sort(data): for i in range(len(data)): # swapped = False, if False return for j in range(len(data)-i-1): if data[j] > data[j+1]: # swapped = True data[j], data[j+1] = data[j+1], data[j] return data data = [1, 2, 10, 9, 8 ,7, 4, 5, 6, 3] bubble_sort(data) print(data)
""" Time Complexity """ def bubble_sort(data): for i in range(len(data)): for j in range(len(data) - i - 1): if data[j] > data[j + 1]: (data[j], data[j + 1]) = (data[j + 1], data[j]) return data data = [1, 2, 10, 9, 8, 7, 4, 5, 6, 3] bubble_sort(data) print(data)
def command(*command_list): def add_attribute(function): function.command_list = command_list return function return add_attribute
def command(*command_list): def add_attribute(function): function.command_list = command_list return function return add_attribute
''' URL: https://leetcode.com/problems/add-two-numbers/ Time complexity: O(n) Space complexity: O(1) ''' # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def get_length(self, node): count = 0 while node is not None: count += 1 node = node.next return count def addTwoNumbers(self, l1, l2): """ :type l1: ListNode :type l2: ListNode :rtype: ListNode """ if l1 is None or l2 is None: return l1 or l2 l1_length = self.get_length(l1) l2_length = self.get_length(l2) if l1_length < l2_length: shorter_node = l1 longer_node = l2 else: shorter_node = l2 longer_node = l1 final_answer = None curr_answer = None carry_over = 0 while shorter_node is not None or longer_node is not None: column_sum = carry_over + longer_node.val longer_node = longer_node.next if shorter_node: column_sum += shorter_node.val shorter_node = shorter_node.next if final_answer: curr_answer.next = ListNode(column_sum % 10) curr_answer = curr_answer.next else: final_answer = ListNode(column_sum % 10) curr_answer = final_answer carry_over = 1 if column_sum >= 10 else 0 if carry_over == 1: curr_answer.next = ListNode(1) return final_answer
""" URL: https://leetcode.com/problems/add-two-numbers/ Time complexity: O(n) Space complexity: O(1) """ class Solution(object): def get_length(self, node): count = 0 while node is not None: count += 1 node = node.next return count def add_two_numbers(self, l1, l2): """ :type l1: ListNode :type l2: ListNode :rtype: ListNode """ if l1 is None or l2 is None: return l1 or l2 l1_length = self.get_length(l1) l2_length = self.get_length(l2) if l1_length < l2_length: shorter_node = l1 longer_node = l2 else: shorter_node = l2 longer_node = l1 final_answer = None curr_answer = None carry_over = 0 while shorter_node is not None or longer_node is not None: column_sum = carry_over + longer_node.val longer_node = longer_node.next if shorter_node: column_sum += shorter_node.val shorter_node = shorter_node.next if final_answer: curr_answer.next = list_node(column_sum % 10) curr_answer = curr_answer.next else: final_answer = list_node(column_sum % 10) curr_answer = final_answer carry_over = 1 if column_sum >= 10 else 0 if carry_over == 1: curr_answer.next = list_node(1) return final_answer
class Solution: def countOrders(self, n: int) -> int: @functools.cache def totalWays(unpicked, undelivered): if not unpicked and not undelivered: # We have completed all orders. return 1 if (unpicked < 0 or undelivered < 0 or undelivered < unpicked): # We can't pick or deliver more than N items # Number of deliveries can't exceed number of pickups # as we can only deliver after a pickup. return 0 # Count all choices of picking up an order. ans = unpicked * totalWays(unpicked - 1, undelivered) ans %= MOD # Count all choices of delivering a picked order. ans += (undelivered - unpicked) * \ totalWays(unpicked, undelivered - 1) ans %= MOD return ans MOD = 1_000_000_007 return totalWays(n, n)
class Solution: def count_orders(self, n: int) -> int: @functools.cache def total_ways(unpicked, undelivered): if not unpicked and (not undelivered): return 1 if unpicked < 0 or undelivered < 0 or undelivered < unpicked: return 0 ans = unpicked * total_ways(unpicked - 1, undelivered) ans %= MOD ans += (undelivered - unpicked) * total_ways(unpicked, undelivered - 1) ans %= MOD return ans mod = 1000000007 return total_ways(n, n)
lista = [] for x in range(0, 4+1): num = int(input("Informe um valor: ")) if x == 0 or num > lista[-1]: lista.append(num) else: pos = 0 while pos < len(lista): if num <= lista[pos]: lista.insert(pos, num) break pos += 1 print('-' * 30) print(lista)
lista = [] for x in range(0, 4 + 1): num = int(input('Informe um valor: ')) if x == 0 or num > lista[-1]: lista.append(num) else: pos = 0 while pos < len(lista): if num <= lista[pos]: lista.insert(pos, num) break pos += 1 print('-' * 30) print(lista)
A, B = map(int, input().split()) C, D = A // B, A % B if A != 0 and D < 0: C, D = C + 1, D - B print(C) print(D)
(a, b) = map(int, input().split()) (c, d) = (A // B, A % B) if A != 0 and D < 0: (c, d) = (C + 1, D - B) print(C) print(D)
#: Common folder in which all data are stored BASE_FOLDER = r'/Users/mdartiailh/Labber/Data/2019/11/Data_1114' #: Name of the sample and associated parameters as a dict. #: The currently expected keys are: #: - path #: - Tc (in K) #: - gap size (in nm) SAMPLES = {"JJ200": {"path": "JS129D_BM001_030.hdf5", "Tc": 1.44, "gap size": 200}, "JJ1000": {"path": "JS129D_BM001_032.hdf5", "Tc": 1.44, "gap size": 1000}, "JJ500": {"path": "JS129D_BM001_033.hdf5", "Tc": 1.44, "gap size": 500}, "JJ100": {"path": "JS129D_BM001_034.hdf5", "Tc": 1.44, "gap size": 100}, "JJ50": {"path": "JS129D_BM001_035.hdf5", "Tc": 1.44, "gap size": 50}, } #: Path to the file in which to write the output OUTPUT = "/Users/mdartiailh/Documents/PostDocNYU/DataAnalysis/JJ/JS129/results.csv" #: For all the following parameters one can use a dictionary with sample names #: as keys can be used. #: Name or index of the column containing the voltage bias data. #: This should be a stepped channel ! use the applied voltage not the #: measured current BIAS_NAME = 0 #: Name or index of the column containing the voltage data VOLTAGE_NAME = {"JJ200": 1, "JJ1000": 2, "JJ500": 2, "JJ100": 2, "JJ50": 2, } #: Name or index of the column containing the counter value for scans with #: multiple traces (use None if absent). Only the first trace is used in the #: analysis. COUNTER_NAME = {"JJ200": None, "JJ1000": 1, "JJ500": 1, "JJ100": 1, "JJ50": 1, } #: Should we correct the offset in voltage and if so on how many points to #: average CORRECT_VOLTAGE_OFFSET = 5 #: Conversion factor to apply to the current data (allow to convert from #: applied voltage to current bias). CURRENT_CONVERSION = 1e-6 #: Amplifier gain used to measure the voltage across the junction. AMPLIFIER_GAIN = 100 #: Threshold to use to determine the critical current (in raw data units). IC_VOLTAGE_THRESHOLD = 2e-5 #: Bias current at which we consider to be in the high bias regime and can fit #: the resistance. HIGH_BIAS_THRESHOLD = 20e-6
base_folder = '/Users/mdartiailh/Labber/Data/2019/11/Data_1114' samples = {'JJ200': {'path': 'JS129D_BM001_030.hdf5', 'Tc': 1.44, 'gap size': 200}, 'JJ1000': {'path': 'JS129D_BM001_032.hdf5', 'Tc': 1.44, 'gap size': 1000}, 'JJ500': {'path': 'JS129D_BM001_033.hdf5', 'Tc': 1.44, 'gap size': 500}, 'JJ100': {'path': 'JS129D_BM001_034.hdf5', 'Tc': 1.44, 'gap size': 100}, 'JJ50': {'path': 'JS129D_BM001_035.hdf5', 'Tc': 1.44, 'gap size': 50}} output = '/Users/mdartiailh/Documents/PostDocNYU/DataAnalysis/JJ/JS129/results.csv' bias_name = 0 voltage_name = {'JJ200': 1, 'JJ1000': 2, 'JJ500': 2, 'JJ100': 2, 'JJ50': 2} counter_name = {'JJ200': None, 'JJ1000': 1, 'JJ500': 1, 'JJ100': 1, 'JJ50': 1} correct_voltage_offset = 5 current_conversion = 1e-06 amplifier_gain = 100 ic_voltage_threshold = 2e-05 high_bias_threshold = 2e-05
# reverse a linkedlist # O(N) space:O(1) class Node: def __init__(self, value, next = None) -> None: self.value = value self.next = None def print_linkedlist(head): while head is not None: print(str(head.value) + "", end = "") head = head.next print() def reverse_linkedlist(head): if head is None or head.next is None: return head new_header = None while head is not None: pointer = head.next head.next = new_header new_header = head head = pointer return new_header head = Node(1) head.next = Node(2) head.next.next = Node(3) head.next.next.next = Node(4) head.next.next.next.next = Node(1) new_header = reverse_linkedlist(head) new_header.print_linkedlist()
class Node: def __init__(self, value, next=None) -> None: self.value = value self.next = None def print_linkedlist(head): while head is not None: print(str(head.value) + '', end='') head = head.next print() def reverse_linkedlist(head): if head is None or head.next is None: return head new_header = None while head is not None: pointer = head.next head.next = new_header new_header = head head = pointer return new_header head = node(1) head.next = node(2) head.next.next = node(3) head.next.next.next = node(4) head.next.next.next.next = node(1) new_header = reverse_linkedlist(head) new_header.print_linkedlist()
# terrascript/data/paultyng/twitter.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:29:28 UTC) __all__ = []
__all__ = []
def validSolution(sudoku): row=[] column=[] box=[] for i in range(9): row.append([]) column.append([]) box.append([]) for r in sudoku: i= sudoku.index(r) for c in r: j= r.index(c) if c in row[i] or c in column[j] or c in box[(i/3)*3+j/3]: return False else: row[i].append(c) column[j].append(c) box[(i/3)*3+j/3].append(c) return True
def valid_solution(sudoku): row = [] column = [] box = [] for i in range(9): row.append([]) column.append([]) box.append([]) for r in sudoku: i = sudoku.index(r) for c in r: j = r.index(c) if c in row[i] or c in column[j] or c in box[i / 3 * 3 + j / 3]: return False else: row[i].append(c) column[j].append(c) box[i / 3 * 3 + j / 3].append(c) return True
# # PySNMP MIB module CISCO-ATM-EXT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ATM-EXT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:33:12 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") SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint") atmVclEntry, aal5VccEntry = mibBuilder.importSymbols("ATM-MIB", "atmVclEntry", "aal5VccEntry") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") ObjectIdentity, MibIdentifier, Integer32, Gauge32, iso, Bits, Counter64, Unsigned32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32, NotificationType, ModuleIdentity, TimeTicks, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "MibIdentifier", "Integer32", "Gauge32", "iso", "Bits", "Counter64", "Unsigned32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32", "NotificationType", "ModuleIdentity", "TimeTicks", "IpAddress") TruthValue, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "TextualConvention", "DisplayString") ciscoAtmExtMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 88)) ciscoAtmExtMIB.setRevisions(('2003-01-06 00:00', '1997-06-20 00:00',)) if mibBuilder.loadTexts: ciscoAtmExtMIB.setLastUpdated('200301060000Z') if mibBuilder.loadTexts: ciscoAtmExtMIB.setOrganization('Cisco Systems, Inc.') ciscoAtmExtMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 1)) cAal5VccExtMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1)) catmxVcl = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2)) class OamCCStatus(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5)) namedValues = NamedValues(("ready", 1), ("waitActiveResponse", 2), ("waitActiveConfirm", 3), ("active", 4), ("waitDeactiveConfirm", 5)) class OamCCVcState(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("verified", 1), ("aisrdi", 2), ("notManaged", 3)) cAal5VccExtTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1), ) if mibBuilder.loadTexts: cAal5VccExtTable.setStatus('current') cAal5VccExtEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1, 1), ) aal5VccEntry.registerAugmentions(("CISCO-ATM-EXT-MIB", "cAal5VccExtEntry")) cAal5VccExtEntry.setIndexNames(*aal5VccEntry.getIndexNames()) if mibBuilder.loadTexts: cAal5VccExtEntry.setStatus('current') cAal5VccExtCompEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1, 1, 1), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cAal5VccExtCompEnabled.setStatus('current') cAal5VccExtVoice = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1, 1, 2), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cAal5VccExtVoice.setStatus('current') cAal5VccExtInF5OamCells = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cAal5VccExtInF5OamCells.setStatus('current') cAal5VccExtOutF5OamCells = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cAal5VccExtOutF5OamCells.setStatus('current') catmxVclOamTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1), ) if mibBuilder.loadTexts: catmxVclOamTable.setStatus('current') catmxVclOamEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1), ) atmVclEntry.registerAugmentions(("CISCO-ATM-EXT-MIB", "catmxVclOamEntry")) catmxVclOamEntry.setIndexNames(*atmVclEntry.getIndexNames()) if mibBuilder.loadTexts: catmxVclOamEntry.setStatus('current') catmxVclOamLoopbackFreq = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 1), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: catmxVclOamLoopbackFreq.setStatus('current') catmxVclOamRetryFreq = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 2), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: catmxVclOamRetryFreq.setStatus('current') catmxVclOamUpRetryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 3), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: catmxVclOamUpRetryCount.setStatus('current') catmxVclOamDownRetryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 4), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: catmxVclOamDownRetryCount.setStatus('current') catmxVclOamEndCCActCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 5), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: catmxVclOamEndCCActCount.setStatus('current') catmxVclOamEndCCDeActCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 6), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: catmxVclOamEndCCDeActCount.setStatus('current') catmxVclOamEndCCRetryFreq = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 7), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: catmxVclOamEndCCRetryFreq.setStatus('current') catmxVclOamSegCCActCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 8), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: catmxVclOamSegCCActCount.setStatus('current') catmxVclOamSegCCDeActCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 9), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: catmxVclOamSegCCDeActCount.setStatus('current') catmxVclOamSegCCRetryFreq = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 10), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: catmxVclOamSegCCRetryFreq.setStatus('current') catmxVclOamManage = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 11), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: catmxVclOamManage.setStatus('current') catmxVclOamLoopBkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("disabled", 1), ("sent", 2), ("received", 3), ("failed", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamLoopBkStatus.setStatus('current') catmxVclOamVcState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("downRetry", 1), ("verified", 2), ("notVerified", 3), ("upRetry", 4), ("aisRDI", 5), ("aisOut", 6), ("notManaged", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamVcState.setStatus('current') catmxVclOamEndCCStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 14), OamCCStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamEndCCStatus.setStatus('current') catmxVclOamSegCCStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 15), OamCCStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamSegCCStatus.setStatus('current') catmxVclOamEndCCVcState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 16), OamCCVcState()).setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamEndCCVcState.setStatus('current') catmxVclOamSegCCVcState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 17), OamCCVcState()).setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamSegCCVcState.setStatus('current') catmxVclOamCellsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 18), Counter32()).setUnits('cells').setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamCellsReceived.setStatus('current') catmxVclOamCellsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 19), Counter32()).setUnits('cells').setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamCellsSent.setStatus('current') catmxVclOamCellsDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 20), Counter32()).setUnits('cells').setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamCellsDropped.setStatus('current') catmxVclOamInF5ais = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 21), Counter32()).setUnits('cells').setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamInF5ais.setStatus('current') catmxVclOamOutF5ais = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 22), Counter32()).setUnits('cells').setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamOutF5ais.setStatus('current') catmxVclOamInF5rdi = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 23), Counter32()).setUnits('cells').setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamInF5rdi.setStatus('current') catmxVclOamOutF5rdi = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 24), Counter32()).setUnits('cells').setMaxAccess("readonly") if mibBuilder.loadTexts: catmxVclOamOutF5rdi.setStatus('current') ciscoAal5ExtMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 2)) ciscoAal5ExtMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 1)) ciscoAal5ExtMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 2)) ciscoAal5ExtMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 1, 1)).setObjects(("CISCO-ATM-EXT-MIB", "ciscoAal5ExtMIBGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoAal5ExtMIBCompliance = ciscoAal5ExtMIBCompliance.setStatus('deprecated') ciscoAal5ExtMIBComplianceRev1 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 1, 2)).setObjects(("CISCO-ATM-EXT-MIB", "ciscoAal5ExtMIBGroup"), ("CISCO-ATM-EXT-MIB", "ciscoAtmExtVclOamGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoAal5ExtMIBComplianceRev1 = ciscoAal5ExtMIBComplianceRev1.setStatus('current') ciscoAal5ExtMIBGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 2, 1)).setObjects(("CISCO-ATM-EXT-MIB", "cAal5VccExtCompEnabled"), ("CISCO-ATM-EXT-MIB", "cAal5VccExtVoice"), ("CISCO-ATM-EXT-MIB", "cAal5VccExtInF5OamCells"), ("CISCO-ATM-EXT-MIB", "cAal5VccExtOutF5OamCells")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoAal5ExtMIBGroup = ciscoAal5ExtMIBGroup.setStatus('current') ciscoAtmExtVclOamGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 2, 2)).setObjects(("CISCO-ATM-EXT-MIB", "catmxVclOamLoopbackFreq"), ("CISCO-ATM-EXT-MIB", "catmxVclOamRetryFreq"), ("CISCO-ATM-EXT-MIB", "catmxVclOamUpRetryCount"), ("CISCO-ATM-EXT-MIB", "catmxVclOamDownRetryCount"), ("CISCO-ATM-EXT-MIB", "catmxVclOamEndCCActCount"), ("CISCO-ATM-EXT-MIB", "catmxVclOamEndCCDeActCount"), ("CISCO-ATM-EXT-MIB", "catmxVclOamEndCCRetryFreq"), ("CISCO-ATM-EXT-MIB", "catmxVclOamSegCCActCount"), ("CISCO-ATM-EXT-MIB", "catmxVclOamSegCCDeActCount"), ("CISCO-ATM-EXT-MIB", "catmxVclOamSegCCRetryFreq"), ("CISCO-ATM-EXT-MIB", "catmxVclOamManage"), ("CISCO-ATM-EXT-MIB", "catmxVclOamLoopBkStatus"), ("CISCO-ATM-EXT-MIB", "catmxVclOamVcState"), ("CISCO-ATM-EXT-MIB", "catmxVclOamEndCCStatus"), ("CISCO-ATM-EXT-MIB", "catmxVclOamSegCCStatus"), ("CISCO-ATM-EXT-MIB", "catmxVclOamEndCCVcState"), ("CISCO-ATM-EXT-MIB", "catmxVclOamSegCCVcState"), ("CISCO-ATM-EXT-MIB", "catmxVclOamCellsReceived"), ("CISCO-ATM-EXT-MIB", "catmxVclOamCellsSent"), ("CISCO-ATM-EXT-MIB", "catmxVclOamCellsDropped"), ("CISCO-ATM-EXT-MIB", "catmxVclOamInF5ais"), ("CISCO-ATM-EXT-MIB", "catmxVclOamOutF5ais"), ("CISCO-ATM-EXT-MIB", "catmxVclOamInF5rdi"), ("CISCO-ATM-EXT-MIB", "catmxVclOamOutF5rdi")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoAtmExtVclOamGroup = ciscoAtmExtVclOamGroup.setStatus('current') mibBuilder.exportSymbols("CISCO-ATM-EXT-MIB", catmxVclOamSegCCActCount=catmxVclOamSegCCActCount, cAal5VccExtCompEnabled=cAal5VccExtCompEnabled, catmxVclOamEndCCStatus=catmxVclOamEndCCStatus, ciscoAtmExtVclOamGroup=ciscoAtmExtVclOamGroup, ciscoAtmExtMIB=ciscoAtmExtMIB, cAal5VccExtInF5OamCells=cAal5VccExtInF5OamCells, catmxVclOamEndCCRetryFreq=catmxVclOamEndCCRetryFreq, catmxVclOamSegCCStatus=catmxVclOamSegCCStatus, catmxVclOamInF5ais=catmxVclOamInF5ais, cAal5VccExtTable=cAal5VccExtTable, ciscoAtmExtMIBObjects=ciscoAtmExtMIBObjects, catmxVclOamManage=catmxVclOamManage, catmxVclOamEntry=catmxVclOamEntry, catmxVclOamSegCCRetryFreq=catmxVclOamSegCCRetryFreq, catmxVclOamSegCCDeActCount=catmxVclOamSegCCDeActCount, catmxVclOamVcState=catmxVclOamVcState, cAal5VccExtEntry=cAal5VccExtEntry, ciscoAal5ExtMIBCompliances=ciscoAal5ExtMIBCompliances, PYSNMP_MODULE_ID=ciscoAtmExtMIB, catmxVclOamEndCCVcState=catmxVclOamEndCCVcState, ciscoAal5ExtMIBGroup=ciscoAal5ExtMIBGroup, catmxVclOamCellsReceived=catmxVclOamCellsReceived, catmxVclOamOutF5ais=catmxVclOamOutF5ais, OamCCStatus=OamCCStatus, catmxVclOamRetryFreq=catmxVclOamRetryFreq, catmxVclOamDownRetryCount=catmxVclOamDownRetryCount, ciscoAal5ExtMIBGroups=ciscoAal5ExtMIBGroups, catmxVclOamSegCCVcState=catmxVclOamSegCCVcState, catmxVclOamCellsSent=catmxVclOamCellsSent, catmxVclOamInF5rdi=catmxVclOamInF5rdi, catmxVclOamTable=catmxVclOamTable, ciscoAal5ExtMIBComplianceRev1=ciscoAal5ExtMIBComplianceRev1, cAal5VccExtMIBObjects=cAal5VccExtMIBObjects, cAal5VccExtVoice=cAal5VccExtVoice, catmxVcl=catmxVcl, catmxVclOamEndCCActCount=catmxVclOamEndCCActCount, ciscoAal5ExtMIBCompliance=ciscoAal5ExtMIBCompliance, catmxVclOamLoopbackFreq=catmxVclOamLoopbackFreq, OamCCVcState=OamCCVcState, catmxVclOamUpRetryCount=catmxVclOamUpRetryCount, catmxVclOamEndCCDeActCount=catmxVclOamEndCCDeActCount, catmxVclOamOutF5rdi=catmxVclOamOutF5rdi, catmxVclOamCellsDropped=catmxVclOamCellsDropped, cAal5VccExtOutF5OamCells=cAal5VccExtOutF5OamCells, ciscoAal5ExtMIBConformance=ciscoAal5ExtMIBConformance, catmxVclOamLoopBkStatus=catmxVclOamLoopBkStatus)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, value_range_constraint, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ConstraintsUnion', 'ValueSizeConstraint') (atm_vcl_entry, aal5_vcc_entry) = mibBuilder.importSymbols('ATM-MIB', 'atmVclEntry', 'aal5VccEntry') (cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt') (notification_group, object_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ObjectGroup', 'ModuleCompliance') (object_identity, mib_identifier, integer32, gauge32, iso, bits, counter64, unsigned32, mib_scalar, mib_table, mib_table_row, mib_table_column, counter32, notification_type, module_identity, time_ticks, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'MibIdentifier', 'Integer32', 'Gauge32', 'iso', 'Bits', 'Counter64', 'Unsigned32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter32', 'NotificationType', 'ModuleIdentity', 'TimeTicks', 'IpAddress') (truth_value, textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TruthValue', 'TextualConvention', 'DisplayString') cisco_atm_ext_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 88)) ciscoAtmExtMIB.setRevisions(('2003-01-06 00:00', '1997-06-20 00:00')) if mibBuilder.loadTexts: ciscoAtmExtMIB.setLastUpdated('200301060000Z') if mibBuilder.loadTexts: ciscoAtmExtMIB.setOrganization('Cisco Systems, Inc.') cisco_atm_ext_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 1)) c_aal5_vcc_ext_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1)) catmx_vcl = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2)) class Oamccstatus(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5)) named_values = named_values(('ready', 1), ('waitActiveResponse', 2), ('waitActiveConfirm', 3), ('active', 4), ('waitDeactiveConfirm', 5)) class Oamccvcstate(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('verified', 1), ('aisrdi', 2), ('notManaged', 3)) c_aal5_vcc_ext_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1)) if mibBuilder.loadTexts: cAal5VccExtTable.setStatus('current') c_aal5_vcc_ext_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1, 1)) aal5VccEntry.registerAugmentions(('CISCO-ATM-EXT-MIB', 'cAal5VccExtEntry')) cAal5VccExtEntry.setIndexNames(*aal5VccEntry.getIndexNames()) if mibBuilder.loadTexts: cAal5VccExtEntry.setStatus('current') c_aal5_vcc_ext_comp_enabled = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1, 1, 1), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: cAal5VccExtCompEnabled.setStatus('current') c_aal5_vcc_ext_voice = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1, 1, 2), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: cAal5VccExtVoice.setStatus('current') c_aal5_vcc_ext_in_f5_oam_cells = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cAal5VccExtInF5OamCells.setStatus('current') c_aal5_vcc_ext_out_f5_oam_cells = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 1, 1, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cAal5VccExtOutF5OamCells.setStatus('current') catmx_vcl_oam_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1)) if mibBuilder.loadTexts: catmxVclOamTable.setStatus('current') catmx_vcl_oam_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1)) atmVclEntry.registerAugmentions(('CISCO-ATM-EXT-MIB', 'catmxVclOamEntry')) catmxVclOamEntry.setIndexNames(*atmVclEntry.getIndexNames()) if mibBuilder.loadTexts: catmxVclOamEntry.setStatus('current') catmx_vcl_oam_loopback_freq = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 1), unsigned32()).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: catmxVclOamLoopbackFreq.setStatus('current') catmx_vcl_oam_retry_freq = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 2), unsigned32()).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: catmxVclOamRetryFreq.setStatus('current') catmx_vcl_oam_up_retry_count = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 3), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: catmxVclOamUpRetryCount.setStatus('current') catmx_vcl_oam_down_retry_count = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 4), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: catmxVclOamDownRetryCount.setStatus('current') catmx_vcl_oam_end_cc_act_count = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 5), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: catmxVclOamEndCCActCount.setStatus('current') catmx_vcl_oam_end_cc_de_act_count = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 6), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: catmxVclOamEndCCDeActCount.setStatus('current') catmx_vcl_oam_end_cc_retry_freq = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 7), unsigned32()).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: catmxVclOamEndCCRetryFreq.setStatus('current') catmx_vcl_oam_seg_cc_act_count = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 8), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: catmxVclOamSegCCActCount.setStatus('current') catmx_vcl_oam_seg_cc_de_act_count = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 9), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: catmxVclOamSegCCDeActCount.setStatus('current') catmx_vcl_oam_seg_cc_retry_freq = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 10), unsigned32()).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: catmxVclOamSegCCRetryFreq.setStatus('current') catmx_vcl_oam_manage = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 11), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: catmxVclOamManage.setStatus('current') catmx_vcl_oam_loop_bk_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('disabled', 1), ('sent', 2), ('received', 3), ('failed', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamLoopBkStatus.setStatus('current') catmx_vcl_oam_vc_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('downRetry', 1), ('verified', 2), ('notVerified', 3), ('upRetry', 4), ('aisRDI', 5), ('aisOut', 6), ('notManaged', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamVcState.setStatus('current') catmx_vcl_oam_end_cc_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 14), oam_cc_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamEndCCStatus.setStatus('current') catmx_vcl_oam_seg_cc_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 15), oam_cc_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamSegCCStatus.setStatus('current') catmx_vcl_oam_end_cc_vc_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 16), oam_cc_vc_state()).setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamEndCCVcState.setStatus('current') catmx_vcl_oam_seg_cc_vc_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 17), oam_cc_vc_state()).setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamSegCCVcState.setStatus('current') catmx_vcl_oam_cells_received = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 18), counter32()).setUnits('cells').setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamCellsReceived.setStatus('current') catmx_vcl_oam_cells_sent = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 19), counter32()).setUnits('cells').setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamCellsSent.setStatus('current') catmx_vcl_oam_cells_dropped = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 20), counter32()).setUnits('cells').setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamCellsDropped.setStatus('current') catmx_vcl_oam_in_f5ais = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 21), counter32()).setUnits('cells').setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamInF5ais.setStatus('current') catmx_vcl_oam_out_f5ais = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 22), counter32()).setUnits('cells').setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamOutF5ais.setStatus('current') catmx_vcl_oam_in_f5rdi = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 23), counter32()).setUnits('cells').setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamInF5rdi.setStatus('current') catmx_vcl_oam_out_f5rdi = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 88, 1, 2, 1, 1, 24), counter32()).setUnits('cells').setMaxAccess('readonly') if mibBuilder.loadTexts: catmxVclOamOutF5rdi.setStatus('current') cisco_aal5_ext_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 2)) cisco_aal5_ext_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 1)) cisco_aal5_ext_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 2)) cisco_aal5_ext_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 1, 1)).setObjects(('CISCO-ATM-EXT-MIB', 'ciscoAal5ExtMIBGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_aal5_ext_mib_compliance = ciscoAal5ExtMIBCompliance.setStatus('deprecated') cisco_aal5_ext_mib_compliance_rev1 = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 1, 2)).setObjects(('CISCO-ATM-EXT-MIB', 'ciscoAal5ExtMIBGroup'), ('CISCO-ATM-EXT-MIB', 'ciscoAtmExtVclOamGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_aal5_ext_mib_compliance_rev1 = ciscoAal5ExtMIBComplianceRev1.setStatus('current') cisco_aal5_ext_mib_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 2, 1)).setObjects(('CISCO-ATM-EXT-MIB', 'cAal5VccExtCompEnabled'), ('CISCO-ATM-EXT-MIB', 'cAal5VccExtVoice'), ('CISCO-ATM-EXT-MIB', 'cAal5VccExtInF5OamCells'), ('CISCO-ATM-EXT-MIB', 'cAal5VccExtOutF5OamCells')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_aal5_ext_mib_group = ciscoAal5ExtMIBGroup.setStatus('current') cisco_atm_ext_vcl_oam_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 88, 2, 2, 2)).setObjects(('CISCO-ATM-EXT-MIB', 'catmxVclOamLoopbackFreq'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamRetryFreq'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamUpRetryCount'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamDownRetryCount'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamEndCCActCount'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamEndCCDeActCount'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamEndCCRetryFreq'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamSegCCActCount'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamSegCCDeActCount'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamSegCCRetryFreq'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamManage'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamLoopBkStatus'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamVcState'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamEndCCStatus'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamSegCCStatus'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamEndCCVcState'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamSegCCVcState'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamCellsReceived'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamCellsSent'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamCellsDropped'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamInF5ais'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamOutF5ais'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamInF5rdi'), ('CISCO-ATM-EXT-MIB', 'catmxVclOamOutF5rdi')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_atm_ext_vcl_oam_group = ciscoAtmExtVclOamGroup.setStatus('current') mibBuilder.exportSymbols('CISCO-ATM-EXT-MIB', catmxVclOamSegCCActCount=catmxVclOamSegCCActCount, cAal5VccExtCompEnabled=cAal5VccExtCompEnabled, catmxVclOamEndCCStatus=catmxVclOamEndCCStatus, ciscoAtmExtVclOamGroup=ciscoAtmExtVclOamGroup, ciscoAtmExtMIB=ciscoAtmExtMIB, cAal5VccExtInF5OamCells=cAal5VccExtInF5OamCells, catmxVclOamEndCCRetryFreq=catmxVclOamEndCCRetryFreq, catmxVclOamSegCCStatus=catmxVclOamSegCCStatus, catmxVclOamInF5ais=catmxVclOamInF5ais, cAal5VccExtTable=cAal5VccExtTable, ciscoAtmExtMIBObjects=ciscoAtmExtMIBObjects, catmxVclOamManage=catmxVclOamManage, catmxVclOamEntry=catmxVclOamEntry, catmxVclOamSegCCRetryFreq=catmxVclOamSegCCRetryFreq, catmxVclOamSegCCDeActCount=catmxVclOamSegCCDeActCount, catmxVclOamVcState=catmxVclOamVcState, cAal5VccExtEntry=cAal5VccExtEntry, ciscoAal5ExtMIBCompliances=ciscoAal5ExtMIBCompliances, PYSNMP_MODULE_ID=ciscoAtmExtMIB, catmxVclOamEndCCVcState=catmxVclOamEndCCVcState, ciscoAal5ExtMIBGroup=ciscoAal5ExtMIBGroup, catmxVclOamCellsReceived=catmxVclOamCellsReceived, catmxVclOamOutF5ais=catmxVclOamOutF5ais, OamCCStatus=OamCCStatus, catmxVclOamRetryFreq=catmxVclOamRetryFreq, catmxVclOamDownRetryCount=catmxVclOamDownRetryCount, ciscoAal5ExtMIBGroups=ciscoAal5ExtMIBGroups, catmxVclOamSegCCVcState=catmxVclOamSegCCVcState, catmxVclOamCellsSent=catmxVclOamCellsSent, catmxVclOamInF5rdi=catmxVclOamInF5rdi, catmxVclOamTable=catmxVclOamTable, ciscoAal5ExtMIBComplianceRev1=ciscoAal5ExtMIBComplianceRev1, cAal5VccExtMIBObjects=cAal5VccExtMIBObjects, cAal5VccExtVoice=cAal5VccExtVoice, catmxVcl=catmxVcl, catmxVclOamEndCCActCount=catmxVclOamEndCCActCount, ciscoAal5ExtMIBCompliance=ciscoAal5ExtMIBCompliance, catmxVclOamLoopbackFreq=catmxVclOamLoopbackFreq, OamCCVcState=OamCCVcState, catmxVclOamUpRetryCount=catmxVclOamUpRetryCount, catmxVclOamEndCCDeActCount=catmxVclOamEndCCDeActCount, catmxVclOamOutF5rdi=catmxVclOamOutF5rdi, catmxVclOamCellsDropped=catmxVclOamCellsDropped, cAal5VccExtOutF5OamCells=cAal5VccExtOutF5OamCells, ciscoAal5ExtMIBConformance=ciscoAal5ExtMIBConformance, catmxVclOamLoopBkStatus=catmxVclOamLoopBkStatus)
# Set window of past points for LSTM model window = 10 # Split 80/20 into train/test data last = int(n/5.0) Xtrain = X[:-last] Xtest = X[-last-window:] # Store window number of points as a sequence xin = [] next_X = [] for i in range(window,len(Xtrain)): xin.append(Xtrain[i-window:i]) next_X.append(Xtrain[i]) # Reshape data to format for LSTM xin, next_X = np.array(xin), np.array(next_X) xin = xin.reshape(xin.shape[0], xin.shape[1], 1)
window = 10 last = int(n / 5.0) xtrain = X[:-last] xtest = X[-last - window:] xin = [] next_x = [] for i in range(window, len(Xtrain)): xin.append(Xtrain[i - window:i]) next_X.append(Xtrain[i]) (xin, next_x) = (np.array(xin), np.array(next_X)) xin = xin.reshape(xin.shape[0], xin.shape[1], 1)
COLUMNS = [ 'TIPO_REGISTRO', 'NRO_FILIAL_PONTO_VENDA', 'NRO_RESUMO_VENDAS', 'DT_CV', 'VL_BRUTO', 'VL_DESCONTO', 'VL_LIQUIDO', 'NRO_CARTAO', 'TIPO_TRANSACAO', 'NRO_CV', 'DT_CREDITO', 'STATUS_TRANSACAO', 'HR_TRANSACAO', 'NRO_TERMINAL', 'TIPO_CAPTURA', 'RESERVADO', 'VL_COMPRA', 'VL_SAQUE', 'BANDEIRA' ]
columns = ['TIPO_REGISTRO', 'NRO_FILIAL_PONTO_VENDA', 'NRO_RESUMO_VENDAS', 'DT_CV', 'VL_BRUTO', 'VL_DESCONTO', 'VL_LIQUIDO', 'NRO_CARTAO', 'TIPO_TRANSACAO', 'NRO_CV', 'DT_CREDITO', 'STATUS_TRANSACAO', 'HR_TRANSACAO', 'NRO_TERMINAL', 'TIPO_CAPTURA', 'RESERVADO', 'VL_COMPRA', 'VL_SAQUE', 'BANDEIRA']
""" Finds the largest palindrome product of 2 n-digit nubers """ def find_largest_palindrome_product(n): """ Finds the largest palindrome product of 2 n-digit numbers :param n: N digit number which specifies the number of digits of a given number :return: Largest Palindrome product of 2 n-digit numbers :rtype: int >>> find_largest_palindrome_product(2) 9009 """ # first find the upper and lower limits for numbers with n digits upper_limit = 0 for _ in range(1, n + 1): upper_limit *= 10 upper_limit += 9 # lower limit is 1 + the upper limit floor division of 10 lower_limit = 1 + upper_limit // 10 # initialize the max product max_product = 0 for x in range(upper_limit, lower_limit - 1, -1): for y in range(x, lower_limit - 1, -1): product = x * y # short circuit early if the product is less than the max_product, no need to continue computation as this # already fails if product < max_product: break number_str = str(product) # check if this is a palindrome and is greater than the max_product currently if number_str == number_str[::-1] and product > max_product: max_product = product return max_product
""" Finds the largest palindrome product of 2 n-digit nubers """ def find_largest_palindrome_product(n): """ Finds the largest palindrome product of 2 n-digit numbers :param n: N digit number which specifies the number of digits of a given number :return: Largest Palindrome product of 2 n-digit numbers :rtype: int >>> find_largest_palindrome_product(2) 9009 """ upper_limit = 0 for _ in range(1, n + 1): upper_limit *= 10 upper_limit += 9 lower_limit = 1 + upper_limit // 10 max_product = 0 for x in range(upper_limit, lower_limit - 1, -1): for y in range(x, lower_limit - 1, -1): product = x * y if product < max_product: break number_str = str(product) if number_str == number_str[::-1] and product > max_product: max_product = product return max_product
# Large non-Mersenne prime def solve(): return (28433 * pow(2, 7830457, 10**10) + 1) % 10**10 if __name__ == "__main__": print(solve())
def solve(): return (28433 * pow(2, 7830457, 10 ** 10) + 1) % 10 ** 10 if __name__ == '__main__': print(solve())
class Solution: def isIsomorphic(self, s, t): """ :type s: str :type t: str :rtype: bool """ if len(s) != len(t): return False map1 = {} map2 = {} # reverse for i in range(len(s)): if s[i] in map1: if map1[s[i]] != t[i] or map2[t[i]] != s[i]: # doesn't match previously established mapping return False elif t[i] in map2: # attempting to map second letter in s to the same letter in t return False else: map1[s[i]] = t[i] map2[t[i]] = s[i] return True
class Solution: def is_isomorphic(self, s, t): """ :type s: str :type t: str :rtype: bool """ if len(s) != len(t): return False map1 = {} map2 = {} for i in range(len(s)): if s[i] in map1: if map1[s[i]] != t[i] or map2[t[i]] != s[i]: return False elif t[i] in map2: return False else: map1[s[i]] = t[i] map2[t[i]] = s[i] return True
#! /usr/bin/env python """ ------------------- depexoTools module. ------------------- This module was written primarily for the Depexo source finder, and the tools BANE and MIMAS. The wcs_helpers and angle_tools modules contain many useful classes and methods that would be useful more generally. """ __author__ = 'Paul Hancock' __version__ = '2.2.5' __date__ = '2021-11-15' __citation__ = """ % If your work makes use of depexoTools please cite the following papers as appropriate: % Advanced features of depexo, plus description of BANE, MIMAS, and AeRes @ARTICLE{Hancock_depexo2_2018, author = {{Hancock}, P.~J. and {Trott}, C.~M. and {Hurley-Walker}, N.}, title = "{Source Finding in the Era of the SKA (Precursors): Depexo 2.0}", journal = {\pasa}, archivePrefix = "arXiv", eprint = {1801.05548}, primaryClass = "astro-ph.IM", keywords = {radio continuum: general, catalogs, methods: statistical}, year = 2018, month = mar, volume = 35, eid = {e011}, pages = {e011}, doi = {10.1017/pasa.2018.3}, adsurl = {http://adsabs.harvard.edu/abs/2018PASA...35...11H}, adsnote = {Provided by the SAO/NASA Astrophysics Data System} } % Basic description of depexo @ARTICLE{Hancock_depexo_2012, author = {{Hancock}, P.~J. and {Murphy}, T. and {Gaensler}, B.~M. and {Hopkins}, A. and {Curran}, J.~R.}, title = "{Compact continuum source finding for next generation radio surveys}", journal = {\mnras}, archivePrefix = "arXiv", eprint = {1202.4500}, primaryClass = "astro-ph.IM", keywords = {techniques: image processing, catalogues, surveys}, year = 2012, month = may, volume = 422, pages = {1812-1824}, doi = {10.1111/j.1365-2966.2012.20768.x}, adsurl = {http://adsabs.harvard.edu/abs/2012MNRAS.422.1812H}, adsnote = {Provided by the SAO/NASA Astrophysics Data System} } """
""" ------------------- depexoTools module. ------------------- This module was written primarily for the Depexo source finder, and the tools BANE and MIMAS. The wcs_helpers and angle_tools modules contain many useful classes and methods that would be useful more generally. """ __author__ = 'Paul Hancock' __version__ = '2.2.5' __date__ = '2021-11-15' __citation__ = '\n% If your work makes use of depexoTools please cite the following papers as appropriate:\n\n% Advanced features of depexo, plus description of BANE, MIMAS, and AeRes\n@ARTICLE{Hancock_depexo2_2018,\n author = {{Hancock}, P.~J. and {Trott}, C.~M. and {Hurley-Walker}, N.},\n title = "{Source Finding in the Era of the SKA (Precursors): Depexo 2.0}",\n journal = {\\pasa},\narchivePrefix = "arXiv",\n eprint = {1801.05548},\n primaryClass = "astro-ph.IM",\n keywords = {radio continuum: general, catalogs, methods: statistical},\n year = 2018,\n month = mar,\n volume = 35,\n eid = {e011},\n pages = {e011},\n doi = {10.1017/pasa.2018.3},\n adsurl = {http://adsabs.harvard.edu/abs/2018PASA...35...11H},\n adsnote = {Provided by the SAO/NASA Astrophysics Data System}\n}\n\n% Basic description of depexo\n@ARTICLE{Hancock_depexo_2012,\n author = {{Hancock}, P.~J. and {Murphy}, T. and {Gaensler}, B.~M. and\n {Hopkins}, A. and {Curran}, J.~R.},\n title = "{Compact continuum source finding for next generation radio surveys}",\n journal = {\\mnras},\narchivePrefix = "arXiv",\n eprint = {1202.4500},\n primaryClass = "astro-ph.IM",\n keywords = {techniques: image processing, catalogues, surveys},\n year = 2012,\n month = may,\n volume = 422,\n pages = {1812-1824},\n doi = {10.1111/j.1365-2966.2012.20768.x},\n adsurl = {http://adsabs.harvard.edu/abs/2012MNRAS.422.1812H},\n adsnote = {Provided by the SAO/NASA Astrophysics Data System}\n}\n'
# 3 row=0 while row<8: col=0 while col<6: if (row==0) or (row==1 and col==4) or (row==2 and col==3)or (row==3 and col==2)or (row==4 and col==3)or (row==5 and col==4) or row==6: print("*",end=" ") else: print(" ",end=" ") col +=1 row +=1 print()
row = 0 while row < 8: col = 0 while col < 6: if row == 0 or (row == 1 and col == 4) or (row == 2 and col == 3) or (row == 3 and col == 2) or (row == 4 and col == 3) or (row == 5 and col == 4) or (row == 6): print('*', end=' ') else: print(' ', end=' ') col += 1 row += 1 print()
def _git_toolchain_alias_impl(ctx): toolchain = ctx.toolchains["//tools/git-toolchain:toolchain_type"] return [ platform_common.TemplateVariableInfo({ "GIT_BIN_PATH": toolchain.binary_path, }), ] git_toolchain_alias = rule( implementation = _git_toolchain_alias_impl, toolchains = ["//tools/git-toolchain:toolchain_type"], doc = """ Exposes an alias for retrieving the resolved Git toolchain. Exposing a template variable for accessing the Git binary path using Bazel `Make variables`. """, )
def _git_toolchain_alias_impl(ctx): toolchain = ctx.toolchains['//tools/git-toolchain:toolchain_type'] return [platform_common.TemplateVariableInfo({'GIT_BIN_PATH': toolchain.binary_path})] git_toolchain_alias = rule(implementation=_git_toolchain_alias_impl, toolchains=['//tools/git-toolchain:toolchain_type'], doc='\n Exposes an alias for retrieving the resolved Git toolchain. Exposing a template variable for\n accessing the Git binary path using Bazel `Make variables`.\n ')
""" Demo application for cli-toolkit shell wrappers """ __version__ = '1.0'
""" Demo application for cli-toolkit shell wrappers """ __version__ = '1.0'
class Solution: def longestMountain(self, arr: List[int]) -> int: forward_list = [0] backward_list = [0] res = [] for i in range(1,len(arr)): if arr[i] > arr[i-1]: forward_list.append(forward_list[i-1] + 1) else: forward_list.append(0) for i in range(len(arr)-2,-1,-1): if arr[i] > arr[i+1]: backward_list.append(backward_list[-1]+1) else: backward_list.append(0) backward_list.reverse() for i in range(len(arr)): if forward_list[i] != 0 and backward_list[i] != 0: res.append(forward_list[i] + backward_list[i]) else: res.append(0) #print(backward_list) #print(forward_list) return max(res) + 1 if max(res) + 1 >= 3 else 0 # dp solution time limited """ class Solution: def longestMountain(self, arr: List[int]) -> int: # dp[i][j] == 1 means arr[i:j+1] is a mountain # dp[i][j] = (dp[i+1][j-1] and arr[i] < arr[i+1] and arr[j] < arr[j-1]) # or (dp[i+1][j] and arr[i] < arr[i+1]) # or (dp[i][j-1] and arr[j] < arr[j-1]) res = 0 dp = [[0 for _ in range(len(arr))] for _ in range(len(arr))] for i in range(len(arr) - 2, -1, -1): if arr[i] < arr[i + 1] and arr[i+2] < arr[i+1]: dp[i][i+2] = 1 res = 3 for j in range(i + 3, len(arr)): dp[i][j] = (dp[i+1][j-1] and arr[i] < arr[i+1] and arr[j] < arr[j-1])\ or (dp[i+1][j] and arr[i] < arr[i+1])\ or (dp[i][j-1] and arr[j] < arr[j-1]) res = max(res,(j-i)+1) if dp[i][j] == 1 else res return res """
class Solution: def longest_mountain(self, arr: List[int]) -> int: forward_list = [0] backward_list = [0] res = [] for i in range(1, len(arr)): if arr[i] > arr[i - 1]: forward_list.append(forward_list[i - 1] + 1) else: forward_list.append(0) for i in range(len(arr) - 2, -1, -1): if arr[i] > arr[i + 1]: backward_list.append(backward_list[-1] + 1) else: backward_list.append(0) backward_list.reverse() for i in range(len(arr)): if forward_list[i] != 0 and backward_list[i] != 0: res.append(forward_list[i] + backward_list[i]) else: res.append(0) return max(res) + 1 if max(res) + 1 >= 3 else 0 ' class Solution:\n def longestMountain(self, arr: List[int]) -> int:\n # dp[i][j] == 1 means arr[i:j+1] is a mountain\n # dp[i][j] = (dp[i+1][j-1] and arr[i] < arr[i+1] and arr[j] < arr[j-1])\n # or (dp[i+1][j] and arr[i] < arr[i+1])\n # or (dp[i][j-1] and arr[j] < arr[j-1])\n\n res = 0\n dp = [[0 for _ in range(len(arr))] for _ in range(len(arr))]\n for i in range(len(arr) - 2, -1, -1):\n if arr[i] < arr[i + 1] and arr[i+2] < arr[i+1]:\n dp[i][i+2] = 1\n res = 3\n\n for j in range(i + 3, len(arr)):\n dp[i][j] = (dp[i+1][j-1] and arr[i] < arr[i+1] and arr[j] < arr[j-1]) or (dp[i+1][j] and arr[i] < arr[i+1]) or (dp[i][j-1] and arr[j] < arr[j-1])\n\n res = max(res,(j-i)+1) if dp[i][j] == 1 else res\n \n\n return res '
# Data Structure Base Class class DS: def __init__(self, cmp): raise NotImplementedError def gettop(self): raise NotImplementedError def extracttop(self): raise NotImplementedError def insert(self, val): raise NotImplementedError def print(self): raise NotImplementedError
class Ds: def __init__(self, cmp): raise NotImplementedError def gettop(self): raise NotImplementedError def extracttop(self): raise NotImplementedError def insert(self, val): raise NotImplementedError def print(self): raise NotImplementedError
def arg_parse_common(parser): parser.add_argument('-d', action = 'store_true', help = "Debug mode") parser.add_argument('-f', type = str, nargs = '?', help = 'Format output') parser.add_argument('-b', type = str, nargs = '?', help = 'Batch file') parser.add_argument('-config', type = str, nargs = '?', help = 'Config file') parser.add_argument('-list', action = 'store_true', help = 'List cache') parser.add_argument('-test', action = 'store_true', help = 'Run tests') parser.add_argument('-sort', type = str, nargs = '?', help = '') parser.add_argument('-order', type = str, nargs = '?', help = '') parser.add_argument('--cache', type = str, nargs = '?', help = 'Cache sqlite3 database') parser.add_argument('--cache_expire', type = int, nargs = '?', help = 'Cache expiration time') parser.add_argument('--rate_limit', type = str, nargs = '?', help = 'Query rate limit') parser.add_argument('--machine', action = 'store_true', help = 'Machine-readable output') parser.add_argument('query', nargs = '*')
def arg_parse_common(parser): parser.add_argument('-d', action='store_true', help='Debug mode') parser.add_argument('-f', type=str, nargs='?', help='Format output') parser.add_argument('-b', type=str, nargs='?', help='Batch file') parser.add_argument('-config', type=str, nargs='?', help='Config file') parser.add_argument('-list', action='store_true', help='List cache') parser.add_argument('-test', action='store_true', help='Run tests') parser.add_argument('-sort', type=str, nargs='?', help='') parser.add_argument('-order', type=str, nargs='?', help='') parser.add_argument('--cache', type=str, nargs='?', help='Cache sqlite3 database') parser.add_argument('--cache_expire', type=int, nargs='?', help='Cache expiration time') parser.add_argument('--rate_limit', type=str, nargs='?', help='Query rate limit') parser.add_argument('--machine', action='store_true', help='Machine-readable output') parser.add_argument('query', nargs='*')
def hello (s): print("Hello, " + s + "!") hello("world") hello("python") hello("Sergey")
def hello(s): print('Hello, ' + s + '!') hello('world') hello('python') hello('Sergey')
# class Tree: # def __init__(self, val, left=None, right=None): # self.val = val # self.left = left # self.right = right # class LLNode: # def __init__(self, val, next=None): # self.val = val # self.next = next class Solution: def solve(self, root): ans = LLNode(0) cur = ans def iot(node): nonlocal cur if not node: return iot(node.left) cur.next = LLNode(node.val) cur = cur.next iot(node.right) iot(root) return ans.next
class Solution: def solve(self, root): ans = ll_node(0) cur = ans def iot(node): nonlocal cur if not node: return iot(node.left) cur.next = ll_node(node.val) cur = cur.next iot(node.right) iot(root) return ans.next
class Main: def __init__(self): self.pi = 3.14159 self.r = float(input()) def output(self): print("A=%0.4f" % (self.pi * self.r ** 2)) if __name__ == '__main__': obj = Main() obj.output()
class Main: def __init__(self): self.pi = 3.14159 self.r = float(input()) def output(self): print('A=%0.4f' % (self.pi * self.r ** 2)) if __name__ == '__main__': obj = main() obj.output()
class InvalidConfigException(Exception): """Thrown when the configuration for a question is invalid""" class EvaluationException(Exception): """Thrown when an excetption was thrown from either the evaluation of a code block or a user function call"""
class Invalidconfigexception(Exception): """Thrown when the configuration for a question is invalid""" class Evaluationexception(Exception): """Thrown when an excetption was thrown from either the evaluation of a code block or a user function call"""
""" Ex 02 - Make a program that reads a person's name and shows a welcome message """ #reads something typed by the user n = str(input('Type your name: ')) print(f'Nice to Meet you {n}') input('Enter to exit')
""" Ex 02 - Make a program that reads a person's name and shows a welcome message """ n = str(input('Type your name: ')) print(f'Nice to Meet you {n}') input('Enter to exit')
class Perceptron(object): def __init__(self, lr=0.1, epoch=10): self.lr = lr self.epoch = epoch def fit(self, x, y): self.n_classes = len(np.unique(test_y)) self.w = np.zeros((x.shape[1]+1,self.n_classes)) for _ in range(self.epoch): for xi, yi in zip(x,y): dw = self.lr*(yi-self.predict(xi)) self.w[1:,yi] += dw*xi self.w[0,yi] += dw def predict(self, v): tmp = np.dot(v, self.w[1:,:])+self.w[0,:] try: return np.argmax(tmp, axis=1) except: return np.argmax(tmp) class Adaline(object): def __init__(self,lr=0.1, epoch=10): self.lr = lr self.epoch = epoch def fit(self, x, y): self.n_classes = len(np.unique(test_y)) self.w = np.zeros((x.shape[1]+1,self.n_classes)) for xi, yi in zip(x, y): for _ in range(self.epoch): dw = self.lr*(yi-self.net_input(xi,yi)) self.w[1:,yi] += dw*xi self.w[0,yi] += dw def net_input(self, x, y): return np.dot(x, self.w[1:,y]+self.w[0,y]) def predict(self, v): tmp = np.dot(v, self.w[1:,:])+self.w[0,:] print(tmp) try: return np.argmax(tmp, axis=1) except: return np.argmax(tmp)
class Perceptron(object): def __init__(self, lr=0.1, epoch=10): self.lr = lr self.epoch = epoch def fit(self, x, y): self.n_classes = len(np.unique(test_y)) self.w = np.zeros((x.shape[1] + 1, self.n_classes)) for _ in range(self.epoch): for (xi, yi) in zip(x, y): dw = self.lr * (yi - self.predict(xi)) self.w[1:, yi] += dw * xi self.w[0, yi] += dw def predict(self, v): tmp = np.dot(v, self.w[1:, :]) + self.w[0, :] try: return np.argmax(tmp, axis=1) except: return np.argmax(tmp) class Adaline(object): def __init__(self, lr=0.1, epoch=10): self.lr = lr self.epoch = epoch def fit(self, x, y): self.n_classes = len(np.unique(test_y)) self.w = np.zeros((x.shape[1] + 1, self.n_classes)) for (xi, yi) in zip(x, y): for _ in range(self.epoch): dw = self.lr * (yi - self.net_input(xi, yi)) self.w[1:, yi] += dw * xi self.w[0, yi] += dw def net_input(self, x, y): return np.dot(x, self.w[1:, y] + self.w[0, y]) def predict(self, v): tmp = np.dot(v, self.w[1:, :]) + self.w[0, :] print(tmp) try: return np.argmax(tmp, axis=1) except: return np.argmax(tmp)
# # PySNMP MIB module CISCO-SESS-BORDER-CTRLR-STATS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-SESS-BORDER-CTRLR-STATS-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:11:55 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint") csbCallStatsServiceIndex, csbCallStatsInstanceIndex, CiscoSbcPeriodicStatsInterval = mibBuilder.importSymbols("CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsServiceIndex", "csbCallStatsInstanceIndex", "CiscoSbcPeriodicStatsInterval") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup") Counter32, NotificationType, Integer32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Bits, ObjectIdentity, Gauge32, TimeTicks, MibIdentifier, ModuleIdentity, Counter64, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "NotificationType", "Integer32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Bits", "ObjectIdentity", "Gauge32", "TimeTicks", "MibIdentifier", "ModuleIdentity", "Counter64", "Unsigned32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") ciscoSbcStatsMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 757)) ciscoSbcStatsMIB.setRevisions(('2010-09-15 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoSbcStatsMIB.setRevisionsDescriptions(('Latest version of this MIB module.',)) if mibBuilder.loadTexts: ciscoSbcStatsMIB.setLastUpdated('201009150000Z') if mibBuilder.loadTexts: ciscoSbcStatsMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoSbcStatsMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: sbc-dev@cisco.com') if mibBuilder.loadTexts: ciscoSbcStatsMIB.setDescription('The main purpose of this MIB is to define the statistics information for Session Border Controller application. This MIB categorizes the statistics information into following types: 1. RADIUS Messages Statistics - Represents statistics of various RADIUS messages for RADIUS servers with which the client (SBC) shares a secret. 2. Rf Billing Statistics- Represents Rf billing statistics information which monitors the messages sent per-realm over IMS Rx interface by Rf billing manager(SBC). 3. SIP Statistics - Represents SIP requests and various SIP responses on a SIP adjacency in a given interval. The Session Border Controller (SBC) enables direct IP-to-IP interconnect between multiple administrative domains for session-based services providing protocol inter-working, security, and admission control and management. The SBC is a voice over IP (VoIP) device that sits on the border of a network and controls call admission to that network. The primary purpose of an SBC is to protect the interior of the network from excessive call load and malicious traffic. Additional functions provided by the SBC include media bridging and billing services. Periodic Statistics - Represents the SBC call statistics information for a particular time interval. E.g. you can specify that you want to retrieve statistics for a summary period of the current or previous 5 minutes, 15 minutes, hour, or day. The statistics for 5 minutes are divided into five minute intervals past the hour - that is, at 0 minutes, 5 minutes, 10 minutes... past the hour. When you retrieve statistics for the current five minute period, you will be given statistics from the start of the interval to the current time. When you retrieve statistics for the previous five minutes, you will be given the statistics for the entirety of the previous interval. For example, if it is currently 12:43 - the current 5 minute statistics cover 12:40 - 12:43 - the previous 5 minute statistics cover 12:35 - 12:40 The other intervals work similarly. 15 minute statistics are divided into 15 minute intervals past the hour (0 minutes, 15 minutes, 30 minutes, 45 minutes). Hourly statistics are divided into intervals on the hour. Daily statistics are divided into intervals at 0:00 each day. Therefore, if you retrieve the statistics at 12:43 for each of these intervals, the periods covered are as follows. - current 15 minutes: 12:30 - 12:43 - previous 15 minutes: 12:15 - 12:30 - current hour: 12:00 - 12:43 - last hour: 11:00 - 12:00 - current day: 00:00 - 12:43 - last day: 00:00 (the day before) - 00:00. GLOSSARY SBC: Session Border Controller CSB: CISCO Session Border Controller Adjacency: An adjacency contains the system information to be transmitted to next HOP. ACR: Accounting Request ACA: Accounting Accept AVP: Attribute-Value Pairs REFERENCES 1. CISCO Session Border Controller Documents and FAQ http://zed.cisco.com/confluence/display/SBC/SBC') class CiscoSbcSIPMethod(TextualConvention, Integer32): description = 'This textual convention represents the various SIP Methods.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)) namedValues = NamedValues(("unknown", 1), ("ack", 2), ("bye", 3), ("cancel", 4), ("info", 5), ("invite", 6), ("message", 7), ("notify", 8), ("options", 9), ("prack", 10), ("refer", 11), ("register", 12), ("subscribe", 13), ("update", 14)) class CiscoSbcRadiusClientType(TextualConvention, Integer32): description = 'This textual convention represents the type of RADIUS client.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("authentication", 1), ("accounting", 2)) ciscoSbcStatsMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 757, 0)) ciscoSbcStatsMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 757, 1)) ciscoSbcStatsMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 757, 2)) csbRadiusStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1), ) if mibBuilder.loadTexts: csbRadiusStatsTable.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsTable.setDescription('This table has the reporting statistics of various RADIUS messages for RADIUS servers with which the client (SBC) shares a secret. Each entry in this table is identified by a value of csbRadiusStatsEntIndex. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csbRadiusStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1), ).setIndexNames((0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsInstanceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsServiceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsEntIndex")) if mibBuilder.loadTexts: csbRadiusStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsEntry.setDescription('A conceptual row in the csbRadiusStatsTable. There is an entry in this table for each RADIUS server, as identified by a value of csbRadiusStatsEntIndex. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csbRadiusStatsEntIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: csbRadiusStatsEntIndex.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsEntIndex.setDescription('This object indicates the index of the RADIUS client entity that this server is configured on. This index is assigned arbitrarily by the engine and is not saved over reboots.') csbRadiusStatsClientName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 2), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsClientName.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsClientName.setDescription('This object indicates the client name of the RADIUS client to which that these statistics apply.') csbRadiusStatsClientType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 3), CiscoSbcRadiusClientType()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsClientType.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsClientType.setDescription('This object indicates the type(authentication or accounting) of the RADIUS clients configured on SBC.') csbRadiusStatsSrvrName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 4), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsSrvrName.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsSrvrName.setDescription('This object indicates the server name of the RADIUS server to which that these statistics apply.') csbRadiusStatsAcsReqs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 5), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsAcsReqs.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsAcsReqs.setDescription('This object indicates the number of RADIUS Access-Request packets sent to this server. This does not include retransmissions.') csbRadiusStatsAcsRtrns = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 6), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsAcsRtrns.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsAcsRtrns.setDescription('This object indicates the number of RADIUS Access-Request packets retransmitted to this RADIUS server.') csbRadiusStatsAcsAccpts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsAcsAccpts.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsAcsAccpts.setDescription('This object indicates the number of RADIUS Access-Accept packets (valid or invalid) received from this server.') csbRadiusStatsAcsRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 8), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsAcsRejects.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsAcsRejects.setDescription('This object indicates the number of RADIUS Access-Reject packets (valid or invalid) received from this server.') csbRadiusStatsAcsChalls = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 9), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsAcsChalls.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsAcsChalls.setDescription('This object indicates the number of RADIUS Access-Challenge packets (valid or invalid) received from this server.') csbRadiusStatsActReqs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 10), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsActReqs.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsActReqs.setDescription('This object indicates the number of RADIUS Accounting-Request packets sent to this server. This does not include retransmissions.') csbRadiusStatsActRetrans = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 11), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsActRetrans.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsActRetrans.setDescription('This object indicates the number of RADIUS Accounting-Request packets retransmitted to this RADIUS server.') csbRadiusStatsActRsps = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 12), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsActRsps.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsActRsps.setDescription('This object indicates the number of RADIUS Accounting-Response packets (valid or invalid) received from this server.') csbRadiusStatsMalformedRsps = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 13), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsMalformedRsps.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsMalformedRsps.setDescription('This object indicates the number of malformed RADIUS response packets received from this server. Malformed packets include packets with an invalid length. Bad authenticators, Signature attributes and unknown types are not included as malformed access responses.') csbRadiusStatsBadAuths = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 14), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsBadAuths.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsBadAuths.setDescription('This object indicates the number of RADIUS response packets containing invalid authenticators or Signature attributes received from this server.') csbRadiusStatsPending = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 15), Gauge32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsPending.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsPending.setDescription('This object indicates the number of RADIUS request packets destined for this server that have not yet timed out or received a response. This variable is incremented when a request is sent and decremented on receipt of the response or on a timeout or retransmission.') csbRadiusStatsTimeouts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 16), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsTimeouts.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsTimeouts.setDescription('This object indicates the number of RADIUS request timeouts to this server. After a timeout the client may retry to a different server or give up. A retry to a different server is counted as a request as well as a timeout.') csbRadiusStatsUnknownType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 17), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsUnknownType.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsUnknownType.setDescription('This object indicates the number of RADIUS packets of unknown type which were received from this server.') csbRadiusStatsDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 18), Counter64()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRadiusStatsDropped.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsDropped.setDescription('This object indicates the number of RADIUS packets which were received from this server and dropped for some other reason.') csbRfBillRealmStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2), ) if mibBuilder.loadTexts: csbRfBillRealmStatsTable.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsTable.setDescription('This table describes the Rf billing statistics information which monitors the messages sent per-realm by Rf billing manager(SBC). SBC sends Rf billing data using Diameter as a transport protocol. Rf billing uses only ACR and ACA Diameter messages for the transport of billing data. The Accounting-Record-Type AVP on the ACR message labels the type of the accounting request. The following types are used by Rf billing. 1. For session-based charging, the types Start (session begins), Interim (session is modified) and Stop (session ends) are used. 2. For event-based charging, the type Event is used when a chargeable event occurs outside the scope of a session. Each row of this table is identified by a value of csbRfBillRealmStatsIndex and csbRfBillRealmStatsRealmName. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csbRfBillRealmStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1), ).setIndexNames((0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsInstanceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsServiceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsIndex"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsRealmName")) if mibBuilder.loadTexts: csbRfBillRealmStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsEntry.setDescription('A conceptual row in the csbRfBillRealmStatsTable. There is an entry in this table for each realm, as identified by a value of csbRfBillRealmStatsIndex and csbRfBillRealmStatsRealmName. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csbRfBillRealmStatsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))) if mibBuilder.loadTexts: csbRfBillRealmStatsIndex.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsIndex.setDescription('This object indicates the billing method instance index. The range of valid values for this field is 0 - 31.') csbRfBillRealmStatsRealmName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 2), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsRealmName.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsRealmName.setDescription('This object indicates the realm for which these statistics are collected. The length of this object is zero when value is not assigned to it.') csbRfBillRealmStatsTotalStartAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 3), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsTotalStartAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalStartAcrs.setDescription('This object indicates the combined sum of successful and failed Start ACRs since start of day or the last time the statistics were reset.') csbRfBillRealmStatsTotalInterimAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 4), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsTotalInterimAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalInterimAcrs.setDescription('This object indicates the combined sum of successful and failed Interim ACRs since start of day or the last time the statistics were reset.') csbRfBillRealmStatsTotalStopAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 5), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsTotalStopAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalStopAcrs.setDescription('This object indicates the combined sum of successful and failed Stop ACRs since start of day or the last time the statistics were reset.') csbRfBillRealmStatsTotalEventAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 6), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsTotalEventAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalEventAcrs.setDescription('This object indicates the combined sum of successful and failed Event ACRs since start of day or the last time the statistics were reset.') csbRfBillRealmStatsSuccStartAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 7), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsSuccStartAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccStartAcrs.setDescription('This object indicates the total number of successful Start ACRs since start of day or the last time the statistics were reset.') csbRfBillRealmStatsSuccInterimAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 8), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsSuccInterimAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccInterimAcrs.setDescription('This object indicates the total number of successful Interim ACRs since start of day or the last time the statistics were reset.') csbRfBillRealmStatsSuccStopAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 9), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsSuccStopAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccStopAcrs.setDescription('This object indicates the total number of successful Stop ACRs since start of day or the last time the statistics were reset.') csbRfBillRealmStatsSuccEventAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 10), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsSuccEventAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccEventAcrs.setDescription('This object indicates the total number of successful Event ACRs since start of day or the last time the statistics were reset.') csbRfBillRealmStatsFailStartAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 11), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsFailStartAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsFailStartAcrs.setDescription('This object indicates the total number of failed Start ACRs since start of day or the last time the statistics were reset.') csbRfBillRealmStatsFailInterimAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 12), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsFailInterimAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsFailInterimAcrs.setDescription('This object indicates the total number of failed Interim ACRs since start of day or the last time the statistics were reset.') csbRfBillRealmStatsFailStopAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 13), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsFailStopAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsFailStopAcrs.setDescription('This object indicates the total number of failed Stop ACRs since start of day or the last time the statistics were reset.') csbRfBillRealmStatsFailEventAcrs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 14), Unsigned32()).setUnits('ACRs').setMaxAccess("readonly") if mibBuilder.loadTexts: csbRfBillRealmStatsFailEventAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsFailEventAcrs.setDescription('This object indicates the total number of failed Event ACRs since start of day or the last time the statistics were reset.') csbSIPMthdCurrentStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3), ) if mibBuilder.loadTexts: csbSIPMthdCurrentStatsTable.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsTable.setDescription('This table reports count of SIP request and various SIP responses for each SIP method on a SIP adjacency in a given interval. Each entry in this table represents a SIP method, its incoming and outgoing count, individual incoming and outgoing count of various SIP responses for this method on a SIP adjacency in a given interval. To understand the meaning of interval please refer <Periodic Statistics> section in description of ciscoSbcStatsMIB. This table is indexed on csbSIPMthdCurrentStatsAdjName, csbSIPMthdCurrentStatsMethod and csbSIPMthdCurrentStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csbSIPMthdCurrentStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1), ).setIndexNames((0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsInstanceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsServiceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsAdjName"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsMethod"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsInterval")) if mibBuilder.loadTexts: csbSIPMthdCurrentStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsEntry.setDescription('A conceptual row in the csbSIPMthdCurrentStatsTable. Each row describes a SIP method and various responses count for this method on a given SIP adjacency and given interval. This table is indexed on csbSIPMthdCurrentStatsAdjName, csbSIPMthdCurrentStatsMethod and csbSIPMthdCurrentStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csbSIPMthdCurrentStatsAdjName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 1), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsAdjName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsAdjName.setDescription('This object indicates the name of the SIP adjacency for which stats related with SIP request and all kind of corresponding SIP responses are reported. The object acts as an index of the table.') csbSIPMthdCurrentStatsMethod = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 2), CiscoSbcSIPMethod()) if mibBuilder.loadTexts: csbSIPMthdCurrentStatsMethod.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsMethod.setDescription('This object indicates the SIP method Request. The object acts as an index of the table.') csbSIPMthdCurrentStatsInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 3), CiscoSbcPeriodicStatsInterval()) if mibBuilder.loadTexts: csbSIPMthdCurrentStatsInterval.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsInterval.setDescription('This object indicates the interval for which the periodic statistics information is to be displayed. The interval values can be 5 minutes, 15 minutes, 1 hour , 1 Day. This object acts as an index for the table.') csbSIPMthdCurrentStatsMethodName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 4), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsMethodName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsMethodName.setDescription('This object indicates the text representation of the SIP method request. E.g. INVITE, ACK, BYE etc.') csbSIPMthdCurrentStatsReqIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 5), Gauge32()).setUnits('requests').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsReqIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsReqIn.setDescription('This object indicates the total incoming SIP message requests of this type on this SIP adjacency.') csbSIPMthdCurrentStatsReqOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 6), Gauge32()).setUnits('requests').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsReqOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsReqOut.setDescription('This object indicates the total outgoing SIP message requests of this type on this SIP adjacency.') csbSIPMthdCurrentStatsResp1xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 7), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp1xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp1xxIn.setDescription('This object indicates the total 1xx responses for this method received on this SIP adjacency.') csbSIPMthdCurrentStatsResp1xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 8), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp1xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp1xxOut.setDescription('This object indicates the total 1xx responses for this method sent on this SIP adjacency.') csbSIPMthdCurrentStatsResp2xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 9), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp2xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp2xxIn.setDescription('This object indicates the total 2xx responses for this method received on this SIP adjacency.') csbSIPMthdCurrentStatsResp2xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 10), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp2xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp2xxOut.setDescription('This object indicates the total 2xx responses for this method sent on this SIP adjacency.') csbSIPMthdCurrentStatsResp3xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 11), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp3xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp3xxIn.setDescription('This object indicates the total 3xx responses for this method received on this SIP adjacency.') csbSIPMthdCurrentStatsResp3xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 12), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp3xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp3xxOut.setDescription('This object indicates the total 3xx responses for this method sent on this SIP adjacency.') csbSIPMthdCurrentStatsResp4xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 13), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp4xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp4xxIn.setDescription('This object indicates the total 4xx responses for this method received on this SIP adjacency.') csbSIPMthdCurrentStatsResp4xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 14), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp4xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp4xxOut.setDescription('This object indicates the total 4xx responses for this method sent on this SIP adjacency.') csbSIPMthdCurrentStatsResp5xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 15), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp5xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp5xxIn.setDescription('This object indicates the total 5xx responses for this method received on this SIP adjacency.') csbSIPMthdCurrentStatsResp5xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 16), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp5xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp5xxOut.setDescription('This object indicates the total 5xx responses for this method sent on this SIP adjacency.') csbSIPMthdCurrentStatsResp6xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 17), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp6xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp6xxIn.setDescription('This object indicates the total 6xx responses for this method received on this SIP adjacency.') csbSIPMthdCurrentStatsResp6xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 18), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp6xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp6xxOut.setDescription('This object indicates the total 6xx responses for this method sent on this SIP adjacency.') csbSIPMthdHistoryStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4), ) if mibBuilder.loadTexts: csbSIPMthdHistoryStatsTable.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsTable.setDescription('This table provide historical count of SIP request and various SIP responses for each SIP method on a SIP adjacency in various interval length defined by the csbSIPMthdHistoryStatsInterval object. Each entry in this table represents a SIP method, its incoming and outgoing count, individual incoming and outgoing count of various SIP responses for this method on a SIP adjacency in a given interval. The possible values of interval will be previous 5 minutes, previous 15 minutes, previous 1 hour and previous day. To understand the meaning of interval please refer <Periodic Statistics> description of ciscoSbcStatsMIB. This table is indexed on csbSIPMthdHistoryStatsAdjName, csbSIPMthdHistoryStatsMethod and csbSIPMthdHistoryStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csbSIPMthdHistoryStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1), ).setIndexNames((0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsInstanceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsServiceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsAdjName"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsMethod"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsInterval")) if mibBuilder.loadTexts: csbSIPMthdHistoryStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsEntry.setDescription('A conceptual row in the csbSIPMthdHistoryStatsTable. The entries in this table are updated as interval completes in the csbSIPMthdCurrentStatsTable table and the data is moved from that table to this one. This table is indexed on csbSIPMthdHistoryStatsAdjName, csbSIPMthdHistoryStatsMethod and csbSIPMthdHistoryStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csbSIPMthdHistoryStatsAdjName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 1), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsAdjName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsAdjName.setDescription('This object indicates the name of the SIP adjacency for which stats related with SIP request and all kind of corresponding SIP responses are reported. The object acts as an index of the table.') csbSIPMthdHistoryStatsMethod = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 2), CiscoSbcSIPMethod()) if mibBuilder.loadTexts: csbSIPMthdHistoryStatsMethod.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsMethod.setDescription('This object indicates the SIP method Request. The object acts as an index of the table.') csbSIPMthdHistoryStatsInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 3), CiscoSbcPeriodicStatsInterval()) if mibBuilder.loadTexts: csbSIPMthdHistoryStatsInterval.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsInterval.setDescription('This object indicates the interval for which the historical statistics information is to be displayed. The interval values can be previous 5 minutes, previous 15 minutes, previous 1 hour and previous 1 Day. This object acts as an index for the table.') csbSIPMthdHistoryStatsMethodName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 4), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsMethodName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsMethodName.setDescription('This object indicates the text representation of the SIP method request. E.g. INVITE, ACK, BYE etc.') csbSIPMthdHistoryStatsReqIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 5), Gauge32()).setUnits('requests').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsReqIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsReqIn.setDescription('This object indicates the total incoming SIP message requests of this type on this SIP adjacency.') csbSIPMthdHistoryStatsReqOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 6), Gauge32()).setUnits('requests').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsReqOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsReqOut.setDescription('This object indicates the total outgoing SIP message requests of this type on this SIP adjacency.') csbSIPMthdHistoryStatsResp1xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 7), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp1xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp1xxIn.setDescription('This object indicates the total 1xx responses for this method received on this SIP adjacency.') csbSIPMthdHistoryStatsResp1xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 8), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp1xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp1xxOut.setDescription('This object indicates the total 1xx responses for this method sent on this SIP adjacency.') csbSIPMthdHistoryStatsResp2xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 9), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp2xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp2xxIn.setDescription('This object indicates the total 2xx responses for this method received on this SIP adjacency.') csbSIPMthdHistoryStatsResp2xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 10), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp2xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp2xxOut.setDescription('This object indicates the total 2xx responses for this method sent on this SIP adjacency.') csbSIPMthdHistoryStatsResp3xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 11), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp3xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp3xxIn.setDescription('This object indicates the total 3xx responses for this method received on this SIP adjacency.') csbSIPMthdHistoryStatsResp3xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 12), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp3xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp3xxOut.setDescription('This object indicates the total 3xx responses for this method sent on this SIP adjacency.') csbSIPMthdHistoryStatsResp4xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 13), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp4xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp4xxIn.setDescription('This object indicates the total 4xx responses for this method received on this SIP adjacency.') csbSIPMthdHistoryStatsResp4xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 14), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp4xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp4xxOut.setDescription('This object indicates the total 4xx responses for this method sent on this SIP adjacency.') csbSIPMthdHistoryStatsResp5xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 15), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp5xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp5xxIn.setDescription('This object indicates the total 5xx responses for this method received on this SIP adjacency.') csbSIPMthdHistoryStatsResp5xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 16), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp5xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp5xxOut.setDescription('This object indicates the total 5xx responses for this method sent on this SIP adjacency.') csbSIPMthdHistoryStatsResp6xxIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 17), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp6xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp6xxIn.setDescription('This object indicates the total 6xx responses for this method received on this SIP adjacency.') csbSIPMthdHistoryStatsResp6xxOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 18), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp6xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp6xxOut.setDescription('This object indicates the total 6xx responses for this method sent on this SIP adjacency.') csbSIPMthdRCCurrentStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5), ) if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsTable.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsTable.setDescription('This table reports SIP method request and response code statistics for each method and response code combination on given SIP adjacency in a given interval. To understand the meaning of interval please refer <Periodic Statistics> section in description of ciscoSbcStatsMIB. An exact lookup will return a row only if - 1) detailed response code statistics are turned on in SBC 2) response code messages sent or received is non zero for given SIP adjacency, method and interval. Also an inexact lookup will only return rows for messages with non-zero counts, to protect the user from large numbers of rows for response codes which have not been received or sent.') csbSIPMthdRCCurrentStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1), ).setIndexNames((0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsInstanceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsServiceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCCurrentStatsAdjName"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCCurrentStatsMethod"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCCurrentStatsRespCode"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCCurrentStatsInterval")) if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsEntry.setDescription('A conceptual row in the csbSIPMthdRCCurrentStatsTable. Each entry in this table represents a method and response code combination. Each entry in this table is identified by a value of csbSIPMthdRCCurrentStatsAdjName, csbSIPMthdRCCurrentStatsMethod, csbSIPMthdRCCurrentStatsRespCode and csbSIPMthdRCCurrentStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csbSIPMthdRCCurrentStatsAdjName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 1), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsAdjName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsAdjName.setDescription('This identifies the name of the adjacency for which statistics are reported. This object acts as an index for the table.') csbSIPMthdRCCurrentStatsMethod = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 2), CiscoSbcSIPMethod()) if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsMethod.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsMethod.setDescription('This object indicates the SIP method request. This object acts as an index for the table.') csbSIPMthdRCCurrentStatsRespCode = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 3), Unsigned32()) if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespCode.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespCode.setDescription('This object indicates the response code for the SIP message request. The range of valid values for SIP response codes is 100 - 999. This object acts as an index for the table.') csbSIPMthdRCCurrentStatsInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 4), CiscoSbcPeriodicStatsInterval()) if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsInterval.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsInterval.setDescription('This object identifies the interval for which the periodic statistics information is to be displayed. The interval values can be 5 min, 15 mins, 1 hour , 1 Day. This object acts as an index for the table.') csbSIPMthdRCCurrentStatsMethodName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 5), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsMethodName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsMethodName.setDescription('This object indicates the text representation of the SIP method request. E.g. INVITE, ACK, BYE etc.') csbSIPMthdRCCurrentStatsRespIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 6), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespIn.setDescription('This object indicates the total SIP messages with this response code this method received on this SIP adjacency.') csbSIPMthdRCCurrentStatsRespOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 7), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespOut.setDescription('This object indicates the total SIP messages with this response code for this method sent on this SIP adjacency.') csbSIPMthdRCHistoryStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6), ) if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsTable.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsTable.setDescription('This table reports historical data for SIP method request and response code statistics for each method and response code combination in a given past interval. The possible values of interval will be previous 5 minutes, previous 15 minutes, previous 1 hour and previous day. To understand the meaning of interval please refer <Periodic Statistics> section in description of ciscoSbcStatsMIB. An exact lookup will return a row only if - 1) detailed response code statistics are turned on in SBC 2) response code messages sent or received is non zero for given SIP adjacency, method and interval. Also an inexact lookup will only return rows for messages with non-zero counts, to protect the user from large numbers of rows for response codes which have not been received or sent.') csbSIPMthdRCHistoryStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1), ).setIndexNames((0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsInstanceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB", "csbCallStatsServiceIndex"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCHistoryStatsAdjName"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCHistoryStatsMethod"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCHistoryStatsRespCode"), (0, "CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCHistoryStatsInterval")) if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsEntry.setDescription('A conceptual row in the csbSIPMthdRCHistoryStatsTable. The entries in this table are updated as interval completes in the csbSIPMthdRCCurrentStatsTable table and the data is moved from that table to this one. Each entry in this table is identified by a value of csbSIPMthdRCHistoryStatsAdjName, csbSIPMthdRCHistoryStatsMethod, csbSIPMthdRCHistoryStatsRespCode and csbSIPMthdRCHistoryStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csbSIPMthdRCHistoryStatsAdjName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 1), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsAdjName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsAdjName.setDescription('This identifies the name of the adjacency for which statistics are reported. This object acts as an index for the table.') csbSIPMthdRCHistoryStatsMethod = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 2), CiscoSbcSIPMethod()) if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsMethod.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsMethod.setDescription('This object indicates the SIP method request. This object acts as an index for the table.') csbSIPMthdRCHistoryStatsMethodName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 3), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsMethodName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsMethodName.setDescription('This object indicates the text representation of the SIP method request. E.g. INVITE, ACK, BYE etc.') csbSIPMthdRCHistoryStatsRespCode = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 4), Unsigned32()) if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespCode.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespCode.setDescription('This object indicates the response code for the SIP message request. The range of valid values for SIP response codes is 100 - 999. This object acts as an index for the table.') csbSIPMthdRCHistoryStatsInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 5), CiscoSbcPeriodicStatsInterval()) if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsInterval.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsInterval.setDescription('This object identifies the interval for which the periodic statistics information is to be displayed. The interval values can be previous 5 min, previous 15 mins, previous 1 hour , previous 1 Day. This object acts as an index for the table.') csbSIPMthdRCHistoryStatsRespIn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 6), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespIn.setDescription('This object indicates the total SIP messages with this response code this method received on this SIP adjacency.') csbSIPMthdRCHistoryStatsRespOut = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 7), Gauge32()).setUnits('responses').setMaxAccess("readonly") if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespOut.setDescription('This object indicates the total SIP messages with this response code for this method sent on this SIP adjacency.') csbStatsMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 1)) csbStatsMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2)) csbStatsMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 1, 1)).setObjects(("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsGroup"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsGroup"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsGroup"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsGroup"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCHistoryStatsGroup"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCCurrentStatsGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csbStatsMIBCompliance = csbStatsMIBCompliance.setStatus('current') if mibBuilder.loadTexts: csbStatsMIBCompliance.setDescription('This is a default module-compliance containing csbStatsMIBGroups.') csbRadiusStatsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 1)).setObjects(("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsClientName"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsClientType"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsSrvrName"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsAcsReqs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsAcsRtrns"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsAcsAccpts"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsAcsRejects"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsAcsChalls"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsActReqs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsActRetrans"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsActRsps"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsMalformedRsps"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsBadAuths"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsPending"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsTimeouts"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsUnknownType"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRadiusStatsDropped")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csbRadiusStatsGroup = csbRadiusStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsGroup.setDescription('A collection of objects providing RADIUS messages statistics for configured RADIUS servers on Cisco Session Border Controller (SBC).') csbRfBillRealmStatsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 2)).setObjects(("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsRealmName"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsTotalStartAcrs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsTotalInterimAcrs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsTotalStopAcrs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsTotalEventAcrs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsSuccStartAcrs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsSuccInterimAcrs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsSuccStopAcrs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsSuccEventAcrs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsFailStartAcrs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsFailInterimAcrs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsFailStopAcrs"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbRfBillRealmStatsFailEventAcrs")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csbRfBillRealmStatsGroup = csbRfBillRealmStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsGroup.setDescription('A collection of objects providing Rf billing statistics information on Cisco Session Border Controller (SBC).') csbSIPMthdCurrentStatsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 3)).setObjects(("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsAdjName"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsMethodName"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsReqIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsReqOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp1xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp1xxOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp2xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp2xxOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp3xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp3xxOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp4xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp4xxOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp5xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp5xxOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp6xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdCurrentStatsResp6xxOut")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csbSIPMthdCurrentStatsGroup = csbSIPMthdCurrentStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsGroup.setDescription('A collection of objects providing statistics for a SIP method and various responses count for this method on a given SIP adjacency and given interval for Cisco Session Border Controller (SBC).') csbSIPMthdHistoryStatsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 4)).setObjects(("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsAdjName"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsMethodName"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsReqIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsReqOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp1xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp1xxOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp2xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp2xxOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp3xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp3xxOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp4xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp4xxOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp5xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp5xxOut"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp6xxIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdHistoryStatsResp6xxOut")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csbSIPMthdHistoryStatsGroup = csbSIPMthdHistoryStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsGroup.setDescription('A collection of objects providing historical statistics for a SIP method and various responses count for this method on a given SIP adjacency and given interval for Cisco Session Border Controller (SBC).') csbSIPMthdRCCurrentStatsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 5)).setObjects(("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCCurrentStatsAdjName"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCCurrentStatsMethodName"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCCurrentStatsRespIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCCurrentStatsRespOut")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csbSIPMthdRCCurrentStatsGroup = csbSIPMthdRCCurrentStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsGroup.setDescription('A collection of objects providing SIP statistics for a method and response code combination for Cisco Session Border Controller (SBC).') csbSIPMthdRCHistoryStatsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 6)).setObjects(("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCHistoryStatsAdjName"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCHistoryStatsMethodName"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCHistoryStatsRespIn"), ("CISCO-SESS-BORDER-CTRLR-STATS-MIB", "csbSIPMthdRCHistoryStatsRespOut")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csbSIPMthdRCHistoryStatsGroup = csbSIPMthdRCHistoryStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsGroup.setDescription('A collection of objects providing SIP historical statistics for a method and response code combination for Cisco Session Border Controller (SBC).') mibBuilder.exportSymbols("CISCO-SESS-BORDER-CTRLR-STATS-MIB", csbSIPMthdHistoryStatsResp2xxOut=csbSIPMthdHistoryStatsResp2xxOut, csbSIPMthdRCHistoryStatsGroup=csbSIPMthdRCHistoryStatsGroup, csbRfBillRealmStatsFailStopAcrs=csbRfBillRealmStatsFailStopAcrs, csbSIPMthdCurrentStatsMethod=csbSIPMthdCurrentStatsMethod, csbSIPMthdHistoryStatsResp4xxOut=csbSIPMthdHistoryStatsResp4xxOut, csbRadiusStatsEntry=csbRadiusStatsEntry, csbRadiusStatsAcsReqs=csbRadiusStatsAcsReqs, ciscoSbcStatsMIBObjects=ciscoSbcStatsMIBObjects, csbSIPMthdHistoryStatsReqOut=csbSIPMthdHistoryStatsReqOut, csbStatsMIBCompliances=csbStatsMIBCompliances, csbRadiusStatsActReqs=csbRadiusStatsActReqs, ciscoSbcStatsMIB=ciscoSbcStatsMIB, csbSIPMthdCurrentStatsResp4xxOut=csbSIPMthdCurrentStatsResp4xxOut, csbRadiusStatsMalformedRsps=csbRadiusStatsMalformedRsps, csbSIPMthdCurrentStatsResp6xxIn=csbSIPMthdCurrentStatsResp6xxIn, csbRadiusStatsPending=csbRadiusStatsPending, csbSIPMthdHistoryStatsInterval=csbSIPMthdHistoryStatsInterval, csbSIPMthdHistoryStatsEntry=csbSIPMthdHistoryStatsEntry, csbSIPMthdCurrentStatsResp1xxIn=csbSIPMthdCurrentStatsResp1xxIn, csbSIPMthdHistoryStatsResp6xxIn=csbSIPMthdHistoryStatsResp6xxIn, csbRadiusStatsDropped=csbRadiusStatsDropped, csbSIPMthdCurrentStatsResp3xxIn=csbSIPMthdCurrentStatsResp3xxIn, csbSIPMthdRCCurrentStatsRespOut=csbSIPMthdRCCurrentStatsRespOut, csbSIPMthdHistoryStatsResp4xxIn=csbSIPMthdHistoryStatsResp4xxIn, csbSIPMthdRCCurrentStatsGroup=csbSIPMthdRCCurrentStatsGroup, CiscoSbcSIPMethod=CiscoSbcSIPMethod, csbSIPMthdRCCurrentStatsRespIn=csbSIPMthdRCCurrentStatsRespIn, csbRfBillRealmStatsTotalStopAcrs=csbRfBillRealmStatsTotalStopAcrs, csbRfBillRealmStatsGroup=csbRfBillRealmStatsGroup, csbSIPMthdCurrentStatsReqIn=csbSIPMthdCurrentStatsReqIn, csbStatsMIBCompliance=csbStatsMIBCompliance, csbRadiusStatsTable=csbRadiusStatsTable, csbSIPMthdCurrentStatsReqOut=csbSIPMthdCurrentStatsReqOut, csbRfBillRealmStatsTotalStartAcrs=csbRfBillRealmStatsTotalStartAcrs, csbRadiusStatsUnknownType=csbRadiusStatsUnknownType, csbSIPMthdCurrentStatsResp2xxOut=csbSIPMthdCurrentStatsResp2xxOut, csbRfBillRealmStatsTable=csbRfBillRealmStatsTable, csbSIPMthdRCHistoryStatsTable=csbSIPMthdRCHistoryStatsTable, csbSIPMthdCurrentStatsResp5xxOut=csbSIPMthdCurrentStatsResp5xxOut, csbSIPMthdCurrentStatsEntry=csbSIPMthdCurrentStatsEntry, csbSIPMthdRCHistoryStatsMethodName=csbSIPMthdRCHistoryStatsMethodName, csbRadiusStatsBadAuths=csbRadiusStatsBadAuths, csbRfBillRealmStatsEntry=csbRfBillRealmStatsEntry, csbSIPMthdRCHistoryStatsRespOut=csbSIPMthdRCHistoryStatsRespOut, csbSIPMthdHistoryStatsMethod=csbSIPMthdHistoryStatsMethod, csbSIPMthdHistoryStatsGroup=csbSIPMthdHistoryStatsGroup, csbRfBillRealmStatsSuccStopAcrs=csbRfBillRealmStatsSuccStopAcrs, csbSIPMthdRCCurrentStatsEntry=csbSIPMthdRCCurrentStatsEntry, csbRadiusStatsActRsps=csbRadiusStatsActRsps, csbSIPMthdCurrentStatsAdjName=csbSIPMthdCurrentStatsAdjName, csbSIPMthdRCHistoryStatsInterval=csbSIPMthdRCHistoryStatsInterval, csbRfBillRealmStatsFailInterimAcrs=csbRfBillRealmStatsFailInterimAcrs, csbRadiusStatsGroup=csbRadiusStatsGroup, csbRadiusStatsAcsChalls=csbRadiusStatsAcsChalls, csbSIPMthdRCCurrentStatsMethod=csbSIPMthdRCCurrentStatsMethod, csbSIPMthdHistoryStatsTable=csbSIPMthdHistoryStatsTable, csbSIPMthdHistoryStatsResp5xxOut=csbSIPMthdHistoryStatsResp5xxOut, csbSIPMthdRCHistoryStatsMethod=csbSIPMthdRCHistoryStatsMethod, csbStatsMIBGroups=csbStatsMIBGroups, csbRadiusStatsClientType=csbRadiusStatsClientType, csbSIPMthdCurrentStatsResp5xxIn=csbSIPMthdCurrentStatsResp5xxIn, csbSIPMthdHistoryStatsResp3xxOut=csbSIPMthdHistoryStatsResp3xxOut, csbRadiusStatsAcsRejects=csbRadiusStatsAcsRejects, csbSIPMthdCurrentStatsGroup=csbSIPMthdCurrentStatsGroup, csbSIPMthdCurrentStatsResp6xxOut=csbSIPMthdCurrentStatsResp6xxOut, csbSIPMthdRCCurrentStatsMethodName=csbSIPMthdRCCurrentStatsMethodName, csbSIPMthdHistoryStatsResp2xxIn=csbSIPMthdHistoryStatsResp2xxIn, csbRadiusStatsActRetrans=csbRadiusStatsActRetrans, csbRfBillRealmStatsIndex=csbRfBillRealmStatsIndex, csbSIPMthdHistoryStatsResp5xxIn=csbSIPMthdHistoryStatsResp5xxIn, csbRfBillRealmStatsFailStartAcrs=csbRfBillRealmStatsFailStartAcrs, csbSIPMthdHistoryStatsResp6xxOut=csbSIPMthdHistoryStatsResp6xxOut, csbSIPMthdHistoryStatsMethodName=csbSIPMthdHistoryStatsMethodName, csbRfBillRealmStatsSuccStartAcrs=csbRfBillRealmStatsSuccStartAcrs, csbSIPMthdRCHistoryStatsAdjName=csbSIPMthdRCHistoryStatsAdjName, csbRfBillRealmStatsSuccInterimAcrs=csbRfBillRealmStatsSuccInterimAcrs, csbSIPMthdRCCurrentStatsRespCode=csbSIPMthdRCCurrentStatsRespCode, csbSIPMthdCurrentStatsMethodName=csbSIPMthdCurrentStatsMethodName, csbRadiusStatsTimeouts=csbRadiusStatsTimeouts, PYSNMP_MODULE_ID=ciscoSbcStatsMIB, csbSIPMthdCurrentStatsTable=csbSIPMthdCurrentStatsTable, csbSIPMthdRCHistoryStatsRespCode=csbSIPMthdRCHistoryStatsRespCode, csbSIPMthdHistoryStatsAdjName=csbSIPMthdHistoryStatsAdjName, csbSIPMthdRCCurrentStatsInterval=csbSIPMthdRCCurrentStatsInterval, csbSIPMthdCurrentStatsResp2xxIn=csbSIPMthdCurrentStatsResp2xxIn, csbRfBillRealmStatsTotalEventAcrs=csbRfBillRealmStatsTotalEventAcrs, csbSIPMthdCurrentStatsResp1xxOut=csbSIPMthdCurrentStatsResp1xxOut, csbRadiusStatsClientName=csbRadiusStatsClientName, ciscoSbcStatsMIBConform=ciscoSbcStatsMIBConform, csbSIPMthdCurrentStatsResp3xxOut=csbSIPMthdCurrentStatsResp3xxOut, csbRadiusStatsSrvrName=csbRadiusStatsSrvrName, ciscoSbcStatsMIBNotifs=ciscoSbcStatsMIBNotifs, csbRfBillRealmStatsFailEventAcrs=csbRfBillRealmStatsFailEventAcrs, csbSIPMthdRCHistoryStatsRespIn=csbSIPMthdRCHistoryStatsRespIn, csbSIPMthdHistoryStatsResp3xxIn=csbSIPMthdHistoryStatsResp3xxIn, csbSIPMthdRCHistoryStatsEntry=csbSIPMthdRCHistoryStatsEntry, csbSIPMthdRCCurrentStatsAdjName=csbSIPMthdRCCurrentStatsAdjName, csbRfBillRealmStatsTotalInterimAcrs=csbRfBillRealmStatsTotalInterimAcrs, csbSIPMthdCurrentStatsResp4xxIn=csbSIPMthdCurrentStatsResp4xxIn, csbSIPMthdHistoryStatsResp1xxOut=csbSIPMthdHistoryStatsResp1xxOut, csbRfBillRealmStatsRealmName=csbRfBillRealmStatsRealmName, csbRadiusStatsEntIndex=csbRadiusStatsEntIndex, csbRadiusStatsAcsRtrns=csbRadiusStatsAcsRtrns, csbRadiusStatsAcsAccpts=csbRadiusStatsAcsAccpts, csbRfBillRealmStatsSuccEventAcrs=csbRfBillRealmStatsSuccEventAcrs, csbSIPMthdCurrentStatsInterval=csbSIPMthdCurrentStatsInterval, csbSIPMthdRCCurrentStatsTable=csbSIPMthdRCCurrentStatsTable, CiscoSbcRadiusClientType=CiscoSbcRadiusClientType, csbSIPMthdHistoryStatsReqIn=csbSIPMthdHistoryStatsReqIn, csbSIPMthdHistoryStatsResp1xxIn=csbSIPMthdHistoryStatsResp1xxIn)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, single_value_constraint, constraints_intersection, constraints_union, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueRangeConstraint') (csb_call_stats_service_index, csb_call_stats_instance_index, cisco_sbc_periodic_stats_interval) = mibBuilder.importSymbols('CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsServiceIndex', 'csbCallStatsInstanceIndex', 'CiscoSbcPeriodicStatsInterval') (cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (notification_group, module_compliance, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance', 'ObjectGroup') (counter32, notification_type, integer32, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, bits, object_identity, gauge32, time_ticks, mib_identifier, module_identity, counter64, unsigned32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'NotificationType', 'Integer32', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'Bits', 'ObjectIdentity', 'Gauge32', 'TimeTicks', 'MibIdentifier', 'ModuleIdentity', 'Counter64', 'Unsigned32') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') cisco_sbc_stats_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 757)) ciscoSbcStatsMIB.setRevisions(('2010-09-15 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoSbcStatsMIB.setRevisionsDescriptions(('Latest version of this MIB module.',)) if mibBuilder.loadTexts: ciscoSbcStatsMIB.setLastUpdated('201009150000Z') if mibBuilder.loadTexts: ciscoSbcStatsMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoSbcStatsMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: sbc-dev@cisco.com') if mibBuilder.loadTexts: ciscoSbcStatsMIB.setDescription('The main purpose of this MIB is to define the statistics information for Session Border Controller application. This MIB categorizes the statistics information into following types: 1. RADIUS Messages Statistics - Represents statistics of various RADIUS messages for RADIUS servers with which the client (SBC) shares a secret. 2. Rf Billing Statistics- Represents Rf billing statistics information which monitors the messages sent per-realm over IMS Rx interface by Rf billing manager(SBC). 3. SIP Statistics - Represents SIP requests and various SIP responses on a SIP adjacency in a given interval. The Session Border Controller (SBC) enables direct IP-to-IP interconnect between multiple administrative domains for session-based services providing protocol inter-working, security, and admission control and management. The SBC is a voice over IP (VoIP) device that sits on the border of a network and controls call admission to that network. The primary purpose of an SBC is to protect the interior of the network from excessive call load and malicious traffic. Additional functions provided by the SBC include media bridging and billing services. Periodic Statistics - Represents the SBC call statistics information for a particular time interval. E.g. you can specify that you want to retrieve statistics for a summary period of the current or previous 5 minutes, 15 minutes, hour, or day. The statistics for 5 minutes are divided into five minute intervals past the hour - that is, at 0 minutes, 5 minutes, 10 minutes... past the hour. When you retrieve statistics for the current five minute period, you will be given statistics from the start of the interval to the current time. When you retrieve statistics for the previous five minutes, you will be given the statistics for the entirety of the previous interval. For example, if it is currently 12:43 - the current 5 minute statistics cover 12:40 - 12:43 - the previous 5 minute statistics cover 12:35 - 12:40 The other intervals work similarly. 15 minute statistics are divided into 15 minute intervals past the hour (0 minutes, 15 minutes, 30 minutes, 45 minutes). Hourly statistics are divided into intervals on the hour. Daily statistics are divided into intervals at 0:00 each day. Therefore, if you retrieve the statistics at 12:43 for each of these intervals, the periods covered are as follows. - current 15 minutes: 12:30 - 12:43 - previous 15 minutes: 12:15 - 12:30 - current hour: 12:00 - 12:43 - last hour: 11:00 - 12:00 - current day: 00:00 - 12:43 - last day: 00:00 (the day before) - 00:00. GLOSSARY SBC: Session Border Controller CSB: CISCO Session Border Controller Adjacency: An adjacency contains the system information to be transmitted to next HOP. ACR: Accounting Request ACA: Accounting Accept AVP: Attribute-Value Pairs REFERENCES 1. CISCO Session Border Controller Documents and FAQ http://zed.cisco.com/confluence/display/SBC/SBC') class Ciscosbcsipmethod(TextualConvention, Integer32): description = 'This textual convention represents the various SIP Methods.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)) named_values = named_values(('unknown', 1), ('ack', 2), ('bye', 3), ('cancel', 4), ('info', 5), ('invite', 6), ('message', 7), ('notify', 8), ('options', 9), ('prack', 10), ('refer', 11), ('register', 12), ('subscribe', 13), ('update', 14)) class Ciscosbcradiusclienttype(TextualConvention, Integer32): description = 'This textual convention represents the type of RADIUS client.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('authentication', 1), ('accounting', 2)) cisco_sbc_stats_mib_notifs = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 757, 0)) cisco_sbc_stats_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 757, 1)) cisco_sbc_stats_mib_conform = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 757, 2)) csb_radius_stats_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1)) if mibBuilder.loadTexts: csbRadiusStatsTable.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsTable.setDescription('This table has the reporting statistics of various RADIUS messages for RADIUS servers with which the client (SBC) shares a secret. Each entry in this table is identified by a value of csbRadiusStatsEntIndex. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csb_radius_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1)).setIndexNames((0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsInstanceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsServiceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsEntIndex')) if mibBuilder.loadTexts: csbRadiusStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsEntry.setDescription('A conceptual row in the csbRadiusStatsTable. There is an entry in this table for each RADIUS server, as identified by a value of csbRadiusStatsEntIndex. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csb_radius_stats_ent_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 1), unsigned32()) if mibBuilder.loadTexts: csbRadiusStatsEntIndex.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsEntIndex.setDescription('This object indicates the index of the RADIUS client entity that this server is configured on. This index is assigned arbitrarily by the engine and is not saved over reboots.') csb_radius_stats_client_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 2), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsClientName.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsClientName.setDescription('This object indicates the client name of the RADIUS client to which that these statistics apply.') csb_radius_stats_client_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 3), cisco_sbc_radius_client_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsClientType.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsClientType.setDescription('This object indicates the type(authentication or accounting) of the RADIUS clients configured on SBC.') csb_radius_stats_srvr_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 4), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsSrvrName.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsSrvrName.setDescription('This object indicates the server name of the RADIUS server to which that these statistics apply.') csb_radius_stats_acs_reqs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 5), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsAcsReqs.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsAcsReqs.setDescription('This object indicates the number of RADIUS Access-Request packets sent to this server. This does not include retransmissions.') csb_radius_stats_acs_rtrns = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 6), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsAcsRtrns.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsAcsRtrns.setDescription('This object indicates the number of RADIUS Access-Request packets retransmitted to this RADIUS server.') csb_radius_stats_acs_accpts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 7), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsAcsAccpts.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsAcsAccpts.setDescription('This object indicates the number of RADIUS Access-Accept packets (valid or invalid) received from this server.') csb_radius_stats_acs_rejects = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 8), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsAcsRejects.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsAcsRejects.setDescription('This object indicates the number of RADIUS Access-Reject packets (valid or invalid) received from this server.') csb_radius_stats_acs_challs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 9), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsAcsChalls.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsAcsChalls.setDescription('This object indicates the number of RADIUS Access-Challenge packets (valid or invalid) received from this server.') csb_radius_stats_act_reqs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 10), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsActReqs.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsActReqs.setDescription('This object indicates the number of RADIUS Accounting-Request packets sent to this server. This does not include retransmissions.') csb_radius_stats_act_retrans = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 11), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsActRetrans.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsActRetrans.setDescription('This object indicates the number of RADIUS Accounting-Request packets retransmitted to this RADIUS server.') csb_radius_stats_act_rsps = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 12), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsActRsps.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsActRsps.setDescription('This object indicates the number of RADIUS Accounting-Response packets (valid or invalid) received from this server.') csb_radius_stats_malformed_rsps = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 13), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsMalformedRsps.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsMalformedRsps.setDescription('This object indicates the number of malformed RADIUS response packets received from this server. Malformed packets include packets with an invalid length. Bad authenticators, Signature attributes and unknown types are not included as malformed access responses.') csb_radius_stats_bad_auths = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 14), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsBadAuths.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsBadAuths.setDescription('This object indicates the number of RADIUS response packets containing invalid authenticators or Signature attributes received from this server.') csb_radius_stats_pending = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 15), gauge32()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsPending.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsPending.setDescription('This object indicates the number of RADIUS request packets destined for this server that have not yet timed out or received a response. This variable is incremented when a request is sent and decremented on receipt of the response or on a timeout or retransmission.') csb_radius_stats_timeouts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 16), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsTimeouts.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsTimeouts.setDescription('This object indicates the number of RADIUS request timeouts to this server. After a timeout the client may retry to a different server or give up. A retry to a different server is counted as a request as well as a timeout.') csb_radius_stats_unknown_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 17), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsUnknownType.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsUnknownType.setDescription('This object indicates the number of RADIUS packets of unknown type which were received from this server.') csb_radius_stats_dropped = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 1, 1, 18), counter64()).setUnits('packets').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRadiusStatsDropped.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsDropped.setDescription('This object indicates the number of RADIUS packets which were received from this server and dropped for some other reason.') csb_rf_bill_realm_stats_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2)) if mibBuilder.loadTexts: csbRfBillRealmStatsTable.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsTable.setDescription('This table describes the Rf billing statistics information which monitors the messages sent per-realm by Rf billing manager(SBC). SBC sends Rf billing data using Diameter as a transport protocol. Rf billing uses only ACR and ACA Diameter messages for the transport of billing data. The Accounting-Record-Type AVP on the ACR message labels the type of the accounting request. The following types are used by Rf billing. 1. For session-based charging, the types Start (session begins), Interim (session is modified) and Stop (session ends) are used. 2. For event-based charging, the type Event is used when a chargeable event occurs outside the scope of a session. Each row of this table is identified by a value of csbRfBillRealmStatsIndex and csbRfBillRealmStatsRealmName. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csb_rf_bill_realm_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1)).setIndexNames((0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsInstanceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsServiceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsRealmName')) if mibBuilder.loadTexts: csbRfBillRealmStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsEntry.setDescription('A conceptual row in the csbRfBillRealmStatsTable. There is an entry in this table for each realm, as identified by a value of csbRfBillRealmStatsIndex and csbRfBillRealmStatsRealmName. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csb_rf_bill_realm_stats_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 31))) if mibBuilder.loadTexts: csbRfBillRealmStatsIndex.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsIndex.setDescription('This object indicates the billing method instance index. The range of valid values for this field is 0 - 31.') csb_rf_bill_realm_stats_realm_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 2), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsRealmName.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsRealmName.setDescription('This object indicates the realm for which these statistics are collected. The length of this object is zero when value is not assigned to it.') csb_rf_bill_realm_stats_total_start_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 3), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalStartAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalStartAcrs.setDescription('This object indicates the combined sum of successful and failed Start ACRs since start of day or the last time the statistics were reset.') csb_rf_bill_realm_stats_total_interim_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 4), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalInterimAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalInterimAcrs.setDescription('This object indicates the combined sum of successful and failed Interim ACRs since start of day or the last time the statistics were reset.') csb_rf_bill_realm_stats_total_stop_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 5), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalStopAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalStopAcrs.setDescription('This object indicates the combined sum of successful and failed Stop ACRs since start of day or the last time the statistics were reset.') csb_rf_bill_realm_stats_total_event_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 6), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalEventAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsTotalEventAcrs.setDescription('This object indicates the combined sum of successful and failed Event ACRs since start of day or the last time the statistics were reset.') csb_rf_bill_realm_stats_succ_start_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 7), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccStartAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccStartAcrs.setDescription('This object indicates the total number of successful Start ACRs since start of day or the last time the statistics were reset.') csb_rf_bill_realm_stats_succ_interim_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 8), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccInterimAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccInterimAcrs.setDescription('This object indicates the total number of successful Interim ACRs since start of day or the last time the statistics were reset.') csb_rf_bill_realm_stats_succ_stop_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 9), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccStopAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccStopAcrs.setDescription('This object indicates the total number of successful Stop ACRs since start of day or the last time the statistics were reset.') csb_rf_bill_realm_stats_succ_event_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 10), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccEventAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsSuccEventAcrs.setDescription('This object indicates the total number of successful Event ACRs since start of day or the last time the statistics were reset.') csb_rf_bill_realm_stats_fail_start_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 11), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsFailStartAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsFailStartAcrs.setDescription('This object indicates the total number of failed Start ACRs since start of day or the last time the statistics were reset.') csb_rf_bill_realm_stats_fail_interim_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 12), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsFailInterimAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsFailInterimAcrs.setDescription('This object indicates the total number of failed Interim ACRs since start of day or the last time the statistics were reset.') csb_rf_bill_realm_stats_fail_stop_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 13), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsFailStopAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsFailStopAcrs.setDescription('This object indicates the total number of failed Stop ACRs since start of day or the last time the statistics were reset.') csb_rf_bill_realm_stats_fail_event_acrs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 2, 1, 14), unsigned32()).setUnits('ACRs').setMaxAccess('readonly') if mibBuilder.loadTexts: csbRfBillRealmStatsFailEventAcrs.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsFailEventAcrs.setDescription('This object indicates the total number of failed Event ACRs since start of day or the last time the statistics were reset.') csb_sip_mthd_current_stats_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3)) if mibBuilder.loadTexts: csbSIPMthdCurrentStatsTable.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsTable.setDescription('This table reports count of SIP request and various SIP responses for each SIP method on a SIP adjacency in a given interval. Each entry in this table represents a SIP method, its incoming and outgoing count, individual incoming and outgoing count of various SIP responses for this method on a SIP adjacency in a given interval. To understand the meaning of interval please refer <Periodic Statistics> section in description of ciscoSbcStatsMIB. This table is indexed on csbSIPMthdCurrentStatsAdjName, csbSIPMthdCurrentStatsMethod and csbSIPMthdCurrentStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csb_sip_mthd_current_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1)).setIndexNames((0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsInstanceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsServiceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsAdjName'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsMethod'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsInterval')) if mibBuilder.loadTexts: csbSIPMthdCurrentStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsEntry.setDescription('A conceptual row in the csbSIPMthdCurrentStatsTable. Each row describes a SIP method and various responses count for this method on a given SIP adjacency and given interval. This table is indexed on csbSIPMthdCurrentStatsAdjName, csbSIPMthdCurrentStatsMethod and csbSIPMthdCurrentStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csb_sip_mthd_current_stats_adj_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 1), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsAdjName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsAdjName.setDescription('This object indicates the name of the SIP adjacency for which stats related with SIP request and all kind of corresponding SIP responses are reported. The object acts as an index of the table.') csb_sip_mthd_current_stats_method = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 2), cisco_sbc_sip_method()) if mibBuilder.loadTexts: csbSIPMthdCurrentStatsMethod.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsMethod.setDescription('This object indicates the SIP method Request. The object acts as an index of the table.') csb_sip_mthd_current_stats_interval = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 3), cisco_sbc_periodic_stats_interval()) if mibBuilder.loadTexts: csbSIPMthdCurrentStatsInterval.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsInterval.setDescription('This object indicates the interval for which the periodic statistics information is to be displayed. The interval values can be 5 minutes, 15 minutes, 1 hour , 1 Day. This object acts as an index for the table.') csb_sip_mthd_current_stats_method_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 4), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsMethodName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsMethodName.setDescription('This object indicates the text representation of the SIP method request. E.g. INVITE, ACK, BYE etc.') csb_sip_mthd_current_stats_req_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 5), gauge32()).setUnits('requests').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsReqIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsReqIn.setDescription('This object indicates the total incoming SIP message requests of this type on this SIP adjacency.') csb_sip_mthd_current_stats_req_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 6), gauge32()).setUnits('requests').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsReqOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsReqOut.setDescription('This object indicates the total outgoing SIP message requests of this type on this SIP adjacency.') csb_sip_mthd_current_stats_resp1xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 7), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp1xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp1xxIn.setDescription('This object indicates the total 1xx responses for this method received on this SIP adjacency.') csb_sip_mthd_current_stats_resp1xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 8), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp1xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp1xxOut.setDescription('This object indicates the total 1xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_current_stats_resp2xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 9), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp2xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp2xxIn.setDescription('This object indicates the total 2xx responses for this method received on this SIP adjacency.') csb_sip_mthd_current_stats_resp2xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 10), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp2xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp2xxOut.setDescription('This object indicates the total 2xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_current_stats_resp3xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 11), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp3xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp3xxIn.setDescription('This object indicates the total 3xx responses for this method received on this SIP adjacency.') csb_sip_mthd_current_stats_resp3xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 12), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp3xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp3xxOut.setDescription('This object indicates the total 3xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_current_stats_resp4xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 13), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp4xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp4xxIn.setDescription('This object indicates the total 4xx responses for this method received on this SIP adjacency.') csb_sip_mthd_current_stats_resp4xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 14), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp4xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp4xxOut.setDescription('This object indicates the total 4xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_current_stats_resp5xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 15), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp5xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp5xxIn.setDescription('This object indicates the total 5xx responses for this method received on this SIP adjacency.') csb_sip_mthd_current_stats_resp5xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 16), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp5xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp5xxOut.setDescription('This object indicates the total 5xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_current_stats_resp6xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 17), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp6xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp6xxIn.setDescription('This object indicates the total 6xx responses for this method received on this SIP adjacency.') csb_sip_mthd_current_stats_resp6xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 3, 1, 18), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp6xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsResp6xxOut.setDescription('This object indicates the total 6xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_history_stats_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4)) if mibBuilder.loadTexts: csbSIPMthdHistoryStatsTable.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsTable.setDescription('This table provide historical count of SIP request and various SIP responses for each SIP method on a SIP adjacency in various interval length defined by the csbSIPMthdHistoryStatsInterval object. Each entry in this table represents a SIP method, its incoming and outgoing count, individual incoming and outgoing count of various SIP responses for this method on a SIP adjacency in a given interval. The possible values of interval will be previous 5 minutes, previous 15 minutes, previous 1 hour and previous day. To understand the meaning of interval please refer <Periodic Statistics> description of ciscoSbcStatsMIB. This table is indexed on csbSIPMthdHistoryStatsAdjName, csbSIPMthdHistoryStatsMethod and csbSIPMthdHistoryStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csb_sip_mthd_history_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1)).setIndexNames((0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsInstanceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsServiceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsAdjName'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsMethod'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsInterval')) if mibBuilder.loadTexts: csbSIPMthdHistoryStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsEntry.setDescription('A conceptual row in the csbSIPMthdHistoryStatsTable. The entries in this table are updated as interval completes in the csbSIPMthdCurrentStatsTable table and the data is moved from that table to this one. This table is indexed on csbSIPMthdHistoryStatsAdjName, csbSIPMthdHistoryStatsMethod and csbSIPMthdHistoryStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csb_sip_mthd_history_stats_adj_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 1), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsAdjName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsAdjName.setDescription('This object indicates the name of the SIP adjacency for which stats related with SIP request and all kind of corresponding SIP responses are reported. The object acts as an index of the table.') csb_sip_mthd_history_stats_method = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 2), cisco_sbc_sip_method()) if mibBuilder.loadTexts: csbSIPMthdHistoryStatsMethod.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsMethod.setDescription('This object indicates the SIP method Request. The object acts as an index of the table.') csb_sip_mthd_history_stats_interval = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 3), cisco_sbc_periodic_stats_interval()) if mibBuilder.loadTexts: csbSIPMthdHistoryStatsInterval.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsInterval.setDescription('This object indicates the interval for which the historical statistics information is to be displayed. The interval values can be previous 5 minutes, previous 15 minutes, previous 1 hour and previous 1 Day. This object acts as an index for the table.') csb_sip_mthd_history_stats_method_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 4), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsMethodName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsMethodName.setDescription('This object indicates the text representation of the SIP method request. E.g. INVITE, ACK, BYE etc.') csb_sip_mthd_history_stats_req_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 5), gauge32()).setUnits('requests').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsReqIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsReqIn.setDescription('This object indicates the total incoming SIP message requests of this type on this SIP adjacency.') csb_sip_mthd_history_stats_req_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 6), gauge32()).setUnits('requests').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsReqOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsReqOut.setDescription('This object indicates the total outgoing SIP message requests of this type on this SIP adjacency.') csb_sip_mthd_history_stats_resp1xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 7), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp1xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp1xxIn.setDescription('This object indicates the total 1xx responses for this method received on this SIP adjacency.') csb_sip_mthd_history_stats_resp1xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 8), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp1xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp1xxOut.setDescription('This object indicates the total 1xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_history_stats_resp2xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 9), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp2xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp2xxIn.setDescription('This object indicates the total 2xx responses for this method received on this SIP adjacency.') csb_sip_mthd_history_stats_resp2xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 10), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp2xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp2xxOut.setDescription('This object indicates the total 2xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_history_stats_resp3xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 11), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp3xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp3xxIn.setDescription('This object indicates the total 3xx responses for this method received on this SIP adjacency.') csb_sip_mthd_history_stats_resp3xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 12), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp3xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp3xxOut.setDescription('This object indicates the total 3xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_history_stats_resp4xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 13), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp4xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp4xxIn.setDescription('This object indicates the total 4xx responses for this method received on this SIP adjacency.') csb_sip_mthd_history_stats_resp4xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 14), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp4xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp4xxOut.setDescription('This object indicates the total 4xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_history_stats_resp5xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 15), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp5xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp5xxIn.setDescription('This object indicates the total 5xx responses for this method received on this SIP adjacency.') csb_sip_mthd_history_stats_resp5xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 16), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp5xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp5xxOut.setDescription('This object indicates the total 5xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_history_stats_resp6xx_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 17), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp6xxIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp6xxIn.setDescription('This object indicates the total 6xx responses for this method received on this SIP adjacency.') csb_sip_mthd_history_stats_resp6xx_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 4, 1, 18), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp6xxOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsResp6xxOut.setDescription('This object indicates the total 6xx responses for this method sent on this SIP adjacency.') csb_sip_mthd_rc_current_stats_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5)) if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsTable.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsTable.setDescription('This table reports SIP method request and response code statistics for each method and response code combination on given SIP adjacency in a given interval. To understand the meaning of interval please refer <Periodic Statistics> section in description of ciscoSbcStatsMIB. An exact lookup will return a row only if - 1) detailed response code statistics are turned on in SBC 2) response code messages sent or received is non zero for given SIP adjacency, method and interval. Also an inexact lookup will only return rows for messages with non-zero counts, to protect the user from large numbers of rows for response codes which have not been received or sent.') csb_sip_mthd_rc_current_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1)).setIndexNames((0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsInstanceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsServiceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCCurrentStatsAdjName'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCCurrentStatsMethod'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCCurrentStatsRespCode'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCCurrentStatsInterval')) if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsEntry.setDescription('A conceptual row in the csbSIPMthdRCCurrentStatsTable. Each entry in this table represents a method and response code combination. Each entry in this table is identified by a value of csbSIPMthdRCCurrentStatsAdjName, csbSIPMthdRCCurrentStatsMethod, csbSIPMthdRCCurrentStatsRespCode and csbSIPMthdRCCurrentStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csb_sip_mthd_rc_current_stats_adj_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 1), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsAdjName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsAdjName.setDescription('This identifies the name of the adjacency for which statistics are reported. This object acts as an index for the table.') csb_sip_mthd_rc_current_stats_method = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 2), cisco_sbc_sip_method()) if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsMethod.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsMethod.setDescription('This object indicates the SIP method request. This object acts as an index for the table.') csb_sip_mthd_rc_current_stats_resp_code = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 3), unsigned32()) if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespCode.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespCode.setDescription('This object indicates the response code for the SIP message request. The range of valid values for SIP response codes is 100 - 999. This object acts as an index for the table.') csb_sip_mthd_rc_current_stats_interval = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 4), cisco_sbc_periodic_stats_interval()) if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsInterval.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsInterval.setDescription('This object identifies the interval for which the periodic statistics information is to be displayed. The interval values can be 5 min, 15 mins, 1 hour , 1 Day. This object acts as an index for the table.') csb_sip_mthd_rc_current_stats_method_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 5), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsMethodName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsMethodName.setDescription('This object indicates the text representation of the SIP method request. E.g. INVITE, ACK, BYE etc.') csb_sip_mthd_rc_current_stats_resp_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 6), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespIn.setDescription('This object indicates the total SIP messages with this response code this method received on this SIP adjacency.') csb_sip_mthd_rc_current_stats_resp_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 5, 1, 7), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsRespOut.setDescription('This object indicates the total SIP messages with this response code for this method sent on this SIP adjacency.') csb_sip_mthd_rc_history_stats_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6)) if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsTable.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsTable.setDescription('This table reports historical data for SIP method request and response code statistics for each method and response code combination in a given past interval. The possible values of interval will be previous 5 minutes, previous 15 minutes, previous 1 hour and previous day. To understand the meaning of interval please refer <Periodic Statistics> section in description of ciscoSbcStatsMIB. An exact lookup will return a row only if - 1) detailed response code statistics are turned on in SBC 2) response code messages sent or received is non zero for given SIP adjacency, method and interval. Also an inexact lookup will only return rows for messages with non-zero counts, to protect the user from large numbers of rows for response codes which have not been received or sent.') csb_sip_mthd_rc_history_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1)).setIndexNames((0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsInstanceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB', 'csbCallStatsServiceIndex'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCHistoryStatsAdjName'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCHistoryStatsMethod'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCHistoryStatsRespCode'), (0, 'CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCHistoryStatsInterval')) if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsEntry.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsEntry.setDescription('A conceptual row in the csbSIPMthdRCHistoryStatsTable. The entries in this table are updated as interval completes in the csbSIPMthdRCCurrentStatsTable table and the data is moved from that table to this one. Each entry in this table is identified by a value of csbSIPMthdRCHistoryStatsAdjName, csbSIPMthdRCHistoryStatsMethod, csbSIPMthdRCHistoryStatsRespCode and csbSIPMthdRCHistoryStatsInterval. The other indices of this table are csbCallStatsInstanceIndex defined in csbCallStatsInstanceTable and csbCallStatsServiceIndex defined in csbCallStatsTable.') csb_sip_mthd_rc_history_stats_adj_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 1), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsAdjName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsAdjName.setDescription('This identifies the name of the adjacency for which statistics are reported. This object acts as an index for the table.') csb_sip_mthd_rc_history_stats_method = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 2), cisco_sbc_sip_method()) if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsMethod.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsMethod.setDescription('This object indicates the SIP method request. This object acts as an index for the table.') csb_sip_mthd_rc_history_stats_method_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 3), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsMethodName.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsMethodName.setDescription('This object indicates the text representation of the SIP method request. E.g. INVITE, ACK, BYE etc.') csb_sip_mthd_rc_history_stats_resp_code = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 4), unsigned32()) if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespCode.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespCode.setDescription('This object indicates the response code for the SIP message request. The range of valid values for SIP response codes is 100 - 999. This object acts as an index for the table.') csb_sip_mthd_rc_history_stats_interval = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 5), cisco_sbc_periodic_stats_interval()) if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsInterval.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsInterval.setDescription('This object identifies the interval for which the periodic statistics information is to be displayed. The interval values can be previous 5 min, previous 15 mins, previous 1 hour , previous 1 Day. This object acts as an index for the table.') csb_sip_mthd_rc_history_stats_resp_in = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 6), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespIn.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespIn.setDescription('This object indicates the total SIP messages with this response code this method received on this SIP adjacency.') csb_sip_mthd_rc_history_stats_resp_out = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 757, 1, 6, 1, 7), gauge32()).setUnits('responses').setMaxAccess('readonly') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespOut.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsRespOut.setDescription('This object indicates the total SIP messages with this response code for this method sent on this SIP adjacency.') csb_stats_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 1)) csb_stats_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2)) csb_stats_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 1, 1)).setObjects(('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsGroup'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsGroup'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsGroup'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsGroup'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCHistoryStatsGroup'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCCurrentStatsGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csb_stats_mib_compliance = csbStatsMIBCompliance.setStatus('current') if mibBuilder.loadTexts: csbStatsMIBCompliance.setDescription('This is a default module-compliance containing csbStatsMIBGroups.') csb_radius_stats_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 1)).setObjects(('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsClientName'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsClientType'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsSrvrName'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsAcsReqs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsAcsRtrns'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsAcsAccpts'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsAcsRejects'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsAcsChalls'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsActReqs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsActRetrans'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsActRsps'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsMalformedRsps'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsBadAuths'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsPending'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsTimeouts'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsUnknownType'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRadiusStatsDropped')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csb_radius_stats_group = csbRadiusStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbRadiusStatsGroup.setDescription('A collection of objects providing RADIUS messages statistics for configured RADIUS servers on Cisco Session Border Controller (SBC).') csb_rf_bill_realm_stats_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 2)).setObjects(('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsRealmName'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsTotalStartAcrs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsTotalInterimAcrs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsTotalStopAcrs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsTotalEventAcrs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsSuccStartAcrs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsSuccInterimAcrs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsSuccStopAcrs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsSuccEventAcrs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsFailStartAcrs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsFailInterimAcrs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsFailStopAcrs'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbRfBillRealmStatsFailEventAcrs')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csb_rf_bill_realm_stats_group = csbRfBillRealmStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbRfBillRealmStatsGroup.setDescription('A collection of objects providing Rf billing statistics information on Cisco Session Border Controller (SBC).') csb_sip_mthd_current_stats_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 3)).setObjects(('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsAdjName'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsMethodName'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsReqIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsReqOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp1xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp1xxOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp2xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp2xxOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp3xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp3xxOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp4xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp4xxOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp5xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp5xxOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp6xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdCurrentStatsResp6xxOut')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csb_sip_mthd_current_stats_group = csbSIPMthdCurrentStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdCurrentStatsGroup.setDescription('A collection of objects providing statistics for a SIP method and various responses count for this method on a given SIP adjacency and given interval for Cisco Session Border Controller (SBC).') csb_sip_mthd_history_stats_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 4)).setObjects(('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsAdjName'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsMethodName'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsReqIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsReqOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp1xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp1xxOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp2xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp2xxOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp3xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp3xxOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp4xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp4xxOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp5xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp5xxOut'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp6xxIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdHistoryStatsResp6xxOut')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csb_sip_mthd_history_stats_group = csbSIPMthdHistoryStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdHistoryStatsGroup.setDescription('A collection of objects providing historical statistics for a SIP method and various responses count for this method on a given SIP adjacency and given interval for Cisco Session Border Controller (SBC).') csb_sip_mthd_rc_current_stats_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 5)).setObjects(('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCCurrentStatsAdjName'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCCurrentStatsMethodName'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCCurrentStatsRespIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCCurrentStatsRespOut')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csb_sip_mthd_rc_current_stats_group = csbSIPMthdRCCurrentStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCCurrentStatsGroup.setDescription('A collection of objects providing SIP statistics for a method and response code combination for Cisco Session Border Controller (SBC).') csb_sip_mthd_rc_history_stats_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 757, 2, 2, 6)).setObjects(('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCHistoryStatsAdjName'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCHistoryStatsMethodName'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCHistoryStatsRespIn'), ('CISCO-SESS-BORDER-CTRLR-STATS-MIB', 'csbSIPMthdRCHistoryStatsRespOut')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csb_sip_mthd_rc_history_stats_group = csbSIPMthdRCHistoryStatsGroup.setStatus('current') if mibBuilder.loadTexts: csbSIPMthdRCHistoryStatsGroup.setDescription('A collection of objects providing SIP historical statistics for a method and response code combination for Cisco Session Border Controller (SBC).') mibBuilder.exportSymbols('CISCO-SESS-BORDER-CTRLR-STATS-MIB', csbSIPMthdHistoryStatsResp2xxOut=csbSIPMthdHistoryStatsResp2xxOut, csbSIPMthdRCHistoryStatsGroup=csbSIPMthdRCHistoryStatsGroup, csbRfBillRealmStatsFailStopAcrs=csbRfBillRealmStatsFailStopAcrs, csbSIPMthdCurrentStatsMethod=csbSIPMthdCurrentStatsMethod, csbSIPMthdHistoryStatsResp4xxOut=csbSIPMthdHistoryStatsResp4xxOut, csbRadiusStatsEntry=csbRadiusStatsEntry, csbRadiusStatsAcsReqs=csbRadiusStatsAcsReqs, ciscoSbcStatsMIBObjects=ciscoSbcStatsMIBObjects, csbSIPMthdHistoryStatsReqOut=csbSIPMthdHistoryStatsReqOut, csbStatsMIBCompliances=csbStatsMIBCompliances, csbRadiusStatsActReqs=csbRadiusStatsActReqs, ciscoSbcStatsMIB=ciscoSbcStatsMIB, csbSIPMthdCurrentStatsResp4xxOut=csbSIPMthdCurrentStatsResp4xxOut, csbRadiusStatsMalformedRsps=csbRadiusStatsMalformedRsps, csbSIPMthdCurrentStatsResp6xxIn=csbSIPMthdCurrentStatsResp6xxIn, csbRadiusStatsPending=csbRadiusStatsPending, csbSIPMthdHistoryStatsInterval=csbSIPMthdHistoryStatsInterval, csbSIPMthdHistoryStatsEntry=csbSIPMthdHistoryStatsEntry, csbSIPMthdCurrentStatsResp1xxIn=csbSIPMthdCurrentStatsResp1xxIn, csbSIPMthdHistoryStatsResp6xxIn=csbSIPMthdHistoryStatsResp6xxIn, csbRadiusStatsDropped=csbRadiusStatsDropped, csbSIPMthdCurrentStatsResp3xxIn=csbSIPMthdCurrentStatsResp3xxIn, csbSIPMthdRCCurrentStatsRespOut=csbSIPMthdRCCurrentStatsRespOut, csbSIPMthdHistoryStatsResp4xxIn=csbSIPMthdHistoryStatsResp4xxIn, csbSIPMthdRCCurrentStatsGroup=csbSIPMthdRCCurrentStatsGroup, CiscoSbcSIPMethod=CiscoSbcSIPMethod, csbSIPMthdRCCurrentStatsRespIn=csbSIPMthdRCCurrentStatsRespIn, csbRfBillRealmStatsTotalStopAcrs=csbRfBillRealmStatsTotalStopAcrs, csbRfBillRealmStatsGroup=csbRfBillRealmStatsGroup, csbSIPMthdCurrentStatsReqIn=csbSIPMthdCurrentStatsReqIn, csbStatsMIBCompliance=csbStatsMIBCompliance, csbRadiusStatsTable=csbRadiusStatsTable, csbSIPMthdCurrentStatsReqOut=csbSIPMthdCurrentStatsReqOut, csbRfBillRealmStatsTotalStartAcrs=csbRfBillRealmStatsTotalStartAcrs, csbRadiusStatsUnknownType=csbRadiusStatsUnknownType, csbSIPMthdCurrentStatsResp2xxOut=csbSIPMthdCurrentStatsResp2xxOut, csbRfBillRealmStatsTable=csbRfBillRealmStatsTable, csbSIPMthdRCHistoryStatsTable=csbSIPMthdRCHistoryStatsTable, csbSIPMthdCurrentStatsResp5xxOut=csbSIPMthdCurrentStatsResp5xxOut, csbSIPMthdCurrentStatsEntry=csbSIPMthdCurrentStatsEntry, csbSIPMthdRCHistoryStatsMethodName=csbSIPMthdRCHistoryStatsMethodName, csbRadiusStatsBadAuths=csbRadiusStatsBadAuths, csbRfBillRealmStatsEntry=csbRfBillRealmStatsEntry, csbSIPMthdRCHistoryStatsRespOut=csbSIPMthdRCHistoryStatsRespOut, csbSIPMthdHistoryStatsMethod=csbSIPMthdHistoryStatsMethod, csbSIPMthdHistoryStatsGroup=csbSIPMthdHistoryStatsGroup, csbRfBillRealmStatsSuccStopAcrs=csbRfBillRealmStatsSuccStopAcrs, csbSIPMthdRCCurrentStatsEntry=csbSIPMthdRCCurrentStatsEntry, csbRadiusStatsActRsps=csbRadiusStatsActRsps, csbSIPMthdCurrentStatsAdjName=csbSIPMthdCurrentStatsAdjName, csbSIPMthdRCHistoryStatsInterval=csbSIPMthdRCHistoryStatsInterval, csbRfBillRealmStatsFailInterimAcrs=csbRfBillRealmStatsFailInterimAcrs, csbRadiusStatsGroup=csbRadiusStatsGroup, csbRadiusStatsAcsChalls=csbRadiusStatsAcsChalls, csbSIPMthdRCCurrentStatsMethod=csbSIPMthdRCCurrentStatsMethod, csbSIPMthdHistoryStatsTable=csbSIPMthdHistoryStatsTable, csbSIPMthdHistoryStatsResp5xxOut=csbSIPMthdHistoryStatsResp5xxOut, csbSIPMthdRCHistoryStatsMethod=csbSIPMthdRCHistoryStatsMethod, csbStatsMIBGroups=csbStatsMIBGroups, csbRadiusStatsClientType=csbRadiusStatsClientType, csbSIPMthdCurrentStatsResp5xxIn=csbSIPMthdCurrentStatsResp5xxIn, csbSIPMthdHistoryStatsResp3xxOut=csbSIPMthdHistoryStatsResp3xxOut, csbRadiusStatsAcsRejects=csbRadiusStatsAcsRejects, csbSIPMthdCurrentStatsGroup=csbSIPMthdCurrentStatsGroup, csbSIPMthdCurrentStatsResp6xxOut=csbSIPMthdCurrentStatsResp6xxOut, csbSIPMthdRCCurrentStatsMethodName=csbSIPMthdRCCurrentStatsMethodName, csbSIPMthdHistoryStatsResp2xxIn=csbSIPMthdHistoryStatsResp2xxIn, csbRadiusStatsActRetrans=csbRadiusStatsActRetrans, csbRfBillRealmStatsIndex=csbRfBillRealmStatsIndex, csbSIPMthdHistoryStatsResp5xxIn=csbSIPMthdHistoryStatsResp5xxIn, csbRfBillRealmStatsFailStartAcrs=csbRfBillRealmStatsFailStartAcrs, csbSIPMthdHistoryStatsResp6xxOut=csbSIPMthdHistoryStatsResp6xxOut, csbSIPMthdHistoryStatsMethodName=csbSIPMthdHistoryStatsMethodName, csbRfBillRealmStatsSuccStartAcrs=csbRfBillRealmStatsSuccStartAcrs, csbSIPMthdRCHistoryStatsAdjName=csbSIPMthdRCHistoryStatsAdjName, csbRfBillRealmStatsSuccInterimAcrs=csbRfBillRealmStatsSuccInterimAcrs, csbSIPMthdRCCurrentStatsRespCode=csbSIPMthdRCCurrentStatsRespCode, csbSIPMthdCurrentStatsMethodName=csbSIPMthdCurrentStatsMethodName, csbRadiusStatsTimeouts=csbRadiusStatsTimeouts, PYSNMP_MODULE_ID=ciscoSbcStatsMIB, csbSIPMthdCurrentStatsTable=csbSIPMthdCurrentStatsTable, csbSIPMthdRCHistoryStatsRespCode=csbSIPMthdRCHistoryStatsRespCode, csbSIPMthdHistoryStatsAdjName=csbSIPMthdHistoryStatsAdjName, csbSIPMthdRCCurrentStatsInterval=csbSIPMthdRCCurrentStatsInterval, csbSIPMthdCurrentStatsResp2xxIn=csbSIPMthdCurrentStatsResp2xxIn, csbRfBillRealmStatsTotalEventAcrs=csbRfBillRealmStatsTotalEventAcrs, csbSIPMthdCurrentStatsResp1xxOut=csbSIPMthdCurrentStatsResp1xxOut, csbRadiusStatsClientName=csbRadiusStatsClientName, ciscoSbcStatsMIBConform=ciscoSbcStatsMIBConform, csbSIPMthdCurrentStatsResp3xxOut=csbSIPMthdCurrentStatsResp3xxOut, csbRadiusStatsSrvrName=csbRadiusStatsSrvrName, ciscoSbcStatsMIBNotifs=ciscoSbcStatsMIBNotifs, csbRfBillRealmStatsFailEventAcrs=csbRfBillRealmStatsFailEventAcrs, csbSIPMthdRCHistoryStatsRespIn=csbSIPMthdRCHistoryStatsRespIn, csbSIPMthdHistoryStatsResp3xxIn=csbSIPMthdHistoryStatsResp3xxIn, csbSIPMthdRCHistoryStatsEntry=csbSIPMthdRCHistoryStatsEntry, csbSIPMthdRCCurrentStatsAdjName=csbSIPMthdRCCurrentStatsAdjName, csbRfBillRealmStatsTotalInterimAcrs=csbRfBillRealmStatsTotalInterimAcrs, csbSIPMthdCurrentStatsResp4xxIn=csbSIPMthdCurrentStatsResp4xxIn, csbSIPMthdHistoryStatsResp1xxOut=csbSIPMthdHistoryStatsResp1xxOut, csbRfBillRealmStatsRealmName=csbRfBillRealmStatsRealmName, csbRadiusStatsEntIndex=csbRadiusStatsEntIndex, csbRadiusStatsAcsRtrns=csbRadiusStatsAcsRtrns, csbRadiusStatsAcsAccpts=csbRadiusStatsAcsAccpts, csbRfBillRealmStatsSuccEventAcrs=csbRfBillRealmStatsSuccEventAcrs, csbSIPMthdCurrentStatsInterval=csbSIPMthdCurrentStatsInterval, csbSIPMthdRCCurrentStatsTable=csbSIPMthdRCCurrentStatsTable, CiscoSbcRadiusClientType=CiscoSbcRadiusClientType, csbSIPMthdHistoryStatsReqIn=csbSIPMthdHistoryStatsReqIn, csbSIPMthdHistoryStatsResp1xxIn=csbSIPMthdHistoryStatsResp1xxIn)
def print_formatted(number): s=len(bin(number)[2:]) for i in range(1,number+1): print(repr(i).rjust(s),oct(i)[2:].rjust(s+1),hex(i)[2:].upper().rjust(s+1),bin(i)[2:].rjust(s+1)) # your code goes here if __name__ == '__main__': print_formatted(17)
def print_formatted(number): s = len(bin(number)[2:]) for i in range(1, number + 1): print(repr(i).rjust(s), oct(i)[2:].rjust(s + 1), hex(i)[2:].upper().rjust(s + 1), bin(i)[2:].rjust(s + 1)) if __name__ == '__main__': print_formatted(17)
# -*- coding: utf-8 -*- """ A sample of kay settings. :Copyright: (c) 2009 Accense Technology, Inc. Takashi Matsuo <tmatsuo@candit.jp>, All rights reserved. :license: BSD, see LICENSE for more details. """ DEFAULT_TIMEZONE = 'Asia/Kuala_Lumpur' DEBUG = True PROFILE = False SECRET_KEY = 'MySecretIsSafeWithNoOne123' SESSION_PREFIX = 'gaesess:' COOKIE_AGE = 1209600 # 2 weeks COOKIE_NAME = 'KAY_SESSION' ADD_APP_PREFIX_TO_KIND = True ADMINS = ( ) TEMPLATE_DIRS = ( ) USE_I18N = True DEFAULT_LANG = 'en' FORMS_USE_XHTML = True INSTALLED_APPS = ( 'kay.auth', 'blog', 'piggybank', 'weatherbug', ) APP_MOUNT_POINTS = { 'blog': '/', } CONTEXT_PROCESSORS = ( 'kay.context_processors.request', 'kay.context_processors.url_functions', 'kay.context_processors.media_url', ) JINJA2_FILTERS = { 'nl2br': 'kay.utils.filters.nl2br', 'date': 'blog.utils.datetimeformat', } MIDDLEWARE_CLASSES = ( 'kay.auth.middleware.AuthenticationMiddleware', ) AUTH_USER_BACKEND = 'kay.auth.backends.googleaccount.GoogleBackend' AUTH_USER_MODEL = 'kay.auth.models.GoogleUser'
""" A sample of kay settings. :Copyright: (c) 2009 Accense Technology, Inc. Takashi Matsuo <tmatsuo@candit.jp>, All rights reserved. :license: BSD, see LICENSE for more details. """ default_timezone = 'Asia/Kuala_Lumpur' debug = True profile = False secret_key = 'MySecretIsSafeWithNoOne123' session_prefix = 'gaesess:' cookie_age = 1209600 cookie_name = 'KAY_SESSION' add_app_prefix_to_kind = True admins = () template_dirs = () use_i18_n = True default_lang = 'en' forms_use_xhtml = True installed_apps = ('kay.auth', 'blog', 'piggybank', 'weatherbug') app_mount_points = {'blog': '/'} context_processors = ('kay.context_processors.request', 'kay.context_processors.url_functions', 'kay.context_processors.media_url') jinja2_filters = {'nl2br': 'kay.utils.filters.nl2br', 'date': 'blog.utils.datetimeformat'} middleware_classes = ('kay.auth.middleware.AuthenticationMiddleware',) auth_user_backend = 'kay.auth.backends.googleaccount.GoogleBackend' auth_user_model = 'kay.auth.models.GoogleUser'
def cycle(arg, all_ids=None): if all_ids is None: all_ids = set() arg_id = id(arg) if arg_id not in all_ids: all_ids.add(arg_id) if isinstance(arg, list): for a in arg: for b in cycle(a, all_ids): yield b elif isinstance(arg, dict): for k, v in sorted(arg.iteritems()): for c in cycle(v, all_ids): yield c else: yield arg
def cycle(arg, all_ids=None): if all_ids is None: all_ids = set() arg_id = id(arg) if arg_id not in all_ids: all_ids.add(arg_id) if isinstance(arg, list): for a in arg: for b in cycle(a, all_ids): yield b elif isinstance(arg, dict): for (k, v) in sorted(arg.iteritems()): for c in cycle(v, all_ids): yield c else: yield arg
menor = 0 maior = 0 for c in range(1, 5): pes = int(input('Em Que Ano a \033[35m{}\033[m Pessoa Nasceu?'.format(c))) if pes >= 1999: menor = menor + 1 else: maior = maior + 1 print('A \033[35m {}\033[m menor de idade e \033[36m{}\033[m maior de idade'.format(menor, maior))
menor = 0 maior = 0 for c in range(1, 5): pes = int(input('Em Que Ano a \x1b[35m{}\x1b[m Pessoa Nasceu?'.format(c))) if pes >= 1999: menor = menor + 1 else: maior = maior + 1 print('A \x1b[35m {}\x1b[m menor de idade e \x1b[36m{}\x1b[m maior de idade'.format(menor, maior))
def is_integral(n): return int(n) == n LOCALES = { "af": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d %-I:%M:%S %p", "datetime_short": "%Y-%m-%-d %-I:%M %p", "decimal_point": ",", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Afrikaans", "native_name": "Afrikaans", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "am": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Amharic", "native_name": "\u12a0\u121b\u122d\u129b", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ar": { "format": { "date": "%-d\u200f/%m\u200f/%Y", "datetime": "%-d\u200f/%m\u200f/%Y %-I:%M:%S %p", "datetime_short": "%-d\u200f/%m\u200f/%Y %-I:%M %p", "decimal_point": "\u066b", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Arabic", "native_name": "\u0627\u0644\u0639\u0631\u0628\u064a\u0629", "number_rule": lambda n: 'p' if not is_integral(n) else ('z' if n == 0 else '' if n == 1 else 't' if n == 2 else 'w' if n % 100 >= 3 and n % 100 <= 10 else 'y' if n % 100 >= 11 else 'p') }, "az": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Azeri", "native_name": "az\u0259rbaycan", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "bg": { "format": { "date": "%-d.%m.%Y '\u0433'.", "datetime": "%-d.%m.%Y '\u0433'., %-H:%M:%S", "datetime_short": "%-d.%m.%Y '\u0433'., %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Bulgarian", "native_name": "\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "bn": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Bengali", "native_name": "\u09ac\u09be\u0982\u09b2\u09be", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "bs": { "format": { "date": "%-d.%m.%Y.", "datetime": "%-d.%m.%Y. %-H:%M:%S", "datetime_short": "%-d.%m.%Y. %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Bosnian", "native_name": "bosanski", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "ca": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Catalan", "native_name": "catal\u00e0", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "cs": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Czech", "native_name": "\u010de\u0161tina", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if (n == 1) else 'w' if (n >= 2 and n <= 4) else 'p') }, "cy": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Welsh", "native_name": "Cymraeg", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if (n == 1) else 't' if (n == 2) else 'p' if (n != 8 and n != 11) else 'y') }, "da": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H.%M.%S", "datetime_short": "%-d/%m/%Y %-H.%M", "decimal_point": ",", "time": "%-H.%M.%S", "time_short": "%-H.%M" }, "name": "Danish", "native_name": "dansk", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "de": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "German", "native_name": "Deutsch", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "dz": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d \u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b%-I:%M:%S %p", "datetime_short": "%Y-%m-%-d \u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b %-I \u0f66\u0f90\u0f62\u0f0b\u0f58\u0f0b %M %p", "decimal_point": ".", "time": "\u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b%-I:%M:%S %p", "time_short": "\u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b %-I \u0f66\u0f90\u0f62\u0f0b\u0f58\u0f0b %M %p" }, "name": "Dzongkha", "native_name": "\u0f62\u0fab\u0f7c\u0f44\u0f0b\u0f41", "number_rule": lambda n: '' }, "el": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y, %-I:%M %p", "decimal_point": ",", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Greek", "native_name": "\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "en": { "format": { "date": "%Y-%-m-%-d", "datetime": "%Y-%-m-%-d, %-I:%M:%S %p", "datetime_short": "%Y-%-m-%-d, %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "English", "native_name": "English", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "en-US": { "format": { "date": "%-m/%-d/%Y", "datetime": "%-m/%-d/%Y, %-I:%M:%S %p", "datetime_short": "%-m/%-d/%Y, %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "English", "native_name": "English", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "es": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Spanish", "native_name": "espa\u00f1ol", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "et": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M.%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M.%S", "time_short": "%-H:%M" }, "name": "Estonian", "native_name": "eesti", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "eu": { "format": { "date": "%Y/%m/%-d", "datetime": "%Y/%m/%-d %-H:%M:%S", "datetime_short": "%Y/%m/%-d %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Basque", "native_name": "euskara", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "fa": { "format": { "date": "%Y/%m/%-d", "datetime": "%Y/%m/%-d\u060c\u200f %-H:%M:%S", "datetime_short": "%Y/%m/%-d\u060c\u200f %-H:%M", "decimal_point": "\u066b", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Persian", "native_name": "\u0641\u0627\u0631\u0633\u06cc", "number_rule": lambda n: '' }, "fi": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H.%M.%S", "datetime_short": "%-d.%m.%Y %-H.%M", "decimal_point": ",", "time": "%-H.%M.%S", "time_short": "%-H.%M" }, "name": "Finnish", "native_name": "suomi", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "fo": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y %-H:%M:%S", "datetime_short": "%-d-%m-%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Faroese", "native_name": "f\u00f8royskt", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "fr": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "French", "native_name": "fran\u00e7ais", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "fy": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y %-H:%M:%S", "datetime_short": "%-d-%m-%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Western Frisian", "native_name": "West-Frysk", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ga": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Irish", "native_name": "Gaeilge", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 't' if n == 2 else 't' if (n > 2 and n < 7) else 'y' if (n > 6 and n < 11) else 'p') }, "gd": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Scottish Gaelic", "native_name": "G\u00e0idhlig", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if (n == 1 or n == 11) else 't' if (n == 2 or n == 12) else 'w' if (n > 2 and n < 20) else 'p') }, "gl": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Galician", "native_name": "galego", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "gu": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Gujarati", "native_name": "\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "he": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Hebrew", "native_name": "\u05e2\u05d1\u05e8\u05d9\u05ea", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "hi": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y, %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Hindi", "native_name": "\u0939\u093f\u0928\u094d\u0926\u0940", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "hr": { "format": { "date": "%-d.%m.%Y.", "datetime": "%-d.%m.%Y. %-H:%M:%S", "datetime_short": "%-d.%m.%Y. %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Croatian", "native_name": "hrvatski", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "hu": { "format": { "date": "%Y. %m. %-d.", "datetime": "%Y. %m. %-d. %-H:%M:%S", "datetime_short": "%Y. %m. %-d. %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Hungarian", "native_name": "magyar", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "hy": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Armenian", "native_name": "\u0570\u0561\u0575\u0565\u0580\u0565\u0576", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "id": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H.%M.%S", "datetime_short": "%-d/%m/%Y %-H.%M", "decimal_point": ",", "time": "%-H.%M.%S", "time_short": "%-H.%M" }, "name": "Indonesian", "native_name": "Bahasa Indonesia", "number_rule": lambda n: '' }, "is": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Icelandic", "native_name": "\u00edslenska", "number_rule": lambda n: 'p' if not is_integral(n) else ('p' if (n % 10 != 1 or n % 100 == 11) else '') }, "it": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-H:%M:%S", "datetime_short": "%-d/%m/%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Italian", "native_name": "italiano", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ja": { "format": { "date": "%Y/%m/%-d", "datetime": "%Y/%m/%-d %-H:%M:%S", "datetime_short": "%Y/%m/%-d %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Japanese", "native_name": "\u65e5\u672c\u8a9e", "number_rule": lambda n: '' }, "ka": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Georgian", "native_name": "\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8", "number_rule": lambda n: '' }, "kk": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Kazakh", "native_name": "\u049b\u0430\u0437\u0430\u049b \u0442\u0456\u043b\u0456", "number_rule": lambda n: '' }, "kl": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d %-I:%M:%S %p", "datetime_short": "%Y-%m-%-d %-I:%M %p", "decimal_point": ",", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Kalaallisut", "native_name": "kalaallisut", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "km": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y, %-I:%M %p", "decimal_point": ",", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Khmer", "native_name": "\u1781\u17d2\u1798\u17c2\u179a", "number_rule": lambda n: '' }, "kn": { "format": { "date": "%-m/%-d/%Y", "datetime": "%-m/%-d/%Y %-I:%M:%S %p", "datetime_short": "%-m/%-d/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Kannada", "native_name": "\u0c95\u0ca8\u0ccd\u0ca8\u0ca1", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ko": { "format": { "date": "%Y. %m. %-d.", "datetime": "%Y. %m. %-d. %p %-I:%M:%S", "datetime_short": "%Y. %m. %-d. %p %-I:%M", "decimal_point": ".", "time": "%p %-I:%M:%S", "time_short": "%p %-I:%M" }, "name": "Korean", "native_name": "\ud55c\uad6d\uc5b4", "number_rule": lambda n: '' }, "ks": { "format": { "date": "%-m/%-d/%Y", "datetime": "%-m/%-d/%Y %-I:%M:%S %p", "datetime_short": "%-m/%-d/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Kashmiri", "native_name": "\u06a9\u0672\u0634\u064f\u0631", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ky": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Kirghiz", "native_name": "\u043a\u044b\u0440\u0433\u044b\u0437\u0447\u0430", "number_rule": lambda n: '' }, "lb": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Luxembourgish", "native_name": "L\u00ebtzebuergesch", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "lo": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-H:%M:%S", "datetime_short": "%-d/%m/%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Lao", "native_name": "\u0ea5\u0eb2\u0ea7", "number_rule": lambda n: '' }, "lt": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d %-H:%M:%S", "datetime_short": "%Y-%m-%-d %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Lithuanian", "native_name": "lietuvi\u0173", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "lv": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Latvian", "native_name": "latvie\u0161u", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'p' if n != 0 else 'z') }, "mk": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Macedonian", "native_name": "\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ml": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Malayalam", "native_name": "\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "mn": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d, %-H:%M:%S", "datetime_short": "%Y-%m-%-d, %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Mongolian", "native_name": "\u043c\u043e\u043d\u0433\u043e\u043b", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "mr": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y, %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Marathi", "native_name": "\u092e\u0930\u093e\u0920\u0940", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ms": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Malay", "native_name": "Bahasa Melayu", "number_rule": lambda n: '' }, "my": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y %-H:%M:%S", "datetime_short": "%-d-%m-%Y %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Burmese", "native_name": "\u1017\u1019\u102c", "number_rule": lambda n: '' }, "nb": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H.%M.%S", "datetime_short": "%-d.%m.%Y, %-H.%M", "decimal_point": ",", "time": "%-H.%M.%S", "time_short": "%-H.%M" }, "name": "Norwegian Bokm\u00e5l", "native_name": "norsk bokm\u00e5l", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ne": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d, %-H:%M:%S", "datetime_short": "%Y-%m-%-d, %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Nepali", "native_name": "\u0928\u0947\u092a\u093e\u0932\u0940", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "nl": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y %-H:%M:%S", "datetime_short": "%-d-%m-%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Dutch", "native_name": "Nederlands", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "nn": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Norwegian Nynorsk", "native_name": "nynorsk", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "os": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Ossetic", "native_name": "\u0438\u0440\u043e\u043d", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "pa": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y, %-I:%M %p", "decimal_point": "\u066b", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Punjabi", "native_name": "\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "pl": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Polish", "native_name": "polski", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "pt": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Portuguese", "native_name": "portugu\u00eas", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ro": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Romanian", "native_name": "rom\u00e2n\u0103", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'w' if (n == 0 or (n % 100 > 0 and n % 100 < 20)) else 'p') }, "ru": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Russian", "native_name": "\u0440\u0443\u0441\u0441\u043a\u0438\u0439", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "si": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d %p %-I.%M.%S", "datetime_short": "%Y-%m-%-d %p %-I.%M", "decimal_point": ".", "time": "%p %-I.%M.%S", "time_short": "%p %-I.%M" }, "name": "Sinhala", "native_name": "\u0dc3\u0dd2\u0d82\u0dc4\u0dbd", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "sk": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Slovak", "native_name": "sloven\u010dina", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if (n == 1) else 'w' if (n >= 2 and n <= 4) else 'p') }, "sl": { "format": { "date": "%-d. %m. %Y", "datetime": "%-d. %m. %Y %-H:%M:%S", "datetime_short": "%-d. %m. %Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Slovenian", "native_name": "sloven\u0161\u010dina", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 100 == 1 else 't' if n % 100 == 2 else 'w' if n % 100 == 3 or n % 100 == 4 else 'p') }, "sq": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Albanian", "native_name": "shqip", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "sr": { "format": { "date": "%-d.%m.%Y.", "datetime": "%-d.%m.%Y. %-H.%M.%S", "datetime_short": "%-d.%m.%Y. %-H.%M", "decimal_point": ",", "time": "%-H.%M.%S", "time_short": "%-H.%M" }, "name": "Serbian", "native_name": "\u0441\u0440\u043f\u0441\u043a\u0438", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "sv": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d %-H:%M:%S", "datetime_short": "%Y-%m-%-d %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Swedish", "native_name": "svenska", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "sw": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Swahili", "native_name": "Kiswahili", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ta": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y, %-I:%M:%S %p", "datetime_short": "%-d-%m-%Y, %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Tamil", "native_name": "\u0ba4\u0bae\u0bbf\u0bb4\u0bcd", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "te": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y %-I:%M:%S %p", "datetime_short": "%-d-%m-%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Telugu", "native_name": "\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "th": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Thai", "native_name": "\u0e44\u0e17\u0e22", "number_rule": lambda n: '' }, "to": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Tongan", "native_name": "lea fakatonga", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "tr": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Turkish", "native_name": "T\u00fcrk\u00e7e", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ug": { "format": { "date": "%-m/%-d/%Y", "datetime": "%-m/%-d/%Y\u060c %-I:%M:%S %p", "datetime_short": "%-m/%-d/%Y\u060c %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Uighur", "native_name": "\u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u06d5", "number_rule": lambda n: '' }, "uk": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Ukrainian", "native_name": "\u0443\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "ur": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Urdu", "native_name": "\u0627\u0631\u062f\u0648", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "uz": { "format": { "date": "%Y/%m/%-d", "datetime": "%Y/%m/%-d %-H:%M:%S", "datetime_short": "%Y/%m/%-d %-H:%M", "decimal_point": "\u066b", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Uzbek", "native_name": "o\u02bbzbekcha", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "vi": { "format": { "date": "%-d/%m/%Y", "datetime": "%-H:%M:%S %-d/%m/%Y", "datetime_short": "%-H:%M %-d/%m/%Y", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Vietnamese", "native_name": "Ti\u1ebfng Vi\u1ec7t", "number_rule": lambda n: '' }, "yi": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-H:%M:%S", "datetime_short": "%-d/%m/%Y, %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Yiddish", "native_name": "\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "zh": { "format": { "date": "%Y/%m/%-d", "datetime": "%Y/%m/%-d %p%-I:%M:%S", "datetime_short": "%Y/%m/%-d %p%-I:%M", "decimal_point": ".", "time": "%p%-I:%M:%S", "time_short": "%p%-I:%M" }, "name": "Chinese", "native_name": "\u4e2d\u6587", "number_rule": lambda n: '' }, "zu": { "format": { "date": "%-m/%-d/%Y", "datetime": "%-m/%-d/%Y %-I:%M:%S %p", "datetime_short": "%-m/%-d/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Zulu", "native_name": "isiZulu", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') } }
def is_integral(n): return int(n) == n locales = {'af': {'format': {'date': '%Y-%m-%-d', 'datetime': '%Y-%m-%-d %-I:%M:%S %p', 'datetime_short': '%Y-%m-%-d %-I:%M %p', 'decimal_point': ',', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Afrikaans', 'native_name': 'Afrikaans', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'am': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Amharic', 'native_name': 'አማርኛ', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'ar': {'format': {'date': '%-d\u200f/%m\u200f/%Y', 'datetime': '%-d\u200f/%m\u200f/%Y %-I:%M:%S %p', 'datetime_short': '%-d\u200f/%m\u200f/%Y %-I:%M %p', 'decimal_point': '٫', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Arabic', 'native_name': 'العربية', 'number_rule': lambda n: 'p' if not is_integral(n) else 'z' if n == 0 else '' if n == 1 else 't' if n == 2 else 'w' if n % 100 >= 3 and n % 100 <= 10 else 'y' if n % 100 >= 11 else 'p'}, 'az': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y %-H:%M:%S', 'datetime_short': '%-d.%m.%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Azeri', 'native_name': 'azərbaycan', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'bg': {'format': {'date': "%-d.%m.%Y 'г'.", 'datetime': "%-d.%m.%Y 'г'., %-H:%M:%S", 'datetime_short': "%-d.%m.%Y 'г'., %-H:%M", 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Bulgarian', 'native_name': 'български', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'bn': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Bengali', 'native_name': 'বাংলা', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'bs': {'format': {'date': '%-d.%m.%Y.', 'datetime': '%-d.%m.%Y. %-H:%M:%S', 'datetime_short': '%-d.%m.%Y. %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Bosnian', 'native_name': 'bosanski', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p'}, 'ca': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H:%M:%S', 'datetime_short': '%-d/%m/%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Catalan', 'native_name': 'català', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'cs': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y %-H:%M:%S', 'datetime_short': '%-d.%m.%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Czech', 'native_name': 'čeština', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'w' if n >= 2 and n <= 4 else 'p'}, 'cy': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H:%M:%S', 'datetime_short': '%-d/%m/%Y %-H:%M', 'decimal_point': '.', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Welsh', 'native_name': 'Cymraeg', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 't' if n == 2 else 'p' if n != 8 and n != 11 else 'y'}, 'da': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H.%M.%S', 'datetime_short': '%-d/%m/%Y %-H.%M', 'decimal_point': ',', 'time': '%-H.%M.%S', 'time_short': '%-H.%M'}, 'name': 'Danish', 'native_name': 'dansk', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'de': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H:%M:%S', 'datetime_short': '%-d.%m.%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'German', 'native_name': 'Deutsch', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'dz': {'format': {'date': '%Y-%m-%-d', 'datetime': '%Y-%m-%-d ཆུ་ཚོད་%-I:%M:%S %p', 'datetime_short': '%Y-%m-%-d ཆུ་ཚོད་ %-I སྐར་མ་ %M %p', 'decimal_point': '.', 'time': 'ཆུ་ཚོད་%-I:%M:%S %p', 'time_short': 'ཆུ་ཚོད་ %-I སྐར་མ་ %M %p'}, 'name': 'Dzongkha', 'native_name': 'རྫོང་ཁ', 'number_rule': lambda n: ''}, 'el': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y, %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y, %-I:%M %p', 'decimal_point': ',', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Greek', 'native_name': 'Ελληνικά', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'en': {'format': {'date': '%Y-%-m-%-d', 'datetime': '%Y-%-m-%-d, %-I:%M:%S %p', 'datetime_short': '%Y-%-m-%-d, %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'English', 'native_name': 'English', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'en-US': {'format': {'date': '%-m/%-d/%Y', 'datetime': '%-m/%-d/%Y, %-I:%M:%S %p', 'datetime_short': '%-m/%-d/%Y, %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'English', 'native_name': 'English', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'es': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H:%M:%S', 'datetime_short': '%-d/%m/%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Spanish', 'native_name': 'español', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'et': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y %-H:%M.%S', 'datetime_short': '%-d.%m.%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M.%S', 'time_short': '%-H:%M'}, 'name': 'Estonian', 'native_name': 'eesti', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'eu': {'format': {'date': '%Y/%m/%-d', 'datetime': '%Y/%m/%-d %-H:%M:%S', 'datetime_short': '%Y/%m/%-d %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Basque', 'native_name': 'euskara', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'fa': {'format': {'date': '%Y/%m/%-d', 'datetime': '%Y/%m/%-d،\u200f %-H:%M:%S', 'datetime_short': '%Y/%m/%-d،\u200f %-H:%M', 'decimal_point': '٫', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Persian', 'native_name': 'فارسی', 'number_rule': lambda n: ''}, 'fi': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y %-H.%M.%S', 'datetime_short': '%-d.%m.%Y %-H.%M', 'decimal_point': ',', 'time': '%-H.%M.%S', 'time_short': '%-H.%M'}, 'name': 'Finnish', 'native_name': 'suomi', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'fo': {'format': {'date': '%-d-%m-%Y', 'datetime': '%-d-%m-%Y %-H:%M:%S', 'datetime_short': '%-d-%m-%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Faroese', 'native_name': 'føroyskt', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'fr': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H:%M:%S', 'datetime_short': '%-d/%m/%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'French', 'native_name': 'français', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'fy': {'format': {'date': '%-d-%m-%Y', 'datetime': '%-d-%m-%Y %-H:%M:%S', 'datetime_short': '%-d-%m-%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Western Frisian', 'native_name': 'West-Frysk', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'ga': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H:%M:%S', 'datetime_short': '%-d/%m/%Y %-H:%M', 'decimal_point': '.', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Irish', 'native_name': 'Gaeilge', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 't' if n == 2 else 't' if n > 2 and n < 7 else 'y' if n > 6 and n < 11 else 'p'}, 'gd': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H:%M:%S', 'datetime_short': '%-d/%m/%Y %-H:%M', 'decimal_point': '.', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Scottish Gaelic', 'native_name': 'Gàidhlig', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 or n == 11 else 't' if n == 2 or n == 12 else 'w' if n > 2 and n < 20 else 'p'}, 'gl': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H:%M:%S', 'datetime_short': '%-d/%m/%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Galician', 'native_name': 'galego', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'gu': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Gujarati', 'native_name': 'ગુજરાતી', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'he': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H:%M:%S', 'datetime_short': '%-d.%m.%Y, %-H:%M', 'decimal_point': '.', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Hebrew', 'native_name': 'עברית', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'hi': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y, %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y, %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Hindi', 'native_name': 'हिन्दी', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'hr': {'format': {'date': '%-d.%m.%Y.', 'datetime': '%-d.%m.%Y. %-H:%M:%S', 'datetime_short': '%-d.%m.%Y. %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Croatian', 'native_name': 'hrvatski', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p'}, 'hu': {'format': {'date': '%Y. %m. %-d.', 'datetime': '%Y. %m. %-d. %-H:%M:%S', 'datetime_short': '%Y. %m. %-d. %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Hungarian', 'native_name': 'magyar', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'hy': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H:%M:%S', 'datetime_short': '%-d.%m.%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Armenian', 'native_name': 'հայերեն', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'id': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H.%M.%S', 'datetime_short': '%-d/%m/%Y %-H.%M', 'decimal_point': ',', 'time': '%-H.%M.%S', 'time_short': '%-H.%M'}, 'name': 'Indonesian', 'native_name': 'Bahasa Indonesia', 'number_rule': lambda n: ''}, 'is': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H:%M:%S', 'datetime_short': '%-d.%m.%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Icelandic', 'native_name': 'íslenska', 'number_rule': lambda n: 'p' if not is_integral(n) else 'p' if n % 10 != 1 or n % 100 == 11 else ''}, 'it': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y, %-H:%M:%S', 'datetime_short': '%-d/%m/%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Italian', 'native_name': 'italiano', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'ja': {'format': {'date': '%Y/%m/%-d', 'datetime': '%Y/%m/%-d %-H:%M:%S', 'datetime_short': '%Y/%m/%-d %-H:%M', 'decimal_point': '.', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Japanese', 'native_name': '日本語', 'number_rule': lambda n: ''}, 'ka': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H:%M:%S', 'datetime_short': '%-d.%m.%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Georgian', 'native_name': 'ქართული', 'number_rule': lambda n: ''}, 'kk': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H:%M:%S', 'datetime_short': '%-d/%m/%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Kazakh', 'native_name': 'қазақ тілі', 'number_rule': lambda n: ''}, 'kl': {'format': {'date': '%Y-%m-%-d', 'datetime': '%Y-%m-%-d %-I:%M:%S %p', 'datetime_short': '%Y-%m-%-d %-I:%M %p', 'decimal_point': ',', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Kalaallisut', 'native_name': 'kalaallisut', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'km': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y, %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y, %-I:%M %p', 'decimal_point': ',', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Khmer', 'native_name': 'ខ្មែរ', 'number_rule': lambda n: ''}, 'kn': {'format': {'date': '%-m/%-d/%Y', 'datetime': '%-m/%-d/%Y %-I:%M:%S %p', 'datetime_short': '%-m/%-d/%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Kannada', 'native_name': 'ಕನ್ನಡ', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'ko': {'format': {'date': '%Y. %m. %-d.', 'datetime': '%Y. %m. %-d. %p %-I:%M:%S', 'datetime_short': '%Y. %m. %-d. %p %-I:%M', 'decimal_point': '.', 'time': '%p %-I:%M:%S', 'time_short': '%p %-I:%M'}, 'name': 'Korean', 'native_name': '한국어', 'number_rule': lambda n: ''}, 'ks': {'format': {'date': '%-m/%-d/%Y', 'datetime': '%-m/%-d/%Y %-I:%M:%S %p', 'datetime_short': '%-m/%-d/%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Kashmiri', 'native_name': 'کٲشُر', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'ky': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y %-H:%M:%S', 'datetime_short': '%-d.%m.%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Kirghiz', 'native_name': 'кыргызча', 'number_rule': lambda n: ''}, 'lb': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y %-H:%M:%S', 'datetime_short': '%-d.%m.%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Luxembourgish', 'native_name': 'Lëtzebuergesch', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'lo': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y, %-H:%M:%S', 'datetime_short': '%-d/%m/%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Lao', 'native_name': 'ລາວ', 'number_rule': lambda n: ''}, 'lt': {'format': {'date': '%Y-%m-%-d', 'datetime': '%Y-%m-%-d %-H:%M:%S', 'datetime_short': '%Y-%m-%-d %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Lithuanian', 'native_name': 'lietuvių', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and (n % 100 < 10 or n % 100 >= 20) else 'p'}, 'lv': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y %-H:%M:%S', 'datetime_short': '%-d.%m.%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Latvian', 'native_name': 'latviešu', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n % 10 == 1 and n % 100 != 11 else 'p' if n != 0 else 'z'}, 'mk': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y %-H:%M:%S', 'datetime_short': '%-d.%m.%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Macedonian', 'native_name': 'македонски', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'ml': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Malayalam', 'native_name': 'മലയാളം', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'mn': {'format': {'date': '%Y-%m-%-d', 'datetime': '%Y-%m-%-d, %-H:%M:%S', 'datetime_short': '%Y-%m-%-d, %-H:%M', 'decimal_point': '.', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Mongolian', 'native_name': 'монгол', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'mr': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y, %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y, %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Marathi', 'native_name': 'मराठी', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'ms': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Malay', 'native_name': 'Bahasa Melayu', 'number_rule': lambda n: ''}, 'my': {'format': {'date': '%-d-%m-%Y', 'datetime': '%-d-%m-%Y %-H:%M:%S', 'datetime_short': '%-d-%m-%Y %-H:%M', 'decimal_point': '.', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Burmese', 'native_name': 'ဗမာ', 'number_rule': lambda n: ''}, 'nb': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H.%M.%S', 'datetime_short': '%-d.%m.%Y, %-H.%M', 'decimal_point': ',', 'time': '%-H.%M.%S', 'time_short': '%-H.%M'}, 'name': 'Norwegian Bokmål', 'native_name': 'norsk bokmål', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'ne': {'format': {'date': '%Y-%m-%-d', 'datetime': '%Y-%m-%-d, %-H:%M:%S', 'datetime_short': '%Y-%m-%-d, %-H:%M', 'decimal_point': '.', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Nepali', 'native_name': 'नेपाली', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'nl': {'format': {'date': '%-d-%m-%Y', 'datetime': '%-d-%m-%Y %-H:%M:%S', 'datetime_short': '%-d-%m-%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Dutch', 'native_name': 'Nederlands', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'nn': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H:%M:%S', 'datetime_short': '%-d.%m.%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Norwegian Nynorsk', 'native_name': 'nynorsk', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'os': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H:%M:%S', 'datetime_short': '%-d.%m.%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Ossetic', 'native_name': 'ирон', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'pa': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y, %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y, %-I:%M %p', 'decimal_point': '٫', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Punjabi', 'native_name': 'ਪੰਜਾਬੀ', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'pl': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H:%M:%S', 'datetime_short': '%-d.%m.%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Polish', 'native_name': 'polski', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p'}, 'pt': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H:%M:%S', 'datetime_short': '%-d/%m/%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Portuguese', 'native_name': 'português', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'ro': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H:%M:%S', 'datetime_short': '%-d.%m.%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Romanian', 'native_name': 'română', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'w' if n == 0 or (n % 100 > 0 and n % 100 < 20) else 'p'}, 'ru': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H:%M:%S', 'datetime_short': '%-d.%m.%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Russian', 'native_name': 'русский', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p'}, 'si': {'format': {'date': '%Y-%m-%-d', 'datetime': '%Y-%m-%-d %p %-I.%M.%S', 'datetime_short': '%Y-%m-%-d %p %-I.%M', 'decimal_point': '.', 'time': '%p %-I.%M.%S', 'time_short': '%p %-I.%M'}, 'name': 'Sinhala', 'native_name': 'සිංහල', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'sk': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y %-H:%M:%S', 'datetime_short': '%-d.%m.%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Slovak', 'native_name': 'slovenčina', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'w' if n >= 2 and n <= 4 else 'p'}, 'sl': {'format': {'date': '%-d. %m. %Y', 'datetime': '%-d. %m. %Y %-H:%M:%S', 'datetime_short': '%-d. %m. %Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Slovenian', 'native_name': 'slovenščina', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n % 100 == 1 else 't' if n % 100 == 2 else 'w' if n % 100 == 3 or n % 100 == 4 else 'p'}, 'sq': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y, %-H:%M:%S', 'datetime_short': '%-d.%m.%Y, %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Albanian', 'native_name': 'shqip', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'sr': {'format': {'date': '%-d.%m.%Y.', 'datetime': '%-d.%m.%Y. %-H.%M.%S', 'datetime_short': '%-d.%m.%Y. %-H.%M', 'decimal_point': ',', 'time': '%-H.%M.%S', 'time_short': '%-H.%M'}, 'name': 'Serbian', 'native_name': 'српски', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p'}, 'sv': {'format': {'date': '%Y-%m-%-d', 'datetime': '%Y-%m-%-d %-H:%M:%S', 'datetime_short': '%Y-%m-%-d %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Swedish', 'native_name': 'svenska', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'sw': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Swahili', 'native_name': 'Kiswahili', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'ta': {'format': {'date': '%-d-%m-%Y', 'datetime': '%-d-%m-%Y, %-I:%M:%S %p', 'datetime_short': '%-d-%m-%Y, %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Tamil', 'native_name': 'தமிழ்', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'te': {'format': {'date': '%-d-%m-%Y', 'datetime': '%-d-%m-%Y %-I:%M:%S %p', 'datetime_short': '%-d-%m-%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Telugu', 'native_name': 'తెలుగు', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'th': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-H:%M:%S', 'datetime_short': '%-d/%m/%Y %-H:%M', 'decimal_point': '.', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Thai', 'native_name': 'ไทย', 'number_rule': lambda n: ''}, 'to': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Tongan', 'native_name': 'lea fakatonga', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'tr': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y %-H:%M:%S', 'datetime_short': '%-d.%m.%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Turkish', 'native_name': 'Türkçe', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'ug': {'format': {'date': '%-m/%-d/%Y', 'datetime': '%-m/%-d/%Y، %-I:%M:%S %p', 'datetime_short': '%-m/%-d/%Y، %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Uighur', 'native_name': 'ئۇيغۇرچە', 'number_rule': lambda n: ''}, 'uk': {'format': {'date': '%-d.%m.%Y', 'datetime': '%-d.%m.%Y %-H:%M:%S', 'datetime_short': '%-d.%m.%Y %-H:%M', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Ukrainian', 'native_name': 'українська', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p'}, 'ur': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y %-I:%M:%S %p', 'datetime_short': '%-d/%m/%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Urdu', 'native_name': 'اردو', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'uz': {'format': {'date': '%Y/%m/%-d', 'datetime': '%Y/%m/%-d %-H:%M:%S', 'datetime_short': '%Y/%m/%-d %-H:%M', 'decimal_point': '٫', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Uzbek', 'native_name': 'oʻzbekcha', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'vi': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-H:%M:%S %-d/%m/%Y', 'datetime_short': '%-H:%M %-d/%m/%Y', 'decimal_point': ',', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Vietnamese', 'native_name': 'Tiếng Việt', 'number_rule': lambda n: ''}, 'yi': {'format': {'date': '%-d/%m/%Y', 'datetime': '%-d/%m/%Y, %-H:%M:%S', 'datetime_short': '%-d/%m/%Y, %-H:%M', 'decimal_point': '.', 'time': '%-H:%M:%S', 'time_short': '%-H:%M'}, 'name': 'Yiddish', 'native_name': 'ייִדיש', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}, 'zh': {'format': {'date': '%Y/%m/%-d', 'datetime': '%Y/%m/%-d %p%-I:%M:%S', 'datetime_short': '%Y/%m/%-d %p%-I:%M', 'decimal_point': '.', 'time': '%p%-I:%M:%S', 'time_short': '%p%-I:%M'}, 'name': 'Chinese', 'native_name': '中文', 'number_rule': lambda n: ''}, 'zu': {'format': {'date': '%-m/%-d/%Y', 'datetime': '%-m/%-d/%Y %-I:%M:%S %p', 'datetime_short': '%-m/%-d/%Y %-I:%M %p', 'decimal_point': '.', 'time': '%-I:%M:%S %p', 'time_short': '%-I:%M %p'}, 'name': 'Zulu', 'native_name': 'isiZulu', 'number_rule': lambda n: 'p' if not is_integral(n) else '' if n == 1 else 'p'}}
""" nested helpers """ def get_(obj, field, default=None): if callable(field): return field(obj) if isinstance(obj, dict): return obj.get(field, default) return getattr(obj, field, default) def set_(obj, field, value): if isinstance(obj, dict): obj[field] = value else: setattr(obj, field, value) def nget(dic, keys, _default=None): for key in keys[:-1]: dic = get_(dic, key, {}) return get_(dic, keys[-1], _default) def nexists(dic, keys): _dic = dic for key in keys: if key not in _dic: return False _dic = _dic[key] return True def nset(dic, keys, val): """ Set a nested key-value pair - in-place. No-op when a value already exists. Example: x = {} nset(x, ['a', 'b', 'c'], 0) print(x) > {'a': {'b': {'c': 0}}} """ for key in keys[:-1]: dic = dic.setdefault(key, {}) dic[keys[-1]] = dic.setdefault(keys[-1], val) return dic def ninc(dic, keys): """ increments a counter nested within dic """ cur = nget(dic, keys, 0) nset(dic, keys, cur + 1) def nappend(dic, keys, val): """ Example: x = {} nappend(x, ['a', 'b'], 1) nappend(x, ['a', 'b'], 2) print(x) > {'a': {'b': [1, 2]}} """ dic = nset(dic, keys, []) dic[keys[-1]].append(val) def nconcat(dic, keys, val_arr): dic = nset(dic, keys, []) dic[keys[-1]] += val_arr def nget_obj_vals(obj, keys): obj_vals = [get_(obj, key) for key in keys if get_(obj, key) is not None] if len(obj_vals) != len(keys): return None return obj_vals def get_map(objs, fields, mult=True, get_val=None): """ creates a map from a list of objects Args: objs (arr of dicts): array of dicts to turn into mapping fields (arr of strings): keys of dict to use in forming mapping mult (bool): whether the mapped values should be unique (a single value) or multiple (an array of values) get_val (func): a function, if true the mapped value is computed by applying the function to the mapped dict Returns: A mapping """ ret_map = {} for obj in objs: obj_keys = nget_obj_vals(obj, fields) if obj_keys: obj_val = get_(obj, get_val) if get_val else obj if mult: nappend(ret_map, obj_keys, obj_val) else: nset(ret_map, obj_keys, obj_val) return ret_map def nflatten_map(_map): """ Flattens the nested mapping and returns an array of the values Args: _map (dict): output of get_map Returns: (arr): an array of the values within nflatten_map """ values = [] if isinstance(_map, dict): values += [nflatten_map(val) for val in _map.values()] elif isinstance(_map, list): values += _map return values def get_groups(objs, fields, include_keys=False): """ gets groups from a list of objecst with matching values for fields Args: objs (arr of dicts): array of dicts to turn into mapping fields (arr of strings): keys of dict to use in forming groups include_keys (bool, optional): if True, the tuple of keys found from `fields` will be returned as the first value of a tuple with the grouping as the second value Returns: (arr): if include_keys is False, returns an array of arrays of groups if include_keys is True, returns an array of tuples with the first value of each tuple being the keys found from `fields` and the second value of the tuple being the group """ groups_dict = {} for obj in objs: key = tuple(nget_obj_vals(obj, fields)) nappend(groups_dict, [key], obj) ret_groups = [] for group_key, groups_arr in groups_dict.items(): if include_keys: ret_groups.append((group_key, groups_arr)) else: ret_groups.append(groups_arr) return ret_groups def nmerge_concat(master_dic, dic_or_arr, prev_key=None): if isinstance(dic_or_arr, dict): if prev_key: master_dic = master_dic.setdefault(prev_key, {}) for key, val in dic_or_arr.items(): nmerge_concat(master_dic, val, prev_key=key) else: master_dic[prev_key] = master_dic.setdefault(prev_key, []) master_dic[prev_key] += dic_or_arr if __name__ == "__main__": pass
""" nested helpers """ def get_(obj, field, default=None): if callable(field): return field(obj) if isinstance(obj, dict): return obj.get(field, default) return getattr(obj, field, default) def set_(obj, field, value): if isinstance(obj, dict): obj[field] = value else: setattr(obj, field, value) def nget(dic, keys, _default=None): for key in keys[:-1]: dic = get_(dic, key, {}) return get_(dic, keys[-1], _default) def nexists(dic, keys): _dic = dic for key in keys: if key not in _dic: return False _dic = _dic[key] return True def nset(dic, keys, val): """ Set a nested key-value pair - in-place. No-op when a value already exists. Example: x = {} nset(x, ['a', 'b', 'c'], 0) print(x) > {'a': {'b': {'c': 0}}} """ for key in keys[:-1]: dic = dic.setdefault(key, {}) dic[keys[-1]] = dic.setdefault(keys[-1], val) return dic def ninc(dic, keys): """ increments a counter nested within dic """ cur = nget(dic, keys, 0) nset(dic, keys, cur + 1) def nappend(dic, keys, val): """ Example: x = {} nappend(x, ['a', 'b'], 1) nappend(x, ['a', 'b'], 2) print(x) > {'a': {'b': [1, 2]}} """ dic = nset(dic, keys, []) dic[keys[-1]].append(val) def nconcat(dic, keys, val_arr): dic = nset(dic, keys, []) dic[keys[-1]] += val_arr def nget_obj_vals(obj, keys): obj_vals = [get_(obj, key) for key in keys if get_(obj, key) is not None] if len(obj_vals) != len(keys): return None return obj_vals def get_map(objs, fields, mult=True, get_val=None): """ creates a map from a list of objects Args: objs (arr of dicts): array of dicts to turn into mapping fields (arr of strings): keys of dict to use in forming mapping mult (bool): whether the mapped values should be unique (a single value) or multiple (an array of values) get_val (func): a function, if true the mapped value is computed by applying the function to the mapped dict Returns: A mapping """ ret_map = {} for obj in objs: obj_keys = nget_obj_vals(obj, fields) if obj_keys: obj_val = get_(obj, get_val) if get_val else obj if mult: nappend(ret_map, obj_keys, obj_val) else: nset(ret_map, obj_keys, obj_val) return ret_map def nflatten_map(_map): """ Flattens the nested mapping and returns an array of the values Args: _map (dict): output of get_map Returns: (arr): an array of the values within nflatten_map """ values = [] if isinstance(_map, dict): values += [nflatten_map(val) for val in _map.values()] elif isinstance(_map, list): values += _map return values def get_groups(objs, fields, include_keys=False): """ gets groups from a list of objecst with matching values for fields Args: objs (arr of dicts): array of dicts to turn into mapping fields (arr of strings): keys of dict to use in forming groups include_keys (bool, optional): if True, the tuple of keys found from `fields` will be returned as the first value of a tuple with the grouping as the second value Returns: (arr): if include_keys is False, returns an array of arrays of groups if include_keys is True, returns an array of tuples with the first value of each tuple being the keys found from `fields` and the second value of the tuple being the group """ groups_dict = {} for obj in objs: key = tuple(nget_obj_vals(obj, fields)) nappend(groups_dict, [key], obj) ret_groups = [] for (group_key, groups_arr) in groups_dict.items(): if include_keys: ret_groups.append((group_key, groups_arr)) else: ret_groups.append(groups_arr) return ret_groups def nmerge_concat(master_dic, dic_or_arr, prev_key=None): if isinstance(dic_or_arr, dict): if prev_key: master_dic = master_dic.setdefault(prev_key, {}) for (key, val) in dic_or_arr.items(): nmerge_concat(master_dic, val, prev_key=key) else: master_dic[prev_key] = master_dic.setdefault(prev_key, []) master_dic[prev_key] += dic_or_arr if __name__ == '__main__': pass
def load(h): return ({'abbr': 0, 'code': 0, 'title': 'Confidence index'}, {'abbr': 1, 'code': 1, 'title': 'Quality indicator'}, {'abbr': 2, 'code': 2, 'title': 'Correlation of product with used calibration product'}, {'abbr': 3, 'code': 3, 'title': 'Standard deviation'}, {'abbr': 4, 'code': 4, 'title': 'Random error'}, {'abbr': None, 'code': 255, 'title': 'Missing'})
def load(h): return ({'abbr': 0, 'code': 0, 'title': 'Confidence index'}, {'abbr': 1, 'code': 1, 'title': 'Quality indicator'}, {'abbr': 2, 'code': 2, 'title': 'Correlation of product with used calibration product'}, {'abbr': 3, 'code': 3, 'title': 'Standard deviation'}, {'abbr': 4, 'code': 4, 'title': 'Random error'}, {'abbr': None, 'code': 255, 'title': 'Missing'})
def binary_search(arr, low, high, number): while(low <= high): mid = (low + high)//2 if arr[mid] == number: return True elif(arr[mid] > number): high = mid -1 else: low = mid + 1 return False if __name__ == "__main__": print(binary_search([3,4,5,6,7,87,96534],0, 6, 87)) def binary_search_recursive(arr, low, high, number): if low <= high: mid = (low + high)//2 if arr[mid] == number: return True if arr[mid] > number: return binary_search_recursive(arr, low, mid-1, number) return binary_search_recursive(arr, mid+1, high, number) return False if __name__ == "__main__": print(binary_search_recursive([3,4,5,6,7,87,96534],0, 6, 96534))
def binary_search(arr, low, high, number): while low <= high: mid = (low + high) // 2 if arr[mid] == number: return True elif arr[mid] > number: high = mid - 1 else: low = mid + 1 return False if __name__ == '__main__': print(binary_search([3, 4, 5, 6, 7, 87, 96534], 0, 6, 87)) def binary_search_recursive(arr, low, high, number): if low <= high: mid = (low + high) // 2 if arr[mid] == number: return True if arr[mid] > number: return binary_search_recursive(arr, low, mid - 1, number) return binary_search_recursive(arr, mid + 1, high, number) return False if __name__ == '__main__': print(binary_search_recursive([3, 4, 5, 6, 7, 87, 96534], 0, 6, 96534))