content stringlengths 7 1.05M |
|---|
myfile= open("running-config.cfg")
def process_line(word):
str=word.split()
lst=str[2:]
mytpl = tuple(lst)
return(mytpl)
def check(line):
if "no ip address" in line:
return
elif "ip address" in line:
return(process_line(line))
else:
return
myfinlist=[]
for line in myfile:
mytpl3=check(line)
if mytpl3 != None:
myfinlist.append(mytpl3)
print(myfinlist)
|
"""Config for sending email via Mailgun"""
MAILGUN = {
"from": "XXXX",
"url": "XXXX",
"api_key": "XXXX"
}
NOTIFICATIONS = ["XX@XX.com"]
|
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def postorderTraversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
## recursive
# self.res=[]
# self.tra(root)
# return self.res
# def tra(self, root):
# if not root:
# return
# self.tra(root.left)
# self.tra(root.right)
# self.res.append(root.val)
## stack
# revres=[]
# stack=[root]
# while stack:
# cur = stack.pop()
# if not cur:
# continue
# revres.append(cur.val)
# stack.append(cur.left)
# stack.append(cur.right)
# return revres[::-1]
## Morris + reverse
revres=[]
cur=root
while cur:
if cur.right:
temp=cur.right
while temp.left and temp.left != cur:
temp=temp.left
if not temp.left:
temp.left=cur
revres.append(cur.val)
cur=cur.right
else:
temp.left=None
cur=cur.left
else:
revres.append(cur.val)
cur=cur.left
return revres[::-1] |
# Create two lists of zeros; rows and cols. Keep incrementing count in the lists. Increment total_odd by r+c%2==1
class Solution:
def oddCells(self, n: int, m: int, indices: List[List[int]]) -> int:
rows, cols = [0]*n, [0]*m
for i in indices:
rows[i[0]] += 1
cols[i[1]] += 1
count = 0
for r in rows:
for c in cols:
if (r+c)%2==1:
count += 1
return count |
# PROGRESSÃO ARITMÉTICA
# Desenvolva um programa que leia o primeiro termo e a razão de uma PA. No final, mostre os 10 primeiros termos dessa progressão.
termo = int(input('Digite o primeiro termo: '))
razao = int(input('Digite a razão: '))
decimo = termo + (10-1) * razao
for c in range(termo, decimo, razao):
print(c)
|
I=input('Enter String: ')
if I.count('4')==0 and I.count('7')==0:
print('Output:',-1)
else:
if I.count('4')>=I.count('7'):
print('Output:',4)
else:
print('Output:',7)
|
# Window-handling features of PyAutoGUI
# UNDER CONSTRUCTION
"""
Window handling features:
- pyautogui.getWindows() # returns a dict of window titles mapped to window IDs
- pyautogui.getWindow(str_title_or_int_id) # returns a "Win" object
- win.move(x, y)
- win.resize(width, height)
- win.maximize()
- win.minimize()
- win.restore()
- win.close()
- win.position() # returns (x, y) of top-left corner
- win.moveRel(x=0, y=0) # moves relative to the x, y of top-left corner of the window
- win.clickRel(x=0, y=0, clicks=1, interval=0.0, button='left') # click relative to the x, y of top-left corner of the window
""" |
def can_build(env, platform):
return (platform == "x11")
# for futur: or platform == "windows" or platform == "osx" or platform == "android"
def configure(env):
pass
def get_doc_classes():
return [
"Bluetooth",
"NetworkedMultiplayerBt",
]
def get_doc_path():
return "doc_classes"
|
def fib(n):
if(n <= 1): return n
return fib(n-1) + fib(n-2)
print(fib(30))
|
NAME = 'Little Wolf'
def extract_upper(phrase):
return list(filter(str.isupper, phrase))
def extract_lower(phrase):
return list(filter(str.islower, phrase))
|
def main() -> None:
N, M, K = map(int, input().split())
A = [0] * M
B = [0] * M
for i in range(M):
A[i], B[i] = map(int, input().split())
X = list(map(int, input().split()))
assert 2 <= N <= 50
assert 1 <= M <= (N * (N - 1))
assert 1 <= K <= 10
assert len(X) == N
assert all(1 <= A_i <= N for A_i in A)
assert all(1 <= B_i <= N for B_i in B)
assert all(A[i] != B[i] for i in range(M))
assert all(1 <= X_i <= 100 for X_i in X)
for i in range(M):
for j in range(i + 1, M):
assert (A[i] != A[j]) or (B[i] != B[j])
if __name__ == '__main__':
main()
|
{
'targets': [{
'target_name': 'talib',
'sources': [
'src/talib.cpp'
],
"include_dirs": [
"<!(node -e \"require('nan')\")"
],
'conditions': [
['OS=="linux"', {
"libraries": [
"../src/lib/lib/libta_abstract_csr.a",
"../src/lib/lib/libta_func_csr.a",
"../src/lib/lib/libta_common_csr.a",
"../src/lib/lib/libta_libc_csr.a",
]
}],
['OS=="mac"', {
'xcode_settings': {
'OTHER_CPLUSPLUSFLAGS': ['-std=c++11', '-stdlib=libc++'],
'OTHER_LDFLAGS': ['-stdlib=libc++'],
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
},
"libraries": [
"../src/lib/lib/libta_abstract_csr.a",
"../src/lib/lib/libta_func_csr.a",
"../src/lib/lib/libta_common_csr.a",
"../src/lib/lib/libta_libc_csr.a",
]
}],
['OS=="win"', {
"libraries": [
"../src/lib/lib/ta_libc_csr.lib",
"../src/lib/lib/ta_func_csr.lib",
"../src/lib/lib/ta_common_csr.lib",
"../src/lib/lib/ta_abstract_csr.lib"
]
}],
]
}]
}
|
n = input("Enter a number: ")
n = int(n)
if n > 1000:
print("PLEASE ENTER A NUMBER THAT IS LESS THAN 1000!")
else:
n = str(n)
if len(n) == 2:
if n[0] == "2":
a = "Twenty"
if n[0] == "3":
a = "Thirty"
if n[0] == "4":
a = "Fourty"
if n[0] == "5":
a = "Fifty"
if n[0] == "6":
a = "Sixty"
if n[0] == "7":
a = "Seventy"
if n[0] == "8":
a = "Eighty"
if n[0] == "9":
a = "Ninety"
if n[1] == "0":
b = ""
if n[1] == "1":
b = "-One"
if n[1] == "2":
b = "-Two"
if n[1] == "3":
b = "-Three"
if n[1] == "4":
b = "-Four"
if n[1] == "5":
b = "-Five"
if n[1] == "6":
b = "-Six"
if n[1] == "7":
b = "-Seven"
if n[1] == "8":
b = "-Eight"
if n[1] == "9":
b = "-Nine"
print(a + b)
|
def test1(foo, bar):
foo = 3
def test2(quix):
foo = 4
test2(123)
print(foo)
# Should be 3
|
MONTH_IN_YEAR = 12
LOAN_STATE_TEMPLATE = '{body:<15}|{pay:<15}|{percentage_pay:<15}|{body_pay:<15}'
LOAN_REPORT_ROW_TEMPLATE = '{payment_num:<10}|' + LOAN_STATE_TEMPLATE
REPORT_HEADER = LOAN_REPORT_ROW_TEMPLATE.format(
payment_num='Payment №',
body='Remaining body',
pay='Payment',
percentage_pay='% payment',
body_pay='Body payment'
)
|
temp: int = int(input())
temp_range: int = 0 if (10 <= temp <= 18) else 1 if (18 < temp <= 24) else 2
day_time: int = ('Morning', 'Afternoon', 'Evening',).index(input())
options: tuple = (
(('Sweatshirt', 'Sneakers',),('Shirt','Moccasins',),('Shirt','Moccasins',),),
(('Shirt','Moccasins',),('T-Shirt','Sandals',),('Shirt','Moccasins',),),
(('T-Shirt','Sandals',),('Swim Suit','Barefoot',),('Shirt','Moccasins',),),
)
print(f'It\'s {temp} degrees, get your {options[temp_range][day_time][0]} and {options[temp_range][day_time][1]}.')
|
def tmembership(my_tuple1,my_tuple2):
for item in my_tuple1:
# membership in and not in operator in tuple
if item in my_tuple2:
print(str(item) + ' in my_tuple2')
if item not in my_tuple2:
print(str(item) + ' not in my_tuple2')
print(tmembership((1, 2, 3, 4, 5), (1, 2, 3)))
|
# Exceptions
# Problem Link: https://www.hackerrank.com/challenges/exceptions/problem
for _ in range(int(input())):
try:
a, b = [int(x) for x in input().split()]
print(a // b)
except Exception as e:
print("Error Code:", e)
|
TYPEKRUISING = {
1: "aquaduct",
2: "brug",
3: "duiker",
4: "sifon",
5: "hevel",
6: "bypass"
}
MATERIAALKUNSTWERK = {
1: "aluminium",
2: "asbestcement",
3: "beton",
4: "gegolfd plaatstaal",
5: "gewapend beton",
6: "gietijzer",
7: "glad staal",
8: "glas",
9: "grasbetontegels",
10: "hout",
11: "ijzer",
12: "koper",
13: "kunststof",
14: "kunststoffolie",
15: "kurk",
16: "lood",
17: "metselwerk",
18: "plaatstaal",
19: "puinsteen",
20: "PVC",
21: "staal",
22: "steen",
23: "voorgespannen beton",
24: "riet en/of biezen",
25: "zand",
26: "gips",
28: "roestvrij staal",
27: "gres",
29: "veen",
30: "klei",
31: "lokale bodemsoort"
}
TYPESTUW = {
1: "schotbalkstuw",
2: "stuw met schuif",
3: "stuw met klep",
4: "segmentstuw",
5: "cascadestuw",
6: "hevelstuw",
7: "meetstuw",
8: "meetschot",
9: "stuw met contra-gewicht",
10: "inlaat- en/of aflaatstuw",
11: "overlaat",
12: "drijverstuw",
13: "trommelstuw",
20: "gronddamstuw",
21: "stuwbak",
22: "tuimel- of kantelstuw",
23: "balgstuw",
24: "brievenbusstuw",
25: "knijpstuw",
26: "conserveringstuw",
99: "onbekend"
}
TYPEREGELBAARHEID = {
1: "niet regelbaar (vast)",
2: "regelbaar, niet automatisch",
3: "regelbaar, automatisch",
4: "handmatig",
99: "overig",
}
VORMKOKER = {
1: "Rond",
2: "Driehoek",
3: "Rechthoekig",
4: "Eivormig",
5: "Ellipsvormig",
6: "Paraboolvormig",
7: "Trapeziumvormig",
8: "Heulprofiel",
9: "Muilprofiel",
10: "Langwerpig",
11: "Scherp",
99: "Onbekend",
}
SOORTAFSLUITMIDDEL = {
1: "deur",
2: "schotbalk sponning",
3: "zandzakken",
4: "schuif",
5: "terugslagklep",
6: "tolklep",
97: "niet afsluitbaar",
98: "overig",
99: "onbekend"
}
|
'''
Implement a queue using an array¶
In this notebook, we'll look at one way to implement a queue by using an array. First, check out the walkthrough for an overview of the concepts, and then we'll take a look at the code.
OK, so those are the characteristics of a queue, but how would we implement those characteristics using an array?
What happens when we run out of space in the array? This is one of the trickier things we'll need to handle with our code.
Functionality
Once implemented, our queue will need to have the following functionality:
enqueue - adds data to the back of the queue
dequeue - removes data from the front of the queue
front - returns the element at the front of the queue
size - returns the number of elements present in the queue
is_empty - returns True if there are no elements in the queue, and False otherwise
_handle_full_capacity - increases the capacity of the array, for cases in which the queue would otherwise overflow
Also, if the queue is empty, dequeue and front operations should return None.
1. Create the queue class and its __init__ method
First, have a look at the walkthrough:
Now give it a try for yourself. In the cell below:
Define a class named Queue and add the __init__ method
Initialize the arr attribute with an array containing 10 elements, like this: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Initialize the next_index attribute
Initialize the front_index attribute
Initialize the queue_size attribute
Let's check that the array is being initialized correctly. We can create a Queue object and access the arr attribute, and we should see our ten-element array:
2. Add the enqueue method¶
In the cell below, add the code for the enqueue method.
The method should:
Take a value as input and assign this value to the next free slot in the array
Increment queue_size
Increment next_index (this is where you'll need to use the modulo operator %)
If the front index is -1 (because the queue was empty), it should set the front index to 0
3. Add the size, is_empty, and front methods
Just like with stacks, we need methods to keep track of the size of the queue and whether it is empty. We can also add a front method that returns the value of the front element.
Add a size method that returns the current size of the queue
Add an is_empty method that returns True if the queue is empty and False otherwise
Add a front method that returns the value for the front element (whatever item is located at the front_index position). If the queue is empty, the front method should return None.
4. Add the dequeue method
In the cell below, see if you can add the deqeueue method.
Here's what it should do:
If the queue is empty, reset the front_index and next_index and then simply return None. Otherwise...
Get the value from the front of the queue and store this in a local variable (to return later)
Shift the head over so that it refers to the next index
Update the queue_size attribute
Return the value that was dequeued
## 5. Add the `_handle_queue_capacity_full` method
First, define the _handle_queue_capacity_full method:
Define an old_arr variable and assign the the current (full) array so that we have a copy of it
Create a new (larger) array and assign it to arr.
Iterate over the values in the old array and copy them to the new array. Remember that you'll need two for loops for this.
Then, in the enqueue method:
Add a conditional to check if the queue is full; if it is, call _handle_queue_capacity_full
'''
class Queue:
def __init__(self, initial_size=10):
self.arr = [0 for _ in range(initial_size)]
self.next_index = 0
self.front_index = -1
self.queue_size = 0
def enqueue(self, value):
# if queue is already full --> increase capacity
if self.queue_size == len(self.arr):
self._handle_queue_capacity_full()
# enqueue new element
self.arr[self.next_index] = value
self.queue_size += 1
self.next_index = (self.next_index + 1) % len(self.arr)
if self.front_index == -1:
self.front_index = 0
def dequeue(self):
# check if queue is empty
if self.is_empty():
self.front_index = -1 # resetting pointers
self.next_index = 0
return None
# dequeue front element
value = self.arr[self.front_index]
self.front_index = (self.front_index + 1) % len(self.arr)
self.queue_size -= 1
return value
def size(self):
return self.queue_size
def is_empty(self):
return self.size() == 0
def front(self):
# check if queue is empty
if self.is_empty():
return None
return self.arr[self.front_index]
def _handle_queue_capacity_full(self):
old_arr = self.arr
self.arr = [0 for _ in range(2 * len(old_arr))]
index = 0
# copy all elements from front of queue (front-index) until end
for i in range(self.front_index, len(old_arr)):
self.arr[index] = old_arr[i]
index += 1
# case: when front-index is ahead of next index
for i in range(0, self.front_index):
self.arr[index] = old_arr[i]
index += 1
# reset pointers
self.front_index = 0
self.next_index = index
# Setup
q = Queue()
q.enqueue(1)
q.enqueue(2)
q.enqueue(3)
# Test size
print("Pass" if (q.size() == 3) else "Fail")
# Test dequeue
print("Pass" if (q.dequeue() == 1) else "Fail")
# Test enqueue
q.enqueue(4)
print("Pass" if (q.dequeue() == 2) else "Fail")
print("Pass" if (q.dequeue() == 3) else "Fail")
print("Pass" if (q.dequeue() == 4) else "Fail")
q.enqueue(5)
print("Pass" if (q.size() == 1) else "Fail")
|
# -*- coding: utf-8 -*-
EMPTY_STR = ""
def is_empty(word):
return bool(word == EMPTY_STR)
def is_empty_strip(word):
return bool(str(word).strip() == EMPTY_STR)
|
"""
0849. Maximize Distance to Closest Person
Easy
In a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty.
There is at least one empty seat, and at least one person sitting.
Alex wants to sit in the seat such that the distance between him and the closest person to him is maximized.
Return that maximum distance to closest person.
Example 1:
Input: [1,0,0,0,1,0,1]
Output: 2
Explanation:
If Alex sits in the second open seat (seats[2]), then the closest person has distance 2.
If Alex sits in any other open seat, the closest person has distance 1.
Thus, the maximum distance to the closest person is 2.
Example 2:
Input: [1,0,0,0]
Output: 3
Explanation:
If Alex sits in the last seat, the closest person is 3 seats away.
This is the maximum distance possible, so the answer is 3.
Constraints:
2 <= seats.length <= 20000
seats contains only 0s or 1s, at least one 0, and at least one 1.
"""
class Solution:
def maxDistToClosest(self, seats: List[int]) -> int:
res = 0
last = -1
N = len(seats)
for i in range(N):
if seats[i]:
res = max(res, i if last < 0 else (i - last) // 2)
last = i
return max(res, N - last - 1)
class Solution:
def maxDistToClosest(self, seats: List[int]) -> int:
length, turn = len(seats), []
for i in range(length):
if seats[i] == 1:
turn.append(i)
res = max(turn[0], length - turn[-1] - 1)
for i in range(0, len(turn) - 1):
if (turn[i+1] - turn[i]) // 2 > res:
res = (turn[i+1] - turn[i]) // 2
return res
|
# This is a sample module used for testing doctest.
#
# This module is for testing how doctest handles a module with no
# docstrings.
class Foo(object):
# A class with no docstring.
def __init__(self):
pass
|
# generating magic square
# note only works with odd number input
# conditions and procedure in readme.md file at https://github.com/ThayalanGR/competitive-programs
def generateMagicSquare(n):
mSquare = [[0 for _ in range(n)] for _ in range(n)]
# initialize row and col value
i = int(n/2)
j = n-1
num = 1
# filling magic square
while num <= pow(n, 2):
# checking condition 3
if i == -1 and j == n:
i = 0
j = n - 2
else:
# condition 1 block
if j == n:
j = 0
if i < 0:
i = n - 1
# condition 2 block
if mSquare[i][j]:
i = i + 1
j = j - 2
continue
else:
mSquare[i][j] = num
num += 1
# common statement - condition 1
i = i - 1
j = j + 1
return mSquare
if __name__ == "__main__":
inp = int(input())
magicSquare = generateMagicSquare(inp)
print(magicSquare)
|
# Created by MechAviv
# Map ID :: 940012010
# Hidden Street : Decades Later
sm.curNodeEventEnd(True)
sm.setTemporarySkillSet(0)
sm.setInGameDirectionMode(True, True, False, False)
sm.removeSkill(60011219)
if not "1" in sm.getQRValue(25807):
sm.levelUntil(10)
sm.setJob(6500)
sm.createQuestWithQRValue(25807, "1")
sm.resetStats()
# Unhandled Stat Changed [HP] Packet: 00 00 00 04 00 00 00 00 00 00 C2 00 00 00 FF 00 00 00 00
# Unhandled Stat Changed [MHP] Packet: 00 00 00 08 00 00 00 00 00 00 C2 00 00 00 FF 00 00 00 00
# Unhandled Stat Changed [MMP] Packet: 00 00 00 20 00 00 00 00 00 00 71 00 00 00 FF 00 00 00 00
# Unhandled Stat Changed [MHP] Packet: 00 00 00 08 00 00 00 00 00 00 58 01 00 00 FF 00 00 00 00
# Unhandled Stat Changed [HP] Packet: 00 00 00 04 00 00 00 00 00 00 58 01 00 00 FF 00 00 00 00
sm.addSP(5, True)
# [INVENTORY_GROW] [01 1C ]
# [INVENTORY_GROW] [02 1C ]
# [INVENTORY_GROW] [03 1C ]
# [INVENTORY_GROW] [04 1C ]
sm.giveSkill(60011216, 1, 1)
sm.giveSkill(60011218, 1, 1)
sm.giveSkill(60011220, 1, 1)
sm.giveSkill(60011222, 1, 1)
sm.sendDelay(300)
sm.showFieldEffect("kaiser/text0", 0)
sm.sendDelay(4200)
sm.setTemporarySkillSet(0)
sm.setInGameDirectionMode(False, True, False, False)
# [FORCED_STAT_RESET] []
sm.warp(940011020, 0)
|
'''
Joe Walter
difficulty: 15%
run time: 0:01
answer: 402
***
074 Digit Factorial Chains
The number 145 is well known for the property that the sum of the factorial of its digits is equal to 145:
1! + 4! + 5! = 1 + 24 + 120 = 145
Perhaps less well known is 169, in that it produces the longest chain of numbers that link back to 169; it turns out that there are only three such loops that exist:
169 → 363601 → 1454 → 169
871 → 45361 → 871
872 → 45362 → 872
It is not difficult to prove that EVERY starting number will eventually get stuck in a loop. For example,
69 → 363600 → 1454 → 169 → 363601 (→ 1454)
78 → 45360 → 871 → 45361 (→ 871)
540 → 145 (→ 145)
Starting with 69 produces a chain of five non-repeating terms, but the longest non-repeating chain with a starting number below one million is sixty terms.
How many chains, with a starting number below one million, contain exactly sixty non-repeating terms?
'''
def dig_fac(n, _map = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880]):
ans = 0
while n > 9:
ans += _map[n % 10]
n //= 10
ans += _map[n]
return ans
chain_len = {}
def start(n, visited = None):
if visited is None:
visited = []
if n in chain_len:
a = chain_len[n]
b = len(visited)
for i in range(b-1, -1, -1):
chain_len[visited[i]] = a + b - i
elif n in visited:
a = len(visited)
b = visited.index(n)
for i in range(a-1, b-1, -1):
chain_len[visited[i]] = a - b
for i in range(b-1, -1, -1):
chain_len[visited[i]] = a - i
else:
visited.append(n)
start(dig_fac(n), visited)
for i in range(10**6):
start(i)
print(sum( 1 for k,v in chain_len.items() if v == 60 ))
|
def tabuada(num):
for x in range (11):
print(num*x)
num = int(input('Digite um valor: '))
tabuada(num)
|
"""
Simplified Josephus
Given n people find the survivor, starting from the first person he kills the person to the left and the next surviving person kills the person to his left, this keeps happening until 1 person survives return that person's number.
Examples
josephus(1) ➞ 1
josephus(8) ➞ 1
josephus(41) ➞ 19
Notes
Check the rescources if you are confused about the instructions.
"""
def josephus(people):
if people == 1: return people
k=2
a = list(range(people))
z=0
while len(a)>1:
b = [i for i in a if (a.index(i) + 1 + z) % k == 0]
z = (z + len(a)) % k
a=[i for i in a if not i in b]
return a[0]+1
#josephus(1) #, 1)
josephus(41) #, 19)
#josephus(8) #, 1)
#josephus(5) #, 3)
#josephus(7) #, 7) |
class Environment:
def __init__(self, rows, columns, turns, drones_count, drone_max_payload):
self.rows = rows
self.columns = columns
self.turns = turns
self.drones_count = drones_count
self.drone_max_payload = drone_max_payload
|
class DeviceInfo(object):
"""Device Info class"""
@staticmethod
def get_serial():
# Extract serial from cpuinfo file
cpuserial = "0000000000000000"
try:
f = open('/proc/cpuinfo','r')
for line in f:
if line[0:6]=='Serial':
cpuserial = line[10:26]
f.close()
except:
cpuserial = "ERROR000000000"
return cpuserial
|
#Uma empresa deve aumentar em 5% os salários de todos os seus programadores.
# Faça um algoritmo que calcule o valor do novo salário
# sabendo que o atual salário de um programador é de 3500$.
salario_programador = 3500
novo_salario = 3500+3500*(0.5)
print(f'\033[036mNovo salário dos programadores: \033[032m${novo_salario:.2f}')
|
# Time: O(nlog*n) ~= O(n), n is the length of the positions
# Space: O(n)
# In this problem, a rooted tree is a directed graph such that,
# there is exactly one node (the root) for
# which all other nodes are descendants of this node, plus every node has exactly one parent,
# except for the root node which has no parents.
#
# The given input is a directed graph that started as a rooted tree with N nodes
# (with distinct values 1, 2, ..., N), with one additional directed edge added.
# The added edge has two different vertices chosen from 1 to N, and was not an edge that already existed.
#
# The resulting graph is given as a 2D-array of edges.
# Each element of edges is a pair [u, v] that represents a directed edge connecting nodes u and v,
# where u is a parent of child v.
#
# Return an edge that can be removed so that the resulting graph is a rooted tree of N nodes.
# If there are multiple answers, return the answer that occurs last in the given 2D-array.
#
# Example 1:
# Input: [[1,2], [1,3], [2,3]]
# Output: [2,3]
# Explanation: The given directed graph will be like this:
# 1
# / \
# v v
# 2-->3
# Example 2:
# Input: [[1,2], [2,3], [3,4], [4,1], [1,5]]
# Output: [4,1]
# Explanation: The given directed graph will be like this:
# 5 <- 1 -> 2
# ^ |
# | v
# 4 <- 3
# Note:
# The size of the input 2D-array will be between 3 and 1000.
# Every integer represented in the 2D-array will be between 1 and N, where N is the size of the input array.
class UnionFind(object):
def __init__(self, n):
self.set = range(n)
self.count = n
def find_set(self, x):
if self.set[x] != x:
self.set[x] = self.find_set(self.set[x]) # path compression.
return self.set[x]
def union_set(self, x, y):
x_root, y_root = map(self.find_set, (x, y))
if x_root == y_root or \
y != y_root: # already has a father
return False
self.set[y_root] = x_root
self.count -= 1
return True
class Solution(object):
def findRedundantDirectedConnection(self, edges):
"""
:type edges: List[List[int]]
:rtype: List[int]
"""
union_find = UnionFind(len(edges)+1)
for edge in edges:
if not union_find.union_set(*edge):
return edge
return []
|
f1 = open("slurm-3101.out", 'r')
lines = f1.readlines()
count = 0
d = {}
for line in lines:
s = line.split(' + ')
s.remove('\n')
print(s)
count += 1
for x in s:
s1 = x.split('A^')
if (float(s1[0]) != 0 or int(s1[1]) != 0):
print(s1)
res = d.get(int(s1[1]))
if (res == None):
d[int(s1[1])] = float(s1[0])
else:
d[int(s1[1])] = d[int(s1[1])] + float(s1[0])
else:
count -= 1
print(d)
final = {}
for key in sorted(d):
final[key] = d[key] / count
print(str(final[key]) + "A^" + str(key) + " + ",end=""),
print()
print(count)
|
input = """
bk(a,b).
bk(b,c).
bk(m,m).
bk(x,y).
"""
output = """
bk(a,b).
bk(b,c).
bk(m,m).
bk(x,y).
"""
|
#!/usr/bin/env python
# coding: utf-8
# In[1]:
#Lara Betül Arslantaş-180401024
def polinoma_cevirme(derece,veriler):
matris = []
a = 0
for i in range(derece+1):
satir = []
for j in range(derece+1):
toplam = 0
for k in range(1,len(veriler)+1):
toplam += k**a
satir.append(toplam)
a += 1
matris.append(satir)
a -= derece
sonuc = []
for i in range(derece+1):
toplam = 0
for j in range(len(veriler)):
toplam += veriler[j]*(j+1)**i
sonuc.append(toplam)
for i in range(derece+1):
b = matris[i][i]
for j in range(i+1,derece+1):
bolum = b/matris[j][i]
sonuc[j] = sonuc[j]*bolum-sonuc[i]
for k in range(derece+1):
matris[j][k] = matris[j][k]*bolum-matris[i][k]
for i in range(derece,-1,-1):
b = matris[i][i]
for j in range(i-1,-1,-1):
bolum = b/matris[j][i]
sonuc[j] = sonuc[j]*bolum-sonuc[i]
for k in range(derece+1):
matris[j][k] = matris[j][k]*bolum-matris[i][k]
for i in range(derece+1):
sonuc[i] = sonuc[i]/matris[i][i]
y_ort=0
for i in range (len(veriler)):
y_ort += veriler[i]
y_ort = y_ort/len(veriler)
St=0
Sr=0
for i in range(len(veriler)):
x = veriler[i]
St +=(veriler[i]-y_ort)**2
for j in range(len(sonuc)):
x -= sonuc[j]*(i+1)**j
x=x**2
Sr += x
korelasyon = ((St-Sr)/St)**(1/2)
return sonuc,korelasyon
def polinom_katsayilari(p1,p2,p3,p4,p5,p6,dosya):
dosya2.write("1.dereceden polinom : a0 = "+str(p1[0]) + " a1 = " + str(p1[1])+"\n" )
dosya2.write("2.dereceden polinom : a0 = "+str(p2[0]) + " a1 = " + str(p2[1]) + " a2 =" + str(p2[2]) + "\n")
dosya2.write("3.dereceden polinom : a0 = "+str(p3[0]) + " a1 = " + str(p3[1]) + " a2 =" + str(p3[2]) + " a3 = " + str(p3[3]) + "\n")
dosya2.write("4.dereceden polinom : a0 = "+str(p4[0]) + " a1 = " + str(p4[1]) + " a2 =" + str(p4[2]) + " a3 = " + str(p4[3]) + " a4 = " + str(p4[4]) + "\n")
dosya2.write("5.dereceden polinom : a0 = "+str(p5[0]) + " a1 = " + str(p5[1]) + " a2 =" + str(p5[2]) + " a3 = " + str(p5[3]) + " a4 = " + str(p5[4]) + " a5 = "+ str(p5[5])+ "\n")
dosya2.write("6.dereceden polinom : a0 = "+str(p6[0]) + " a1 = " + str(p6[1]) + " a2 =" + str(p6[2]) + " a3 = " + str(p6[3]) + " a4 = " + str(p6[4]) + " a5 = "+ str(p6[5])+" a6 = "+str(p6[6])+ "\n")
def en_uygun_polinom(k1,k2,k3,k4,k5,k6,dosya):
dosya2.write("katsayi1 = "+str(k1)+" katsayi2 = "+str(k2)+" katsayi 3 = "+str(k3)+" katsayi4 = "+str(k4)+" katsayi5 = "+str(k5)+" katsayi6 = "+str(k6)+"\n")
degerler = [k1,k2,k3,k4,k5,k6]
for i in range(len(degerler)):
if degerler[i] == max(degerler):
dosya2.write("En uygun olan "+str(i+1)+". polinomdur.\n")
dosya = open("veriler.txt","r")
veriler = dosya.readlines()
for i in range(len(veriler)):
veriler[i]=int(veriler[i])
p1,k1=polinoma_cevirme(1,veriler)
p2,k2=polinoma_cevirme(2,veriler)
p3,k3=polinoma_cevirme(3,veriler)
p4,k4=polinoma_cevirme(4,veriler)
p5,k5=polinoma_cevirme(5,veriler)
p6,k6=polinoma_cevirme(6,veriler)
dosya.close()
dosya2 = open("sonuc.txt","w")
polinom_katsayilari(p1,p2,p3,p4,p5,p6,dosya2)
en_uygun_polinom(k1,k2,k3,k4,k5,k6,dosya2)
for i in range(len(veriler)//10):
dosya2.write("\n"+str(i+1)+". 10'lu grup : \n")
onluGruplar=[]
for j in range(10):
onluGruplar.append(veriler[10*i+j])
p1,k1=polinoma_cevirme(1,onluGruplar)
p2,k2=polinoma_cevirme(2,onluGruplar)
p3,k3=polinoma_cevirme(3,onluGruplar)
p4,k4=polinoma_cevirme(4,onluGruplar)
p5,k5=polinoma_cevirme(5,onluGruplar)
p6,k6=polinoma_cevirme(6,onluGruplar)
polinom_katsayilari(p1,p2,p3,p4,p5,p6,dosya2)
en_uygun_polinom(k1,k2,k3,k4,k5,k6,dosya2)
dosya2.close()
# In[ ]:
|
#recursive factorial
def factorial(n):
if (n == 0):
return 1
else:
return n * factorial(n - 1)
#iterative factorial
def factorial(n):
total = 1
for i in range(1,n+1,1):
total *= i
return total
#recursive greatest common divisor
def gcd(a,b):
if (b == 0):
return a
else:
return gcd(b,a % b)
#iterative greatest common divisor (broken)
def gcd_bad(a,b):
while (b != 0):
a = b
b = a % b
return a
#iterative greatest common divisor (broken)
def gcd_bad2(a,b):
while (b != 0):
b = a % b
a = b
return a
#iterative greatest common divisor (correct)
def gcd(a,b):
while (b != 0):
temp = b
b = a % b
a = temp
return a
#iterative greatest common divisor (Python specific swap)
def gcd2(a,b):
while (b != 0):
a,b = b,a % b
return a
#recursive fibonacci (inefficient)
def fib(n):
if (n < 2):
return n
else:
return fib(n - 1) + fib(n - 2)
#iterative fibonacci
def fib(n):
a = 0 # the first Fibonacci number
b = 1 # the second Fibonacci number
for i in range(0,n,1):
c = a + b
a = b
b = c
return a
#recursive fibonacci (efficient)
def fib(n):
def loop(a,b,i):
if (i < n):
return loop(b,a + b,i + 1)
else:
return a
return loop(0,1,0)
#recursive factorial
def fact(n):
total = 1
for i in range(1,n+1,1):
total *= i
return total
#recursive factorial (tail recursive)
def fact2(n):
def loop(total,i):
if (i < n + 1):
return loop(total * i,i + 1)
else:
return total
return loop(1,1)
|
# Extended Euclid's Algorithm for Modular Multiplicative Inverse
def euclidean_mod_inverse(a, b):
temp = b
# Initialize variables
t1, t2 = 0, 1
if b == 1:
return 0
# Perform extended Euclid's algorithm until a > 1
while a > 1:
quotient, remainder = divmod(a, b)
a, b = b, remainder
t1, t2 = t2 - t1 * quotient, t1
if (t2 < 0) :
t2 += temp
return t2
# Driver Code
if __name__ == '__main__':
num = 10
mod = 17
print(
f"The Modular Multiplicative Inverse of {num} is : {euclidean_mod_inverse(num, mod)}")
|
"""
Given the array nums, obtain a subsequence of the array whose sum of
elements is strictly greater than the sum of the non included elements in
such subsequence.
If there are multiple solutions, return the subsequence with minimum size
and if there still exist multiple solutions, return the subsequence with
the maximum total sum of all its elements. A subsequence of an array can
be obtained by erasing some (possibly zero) elements from the array.
Note that the solution with the given constraints is guaranteed to be
unique. Also return the answer sorted in non-increasing order.
Example:
Input: nums = [4,3,10,9,8]
Output: [10,9]
Explanation: The subsequences [10,9] and [10,8] are minimal such that the
sum of their elements is strictly greater than the sum of
elements not included, however, the subsequence [10,9] has the
maximum total sum of its elements.
Example:
Input: nums = [4,4,7,6,7]
Output: [7,7,6]
Explanation: The subsequence [7,7] has the sum of its elements equal to
14 which is not strictly greater than the sum of elements not
included (14 = 4 + 4 + 6). Therefore, the subsequence [7,6,7]
is the minimal satisfying the conditions. Note the subsequence
has to returned in non-decreasing order.
Example:
Input: nums = [6]
Output: [6]
Constraints:
- 1 <= nums.length <= 500
- 1 <= nums[i] <= 100
"""
#Difficulty: Easy
#103 / 103 test cases passed.
#Runtime: 48 ms
#Memory Usage: 14.1 MB
#Runtime: 48 ms, faster than 99.72% of Python3 online submissions for Minimum Subsequence in Non-Increasing Order.
#Memory Usage: 14.1 MB, less than 100.00% of Python3 online submissions for Minimum Subsequence in Non-Increasing Order.
class Solution:
def minSubsequence(self, nums: List[int]) -> List[int]:
nums = sorted(nums, reverse=True)
left = 0
right = sum(nums)
for i, n in enumerate(nums):
left += n
if left > right - left:
return nums[:i+1]
|
"""
Класс для работы с дампами в формате mct (Mifare Classic Tool).
Представляет собой текстовый файл с hex-дампом. Каждый блок с отдельной строки. Дополнительно указаны номера секторов.
Пример:
+Sector: 0
DB5AA4B0950804006263646566676869
140103E103E103E103E103E103E103E1
03E103E103E103E103E103E103E103E1
A0A1A2A3A4A5787788C1FFFFFFFFFFFF
+Sector: 1
033E91010E5402656E746578746D6573
................................
"""
def tohex(dec):
""" Переводит десятичное число в 16-ричный вид с отбрасыванием `0x` """
if dec != None:
s = hex(dec).split('x')[-1]
s = s.upper()
if len(s) == 1:
s = "0" + s
else:
s = "--"
return s
class dumpMct():
dump = property()
def __init__(self):
self._dump = None
def __del__(self):
del(self._dump)
@dump.getter
def dump(self):
return self._dump[:]
@dump.setter
def dump(self, value):
self._dump = value[:]
def loadFromFile(self, fn):
""" Загрузка дампа из файла """
self._dump = []
try:
sector = -1
f = open(fn, "rt")
for line in f:
if line[0] == "+":
sector += 1
fsector = int(line.split()[-1])
if sector != fsector:
while sector < fsector:
for _ in range(0, 4):
t = [None] * 16
self._dump.append(t)
sector += 1
continue
q = [line[i:i+2] for i in range(0, len(line), 2)]
if q[-1] == "\n":
q = q[:-1]
w = []
for item in q:
if item != "--":
w.append(int(item, 16))
else:
w.append(None)
self._dump.append(w)
if sector < 63:
for _ in range(sector, 64):
for _ in range(0, 4):
t = [None] * 16
self._dump.append(t)
f.close()
except:
return False
else:
return True
def saveToFile(self, fn):
""" Сохранение дампа в файл """
try:
f = open(fn, "wb")
ok = True
for i in range(0, 64):
if i % 4 == 0:
# Проверяем наличие данных в секторе перед его записью:
ok = False
for k in range(i, i+4):
for t in range(0, 16):
if self._dump[k][t] != None:
ok = True
break
if ok:
ss = "+Sector: " + str(i // 4)
ss = list(map(ord, list(ss)))
f.write(bytes(ss))
f.write(bytes([10])) # символ переноса строки
if ok:
s = list(map(ord, list("".join(list(map(tohex, self._dump[i]))))))
f.write(bytes(s))
if i < 63:
f.write(bytes([10])) # символ переноса строки
f.close()
except:
return False
else:
return True
|
budget = float(input("Enter the budget: "))
amount_of_video_card = int(input("Enter the number of video cards: "))
amount_of_processor = int(input("Enter the number of processors: "))
amount_of_ram_memory = int(input("Enter the number of ram memory: "))
video_card_price_per_one = 250
video_card_total_price = amount_of_video_card * video_card_price_per_one
processor_price_per_one = video_card_total_price * 0.35
processor_total_price = amount_of_processor * processor_price_per_one
ram_memory_per_one = video_card_total_price * 0.1
ram_memory_total_price = amount_of_ram_memory * ram_memory_per_one
total_sum = video_card_total_price + processor_total_price + ram_memory_total_price
if amount_of_video_card > amount_of_processor:
total_sum = total_sum - total_sum * 0.15
money_left = abs(budget - total_sum)
if budget >= total_sum:
print(f"You have {money_left:.2f} leva left!")
else:
print(f"Not enough money! You need {money_left:.2f} leva more!") |
pysmt_op = ["forall", "exists", "and", "or", "not", "=>", "iff", "symbol", "function", "real_constant", "bool_constant",
"int_constant", "str_constant", "+", "-", "*", "<=", "<", "=", "ite", "toreal", "bv_constant", "bvnot", "bvand",
"bvor", "bvxor", "concat", "extract", "bvult", "bvule", "bvneg", "bvadd", "bvsub", "bvmul", "bvudiv", "bvurem",
"bvshl", "bvlshr", "bvrol", "bvror", "zero_extend", "sign_extend", "bvslt", "bvsle", "bvcomp", "bvsdiv", "bvsrem",
"bvashr", "str.len", "str.++", "str.contains", "str.indexof", "str.replace", "str.substr", "str.prefixof",
"str.suffixof", "str.to_int", "str.from_int", "str.at", "select", "store", "value", "/", "^",
"algebraic_constant", "bv2nat"]
other_op = ["compressed_op", "unknown", "distinct", ">=", ">", "bvuge", "bvugt", "bvsge", "bvsgt", "str.in_re",
"str.to_re", "to_fp", "re.range", "re.union", "re.++", "re.+", "re.*", "re.allchar", "re.none", "xor",
"mod"]
fp_op = ["fp", "fp.neg", "fp.isZero", "fp.isNormal", "fp.isSubnormal", "fp.isPositive", "fp.isInfinite", "fp.isNan",
"fp.eq", "fp.roundToIntegral", "fp.rem", "fp.sub", "fp.sqrt", "fp.lt", "fp.leq", "fp.gt", "fp.geq", "fp.abs",
"fp.add", "fp.div", "fp.min", "fp.max", "fp.mul", "fp.to_sbv", "fp.to_ubv"]
op = pysmt_op + other_op
none_op = ["extract", "zero_extend", "sign_extend", "to_fp", "repeat", "+oo", "-oo"]
tri_op = ["ite", "str.indexof", "str.replace", "str.substr", "store"]
bv_constant = "constant"
bool_constant = "constant"
reserved_word = ["declare-fun", "define-fun", "declare-sort", "define-sort", "declare-datatype", "declare-const"
"assert", "check-sat", "set-info", "set-logic", "set-option"] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
If we list all the natural numbers below 10 that are multiples of 3 or 5,
we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
"""
def main():
x = 0
for n in range(1, 1000):
if n % 3 == 0:
x += n
elif n % 5 == 0:
x += n
print(x)
if __name__ == '__main__':
main() |
"""
limis core - environment
Environment variables set for a project.
"""
LIMIS_PROJECT_NAME_ENVIRONMENT_VARIABLE = 'LIMIS_PROJECT_NAME'
LIMIS_PROJECT_SETTINGS_ENVIRONMENT_VARIABLE = 'LIMIS_PROJECT_SETTINGS'
|
# coding=utf-8
class ErreurRepertoire(Exception):
def __init__(self, *args):
super().__init__(*args)
class FonctionnaliteNonImplementee(Exception):
def __init__(self, *args):
super().__init__(*args)
class CreaturesNonTrouvees(Exception):
def __init__(self):
super().__init__(
"Désolé, aucune créature ne semble exister. Essayez de réinstaller le jeu pour "
"résoudre le problème. Sinon, contactez moi sur Zeste de Savoir (.com) (Folaefolc)"
" pour m'indiquer votre problème"
)
class ErreurDeCreationDeClass(Exception):
def __init__(self):
super().__init__(
"Une erreur s'est produite lors de la création d'un objet de type personnalisé "
"(class). Merci de reporter cette erreur à Folaefolc, main dev' d'Unamed"
)
class ListePleine(Exception):
def __init__(self):
super().__init__(
"La liste étant déjà pleine, le code ne peut pas s'exécuter dans des conditions normales."
" Cela peu avoir pour effet de destabiliser le gameplay ou même le jeu entier. Merci de reporter "
"cette erreur à Folaefolc, main dev' d'Unamed"
)
class CarteInexistante(Exception):
def __init__(self, path=""):
super().__init__(
"La carte demandée à l'adresse '{}' semble ne pas exister. Merci de reporter cette erreur à Folaefolc, "
"main dev' d'Unamed".format(path)
)
class ErreurContenuCarte(Exception):
def __init__(self):
super().__init__(
"Le contenu de la carte n'est pas correct. Il est apparant que la source de la carte a été modifiée de"
" manière anormale, que ce soit par une tiers personne ou un défaut logiciel. Essayez de réinstaller"
" le jeu."
)
class AchatImpossible(Exception):
def __init__(self):
super().__init__(
"Il n'est apparemment pas possible d'acheter un objet dans cette boutique."
" Cela peut être dû à un défaut logiciel ou bien au fait que vous n'ayez pas assez"
" d'argent."
)
class CategorieInexistante(Exception):
def __init__(self):
super().__init__()
class ClassNonChargee(Exception):
def __init__(self, class_name: str="''", method: str="''"):
super().__init__(
"La méthode load() de la class {} ayant levé cette exception aurait dû être appelée avant de vouloir "
"accéder à la méthode {}".format(class_name, method)
)
class CinematiqueIntrouvable(Exception):
def __init__(self, *args):
super().__init__(*args)
class NuzlockeError(Exception):
def __init__(self, *args):
super().__init__(*args)
class ControlerManquant(Exception):
def __init__(self, *args):
super().__init__(*args)
class MethodeManquante(Exception):
def __init__(self, *args):
super().__init__(*args) |
class CyclicQ(object):
'''
Queue.
read parameter is next scheduled for dequeue, write parameter is
most recently queued.
'''
def __init__(self, length):
self.width = length
self.length = 0
self.array = [None] * length
self.read = 0
self.write = -1
def enqueue(self, item):
'''
adds an item to the end of the queue
'''
if self.length == self.width:
raise ValueError
self.write += 1
self.array[self.write % self.width] = item
self.length += 1
def dequeue(self):
'''
Returns the oldest item in queue
'''
if self.length == 0:
raise ValueError
self.length -= 1
reval = self.array[self.read % self.width]
self.read += 1
return reval
def scrollback(self):
'''
Lowers the read/write pointers back down into reasonable
ranges, for sanity's sake I suppose.
'''
if self.write <= 0:
return
offset = self.read % self.width
self.write -= self.read - offset
self.read = offset
class FixedQ(object):
'''
Fixed length/width queue. Pass list equal to queue length for
previous queue values. oldest -> newest
dequeues on enqueue, head is next to be dequeued.
'''
def __init__(self, length, starter_list=None):
self.width = length
self.head = 0
if starter_list is None:
self.array = [None] * length
else:
if len(starter_list) != length:
raise ValueError
else:
self.array = starter_list
def __str__(self):
'''
stotrorrjw
'''
return ' '.join(self.items())
def ndqueue(self, item):
'''
enqueue and dequeue at the same time!
'''
self.head = self.head % self.width
reval = self.array[self.head]
self.array[self.head] = item
self.head += 1
return reval
def items(self):
retlist = []
index = self.head
while index != self.head + self.width:
retlist.append(self.array[index%self.width])
index += 1
return retlist
def test_q():
qu = CyclicQ(4)
qu.enqueue(1)
qu.enqueue(2)
assert qu.dequeue() == 1
qu.enqueue(3)
assert qu.dequeue() == 2
assert qu.dequeue() == 3
|
# 课程作业1函数
def action1_fun():
sum = 0
for num in range(2, 101, 2):
sum = sum + num
print("Sum is", sum)
if __name__ == '__main__':
action1_fun()
|
########################################################
# Copyright (c) 2015-2017 by European Commission. #
# All Rights Reserved. #
########################################################
extends("BaseKPI.py")
"""
Marginal costs statistics (euro/MWh)
-------------------------------------
Indexed by
* scope
* delivery point
* energy (electricity, reserve or gas)
* test case
* statistics (min, max, average or demand average)
Computes the minimum, maximum and average value of the marginal cost over the year for a given delivery point and energy.
The KPI also computes the demand weighted (demand average) marginal cost:
.. math::
\\small demandWeightedMarginalCost_{zone, energy} = \\frac{\\sum_t marginalCost_t^{zone, energy}.demand_t^{zone, energy}}{\\sum_t demand_t^{zone, energy}}
The marginal cost of a given energy and a given delivery point is the variable cost of the production unit that was last called (after the costs of the different technologies were ordered in increasing order) to meet the energy demand in the delivery point.
"""
def computeIndicator(context, indexFilter, paramsIndicator, kpiDict):
timeStepDuration = getTimeStepDurationInHours(context)
selectedScopes = indexFilter.filterIndexList(0, getScopes())
selectedDeliveryPoints = indexFilter.filterIndexList(1, getDeliveryPoints(context))
selectedEnergies = indexFilter.filterIndexList(2, getEnergies(context, includedEnergies = PRODUCED_ENERGIES))
selectedTestCases = indexFilter.filterIndexList(3, context.getResultsIndexSet())
selectedAssetsByScope = getAssetsByScope(context, selectedScopes, includeFinancialAssets=True, includedTechnologies = DEMAND_TYPES)
demandDict = getDemandDict(context, selectedScopes, selectedTestCases, selectedEnergies, selectedDeliveryPoints, selectedAssetsByScope, aggregation = True)
marginalCostDict = getMarginalCostDict(context, selectedScopes, selectedTestCases, selectedEnergies, selectedDeliveryPoints)
for index in marginalCostDict:
kpiDict[index + ("Min",)] = marginalCostDict[index].getMinValue() / timeStepDuration
kpiDict[index + ("Max",)] = marginalCostDict[index].getMaxValue() / timeStepDuration
kpiDict[index + ("Average",)] = marginalCostDict[index].getMeanValue() / timeStepDuration
if index in demandDict and demandDict[index].getSumValue() > 0:
kpiDict[index + ("Demand average",)] = (marginalCostDict[index]*demandDict[index]).getSumValue() / (timeStepDuration*demandDict[index]).getSumValue()
return kpiDict
def get_indexing(context) :
baseIndexList = [getScopesIndexing(), context.getDeliveryPointsIndexing(), getEnergiesIndexing(context, includedEnergies = PRODUCED_ENERGIES), getTestCasesIndexing(context), BaseIndexDefault("Statistics",["Min", "Max", "Average", "Demand average"], False, False, True, 0)]
return baseIndexList
IndicatorLabel = "Marginal costs statistics"
IndicatorUnit = u"\u20ac/MWh"
IndicatorDeltaUnit = u"\u20ac/MWh"
IndicatorDescription = "Marginal costs statistics (min, max and average)"
IndicatorParameters = []
IndicatorIcon = ""
IndicatorCategory = "Results>Marginal Costs"
IndicatorTags = "Power System, Gas System, Power Markets" |
def response_json(target):
def decorator(*args, **kwargs):
response = target(*args, **kwargs)
# TODO: you can add your error handling in here
return response.json()
return decorator
|
NON_CORE_DEPDENDENT_TASKS_FIRST_PRIORITY = 9999
# MessageProcessor
# priority constants for message processors between modules
ASSETS_PRIORITY_PARSE_ISSUANCE = NON_CORE_DEPDENDENT_TASKS_FIRST_PRIORITY - 0
ASSETS_PRIORITY_PARSE_DESTRUCTION = NON_CORE_DEPDENDENT_TASKS_FIRST_PRIORITY - 1
ASSETS_PRIORITY_BALANCE_CHANGE = NON_CORE_DEPDENDENT_TASKS_FIRST_PRIORITY - 2
DEX_PRIORITY_PARSE_TRADEBOOK = NON_CORE_DEPDENDENT_TASKS_FIRST_PRIORITY - 3
BETTING_PRIORITY_PARSE_BROADCAST = NON_CORE_DEPDENDENT_TASKS_FIRST_PRIORITY - 4
CWALLET_PRIORITY_PARSE_FOR_SOCKETIO = NON_CORE_DEPDENDENT_TASKS_FIRST_PRIORITY - 5 # comes last
# MempoolMessageProcessor
CWALLET_PRIORITY_PUBLISH_MEMPOOL = NON_CORE_DEPDENDENT_TASKS_FIRST_PRIORITY - 0 |
# Übungsaufgabe: Auto mit Booster in Python
class Booster:
powerOn = False # erzeugt und initialisiert eine Instanzvariable
def __init__(self, stufe): # Konstruktor
self.stufe = stufe # self ist 'this' in Java/C# -> erzeugt eine Instanzvariable
def getPower(self): # Methoden ohne self sind static
return self.powerOn
def setPower(self, powerOn):
self.powerOn = powerOn
def getStufe(self):
return self.stufe
def setStufe(self, stufe):
self.stufe = stufe
def __str__(self): # toString() in Java/ToString() in C#
return "Power OFF" if not self.powerOn else \
"Power ON - Stufe {0}".format(self.stufe)
class Auto:
def __init__(self, marke, vmax):
self.marke = marke
self.vmax = vmax
self.booster = None # ist 'null' in Java/C#
def getBooster(self):
return self.booster
def setBooster(self, booster):
self.booster = booster
def getVMax(self):
v = self.vmax
if self.booster is not None: # None = null
if self.booster.getPower():
acc = { 1: 15, 2: 30 } # in percent
percent = acc.get(self.booster.getStufe(), 0)
v *= 1+percent/100
return v
def getFahrzeit(self, wegstrecke):
return wegstrecke/self.getVMax()
def __str__(self):
text = "Kein Booster" if self.booster is None else self.booster
return "{0}: vmax = {1} Booster: {2}".\
format(self.marke, self.getVMax(), text)
# 1. Erstelle einen Booster mit Stufe 1
booster = Booster(1) # Erstellen einer Instanz/eines Objekts
# 2. Erstelle das Auto Ferrari SP3JC mit Höchstgeschwindigkeit 320 km/h
ferrari = Auto('Ferrari SP3JC', 320)
# 3. Erstelle das Auto BMW Z1 mit Höchstgeschwindigkeit 260 km/h
bmw = Auto('BMW Z1', 260)
# 4. Führe die 400 km-Fahrt mit dem Ferrari SP3JC aus und gibt die Fahrzeit aus
# Gib den Ferrari auf der Console aus.
tferrari = ferrari.getFahrzeit(400)
print('Der Ferrari benötigt {0:.3f} Stunden.'.format(tferrari))
print(ferrari)
tbmw = []
# Führe die Fahrt mit dem BMW Z1 aus.
# Gib nach jedem Streckenabschnitt die Statuswerte des Fahrzeugs aus.
# 1. Strecke: 20 km - ohne Booster
tbmw.append(bmw.getFahrzeit(20))
print(bmw)
# 2. Strecke: 140 km - mit eingeschaltenen Booster auf Stufe 1
bmw.setBooster(booster)
booster.setPower(True)
booster.setStufe(1)
tbmw.append(bmw.getFahrzeit(140))
print(bmw)
# 3. Strecke: 180 km - mit eingeschaltenen Booster auf Stufe 2
booster.setStufe(2)
tbmw.append(bmw.getFahrzeit(180))
print(bmw)
# 4. Strecke: 60 km - mit abgeschaltetem Booster
booster.setPower(False)
tbmw.append(bmw.getFahrzeit(60))
print(bmw)
for t in tbmw:
print("Fahrzeit {0:.3f}".format(t))
print('Der BMW benötigt {0:.3f} Stunden.'.format(sum(tbmw)))
|
#coding: utf8
def get_data_by_binary_search(target, source_list):
min=0
max=len(source_list)-1
while min<=max:
mid=(min+max)//2
if source_list[mid]==target:
return mid
if source_list[mid]>target:
max=mid-1
else:
min=mid+1
if __name__=='__main__':
source_list=[1,3,5,7,9,10,12,14,15,18]
res=get_data_by_binary_search(14, source_list)
print(res)
|
# -*- coding: utf-8 -*-
"""Binary Search.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1pgYTs84FYj7s3soy6YSyOLeeo6y34p0U
"""
def binary_search(arr, target):
first = 0
last = len(arr)-1
found = False
while first <= last and not found:
mid = (first + last) // 2
if arr[mid] == target:
found = True
else:
if target < arr[mid]:
last = mid-1
else:
first = mid+1
return found
arr = [1,2,3,4,5,6,10,12,14,18,20]
binary_search(arr, 5) |
# # WAP accept a number and check even or odd..
number = int(input("Enter number: "))
if(number == 0):
print("Zero")
elif(number % 2 == 0):
print("Even")
else:
print("Odd")
# # WAP accept three subject marks . Calculate % marks. and display grade as per following condition...
# # 80 - 100 > A... ..... 60 -<80 >> B..... 40- 60 >> C else D
marks1 = float(input("Enter marks for subject 1: "))
marks2 = float(input("Enter marks for subject 2: "))
marks3 = float(input("Enter marks for subject 3: "))
percent = (marks1+marks2+marks3)/3
if(percent >= 80 and percent <= 100):
print("Grade A")
elif(percent >= 60 and percent < 80):
print("Grade B")
elif(percent >= 40 and percent < 60):
print("Grade C")
else:
print("Grade D")
|
pizzas = ['hawaiian', 'pepperoni', 'margherita']
friend_pizzas = pizzas[:]
pizzas.append('marinara')
friend_pizzas.append('vegetariana')
print("My favorite pizzas are:")
for pizza in pizzas:
print(pizza)
print("\nMy friend's favorite pizzas are:")
for pizza in friend_pizzas:
print(pizza) |
class Lang:
""" Содержит языковые константы. """
CPP = 'cpp'
PYTHON = 'python'
JAVA = 'java'
SIM_LANGS = CPP, JAVA
PYCODE_LANGS = PYTHON
CHOICES = (
(CPP, CPP),
(PYTHON, PYTHON),
(JAVA, JAVA)
)
|
#
# PySNMP MIB module DOCS-IETF-BPI2-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DOCS-IETF-BPI2-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:43:47 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")
SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
InetAddressType, InetAddress = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance")
Counter64, Unsigned32, Integer32, mib_2, IpAddress, Bits, Gauge32, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, iso, TimeTicks, ObjectIdentity, NotificationType, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "Unsigned32", "Integer32", "mib-2", "IpAddress", "Bits", "Gauge32", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "iso", "TimeTicks", "ObjectIdentity", "NotificationType", "MibIdentifier")
MacAddress, RowStatus, StorageType, TextualConvention, TruthValue, DateAndTime, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "RowStatus", "StorageType", "TextualConvention", "TruthValue", "DateAndTime", "DisplayString")
docsBpi2MIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 126))
docsBpi2MIB.setRevisions(('2005-07-20 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: docsBpi2MIB.setRevisionsDescriptions(('Initial version of the IETF BPI+ MIB module. This version published as RFC 4131.',))
if mibBuilder.loadTexts: docsBpi2MIB.setLastUpdated('200507200000Z')
if mibBuilder.loadTexts: docsBpi2MIB.setOrganization('IETF IP over Cable Data Network (IPCDN) Working Group')
if mibBuilder.loadTexts: docsBpi2MIB.setContactInfo('--------------------------------------- Stuart M. Green E-mail: rubbersoul3@yahoo.com --------------------------------------- Kaz Ozawa Automotive Systems Development Center TOSHIBA CORPORATION 1-1, Shibaura 1-Chome Minato-ku, Tokyo 105-8001 Japan Phone: +81-3-3457-8569 Fax: +81-3-5444-9325 E-mail: Kazuyoshi.Ozawa@toshiba.co.jp --------------------------------------- Alexander Katsnelson Postal: Tel: +1-303-680-3924 E-mail: katsnelson6@peoplepc.com --------------------------------------- Eduardo Cardona Postal: Cable Television Laboratories, Inc. 858 Coal Creek Circle Louisville, CO 80027- 9750 U.S.A. Tel: +1 303 661 9100 Fax: +1 303 661 9199 E-mail: e.cardona@cablelabs.com --------------------------------------- IETF IPCDN Working Group General Discussion: ipcdn@ietf.org Subscribe: http://www.ietf.org/mailman/listinfo/ipcdn. Archive: ftp://ftp.ietf.org/ietf-mail-archive/ipcdn. Co-chairs: Richard Woundy, rwoundy@cisco.com Jean-Francois Mule, jfm@cablelabs.com')
if mibBuilder.loadTexts: docsBpi2MIB.setDescription('This is the MIB module for the DOCSIS Baseline Privacy Plus Interface (BPI+) at cable modems (CMs) and cable modem termination systems (CMTSs). Copyright (C) The Internet Society (2005). This version of this MIB module is part of RFC 4131; see the RFC itself for full legal notices.')
class DocsX509ASN1DEREncodedCertificate(TextualConvention, OctetString):
description = 'An X509 digital certificate encoded as an ASN.1 DER object.'
status = 'current'
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 4096)
class DocsSAId(TextualConvention, Integer32):
reference = 'DOCSIS Baseline Privacy Plus Interface specification, Section 2.1.3, BPI+ Security Associations'
description = 'Security Association identifier (SAID).'
status = 'current'
displayHint = 'd'
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 16383)
class DocsSAIdOrZero(TextualConvention, Unsigned32):
reference = 'DOCSIS Baseline Privacy Plus Interface specification, Section 2.1.3, BPI+ Security Associations'
description = 'Security Association identifier (SAID). The value zero indicates that the SAID is yet to be determined.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 16383), )
class DocsBpkmSAType(TextualConvention, Integer32):
reference = 'DOCSIS Baseline Privacy Plus Interface specification, Section 4.2.2.24'
description = "The type of security association (SA). The values of the named-numbers are associated with the BPKM SA-Type attributes: 'primary' corresponds to code '1', 'static' to code '2', and 'dynamic' to code '3'. The 'none' value must only be used if the SA type has yet to be determined."
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))
namedValues = NamedValues(("none", 0), ("primary", 1), ("static", 2), ("dynamic", 3))
class DocsBpkmDataEncryptAlg(TextualConvention, Integer32):
reference = 'DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.20.'
description = "The list of data encryption algorithms defined for the DOCSIS interface in the BPKM cryptographic-suite parameter. The value 'none' indicates that the SAID being referenced has no data encryption."
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))
namedValues = NamedValues(("none", 0), ("des56CbcMode", 1), ("des40CbcMode", 2), ("t3Des128CbcMode", 3), ("aes128CbcMode", 4), ("aes256CbcMode", 5))
class DocsBpkmDataAuthentAlg(TextualConvention, Integer32):
reference = 'DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.20.'
description = "The list of data integrity algorithms defined for the DOCSIS interface in the BPKM cryptographic-suite parameter. The value 'none' indicates that no data integrity is used for the SAID being referenced."
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1))
namedValues = NamedValues(("none", 0), ("hmacSha196", 1))
docsBpi2MIBObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 1))
docsBpi2CmObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 1, 1))
docsBpi2CmBaseTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 1, 1), )
if mibBuilder.loadTexts: docsBpi2CmBaseTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmBaseTable.setDescription('This table describes the basic and authorization- related Baseline Privacy Plus attributes of each CM MAC interface.')
docsBpi2CmBaseEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: docsBpi2CmBaseEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmBaseEntry.setDescription('Each entry contains objects describing attributes of one CM MAC interface. An entry in this table exists for each ifEntry with an ifType of docsCableMaclayer(127).')
docsBpi2CmPrivacyEnable = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmPrivacyEnable.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.1.1.')
if mibBuilder.loadTexts: docsBpi2CmPrivacyEnable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmPrivacyEnable.setDescription('This object identifies whether this CM is provisioned to run Baseline Privacy Plus.')
docsBpi2CmPublicKey = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 524))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmPublicKey.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.4.')
if mibBuilder.loadTexts: docsBpi2CmPublicKey.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmPublicKey.setDescription('The value of this object is a DER-encoded RSAPublicKey ASN.1 type string, as defined in the RSA Encryption Standard (PKCS #1), corresponding to the public key of the CM.')
docsBpi2CmAuthState = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("start", 1), ("authWait", 2), ("authorized", 3), ("reauthWait", 4), ("authRejectWait", 5), ("silent", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthState.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.1.2.1.')
if mibBuilder.loadTexts: docsBpi2CmAuthState.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthState.setDescription('The value of this object is the state of the CM authorization FSM. The start state indicates that FSM is in its initial state.')
docsBpi2CmAuthKeySequenceNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthKeySequenceNumber.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.2 and 4.2.2.10.')
if mibBuilder.loadTexts: docsBpi2CmAuthKeySequenceNumber.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthKeySequenceNumber.setDescription('The value of this object is the most recent authorization key sequence number for this FSM.')
docsBpi2CmAuthExpiresOld = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 5), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthExpiresOld.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.2 and 4.2.2.9.')
if mibBuilder.loadTexts: docsBpi2CmAuthExpiresOld.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthExpiresOld.setDescription('The value of this object is the actual clock time for expiration of the immediate predecessor of the most recent authorization key for this FSM. If this FSM has only one authorization key, then the value is the time of activation of this FSM.')
docsBpi2CmAuthExpiresNew = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 6), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthExpiresNew.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.2 and 4.2.2.9.')
if mibBuilder.loadTexts: docsBpi2CmAuthExpiresNew.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthExpiresNew.setDescription('The value of this object is the actual clock time for expiration of the most recent authorization key for this FSM.')
docsBpi2CmAuthReset = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 7), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: docsBpi2CmAuthReset.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.1.2.3.4.')
if mibBuilder.loadTexts: docsBpi2CmAuthReset.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthReset.setDescription("Setting this object to 'true' generates a Reauthorize event in the authorization FSM. Reading this object always returns FALSE. This object is for testing purposes only, and therefore it is not required to be associated with a last reset object.")
docsBpi2CmAuthGraceTime = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6047999))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthGraceTime.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.1.1.1.3.')
if mibBuilder.loadTexts: docsBpi2CmAuthGraceTime.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthGraceTime.setDescription('The value of this object is the grace time for an authorization key in seconds. A CM is expected to start trying to get a new authorization key beginning AuthGraceTime seconds before the most recent authorization key actually expires.')
docsBpi2CmTEKGraceTime = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 302399))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKGraceTime.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.1.1.1.6.')
if mibBuilder.loadTexts: docsBpi2CmTEKGraceTime.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKGraceTime.setDescription('The value of this object is the grace time for the TEK in seconds. The CM is expected to start trying to acquire a new TEK beginning TEK GraceTime seconds before the expiration of the most recent TEK.')
docsBpi2CmAuthWaitTimeout = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 30))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthWaitTimeout.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.1.1.1.1.')
if mibBuilder.loadTexts: docsBpi2CmAuthWaitTimeout.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthWaitTimeout.setDescription('The value of this object is the Authorize Wait Timeout in seconds.')
docsBpi2CmReauthWaitTimeout = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 30))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmReauthWaitTimeout.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.1.1.1.2.')
if mibBuilder.loadTexts: docsBpi2CmReauthWaitTimeout.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmReauthWaitTimeout.setDescription('The value of this object is the Reauthorize Wait Timeout in seconds.')
docsBpi2CmOpWaitTimeout = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmOpWaitTimeout.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.1.1.1.4.')
if mibBuilder.loadTexts: docsBpi2CmOpWaitTimeout.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmOpWaitTimeout.setDescription('The value of this object is the Operational Wait Timeout in seconds.')
docsBpi2CmRekeyWaitTimeout = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmRekeyWaitTimeout.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.1.1.1.5.')
if mibBuilder.loadTexts: docsBpi2CmRekeyWaitTimeout.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmRekeyWaitTimeout.setDescription('The value of this object is the Rekey Wait Timeout in seconds.')
docsBpi2CmAuthRejectWaitTimeout = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 600))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthRejectWaitTimeout.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.1.1.1.7.')
if mibBuilder.loadTexts: docsBpi2CmAuthRejectWaitTimeout.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthRejectWaitTimeout.setDescription('The value of this object is the Authorization Reject Wait Timeout in seconds.')
docsBpi2CmSAMapWaitTimeout = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmSAMapWaitTimeout.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.1.1.1.8.')
if mibBuilder.loadTexts: docsBpi2CmSAMapWaitTimeout.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmSAMapWaitTimeout.setDescription('The value of this object is the retransmission interval, in seconds, of SA Map Requests from the MAP Wait state.')
docsBpi2CmSAMapMaxRetries = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10))).setUnits('count').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmSAMapMaxRetries.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.1.1.1.9.')
if mibBuilder.loadTexts: docsBpi2CmSAMapMaxRetries.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmSAMapMaxRetries.setDescription('The value of this object is the maximum number of Map Request retries allowed.')
docsBpi2CmAuthentInfos = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthentInfos.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.9.')
if mibBuilder.loadTexts: docsBpi2CmAuthentInfos.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthentInfos.setDescription('The value of this object is the number of times the CM has transmitted an Authentication Information message. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmAuthRequests = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 18), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthRequests.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.1.')
if mibBuilder.loadTexts: docsBpi2CmAuthRequests.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthRequests.setDescription('The value of this object is the number of times the CM has transmitted an Authorization Request message. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmAuthReplies = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 19), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthReplies.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.2.')
if mibBuilder.loadTexts: docsBpi2CmAuthReplies.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthReplies.setDescription('The value of this object is the number of times the CM has received an Authorization Reply message. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmAuthRejects = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 20), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthRejects.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.3.')
if mibBuilder.loadTexts: docsBpi2CmAuthRejects.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthRejects.setDescription('The value of this object is the number of times the CM has received an Authorization Reject message. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmAuthInvalids = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 21), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthInvalids.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.7.')
if mibBuilder.loadTexts: docsBpi2CmAuthInvalids.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthInvalids.setDescription('The value of this object is the count of times the CM has received an Authorization Invalid message. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmAuthRejectErrorCode = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 8, 11))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("unauthorizedCm", 3), ("unauthorizedSaid", 4), ("permanentAuthorizationFailure", 8), ("timeOfDayNotAcquired", 11)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthRejectErrorCode.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.3 and 4.2.2.15.')
if mibBuilder.loadTexts: docsBpi2CmAuthRejectErrorCode.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthRejectErrorCode.setDescription('The value of this object is the enumerated description of the Error-Code in the most recent Authorization Reject message received by the CM. This has the value unknown(2) if the last Error-Code value was 0 and none(1) if no Authorization Reject message has been received since reboot.')
docsBpi2CmAuthRejectErrorString = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 23), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthRejectErrorString.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.3 and 4.2.2.6.')
if mibBuilder.loadTexts: docsBpi2CmAuthRejectErrorString.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthRejectErrorString.setDescription('The value of this object is the text string in the most recent Authorization Reject message received by the CM. This is a zero length string if no Authorization Reject message has been received since reboot.')
docsBpi2CmAuthInvalidErrorCode = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5, 6, 7))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("unauthorizedCm", 3), ("unsolicited", 5), ("invalidKeySequence", 6), ("keyRequestAuthenticationFailure", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthInvalidErrorCode.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.7 and 4.2.2.15.')
if mibBuilder.loadTexts: docsBpi2CmAuthInvalidErrorCode.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthInvalidErrorCode.setDescription('The value of this object is the enumerated description of the Error-Code in the most recent Authorization Invalid message received by the CM. This has the value unknown(2) if the last Error-Code value was 0 and none(1) if no Authorization Invalid message has been received since reboot.')
docsBpi2CmAuthInvalidErrorString = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 1, 1, 25), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmAuthInvalidErrorString.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.7 and 4.2.2.6.')
if mibBuilder.loadTexts: docsBpi2CmAuthInvalidErrorString.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmAuthInvalidErrorString.setDescription('The value of this object is the text string in the most recent Authorization Invalid message received by the CM. This is a zero length string if no Authorization Invalid message has been received since reboot.')
docsBpi2CmTEKTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 1, 2), )
if mibBuilder.loadTexts: docsBpi2CmTEKTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKTable.setDescription('This table describes the attributes of each CM Traffic Encryption Key (TEK) association. The CM maintains (no more than) one TEK association per SAID per CM MAC interface.')
docsBpi2CmTEKEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKSAId"))
if mibBuilder.loadTexts: docsBpi2CmTEKEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKEntry.setDescription('Each entry contains objects describing the TEK association attributes of one SAID. The CM MUST create one entry per SAID, regardless of whether the SAID was obtained from a Registration Response message, from an Authorization Reply message, or from any dynamic SAID establishment mechanisms.')
docsBpi2CmTEKSAId = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 1), DocsSAId())
if mibBuilder.loadTexts: docsBpi2CmTEKSAId.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.12.')
if mibBuilder.loadTexts: docsBpi2CmTEKSAId.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKSAId.setDescription('The value of this object is the DOCSIS Security Association ID (SAID).')
docsBpi2CmTEKSAType = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 2), DocsBpkmSAType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKSAType.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 2.1.3.')
if mibBuilder.loadTexts: docsBpi2CmTEKSAType.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKSAType.setDescription('The value of this object is the type of security association.')
docsBpi2CmTEKDataEncryptAlg = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 3), DocsBpkmDataEncryptAlg()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKDataEncryptAlg.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.20.')
if mibBuilder.loadTexts: docsBpi2CmTEKDataEncryptAlg.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKDataEncryptAlg.setDescription('The value of this object is the data encryption algorithm for this SAID.')
docsBpi2CmTEKDataAuthentAlg = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 4), DocsBpkmDataAuthentAlg()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKDataAuthentAlg.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.20.')
if mibBuilder.loadTexts: docsBpi2CmTEKDataAuthentAlg.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKDataAuthentAlg.setDescription('The value of this object is the data authentication algorithm for this SAID.')
docsBpi2CmTEKState = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("start", 1), ("opWait", 2), ("opReauthWait", 3), ("operational", 4), ("rekeyWait", 5), ("rekeyReauthWait", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKState.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.1.3.1.')
if mibBuilder.loadTexts: docsBpi2CmTEKState.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKState.setDescription('The value of this object is the state of the indicated TEK FSM. The start(1) state indicates that the FSM is in its initial state.')
docsBpi2CmTEKKeySequenceNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKKeySequenceNumber.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.2.10 and 4.2.2.13.')
if mibBuilder.loadTexts: docsBpi2CmTEKKeySequenceNumber.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKKeySequenceNumber.setDescription('The value of this object is the most recent TEK key sequence number for this TEK FSM.')
docsBpi2CmTEKExpiresOld = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 7), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKExpiresOld.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.5 and 4.2.2.9.')
if mibBuilder.loadTexts: docsBpi2CmTEKExpiresOld.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKExpiresOld.setDescription('The value of this object is the actual clock time for expiration of the immediate predecessor of the most recent TEK for this FSM. If this FSM has only one TEK, then the value is the time of activation of this FSM.')
docsBpi2CmTEKExpiresNew = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 8), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKExpiresNew.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.5 and 4.2.2.9.')
if mibBuilder.loadTexts: docsBpi2CmTEKExpiresNew.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKExpiresNew.setDescription('The value of this object is the actual clock time for expiration of the most recent TEK for this FSM.')
docsBpi2CmTEKKeyRequests = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRequests.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.4.')
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRequests.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRequests.setDescription('The value of this object is the number of times the CM has transmitted a Key Request message. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmTEKKeyReplies = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKKeyReplies.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.5.')
if mibBuilder.loadTexts: docsBpi2CmTEKKeyReplies.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKKeyReplies.setDescription('The value of this object is the number of times the CM has received a Key Reply message, including a message whose authentication failed. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmTEKKeyRejects = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRejects.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.6.')
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRejects.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRejects.setDescription('The value of this object is the number of times the CM has received a Key Reject message, including a message whose authentication failed. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmTEKInvalids = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKInvalids.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.8.')
if mibBuilder.loadTexts: docsBpi2CmTEKInvalids.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKInvalids.setDescription('The value of this object is the number of times the CM has received a TEK Invalid message, including a message whose authentication failed. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmTEKAuthPends = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKAuthPends.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.1.3.3.3.')
if mibBuilder.loadTexts: docsBpi2CmTEKAuthPends.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKAuthPends.setDescription('The value of this object is the count of times an Authorization Pending (Auth Pend) event occurred in this FSM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmTEKKeyRejectErrorCode = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("unauthorizedSaid", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRejectErrorCode.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.1.2.6 and 4.2.2.15.')
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRejectErrorCode.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRejectErrorCode.setDescription('The value of this object is the enumerated description of the Error-Code in the most recent Key Reject message received by the CM. This has the value unknown(2) if the last Error-Code value was 0 and none(1) if no Key Reject message has been received since registration.')
docsBpi2CmTEKKeyRejectErrorString = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 15), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRejectErrorString.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.1.2.6 and 4.2.2.6.')
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRejectErrorString.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKKeyRejectErrorString.setDescription('The value of this object is the text string in the most recent Key Reject message received by the CM. This is a zero length string if no Key Reject message has been received since registration.')
docsBpi2CmTEKInvalidErrorCode = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 6))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("invalidKeySequence", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKInvalidErrorCode.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.1.2.8 and 4.2.2.15.')
if mibBuilder.loadTexts: docsBpi2CmTEKInvalidErrorCode.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKInvalidErrorCode.setDescription('The value of this object is the enumerated description of the Error-Code in the most recent TEK Invalid message received by the CM. This has the value unknown(2) if the last Error-Code value was 0 and none(1) if no TEK Invalid message has been received since registration.')
docsBpi2CmTEKInvalidErrorString = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 2, 1, 17), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmTEKInvalidErrorString.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.1.2.8 and 4.2.2.6.')
if mibBuilder.loadTexts: docsBpi2CmTEKInvalidErrorString.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmTEKInvalidErrorString.setDescription('The value of this object is the text string in the most recent TEK Invalid message received by the CM. This is a zero length string if no TEK Invalid message has been received since registration.')
docsBpi2CmMulticastObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 1, 1, 3))
docsBpi2CmIpMulticastMapTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1), )
if mibBuilder.loadTexts: docsBpi2CmIpMulticastMapTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastMapTable.setDescription('This table maps multicast IP addresses to SAIDs per CM MAC Interface. It is intended to map multicast IP addresses associated with SA MAP Request messages.')
docsBpi2CmIpMulticastMapEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DOCS-IETF-BPI2-MIB", "docsBpi2CmIpMulticastIndex"))
if mibBuilder.loadTexts: docsBpi2CmIpMulticastMapEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastMapEntry.setDescription('Each entry contains objects describing the mapping of one multicast IP address to one SAID, as well as associated state, message counters, and error information. An entry may be removed from this table upon the reception of an SA Map Reject.')
docsBpi2CmIpMulticastIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)))
if mibBuilder.loadTexts: docsBpi2CmIpMulticastIndex.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastIndex.setDescription('The index of this row.')
docsBpi2CmIpMulticastAddressType = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1, 1, 2), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmIpMulticastAddressType.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastAddressType.setDescription('The type of Internet address for docsBpi2CmIpMulticastAddress.')
docsBpi2CmIpMulticastAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1, 1, 3), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmIpMulticastAddress.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 5.4.')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastAddress.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastAddress.setDescription('This object represents the IP multicast address to be mapped. The type of this address is determined by the value of the docsBpi2CmIpMulticastAddressType object.')
docsBpi2CmIpMulticastSAId = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1, 1, 4), DocsSAIdOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAId.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.12.')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAId.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAId.setDescription('This object represents the SAID to which the IP multicast address has been mapped. If no SA Map Reply has been received for the IP address, this object should have the value 0.')
docsBpi2CmIpMulticastSAMapState = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("start", 1), ("mapWait", 2), ("mapped", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapState.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 5.3.1.')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapState.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapState.setDescription('The value of this object is the state of the SA Mapping FSM for this IP.')
docsBpi2CmIpMulticastSAMapRequests = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRequests.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.10.')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRequests.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRequests.setDescription('The value of this object is the number of times the CM has transmitted an SA Map Request message for this IP. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmIpMulticastSAMapReplies = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapReplies.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.11.')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapReplies.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapReplies.setDescription('The value of this object is the number of times the CM has received an SA Map Reply message for this IP. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmIpMulticastSAMapRejects = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRejects.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.12.')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRejects.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRejects.setDescription('The value of this object is the number of times the CM has received an SA MAP Reject message for this IP. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmIpMulticastSAMapRejectErrorCode = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 9, 10))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("noAuthForRequestedDSFlow", 9), ("dsFlowNotMappedToSA", 10)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRejectErrorCode.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.12 and 4.2.2.15.')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRejectErrorCode.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRejectErrorCode.setDescription('The value of this object is the enumerated description of the Error-Code in the most recent SA Map Reject message sent in response to an SA Map Request for This IP. It has the value none(1) if no SA MAP Reject message has been received since entry creation.')
docsBpi2CmIpMulticastSAMapRejectErrorString = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 3, 1, 1, 10), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRejectErrorString.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.12 and 4.2.2.6.')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRejectErrorString.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmIpMulticastSAMapRejectErrorString.setDescription('The value of this object is the text string in the most recent SA Map Reject message sent in response to an SA Map Request for this IP. It is a zero length string if no SA Map Reject message has been received since entry creation.')
docsBpi2CmCertObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 1, 1, 4))
docsBpi2CmDeviceCertTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 1, 4, 1), )
if mibBuilder.loadTexts: docsBpi2CmDeviceCertTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmDeviceCertTable.setDescription('This table describes the Baseline Privacy Plus device certificates for each CM MAC interface.')
docsBpi2CmDeviceCertEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 1, 4, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: docsBpi2CmDeviceCertEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmDeviceCertEntry.setDescription('Each entry contains the device certificates of one CM MAC interface. An entry in this table exists for each ifEntry with an ifType of docsCableMaclayer(127).')
docsBpi2CmDeviceCmCert = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 4, 1, 1, 1), DocsX509ASN1DEREncodedCertificate()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: docsBpi2CmDeviceCmCert.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.1.')
if mibBuilder.loadTexts: docsBpi2CmDeviceCmCert.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmDeviceCmCert.setDescription("The X509 DER-encoded cable modem certificate. Note: This object can be set only when the value is the zero-length OCTET STRING; otherwise, an error of 'inconsistentValue' is returned. Once the object contains the certificate, its access MUST be read-only and persists after re-initialization of the managed system.")
docsBpi2CmDeviceManufCert = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 4, 1, 1, 2), DocsX509ASN1DEREncodedCertificate()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmDeviceManufCert.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.1.')
if mibBuilder.loadTexts: docsBpi2CmDeviceManufCert.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmDeviceManufCert.setDescription('The X509 DER-encoded manufacturer certificate that signed the cable modem certificate.')
docsBpi2CmCryptoSuiteTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 1, 5), )
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteTable.setDescription('This table describes the Baseline Privacy Plus cryptographic suite capabilities for each CM MAC interface.')
docsBpi2CmCryptoSuiteEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 1, 5, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DOCS-IETF-BPI2-MIB", "docsBpi2CmCryptoSuiteIndex"))
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteEntry.setDescription('Each entry contains a cryptographic suite pair that this CM MAC supports.')
docsBpi2CmCryptoSuiteIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 5, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000)))
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteIndex.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteIndex.setDescription('The index for a cryptographic suite row.')
docsBpi2CmCryptoSuiteDataEncryptAlg = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 5, 1, 2), DocsBpkmDataEncryptAlg()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteDataEncryptAlg.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.20.')
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteDataEncryptAlg.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteDataEncryptAlg.setDescription('The value of this object is the data encryption algorithm for this cryptographic suite capability.')
docsBpi2CmCryptoSuiteDataAuthentAlg = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 1, 5, 1, 3), DocsBpkmDataAuthentAlg()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteDataAuthentAlg.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.20.')
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteDataAuthentAlg.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmCryptoSuiteDataAuthentAlg.setDescription('The value of this object is the data authentication algorithm for this cryptographic suite capability.')
docsBpi2CmtsObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 1, 2))
docsBpi2CmtsBaseTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 2, 1), )
if mibBuilder.loadTexts: docsBpi2CmtsBaseTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsBaseTable.setDescription('This table describes the basic Baseline Privacy attributes of each CMTS MAC interface.')
docsBpi2CmtsBaseEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: docsBpi2CmtsBaseEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsBaseEntry.setDescription('Each entry contains objects describing attributes of one CMTS MAC interface. An entry in this table exists for each ifEntry with an ifType of docsCableMaclayer(127).')
docsBpi2CmtsDefaultAuthLifetime = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6048000)).clone(604800)).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: docsBpi2CmtsDefaultAuthLifetime.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.2.')
if mibBuilder.loadTexts: docsBpi2CmtsDefaultAuthLifetime.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsDefaultAuthLifetime.setDescription('The value of this object is the default lifetime, in seconds, that the CMTS assigns to a new authorization key. This object value persists after re-initialization of the managed system.')
docsBpi2CmtsDefaultTEKLifetime = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 604800)).clone(43200)).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: docsBpi2CmtsDefaultTEKLifetime.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Appendix A.2.')
if mibBuilder.loadTexts: docsBpi2CmtsDefaultTEKLifetime.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsDefaultTEKLifetime.setDescription('The value of this object is the default lifetime, in seconds, that the CMTS assigns to a new Traffic Encryption Key (TEK). This object value persists after re-initialization of the managed system.')
docsBpi2CmtsDefaultSelfSignedManufCertTrust = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("trusted", 1), ("untrusted", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: docsBpi2CmtsDefaultSelfSignedManufCertTrust.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.4.1')
if mibBuilder.loadTexts: docsBpi2CmtsDefaultSelfSignedManufCertTrust.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsDefaultSelfSignedManufCertTrust.setDescription('This object determines the default trust of self-signed manufacturer certificate entries, contained in docsBpi2CmtsCACertTable, and created after this object is set. This object need not persist after re-initialization of the managed system.')
docsBpi2CmtsCheckCertValidityPeriods = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 4), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: docsBpi2CmtsCheckCertValidityPeriods.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.4.2')
if mibBuilder.loadTexts: docsBpi2CmtsCheckCertValidityPeriods.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCheckCertValidityPeriods.setDescription("Setting this object to 'true' causes all chained and root certificates in the chain to have their validity periods checked against the current time of day, when the CMTS receives an Authorization Request from the CM. A 'false' setting causes all certificates in the chain not to have their validity periods checked against the current time of day. This object need not persist after re-initialization of the managed system.")
docsBpi2CmtsAuthentInfos = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthentInfos.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.9.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthentInfos.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthentInfos.setDescription('The value of this object is the number of times the CMTS has received an Authentication Information message from any CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsAuthRequests = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthRequests.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.1.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthRequests.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthRequests.setDescription('The value of this object is the number of times the CMTS has received an Authorization Request message from any CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsAuthReplies = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthReplies.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.2.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthReplies.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthReplies.setDescription('The value of this object is the number of times the CMTS has transmitted an Authorization Reply message to any CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsAuthRejects = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthRejects.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.3.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthRejects.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthRejects.setDescription('The value of this object is the number of times the CMTS has transmitted an Authorization Reject message to any CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsAuthInvalids = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthInvalids.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.7.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthInvalids.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthInvalids.setDescription('The value of this object is the number of times the CMTS has transmitted an Authorization Invalid message to any CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsSAMapRequests = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsSAMapRequests.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.10.')
if mibBuilder.loadTexts: docsBpi2CmtsSAMapRequests.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsSAMapRequests.setDescription('The value of this object is the number of times the CMTS has received an SA Map Request message from any CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsSAMapReplies = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsSAMapReplies.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.11.')
if mibBuilder.loadTexts: docsBpi2CmtsSAMapReplies.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsSAMapReplies.setDescription('The value of this object is the number of times the CMTS has transmitted an SA Map Reply message to any CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsSAMapRejects = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 1, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsSAMapRejects.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.12.')
if mibBuilder.loadTexts: docsBpi2CmtsSAMapRejects.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsSAMapRejects.setDescription('The value of this object is the number of times the CMTS has transmitted an SA Map Reject message to any CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsAuthTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 2, 2), )
if mibBuilder.loadTexts: docsBpi2CmtsAuthTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthTable.setDescription('This table describes the attributes of each CM authorization association. The CMTS maintains one authorization association with each Baseline Privacy- enabled CM, registered on each CMTS MAC interface, regardless of whether the CM is authorized or rejected.')
docsBpi2CmtsAuthEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmMacAddress"))
if mibBuilder.loadTexts: docsBpi2CmtsAuthEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthEntry.setDescription('Each entry contains objects describing attributes of one authorization association. The CMTS MUST create one entry per CM per MAC interface, based on the receipt of an Authorization Request message, and MUST not delete the entry until the CM loses registration.')
docsBpi2CmtsAuthCmMacAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 1), MacAddress())
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmMacAddress.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmMacAddress.setDescription('The value of this object is the physical address of the CM to which the authorization association applies.')
docsBpi2CmtsAuthCmBpiVersion = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("bpi", 0), ("bpiPlus", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmBpiVersion.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.22; ANSI/SCTE 22-2 2002(formerly DSS 02-03) Data-Over-Cable Service Interface Specification DOCSIS 1.0 Baseline Privacy Interface (BPI)')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmBpiVersion.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmBpiVersion.setDescription("The value of this object is the version of Baseline Privacy for which this CM has registered. The value 'bpiplus' represents the value of BPI-Version Attribute of the Baseline Privacy Key Management BPKM attribute BPI-Version (1). The value 'bpi' is used to represent the CM registered using DOCSIS 1.0 Baseline Privacy.")
docsBpi2CmtsAuthCmPublicKey = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 524))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmPublicKey.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.4.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmPublicKey.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmPublicKey.setDescription('The value of this object is a DER-encoded RSAPublicKey ASN.1 type string, as defined in the RSA Encryption Standard (PKCS #1), corresponding to the public key of the CM. This is the zero-length OCTET STRING if the CMTS does not retain the public key.')
docsBpi2CmtsAuthCmKeySequenceNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmKeySequenceNumber.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.2 and 4.2.2.10.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmKeySequenceNumber.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmKeySequenceNumber.setDescription('The value of this object is the most recent authorization key sequence number for this CM.')
docsBpi2CmtsAuthCmExpiresOld = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 5), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmExpiresOld.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.2 and 4.2.2.9.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmExpiresOld.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmExpiresOld.setDescription('The value of this object is the actual clock time for expiration of the immediate predecessor of the most recent authorization key for this FSM. If this FSM has only one authorization key, then the value is the time of activation of this FSM. Note: This object has no meaning for CMs running in BPI mode; therefore, this object is not instantiated for entries associated to those CMs.')
docsBpi2CmtsAuthCmExpiresNew = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 6), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmExpiresNew.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.2 and 4.2.2.9.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmExpiresNew.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmExpiresNew.setDescription('The value of this object is the actual clock time for expiration of the most recent authorization key for this FSM.')
docsBpi2CmtsAuthCmLifetime = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6048000))).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmLifetime.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.2 and Appendix A.2.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmLifetime.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmLifetime.setDescription('The value of this object is the lifetime, in seconds, that the CMTS assigns to an authorization key for this CM.')
docsBpi2CmtsAuthCmReset = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("noResetRequested", 1), ("invalidateAuth", 2), ("sendAuthInvalid", 3), ("invalidateTeks", 4)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmReset.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.1.2.3.4, 4.1.2.3.5, and 4.1.3.3.5.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmReset.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmReset.setDescription("Setting this object to invalidateAuth(2) causes the CMTS to invalidate the current CM authorization key(s), but not to transmit an Authorization Invalid message nor to invalidate the primary SAID's TEKs. Setting this object to sendAuthInvalid(3) causes the CMTS to invalidate the current CM authorization key(s), and to transmit an Authorization Invalid message to the CM, but not to invalidate the primary SAID's TEKs. Setting this object to invalidateTeks(4) causes the CMTS to invalidate the current CM authorization key(s), to transmit an Authorization Invalid message to the CM, and to invalidate the TEKs associated with this CM's primary SAID. For BPI mode, substitute all of the CM's unicast TEKs for the primary SAID's TEKs in the previous paragraph. Reading this object returns the most recently set value of this object or, if the object has not been set since entry creation, returns noResetRequested(1).")
docsBpi2CmtsAuthCmInfos = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmInfos.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.9.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmInfos.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmInfos.setDescription('The value of this object is the number of times the CMTS has received an Authentication Information message from this CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsAuthCmRequests = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmRequests.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.1.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmRequests.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmRequests.setDescription('The value of this object is the number of times the CMTS has received an Authorization Request message from this CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsAuthCmReplies = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmReplies.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.2.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmReplies.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmReplies.setDescription('The value of this object is the number of times the CMTS has transmitted an Authorization Reply message to this CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsAuthCmRejects = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmRejects.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.3.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmRejects.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmRejects.setDescription('The value of this object is the number of times the CMTS has transmitted an Authorization Reject message to this CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsAuthCmInvalids = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmInvalids.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.7.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmInvalids.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCmInvalids.setDescription('The value of this object is the number of times the CMTS has transmitted an Authorization Invalid message to this CM. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsAuthRejectErrorCode = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 8, 11))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("unauthorizedCm", 3), ("unauthorizedSaid", 4), ("permanentAuthorizationFailure", 8), ("timeOfDayNotAcquired", 11)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthRejectErrorCode.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.3 and 4.2.2.15.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthRejectErrorCode.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthRejectErrorCode.setDescription('The value of this object is the enumerated description of the Error-Code in the most recent Authorization Reject message transmitted to the CM. This has the value unknown(2) if the last Error-Code value was 0 and none(1) if no Authorization Reject message has been transmitted to the CM since entry creation.')
docsBpi2CmtsAuthRejectErrorString = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 15), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthRejectErrorString.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.3 and 4.2.2.6.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthRejectErrorString.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthRejectErrorString.setDescription('The value of this object is the text string in the most recent Authorization Reject message transmitted to the CM. This is a zero length string if no Authorization Reject message has been transmitted to the CM since entry creation.')
docsBpi2CmtsAuthInvalidErrorCode = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5, 6, 7))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("unauthorizedCm", 3), ("unsolicited", 5), ("invalidKeySequence", 6), ("keyRequestAuthenticationFailure", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthInvalidErrorCode.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.7 and 4.2.2.15.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthInvalidErrorCode.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthInvalidErrorCode.setDescription('The value of this object is the enumerated description of the Error-Code in the most recent Authorization Invalid message transmitted to the CM. This has the value unknown(2) if the last Error-Code value was 0 and none(1) if no Authorization Invalid message has been transmitted to the CM since entry creation.')
docsBpi2CmtsAuthInvalidErrorString = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 17), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthInvalidErrorString.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.7 and 4.2.2.6.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthInvalidErrorString.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthInvalidErrorString.setDescription('The value of this object is the text string in the most recent Authorization Invalid message transmitted to the CM. This is a zero length string if no Authorization Invalid message has been transmitted to the CM since entry creation.')
docsBpi2CmtsAuthPrimarySAId = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 18), DocsSAIdOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthPrimarySAId.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 2.1.3.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthPrimarySAId.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthPrimarySAId.setDescription('The value of this object is the Primary Security Association identifier. For BPI mode, the value must be any unicast SID.')
docsBpi2CmtsAuthBpkmCmCertValid = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("unknown", 0), ("validCmChained", 1), ("validCmTrusted", 2), ("invalidCmUntrusted", 3), ("invalidCAUntrusted", 4), ("invalidCmOther", 5), ("invalidCAOther", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthBpkmCmCertValid.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.4.2.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthBpkmCmCertValid.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthBpkmCmCertValid.setDescription("Contains the reason why a CM's certificate is deemed valid or invalid. Return unknown(0) if the CM is running BPI mode. ValidCmChained(1) means the certificate is valid because it chains to a valid certificate. ValidCmTrusted(2) means the certificate is valid because it has been provisioned (in the docsBpi2CmtsProvisionedCmCert table) to be trusted. InvalidCmUntrusted(3) means the certificate is invalid because it has been provisioned (in the docsBpi2CmtsProvisionedCmCert table) to be untrusted. InvalidCAUntrusted(4) means the certificate is invalid because it chains to an untrusted certificate. InvalidCmOther(5) and InvalidCAOther(6) refer to errors in parsing, validity periods, etc., which are attributable to the CM certificate or its chain, respectively; additional information may be found in docsBpi2AuthRejectErrorString for these types of errors.")
docsBpi2CmtsAuthBpkmCmCert = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 20), DocsX509ASN1DEREncodedCertificate()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthBpkmCmCert.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.2.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthBpkmCmCert.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthBpkmCmCert.setDescription('The X509 CM Certificate sent as part of a BPKM Authorization Request. Note: The zero-length OCTET STRING must be returned if the Entire certificate is not retained in the CMTS.')
docsBpi2CmtsAuthCACertIndexPtr = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 2, 1, 21), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsAuthCACertIndexPtr.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.2.')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCACertIndexPtr.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsAuthCACertIndexPtr.setDescription('A row index into docsBpi2CmtsCACertTable. Returns the index in docsBpi2CmtsCACertTable to which CA certificate this CM is chained to. A value of 0 means it could not be found or not applicable.')
docsBpi2CmtsTEKTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 2, 3), )
if mibBuilder.loadTexts: docsBpi2CmtsTEKTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKTable.setDescription('This table describes the attributes of each Traffic Encryption Key (TEK) association. The CMTS Maintains one TEK association per SAID on each CMTS MAC interface.')
docsBpi2CmtsTEKEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKSAId"))
if mibBuilder.loadTexts: docsBpi2CmtsTEKEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKEntry.setDescription('Each entry contains objects describing attributes of one TEK association on a particular CMTS MAC interface. The CMTS MUST create one entry per SAID per MAC interface, based on the receipt of a Key Request message, and MUST not delete the entry before the CM authorization for the SAID permanently expires.')
docsBpi2CmtsTEKSAId = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 1), DocsSAId())
if mibBuilder.loadTexts: docsBpi2CmtsTEKSAId.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.12.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKSAId.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKSAId.setDescription('The value of this object is the DOCSIS Security Association ID (SAID).')
docsBpi2CmtsTEKSAType = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 2), DocsBpkmSAType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsTEKSAType.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 2.1.3.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKSAType.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKSAType.setDescription("The value of this object is the type of security association. 'dynamic' does not apply to CMs running in BPI mode. Unicast BPI TEKs must utilize the 'primary' encoding, and multicast BPI TEKs must utilize the 'static' encoding.")
docsBpi2CmtsTEKDataEncryptAlg = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 3), DocsBpkmDataEncryptAlg()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsTEKDataEncryptAlg.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.20.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKDataEncryptAlg.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKDataEncryptAlg.setDescription('The value of this object is the data encryption algorithm for this SAID.')
docsBpi2CmtsTEKDataAuthentAlg = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 4), DocsBpkmDataAuthentAlg()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsTEKDataAuthentAlg.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.20.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKDataAuthentAlg.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKDataAuthentAlg.setDescription('The value of this object is the data authentication algorithm for this SAID.')
docsBpi2CmtsTEKLifetime = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 604800))).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: docsBpi2CmtsTEKLifetime.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.5 and Appendix A.2.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKLifetime.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKLifetime.setDescription('The value of this object is the lifetime, in seconds, that the CMTS assigns to keys for this TEK association.')
docsBpi2CmtsTEKKeySequenceNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsTEKKeySequenceNumber.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.2.10 and 4.2.2.13.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKKeySequenceNumber.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKKeySequenceNumber.setDescription('The value of this object is the most recent TEK key sequence number for this SAID.')
docsBpi2CmtsTEKExpiresOld = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 7), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsTEKExpiresOld.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.5 and 4.2.2.9.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKExpiresOld.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKExpiresOld.setDescription('The value of this object is the actual clock time for expiration of the immediate predecessor of the most recent TEK for this FSM. If this FSM has only one TEK, then the value is the time of activation of this FSM.')
docsBpi2CmtsTEKExpiresNew = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 8), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsTEKExpiresNew.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.5 and 4.2.2.9.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKExpiresNew.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKExpiresNew.setDescription('The value of this object is the actual clock time for expiration of the most recent TEK for this FSM.')
docsBpi2CmtsTEKReset = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 9), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: docsBpi2CmtsTEKReset.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.1.3.3.5.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKReset.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKReset.setDescription("Setting this object to 'true' causes the CMTS to invalidate all currently active TEKs and to generate new TEKs for the associated SAID; the CMTS MAY also generate unsolicited TEK Invalid messages, to optimize the TEK synchronization between the CMTS and the CM(s). Reading this object always returns FALSE.")
docsBpi2CmtsKeyRequests = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsKeyRequests.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.4.')
if mibBuilder.loadTexts: docsBpi2CmtsKeyRequests.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsKeyRequests.setDescription('The value of this object is the number of times the CMTS has received a Key Request message. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsKeyReplies = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsKeyReplies.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.5.')
if mibBuilder.loadTexts: docsBpi2CmtsKeyReplies.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsKeyReplies.setDescription('The value of this object is the number of times the CMTS has transmitted a Key Reply message. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsKeyRejects = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsKeyRejects.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.6.')
if mibBuilder.loadTexts: docsBpi2CmtsKeyRejects.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsKeyRejects.setDescription('The value of this object is the number of times the CMTS has transmitted a Key Reject message. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsTEKInvalids = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsTEKInvalids.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.8.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKInvalids.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKInvalids.setDescription('The value of this object is the number of times the CMTS has transmitted a TEK Invalid message. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsKeyRejectErrorCode = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("unauthorizedSaid", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsKeyRejectErrorCode.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.6 and 4.2.2.15.')
if mibBuilder.loadTexts: docsBpi2CmtsKeyRejectErrorCode.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsKeyRejectErrorCode.setDescription('The value of this object is the enumerated description of the Error-Code in the most recent Key Reject message sent in response to a Key Request for this SAID. This has the value unknown(2) if the last Error-Code value was 0 and none(1) if no Key Reject message has been received since registration.')
docsBpi2CmtsKeyRejectErrorString = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 15), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsKeyRejectErrorString.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.6 and 4.2.2.6.')
if mibBuilder.loadTexts: docsBpi2CmtsKeyRejectErrorString.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsKeyRejectErrorString.setDescription('The value of this object is the text string in the most recent Key Reject message sent in response to a Key Request for this SAID. This is a zero length string if no Key Reject message has been received since registration.')
docsBpi2CmtsTEKInvalidErrorCode = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 6))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("invalidKeySequence", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsTEKInvalidErrorCode.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.8 and 4.2.2.15.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKInvalidErrorCode.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKInvalidErrorCode.setDescription('The value of this object is the enumerated description of the Error-Code in the most recent TEK Invalid message sent in association with this SAID. This has the value unknown(2) if the last Error-Code value was 0 and none(1) if no TEK Invalid message has been received since registration.')
docsBpi2CmtsTEKInvalidErrorString = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 3, 1, 17), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsTEKInvalidErrorString.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.8 and 4.2.2.6.')
if mibBuilder.loadTexts: docsBpi2CmtsTEKInvalidErrorString.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsTEKInvalidErrorString.setDescription('The value of this object is the text string in the most recent TEK Invalid message sent in association with this SAID. This is a zero length string if no TEK Invalid message has been received since registration.')
docsBpi2CmtsMulticastObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 1, 2, 4))
docsBpi2CmtsIpMulticastMapTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1), )
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastMapTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastMapTable.setDescription('This table maps multicast IP addresses to SAIDs. If a multicast IP address is mapped by multiple rows in the table, the row with the lowest docsBpi2CmtsIpMulticastIndex must be utilized for the mapping.')
docsBpi2CmtsIpMulticastMapEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastIndex"))
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastMapEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastMapEntry.setDescription('Each entry contains objects describing the mapping of a set of multicast IP address and the mask to one SAID associated to a CMTS MAC Interface, as well as associated message counters and error information.')
docsBpi2CmtsIpMulticastIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)))
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastIndex.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastIndex.setDescription("The index of this row. Conceptual rows having the value 'permanent' need not allow write-access to any columnar objects in the row.")
docsBpi2CmtsIpMulticastAddressType = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 2), InetAddressType().clone('ipv4')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastAddressType.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastAddressType.setDescription('The type of Internet address for docsBpi2CmtsIpMulticastAddress and docsBpi2CmtsIpMulticastMask.')
docsBpi2CmtsIpMulticastAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 3), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastAddress.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastAddress.setDescription('This object represents the IP multicast address to be mapped, in conjunction with docsBpi2CmtsIpMulticastMask. The type of this address is determined by the value of the object docsBpi2CmtsIpMulticastAddressType.')
docsBpi2CmtsIpMulticastMask = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 4), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastMask.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastMask.setDescription("This object represents the IP multicast address mask for this row. An IP multicast address matches this row if the logical AND of the address with docsBpi2CmtsIpMulticastMask is identical to the logical AND of docsBpi2CmtsIpMulticastAddr with docsBpi2CmtsIpMulticastMask. The type of this address is determined by the value of the object docsBpi2CmtsIpMulticastAddressType. Note: For IPv6, this object need not represent a contiguous netmask; e.g., to associate a SAID to a multicast group matching 'any' multicast scope. The TC InetAddressPrefixLength is not used, as it only represents contiguous netmask.")
docsBpi2CmtsIpMulticastSAId = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 5), DocsSAIdOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAId.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAId.setDescription('This object represents the multicast SAID to be used in this IP multicast address mapping entry.')
docsBpi2CmtsIpMulticastSAType = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 6), DocsBpkmSAType()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAType.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 2.1.3.')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAType.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAType.setDescription("The value of this object is the type of security association. 'dynamic' does not apply to CMs running in BPI mode. Unicast BPI TEKs must utilize the 'primary' encoding, and multicast BPI TEKs must utilize the 'static' encoding. By default, SNMP created entries set this object to 'static' if not set at row creation.")
docsBpi2CmtsIpMulticastDataEncryptAlg = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 7), DocsBpkmDataEncryptAlg().clone('des56CbcMode')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastDataEncryptAlg.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.20.')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastDataEncryptAlg.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastDataEncryptAlg.setDescription('The value of this object is the data encryption algorithm for this IP.')
docsBpi2CmtsIpMulticastDataAuthentAlg = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 8), DocsBpkmDataAuthentAlg().clone('none')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastDataAuthentAlg.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.2.20.')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastDataAuthentAlg.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastDataAuthentAlg.setDescription('The value of this object is the data authentication algorithm for this IP.')
docsBpi2CmtsIpMulticastSAMapRequests = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRequests.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.10.')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRequests.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRequests.setDescription('The value of this object is the number of times the CMTS has received an SA Map Request message for this IP. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsIpMulticastSAMapReplies = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapReplies.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.11.')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapReplies.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapReplies.setDescription('The value of this object is the number of times the CMTS has transmitted an SA Map Reply message for this IP. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsIpMulticastSAMapRejects = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRejects.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 4.2.1.12.')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRejects.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRejects.setDescription('The value of this object is the number of times the CMTS has transmitted an SA Map Reject message for this IP. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
docsBpi2CmtsIpMulticastSAMapRejectErrorCode = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 9, 10))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("noAuthForRequestedDSFlow", 9), ("dsFlowNotMappedToSA", 10)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRejectErrorCode.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.12 and 4.2.2.15.')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRejectErrorCode.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRejectErrorCode.setDescription('The value of this object is the enumerated description of the Error-Code in the most recent SA Map Reject message sent in response to an SA Map Request for this IP. It has the value unknown(2) if the last Error-Code Value was 0 and none(1) if no SA MAP Reject message has been received since entry creation.')
docsBpi2CmtsIpMulticastSAMapRejectErrorString = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 13), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRejectErrorString.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections 4.2.1.12 and 4.2.2.6.')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRejectErrorString.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastSAMapRejectErrorString.setDescription('The value of this object is the text string in the most recent SA Map Reject message sent in response to an SA Map Request for this IP. It is a zero length string if no SA Map Reject message has been received since entry creation.')
docsBpi2CmtsIpMulticastMapControl = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 14), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastMapControl.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastMapControl.setDescription('This object controls and reflects the IP multicast address mapping entry. There is no restriction on the ability to change values in this row while the row is active. A created row can be set to active only after the Corresponding instances of docsBpi2CmtsIpMulticastAddress, docsBpi2CmtsIpMulticastMask, docsBpi2CmtsIpMulticastSAId, and docsBpi2CmtsIpMulticastSAType have all been set.')
docsBpi2CmtsIpMulticastMapStorageType = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 1, 1, 15), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastMapStorageType.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsIpMulticastMapStorageType.setDescription("The storage type for this conceptual row. Conceptual rows having the value 'permanent' need not allow write-access to any columnar objects in the row.")
docsBpi2CmtsMulticastAuthTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 2), )
if mibBuilder.loadTexts: docsBpi2CmtsMulticastAuthTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsMulticastAuthTable.setDescription('This table describes the multicast SAID authorization for each CM on each CMTS MAC interface.')
docsBpi2CmtsMulticastAuthEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DOCS-IETF-BPI2-MIB", "docsBpi2CmtsMulticastAuthSAId"), (0, "DOCS-IETF-BPI2-MIB", "docsBpi2CmtsMulticastAuthCmMacAddress"))
if mibBuilder.loadTexts: docsBpi2CmtsMulticastAuthEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsMulticastAuthEntry.setDescription('Each entry contains objects describing the key authorization of one cable modem for one multicast SAID for one CMTS MAC interface. Row entries persist after re-initialization of the managed system.')
docsBpi2CmtsMulticastAuthSAId = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 2, 1, 1), DocsSAId())
if mibBuilder.loadTexts: docsBpi2CmtsMulticastAuthSAId.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsMulticastAuthSAId.setDescription('This object represents the multicast SAID for authorization.')
docsBpi2CmtsMulticastAuthCmMacAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 2, 1, 2), MacAddress())
if mibBuilder.loadTexts: docsBpi2CmtsMulticastAuthCmMacAddress.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsMulticastAuthCmMacAddress.setDescription('This object represents the MAC address of the CM to which the multicast SAID authorization applies.')
docsBpi2CmtsMulticastAuthControl = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 4, 2, 1, 3), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsMulticastAuthControl.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsMulticastAuthControl.setDescription('The status of this conceptual row for the authorization of multicast SAIDs to CMs.')
docsBpi2CmtsCertObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 1, 2, 5))
docsBpi2CmtsProvisionedCmCertTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 1), )
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertTable.setDescription('A table of CM certificate trust entries provisioned to the CMTS. The trust object for a certificate in this table has an overriding effect on the validity object of a certificate in the authorization table, as long as the entire contents of the two certificates are identical.')
docsBpi2CmtsProvisionedCmCertEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 1, 1), ).setIndexNames((0, "DOCS-IETF-BPI2-MIB", "docsBpi2CmtsProvisionedCmCertMacAddress"))
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertEntry.setReference('Data-Over-Cable Service Interface Specifications: Operations Support System Interface Specification SP-OSSIv2.0-I05-040407, Section 6.2.14')
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertEntry.setDescription("An entry in the CMTS's provisioned CM certificate table. Row entries persist after re-initialization of the managed system.")
docsBpi2CmtsProvisionedCmCertMacAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 1, 1, 1), MacAddress())
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertMacAddress.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertMacAddress.setDescription('The index of this row.')
docsBpi2CmtsProvisionedCmCertTrust = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("trusted", 1), ("untrusted", 2))).clone('untrusted')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertTrust.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.4.1.')
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertTrust.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertTrust.setDescription('Trust state for the provisioned CM certificate entry. Note: Setting this object need only override the validity of CM certificates sent in future authorization requests; instantaneous effect need not occur.')
docsBpi2CmtsProvisionedCmCertSource = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("snmp", 1), ("configurationFile", 2), ("externalDatabase", 3), ("other", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertSource.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.4.1.')
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertSource.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertSource.setDescription('This object indicates how the certificate reached the CMTS. Other(4) means that it originated from a source not identified above.')
docsBpi2CmtsProvisionedCmCertStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 1, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertStatus.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCertStatus.setDescription("The status of this conceptual row. Values in this row cannot be changed while the row is 'active'.")
docsBpi2CmtsProvisionedCmCert = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 1, 1, 5), DocsX509ASN1DEREncodedCertificate()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCert.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.2.')
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCert.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsProvisionedCmCert.setDescription('An X509 DER-encoded Certificate Authority certificate. Note: The zero-length OCTET STRING must be returned, on reads, if the entire certificate is not retained in the CMTS.')
docsBpi2CmtsCACertTable = MibTable((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 2), )
if mibBuilder.loadTexts: docsBpi2CmtsCACertTable.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCACertTable.setDescription('The table of known Certificate Authority certificates acquired by this device.')
docsBpi2CmtsCACertEntry = MibTableRow((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 2, 1), ).setIndexNames((0, "DOCS-IETF-BPI2-MIB", "docsBpi2CmtsCACertIndex"))
if mibBuilder.loadTexts: docsBpi2CmtsCACertEntry.setReference('Data-Over-Cable Service Interface Specifications: Operations Support System Interface Specification SP-OSSIv2.0-I05-040407, Section 6.2.14')
if mibBuilder.loadTexts: docsBpi2CmtsCACertEntry.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCACertEntry.setDescription("A row in the Certificate Authority certificate table. Row entries with the trust status 'trusted', 'untrusted', or 'root' persist after re-initialization of the managed system.")
docsBpi2CmtsCACertIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 2, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)))
if mibBuilder.loadTexts: docsBpi2CmtsCACertIndex.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCACertIndex.setDescription('The index for this row.')
docsBpi2CmtsCACertSubject = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 2, 1, 2), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsCACertSubject.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.2.4')
if mibBuilder.loadTexts: docsBpi2CmtsCACertSubject.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCACertSubject.setDescription("The subject name exactly as it is encoded in the X509 certificate. The organizationName portion of the certificate's subject name must be present. All other fields are optional. Any optional field present must be prepended with <CR> (carriage return, U+000D) <LF> (line feed, U+000A). Ordering of fields present must conform to the following: organizationName <CR> <LF> countryName <CR> <LF> stateOrProvinceName <CR> <LF> localityName <CR> <LF> organizationalUnitName <CR> <LF> organizationalUnitName=<Manufacturing Location> <CR> <LF> commonName")
docsBpi2CmtsCACertIssuer = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 2, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsCACertIssuer.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.2.4')
if mibBuilder.loadTexts: docsBpi2CmtsCACertIssuer.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCACertIssuer.setDescription("The issuer name exactly as it is encoded in the X509 certificate. The commonName portion of the certificate's issuer name must be present. All other fields are optional. Any optional field present must be prepended with <CR> (carriage return, U+000D) <LF> (line feed, U+000A). Ordering of fields present must conform to the following: CommonName <CR><LF> countryName <CR><LF> stateOrProvinceName <CR><LF> localityName <CR><LF> organizationName <CR><LF> organizationalUnitName <CR><LF> organizationalUnitName=<Manufacturing Location>")
docsBpi2CmtsCACertSerialNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 2, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsCACertSerialNumber.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.2.2')
if mibBuilder.loadTexts: docsBpi2CmtsCACertSerialNumber.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCACertSerialNumber.setDescription("This CA certificate's serial number, represented as an octet string.")
docsBpi2CmtsCACertTrust = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("trusted", 1), ("untrusted", 2), ("chained", 3), ("root", 4))).clone('chained')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsCACertTrust.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.4.1')
if mibBuilder.loadTexts: docsBpi2CmtsCACertTrust.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCACertTrust.setDescription('This object controls the trust status of this certificate. Root certificates must be given root(4) trust; manufacturer certificates must not be given root(4) trust. Trust on root certificates must not change. Note: Setting this object need only affect the validity of CM certificates sent in future authorization requests; instantaneous effect need not occur.')
docsBpi2CmtsCACertSource = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("snmp", 1), ("configurationFile", 2), ("externalDatabase", 3), ("other", 4), ("authentInfo", 5), ("compiledIntoCode", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsCACertSource.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.4.1')
if mibBuilder.loadTexts: docsBpi2CmtsCACertSource.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCACertSource.setDescription('This object indicates how the certificate reached the CMTS. Other(4) means that it originated from a source not identified above.')
docsBpi2CmtsCACertStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 2, 1, 7), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsCACertStatus.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCACertStatus.setDescription("The status of this conceptual row. An attempt to set writable columnar values while this row is active behaves as follows: - Sets to the object docsBpi2CmtsCACertTrust are allowed. - Sets to the object docsBpi2CmtsCACert will return an error of 'inconsistentValue'. A newly created entry cannot be set to active until the value of docsBpi2CmtsCACert is being set.")
docsBpi2CmtsCACert = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 2, 1, 8), DocsX509ASN1DEREncodedCertificate()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: docsBpi2CmtsCACert.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.2.')
if mibBuilder.loadTexts: docsBpi2CmtsCACert.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCACert.setDescription('An X509 DER-encoded Certificate Authority certificate. To help identify certificates, either this object or docsBpi2CmtsCACertThumbprint must be returned by a CMTS for self-signed CA certificates. Note: The zero-length OCTET STRING must be returned, on reads, if the entire certificate is not retained in the CMTS.')
docsBpi2CmtsCACertThumbprint = MibTableColumn((1, 3, 6, 1, 2, 1, 126, 1, 2, 5, 2, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(20, 20)).setFixedLength(20)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CmtsCACertThumbprint.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section 9.4.3')
if mibBuilder.loadTexts: docsBpi2CmtsCACertThumbprint.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCACertThumbprint.setDescription('The SHA-1 hash of a CA certificate. To help identify certificates, either this object or docsBpi2CmtsCACert must be returned by a CMTS for self-signed CA certificates. Note: The zero-length OCTET STRING must be returned, on reads, if the CA certificate thumb print is not retained in the CMTS.')
docsBpi2CodeDownloadControl = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 1, 4))
docsBpi2CodeDownloadStatusCode = MibScalar((1, 3, 6, 1, 2, 1, 126, 1, 4, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("configFileCvcVerified", 1), ("configFileCvcRejected", 2), ("snmpCvcVerified", 3), ("snmpCvcRejected", 4), ("codeFileVerified", 5), ("codeFileRejected", 6), ("other", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CodeDownloadStatusCode.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Sections D.3.3.2 and D.3.5.1.')
if mibBuilder.loadTexts: docsBpi2CodeDownloadStatusCode.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CodeDownloadStatusCode.setDescription('The value indicates the result of the latest config file CVC verification, SNMP CVC verification, or code file verification.')
docsBpi2CodeDownloadStatusString = MibScalar((1, 3, 6, 1, 2, 1, 126, 1, 4, 2), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CodeDownloadStatusString.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section D.3.7')
if mibBuilder.loadTexts: docsBpi2CodeDownloadStatusString.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CodeDownloadStatusString.setDescription('The value of this object indicates the additional information to the status code. The value will include the error code and error description, which will be defined separately.')
docsBpi2CodeMfgOrgName = MibScalar((1, 3, 6, 1, 2, 1, 126, 1, 4, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CodeMfgOrgName.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section D.3.2.2.')
if mibBuilder.loadTexts: docsBpi2CodeMfgOrgName.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CodeMfgOrgName.setDescription("The value of this object is the device manufacturer's organizationName.")
docsBpi2CodeMfgCodeAccessStart = MibScalar((1, 3, 6, 1, 2, 1, 126, 1, 4, 4), DateAndTime().subtype(subtypeSpec=ValueSizeConstraint(11, 11)).setFixedLength(11)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CodeMfgCodeAccessStart.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section D.3.2.2.')
if mibBuilder.loadTexts: docsBpi2CodeMfgCodeAccessStart.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CodeMfgCodeAccessStart.setDescription("The value of this object is the device manufacturer's current codeAccessStart value. This value will always refer to Greenwich Mean Time (GMT), and the value format must contain TimeZone information (fields 8-10).")
docsBpi2CodeMfgCvcAccessStart = MibScalar((1, 3, 6, 1, 2, 1, 126, 1, 4, 5), DateAndTime().subtype(subtypeSpec=ValueSizeConstraint(11, 11)).setFixedLength(11)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CodeMfgCvcAccessStart.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section D.3.2.2.')
if mibBuilder.loadTexts: docsBpi2CodeMfgCvcAccessStart.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CodeMfgCvcAccessStart.setDescription("The value of this object is the device manufacturer's current cvcAccessStart value. This value will always refer to Greenwich Mean Time (GMT), and the value format must contain TimeZone information (fields 8-10).")
docsBpi2CodeCoSignerOrgName = MibScalar((1, 3, 6, 1, 2, 1, 126, 1, 4, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CodeCoSignerOrgName.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section D.3.2.2.')
if mibBuilder.loadTexts: docsBpi2CodeCoSignerOrgName.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CodeCoSignerOrgName.setDescription("The value of this object is the co-signer's organizationName. The value is a zero length string if the co-signer is not specified.")
docsBpi2CodeCoSignerCodeAccessStart = MibScalar((1, 3, 6, 1, 2, 1, 126, 1, 4, 7), DateAndTime().subtype(subtypeSpec=ValueSizeConstraint(11, 11)).setFixedLength(11)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CodeCoSignerCodeAccessStart.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section D.3.2.2.')
if mibBuilder.loadTexts: docsBpi2CodeCoSignerCodeAccessStart.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CodeCoSignerCodeAccessStart.setDescription("The value of this object is the co-signer's current codeAccessStart value. This value will always refer to Greenwich Mean Time (GMT), and the value format must contain TimeZone information (fields 8-10). If docsBpi2CodeCoSignerOrgName is a zero length string, the value of this object is meaningless.")
docsBpi2CodeCoSignerCvcAccessStart = MibScalar((1, 3, 6, 1, 2, 1, 126, 1, 4, 8), DateAndTime().subtype(subtypeSpec=ValueSizeConstraint(11, 11)).setFixedLength(11)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsBpi2CodeCoSignerCvcAccessStart.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section D.3.2.2.')
if mibBuilder.loadTexts: docsBpi2CodeCoSignerCvcAccessStart.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CodeCoSignerCvcAccessStart.setDescription("The value of this object is the co-signer's current cvcAccessStart value. This value will always refer to Greenwich Mean Time (GMT), and the value format must contain TimeZone information (fields 8-10). If docsBpi2CodeCoSignerOrgName is a zero length string, the value of this object is meaningless.")
docsBpi2CodeCvcUpdate = MibScalar((1, 3, 6, 1, 2, 1, 126, 1, 4, 9), DocsX509ASN1DEREncodedCertificate()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: docsBpi2CodeCvcUpdate.setReference('DOCSIS Baseline Privacy Plus Interface Specification, Section D.3.3.2.2.')
if mibBuilder.loadTexts: docsBpi2CodeCvcUpdate.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CodeCvcUpdate.setDescription('Setting a CVC to this object triggers the device to verify the CVC and update the cvcAccessStart values. The content of this object is then discarded. If the device is not enabled to upgrade codefiles, or if the CVC verification fails, the CVC will be rejected. Reading this object always returns the zero-length OCTET STRING.')
docsBpi2Notification = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 0))
docsBpi2Conformance = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 2))
docsBpi2Compliances = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 2, 1))
docsBpi2Groups = MibIdentifier((1, 3, 6, 1, 2, 1, 126, 2, 2))
docsBpi2CmCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 126, 2, 1, 1)).setObjects(("DOCS-IETF-BPI2-MIB", "docsBpi2CmGroup"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CodeDownloadGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
docsBpi2CmCompliance = docsBpi2CmCompliance.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmCompliance.setDescription('This is the compliance statement for CMs that implement the DOCSIS Baseline Privacy Interface Plus.')
docsBpi2CmtsCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 126, 2, 1, 2)).setObjects(("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsGroup"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CodeDownloadGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
docsBpi2CmtsCompliance = docsBpi2CmtsCompliance.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsCompliance.setDescription('This is the compliance statement for CMTSs that implement the DOCSIS Baseline Privacy Interface Plus.')
docsBpi2CmGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 126, 2, 2, 1)).setObjects(("DOCS-IETF-BPI2-MIB", "docsBpi2CmPrivacyEnable"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmPublicKey"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthState"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthKeySequenceNumber"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthExpiresOld"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthExpiresNew"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthReset"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthGraceTime"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKGraceTime"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthWaitTimeout"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmReauthWaitTimeout"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmOpWaitTimeout"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmRekeyWaitTimeout"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthRejectWaitTimeout"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmSAMapWaitTimeout"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmSAMapMaxRetries"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthentInfos"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthRequests"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthReplies"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthRejects"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthInvalids"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthRejectErrorCode"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthRejectErrorString"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthInvalidErrorCode"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmAuthInvalidErrorString"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKSAType"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKDataEncryptAlg"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKDataAuthentAlg"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKState"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKKeySequenceNumber"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKExpiresOld"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKExpiresNew"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKKeyRequests"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKKeyReplies"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKKeyRejects"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKInvalids"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKAuthPends"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKKeyRejectErrorCode"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKKeyRejectErrorString"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKInvalidErrorCode"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmTEKInvalidErrorString"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmIpMulticastAddressType"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmIpMulticastAddress"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmIpMulticastSAId"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmIpMulticastSAMapState"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmIpMulticastSAMapRequests"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmIpMulticastSAMapReplies"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmIpMulticastSAMapRejects"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmIpMulticastSAMapRejectErrorCode"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmIpMulticastSAMapRejectErrorString"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmDeviceCmCert"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmDeviceManufCert"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmCryptoSuiteDataEncryptAlg"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmCryptoSuiteDataAuthentAlg"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
docsBpi2CmGroup = docsBpi2CmGroup.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmGroup.setDescription('This collection of objects provides CM BPI+ status and control.')
docsBpi2CmtsGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 126, 2, 2, 2)).setObjects(("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsDefaultAuthLifetime"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsDefaultTEKLifetime"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsDefaultSelfSignedManufCertTrust"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsCheckCertValidityPeriods"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthentInfos"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthRequests"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthReplies"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthRejects"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthInvalids"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsSAMapRequests"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsSAMapReplies"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsSAMapRejects"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmBpiVersion"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmPublicKey"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmKeySequenceNumber"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmExpiresOld"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmExpiresNew"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmLifetime"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmReset"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmInfos"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmRequests"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmReplies"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmRejects"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCmInvalids"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthRejectErrorCode"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthRejectErrorString"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthInvalidErrorCode"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthInvalidErrorString"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthPrimarySAId"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthBpkmCmCertValid"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthBpkmCmCert"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsAuthCACertIndexPtr"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKSAType"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKDataEncryptAlg"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKDataAuthentAlg"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKLifetime"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKKeySequenceNumber"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKExpiresOld"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKExpiresNew"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKReset"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsKeyRequests"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsKeyReplies"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsKeyRejects"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKInvalids"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsKeyRejectErrorCode"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsKeyRejectErrorString"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKInvalidErrorCode"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsTEKInvalidErrorString"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastAddressType"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastAddress"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastMask"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastSAId"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastSAType"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastDataEncryptAlg"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastDataAuthentAlg"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastSAMapRequests"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastSAMapReplies"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastSAMapRejects"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastSAMapRejectErrorCode"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastSAMapRejectErrorString"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastMapControl"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsIpMulticastMapStorageType"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsMulticastAuthControl"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsProvisionedCmCertTrust"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsProvisionedCmCertSource"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsProvisionedCmCertStatus"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsProvisionedCmCert"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsCACertSubject"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsCACertIssuer"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsCACertSerialNumber"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsCACertTrust"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsCACertSource"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsCACertStatus"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsCACert"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CmtsCACertThumbprint"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
docsBpi2CmtsGroup = docsBpi2CmtsGroup.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CmtsGroup.setDescription('This collection of objects provides CMTS BPI+ status and control.')
docsBpi2CodeDownloadGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 126, 2, 2, 3)).setObjects(("DOCS-IETF-BPI2-MIB", "docsBpi2CodeDownloadStatusCode"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CodeDownloadStatusString"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CodeMfgOrgName"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CodeMfgCodeAccessStart"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CodeMfgCvcAccessStart"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CodeCoSignerOrgName"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CodeCoSignerCodeAccessStart"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CodeCoSignerCvcAccessStart"), ("DOCS-IETF-BPI2-MIB", "docsBpi2CodeCvcUpdate"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
docsBpi2CodeDownloadGroup = docsBpi2CodeDownloadGroup.setStatus('current')
if mibBuilder.loadTexts: docsBpi2CodeDownloadGroup.setDescription('This collection of objects provides authenticated software download support.')
mibBuilder.exportSymbols("DOCS-IETF-BPI2-MIB", docsBpi2CmtsProvisionedCmCertTrust=docsBpi2CmtsProvisionedCmCertTrust, docsBpi2CmtsIpMulticastMapStorageType=docsBpi2CmtsIpMulticastMapStorageType, docsBpi2CmIpMulticastSAMapReplies=docsBpi2CmIpMulticastSAMapReplies, docsBpi2CmAuthInvalidErrorString=docsBpi2CmAuthInvalidErrorString, docsBpi2CmtsMulticastAuthCmMacAddress=docsBpi2CmtsMulticastAuthCmMacAddress, docsBpi2CmtsIpMulticastSAType=docsBpi2CmtsIpMulticastSAType, docsBpi2CmGroup=docsBpi2CmGroup, docsBpi2CmtsAuthInvalidErrorCode=docsBpi2CmtsAuthInvalidErrorCode, docsBpi2CmtsIpMulticastSAMapRejects=docsBpi2CmtsIpMulticastSAMapRejects, docsBpi2CmtsTEKInvalids=docsBpi2CmtsTEKInvalids, docsBpi2CmAuthRejectWaitTimeout=docsBpi2CmAuthRejectWaitTimeout, docsBpi2CmTEKDataAuthentAlg=docsBpi2CmTEKDataAuthentAlg, docsBpi2CmCryptoSuiteDataAuthentAlg=docsBpi2CmCryptoSuiteDataAuthentAlg, DocsBpkmSAType=DocsBpkmSAType, docsBpi2CmCryptoSuiteEntry=docsBpi2CmCryptoSuiteEntry, docsBpi2CmDeviceManufCert=docsBpi2CmDeviceManufCert, docsBpi2CmtsMulticastAuthTable=docsBpi2CmtsMulticastAuthTable, docsBpi2CmtsAuthPrimarySAId=docsBpi2CmtsAuthPrimarySAId, docsBpi2CmtsCertObjects=docsBpi2CmtsCertObjects, docsBpi2CmtsIpMulticastSAMapRejectErrorString=docsBpi2CmtsIpMulticastSAMapRejectErrorString, docsBpi2CmIpMulticastSAMapRejects=docsBpi2CmIpMulticastSAMapRejects, docsBpi2CmAuthInvalids=docsBpi2CmAuthInvalids, docsBpi2CmtsCACertIndex=docsBpi2CmtsCACertIndex, docsBpi2Groups=docsBpi2Groups, docsBpi2CmtsProvisionedCmCertEntry=docsBpi2CmtsProvisionedCmCertEntry, docsBpi2CmtsIpMulticastMask=docsBpi2CmtsIpMulticastMask, docsBpi2CmtsProvisionedCmCert=docsBpi2CmtsProvisionedCmCert, docsBpi2CmIpMulticastMapTable=docsBpi2CmIpMulticastMapTable, docsBpi2CodeMfgCodeAccessStart=docsBpi2CodeMfgCodeAccessStart, docsBpi2CmtsMulticastAuthEntry=docsBpi2CmtsMulticastAuthEntry, docsBpi2CmtsAuthInvalidErrorString=docsBpi2CmtsAuthInvalidErrorString, docsBpi2CmtsAuthCmInvalids=docsBpi2CmtsAuthCmInvalids, docsBpi2CmtsGroup=docsBpi2CmtsGroup, docsBpi2CmRekeyWaitTimeout=docsBpi2CmRekeyWaitTimeout, docsBpi2CmTEKTable=docsBpi2CmTEKTable, docsBpi2CodeCoSignerOrgName=docsBpi2CodeCoSignerOrgName, docsBpi2CmtsTEKExpiresNew=docsBpi2CmtsTEKExpiresNew, docsBpi2CmTEKSAType=docsBpi2CmTEKSAType, docsBpi2CmtsAuthCmReplies=docsBpi2CmtsAuthCmReplies, docsBpi2CmtsAuthCmMacAddress=docsBpi2CmtsAuthCmMacAddress, docsBpi2CmtsDefaultTEKLifetime=docsBpi2CmtsDefaultTEKLifetime, docsBpi2CmtsCACertIssuer=docsBpi2CmtsCACertIssuer, docsBpi2CmAuthRejectErrorString=docsBpi2CmAuthRejectErrorString, docsBpi2CmAuthRejects=docsBpi2CmAuthRejects, docsBpi2CmAuthReplies=docsBpi2CmAuthReplies, docsBpi2CmTEKKeySequenceNumber=docsBpi2CmTEKKeySequenceNumber, docsBpi2CmtsCACertSource=docsBpi2CmtsCACertSource, docsBpi2CodeCoSignerCvcAccessStart=docsBpi2CodeCoSignerCvcAccessStart, docsBpi2CmtsIpMulticastSAMapRequests=docsBpi2CmtsIpMulticastSAMapRequests, docsBpi2CmTEKInvalids=docsBpi2CmTEKInvalids, docsBpi2CmtsAuthCmRejects=docsBpi2CmtsAuthCmRejects, docsBpi2Compliances=docsBpi2Compliances, docsBpi2CmDeviceCertEntry=docsBpi2CmDeviceCertEntry, docsBpi2CmtsAuthBpkmCmCert=docsBpi2CmtsAuthBpkmCmCert, docsBpi2CmtsSAMapRequests=docsBpi2CmtsSAMapRequests, docsBpi2CmOpWaitTimeout=docsBpi2CmOpWaitTimeout, docsBpi2CmtsAuthRequests=docsBpi2CmtsAuthRequests, docsBpi2CmAuthReset=docsBpi2CmAuthReset, docsBpi2CmtsAuthCmReset=docsBpi2CmtsAuthCmReset, docsBpi2CmTEKState=docsBpi2CmTEKState, docsBpi2CmtsAuthReplies=docsBpi2CmtsAuthReplies, docsBpi2CmIpMulticastSAMapRequests=docsBpi2CmIpMulticastSAMapRequests, DocsSAId=DocsSAId, docsBpi2CmtsAuthCmKeySequenceNumber=docsBpi2CmtsAuthCmKeySequenceNumber, docsBpi2CmCryptoSuiteIndex=docsBpi2CmCryptoSuiteIndex, docsBpi2CmtsCACertTable=docsBpi2CmtsCACertTable, docsBpi2CmtsSAMapRejects=docsBpi2CmtsSAMapRejects, docsBpi2CmTEKKeyRequests=docsBpi2CmTEKKeyRequests, docsBpi2CmtsBaseEntry=docsBpi2CmtsBaseEntry, docsBpi2CmAuthWaitTimeout=docsBpi2CmAuthWaitTimeout, docsBpi2CmtsAuthCmInfos=docsBpi2CmtsAuthCmInfos, DocsSAIdOrZero=DocsSAIdOrZero, docsBpi2CmtsKeyRequests=docsBpi2CmtsKeyRequests, docsBpi2CmtsProvisionedCmCertMacAddress=docsBpi2CmtsProvisionedCmCertMacAddress, docsBpi2CmAuthExpiresNew=docsBpi2CmAuthExpiresNew, docsBpi2CmSAMapWaitTimeout=docsBpi2CmSAMapWaitTimeout, docsBpi2CmAuthRequests=docsBpi2CmAuthRequests, docsBpi2CmTEKEntry=docsBpi2CmTEKEntry, docsBpi2CodeDownloadControl=docsBpi2CodeDownloadControl, docsBpi2CmtsCACertSubject=docsBpi2CmtsCACertSubject, docsBpi2CmtsCACertThumbprint=docsBpi2CmtsCACertThumbprint, docsBpi2CmTEKKeyRejectErrorString=docsBpi2CmTEKKeyRejectErrorString, docsBpi2CmPublicKey=docsBpi2CmPublicKey, docsBpi2CmReauthWaitTimeout=docsBpi2CmReauthWaitTimeout, docsBpi2CmTEKKeyRejects=docsBpi2CmTEKKeyRejects, docsBpi2MIB=docsBpi2MIB, docsBpi2CmtsTEKExpiresOld=docsBpi2CmtsTEKExpiresOld, docsBpi2CmTEKKeyReplies=docsBpi2CmTEKKeyReplies, docsBpi2CmtsCACert=docsBpi2CmtsCACert, docsBpi2CodeMfgOrgName=docsBpi2CodeMfgOrgName, docsBpi2CmCertObjects=docsBpi2CmCertObjects, docsBpi2CmtsAuthInvalids=docsBpi2CmtsAuthInvalids, docsBpi2CmtsIpMulticastMapControl=docsBpi2CmtsIpMulticastMapControl, docsBpi2CmTEKExpiresOld=docsBpi2CmTEKExpiresOld, docsBpi2CmtsAuthTable=docsBpi2CmtsAuthTable, docsBpi2CmIpMulticastAddressType=docsBpi2CmIpMulticastAddressType, docsBpi2CmtsAuthCmExpiresNew=docsBpi2CmtsAuthCmExpiresNew, DocsX509ASN1DEREncodedCertificate=DocsX509ASN1DEREncodedCertificate, docsBpi2CmtsKeyRejects=docsBpi2CmtsKeyRejects, docsBpi2CmTEKGraceTime=docsBpi2CmTEKGraceTime, docsBpi2CmtsMulticastObjects=docsBpi2CmtsMulticastObjects, docsBpi2CmAuthRejectErrorCode=docsBpi2CmAuthRejectErrorCode, docsBpi2CmtsAuthentInfos=docsBpi2CmtsAuthentInfos, docsBpi2CmtsAuthEntry=docsBpi2CmtsAuthEntry, docsBpi2CmMulticastObjects=docsBpi2CmMulticastObjects, docsBpi2CmtsTEKTable=docsBpi2CmtsTEKTable, docsBpi2CmtsAuthCmBpiVersion=docsBpi2CmtsAuthCmBpiVersion, docsBpi2CmIpMulticastSAMapState=docsBpi2CmIpMulticastSAMapState, docsBpi2CmtsTEKKeySequenceNumber=docsBpi2CmtsTEKKeySequenceNumber, docsBpi2CmtsAuthCmPublicKey=docsBpi2CmtsAuthCmPublicKey, docsBpi2Notification=docsBpi2Notification, docsBpi2CmIpMulticastMapEntry=docsBpi2CmIpMulticastMapEntry, docsBpi2CmTEKDataEncryptAlg=docsBpi2CmTEKDataEncryptAlg, docsBpi2CmtsAuthCmLifetime=docsBpi2CmtsAuthCmLifetime, docsBpi2CmtsIpMulticastSAMapReplies=docsBpi2CmtsIpMulticastSAMapReplies, docsBpi2CmtsCACertEntry=docsBpi2CmtsCACertEntry, docsBpi2CmIpMulticastIndex=docsBpi2CmIpMulticastIndex, docsBpi2CmBaseTable=docsBpi2CmBaseTable, docsBpi2CmTEKKeyRejectErrorCode=docsBpi2CmTEKKeyRejectErrorCode, docsBpi2CmBaseEntry=docsBpi2CmBaseEntry, docsBpi2CmDeviceCmCert=docsBpi2CmDeviceCmCert, docsBpi2CmCryptoSuiteDataEncryptAlg=docsBpi2CmCryptoSuiteDataEncryptAlg, docsBpi2CmtsTEKSAId=docsBpi2CmtsTEKSAId, docsBpi2CmtsIpMulticastDataAuthentAlg=docsBpi2CmtsIpMulticastDataAuthentAlg, docsBpi2CmSAMapMaxRetries=docsBpi2CmSAMapMaxRetries, docsBpi2CmtsTEKEntry=docsBpi2CmtsTEKEntry, docsBpi2CmtsMulticastAuthControl=docsBpi2CmtsMulticastAuthControl, docsBpi2CmtsIpMulticastAddress=docsBpi2CmtsIpMulticastAddress, docsBpi2CodeMfgCvcAccessStart=docsBpi2CodeMfgCvcAccessStart, docsBpi2CmtsBaseTable=docsBpi2CmtsBaseTable, docsBpi2CmtsCACertTrust=docsBpi2CmtsCACertTrust, docsBpi2CmAuthGraceTime=docsBpi2CmAuthGraceTime, docsBpi2CmtsCACertSerialNumber=docsBpi2CmtsCACertSerialNumber, docsBpi2Conformance=docsBpi2Conformance, docsBpi2CmtsTEKLifetime=docsBpi2CmtsTEKLifetime, docsBpi2CmObjects=docsBpi2CmObjects, docsBpi2CmIpMulticastAddress=docsBpi2CmIpMulticastAddress, docsBpi2CmtsCompliance=docsBpi2CmtsCompliance, PYSNMP_MODULE_ID=docsBpi2MIB, docsBpi2CmtsAuthCACertIndexPtr=docsBpi2CmtsAuthCACertIndexPtr, docsBpi2CmtsTEKReset=docsBpi2CmtsTEKReset, docsBpi2CmtsIpMulticastIndex=docsBpi2CmtsIpMulticastIndex, docsBpi2CmtsCACertStatus=docsBpi2CmtsCACertStatus, docsBpi2CmIpMulticastSAId=docsBpi2CmIpMulticastSAId, docsBpi2CmtsAuthBpkmCmCertValid=docsBpi2CmtsAuthBpkmCmCertValid, docsBpi2CmIpMulticastSAMapRejectErrorString=docsBpi2CmIpMulticastSAMapRejectErrorString, docsBpi2CmtsKeyReplies=docsBpi2CmtsKeyReplies, docsBpi2CodeDownloadGroup=docsBpi2CodeDownloadGroup, docsBpi2CmtsTEKInvalidErrorString=docsBpi2CmtsTEKInvalidErrorString, docsBpi2CmtsAuthCmRequests=docsBpi2CmtsAuthCmRequests, docsBpi2CmtsIpMulticastMapTable=docsBpi2CmtsIpMulticastMapTable, docsBpi2CmtsAuthRejects=docsBpi2CmtsAuthRejects, docsBpi2CmtsDefaultSelfSignedManufCertTrust=docsBpi2CmtsDefaultSelfSignedManufCertTrust, docsBpi2CmtsSAMapReplies=docsBpi2CmtsSAMapReplies, docsBpi2CmtsTEKDataAuthentAlg=docsBpi2CmtsTEKDataAuthentAlg, docsBpi2CmPrivacyEnable=docsBpi2CmPrivacyEnable, docsBpi2CmtsProvisionedCmCertTable=docsBpi2CmtsProvisionedCmCertTable, docsBpi2CmDeviceCertTable=docsBpi2CmDeviceCertTable, docsBpi2CmtsCheckCertValidityPeriods=docsBpi2CmtsCheckCertValidityPeriods, docsBpi2CmAuthState=docsBpi2CmAuthState, docsBpi2CodeCoSignerCodeAccessStart=docsBpi2CodeCoSignerCodeAccessStart, docsBpi2CodeCvcUpdate=docsBpi2CodeCvcUpdate, docsBpi2CmtsTEKSAType=docsBpi2CmtsTEKSAType, docsBpi2CmIpMulticastSAMapRejectErrorCode=docsBpi2CmIpMulticastSAMapRejectErrorCode, docsBpi2CmtsProvisionedCmCertStatus=docsBpi2CmtsProvisionedCmCertStatus, docsBpi2CmtsAuthRejectErrorCode=docsBpi2CmtsAuthRejectErrorCode, DocsBpkmDataAuthentAlg=DocsBpkmDataAuthentAlg, docsBpi2CmTEKSAId=docsBpi2CmTEKSAId, docsBpi2CmtsObjects=docsBpi2CmtsObjects, docsBpi2CmCompliance=docsBpi2CmCompliance, docsBpi2CmCryptoSuiteTable=docsBpi2CmCryptoSuiteTable, docsBpi2CodeDownloadStatusCode=docsBpi2CodeDownloadStatusCode, docsBpi2CmtsIpMulticastSAMapRejectErrorCode=docsBpi2CmtsIpMulticastSAMapRejectErrorCode, docsBpi2CmtsAuthCmExpiresOld=docsBpi2CmtsAuthCmExpiresOld, docsBpi2CmTEKInvalidErrorString=docsBpi2CmTEKInvalidErrorString, docsBpi2CmtsKeyRejectErrorCode=docsBpi2CmtsKeyRejectErrorCode, docsBpi2CmtsKeyRejectErrorString=docsBpi2CmtsKeyRejectErrorString, docsBpi2CmtsIpMulticastSAId=docsBpi2CmtsIpMulticastSAId, docsBpi2CmTEKInvalidErrorCode=docsBpi2CmTEKInvalidErrorCode, docsBpi2CmAuthKeySequenceNumber=docsBpi2CmAuthKeySequenceNumber, docsBpi2CmAuthentInfos=docsBpi2CmAuthentInfos, docsBpi2CmtsTEKInvalidErrorCode=docsBpi2CmtsTEKInvalidErrorCode, docsBpi2CmtsIpMulticastMapEntry=docsBpi2CmtsIpMulticastMapEntry, docsBpi2CmtsIpMulticastAddressType=docsBpi2CmtsIpMulticastAddressType, docsBpi2CodeDownloadStatusString=docsBpi2CodeDownloadStatusString, docsBpi2CmtsProvisionedCmCertSource=docsBpi2CmtsProvisionedCmCertSource, DocsBpkmDataEncryptAlg=DocsBpkmDataEncryptAlg, docsBpi2CmAuthExpiresOld=docsBpi2CmAuthExpiresOld, docsBpi2MIBObjects=docsBpi2MIBObjects, docsBpi2CmtsAuthRejectErrorString=docsBpi2CmtsAuthRejectErrorString, docsBpi2CmAuthInvalidErrorCode=docsBpi2CmAuthInvalidErrorCode, docsBpi2CmtsDefaultAuthLifetime=docsBpi2CmtsDefaultAuthLifetime, docsBpi2CmtsTEKDataEncryptAlg=docsBpi2CmtsTEKDataEncryptAlg, docsBpi2CmtsIpMulticastDataEncryptAlg=docsBpi2CmtsIpMulticastDataEncryptAlg, docsBpi2CmtsMulticastAuthSAId=docsBpi2CmtsMulticastAuthSAId, docsBpi2CmTEKExpiresNew=docsBpi2CmTEKExpiresNew, docsBpi2CmTEKAuthPends=docsBpi2CmTEKAuthPends)
|
grid = []
n = int(raw_input())
for i in range(n):
arr = []
s = raw_input()
for j in range(n):
arr.append(s[j])
grid.append(arr)
status = True
for i in range(n):
b = 0
c = 0
lastChar = ' '
lastCount = 0
for x in range(n):
if grid[x][i] == 'B': b += 1
else: c += 1
if grid[x][i] == lastChar: lastCount += 1
else: lastCount = 1
lastChar = grid[x][i]
if lastCount == 3: status = False
if b != c: status = False
b = 0
c = 0
lastChar = ' '
lastCount = 0
for x in range(n):
if grid[i][x] == 'B': b += 1
else: c += 1
if grid[i][x] == lastChar: lastCount += 1
else: lastCount = 1
lastChar = grid[i][x]
if lastCount == 3: status = False
if b != c: status = False
if not status: break
print(1 if status else 0)
|
# This program/script perform usual conversion.
# function Choosing a conversion category (distance, flow, volume, Area, pressure, Liquid Flow, Speed, Gas Flow)
def conversion_cat():
while True:
print("welcome to the Unit Converter!\n")
print('Choose a category from the list below? (Enter corresponding number)')
print("1. Distance \n2. Area \n3. Volume \n4. Pressure \n5. Speed \n6. Mass \n7. Liquid Flow \n8. Gas Flow")
conversion_choice = input()
if conversion_choice.isnumeric() and len(conversion_choice) == 1 and 0 < int(conversion_choice) < 9:
return int(conversion_choice)
else:
continue
# Function to get value to convert from user
def value_to_convert():
while True:
print("\nEnter value to convert: ")
value_entered = input()
if value_entered.isnumeric():
return float(value_entered)
else:
continue
# Function to prompt user to enter a distance unit from a pool of predefined units
def choose_unit(category_choice):
distance_units_dict = {1: "mm", 2: "in", 3: "cm", 4: "m", 5: "km", 6: "mi", 7: "ft", 8: "yd"}
area_units_dict = {1: "hectare", 2: "sqmi", 3: "km2", 4: "acre", 5: "m2", 6: "sqft", 7: "ft2", 8: "sqi",
9: "in2", 10: "sqyd", 11: "yd2"}
volume_units_dict = {1: "m3", 2: "bbl", 3: "l", 4: "cuft", 5: "gal", 6: "qt"}
pressure_units_dict = {1: "Mpa", 2: "atm", 3: "bar", 4: "pa", 5: "psi"}
speed_units_dict = {1: "mph", 2: "kmh", 3: "ft/s", 4: "m/s", 5: "knot"}
mass_units_dict = {1: "t", 2: "kg", 3: "g", 4: "lbs", 5: "oz", 6: "mg"}
liqflow_units_dict = {1: "bpd", 2: "bph", 3: "bpm", 4: "gph", 5: "gpm", 6: "l/h", 7: "m3h", 8: "m3d", 9: "l/s"}
gasflow_units_dict = {1: "mscfd", 2: "scfh", 3: "scfm", 4: "cf/d", 5: ""}
if category_choice == 1:
while True:
print("\nEnter unit: (choose/type from the list below): ")
print("Distance : mm, in, cm, m, km, mi, ft, yd")
unit = input()
unit = unit.lower()
for item in distance_units_dict.keys():
if unit.isalpha() and distance_units_dict[item] == unit:
return str(unit)
else:
continue
if category_choice == 2:
while True:
print("\nEnter unit: (choose/type from the list below): ")
print("Area : acre, m2, ft2 (square foot), km2, hectare, yd2 (square yard), "
"sqmi (square mile), in2 (square inch)")
unit = input()
unit = unit.lower()
for item in area_units_dict.keys():
if area_units_dict[item] == unit:
return str(unit)
else:
continue
if category_choice == 3:
while True:
print("\nEnter unit: (choose/type from the list below): ")
print("Volume : m3, bbl (for us Barrel), l, cuft, gal (for us gallon), qt")
unit = input()
unit = unit.lower()
for item in volume_units_dict.keys():
if volume_units_dict[item] == unit:
return str(unit)
else:
continue
if category_choice == 4:
while True:
print("\nEnter unit: (choose/type from the list below): ")
print("Pressure : Mpa, atm (standard atmosphere), bar, pa, psi")
unit = input()
unit = unit.lower()
for item in pressure_units_dict.keys():
if pressure_units_dict[item] == unit:
return str(unit)
else:
continue
if category_choice == 5:
while True:
print("\nEnter unit: (choose/type from the list below): ")
print("Speed : mph, kmh, ft/s, m/s, knot")
unit = input()
unit = unit.lower()
for item in speed_units_dict.keys():
if speed_units_dict[item] == unit:
return str(unit)
else:
continue
if category_choice == 6:
while True:
print("\nEnter unit: (choose/type from the list below): ")
print("Mass : t, kg, g, lbs, oz, mg")
unit = input()
unit = unit.lower()
for item in mass_units_dict.keys():
if mass_units_dict[item] == unit:
return str(unit)
else:
continue
if category_choice == 7:
while True:
print("\nEnter unit: (choose/type from the list below): ")
print("Liquid Flow : bpd (bbls/day), bph (bbls/hour), bpm, gph, gpm, l/h, m3h, m3d, l/s")
unit = input()
unit = unit.lower()
for item in liqflow_units_dict.keys():
if liqflow_units_dict[item] == unit:
return str(unit)
else:
continue
if category_choice == 8:
while True:
print("\nEnter unit: (choose/type from the list below): ")
print("Gas Flow : mscfd (million standard cubic feet per day), scfh, scfm")
unit = input()
unit = unit.lower()
for item in gasflow_units_dict.keys():
if gasflow_units_dict[item] == unit:
return str(unit)
else:
continue
# Function performing distance conversion
def distance(u_from, val, u_to):
metric_dict = {
'Em': 1000000000000000000,
'Pm': 1000000000000000,
'Tm': 1000000000000,
'Gm': 1000000000,
'Mm': 1000000,
'km': 1000,
'hm': 100,
'dam': 10,
'm': 1,
'dm': .1,
'cm': .01,
'mm': .001,
'μm': .000001,
'nm': .000000001,
'pm': .000000000001,
'fm': .000000000000001,
'am': .000000000000000001
}
imperial_dist_dict = {
'lea': 190080,
'mi': 63360,
'fu': 7920,
'ch': 792,
'rod': 198,
'yd': 36,
'ft': 12,
'li': 7.92,
'in': 1,
'th': .001
}
if u_from in metric_dict and u_to in imperial_dist_dict:
metric_base = metric_dict.get(u_from, None)
imperial_base = imperial_dist_dict.get(u_to, None)
converted_val = val * metric_base * 39.3701 * imperial_base
return str(round(converted_val, 5))
elif u_from in imperial_dist_dict and u_to in metric_dict:
imperial_base = imperial_dist_dict.get(u_from, None)
metric_base = metric_dict.get(u_to, None)
converted_val = val * imperial_base * .0254 / metric_base
return str(round(converted_val, 5))
elif u_from in metric_dict and u_to in metric_dict:
metric_from = metric_dict.get(u_from, None)
metric_to = metric_dict.get(u_to, None)
converted_val = val * metric_from / metric_to
return str(round(converted_val, 5))
elif u_from in imperial_dist_dict and u_to in imperial_dist_dict:
imp_from = imperial_dist_dict.get(u_from, None)
imp_to = imperial_dist_dict.get(u_to, None)
converted_val = val * imp_from / imp_to
return str(round(converted_val, 5))
def area(u_from, val, u_to):
area_dict = {
'hectare': 10000,
'sqmi': 2.59e+6,
'km2': 1e+6,
'acre': 4046.86,
'm2': 1,
'sqft': 0.092903, 'ft2': 0.092903,
'sqi': 0.00064516, "in2": 0.00064516,
'sqyd': 0.836127, 'yd2': 0.836127,
}
uni_from = area_dict.get(u_from, None)
uni_to = area_dict.get(u_to, None)
converted_val = val * uni_from / uni_to
return str(round(converted_val, 5))
def volume(u_from, val, u_to):
volume_dict = {
'cbm': 33814, 'cum': 33814, 'm3': 33814, 'm^3': 33814, 'm**3': 33814,
'bbl': 5376, 'bbls': 5376, 'oil_bbl': 5376,
'l': 33.814,
'cuft': 957.506, 'cft': 957.506, 'ft**3': 957.506, 'ft^3': 957.506,
'gal': 128, 'us_gal': 128,
'qt': 32,
'pt': 16,
'cp': 8.11537, 'cup': 8.11537,
'gi': 4,
'oz': 1,
'cuinch': 0.554113, 'cinch': 0.554113, 'inch**3': 0.554113, 'inch^3': 0.554113, 'ci': 0.554113,
'ml': 0.033814,
'tsp': 0.166667,
'tbsp': .5,
}
uni_from = volume_dict.get(u_from, None)
uni_to = volume_dict.get(u_to, None)
converted_val = val * uni_from / uni_to
return str(round(converted_val, 5))
def pressure(u_from, val, u_to):
pressure_dict = {
'Mpa': 1000000,
'atm': 101325,
'bar': 100000,
'pa': 1,
'psi': 6894.76
}
uni_from = pressure_dict.get(u_from, None)
uni_to = pressure_dict.get(u_to, None)
converted_val = val * uni_from / uni_to
return str(round(converted_val, 5))
def speed(u_from, val, u_to):
speed_dict = {
'mph': 0.44704,
'kmh': 0.277778,
'ft/s': 0.3048,
'm/s': 1,
'knot': 0.514444
}
uni_from = speed_dict.get(u_from, None)
uni_to = speed_dict.get(u_to, None)
converted_val = val * uni_from / uni_to
return str(round(converted_val, 5))
def mass(u_from, val, u_to):
mass_dict = {
't': 1e+6,
'kg': 1000,
'lbs': 453.592,
'oz': 28.3495,
'g': 1,
'mg': 0.001
}
uni_from = mass_dict.get(u_from, None)
uni_to = mass_dict.get(u_to, None)
converted_val = val * uni_from / uni_to
return str(round(converted_val, 5))
def liquidflow(u_from, val, u_to):
lflow_dict = {
'bph': 0.7,
'bpd': 0.02917,
'bpm': 42,
'gph': 0.01667,
'gpm': 1,
'l/h': 0.004403,
'm3h': 4.4029,
'm3d': 0.1835,
'l/s': 15.8503
}
uni_from = lflow_dict.get(u_from, None)
uni_to = lflow_dict.get(u_to, None)
converted_val = val * uni_from / uni_to
return str(round(converted_val, 5))
def gasflow(u_from, val, u_to):
gasflow_dict = {
'mscfd': 1179.868608,
'scfh': 0.028,
'scfm': 1.70,
'm3/h': 1
}
uni_from = gasflow_dict.get(u_from, None)
uni_to = gasflow_dict.get(u_to, None)
converted_val = val * uni_from / uni_to
return str(round(converted_val, 5))
# Main body of the code I call my functions here to perform the conversion
while True:
category = conversion_cat()
unit_from = choose_unit(category)
value = value_to_convert()
unit_to = choose_unit(category)
if category == 1:
result = distance(unit_from, value, unit_to)
elif category == 2:
result = area(unit_from, value, unit_to)
elif category == 3:
result = volume(unit_from, value, unit_to)
elif category == 4:
result = pressure(unit_from, value, unit_to)
elif category == 5:
result = speed(unit_from, value, unit_to)
elif category == 6:
result = mass(unit_from, value, unit_to)
elif category == 7:
result = liquidflow(unit_from, value, unit_to)
elif category == 8:
result = gasflow(unit_from, value, unit_to)
print("\n{} {} is equal to {} {}".format(value, unit_from, result, unit_to))
print("\nDo you wish to convert another value? \n(Enter Y or N)")
answer = input()
if answer.lower() == "y" or answer.lower() == "yes":
continue
else:
break
|
#This is a simple class definition to hold information about each judge. Is used by other files, and is not to be run directly.
class judge(object):
#initialized using a "line". This should be a line from the .csv file produced by judgeMetaDataExtractor.py
def __init__(self,line):
parts = line.strip().split(',')
self.circuit = parts[1]
self.start = int(parts[3])
self.end = int(parts[4])
self.party = parts[2]
self.fullName = parts[0]
self.lastName = parts[0].split('<')[0].lower()
self.firstName = parts[0].split('<')[1].lower().strip().split(' ')[0]
def __str__(self):
return self.fullName + ' Circuit: ' + self.circuit + ' Party: ' + self.party +' Start: ' +str(self.start) + ' End: ' +str(self.end)
def __repr__(self):
return self.fullName + ' Circuit: ' + self.circuit + ' Party: ' + self.party +' Start: ' +str(self.start) + ' End: ' +str(self.end)
|
USER_CREDENTIALS = [
("user1", "user1@example.com", "pass1"),
("user2", "user2@example.com", "pass2"),
("user3", "user3@example.com", "pass3"),
("user4", "user4@example.com", "pass4"),
("user5", "user5@example.com", "pass5")
] |
def _compute_lcs(source, target):
"""Computes the Longest Common Subsequence (LCS).
Description of the dynamic programming algorithm:
https://www.algorithmist.com/index.php/Longest_Common_Subsequence
Args:
source: List of source tokens.
target: List of target tokens.
Returns:
List of tokens in the LCS.
"""
table = _lcs_table(source, target)
return _backtrack(table, source, target, len(source), len(target))
def _lcs_table(source, target):
"""Returns the Longest Common Subsequence dynamic programming table."""
rows = len(source)
cols = len(target)
lcs_table = [[0] * (cols + 1) for _ in range(rows + 1)]
for i in range(1, rows + 1):
for j in range(1, cols + 1):
if source[i - 1] == target[j - 1]:
lcs_table[i][j] = lcs_table[i - 1][j - 1] + 1
else:
lcs_table[i][j] = max(lcs_table[i - 1][j], lcs_table[i][j - 1])
return lcs_table
def _backtrack(table, source, target, i, j):
"""Backtracks the Longest Common Subsequence table to reconstruct the LCS.
Args:
table: Precomputed LCS table.
source: List of source tokens.
target: List of target tokens.
i: Current row index.
j: Current column index.
Returns:
List of tokens corresponding to LCS.
"""
if i == 0 or j == 0:
return []
if source[i - 1] == target[j - 1]:
# Append the aligned token to output.
return _backtrack(table, source, target, i - 1, j - 1) + [target[j - 1]]
if table[i][j - 1] > table[i - 1][j]:
return _backtrack(table, source, target, i, j - 1)
else:
return _backtrack(table, source, target, i - 1, j)
def insert_dummy(tokens, p='[unused%d]'):
rlt = []
cnt = 1
for token in tokens:
rlt.append(p % cnt)
rlt.append(token)
cnt += 1
rlt.append(p % cnt)
return rlt
def convert_tokens_to_string(tokenizer, tokens, en=False):
if en:
return tokenizer.convert_tokens_to_string(tokens)
return ''.join(tokenizer.convert_tokens_to_string(tokens).split(' '))
def _decode_valid_tags(source, tags, tokenizer, en):
string = []
for token, tag in zip(source, tags):
if tag == 'DELETE':
continue
elif tag == 'KEEP':
string.append(token)
else:
string.append(tag.split('|')[-1])
return convert_tokens_to_string(tokenizer, string, en)
def convert_tags(source, target, tokenizer, debug=False, en=False):
source = insert_dummy(tokenizer.tokenize(source))
target = tokenizer.tokenize(target)
# initialize tags
tags = ['DELETE'] * len(source)
kept_tokens = _compute_lcs(source, target) + ['[DUMMY]']
target_idx = 0
phrase = []
for source_idx in range(len(source)):
if source[source_idx] == kept_tokens[0]:
tags[source_idx] = 'KEEP'
while target_idx < len(target) and target[target_idx] != kept_tokens[0]:
phrase.append(target[target_idx])
target_idx += 1
kept_tokens = kept_tokens[1:]
if len(phrase) > 0:
if debug:
tags[source_idx - 1] = 'CHANGE|' + convert_tokens_to_string(tokenizer, phrase, en)
else:
tags[source_idx - 1] = 'CHANGE|' + '<|>'.join(phrase)
phrase = []
target_idx += 1
if target_idx < len(target):
if debug:
tags[-1] = 'CHANGE|' + convert_tokens_to_string(tokenizer, target[target_idx:], en)
else:
tags[-1] = 'CHANGE|' + "<|>".join(target[target_idx:])
if debug and _decode_valid_tags(source, tags, tokenizer, en) != convert_tokens_to_string(tokenizer, target, en):
print(f"decoded: {_decode_valid_tags(source, tags, tokenizer, en)} "
f"original: {convert_tokens_to_string(tokenizer, target, en)}")
return tags, source
def data_iter(file_path, mode):
with open(file_path, 'r', encoding='utf-8') as f:
for line in f:
line = line.strip()
if mode == 'wechat':
line_split = line.split('\t\t')
contexts_source, target = line_split[:-1], line_split[-1]
contexts = contexts_source[:-1]
source = contexts_source[-1]
elif mode == "ailab":
line_split = line.split('\t')
if line_split[-1] != '0':
contexts_source, target = line_split[:5], line_split[-1]
else:
contexts_source, target = line_split[:5], line_split[4]
contexts = contexts_source[:-1]
source = contexts_source[-1]
elif mode == 'canard':
line_split = line.split('\t')
contexts_source, target = line_split[:-1], line_split[-1]
contexts = contexts_source[:-1]
source = contexts_source[-1]
else:
raise ValueError("mode must in [wechat, ailab, local]")
yield contexts, source, target
def str2bool(v):
return v.lower() in ("yes", "true", "t", "1")
|
##defines
SWARM = ["SeqSwarm", "PyramidSwarm", "RingSwarm", "LocalSwarm"]
FUNCTION = ["Sphere", "Rastrigin", "Rosenbrock", "Schaffer", "Griewank","Ackley", "Schwefel", "Levy No.5"]
DISPLAYDIGITS = 3
##end defines
class PsoParameter:
steps = 0
stepwidth = 1
runs = 0
#the actual settings for the batch run
param = []
logdir = ""
attributeslist = []
attributesDesc = []
#describe the log run before/after
description = ""
observation = ""
def __init__(self):
pass
def __str__(self):
out = ""
out += "logdir: " + self.logdir + "\n"
out += "runs: " + str(self.runs) + "\n"
out += "steps: " + str(self.steps) + "\n"
out += "stepwidth: " + str(self.stepwidth) + "\n"
out += "attributes: " + str(self.attributeslist) + "\n"
out += "attrDesc: " + str(self.attributesDesc) + "\n"
out += "param:\n[\n"
for i in range(len(self.param)):
out += " " +str(self.param[i]) + "\n"
out += "]\n"
out += "description:\n" + self.description + "\n"
out += "observation:\n" + self.observation + "\n"
return out
def parameterString(self, i):
out = SWARM[self.param[i][9]] +" - w=" + str(round(self.param[i][0],DISPLAYDIGITS)) + ", c1=" + str(round(self.param[i][2],DISPLAYDIGITS))+ ", c2=" + str(round(self.param[i][3],DISPLAYDIGITS))+ ", size=" + str(self.param[i][4])+ ", height=" + str(self.param[i][6])+ ", branch=" + str(self.param[i][7])
return out
def functionString(self):
out = FUNCTION[self.param[0][8]] + " (dim=" + str(self.param[0][5]) + ")"
return out
|
'''
@description 2019/09/02 22:21
'''
# while循环九九乘法表
'''
1 * 1 = 1
1 * 2 = 2 2 * 2 = 4
1 * 3 = 3 2 * 3 = 6 3 * 3 = 9
.....
'''
print('test....')
print('1 * 2 = 2', end=" ")
print('2 * 2 = 4')
print('test finished....')
# 行
rows = 1
# 列
columns = 1
print('while start....')
# 第一个循环:行
while rows <= 9:
while columns <= rows:
# 在这个地方打印的时候,打印的是同一行的列
# 因此不需要换行,所以修改end=" ",让其在一行中打印
print('%d * %d = %d'%(columns, rows, rows * columns), end=" ")
columns += 1
# 为了使用换行符,打印完一行就要换行
print("")
rows += 1
columns = 1 # rows每循环迭代一次,重新初始化columns,否则每循环一次rows,columns变+1
print('while finished....')
|
a, b, c, d, e, f, g, h = '00000000'
cell = ''
with open(input('What file to execute?> '), 'r') as F:
for row in F:
for x in str(row):
if x == '!':
if cell == '': cell = 'a'
elif 'a' <= cell <= 'g': cell = chr(ord(cell) + 1)
elif cell == 'h': cell = ''
if x == '?':
if cell == '': cell = 'h'
elif cell == 'a': cell = ''
elif 'b' <= cell <= 'h': cell = chr(ord(cell) - 1)
if x == '#':
print(a + b + c + d + e + f + g + h)
if x == "+":
if cell == 'a' and a == '0': a = '1'
elif cell == 'b' and b == '0': b = '1'
elif cell == 'c' and c == '0': c = '1'
elif cell == 'd' and d == '0': d = '1'
elif cell == 'e' and e == '0': e = '1'
elif cell == 'f' and f == '0': f = '1'
elif cell == 'g' and g == '0': g = '1'
elif cell == 'h' and h == '0': h = '1'
if x == ".":
print(cell)
if x == ",":
a, b, c, d, e, f, g, h = '00000000'
cell = ''
|
# noinspection SpellCheckingInspection
"""
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number
of rows like this:
(you may want to display this pattern in a fixed font for better legibility)
P A H N
A P L S I I G
Y I R
And then read line by line: "PAHNAPLSIIGYIR"
Write the code that will take a string and make this conversion given a number
of rows:
string convert(string text, int nRows);
convert("PAYPALISHIRING", 3) should return "PAHNAPLSIIGYIR".
https://leetcode.com/problems/zigzag-conversion/
"""
# noinspection PyPep8Naming,PyMethodMayBeStatic
class Solution:
def convert(self, s, numRows):
"""
:type s: str
:type numRows: int
:rtype: str
"""
if numRows <= 1 or len(s) <= numRows:
return s
result = [''] * numRows
row, step = 0, 1
for char in s:
result[row] += char
if row == 0:
step = 1
elif row == numRows - 1:
step = -1
row += step
return ''.join(result)
|
person = {
"first_name": "Bob",
"last_name": "Smith"
}
# for key in person:
# print(key)
# for key in person.keys():
# print(key)
# for value in person.values():
# print(value)
# for key, value in person.items():
# print(key, value)
the_keys = person.keys()
person["age"] = 23
print(the_keys)
|
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 2 10:24:30 2020
@author: roger luo
"""
def example():
"""show example code
Returns
-------
None.
Example
--------
>>> 1+2
3
>>> d = sum([1,2,3])
>>>
pd.Series([1,2,3])
Out[15]:
0 1
1 2
2 3
dtype: int64
"""
|
WELCOME_BRIEF = "Configures welcoming people to the server."
WELCOME_DESCRIPTION = "Configures welcoming people to the server, what channel it occurs and, and what welcome " \
"messages are sent."
WELCOME_INFO_BRIEF = "Lists basic Welcome info for this server."
WELCOME_ENABLE_BRIEF = "Enables Welcomes for this server."
WELCOME_DISABLE_BRIEF = "Disables Welcomes for this server."
WELCOME_ADD_BRIEF = "Adds the given sentence to the list of possible welcomes."
WELCOME_ADD_DESCRIPTION = "Adds the given sentence, preferably wrapped in quotes, to the list of randomly chosen " \
"welcomes. To have the new persons name show up, put \"{0}\" without quotes anywhere " \
"in the message. To have them be @mentioned, put \"{1}\" anywhere. Again, without quotes."
WELCOME_REMOVE_BRIEF = "Removes a sentence at the given index from possible welcomes."
WELCOME_REMOVE_DESCRIPTION = "Removes the sentence at the given index shown in the info command from the list of " \
"randomly chosen welcomes."
WELCOME_SET_BRIEF = "Sets the welcome channel."
WELCOME_ENABLED = "Enabled Welcomes."
WELCOME_ENABLED_ALREADY = "Welcomes are already enabled."
WELCOME_ENABLED_NO_CHANNEL_SET = "You will need to set a channel to send welcomes to before this will function."
WELCOME_DISABLED = "Disabled Welcomes."
WELCOME_DISABLED_ALREADY = "Welcomes were already disabled."
WELCOME_SET_CHANNEL = "Welcomes will now be sent in this channel."
|
def thread_colorize(area, lexer, theme, index, stopindex):
for pos, token, value in lexer.get_tokens_unprocessed(area.get(index, stopindex)):
area.tag_add(str(token), '%s +%sc' % (index, pos),
'%s +%sc' % (index, pos + len(value)))
yield
def matrix_step(map):
count, offset = 0, 0
for pos, token, value in map:
srow = count
scol = pos - offset
n = value.count('\n')
erow = srow + n
count = count + n
m = value.rfind('\n')
offset = pos + m + 1 if m >= 0 else offset
ecol = len(value) - (m + 1) if m >= 0 else scol + len(value)
yield(((srow, scol), (erow, ecol)), token, value)
def get_tokens_unprocessed_matrix(count, offset, data, lexer):
map = matrix_step(lexer.get_tokens_unprocessed(data))
for ((srow, scol), (erow, ecol)), token, value in map:
if '\n' in value:
yield(((srow + count, scol + offset),
(erow + count, ecol)), token, value)
break
else:
yield(((srow + count, scol + offset),
(erow + count, ecol + offset)),
token, value)
for ((srow, scol), (erow, ecol)), token, value in map:
yield(((srow + count, scol), (erow + count, ecol)),
token, value)
|
#!/usr/bin/env python3
def solution(array):
"""
Finds the number of combinations (ai, aj), given:
- ai == 0
- aj == 1
- j > i
Time Complexity: O(n), as we go through the array only once (in reverse order)
Space Complexity O(1), as we store three variables and create one iterator
"""
result = 0
count = 0
# We iterate over array in reverse order to reuse the counter of 1s
for i in range(len(array) - 1, -1, -1):
if array[i] == 1:
count += 1
else:
if result + count > 1000000000:
return -1
# We never reset "count", as we need to sum the number of all 1s after each 0
result += count
return result
|
# mysql 数据库配置信息
HOST = ''
PORT = ''
USER = ''
PASSWORD = ''
DATABASE = ''
# 网页cookie信息
COOKIE = 's_fid=16EA47F34D0C27D1-3D49C0C1B807C69C; s_dslv=1588085362157; s_vn=1619487134855%26vn%3D2; s_nr=1592356504313-Repeat; regStatus=pre-register; x-wl-uid=1oFkJghyA05X3g0aAQ4KsIIeQQrGiyWDznKUVwLKDcTSdrE2BKMaYDs9LhL2UdTb2e07SY3D4LnM=; session-id-time=2082787201l; session-id=142-9598714-0928514; csm-hit=tb:s-GCS17HN3GAR88M1Y1V5P|1592555629156&t:1592555631807&adb:adblk_no; ubid-main=134-7031937-5362166; aws-priv=eyJ2IjoxLCJldSI6MCwic3QiOjB9; aws-target-static-id=1588085255293-169108; aws-target-visitor-id=1588085255295-290235.22_0; aws-target-data=%7B%22support%22%3A%221%22%7D; i18n-prefs=USD; AMCV_4A8581745834114C0A495E2B%40AdobeOrg=-432600572%7CMCIDTS%7C18431%7CMCMID%7C27134369824229957172953057342603693997%7CMCAAMLH-1592961259%7C11%7CMCAAMB-1592961259%7C6G1ynYcLPuiQxYZrsz_pkqfLG9yMXBpb2zX5dvJdYQJzPXImdj0y%7CMCOPTOUT-1592363659s%7CNONE%7CMCAID%7CNONE%7CMCSYNCSOP%7C411-18436%7CvVersion%7C4.5.2; mbox=PC#811250ed2f8c404081b27400c09e0a6d.38_0#1655601305|session#099394a222a049c68140a6b1dbcb123c#1592358314; _mkto_trk=id:365-EFI-026&token:_mch-amazon.com-1592202796906-53366; s_lv=1592356504314; sst-main=Sst1|PQFa7BEiCqj7XMH4f_bUngbrB9XfbFlMGFQtdKDktq75A69QW7ohUQsEOZL3QlpviKg1L7gL-7Emh3OUKheChCpHHAjCUaLZXnu6euylpT-KBUiFrLm5ngNA724T1br8C8kDanXe2Q34VX1_XRkEUtC_8V4R35lDb_GZlOajKbZm-CAvvJMXafvDjKXYDO65Pq625pZ6sFc-dK_7TTI06kfDK_nKp10WA4kADwH_RTMo8EzIXz85EI4PhoLyLak3FoHE; session-token=inYAkhF0eJXEfthAzAx+9evci55CW0gPNQ2kBghZ1pZEkQK859Z8zPeCPLZvG76cJ48WmTr3PgY2Jtgu1irm9bsvTjZ3hxyoizodHiuHMIdoY7wAFZllwTMaMxIpFiytHGuYcNdcag03KK08U1I0segzFHcow4gCOu1z22F8PrIiibEyY6+3x5eSPZc6ZmOk; skin=noskin' |
# coding=utf-8
# # vigane variant
def isprime(n):
for i in range(n):
if n % i == 0:
return False
return True
# # Parandatud variant
# def isprime(n):
# for i in range(2, n):
# if n % i == 0:
# return False
# return True
# # 0 ja 1 haldamine
# def isprime(n):
# if n in (0, 1):
# return False
# for i in range(2, n):
# if n % i == 0:
# return False
# return True
# def isprime(n):
# if n < 0:
# return False
# if n in (0, 1):
# return False
# for i in range(2, n):
# if n % i == 0:
# return False
# return True
# # Lõplik versioon
# def isprime(n):
# if n <= 1:
# return False
# for i in range(2, n):
# if n % i == 0:
# return False
# return True
# # Kustume funktsiooni testimiseks välja
# n = 5
# if isprime(n):
# print(f"{n} ON algarv") # Kasutame f-formaatimisstringi, mis lubab muutuja otse stringi sisse panna
# else:
# print(f"{n} EI OLE algarv")
# def list_primes(max_num = 100):
# for n in range(2, max_num):
# if isprime(n):
# print(n, end = ' ', flush = True)
# print()
# list_primes() |
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'ACCEPTING COMMA ENVIRONMENT EQUALS FILE INCLUDE INPUTS INPUT_ENABLED INPUT_STATES LEFT_BRACE LEFT_BRACKET LEFT_PAREN LIVENESS NAME OUTPUTS OUTPUT_STATES PROCESS RECEIVE RIGHT_BRACE RIGHT_BRACKET RIGHT_PAREN SAFETY SEND STATES STRONG_FAIRNESS STRONG_NON_BLOCKINGautomata : include automata\n | function automata\n | definition automata\n | instantiation automata\n | strong_non_blocking automata\n | include\n | function\n | definition\n | instantiation\n | strong_non_blocking\n | errorinclude : INCLUDE FILEstrong_non_blocking : STRONG_NON_BLOCKING LEFT_BRACKET names RIGHT_BRACKETdefinition : PROCESS NAME inner\n | ENVIRONMENT NAME inner\n | LIVENESS NAME inner\n | SAFETY NAME innerinner : LEFT_BRACE optional_states optional_input_states optional_output_states inputs optional_input_enabled outputs initial optional_accepting edges RIGHT_BRACE\n inputs : INPUTS LEFT_BRACKET names RIGHT_BRACKEToptional_input_enabled : INPUT_ENABLED LEFT_BRACKET names RIGHT_BRACKEToptional_input_enabled : outputs : OUTPUTS LEFT_BRACKET names RIGHT_BRACKEToptional_states : STATES LEFT_BRACKET names RIGHT_BRACKEToptional_states : optional_input_states : INPUT_STATES LEFT_BRACKET names RIGHT_BRACKEToptional_input_states : optional_output_states : OUTPUT_STATES LEFT_BRACKET names RIGHT_BRACKEToptional_output_states : optional_accepting : ACCEPTING LEFT_BRACKET names RIGHT_BRACKEToptional_accepting : instantiation : NAME EQUALS NAME LEFT_PAREN names RIGHT_PARENfunction : PROCESS NAME LEFT_PAREN names RIGHT_PAREN inner\n | ENVIRONMENT NAME LEFT_PAREN names RIGHT_PAREN inner\n | LIVENESS NAME LEFT_PAREN names RIGHT_PAREN inner\n | SAFETY NAME LEFT_PAREN names RIGHT_PAREN inner\n names : NAME COMMA namesnames : NAME\n |initial : NAME NAMEedges : edge edgesedges : edge : NAME NAME SEND NAME\n | NAME NAME RECEIVE NAMEedge : NAME NAME SEND NAME STRONG_FAIRNESS\n | NAME NAME RECEIVE NAME STRONG_FAIRNESS'
_lr_action_items = {'STRONG_FAIRNESS':([103,104,],[105,106,]),'INPUT_STATES':([27,40,66,],[-24,49,-23,]),'RIGHT_BRACKET':([20,30,31,42,48,52,57,58,67,70,74,75,78,79,83,84,89,94,99,],[-38,-37,43,-38,-38,-36,66,-38,71,-38,-38,80,-38,85,-38,90,95,-38,102,]),'STATES':([27,],[39,]),'LEFT_BRACE':([15,24,25,26,51,54,55,56,],[27,27,27,27,27,27,27,27,]),'FILE':([8,],[21,]),'RIGHT_PAREN':([28,30,33,35,37,41,42,44,45,46,47,52,53,],[-38,-37,-38,-38,-38,51,-38,-38,54,55,56,-36,62,]),'LEFT_PAREN':([15,24,25,26,32,],[28,33,35,37,44,]),'INPUT_ENABLED':([68,85,],[73,-19,]),'COMMA':([30,],[42,]),'$end':([2,3,4,5,6,9,14,16,17,18,19,21,22,29,34,36,38,43,61,62,63,64,65,97,],[-9,-10,0,-6,-7,-8,-11,-4,-5,-1,-2,-12,-3,-15,-14,-16,-17,-13,-33,-31,-32,-34,-35,-18,]),'INPUTS':([27,40,50,59,66,71,80,],[-24,-26,-28,69,-23,-25,-27,]),'RECEIVE':([96,],[100,]),'STRONG_NON_BLOCKING':([0,2,3,5,6,9,21,29,34,36,38,43,61,62,63,64,65,97,],[7,7,7,7,7,7,-12,-15,-14,-16,-17,-13,-33,-31,-32,-34,-35,-18,]),'EQUALS':([10,],[23,]),'RIGHT_BRACE':([81,86,88,92,93,98,102,103,104,105,106,],[-30,-41,-39,97,-41,-40,-29,-43,-42,-45,-44,]),'OUTPUT_STATES':([27,40,50,66,71,],[-24,-26,60,-23,-25,]),'INCLUDE':([0,2,3,5,6,9,21,29,34,36,38,43,61,62,63,64,65,97,],[8,8,8,8,8,8,-12,-15,-14,-16,-17,-13,-33,-31,-32,-34,-35,-18,]),'ENVIRONMENT':([0,2,3,5,6,9,21,29,34,36,38,43,61,62,63,64,65,97,],[1,1,1,1,1,1,-12,-15,-14,-16,-17,-13,-33,-31,-32,-34,-35,-18,]),'NAME':([0,1,2,3,5,6,9,11,12,13,20,21,23,28,29,33,34,35,36,37,38,42,43,44,48,58,61,62,63,64,65,70,74,76,78,81,82,83,86,88,91,93,94,95,97,100,101,102,103,104,105,106,],[10,15,10,10,10,10,10,24,25,26,30,-12,32,30,-15,30,-14,30,-16,30,-17,30,-13,30,30,30,-33,-31,-32,-34,-35,30,30,82,30,-30,88,30,91,-39,96,91,30,-22,-18,103,104,-29,-43,-42,-45,-44,]),'PROCESS':([0,2,3,5,6,9,21,29,34,36,38,43,61,62,63,64,65,97,],[11,11,11,11,11,11,-12,-15,-14,-16,-17,-13,-33,-31,-32,-34,-35,-18,]),'OUTPUTS':([68,72,85,90,],[-21,77,-19,-20,]),'LIVENESS':([0,2,3,5,6,9,21,29,34,36,38,43,61,62,63,64,65,97,],[12,12,12,12,12,12,-12,-15,-14,-16,-17,-13,-33,-31,-32,-34,-35,-18,]),'SEND':([96,],[101,]),'SAFETY':([0,2,3,5,6,9,21,29,34,36,38,43,61,62,63,64,65,97,],[13,13,13,13,13,13,-12,-15,-14,-16,-17,-13,-33,-31,-32,-34,-35,-18,]),'error':([0,2,3,5,6,9,21,29,34,36,38,43,61,62,63,64,65,97,],[14,14,14,14,14,14,-12,-15,-14,-16,-17,-13,-33,-31,-32,-34,-35,-18,]),'ACCEPTING':([81,88,],[87,-39,]),'LEFT_BRACKET':([7,39,49,60,69,73,77,87,],[20,48,58,70,74,78,83,94,]),}
_lr_action = {}
for _k, _v in _lr_action_items.items():
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_action: _lr_action[_x] = {}
_lr_action[_x][_k] = _y
del _lr_action_items
_lr_goto_items = {'function':([0,2,3,5,6,9,],[6,6,6,6,6,6,]),'definition':([0,2,3,5,6,9,],[9,9,9,9,9,9,]),'instantiation':([0,2,3,5,6,9,],[2,2,2,2,2,2,]),'initial':([76,],[81,]),'inputs':([59,],[68,]),'outputs':([72,],[76,]),'strong_non_blocking':([0,2,3,5,6,9,],[3,3,3,3,3,3,]),'optional_output_states':([50,],[59,]),'optional_input_enabled':([68,],[72,]),'edges':([86,93,],[92,98,]),'edge':([86,93,],[93,93,]),'optional_accepting':([81,],[86,]),'automata':([0,2,3,5,6,9,],[4,16,17,18,19,22,]),'optional_input_states':([40,],[50,]),'inner':([15,24,25,26,51,54,55,56,],[29,34,36,38,61,63,64,65,]),'optional_states':([27,],[40,]),'include':([0,2,3,5,6,9,],[5,5,5,5,5,5,]),'names':([20,28,33,35,37,42,44,48,58,70,74,78,83,94,],[31,41,45,46,47,52,53,57,67,75,79,84,89,99,]),}
_lr_goto = {}
for _k, _v in _lr_goto_items.items():
for _x, _y in zip(_v[0], _v[1]):
if not _x in _lr_goto: _lr_goto[_x] = {}
_lr_goto[_x][_k] = _y
del _lr_goto_items
_lr_productions = [
("S' -> automata","S'",1,None,None,None),
('automata -> include automata','automata',2,'p_automata','parser.py',138),
('automata -> function automata','automata',2,'p_automata','parser.py',139),
('automata -> definition automata','automata',2,'p_automata','parser.py',140),
('automata -> instantiation automata','automata',2,'p_automata','parser.py',141),
('automata -> strong_non_blocking automata','automata',2,'p_automata','parser.py',142),
('automata -> include','automata',1,'p_automata','parser.py',143),
('automata -> function','automata',1,'p_automata','parser.py',144),
('automata -> definition','automata',1,'p_automata','parser.py',145),
('automata -> instantiation','automata',1,'p_automata','parser.py',146),
('automata -> strong_non_blocking','automata',1,'p_automata','parser.py',147),
('automata -> error','automata',1,'p_automata','parser.py',148),
('include -> INCLUDE FILE','include',2,'p_include','parser.py',153),
('strong_non_blocking -> STRONG_NON_BLOCKING LEFT_BRACKET names RIGHT_BRACKET','strong_non_blocking',4,'p_strong_non_blocking','parser.py',173),
('definition -> PROCESS NAME inner','definition',3,'p_definition','parser.py',183),
('definition -> ENVIRONMENT NAME inner','definition',3,'p_definition','parser.py',184),
('definition -> LIVENESS NAME inner','definition',3,'p_definition','parser.py',185),
('definition -> SAFETY NAME inner','definition',3,'p_definition','parser.py',186),
('inner -> LEFT_BRACE optional_states optional_input_states optional_output_states inputs optional_input_enabled outputs initial optional_accepting edges RIGHT_BRACE','inner',11,'p_inner','parser.py',247),
('inputs -> INPUTS LEFT_BRACKET names RIGHT_BRACKET','inputs',4,'p_inputs','parser.py',271),
('optional_input_enabled -> INPUT_ENABLED LEFT_BRACKET names RIGHT_BRACKET','optional_input_enabled',4,'p_input_enabled','parser.py',275),
('optional_input_enabled -> <empty>','optional_input_enabled',0,'p_input_enabled_empty','parser.py',279),
('outputs -> OUTPUTS LEFT_BRACKET names RIGHT_BRACKET','outputs',4,'p_outputs','parser.py',283),
('optional_states -> STATES LEFT_BRACKET names RIGHT_BRACKET','optional_states',4,'p_states','parser.py',287),
('optional_states -> <empty>','optional_states',0,'p_states_empty','parser.py',291),
('optional_input_states -> INPUT_STATES LEFT_BRACKET names RIGHT_BRACKET','optional_input_states',4,'p_input_states','parser.py',295),
('optional_input_states -> <empty>','optional_input_states',0,'p_input_states_empty','parser.py',299),
('optional_output_states -> OUTPUT_STATES LEFT_BRACKET names RIGHT_BRACKET','optional_output_states',4,'p_output_states','parser.py',303),
('optional_output_states -> <empty>','optional_output_states',0,'p_output_states_empty','parser.py',307),
('optional_accepting -> ACCEPTING LEFT_BRACKET names RIGHT_BRACKET','optional_accepting',4,'p_accepting','parser.py',311),
('optional_accepting -> <empty>','optional_accepting',0,'p_accepting_empty','parser.py',315),
('instantiation -> NAME EQUALS NAME LEFT_PAREN names RIGHT_PAREN','instantiation',6,'p_instantiation','parser.py',371),
('function -> PROCESS NAME LEFT_PAREN names RIGHT_PAREN inner','function',6,'p_function','parser.py',379),
('function -> ENVIRONMENT NAME LEFT_PAREN names RIGHT_PAREN inner','function',6,'p_function','parser.py',380),
('function -> LIVENESS NAME LEFT_PAREN names RIGHT_PAREN inner','function',6,'p_function','parser.py',381),
('function -> SAFETY NAME LEFT_PAREN names RIGHT_PAREN inner','function',6,'p_function','parser.py',382),
('names -> NAME COMMA names','names',3,'p_names_many','parser.py',387),
('names -> NAME','names',1,'p_names_single','parser.py',391),
('names -> <empty>','names',0,'p_names_single','parser.py',392),
('initial -> NAME NAME','initial',2,'p_initial','parser.py',396),
('edges -> edge edges','edges',2,'p_edges_many','parser.py',402),
('edges -> <empty>','edges',0,'p_edges_empty','parser.py',406),
('edge -> NAME NAME SEND NAME','edge',4,'p_edge','parser.py',410),
('edge -> NAME NAME RECEIVE NAME','edge',4,'p_edge','parser.py',411),
('edge -> NAME NAME SEND NAME STRONG_FAIRNESS','edge',5,'p_edge_with_strong_fairness','parser.py',415),
('edge -> NAME NAME RECEIVE NAME STRONG_FAIRNESS','edge',5,'p_edge_with_strong_fairness','parser.py',416),
]
|
'''for c in range(1, 10): #usar este comando apenas quando vc sabe o limite, ponto final, caso não saiba usa-se while
print(c)
print('FIM')'''
# USANDO WHILE, bom usar quando não sabemos o limite final do loob, ou seja, até que ponto chegar
'''c = 1 #COMEÇA NO 1
while c < 10: #ENQUANTO FOR MENOR QUE 10, CONTINUE COM OS PASSOS
print(c)
c += 1 #OU TBM PODEMOS USAR C = C + 1, essa matemática é usada, pois sempre que acabar um loop ele vai somar mais 1 passo até 10
print('FIM')'''
# EXEMPLO DE USO DO WHILE QUANDO VC NÃO SABE O LIMITE FINAL DA OPERAÇÃO
r = 'S' #ACONTAGEM SE INICIA EM 1, ou str que deseja finalizar o programa
while r == 'S': #O programa será paralisado apenas quando o usuário digitar o zero ou a letra, neste caso, condição de parada
n = int(input('Digite um valor: '))
r = str(input('Quer continuar? [S/N] : ')).upper()
print('FIM')
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------
# Arquivo de configuração
# -------------------
# URL para ser minerada
website = "http://gmasson.com.br/"
# TAG á ser minerada
tag_open = "<title"
tag_close = "</title>"
|
#1. get input
#2. store each character into an array
#3. convert to ascii
#4. change even to odd and odd to even
#5. convert from ascii to char
#6. convert array to string
#7. print string
#1
"""
print("#1")
text = input("Enter text for encryption or decryption")
#2
print("#2")
letters = []
character = text.split()
for character in text:
print(character)
letters.append(character)
#3
print("#3")
i=0
while(i<len(letters)):
letters[i] = ord(letters[i])
print(letters[i])
i += 1
#4
print("#4")
i=0
while(i<len(letters)):
check = letters[i] % 2
if(check == 0):
letters[i] -= 1
else:
letters[i] += 1
i += 1
#5
print("#5")
i=0
while(i<len(letters)):
print(letters[i])
letters[i] = chr(letters[i])
print(letters[i])
i += 1
#6
print("#6")
word = ""
i=0
while(i<len(letters)):
word = word + letters[i]
i += 1
print(word)
"""
def get_input(text):
letters = []
character = text.split()
for character in text:
print(character)
letters.append(character)
return letters
def to_ascii(letters):
i = 0
while (i < len(letters)):
letters[i] = ord(letters[i])
print(letters[i])
i += 1
return letters
def encrypt(letters):
i = 0
while (i < len(letters)):
check = letters[i] % 2
if (check == 0):
letters[i] -= 1
else:
letters[i] += 1
i += 1
return letters
def to_char(letters):
i = 0
while (i < len(letters)):
print(letters[i])
letters[i] = chr(letters[i])
print(letters[i])
i += 1
return letters
def concatinate(letters):
word = ""
i = 0
while (i < len(letters)):
word = word + letters[i]
i += 1
return word
def encrypt_input(input):
letters = []
letters = get_input(input)
letters = to_ascii(letters)
letters = encrypt(letters)
letters = to_char(letters)
text = concatinate(letters)
return text
|
# Class Hero, containig all the
# current information about the hero
class Hero:
"""Hero"""
def __init__(self, health=100, magic=0):
self.health = health
self.magic = magic
self.x = None
self.y = None
def printH(self):
print('Health: {0}, Magic: {1}, X: {2}, Y: {3}'.
format(self.health, self.magic, self.x, self.y))
def setHealth(self, num):
if num >= 0:
self.health = num
else:
self.health = 0
|
class Heap:
def __init__(self,maxSize):
self.heapList = (maxSize+1)*[None]
self.heapSize = 0
self.maxSize = maxSize
def __str__(self):
return str(self.heapList)
def size(self,root):
return root.heapSize
def peek(self,root):
if root.heapList[1] == None:
return None
else:
return root.heapList[1]
def levelOrderTraversal(self,root):
if root.heapSize == 0:
return
else:
for i in range(1,root.heapSize+1):
print(root.heapList[i])
def heapifyTreeInsert(self,root,index,heapType):
parentIndex = index//2
if index <= 1:
return
if heapType == "Min":
if root.heapList[index] < root.heapList[parentIndex]:
temp = root.heapList[index]
root.heapList[index] = root.heapList[parentIndex]
root.heapList[parentIndex] = temp
self.heapifyTreeInsert(root,parentIndex,heapType)
elif heapType == "Max":
if root.heapList[index] > root.heapList[parentIndex]:
temp = root.heapList[index]
root.heapList[index] = root.heapList[parentIndex]
root.heapList[parentIndex] = temp
self.heapifyTreeInsert(root,parentIndex,heapType)
def insert(self,root,value,heapType):
if root.heapSize == root.maxSize+1:
return 'Binary Heap is full'
root.heapList[root.heapSize+1] = value
root.heapSize += 1
self.heapifyTreeInsert(root,root.heapSize,heapType)
return 'Inserted successfully'
def heapifyTreeExtract(self,root,index,heapType):
leftIndex = index * 2
rightIndex = index * 2 + 1
swapChild = 0
if leftIndex > root.heapSize:
return
elif root.heapSize == leftIndex:
if heapType == "Min":
if root.heapList[index] > root.heapList[leftIndex]:
temp = root.heapList[index]
root.heapList[index] = root.heapList[leftIndex]
root.heapList[leftIndex] = temp
return
elif heapType == "Max":
if root.heapList[index] < root.heapList[leftIndex]:
temp = root.heapList[index]
root.heapList[index] = root.heapList[swapChild]
root.heapList[swapChild] = temp
return
else:
if heapType == "Min":
if root.heapList[leftIndex] < root.heapList[rightIndex]:
swapChild = leftIndex
else:
swapChild = rightIndex
if root.heapList[index] > root.heapList[swapChild]:
temp = root.heapList[index]
root.heapList[index] = root.heapList[swapChild]
root.heapList[swapChild] = temp
else:
if root.heapList[leftIndex] > root.heapList[rightIndex]:
swapChild = leftIndex
else:
swapChild = rightIndex
if root.heapList[index] < root.heapList[swapChild]:
temp = root.heapList[index]
root.heapList[index] = root.heapList[swapChild]
root.heapList[swapChild] = temp
self.heapifyTreeExtract(root,swapChild,heapType)
def extract(self,root,heapType):
if root.heapSize == 0:
return
else:
extractedNode = root.heapList[1]
root.heapList[1] = root.heapList[root.heapSize]
root.heapList[root.heapSize] = None
root.heapSize -= 1
self.heapifyTreeExtract(root,1,heapType)
return extractedNode
def clear(self,root):
root.binaryList.clear()
root.heapSize = 0
|
class Lock:
def __init__(self):
self.locked = False
def lock(self, msg):
assert not self.locked, msg
self.locked = True
def unlock(self):
self.locked = False |
# Author: Luka Maletin
class GraphError(Exception):
pass
class Graph(object):
class Vertex(object):
def __init__(self, x):
self._element = x
def element(self):
return self._element
def __hash__(self):
return hash(id(self))
class Edge(object):
def __init__(self, u, v):
self._source = u
self._destination = v
def source(self):
return self._source
def destination(self):
return self._destination
def __hash__(self):
return hash((self._source, self._destination))
def __init__(self):
# (K, V) = (Vertex, destinations (dictionary)):
self._outgoing = {} # top-level dictionary
# (K, V) = (Vertex, sources (dictionary)):
self._incoming = {} # top-level dictionary
# (K, V) = (link, Vertex)
self._vertices = {}
def insert_vertex(self, x=None):
if x not in self._vertices:
v = self.Vertex(x)
# (K, V) = (Vertex, Edge):
self._outgoing[v] = {}
# (K, V) = (Vertex, Edge):
self._incoming[v] = {}
self._vertices[x] = v
return v
else:
return self._vertices[x]
def insert_edge(self, u, v):
if self.get_edge(u, v) is not None:
raise GraphError('Vertices are already connected.')
e = self.Edge(u, v)
self._outgoing[u][v] = e
self._incoming[v][u] = e
def get_edge(self, u, v):
return self._outgoing[u].get(v)
def get_vertex(self, x):
return self._vertices[x]
def incoming_degree(self, v):
return len(self._incoming[v])
def incoming_edges(self, v):
result = []
for edge in self._incoming[v].values():
result.append(edge)
return result
|
def add(*lists_of_numbers):
lengths = set(tuple(tuple(len(sublist) for sublist in outer_list) for outer_list in lists_of_numbers))
if len(lengths) != 1:
raise ValueError
return [[sum(p) for p in zip(*sublists)] for sublists in zip(*lists_of_numbers)]
|
# 8zxx xxxx - Mobile, Data Services, New Numbers and Prepaid Numbers
# 9yxx xxxx - Mobile, Data Services and Pager (until May 2012)
# x denotes 0 to 9
# y denotes 0 to 8 only
# z denotes 1 to 8 only
min8range = 81000000
max8range = 88000000
min9range = 90000000
max9range = 98000000
eight = []
for i in range(min8range, max8range):
eight.append(i)
print("appended")
nine = []
for i in range(min9range, max9range):
nine.append(i)
print("appended")
def printnumbers():
return nine
return eight
printnumbers() |
"""
A file containing validator functions to make sure
the input from SQS Message is correct.
Every function follows the logic of checking the values and
returning True or False depending on whether or not they are correct.
"""
supported_input_formats = [
"WAV",
"FLAC",
"MP3",
"AIFF",
"AAC",
"OGG",
"OPUS",
"WMA",
"FLV",
"OGV",
"AC3"
]
supported_output_formats = [
"WAV",
"FLAC",
"MP3",
"AIFF"
]
def validate_message(data):
try:
validations = [
validate_message_keys(data),
validate_input_keys(data["input"]),
validate_output_keys(data["outputs"])
]
except KeyError:
return False
return False not in validations
def validate_message_keys(body):
return list(body.keys()) == ["id", "input", "outputs"]
def validate_input_keys(input):
return list(input.keys()) == ["key", "bucket"]
def validate_output_keys(outputs):
validations = []
for output in outputs:
validations.append(list(output.keys()) == ["key", "format", "bucket"])
return False not in validations
def check_error_list(errors):
return len(errors) > 0
def validate_input_format(format):
return format.upper() in supported_input_formats
def validate_output_formats(format):
return format.upper() in supported_output_formats
|
if True:
print("It's IF!!!")
while True:
print("It's WHILE!!!") |
POSTS = [
[
'Microsoft Is Hiring!',
'We are looking for a delivry driver to work at our Haifa office',
'Bill Gates',
True,
'Delivery driver',
],
[
'Apple Is Hiring!',
'We are looking for a web developer to work at our Tel Aviv office',
'Tim Cook',
True,
'Web developer',
],
[
'Microsoft Is Hiring!',
'We are looking for a graphic designer to work at our Herzliya offices',
'Bill Gates',
True,
'Graphic Designer',
],
[
'Apple Is Hiring!',
'We are looking for a database administrator to work at our Tel Aviv office',
'Tim Cook',
True,
'Database Administrator',
],
[
'Microsoft Is Hiring!',
'We are looking for an accountant to work at our Tel Aviv office',
'Bill Gates',
True,
'Accountant',
],
[
'Apple Is Hiring!',
'We are looking for a talented human resources specialist to work at our Tel Aviv office',
'Tim Cook',
True,
'Human resources',
],
[
'Im a Job Seeker!',
'Looking for a delivery driver opportunity',
'John Doe',
False,
None,
],
[
'Im Job Seeking!',
'Looking for a django web developing opportunity',
'Jane Doe',
False,
None,
],
[
'Im a Job Seeker!',
'Looking for a secretary full time position',
'Jane Doe',
False,
None,
],
[
'I am looking for a job!',
'Looking for an electrician position',
'John Doe',
False,
None,
],
[
'Please help me find a job',
'Looking for a Graphic Designer opportunity',
'Jane Doe',
False,
None,
],
[
'Im Job Seeking!',
'Looking for a librarian opportunity',
'John Doe',
False,
None,
],
]
|
#!/usr/bin/env python3
# go = False
go = True
pieces_seeds = ['BRU','FRU','RFF','LFUDF','DRBB','BDRB']
# optimisable en mettant les 3 pièces de volume 5 avant les 3 pièces de volume 4 dans pieces_seeds
# TO DO
# tester parties
# check that Rzx=RyxRzyRxy
# afficher une solution sur un graphique 3D coloré par pièces.
# 1st successful run: took a few minutes.
# Input: pieces_seeds = ['BRU','FRU','RFF','LFUDF','DRBB','BDRB']
# Output:
# 1 précube(s).
# 96 précube(s).
# 3168 précube(s).
# 18864 précube(s).
# 133056 précube(s).
# 94848 précube(s).
# 1152 solution(s).
# [[1, 2, 0, 0], [0, 2, 0, 0], [0, 1, 0, 0], [0, 1, 1, 0], [1, 2, 1, 1], [2, 2, 1, 1], [2, 2, 0, 1], [2, 1, 0, 1], [0, 2, 1, 2], [0, 2, 2, 2], [0, 1, 2, 2], [0, 0, 2, 2], [0, 0, 1, 3], [0, 0, 0, 3], [1, 0, 0, 3], [1, 1, 0, 3], [1, 0, 0, 3], [2, 0, 0, 3], [1, 0, 1, 4], [1, 0, 2, 4], [2, 0, 2, 4], [2, 1, 2, 4], [2, 2, 2, 4], [1, 2, 2, 5], [1, 1, 2, 5], [1, 1, 1, 5], [2, 1, 1, 5], [2, 0, 1, 5]]
def iterer(f,n):
def f_new(x):
for k in range(n):
x = f(x)
return x
return f_new
def compose(*fs):
lfs = list(fs)
lfs.reverse()
def f_new(x):
for f in lfs:
x = f(x)
return x
return f_new
def add_tuples(U, V):
return tuple(u + v for (u, v) in zip(U, V))
directions = dict(L=(-1,0,0,0), R=(1,0,0,0), B=(0,-1,0,0), F=(0,1,0,0), D=(0,0,-1,0), U=(0,0,1,0))
def nouvelle_piece(seed, p):
# seed peut passer plusieurs fois par le même bloc
piece = [(0,0,0,p)]
for direction in seed:
piece.append(add_tuples(piece[-1], directions[direction]))
return list(set(piece))
def coords(L):
return {(x,y,z) for (x,y,z,p) in L}
def emplacements(precube, places_prises = None):
if not places_prises:
places_prises = coords(precube)
places_libres = {(x,y,z) for x in range(3) for y in range(3) for z in range(3) if (x,y,z) not in places_prises}
return places_prises, places_libres
def R1(bloc):
return bloc
def Rxy(bloc):
(x,y,z,p) = bloc
return (-y,x,z,p)
def Rzy(bloc):
(x,y,z,p) = bloc
return (x,z,-y,p)
Ryx = iterer(Rxy,3)
Ryz = iterer(Rzy,3)
rotations_v = [R1,Rzy,iterer(Rzy,2),Ryz,compose(Ryx,Rzy,Rxy),compose(Ryx,Ryz,Rxy)]
rotations_h = [R1,Rxy,iterer(Rxy,2),Ryx]
def positions(piece):
# optimisable en factorisant les rotations_v hors de la boucle des rotations_h
for rotation_v in rotations_v:
for rotation_h in rotations_h:
yield([rotation_h(rotation_v(bloc)) for bloc in piece])
def placer(piece, centre_voulu):
p = piece[0][3]
centre_actuel = piece[0][0:3]
return [[(centre_voulu[k] - centre_actuel[k] + bloc[k]) for k in range(3)] + [p] for bloc in piece]
def contingent(piece, places_prises):
# check cube boundaries
for bloc in piece:
for c in bloc[0:3]:
if c < 0 or c > 2:
return False
# check collisions
return not places_prises.intersection(coords(piece))
if go:
pieces_restantes = [nouvelle_piece(pieces_seeds[k], k) for k in range(len(pieces_seeds))]
precubes = [[]]
while pieces_restantes and precubes:
print(len(precubes),'précube(s).')
piece = pieces_restantes.pop()
new_precubes = []
for precube in precubes:
places_prises, places_libres = emplacements(precube)
# optimisable en n'appliquant pas positions() pour la 1ère pièce (grâce aux symétries du cube)
for piece_positionnee in positions(piece):
for emplacement in places_libres:
piece_placee = placer(piece_positionnee, emplacement)
if contingent(piece_placee, places_prises):
new_precubes.append(precube + piece_placee)
precubes = new_precubes
print(len(precubes),'solution(s).')
# afficher et trier par pièces la première solution
print(sorted(precubes[0], key = lambda x: x[3]))
|
class TextureNodeTexBlend:
pass
|
num1=10
num2=20
num3=30
num4=40
|
# lc643.py
# LeetCode 643. Maximum Average Subarray I `E`
# 1sk | 98% | 9'
# A~0g17
class Solution:
def findMaxAverage(self, nums: List[int], k: int) -> float:
maxsum = cursum = sum(nums[0:k])
for i in range(len(nums)-k):
cursum += nums[i+k] - nums[i]
maxsum = max(cursum, maxsum)
return maxsum / k
|
class_names = [
'agricultural',
'airplane',
'baseballdiamond',
'beach',
'buildings',
'chaparral',
'denseresidential',
'forest',
'freeway',
'golfcourse',
'harbor',
'intersection',
'mediumresidential',
'mobilehomepark',
'overpass',
'parkinglot',
'river',
'runway',
'sparseresidential',
'storagetanks',
'tenniscourt',
] |
#! /usr/bin/env python3
# func.py -- This script calls the hello function 10 times.
# Author -- Prince Oppong Boamah<regioths@gmail.com>
# Date -- 27th August, 2015
def hello():
print("Hello world!")
print("I am going to call the hello function 10 times")
for i in range(10):
print("hello")
|
#########################################YOLOV3##################################################################
yolov3_params={
'good_model_path' :'/home/ai/model/freezer/ep3587-loss46.704-val_loss52.474.h5',
'anchors_path' :'./goods/freezer/keras_yolo3/model_data/yolo_anchors.txt',
'classes_path' : './goods/freezer/keras_yolo3/model_data/voc_classes.txt',
'label_path':'./goods/freezer/keras_yolo3/model_data/goods_label_map.pbtxt',
'score' :0.1,
'iou' :0.45,
'model_image_size' : (416, 416),
'gpu_num' : 1,
"diff_switch_iou":(True,0.6),
"single_switch_iou_minscore":(True,0.0,0.3)
}
######################################common#####################################################################
common_params={
'freezer_check_yolov3_switch':True
} |
class RestApiException(Exception):
def __init__(self, message, status_code):
super(RestApiException, self).__init__(message)
self.status_code = status_code
self.message = message
def __unicode__(self, ):
return "%s" % self.message
def __repr__(self, ):
return "%s" % self.message
|
QUERIES = {
'add_service':
'insert into services(name, type, repeat_period, metadata, status) values("{name}", {type}, {repeat_period}, "{metadata}", 1)',
'services_last_row_id': 'select max(id) from services',
'get_active_services': 'select services.id, services.name, services.type, service_types.Type, services.repeat_period, services.metadata from services INNER join service_types on services.type = service_types.id',
'get_active_services_type': 'select services.id, services.name, services.type, service_types.Type, services.repeat_period, services.metadata from services INNER join service_types on services.type = service_types.id where services.type = {}'
}
|
# 循环链表实现
class ListNode:
def __init__(self, val):
self.val = val
self.prev = None
self.next = None
class LinkedList:
def __init__(self):
self.head = None
self.tail = None
self.size = 0
# 添加元素至链表尾部
def add(self, val: int):
node = ListNode(val)
if not self.head:
self.head = node
if self.tail:
self.tail.next = node
self.tail = node
self.tail.next = self.head
self.size += 1
# 在某个节点之后添加节点
def addAfter(self, p: ListNode, val: int):
if not p:
return
node = ListNode(val)
node.next = p.next
p.next = node
if p == self.tail:
self.tail = node
self.tail.next = self.head
self.size += 1
# 根据值删除节点
def delete(self, val: int):
node = self.find(val)
if node is None:
return
if node == self.head:
self.head = self.head.next
else:
prev = lis.head
for i in range(self.size):
if prev.next == node:
break
prev.next = node.next.next
self.size -= 1
# 根据元素值查找节点
def find(self, val: int):
p = self.head
for i in range(self.size):
if p.val == val:
return p
p = p.next
return p
# 打印链表中所有元素
def print(self):
p = self.head
for i in range(self.size):
print(p.val, end=' ')
p = p.next
print()
def __size__(self):
return self.size
if __name__ == '__main__':
lis = LinkedList()
lis.add(10)
lis.delete(10)
lis.print()
lis.add(8)
lis.add(21)
lis.add(3)
lis.add(9)
print(lis.__size__())
lis.print()
n = lis.find(10)
print(n.val)
lis.addAfter(n, 15)
lis.print()
n9 = lis.find(9)
lis.addAfter(n9, 24)
lis.print()
lis.delete(24)
lis.print()
print(lis.size)
|
adj_descriptions = {
'STR': {
'short': [
'Atk Mod',
'Dmg Adj',
'Test',
'Feat',
],
'long': [
'Melee Attack',
'Damage Adjustment',
'Test of STR',
'Feat of STR',
],
},
'DEX': {
'short': [
'Atk Mod',
'Def Adj',
'Test',
'Feat',
],
'long': [
'Missile Attack',
'Defense Adjustment',
'Test of DEX',
'Feat of DEX',
],
},
'CON': {
'short': [
'HP Adj',
'Poison Adj',
'Surv',
'Test',
'Feat',
],
'long': [
'Hit Point Adjustment',
'Poison Adjustment',
'Trauma Survival',
'Test of CON',
'Feat of CON',
],
},
'INT': {
'short': [
'Lang',
'Bonus Spells',
'Learn Spell',
],
'long': [
'Languages',
'Bonus Spells Per Day',
'Chance to Learn Spell',
],
},
'WIS': {
'short': [
'Will Adj',
'Bonus Spells',
'Learn Spell',
],
'long': [
'Willpower Adjustment',
'Bonus Spells Per Day',
'Chance to Learn Spell',
],
},
'CHA': {
'short': [
'Reac Adj',
'Max Henchmen',
'Turning Adj',
],
'long': [
'Reaction / Loyalty Adjustment',
'Maximum Number of Henchmen',
'Undead Turning Adjustment',
],
},
}
adjustments = {
'STR': {
3: [-2, -2, "1:6", "0%"],
4: [-1, -1, "1:6", "1%"],
5: [-1, -1, "1:6", "1%"],
6: [-1, -1, "1:6", "1%"],
7: [ 0, -1, "2:6", "2%"],
8: [ 0, -1, "2:6", "2%"],
9: [ 0, 0, "2:6", "4%"],
10: [ 0, 0, "2:6", "4%"],
11: [ 0, 0, "2:6", "4%"],
12: [ 0, 0, "2:6", "4%"],
13: [ 0, 1, "3:6", "8%"],
14: [ 0, 1, "3:6", "8%"],
15: [ 1, 1, "3:6", "16%"],
16: [ 1, 1, "3:6", "16%"],
17: [ 1, 2, "4:6", "24%"],
18: [ 2, 3, "5:6", "32%"],
},
'DEX': {
3: [-2, -2, "1:6", "0%"],
4: [-1, -1, "1:6", "1%"],
5: [-1, -1, "1:6", "1%"],
6: [-1, -1, "1:6", "1%"],
7: [-1, 0, "2:6", "2%"],
8: [-1, 0, "2:6", "2%"],
9: [ 0, 0, "2:6", "4%"],
10: [ 0, 0, "2:6", "4%"],
11: [ 0, 0, "2:6", "4%"],
12: [ 0, 0, "2:6", "4%"],
13: [ 1, 0, "3:6", "8%"],
14: [ 1, 0, "3:6", "8%"],
15: [ 1, 1, "3:6", "16%"],
16: [ 1, 1, "3:6", "16%"],
17: [ 2, 1, "4:6", "24%"],
18: [ 3, 2, "5:6", "32%"],
},
'CON': {
3: [-1, -2, "45%", "1:6", "0%"],
4: [-1, -1, "55%", "1:6", "1%"],
5: [-1, -1, "55%", "1:6", "1%"],
6: [-1, -1, "55%", "1:6", "1%"],
7: [ 0, 0, "65%", "2:6", "2%"],
8: [ 0, 0, "65%", "2:6", "2%"],
9: [ 0, 0, "75%", "2:6", "4%"],
10: [ 0, 0, "75%", "2:6", "4%"],
11: [ 0, 0, "75%", "2:6", "4%"],
12: [ 0, 0, "75%", "2:6", "4%"],
13: [ 1, 0, "80%", "3:6", "8%"],
14: [ 1, 0, "80%", "3:6", "8%"],
15: [ 1, 1, "85%", "3:6", "16%"],
16: [ 1, 1, "85%", "3:6", "16%"],
17: [ 2, 1, "90%", "4:6", "24%"],
18: [ 3, 2, "95%", "5:6", "32%"],
},
'INT': {
3: ["Illiterate", "N/A", "N/A"],
4: ["Illiterate", "N/A", "N/A"],
5: ["Illiterate", "N/A", "N/A"],
6: ["Illiterate", "N/A", "N/A"],
7: ["+0", "N/A", "N/A"],
8: ["+0", "N/A", "N/A"],
9: ["+0", "--", "50%"],
10: ["+0", "--", "50%"],
11: ["+0", "--", "50%"],
12: ["+0", "--", "50%"],
13: ["+1", "1st", "65%"],
14: ["+1", "1st", "65%"],
15: ["+1", "1st, 2nd", "75%"],
16: ["+1", "1st, 2nd", "75%"],
17: ["+2", "1st, 2nd, 3rd", "85%"],
18: ["+3", "1st, 2nd, 3rd, 4th", "95%"],
},
'WIS': {
3: [-2, "N/A", "N/A"],
4: [-1, "N/A", "N/A"],
5: [-1, "N/A", "N/A"],
6: [-1, "N/A", "N/A"],
7: [0, "N/A", "N/A"],
8: [0, "N/A", "N/A"],
9: [0, "--", "50%"],
10: [0, "--", "50%"],
11: [0, "--", "50%"],
12: [0, "--", "50%"],
13: [0, "1st", "65%"],
14: [0, "1st", "65%"],
15: [1, "1st, 2nd", "75%"],
16: [1, "1st, 2nd", "75%"],
17: [1, "1st, 2nd, 3rd", "85%"],
18: [2, "1st, 2nd, 3rd, 4th", "95%"],
},
'CHA': {
3: [-3, 1, -1],
4: [-2, 2, -1],
5: [-2, 2, -1],
6: [-2, 2, -1],
7: [-1, 3, 0],
8: [-1, 3, 0],
9: [ 0, 4, 0],
10: [ 0, 4, 0],
11: [ 0, 4, 0],
12: [ 0, 4, 0],
13: [ 1, 6, 0],
14: [ 1, 6, 0],
15: [ 1, 8, 1],
16: [ 1, 8, 1],
17: [ 2, 10, 1],
18: [ 3, 12, 1],
},
}
|
def permutationWCaseChangeUtil(input_string, output_string):
if len(input_string) == 0:
print(output_string, end=', ')
return
modified_output_string1 = output_string + input_string[0].upper()
modified_output_string2 = output_string + input_string[0]
modified_input_string = input_string[1:]
permutationWCaseChangeUtil(modified_input_string, modified_output_string1)
permutationWCaseChangeUtil(modified_input_string, modified_output_string2)
def permutationWCaseChange(input_string):
if len(input_string) == 0:
print('Invalid String')
return
print('permutation with case change of',input_string,':')
permutationWCaseChangeUtil(input_string, '')
print()
permutationWCaseChange('ab')
|
# function = a block of code which is executed only when it is called
name = input("What's your name? ")
age = str(input("What is your age? "))
def trevi(name, age):
print(f'Hello {name}!')
if age == "0":
print(f'Keep Pounding {name}!')
elif age == "1":
print(f'Proud of you {name}. Keep going!')
else:
print(f'Awesome {name}!That\'s the way!')
trevi(name, age)
print('--------')
# return statement = Functions send Python values/objects back to the caller;
# These values/objects are known as the function's return value
def multiply(number_one, number_two):
return number_one * number_two
multi = multiply(3, 7)
print(multi)
# keyword arguments = arguments proceded by an identifier when we pass then to a function
# The order of the arguments doest matter, unlike positional arguments
# Python knows the names of the arguments that our function receives
first = input("What is your first name? ")
middle = input("What is your middle name? ")
last = input("What is your last name? ")
def hello(first, middle, last):
print(f"Hello {first} {middle} {last}. Welcome to the new world.")
# hello(last=last, first=first, middle=middle)
# nested functions calls = function inside other function calls;
# innermost functin calls are resolved first;
# returned values is used as argument for the next outer function
# num = input("Enter a whole positive number: ")
# num = float(num)
# num = abs(num)
# num = round(num)
# print(num)
print(round(abs(float(input("Enter a whole positive number: "))))) |
def non_capitalized():
"""
compute the MACD (Moving Average Convergence/Divergence) using ...
"""
def capitalized():
"""
Compute the MACD (Moving Average Convergence/Divergence) using ...
"""
|
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def reorderList(self, head):
if head:
arr = []
while head:
arr += head,
head = head.next
l, r, prev = 0, len(arr) - 1, ListNode(0)
while l < r: prev.next, arr[l].next, prev, l, r = arr[l], arr[r], arr[r], l + 1, r - 1
if l == r: prev.next = arr[l]
arr[l].next = None |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.