content
stringlengths 7
1.05M
|
|---|
def is_in_interval(n):
return (-15 < n <= 12) or (14 < n < 17) or (19 <= n)
print(is_in_interval(int(input())))
|
class UniBrokerMessageManager:
def reject(self) -> None:
raise NotImplementedError(f'method reject must be specified for class "{type(self).__name__}"')
def ack(self) -> None:
raise NotImplementedError(f'method acknowledge must be specified for class "{type(self).__name__}"')
|
__all__ = (
"Node",
"DefinitionNode",
"ExecutableDefinitionNode",
"TypeSystemDefinitionNode",
"TypeSystemExtensionNode",
"TypeDefinitionNode",
"TypeExtensionNode",
"SelectionNode",
"ValueNode",
"TypeNode",
)
class Node:
__slots__ = ()
class DefinitionNode(Node):
__slots__ = ()
class ExecutableDefinitionNode(DefinitionNode):
__slots__ = ()
class TypeSystemDefinitionNode(DefinitionNode):
__slots__ = ()
class TypeSystemExtensionNode(DefinitionNode):
__slots__ = ()
class TypeDefinitionNode(TypeSystemDefinitionNode):
__slots__ = ()
class TypeExtensionNode(TypeSystemExtensionNode):
__slots__ = ()
class SelectionNode(Node):
__slots__ = ()
class ValueNode(Node):
__slots__ = ()
class TypeNode(Node):
__slots__ = ()
|
class Sort:
col_id: str
sort: str
def __init__(self, col_id, sort):
self.col_id = col_id
self.sort = sort
@staticmethod
def from_json(json: dict):
if not json:
raise Exception('Error. Sort was not defined but should be.')
sort = Sort()
# colId is required.
if 'colId' in json:
sort.col_id = json['colId']
else:
raise Exception('Error. json.colId was not defined.')
# sort is required.
if 'sort' in json:
sort.sort = json['sort']
else:
raise Exception('Error. json.sort was not defined.')
return sort
def to_json(self):
return {
'colId': self.col_id,
'sort': self.sort
}
|
ANIMALS = [
"aardvark",
"aardwolf",
"albatross",
"alligator",
"alpaca",
"amphibian",
"anaconda",
"angelfish",
"anglerfish",
"ant",
"anteater",
"antelope",
"antlion",
"ape",
"aphid",
"armadillo",
"asp",
"baboon",
"badger",
"bandicoot",
"barnacle",
"barracuda",
"basilisk",
"bass",
"bat",
"bear",
"beaver",
"bedbug",
"bee",
"beetle",
"bird",
"bison",
"blackbird",
"boa",
"boar",
"bobcat",
"bobolink",
"bonobo",
"booby",
"bovid",
"bug",
"butterfly",
"buzzard",
"camel",
"canid",
"canidae",
"capybara",
"cardinal",
"caribou",
"carp",
"cat",
"caterpillar",
"catfish",
"catshark",
"cattle",
"centipede",
"cephalopod",
"chameleon",
"cheetah",
"chickadee",
"chicken",
"chimpanzee",
"chinchilla",
"chipmunk",
"cicada",
"clam",
"clownfish",
"cobra",
"cockroach",
"cod",
"condor",
"constrictor",
"coral",
"cougar",
"cow",
"coyote",
"crab",
"crane",
"crawdad",
"crayfish",
"cricket",
"crocodile",
"crow",
"cuckoo",
"damselfly",
"deer",
"dingo",
"dinosaur",
"dog",
"dolphin",
"dormouse",
"dove",
"dragon",
"dragonfly",
"duck",
"eagle",
"earthworm",
"earwig",
"echidna",
"eel",
"egret",
"elephant",
"elk",
"emu",
"ermine",
"falcon",
"felidae",
"ferret",
"finch",
"firefly",
"fish",
"flamingo",
"flea",
"fly",
"flyingfish",
"fowl",
"fox",
"frog",
"galliform",
"gamefowl",
"gayal",
"gazelle",
"gecko",
"gerbil",
"gibbon",
"giraffe",
"goat",
"goldfish",
"goose",
"gopher",
"gorilla",
"grasshopper",
"grouse",
"guan",
"guanaco",
"guineafowl",
"gull",
"guppy",
"haddock",
"halibut",
"hamster",
"hare",
"harrier",
"hawk",
"hedgehog",
"heron",
"herring",
"hippopotamus",
"hookworm",
"hornet",
"horse",
"hoverfly",
"hummingbird",
"hyena",
"iguana",
"impala",
"jackal",
"jaguar",
"jay",
"jellyfish",
"junglefowl",
"kangaroo",
"kingfisher",
"kite",
"kiwi",
"koala",
"koi",
"krill",
"ladybug",
"lamprey",
"landfowl",
"lark",
"leech",
"lemming",
"lemur",
"leopard",
"leopon",
"limpet",
"lion",
"lizard",
"llama",
"lobster",
"locust",
"loon",
"louse",
"lungfish",
"lynx",
"macaw",
"mackerel",
"magpie",
"mammal",
"manatee",
"mandrill",
"marlin",
"marmoset",
"marmot",
"marsupial",
"marten",
"mastodon",
"meadowlark",
"meerkat",
"mink",
"minnow",
"mite",
"mockingbird",
"mole",
"mollusk",
"mongoose",
"moose",
"mosquito",
"moth",
"mouse",
"mule",
"muskox",
"narwhal",
"newt",
"nightingale",
"ocelot",
"octopus",
"opossum",
"orangutan",
"orca",
"ostrich",
"otter",
"owl",
"ox",
"panda",
"panther",
"parakeet",
"parrot",
"parrotfish",
"partridge",
"peacock",
"peafowl",
"pelican",
"penguin",
"perch",
"pheasant",
"pigeon",
"pike",
"pinniped",
"piranha",
"planarian",
"platypus",
"pony",
"porcupine",
"porpoise",
"possum",
"prawn",
"primate",
"ptarmigan",
"puffin",
"puma",
"python",
"quail",
"quelea",
"quokka",
"rabbit",
"raccoon",
"rat",
"rattlesnake",
"raven",
"reindeer",
"reptile",
"rhinoceros",
"roadrunner",
"rodent",
"rook",
"rooster",
"roundworm",
"sailfish",
"salamander",
"salmon",
"sawfish",
"scallop",
"scorpion",
"seahorse",
"shark",
"sheep",
"shrew",
"shrimp",
"silkworm",
"silverfish",
"skink",
"skunk",
"sloth",
"slug",
"smelt",
"snail",
"snake",
"snipe",
"sole",
"sparrow",
"spider",
"spoonbill",
"squid",
"squirrel",
"starfish",
"stingray",
"stoat",
"stork",
"sturgeon",
"swallow",
"swan",
"swift",
"swordfish",
"swordtail",
"tahr",
"takin",
"tapir",
"tarantula",
"tarsier",
"termite",
"tern",
"thrush",
"tick",
"tiger",
"tiglon",
"toad",
"tortoise",
"toucan",
"trout",
"tuna",
"turkey",
"turtle",
"tyrannosaurus",
"unicorn",
"urial",
"vicuna",
"viper",
"vole",
"vulture",
"wallaby",
"walrus",
"warbler",
"wasp",
"weasel",
"whale",
"whippet",
"whitefish",
"wildcat",
"wildebeest",
"wildfowl",
"wolf",
"wolverine",
"wombat",
"woodpecker",
"worm",
"wren",
"xerinae",
"yak",
"zebra",
]
|
# Name of the campaign
CampaignName = 'iview-campaign'
# Name of the parser module. The parser module must be
# in the chromosome/parsers directory.
Parser = 'PNG'
# The path of the initial corpus
InitialPopulation = 'C:\\tmp\\png'
# The fitness algorithms that will be used by Chronzon
# and the weight of each one. Currently, two algorithms
# are implemented, the BasicBlockCoverage and CodeCommonality.
FitnessAlgorithms = {
'BasicBlockCoverage': 0.5,
'CodeCommonality': 0.3
}
# A tuple with the Recombinators that will be used during the fuzzing.
# Users are encouraged to comment out the algorithms that they think
# they are not effective when fuzzing a specific target format. However,
# Choronzon has an internal evaluation system in order to use more often
# the effective algorithms.
Recombinators = (
'AdditiveSimilarGeneCrossOver',
'DuplicateGeneRecombinator',
'RemoveGeneRecombinator',
'RemoveGeneRecombinator',
'ShuffleSiblings',
'ParentChildrenSwap',
'SimilarGeneSwapRecombinator',
'RandomGeneSwapRecombinator',
'RandomGeneInsertRecombinator',
)
# A tuple with the Mutators that will be used during the fuzzing.
Mutators = (
'RandomByteMutator',
'AddRandomData',
'RandomByteMutator',
'RemoveByte',
'SwapAdjacentLines',
'SwapLines',
'RepeatLine',
'RemoveLines',
'QuotedTextualNumberMutator',
'PurgeMutator',
'SwapWord',
'SwapDword',
)
# If KeepGenerations is True the seedfiles of each generation will be stored
# in the campaign directory. Keep in mind though, that this may lead to run out of
# free space, if the fuzzer runs of a long time.
KeepGenerations = True
# The name of the disassembler module that will be used.
# Currently, only IDA is supported.
Disassembler = 'IDADisassembler'
DisassemblerPath = 'C:\\Program Files (x86)\\IDA 6.9'
# The command that will be executed to test the target application.
# Note that %s will be replaced by the fuzzed file.
Command = '\"C:\\Program Files\\IrfanView\\i_view64.exe\" %s'
# A tuple with the modules that will be instrumented in order to collect
# stats to calculate the fitness. Full path of the modules is required.
# Please note, that Whitelist must be a tuple even there is only one module.
Whitelist = ('C:\\Program Files\\IrfanView\\i_view64.exe',)
|
# https://www.acmicpc.net/problem/10872
def n_fac(n):
if n==1:
return 1
else:
return n * n_fac(n-1)
n = int(input())
if n == 0:
print(1)
else:
print(n_fac(n))
|
class TestRequest_certs():
def test_request_certs(self):
return
|
print('MAIOR E MENOR NÚMERO')
a = int(input('Digite um número inteiro: '))
b = int(input('Digite outro número inteiro: '))
c = int(input('Digite outro: '))
#VERIFICANDO O MENOR NÚMERO:
if a<c and a<b:
menor = a
if b<c and b<a:
menor = b
if c<b and c<a:
menor = c
#VERIFICANDO O MAIOR NÚMERO:
if a > c and a > b:
maior = a
if b > c and b > a:
maior = b
if c > b and c > a:
maior = c
print('O menor número digitado é o {}!'.format(menor))
print('O maior número digitado é o {}!'.format(maior))
|
def complement(l):
"Compute the complement of the literal L."
if isinstance(l, str):
return ('¬', l)
else:
return l[1]
def extractVariable(l):
"Extract the propositional variable from the literal L."
if isinstance(l, str):
return l
else:
return l[1]
def arb(S):
"Return some member from the set S."
for x in S:
return x
def selectVariable(Clauses, Forbidden):
return arb({ extractVariable(L) for C in Clauses for L in C } - Forbidden)
def reduce(Clauses, l):
lBar = complement(l)
return { C - { lBar } for C in Clauses if lBar in C } \
| { C for C in Clauses if lBar not in C and l not in C } \
| { frozenset({l}) }
def saturate(Clauses):
S = Clauses.copy()
Units = { C for C in S if len(C) == 1 } # set of unit clausesoccurring in C
Used = set() # remember which unit clauses have already been used
while len(Units) > 0: # iterate as long as we derive new unit clauses
unit = Units.pop()
Used |= { unit }
l = arb(unit)
S = reduce(S, l)
Units = { C for C in S if len(C) == 1 } - Used
return S
def solve(Clauses, Variables):
S = saturate(Clauses);
empty = frozenset()
Falsum = {empty}
if empty in S: # S is inconsistent
return Falsum
if all(len(C) == 1 for C in S): # S is trivial
return S
# case distinction on variaable p
p = selectVariable(S, Variables)
negP = complement(p)
Result = solve(S | { frozenset({p}) }, Variables | { p })
if Result != Falsum:
return Result
return solve(S | { frozenset({negP}) }, Variables| { p })
def toString(S):
"Convert the set S of frozen sets to a string where frozen sets are written as sets."
if S == set():
return '{}'
result = '{ '
for f in S:
result += str(set(f)) + ', '
result = result[:-2]
result += ' }'
return result
|
class Solution:
def removeDuplicateLetters(self, s: str) -> str:
dic = {}
for char in s:
dic[char] = dic.get(char,0)+1
res = []
for char in s:
dic[char] -= 1
if char not in res:
while res and char<res[-1] and dic[res[-1]]>0:
res.pop()
res.append(char)
return ''.join(res)
|
VERSION_NAME = "tmtccmd"
VERSION_MAJOR = 1
VERSION_MINOR = 10
VERSION_REVISION = 2
# I think this needs to be in string representation to be parsed so we can't
# use a formatted string here.
__version__ = "1.10.2"
|
def caesar_encrypt(word,n):
c = ''
for i in word:
if (not i.isalpha()):
c += i
elif (i.isupper()):
c += chr((ord(i) + n-65) % 26 + 65)
else:
c += chr((ord(i) + n - 97) % 26 + 97)
return c
def caesar_decrypt(word,n):
c = ''
for i in word:
if (not i.isalpha()):
c += i
elif (i.isupper()):
c += chr((ord(i) - n -65) % 26 + 65)
# Encrypt lowercase characters
else:
c += chr((ord(i) - n - 97) % 26 + 97)
return c
plain = input()
n=int(input())
cipher = caesar_encrypt(plain,n)
print(cipher)
decipher = caesar_decrypt(cipher,n)
print(decipher)
|
def parOuImpar(n=0):
if n % 2 ==0:
return True
else:
return False
num = int(input("Digite um numero: "))
if parOuImpar(num):
print("E par!")
else:
print("Nao e par!")
|
# coding=utf-8
def yes_no_input():
while True:
choice = raw_input("This will read open or close information 'Type anything': ").lower()
if choice in ['運行', '全面滑走可能', '平常運転','○','● ','open','OPEN','Open','◎','◯','一部滑走可能']:
return True
elif choice in ['運休','時間外','運転見合わせ','close','CLOSE','Close','-','×','-','営業終了','ー']:
return False
if __name__ == '__main__':
if yes_no_input():
print('リフト運行中')
else:
print('運休')
|
# Subtract numbers module
class Calculate:
def sub(a, b):
"""Substract two numbers"""
return a - b
def add(a, b):
"""Add two numbers"""
return a + b
def mult(a, b):
"""Product of two numbers"""
return a * b
def div(a, b):
"""Divide two numbers"""
return a / b
|
inputs = [1, 2, 3, 2.5]
weights1 = [0.2, 0.8, -0.5, 1.0]
weights2 = [0.5, -0.91, 0.26, -0.5]
weights3 = [-0.26, -0.27, 0.17, 0.87]
bias1 = 2
bias2 = 3
bias3 = 0.5
output = [ inputs[0]*weights1[0] + inputs[1]*weights1[1] + inputs[2]*weights1[2] + inputs[3]*weights1[3] + bias1,
inputs[0]*weights2[0] + inputs[1]*weights2[1] + inputs[2]*weights2[2] + inputs[3]*weights2[3] + bias2,
inputs[0]*weights3[0] + inputs[1]*weights3[1] + inputs[2]*weights3[2] + inputs[3]*weights3[3] + bias3
]
print(output)
|
x=[]
for i in range(4):
x.append(int(input()))
x.sort()
ans=sum(x[1:])
x=[]
for i in range(2):
x.append(int(input()))
ans+=max(x)
print(ans)
|
#https://codeforces.com/problemset/problem/588/A
n = int(input())
a, p = map(int, input().split(" "))
mm = a * p # minimum money
mp = p # minimum price
for i in range(n - 1):
a, p = map(int, input().split(" "))
if p < mp:
mp = p
mm += a * mp
print(mm)
|
#42) Coded triangle numbers
#The nth term of the sequence of triangle numbers is given by, tn = (1/2)*n*(n+1); so the first ten triangle numbers are:
#1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
#By converting each letter in a word to a number corresponding to its alphabetical position and adding these values we form a word value. For example, the word value for SKY is 19 + 11 + 25 = 55 = t10. If the word value is a triangle number then we shall call the word a triangle word.
#Using words.txt (right click and 'Save Link/Target As...'), a 16K text file containing nearly two-thousand common English words, how many are triangle words?
#%% Solution
def triangle_nums(x):
n = 1
while int(1/2*n*(n+1)) <= x:
yield int(1/2*n*(n+1))
n += 1
with open("p042_words.txt", mode='r') as doc:
list_words = doc.read().replace('"', '').split(',')
list_values = [sum([ord(x)-64 for x in word]) for word in list_words]
list_triangle = [x for x in list_values if x in triangle_nums(max(list_values))]
len(list_triangle)
|
"""lista = []
lista.append('Guilherme')
lista.append(28)
#print(lista)
lista2 = []
lista2.append(lista[:])
lista[0] = 'Bryan'
lista[1] = 6
lista2.append(lista[:])
print(lista2)
"""
"""lista = [['João', 61], ['Guilherme', 28], ['Julia', 1], ['Bryan', 6]]
# [ [ 0 ],[ 1]], [ 0 ], [1], [ 0 ], [1], [ 0 ], [1]
#Posição[ 0 ], [ 1 ], [ 2 ], [ 3 ]"""
"""for indice in lista:
print(f'{indice[0]} tem {indice[1]} anos.')"""
lista1 = []
lista2 = []
for controle in range(0, 3):
lista2.append(str(input('Nome: ')))
lista2.append(int(input('Idade: ')))
lista1.append(lista2[:])
lista2.clear()
for posicao in lista1:
if posicao[1] >= 21:
print(f'{posicao[0]} é maior e tem {posicao[1]} anos.')
else:
print(f'{posicao[0]} é menor e tem {posicao[1]} anos.')
|
class Solution:
def bagOfTokensScore(self, tokens: List[int], P: int) -> int:
tokens.sort()
tokens, maxScore, currentScore = deque(tokens), 0, 0
while tokens and (P >= tokens[0] or currentScore):
while tokens and P >= tokens[0]:
P -= tokens.popleft()
currentScore += 1
maxScore = max(maxScore, currentScore)
if tokens and currentScore:
P += tokens.pop()
currentScore -= 1
return maxScore
|
#Done by Carlos Amaral on 12/06/2020
"""
Start with the list you used in Exercise 3-1, but instead of just
printing each person’s name, print a message to them. The text of each mes-
sage should be the same, but each message should be personalized with the
person’s name.
"""
friends = ['Rita', 'Catarina', 'Emilia', 'Patrícia']
message = "Hello, " + friends[0].title() + "!!!"
print(message)
message = "Hello, " +friends[1].title() + "!!!"
print(message)
message = "Hello, " + friends[2].title() + "!!!"
print(message)
message = "Hello, " + friends[3].title() + "!!!"
print (message)
|
#
# PySNMP MIB module CISCO-STACKWISE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-STACKWISE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:13:00 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
EntPhysicalIndexOrZero, = mibBuilder.importSymbols("CISCO-TC", "EntPhysicalIndexOrZero")
entPhysicalIndex, = mibBuilder.importSymbols("ENTITY-MIB", "entPhysicalIndex")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance")
NotificationType, Integer32, ObjectIdentity, TimeTicks, Counter32, MibIdentifier, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Bits, Counter64, ModuleIdentity, IpAddress, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Integer32", "ObjectIdentity", "TimeTicks", "Counter32", "MibIdentifier", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Bits", "Counter64", "ModuleIdentity", "IpAddress", "Unsigned32")
DisplayString, TextualConvention, TruthValue, MacAddress = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "TruthValue", "MacAddress")
ciscoStackWiseMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 500))
ciscoStackWiseMIB.setRevisions(('2016-04-16 00:00', '2015-11-24 00:00', '2011-12-12 00:00', '2010-02-01 00:00', '2008-06-10 00:00', '2005-10-12 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoStackWiseMIB.setRevisionsDescriptions(('Added following objects in cswGlobals - cswStackDomainNum - cswStackType - cswStackBandWidth Created following tables - cswDistrStackLinkInfoTable -cswDistrStackPhyPortInfoTable Added cswStatusGroupRev2 Deprecated cswStatusGroupRev1 Added cswDistrStackLinkStatusGroup Added cswDistrStackPhyPortStatusGroup Added cswStackWiseMIBComplianceRev4 MIB COMPLIANCE Deprecated cswStackWiseMIBComplianceRev3 MIB COMPLIANCE.', 'Added following Objects in cswSwitchInfoTable - cswSwitchPowerAllocated Added following OBJECT-GROUP - cswStackPowerAllocatedGroup Deprecated cswStackWiseMIBComplianceRev2 MODULE-COMPLIANCE. Added cswStackWiseMIBComplianceRev3 MODULE-COMPLIANCE.', "Modified 'cswSwitchRole' object.", 'Added cswStackPowerStatusGroup, cswStackPowerSwitchStatusGroup, cswStackPowerPortStatusGroup, cswStatusGroupRev1 and cswStackPowerNotificationGroup. Deprecated cswStackWiseMIBCompliance compliance statement. Added cswStackWiseMIBComplianceRev1 compliance statement. Deprecated cswStatusGroup because we deprecated cswEnableStackNotifications', "Modified 'cswSwitchState' object.", 'Initial version of this MIB module.',))
if mibBuilder.loadTexts: ciscoStackWiseMIB.setLastUpdated('201604160000Z')
if mibBuilder.loadTexts: ciscoStackWiseMIB.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts: ciscoStackWiseMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 Tel: +1 800 553-NETS E-mail: cs-dsbu@cisco.com')
if mibBuilder.loadTexts: ciscoStackWiseMIB.setDescription('This MIB module contain a collection of managed objects that apply to network devices supporting the Cisco StackWise(TM) technology. The StackWise technology provides a method for collectively utilizing a stack of switches to create a single switching unit. The data stack is used for switching data packets and, in power stack, switches are connected by special stack power cables to share power. Moreover, stackwise is the concept for combining multiple systems to give an impression of a single system so that is why both power stack and data stack are supported by single MIB. Terminology: Stack - A collection of switches connected by the Cisco StackWise technology. Master - The switch that is managing the stack. Member - A switch in the stack that is NOT the stack master. Ring - Components that makes up the connections between the switches in order to create a stack. Stackport - A special physical connector used by the ring. It is possible for a switch have more than one stackport. SDM - Switch Database Management. Stack Power - A collection of switches connected by special stack power cables to share the power of inter-connected power supplies across all switches requiring power. Stack Power is managed by a single data stack. Jack-Jack - It is a device that provides the Power Shelf capabilities required for Stack Power on the high-end. POE - Power Over Ethernet FEP - Front End Power Supply SOC - Sustained Overload Condition GLS - Graceful Load Shedding ILS - Immediate Load Shedding SRLS - System Ring Load Shedding SSLS - System Star Load Shedding')
class CswPowerStackMode(TextualConvention, Integer32):
description = 'This textual convention is used to describe the mode of the power stack. Since the power stack could only run in either power sharing or redundant mode so this TC will also have only following valid values, powerSharing(1) :When a power stack is running in power sharing mode then all the power supplies in the power stack contributes towards the global power budget of the stack. redundant(2) :If the user wants the power stack to run in redundant mode then we will take the capacity of the largest power supply in the power stack out of power stack global power budget pool. powerSharingStrict(3):This mode is same as power sharing mode but, in this mode, the available power will always be more than the used power. redundantStrict(4) :This mode is same as redundant mode but, in this mode, the available power will always be more than the used power.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))
namedValues = NamedValues(("powerSharing", 1), ("redundant", 2), ("powerSharingStrict", 3), ("redundantStrict", 4))
class CswPowerStackType(TextualConvention, Integer32):
description = 'This textual conventions is used to describe the type of the power stack. Since the power stack could only be configured in a ring or star topology so this TC will have only following valid values, ring(1): The power stack has been formed by connecting the switches in ring topology. star(2): The power stack has been formed by connecting the switches in star topology.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("ring", 1), ("star", 2))
ciscoStackWiseMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 500, 0))
ciscoStackWiseMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 500, 1))
ciscoStackWiseMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 500, 2))
cswGlobals = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 1))
cswStackInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2))
cswStackPowerInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3))
class CswSwitchNumber(TextualConvention, Unsigned32):
description = 'A unique value, greater than zero, for each switch in a group of stackable switches.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 4294967295)
class CswSwitchNumberOrZero(TextualConvention, Unsigned32):
description = 'A unique value, greater than or equal to zero, for each switch in a group of stackable switches. A value of zero means that the switch number can not be determined. The value of zero is not unique.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(0, 4294967295)
class CswSwitchPriority(TextualConvention, Unsigned32):
description = 'A value, greater than or equal to zero, that defines the priority of a switch in a group of stackable switches. The higher the value, the higher the priority.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(0, 4294967295)
cswMaxSwitchNum = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 1, 1), CswSwitchNumber()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswMaxSwitchNum.setStatus('current')
if mibBuilder.loadTexts: cswMaxSwitchNum.setDescription('The maximum number of switches that can be configured on this stack. This is also the maximum value that can be set by the cswSwitchNumNextReload object.')
cswMaxSwitchConfigPriority = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 1, 2), CswSwitchPriority()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswMaxSwitchConfigPriority.setStatus('current')
if mibBuilder.loadTexts: cswMaxSwitchConfigPriority.setDescription('The maximum configurable priority for a switch in this stack. Highest value equals highest priority. This is the highest value that can be set by the cswSwitchSwPriority object.')
cswRingRedundant = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 1, 3), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswRingRedundant.setStatus('current')
if mibBuilder.loadTexts: cswRingRedundant.setDescription("A value of 'true' is returned when the stackports are connected in such a way that it forms a redundant ring.")
cswStackPowerInfoTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 1), )
if mibBuilder.loadTexts: cswStackPowerInfoTable.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerInfoTable.setDescription('This table holds the information about all the power stacks in a single data stack.')
cswStackPowerInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 1, 1), ).setIndexNames((0, "CISCO-STACKWISE-MIB", "cswStackPowerStackNumber"))
if mibBuilder.loadTexts: cswStackPowerInfoEntry.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerInfoEntry.setDescription('An entry in the cswStackPowerInfoTable for each of the power stacks in a single data stack. This entry contains information regarding the power stack.')
cswStackPowerStackNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 1, 1, 1), Unsigned32())
if mibBuilder.loadTexts: cswStackPowerStackNumber.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerStackNumber.setDescription('A unique value, greater than zero, to identify a power stack.')
cswStackPowerMode = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 1, 1, 2), CswPowerStackMode()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cswStackPowerMode.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerMode.setDescription('This object specifies the information about the mode of the power stack. Power-sharing mode: All of the input power can be used for loads, and the total available power appears as one huge power supply. The power budget includes all power from all supplies. No power is set aside for power supply failures, so if a power supply fails, load shedding (shutting down of powered devices or switches) might occur. This is the default. Redundant mode: The largest power supply is removed from the power pool to be used as backup power in case one of the other power supplies fails. The available power budget is the total power minus the largest power supply. This reduces the available power in the pool for switches and powered devices to draw from, but in case of a failure or an extreme power load, there is less chance of having to shut down switches or powered devices. This is the recommended operating mode if your system has enough power. In addition, you can configure each mode to run a strict power budget or a non-strict (loose) power budget. If the mode is strict, the stack power needs cannot exceed the available power. When the power budgeted to devices reaches the maximum available PoE power, power is denied to the next device seeking power. In this mode the stack never goes into an over-budgeted power mode. When the mode is non-strict, budgeted power is allowed to exceed available power. This is normally not a problem because most devices do not run at full power and the chances of all powered devices in the stack requiring maximum power at the same time is small.')
cswStackPowerMasterMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 1, 1, 3), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackPowerMasterMacAddress.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerMasterMacAddress.setDescription('This object indicates the Mac address of the power stack master.')
cswStackPowerMasterSwitchNum = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 1, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackPowerMasterSwitchNum.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerMasterSwitchNum.setDescription('This object indicates the switch number of the power stack master. The value of this object would be zero if the power stack master is not part of this data stack.')
cswStackPowerNumMembers = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 1, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackPowerNumMembers.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerNumMembers.setDescription('This object indicates the number of members in the power stack.')
cswStackPowerType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 1, 1, 6), CswPowerStackType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackPowerType.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerType.setDescription('This object indicates the topology of the power stack, that is, whether the switch is running in RING or STAR topology.')
cswStackPowerName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 1, 1, 7), SnmpAdminString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cswStackPowerName.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerName.setDescription('This object specifies a unique name of this power stack. A zero-length string indicates no name is assigned.')
cswStackPowerPortInfoTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 2), )
if mibBuilder.loadTexts: cswStackPowerPortInfoTable.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortInfoTable.setDescription('This table contains information about the stack power ports. There exists an entry in this table for each physical stack power port.')
cswStackPowerPortInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 2, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"), (0, "CISCO-STACKWISE-MIB", "cswStackPowerPortIndex"))
if mibBuilder.loadTexts: cswStackPowerPortInfoEntry.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortInfoEntry.setDescription('A conceptual row in the cswStackPowerPortInfoTable. This entry contains information about a power stack port.')
cswStackPowerPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 2, 1, 1), Unsigned32())
if mibBuilder.loadTexts: cswStackPowerPortIndex.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortIndex.setDescription('A unique value, greater than zero, for each stack power port.')
cswStackPowerPortOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cswStackPowerPortOperStatus.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortOperStatus.setDescription('This object is used to either set or unset the operational status of the stack port. This object will have following valid values, enabled(1) : The port is enabled disabled(2) : The port is forced down')
cswStackPowerPortNeighborMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 2, 1, 3), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackPowerPortNeighborMacAddress.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortNeighborMacAddress.setDescription("This objects indicates the port neighbor's Mac Address.")
cswStackPowerPortNeighborSwitchNum = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 2, 1, 4), CswSwitchNumberOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackPowerPortNeighborSwitchNum.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortNeighborSwitchNum.setDescription("This objects indicates the port neighbor's switch number. If either there is no switch connected or the neighbor is not Jack-Jack then the value of this object is going to be 0.")
cswStackPowerPortLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackPowerPortLinkStatus.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortLinkStatus.setDescription('This object is used to describe the link status of the stack port. This object will have following valid values, up(1) : The port is connected and operational down(2): The port is either forced down or not connected')
cswStackPowerPortOverCurrentThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 2, 1, 6), Unsigned32()).setUnits('Amperes').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cswStackPowerPortOverCurrentThreshold.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortOverCurrentThreshold.setDescription('This object is used to retrieve the over current threshold. The stack power cables are limited to carry current up to the limit retrieved by this object. The stack power cables would not be able to function properly if either the input or output current goes beyond the threshold retrieved by this object.')
cswStackPowerPortName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 3, 2, 1, 7), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackPowerPortName.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortName.setDescription('This object specifies a unique name of the stack power port as shown on the face plate of the system. A zero-length string indicates no name is assigned.')
cswEnableStackNotifications = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 1, 4), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cswEnableStackNotifications.setStatus('deprecated')
if mibBuilder.loadTexts: cswEnableStackNotifications.setDescription("This object indicates whether the system generates the notifications defined in this MIB or not. A value of 'false' will prevent the notifications from being sent.")
cswEnableIndividualStackNotifications = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 1, 5), Bits().clone(namedValues=NamedValues(("stackPortChange", 0), ("stackNewMaster", 1), ("stackMismatch", 2), ("stackRingRedundant", 3), ("stackNewMember", 4), ("stackMemberRemoved", 5), ("stackPowerLinkStatusChanged", 6), ("stackPowerPortOperStatusChanged", 7), ("stackPowerVersionMismatch", 8), ("stackPowerInvalidTopology", 9), ("stackPowerBudgetWarning", 10), ("stackPowerInvalidInputCurrent", 11), ("stackPowerInvalidOutputCurrent", 12), ("stackPowerUnderBudget", 13), ("stackPowerUnbalancedPowerSupplies", 14), ("stackPowerInsufficientPower", 15), ("stackPowerPriorityConflict", 16), ("stackPowerUnderVoltage", 17), ("stackPowerGLS", 18), ("stackPowerILS", 19), ("stackPowerSRLS", 20), ("stackPowerSSLS", 21), ("stackMemberToBeReloadedForUpgrade", 22)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cswEnableIndividualStackNotifications.setStatus('current')
if mibBuilder.loadTexts: cswEnableIndividualStackNotifications.setDescription('This object is used to enable/disable individual notifications defined in this MIB module. Turning on a particular bit would enable the corresponding trap and, similarly, turning off a particular bit would disable the corresponding trap. The following notifications are controlled by this object: stackPortChange(0): enables/disables cswStackPortChange notification. stackNewMaster(1): enables/disables cswStackNewMember notification. stackMismatch(2): enables/disables cswStackMismatch notification. stackRingRedundant(3): enables/disables cswStackRingRedundant notification. stackNewMember(4): enables/disables cswStackNewMember notification. stackMemberRemoved(5): enables/disables cswStackMemberRemoved notification. stackPowerLinkStatusChanged(6): enables/disables cswStackPowerPortLinkStatusChanged notification. stackPowerPortOperStatusChanged(7): enables/disables cswStackPowerPortOperStatusChanged notification. stackPowerVersionMismatch(8): enables/disables cswStackPowerVersionMismatch notification. stackPowerInvalidTopology(9): enables/disables cswStackPowerInvalidTopology notification stackPowerBudgetWarning(10): enables/disables cswStackPowerBudgetWarning notification. stackPowerInvalidInputCurrent(11): enables/disables cswStackPowerInvalidInputCurrent notification. stackPowerInvalidOutputCurrent(12): enables/disables cswStackPowerInvalidOutputCurrent notification. stackPowerUnderBudget(13): enables/disables cswStackPowerUnderBudget notification. stackPowerUnbalancedPowerSupplies(14): enables/disables cswStackPowerUnbalancedPowerSupplies notification. stackPowerInsufficientPower(15): enables/disables cswStackPowerInsufficientPower notification. stackPowerPriorityConflict(16): enables/disables cswStackPowerPriorityConflict notification. stackPowerUnderVoltage(17): enables/disables cswStackPowerUnderVoltage notification. stackPowerGLS(18): enables/disables cswStackPowerGLS notification. stackPowerILS(19): enables/disabled cswStackPowerILS notification. stackPowerSRLS(20): enables/disables cswStackPowerSRLS notification. stackPowerSSLS(21): enables/disables cswStackPowerSSLS notification. stackMemberToBeReloadedForUpgrade(22): enables/disables cswStackMemberToBeReloadedForUpgrade notification.')
cswStackDomainNum = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackDomainNum.setStatus('current')
if mibBuilder.loadTexts: cswStackDomainNum.setDescription('This object indicates distributed domain of the switch.Only Switches with the same domain number can be in the same dist ributed domain.0 means no switch domain configured.')
cswStackType = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackType.setStatus('current')
if mibBuilder.loadTexts: cswStackType.setDescription('This object indicates type of switch stack. value of Switch virtual domain determines if switch is distributed or conventional stack. 0 means stack is conventional back side stack.')
cswStackBandWidth = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackBandWidth.setStatus('current')
if mibBuilder.loadTexts: cswStackBandWidth.setDescription('This object indicates stack bandwidth.')
cswSwitchInfoTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1), )
if mibBuilder.loadTexts: cswSwitchInfoTable.setStatus('current')
if mibBuilder.loadTexts: cswSwitchInfoTable.setDescription("This table contains information specific to switches in a stack. Every switch with an entry in the entPhysicalTable (ENTITY-MIB) whose entPhysicalClass is 'chassis' will have an entry in this table.")
cswSwitchInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"))
if mibBuilder.loadTexts: cswSwitchInfoEntry.setStatus('current')
if mibBuilder.loadTexts: cswSwitchInfoEntry.setDescription('A conceptual row in the cswSwitchInfoTable describing a switch information.')
cswSwitchNumCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 1), CswSwitchNumber()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswSwitchNumCurrent.setStatus('current')
if mibBuilder.loadTexts: cswSwitchNumCurrent.setDescription("This object contains the current switch identification number. This number should match any logical labeling on the switch. For example, a switch whose interfaces are labeled 'interface #3' this value should be 3.")
cswSwitchNumNextReload = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 2), CswSwitchNumberOrZero()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cswSwitchNumNextReload.setStatus('current')
if mibBuilder.loadTexts: cswSwitchNumNextReload.setDescription("This object contains the cswSwitchNumCurrent to be used at next reload. The maximum value for this object is defined by the cswMaxSwitchNum object. Note: This object will contain 0 and cannot be set if the cswSwitchState value is other than 'ready'.")
cswSwitchRole = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("master", 1), ("member", 2), ("notMember", 3), ("standby", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswSwitchRole.setStatus('current')
if mibBuilder.loadTexts: cswSwitchRole.setDescription('This object describes the function of the switch: master - stack master. member - active member of the stack. notMember - none-active stack member, see cswSwitchState for status. standby - stack standby switch.')
cswSwitchSwPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 4), CswSwitchPriority()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cswSwitchSwPriority.setStatus('current')
if mibBuilder.loadTexts: cswSwitchSwPriority.setDescription("A number containing the priority of a switch. The switch with the highest priority will become the master. The maximum value for this object is defined by the cswMaxSwitchConfigPriority object. If after a reload the value of cswMaxSwitchConfigPriority changes to a smaller value, and the value of cswSwitchSwPriority has been previously set to a value greater or equal to the new cswMaxSwitchConfigPriority, then the SNMP agent must set cswSwitchSwPriority to the new cswMaxSwitchConfigPriority. Note: This object will contain the value of 0 if the cswSwitchState value is other than 'ready'.")
cswSwitchHwPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 5), CswSwitchPriority()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswSwitchHwPriority.setStatus('current')
if mibBuilder.loadTexts: cswSwitchHwPriority.setDescription("This object contains the hardware priority of a switch. If two or more entries in this table have the same cswSwitchSwPriority value during the master election time, the switch with the highest cswSwitchHwPriority will become the master. Note: This object will contain the value of 0 if the cswSwitchState value is other than 'ready'.")
cswSwitchState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("waiting", 1), ("progressing", 2), ("added", 3), ("ready", 4), ("sdmMismatch", 5), ("verMismatch", 6), ("featureMismatch", 7), ("newMasterInit", 8), ("provisioned", 9), ("invalid", 10), ("removed", 11)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswSwitchState.setStatus('current')
if mibBuilder.loadTexts: cswSwitchState.setDescription("The current state of a switch: waiting - Waiting for a limited time on other switches in the stack to come online. progressing - Master election or mismatch checks in progress. added - The switch is added to the stack. ready - The switch is operational. sdmMismatch - The SDM template configured on the master is not supported by the new member. verMismatch - The operating system version running on the master is different from the operating system version running on this member. featureMismatch - Some of the features configured on the master are not supported on this member. newMasterInit - Waiting for the new master to finish initialization after master switchover (Master Re-Init). provisioned - The switch is not an active member of the stack. invalid - The switch's state machine is in an invalid state. removed - The switch is removed from the stack.")
cswSwitchMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 7), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswSwitchMacAddress.setStatus('current')
if mibBuilder.loadTexts: cswSwitchMacAddress.setDescription("The MAC address of the switch. Note: This object will contain the value of 0000:0000:0000 if the cswSwitchState value is other than 'ready'.")
cswSwitchSoftwareImage = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 8), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswSwitchSoftwareImage.setStatus('current')
if mibBuilder.loadTexts: cswSwitchSoftwareImage.setDescription("The software image type running on the switch. Note: This object will contain an empty string if the cswSwitchState value is other than 'ready'.")
cswSwitchPowerBudget = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 9), Unsigned32()).setUnits('Watts').setMaxAccess("readonly")
if mibBuilder.loadTexts: cswSwitchPowerBudget.setStatus('current')
if mibBuilder.loadTexts: cswSwitchPowerBudget.setDescription('This object indicates the power budget of the switch.')
cswSwitchPowerCommited = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 10), Unsigned32()).setUnits('Watts').setMaxAccess("readonly")
if mibBuilder.loadTexts: cswSwitchPowerCommited.setStatus('current')
if mibBuilder.loadTexts: cswSwitchPowerCommited.setDescription('This object indicates the power committed to the POE devices connected to the switch.')
cswSwitchSystemPowerPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 11), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cswSwitchSystemPowerPriority.setStatus('current')
if mibBuilder.loadTexts: cswSwitchSystemPowerPriority.setDescription("This specifies the system's power priority. In case of a power failure then the system with the highest system priority will be brought down last.")
cswSwitchPoeDevicesLowPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 12), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cswSwitchPoeDevicesLowPriority.setStatus('current')
if mibBuilder.loadTexts: cswSwitchPoeDevicesLowPriority.setDescription("This object specifies the priority of the system's low priority POE devices.")
cswSwitchPoeDevicesHighPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 13), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cswSwitchPoeDevicesHighPriority.setStatus('current')
if mibBuilder.loadTexts: cswSwitchPoeDevicesHighPriority.setDescription("This object specifies the priority of the system's high priority POE devices. In order to avoid losing the high priority POE devices before the low priority POE devices, this object's value must be greater than value of cswSwitchPoeDevicesLowPriority.")
cswSwitchPowerAllocated = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 1, 1, 14), Unsigned32()).setUnits('Watts').setMaxAccess("readonly")
if mibBuilder.loadTexts: cswSwitchPowerAllocated.setStatus('current')
if mibBuilder.loadTexts: cswSwitchPowerAllocated.setDescription('This object indicates the power committed to the POE devices connected to the switch.')
cswStackPortInfoTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 2), )
if mibBuilder.loadTexts: cswStackPortInfoTable.setStatus('current')
if mibBuilder.loadTexts: cswStackPortInfoTable.setDescription('This table contains stackport specific information. There exists an entry in this table for every physical stack port that have an entry in the ifTable (IF-MIB).')
cswStackPortInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: cswStackPortInfoEntry.setStatus('current')
if mibBuilder.loadTexts: cswStackPortInfoEntry.setDescription('A conceptual row in the cswStackPortInfoTable. An entry contains information about a stackport.')
cswStackPortOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("forcedDown", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackPortOperStatus.setStatus('current')
if mibBuilder.loadTexts: cswStackPortOperStatus.setDescription('The state of the stackport. up - Connected and operational. down - Not connected to a neighboring switch or administrative down. forcedDown - Shut down by stack manager due to mismatch or stackport errors.')
cswStackPortNeighbor = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 2, 1, 2), EntPhysicalIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswStackPortNeighbor.setStatus('current')
if mibBuilder.loadTexts: cswStackPortNeighbor.setDescription("This object contains the value of the entPhysicalIndex of the switch's chassis to which this stackport is connected to. If the stackport is not connected, the value 0 is returned.")
cswDistrStackLinkInfoTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 3), )
if mibBuilder.loadTexts: cswDistrStackLinkInfoTable.setStatus('current')
if mibBuilder.loadTexts: cswDistrStackLinkInfoTable.setDescription('Distributed Stack Link Information.')
cswDistrStackLinkInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 3, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"), (0, "CISCO-STACKWISE-MIB", "cswDSLindex"))
if mibBuilder.loadTexts: cswDistrStackLinkInfoEntry.setStatus('current')
if mibBuilder.loadTexts: cswDistrStackLinkInfoEntry.setDescription('An Entry containing information about DSL link.')
cswDSLindex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 3, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2)))
if mibBuilder.loadTexts: cswDSLindex.setStatus('current')
if mibBuilder.loadTexts: cswDSLindex.setDescription('This is index of the distributed stack link with respect to each interface port')
cswDistrStackLinkBundleOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswDistrStackLinkBundleOperStatus.setStatus('current')
if mibBuilder.loadTexts: cswDistrStackLinkBundleOperStatus.setDescription('The state of the stackLink. up - Connected and operational. down - Not connected or administrative down.')
cswDistrStackPhyPortInfoTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 4), )
if mibBuilder.loadTexts: cswDistrStackPhyPortInfoTable.setStatus('current')
if mibBuilder.loadTexts: cswDistrStackPhyPortInfoTable.setDescription('This table contains objects for Distributed stack Link information Table.')
cswDistrStackPhyPortInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 4, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"), (0, "CISCO-STACKWISE-MIB", "cswDSLindex"), (0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: cswDistrStackPhyPortInfoEntry.setStatus('current')
if mibBuilder.loadTexts: cswDistrStackPhyPortInfoEntry.setDescription('An Entry containing information about stack port that is part of Distributed Stack Link.')
cswDistrStackPhyPort = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 4, 1, 1), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswDistrStackPhyPort.setStatus('current')
if mibBuilder.loadTexts: cswDistrStackPhyPort.setDescription('This object indicates the name of distributed stack port.')
cswDistrStackPhyPortOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswDistrStackPhyPortOperStatus.setStatus('current')
if mibBuilder.loadTexts: cswDistrStackPhyPortOperStatus.setDescription('The state of the distributed stackport. up - Connected and operational. down - Not connected to a neighboring switch or administrative down.')
cswDistrStackPhyPortNbr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 4, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswDistrStackPhyPortNbr.setStatus('current')
if mibBuilder.loadTexts: cswDistrStackPhyPortNbr.setDescription("This object indicates the name of distributed stack port's neighbor.")
cswDistrStackPhyPortNbrsw = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 500, 1, 2, 4, 1, 4), EntPhysicalIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cswDistrStackPhyPortNbrsw.setStatus('current')
if mibBuilder.loadTexts: cswDistrStackPhyPortNbrsw.setDescription("This object indicates the EntPhysicalIndex of the distributed stack port's neigbor switch.")
cswMIBNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0))
cswStackPortChange = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 1)).setObjects(("IF-MIB", "ifIndex"), ("CISCO-STACKWISE-MIB", "cswStackPortOperStatus"), ("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackPortChange.setStatus('current')
if mibBuilder.loadTexts: cswStackPortChange.setDescription('This notification is generated when the state of a stack port has changed.')
cswStackNewMaster = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 2)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackNewMaster.setStatus('current')
if mibBuilder.loadTexts: cswStackNewMaster.setDescription('This notification is generated when a new master has been elected. The notification will contain the cswSwitchNumCurrent object to indicate the new master ID.')
cswStackMismatch = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 3)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchState"), ("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackMismatch.setStatus('current')
if mibBuilder.loadTexts: cswStackMismatch.setDescription('This notification is generated when a new member attempt to join the stack but was denied due to a mismatch. The cswSwitchState object will indicate the type of mismatch.')
cswStackRingRedundant = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 4)).setObjects(("CISCO-STACKWISE-MIB", "cswRingRedundant"))
if mibBuilder.loadTexts: cswStackRingRedundant.setStatus('current')
if mibBuilder.loadTexts: cswStackRingRedundant.setDescription('This notification is generated when the redundancy of the ring has changed.')
cswStackNewMember = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 5)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackNewMember.setStatus('current')
if mibBuilder.loadTexts: cswStackNewMember.setDescription('This notification is generated when a new member joins the stack.')
cswStackMemberRemoved = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 6)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackMemberRemoved.setStatus('current')
if mibBuilder.loadTexts: cswStackMemberRemoved.setDescription('This notification is generated when a member is removed from the stack.')
cswStackPowerPortLinkStatusChanged = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 7)).setObjects(("CISCO-STACKWISE-MIB", "cswStackPowerPortLinkStatus"), ("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortName"))
if mibBuilder.loadTexts: cswStackPowerPortLinkStatusChanged.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortLinkStatusChanged.setDescription('This notification is generated when the link status of a stack power port is changed from up to down or down to up. This notification is for informational purposes only and no action is required. cswStackPowerPortLinkStatus indicates link status of the stack power ports. cswSwitchNumCurrent indicates the switch number of the system. cswStackPowerPortName specifies a unique name of the stack power port as shown on the face plate of the system.')
cswStackPowerPortOperStatusChanged = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 8)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortOperStatus"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortName"))
if mibBuilder.loadTexts: cswStackPowerPortOperStatusChanged.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortOperStatusChanged.setDescription('This notification is generated when the operational status of a stack power port is changed from enabled to disabled or from disabled to enabled. This notification is for informational purposes only and no action is required. cswSwitchNumCurrent indicates the switch number of the system. cswStackPowerPortOperStatus indicates operational status of the stack power ports. cswStackPowerPortName specifies a unique name of the stack power port as shown on the face plate of the system.')
cswStackPowerVersionMismatch = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 9)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackPowerVersionMismatch.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerVersionMismatch.setDescription('This notification is generated when the major version of the stack power protocol is different from the other members of the power stack. Upon receiving this notification, the user should make sure that he/she is using the same software version on all the members of the same power stack. cswSwitchNumCurrent indicates the switch number of the system seeing the power stack version mismatch.')
cswStackPowerInvalidTopology = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 10)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackPowerInvalidTopology.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerInvalidTopology.setDescription('This notification is generated when an invalid stack power topology is discovered by a switch. cswSwitchNumCurrent indicates the switch number of the system where the invalid topology is discovered.')
cscwStackPowerBudgetWarrning = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 11)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cscwStackPowerBudgetWarrning.setStatus('current')
if mibBuilder.loadTexts: cscwStackPowerBudgetWarrning.setDescription('This notification is generated when the switch power budget is more than 1000W above its power supplies rated power output. cswSwitchNumCurrent indicates the switch number of the system where the invalid power budget has been detected.')
cswStackPowerInvalidInputCurrent = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 12)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortOverCurrentThreshold"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortName"))
if mibBuilder.loadTexts: cswStackPowerInvalidInputCurrent.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerInvalidInputCurrent.setDescription('This notification is generated when the input current in the stack power cable is over the limit of the threshold retrieved by the agent through cswStackPowerPortOverCurrentThreshold object. Upon receiving this notification, the user should add a power supply to the system whose switch number is generated with this notification. cswSwitchNumCurrent indicates the switch number of the system. cswStackPowerPortOverCurrentThreshold indicates the over current threshold of power stack cables. cswStackPowerPortName specifies a unique name of the stack power port as shown on the face plate of the system.')
cswStackPowerInvalidOutputCurrent = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 13)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortOverCurrentThreshold"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortName"))
if mibBuilder.loadTexts: cswStackPowerInvalidOutputCurrent.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerInvalidOutputCurrent.setDescription('This notification is generated when the output current in the stack power cable is over the limit of the threshold retrieved by the agent through cswStackPowerPortOverCurrentThreshold object. Upon receiving this notification, the user should remove a power supply from the system whose switch number is generated with this notification. cswSwitchNumCurrent indicates the switch number of the system. cswStackPowerPortOverCurrentThreshold indicates the over current threshold of power stack cables. cswStackPowerPortName specifies a unique name of the stack power port as shown on the face plate of the system.')
cswStackPowerUnderBudget = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 14)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackPowerUnderBudget.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerUnderBudget.setDescription("This notification is generated when the switch's budget is less than maximum possible switch power consumption. cswSwitchNumCurrent indicates the switch number of the system that is running with the power budget less than the power consumption.")
cswStackPowerUnbalancedPowerSupplies = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 15)).setObjects(("CISCO-STACKWISE-MIB", "cswStackPowerName"))
if mibBuilder.loadTexts: cswStackPowerUnbalancedPowerSupplies.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerUnbalancedPowerSupplies.setDescription('This notification is generated when the switch has no power supply but another switch in the same stack has more than one power supplies. cswStackPowerName specifies a unique name of the power stack where the unbalanced power supplies are detected.')
cswStackPowerInsufficientPower = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 16)).setObjects(("CISCO-STACKWISE-MIB", "cswStackPowerName"))
if mibBuilder.loadTexts: cswStackPowerInsufficientPower.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerInsufficientPower.setDescription("This notification is generated when the switch's power stack does not have enough power to bring up all the switches in the power stack. cswStackPowerName specifies a unique name of the power stack where insufficient power condition is detected.")
cswStackPowerPriorityConflict = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 17)).setObjects(("CISCO-STACKWISE-MIB", "cswStackPowerName"))
if mibBuilder.loadTexts: cswStackPowerPriorityConflict.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPriorityConflict.setDescription("This notification is generated when the switch's power priorities are conflicting with power priorities of another switch in the same power stack. cswStackPowerPortName specifies the unique name of the power stack where the conflicting power priorities are detected.")
cswStackPowerUnderVoltage = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 18)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackPowerUnderVoltage.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerUnderVoltage.setDescription('This notification is generated when the switch had an under voltage condition on last boot up. cswSwitchNumCurrent indicates the switch number of the system that was forced down with the under voltage condition.')
cswStackPowerGLS = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 19)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackPowerGLS.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerGLS.setDescription('This notification is generated when the switch had to shed loads based on a sustained over load (SOC) condition. cswSwitchNumCurrent indicates the switch number of the system that goes through graceful load shedding.')
cswStackPowerILS = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 20)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackPowerILS.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerILS.setDescription('This notification is generated when the switch had to shed loads based on power supply fail condition. cswSwitchNumCurrent indicates the switch number of the system that goes through immediate load shedding.')
cswStackPowerSRLS = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 21)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackPowerSRLS.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerSRLS.setDescription('This notification is generated when the switch had to shed loads based on loss of a system in ring topology. cswSwitchNumCurrent indicates the switch number of the system that detects the loss of system in ring topology.')
cswStackPowerSSLS = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 22)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackPowerSSLS.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerSSLS.setDescription('This notification is generated when the switch had to shed loads based on loss of a system in star topology. cswSwitchNumCurrent indicates the switch number of the system that detects the loss of system in star topology.')
cswStackMemberToBeReloadedForUpgrade = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 500, 0, 0, 23)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"))
if mibBuilder.loadTexts: cswStackMemberToBeReloadedForUpgrade.setStatus('current')
if mibBuilder.loadTexts: cswStackMemberToBeReloadedForUpgrade.setDescription('This notification is generated when a member is to be reloaded for upgrade.')
cswStackWiseMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 1))
cswStackWiseMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2))
cswStackWiseMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 1, 1)).setObjects(("CISCO-STACKWISE-MIB", "cswStatusGroup"), ("CISCO-STACKWISE-MIB", "cswNotificationGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStackWiseMIBCompliance = cswStackWiseMIBCompliance.setStatus('deprecated')
if mibBuilder.loadTexts: cswStackWiseMIBCompliance.setDescription('The compliance statement for entities that implement the CISCO-STACKWISE-MIB.')
cswStackWiseMIBComplianceRev1 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 1, 2)).setObjects(("CISCO-STACKWISE-MIB", "cswNotificationGroup"), ("CISCO-STACKWISE-MIB", "cswStatusGroupRev1"), ("CISCO-STACKWISE-MIB", "cswStackPowerEnableNotificationGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerSwitchStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerNotificationGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStackWiseMIBComplianceRev1 = cswStackWiseMIBComplianceRev1.setStatus('deprecated')
if mibBuilder.loadTexts: cswStackWiseMIBComplianceRev1.setDescription('The compliance statements for entities described in CISCO-STACKWISE-MIB. Stack Power entities are added in this revision.')
cswStackWiseMIBComplianceRev2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 1, 3)).setObjects(("CISCO-STACKWISE-MIB", "cswNotificationGroup"), ("CISCO-STACKWISE-MIB", "cswNotificationGroupSup1"), ("CISCO-STACKWISE-MIB", "cswStatusGroupRev1"), ("CISCO-STACKWISE-MIB", "cswStackPowerEnableNotificationGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerSwitchStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerNotificationGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStackWiseMIBComplianceRev2 = cswStackWiseMIBComplianceRev2.setStatus('deprecated')
if mibBuilder.loadTexts: cswStackWiseMIBComplianceRev2.setDescription('The compliance statements for entities described in CISCO-STACKWISE-MIB. Stack Power entities are added in this revision.')
cswStackWiseMIBComplianceRev3 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 1, 4)).setObjects(("CISCO-STACKWISE-MIB", "cswNotificationGroup"), ("CISCO-STACKWISE-MIB", "cswNotificationGroupSup1"), ("CISCO-STACKWISE-MIB", "cswStatusGroupRev1"), ("CISCO-STACKWISE-MIB", "cswStackPowerEnableNotificationGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerSwitchStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerNotificationGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerAllocatedGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStackWiseMIBComplianceRev3 = cswStackWiseMIBComplianceRev3.setStatus('deprecated')
if mibBuilder.loadTexts: cswStackWiseMIBComplianceRev3.setDescription('The compliance statements for entities described in CISCO-STACKWISE-MIB. Stack Power entities are added in this revision.')
cswStackWiseMIBComplianceRev4 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 1, 5)).setObjects(("CISCO-STACKWISE-MIB", "cswNotificationGroup"), ("CISCO-STACKWISE-MIB", "cswNotificationGroupSup1"), ("CISCO-STACKWISE-MIB", "cswStatusGroupRev2"), ("CISCO-STACKWISE-MIB", "cswStackPowerEnableNotificationGroup"), ("CISCO-STACKWISE-MIB", "cswDistrStackLinkStatusGroup"), ("CISCO-STACKWISE-MIB", "cswDistrStackPhyPortStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerSwitchStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortStatusGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerNotificationGroup"), ("CISCO-STACKWISE-MIB", "cswStackPowerAllocatedGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStackWiseMIBComplianceRev4 = cswStackWiseMIBComplianceRev4.setStatus('current')
if mibBuilder.loadTexts: cswStackWiseMIBComplianceRev4.setDescription('The compliance statements for entities described in CISCO-STACKWISE-MIB. Stack Global entities are added in this revision.')
cswStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 1)).setObjects(("CISCO-STACKWISE-MIB", "cswMaxSwitchNum"), ("CISCO-STACKWISE-MIB", "cswMaxSwitchConfigPriority"), ("CISCO-STACKWISE-MIB", "cswRingRedundant"), ("CISCO-STACKWISE-MIB", "cswEnableStackNotifications"), ("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"), ("CISCO-STACKWISE-MIB", "cswSwitchNumNextReload"), ("CISCO-STACKWISE-MIB", "cswSwitchRole"), ("CISCO-STACKWISE-MIB", "cswSwitchSwPriority"), ("CISCO-STACKWISE-MIB", "cswSwitchHwPriority"), ("CISCO-STACKWISE-MIB", "cswSwitchState"), ("CISCO-STACKWISE-MIB", "cswSwitchMacAddress"), ("CISCO-STACKWISE-MIB", "cswSwitchSoftwareImage"), ("CISCO-STACKWISE-MIB", "cswStackPortOperStatus"), ("CISCO-STACKWISE-MIB", "cswStackPortNeighbor"), ("CISCO-STACKWISE-MIB", "cswStackPowerType"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStatusGroup = cswStatusGroup.setStatus('deprecated')
if mibBuilder.loadTexts: cswStatusGroup.setDescription('A collection of objects that are used for control and status.')
cswNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 2)).setObjects(("CISCO-STACKWISE-MIB", "cswStackPortChange"), ("CISCO-STACKWISE-MIB", "cswStackNewMaster"), ("CISCO-STACKWISE-MIB", "cswStackMismatch"), ("CISCO-STACKWISE-MIB", "cswStackRingRedundant"), ("CISCO-STACKWISE-MIB", "cswStackNewMember"), ("CISCO-STACKWISE-MIB", "cswStackMemberRemoved"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswNotificationGroup = cswNotificationGroup.setStatus('current')
if mibBuilder.loadTexts: cswNotificationGroup.setDescription('A collection of notifications that are required.')
cswStatusGroupRev1 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 3)).setObjects(("CISCO-STACKWISE-MIB", "cswMaxSwitchNum"), ("CISCO-STACKWISE-MIB", "cswMaxSwitchConfigPriority"), ("CISCO-STACKWISE-MIB", "cswRingRedundant"), ("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"), ("CISCO-STACKWISE-MIB", "cswSwitchNumNextReload"), ("CISCO-STACKWISE-MIB", "cswSwitchRole"), ("CISCO-STACKWISE-MIB", "cswSwitchSwPriority"), ("CISCO-STACKWISE-MIB", "cswSwitchHwPriority"), ("CISCO-STACKWISE-MIB", "cswSwitchState"), ("CISCO-STACKWISE-MIB", "cswSwitchMacAddress"), ("CISCO-STACKWISE-MIB", "cswSwitchSoftwareImage"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStatusGroupRev1 = cswStatusGroupRev1.setStatus('current')
if mibBuilder.loadTexts: cswStatusGroupRev1.setDescription('A collection of objects that are used for control and status.')
cswStackPowerStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 4)).setObjects(("CISCO-STACKWISE-MIB", "cswStackPowerMode"), ("CISCO-STACKWISE-MIB", "cswStackPowerMasterMacAddress"), ("CISCO-STACKWISE-MIB", "cswStackPowerMasterSwitchNum"), ("CISCO-STACKWISE-MIB", "cswStackPowerNumMembers"), ("CISCO-STACKWISE-MIB", "cswStackPowerType"), ("CISCO-STACKWISE-MIB", "cswStackPowerName"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStackPowerStatusGroup = cswStackPowerStatusGroup.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerStatusGroup.setDescription('A collection of stack power objects that are used for control and status of power stack.')
cswStackPowerSwitchStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 5)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchPowerBudget"), ("CISCO-STACKWISE-MIB", "cswSwitchPowerCommited"), ("CISCO-STACKWISE-MIB", "cswSwitchSystemPowerPriority"), ("CISCO-STACKWISE-MIB", "cswSwitchPoeDevicesLowPriority"), ("CISCO-STACKWISE-MIB", "cswSwitchPoeDevicesHighPriority"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStackPowerSwitchStatusGroup = cswStackPowerSwitchStatusGroup.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerSwitchStatusGroup.setDescription('A collection of stack power objects that are used to track the stack power parameters of a switch.')
cswStackPowerPortStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 6)).setObjects(("CISCO-STACKWISE-MIB", "cswStackPowerPortOperStatus"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortNeighborMacAddress"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortNeighborSwitchNum"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortLinkStatus"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortOverCurrentThreshold"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortName"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStackPowerPortStatusGroup = cswStackPowerPortStatusGroup.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerPortStatusGroup.setDescription('A collection of objects that are used for control and status of stack power ports.')
cswStackPowerNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 7)).setObjects(("CISCO-STACKWISE-MIB", "cswStackPowerPortLinkStatusChanged"), ("CISCO-STACKWISE-MIB", "cswStackPowerPortOperStatusChanged"), ("CISCO-STACKWISE-MIB", "cswStackPowerVersionMismatch"), ("CISCO-STACKWISE-MIB", "cswStackPowerInvalidTopology"), ("CISCO-STACKWISE-MIB", "cscwStackPowerBudgetWarrning"), ("CISCO-STACKWISE-MIB", "cswStackPowerInvalidInputCurrent"), ("CISCO-STACKWISE-MIB", "cswStackPowerInvalidOutputCurrent"), ("CISCO-STACKWISE-MIB", "cswStackPowerUnderBudget"), ("CISCO-STACKWISE-MIB", "cswStackPowerUnbalancedPowerSupplies"), ("CISCO-STACKWISE-MIB", "cswStackPowerInsufficientPower"), ("CISCO-STACKWISE-MIB", "cswStackPowerPriorityConflict"), ("CISCO-STACKWISE-MIB", "cswStackPowerUnderVoltage"), ("CISCO-STACKWISE-MIB", "cswStackPowerGLS"), ("CISCO-STACKWISE-MIB", "cswStackPowerILS"), ("CISCO-STACKWISE-MIB", "cswStackPowerSRLS"), ("CISCO-STACKWISE-MIB", "cswStackPowerSSLS"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStackPowerNotificationGroup = cswStackPowerNotificationGroup.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerNotificationGroup.setDescription('A collection of notifications that are triggered whenever there is either a change in stack power object or an error is encountered.')
cswStackPowerEnableNotificationGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 8)).setObjects(("CISCO-STACKWISE-MIB", "cswEnableIndividualStackNotifications"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStackPowerEnableNotificationGroup = cswStackPowerEnableNotificationGroup.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerEnableNotificationGroup.setDescription('This group contains the notification enable objects for this MIB.')
cswNotificationGroupSup1 = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 9)).setObjects(("CISCO-STACKWISE-MIB", "cswStackMemberToBeReloadedForUpgrade"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswNotificationGroupSup1 = cswNotificationGroupSup1.setStatus('current')
if mibBuilder.loadTexts: cswNotificationGroupSup1.setDescription('Additional notification required for data stack.')
cswStackPowerAllocatedGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 10)).setObjects(("CISCO-STACKWISE-MIB", "cswSwitchPowerAllocated"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStackPowerAllocatedGroup = cswStackPowerAllocatedGroup.setStatus('current')
if mibBuilder.loadTexts: cswStackPowerAllocatedGroup.setDescription('A collection of objects providing the stack power allocation information of a switch.')
cswStatusGroupRev2 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 11)).setObjects(("CISCO-STACKWISE-MIB", "cswMaxSwitchNum"), ("CISCO-STACKWISE-MIB", "cswMaxSwitchConfigPriority"), ("CISCO-STACKWISE-MIB", "cswRingRedundant"), ("CISCO-STACKWISE-MIB", "cswSwitchNumCurrent"), ("CISCO-STACKWISE-MIB", "cswSwitchNumNextReload"), ("CISCO-STACKWISE-MIB", "cswSwitchRole"), ("CISCO-STACKWISE-MIB", "cswSwitchSwPriority"), ("CISCO-STACKWISE-MIB", "cswSwitchHwPriority"), ("CISCO-STACKWISE-MIB", "cswSwitchState"), ("CISCO-STACKWISE-MIB", "cswSwitchMacAddress"), ("CISCO-STACKWISE-MIB", "cswStackDomainNum"), ("CISCO-STACKWISE-MIB", "cswStackType"), ("CISCO-STACKWISE-MIB", "cswStackBandWidth"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswStatusGroupRev2 = cswStatusGroupRev2.setStatus('current')
if mibBuilder.loadTexts: cswStatusGroupRev2.setDescription('A collection of objects that are used for control and status.')
cswDistrStackLinkStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 12)).setObjects(("CISCO-STACKWISE-MIB", "cswDistrStackLinkBundleOperStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswDistrStackLinkStatusGroup = cswDistrStackLinkStatusGroup.setStatus('current')
if mibBuilder.loadTexts: cswDistrStackLinkStatusGroup.setDescription('A collection object(s) for control and status of the distributed Stack Link.')
cswDistrStackPhyPortStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 500, 2, 2, 13)).setObjects(("CISCO-STACKWISE-MIB", "cswDistrStackPhyPort"), ("CISCO-STACKWISE-MIB", "cswDistrStackPhyPortOperStatus"), ("CISCO-STACKWISE-MIB", "cswDistrStackPhyPortNbr"), ("CISCO-STACKWISE-MIB", "cswDistrStackPhyPortNbrsw"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cswDistrStackPhyPortStatusGroup = cswDistrStackPhyPortStatusGroup.setStatus('current')
if mibBuilder.loadTexts: cswDistrStackPhyPortStatusGroup.setDescription('A collection of objects for control and status of the distributed stack port')
mibBuilder.exportSymbols("CISCO-STACKWISE-MIB", cswDistrStackPhyPort=cswDistrStackPhyPort, cswDistrStackLinkInfoTable=cswDistrStackLinkInfoTable, cswStackPowerPortInfoTable=cswStackPowerPortInfoTable, cswStackInfo=cswStackInfo, cswStatusGroupRev1=cswStatusGroupRev1, cswSwitchMacAddress=cswSwitchMacAddress, cswStackPowerSwitchStatusGroup=cswStackPowerSwitchStatusGroup, cscwStackPowerBudgetWarrning=cscwStackPowerBudgetWarrning, cswStackPowerPortOverCurrentThreshold=cswStackPowerPortOverCurrentThreshold, cswSwitchPoeDevicesHighPriority=cswSwitchPoeDevicesHighPriority, cswDSLindex=cswDSLindex, cswStackPowerStackNumber=cswStackPowerStackNumber, cswStackPowerInfo=cswStackPowerInfo, cswStackNewMember=cswStackNewMember, cswStackPowerInvalidInputCurrent=cswStackPowerInvalidInputCurrent, cswStackPowerEnableNotificationGroup=cswStackPowerEnableNotificationGroup, cswStackPowerInfoTable=cswStackPowerInfoTable, cswStackPowerInfoEntry=cswStackPowerInfoEntry, cswRingRedundant=cswRingRedundant, cswStackPowerPortLinkStatus=cswStackPowerPortLinkStatus, cswStackDomainNum=cswStackDomainNum, cswStackPowerPortNeighborMacAddress=cswStackPowerPortNeighborMacAddress, cswStackWiseMIBComplianceRev1=cswStackWiseMIBComplianceRev1, cswMaxSwitchConfigPriority=cswMaxSwitchConfigPriority, CswSwitchPriority=CswSwitchPriority, cswStackWiseMIBComplianceRev2=cswStackWiseMIBComplianceRev2, cswStackNewMaster=cswStackNewMaster, cswStackPortChange=cswStackPortChange, cswSwitchState=cswSwitchState, cswStackPowerPriorityConflict=cswStackPowerPriorityConflict, cswStackPowerName=cswStackPowerName, cswDistrStackPhyPortStatusGroup=cswDistrStackPhyPortStatusGroup, cswStackPowerUnderVoltage=cswStackPowerUnderVoltage, cswStackPowerPortInfoEntry=cswStackPowerPortInfoEntry, cswStackMemberToBeReloadedForUpgrade=cswStackMemberToBeReloadedForUpgrade, CswPowerStackType=CswPowerStackType, cswStackPortInfoTable=cswStackPortInfoTable, cswStackPowerInvalidTopology=cswStackPowerInvalidTopology, cswStackPowerPortStatusGroup=cswStackPowerPortStatusGroup, cswSwitchPowerCommited=cswSwitchPowerCommited, cswStackBandWidth=cswStackBandWidth, cswStackPowerStatusGroup=cswStackPowerStatusGroup, cswStackPowerMasterMacAddress=cswStackPowerMasterMacAddress, ciscoStackWiseMIB=ciscoStackWiseMIB, cswDistrStackPhyPortOperStatus=cswDistrStackPhyPortOperStatus, cswEnableStackNotifications=cswEnableStackNotifications, ciscoStackWiseMIBConform=ciscoStackWiseMIBConform, cswSwitchPowerAllocated=cswSwitchPowerAllocated, cswStackPowerInsufficientPower=cswStackPowerInsufficientPower, cswStackPowerPortNeighborSwitchNum=cswStackPowerPortNeighborSwitchNum, cswStackPowerPortName=cswStackPowerPortName, cswSwitchInfoTable=cswSwitchInfoTable, cswSwitchPoeDevicesLowPriority=cswSwitchPoeDevicesLowPriority, cswStackWiseMIBCompliances=cswStackWiseMIBCompliances, cswStackPowerPortIndex=cswStackPowerPortIndex, cswSwitchSwPriority=cswSwitchSwPriority, cswSwitchSoftwareImage=cswSwitchSoftwareImage, cswStackWiseMIBComplianceRev3=cswStackWiseMIBComplianceRev3, cswStackMismatch=cswStackMismatch, cswStackPowerType=cswStackPowerType, cswSwitchPowerBudget=cswSwitchPowerBudget, cswDistrStackLinkStatusGroup=cswDistrStackLinkStatusGroup, cswStackPowerVersionMismatch=cswStackPowerVersionMismatch, cswStackPowerSRLS=cswStackPowerSRLS, PYSNMP_MODULE_ID=ciscoStackWiseMIB, cswStackPowerNotificationGroup=cswStackPowerNotificationGroup, cswStatusGroup=cswStatusGroup, cswDistrStackPhyPortNbrsw=cswDistrStackPhyPortNbrsw, cswNotificationGroup=cswNotificationGroup, cswStackPowerGLS=cswStackPowerGLS, cswStackMemberRemoved=cswStackMemberRemoved, cswDistrStackLinkInfoEntry=cswDistrStackLinkInfoEntry, cswSwitchHwPriority=cswSwitchHwPriority, cswStackWiseMIBComplianceRev4=cswStackWiseMIBComplianceRev4, cswStackPowerInvalidOutputCurrent=cswStackPowerInvalidOutputCurrent, cswStackPowerPortLinkStatusChanged=cswStackPowerPortLinkStatusChanged, cswStackPowerPortOperStatus=cswStackPowerPortOperStatus, cswStackPowerUnderBudget=cswStackPowerUnderBudget, cswStackWiseMIBGroups=cswStackWiseMIBGroups, cswStackRingRedundant=cswStackRingRedundant, cswStackType=cswStackType, cswStackPortInfoEntry=cswStackPortInfoEntry, cswStackPortOperStatus=cswStackPortOperStatus, cswStackPowerPortOperStatusChanged=cswStackPowerPortOperStatusChanged, cswStackPowerILS=cswStackPowerILS, cswStackPowerAllocatedGroup=cswStackPowerAllocatedGroup, cswEnableIndividualStackNotifications=cswEnableIndividualStackNotifications, cswDistrStackPhyPortNbr=cswDistrStackPhyPortNbr, cswStatusGroupRev2=cswStatusGroupRev2, CswSwitchNumber=CswSwitchNumber, cswNotificationGroupSup1=cswNotificationGroupSup1, cswMIBNotifications=cswMIBNotifications, cswStackPowerMasterSwitchNum=cswStackPowerMasterSwitchNum, cswGlobals=cswGlobals, cswMaxSwitchNum=cswMaxSwitchNum, CswSwitchNumberOrZero=CswSwitchNumberOrZero, cswStackPowerMode=cswStackPowerMode, ciscoStackWiseMIBNotifs=ciscoStackWiseMIBNotifs, cswStackPortNeighbor=cswStackPortNeighbor, cswDistrStackPhyPortInfoEntry=cswDistrStackPhyPortInfoEntry, cswStackWiseMIBCompliance=cswStackWiseMIBCompliance, cswDistrStackPhyPortInfoTable=cswDistrStackPhyPortInfoTable, CswPowerStackMode=CswPowerStackMode, cswStackPowerSSLS=cswStackPowerSSLS, cswSwitchSystemPowerPriority=cswSwitchSystemPowerPriority, cswSwitchNumCurrent=cswSwitchNumCurrent, ciscoStackWiseMIBObjects=ciscoStackWiseMIBObjects, cswStackPowerNumMembers=cswStackPowerNumMembers, cswSwitchRole=cswSwitchRole, cswDistrStackLinkBundleOperStatus=cswDistrStackLinkBundleOperStatus, cswSwitchNumNextReload=cswSwitchNumNextReload, cswStackPowerUnbalancedPowerSupplies=cswStackPowerUnbalancedPowerSupplies, cswSwitchInfoEntry=cswSwitchInfoEntry)
|
# _*_ coding: utf-8 _*_
#
# Package: src.core.repository.file
__all__ = [
"car_repository",
"customer_repository",
"employee_repository",
"file_db",
"file_repository",
"rental_repository"
]
|
# Write a function to find the longest common prefix string amongst an array of strings.
class Solution:
# @param {string[]} strs
# @return {string}
def longestCommonPrefix(self, strs):
if not strs:
return ""
lcp = ""
base = strs[0]
for i in range(len(base)):
for s in strs[1:]:
if i > len(s) - 1:
return lcp
if base[i] != s[i]:
return lcp
lcp += base[i]
return lcp
# lcp = ""
# for z in zip(*strs):
# bag = set(z);
# if len(bag) == 1:
# lcp += bag.pop()
# else:
# break
# return lcp
# 84 ms
# lcp = strs[0]
# for s in strs[1:]:
# i, j, local = 0, 0, ""
# while i < len(lcp) and j < len(s):
# if lcp[i] != s[j]:
# break
# local += lcp[j]
# i, j = i+1, j+1
# if not local:
# return ""
# lcp = local
# return lcp
|
#
# @lc app=leetcode id=32 lang=python3
#
# [32] Longest Valid Parentheses
#
# @lc code=start
class Solution:
def longestValidParentheses(self, s):
if not s:
return 0
l = 0
r = len(s)
while s[r - 1] == '(' and r > 0:
r -= 1
while s[l] == ')' and l < r - 2:
l += 1
s = s[l : r]
if len(s) < 2:
return 0
stack = [-1]
mx = 0
for i, p in enumerate(s):
if p == '(':
stack.append(i)
elif p == ')':
stack.pop()
if not stack:
stack.append(i)
else:
mx = max(mx, i - stack[-1])
return mx
# @lc code=end
|
'''
Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
For example,
Given [100, 4, 200, 1, 3, 2],
The longest consecutive elements sequence is [1, 2, 3, 4]. Return its length: 4.
Your algorithm should run in O(n) complexity.
'''
class Solution(object):
def longestConsecutive(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums: return 0
if len(nums) == 0: return 0
curLength = 1
maxLength = 1
records = {}
for i in range(len(nums)):
n = nums[i]
if n not in records:
records[n] = 1
else:
records[n] = records[n] + 1
pre = 0
for i, n in enumerate(sorted(records)):
if n == pre + 1 and i > 0:
curLength += 1
else:
curLength = 1
pre = n
maxLength = max(maxLength, curLength)
return maxLength
nums = [100, 4, 200, 1, 3, 2]
s = Solution()
print(s.longestConsecutive(nums))
|
#-*- coding:utf-8 -*-
#宏定义
#字体
FONT_COMMON = "Roboto"
FONT_HEI = "FontHei"
#界面
START_MENU = "startmenu"
PLAY_MENU = "playmenu"
|
"""
Given a binary tree, flatten it to a linked list in-place.
For example, given the following tree:
1
/ \
2 5
/ \ \
3 4 6
The flattened tree should look like:
1
\
2
\
3
\
4
\
5
\
6
Solution:
1. Recursion (in place)
Flatten the left subtree of root, then set it as the right child of root (need to store the previous right child of root).
Then set the previous right child of root as the right child of the rightmost node of the flattened left subtree.
Make left subtree of root to None
2. Preorder Traversal (Not in place)
"""
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# Recursion
class Solution:
def flatten(self, root: TreeNode) -> None:
"""
Do not return anything, modify root in-place instead.
"""
while root:
if root.left:
self.flatten(root.left)
left_tail = root.left
while left_tail.right:
left_tail = left_tail.right
right_head = root.right
root.right = root.left
root.left = None
left_tail.right = right_head
root = root.right
# Preorder Traversal
class Solution:
def flatten(self, root: TreeNode) -> None:
"""
Do not return anything, modify root in-place instead.
"""
if root == None:
return root
nodes = []
stack = []
dummy = root
# preorder
while stack or dummy:
while dummy != None:
stack.append(dummy)
nodes.append(dummy.val)
dummy = dummy.left
dummy = stack.pop()
dummy = dummy.right
root.left = None
cur = root
for i in range(1, len(nodes)):
node = TreeNode(nodes[i])
cur.right = node
cur = cur.right
|
"""
A module storing strings used to display messages.
"""
INVALID_INTERNAL_RESAMPLING_OPTIMAL = "Invalid CAT12 configuration! Resampling type 'optimal' can only be set with an internal resampling value of 1. Valid configuration coerced."
INVALID_INTERNAL_RESAMPLING_FIXED = "Invalid CAT12 configuration! Resampling type 'fixed' can only be set with an internal resampling value of 1.0 or 0.8. Configuration coerced to 1.0."
INVALID_INTERNAL_RESAMPLING_BEST = "Invalid CAT12 configuration! Resampling type 'best' can only be set with an internal resampling value of 0.5. Valid configuration coerced."
INVALID_RESAMPLING_TYPE = "Invalid CAT12 configuration (resampling_type={resampling_type})! Valid resampling type values are: 'optimal', 'fixed', or 'best'."
|
command = input()
compare_string_lower = {"coding", "dog", "cat", "movie"}
compare_string_upper = {"CODING", "DOG", "CAT", "MOVIE"}
coffee = 0
get_sleep = False
while not command == "END":
if command.isupper() and command in compare_string_upper:
coffee += 2
if command.islower() and command in compare_string_lower:
coffee += 1
if coffee > 5:
get_sleep = True
print()
print("You need extra sleep")
break
command = input()
if not get_sleep:
print(f"{coffee}")
# dog
# CAT
# gaming
# END
# movie
# CODING
# MOVIE
# CLEANING
# cat
# END
|
"""Various useful string conversions utilities for XRPL."""
def str_to_hex(input: str) -> str:
"""
Convert a UTF-8-encoded string into hexadecimal encoding.
XRPL uses hex strings as inputs in fields like `domain`
in the `AccountSet` transaction.
Args:
input: UTF-8-encoded string to convert
Returns:
Input encoded as a hex string.
"""
return input.encode("utf-8").hex()
def hex_to_str(input: str) -> str:
"""
Convert a hex string into a human-readable string.
XRPL uses hex strings as inputs in fields like `domain`
in the `AccountSet` transaction.
Args:
input: hex-encoded string to convert
Returns:
Input encoded as a human-readable string.
"""
return bytes.fromhex(input).decode()
|
print('nice' in 'nice to meet you')
a=1000000
b=1000000
c=a+b
print(c)
|
a = 1
b = 1
while 32 >= a:
print(a,-b)
b *= 2
a += 1
print("Year",b/365)
|
# Please contact the author(s) of this library if you have any questions.
# Authors: Kai-Chieh Hsu ( kaichieh@princeton.edu )
class _scheduler(object):
def __init__(self, last_epoch=-1, verbose=False):
self.cnt = last_epoch
self.verbose = verbose
self.variable = None
self.step()
def step(self):
self.cnt += 1
value = self.get_value()
self.variable = value
def get_value(self):
raise NotImplementedError
def get_variable(self):
return self.variable
class StepLR(_scheduler):
def __init__(self,
initValue,
period,
decay=0.1,
endValue=None,
last_epoch=-1,
threshold=0,
verbose=False):
self.initValue = initValue
self.period = period
self.decay = decay
self.endValue = endValue
self.threshold = threshold
super(StepLR, self).__init__(last_epoch, verbose)
def get_value(self):
cnt = self.cnt - self.threshold
if cnt < 0:
return self.initValue
numDecay = int(cnt / self.period)
tmpValue = self.initValue * (self.decay**numDecay)
if self.endValue is not None and tmpValue <= self.endValue:
return self.endValue
return tmpValue
class StepLRMargin(_scheduler):
def __init__(self,
initValue,
period,
goalValue,
decay=0.1,
endValue=None,
last_epoch=-1,
threshold=0,
verbose=False):
self.initValue = initValue
self.period = period
self.decay = decay
self.endValue = endValue
self.goalValue = goalValue
self.threshold = threshold
super(StepLRMargin, self).__init__(last_epoch, verbose)
def get_value(self):
cnt = self.cnt - self.threshold
if cnt < 0:
return self.initValue
numDecay = int(cnt / self.period)
tmpValue = self.goalValue - (self.goalValue -
self.initValue) * (self.decay**numDecay)
if self.endValue is not None and tmpValue >= self.endValue:
return self.endValue
return tmpValue
class StepLRFixed(_scheduler):
def __init__(self,
initValue,
period,
endValue,
stepSize=0.1,
last_epoch=-1,
verbose=False):
self.initValue = initValue
self.period = period
self.stepSize = stepSize
self.endValue = endValue
super(StepLRFixed, self).__init__(last_epoch, verbose)
def get_value(self):
if self.cnt == 0:
return self.initValue
elif self.cnt > self.period:
self.cnt = 0
if self.stepSize > 0:
self.variable = min(self.endValue,
self.variable + self.stepSize)
else:
self.variable = max(self.endValue,
self.variable + self.stepSize)
return self.variable
class StepResetLR(_scheduler):
def __init__(self,
initValue,
period,
resetPeriod,
decay=0.1,
endValue=None,
last_epoch=-1,
verbose=False):
self.initValue = initValue
self.period = period
self.decay = decay
self.endValue = endValue
self.resetPeriod = resetPeriod
super(StepResetLR, self).__init__(last_epoch, verbose)
def get_value(self):
if self.cnt == -1:
return self.initValue
numDecay = int(self.cnt / self.period)
tmpValue = self.initValue * (self.decay**numDecay)
if self.endValue is not None and tmpValue <= self.endValue:
return self.endValue
return tmpValue
def step(self):
self.cnt += 1
value = self.get_value()
self.variable = value
if (self.cnt + 1) % self.resetPeriod == 0:
self.cnt = -1
|
#!/usr/bin/env python3
inp = []
with open('03.txt') as fp:
for line in fp:
inp.append(line.strip())
def part1(arr):
acc = [0] * len(arr[0])
for x in arr:
for i in range(len(x)):
acc[i] += int(x[i])
gamma = list(map(lambda x: '1' if x >= len(arr)/2.0 else '0', acc))
epsilon = list(map(lambda x: '1' if x == '0' else '0', gamma))
return ''.join(gamma), ''.join(epsilon)
def part2(arr):
return oxygen(arr) * co2(arr)
def oxygen(arr):
num_len = len(arr[0])
for i in range(num_len):
gamma, epsilon = part1(arr)
arr = filter(lambda x: x[i] == gamma[i], arr)
if (len(arr) == 1): break
retval = int(arr[0], 2)
return retval
def co2(arr):
num_len = len(arr[0])
for i in range(num_len):
gamma, epsilon = part1(arr)
arr = filter(lambda x: x[i] == epsilon[i], arr)
if (len(arr) == 1): break
retval = int(arr[0], 2)
return retval
gamma, epsilon = part1(inp)
print(int(gamma, 2) * int(epsilon, 2))
print(part2(inp))
|
# ac
N = int(input())
A = list(map(int,input().split()))
mid = int(2**N/2)
left, right = A[:mid], A[mid:]
second = min(max(left), max(right))
print(A.index(second)+1)
|
"""Exceptions for Unmanic."""
class UnmanicError(Exception):
"""Generic Unmanic Exception."""
pass
class UnmanicBadRequestRequestedEndpointNotFoundError(UnmanicError):
"""Unmanic bad request endpoint not found exception."""
pass
class UnmanicBadRequestRequestedMethodNotAllowedError(UnmanicError):
"""Unmanic bad request method not allowed exception."""
pass
class UnmanicBadRequestValidationError(UnmanicError):
"""Unmanic bad request validation error exception."""
pass
class UnmanicConnectionError(UnmanicError):
"""Unmanic connection exception."""
pass
class UnmanicInternalServerError(UnmanicError):
"""Unmanic internal server error exception."""
pass
|
# eln:decorators
READERS = dict()
# Decorator for adding reader functions
def register_reader(function):
READERS[function.__name__] = function
return function
|
# -*- coding: utf-8 -*-
'''
File name: code\permuted_matrices\sol_559.py
Author: Vaidic Joshi
Date created: Oct 20, 2018
Python Version: 3.x
'''
# Solution to Project Euler Problem #559 :: Permuted Matrices
#
# For more information see:
# https://projecteuler.net/problem=559
# Problem Statement
'''
An ascent of a column j in a matrix occurs if the value of column j is smaller than the value of column j+1 in all rows.
Let P(k, r, n) be the number of r x n matrices with the following properties:
The rows are permutations of {1, 2, 3, ... , n}.
Numbering the first column as 1, a column ascent occurs at column j<n if and only if j is not a multiple of k.
For example, P(1, 2, 3) = 19, P(2, 4, 6) = 65508751 and P(7, 5, 30) mod 1000000123 = 161858102.
Let Q(n) =$\, \displaystyle \sum_{k=1}^n\,$ P(k, n, n).
For example, Q(5) = 21879393751 and Q(50) mod 1000000123 = 819573537.
Find Q(50000) mod 1000000123.
'''
# Solution
# Solution Approach
'''
'''
|
soma = 0
valor = 0
cont = -1
while valor != 999:
soma += valor
cont += 1
valor = int(input('Digite o valor: [999 para parar] '))
print('A soma de {} termos é igual a {}'.format(cont,soma))
|
# oci-utils
#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown
# at http://oss.oracle.com/licenses/upl.
""" Module with oci migrate related exceptions.
"""
class OciMigrateException(Exception):
""" Exceptions for the Image Migrate to OCI context.
"""
__args = None
def __init__(self, message=None):
"""
Initialisation of the Oci Migrate Exception.
Parameters
----------
message: str
The exception message.
"""
self._message = message
assert (self._message is not None), 'No exception message given'
if self._message is None:
self._message = 'An exception occurred, no further information'
def __str__(self):
"""
Get this OciMigrateException representation.
Returns
-------
str
The error message.
"""
return str(self._message)
|
def assert_valid_git_hub_url(edit_on_github_url: str, page_path: str):
# Do you like to include yet another organization? Thing twice :)
url_lower = edit_on_github_url.lower()
assert \
url_lower.startswith('https://github.com/JetBrains/'.lower()) \
or \
url_lower.startswith('https://github.com/kotlin/'.lower()), \
'Check `edit_on_github_url` for `' + page_path + "` to be either `JetBrains` or `kotlin` "
|
class RigPacket:
def __init__(self, velocity=0, direction=0):
self.velocity = velocity
self.direction = direction
|
"""
This package represents Presentation layer.
Put your views for different API.
Your views should use services from Application layer,
without implementing logic and only preparing given
data from request for services and formatting it for
response.
All of sub-packages should use the same services
interfaces, differentiating only be data presentation.
Remember: your Presentation layer is Adapter
of Request for Services and of Services for Response.
"""
|
"""
A direct child HAS TO define required class variables (pseudo "abstract").
"""
class ClassWithAbstractVariables(object):
@classmethod
def __init_subclass__(cls):
required_class_variables = [
'abstract_class_variables_0',
'abstract_class_variables_1',
'abstract_class_variables_2',
]
for var in required_class_variables:
if not hasattr(cls, var):
raise NotImplementedError(
f'Class {cls} lacks required `{var}` class attribute'
)
class MainClassSuccess(ClassWithAbstractVariables):
abstract_class_variables_0 = None
abstract_class_variables_1 = None
abstract_class_variables_2 = None
pass
class MainClassFail(ClassWithAbstractVariables):
"""
Class <class '__main__.MainClassFail0'> lacks required `abstract_class_variables_0` class attribute
Class <class '__main__.MainClassFail0'> lacks required `abstract_class_variables_1` class attribute
Class <class '__main__.MainClassFail0'> lacks required `abstract_class_variables_2` class attribute
"""
pass
if __name__ == '__main__':
pass
|
#!/usr/bin/env python
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_float.tif test_varying_index_float")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_int.tif test_varying_index_int")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_string.tif test_varying_index_string")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_matrix.tif test_varying_index_matrix")
outputs.append ("out_varying_index_float.tif")
outputs.append ("out_varying_index_int.tif")
outputs.append ("out_varying_index_string.tif")
outputs.append ("out_varying_index_matrix.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_color.tif test_varying_index_color")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_point.tif test_varying_index_point")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_vector.tif test_varying_index_vector")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_normal.tif test_varying_index_normal")
outputs.append ("out_varying_index_color.tif")
outputs.append ("out_varying_index_point.tif")
outputs.append ("out_varying_index_vector.tif")
outputs.append ("out_varying_index_normal.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_out_of_bounds_index_int.tif test_varying_out_of_bounds_index_int")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_out_of_bounds_index_float.tif test_varying_out_of_bounds_index_float")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_out_of_bounds_index_string.tif test_varying_out_of_bounds_index_string")
outputs.append ("out_varying_out_of_bounds_index_int.tif")
outputs.append ("out_varying_out_of_bounds_index_float.tif")
outputs.append ("out_varying_out_of_bounds_index_string.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_ray.tif test_varying_index_ray")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_cube.tif test_varying_index_cube")
outputs.append ("out_varying_index_ray.tif")
outputs.append ("out_varying_index_cube.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_float.tif test_varying_index_varying_float")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_int.tif test_varying_index_varying_int")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_point.tif test_varying_index_varying_point")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_normal.tif test_varying_index_varying_normal")
outputs.append ("out_varying_index_varying_float.tif")
outputs.append ("out_varying_index_varying_int.tif")
outputs.append ("out_varying_index_varying_point.tif")
outputs.append ("out_varying_index_varying_normal.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_vector.tif test_varying_index_varying_vector")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_color.tif test_varying_index_varying_color")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_string.tif test_varying_index_varying_string")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_matrix.tif test_varying_index_varying_matrix")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_varying_index_varying_ray.tif test_varying_index_varying_ray")
outputs.append ("out_varying_index_varying_vector.tif")
outputs.append ("out_varying_index_varying_color.tif")
outputs.append ("out_varying_index_varying_string.tif")
outputs.append ("out_varying_index_varying_matrix.tif")
outputs.append ("out_varying_index_varying_ray.tif")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_float.tif test_uniform_index_varying_float")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_int.tif test_uniform_index_varying_int")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_point.tif test_uniform_index_varying_point")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_normal.tif test_uniform_index_varying_normal")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_vector.tif test_uniform_index_varying_vector")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_color.tif test_uniform_index_varying_color")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_string.tif test_uniform_index_varying_string")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_matrix.tif test_uniform_index_varying_matrix")
command += testshade("-t 1 -g 256 256 -od uint8 -o Cout out_uniform_index_varying_ray.tif test_uniform_index_varying_ray")
outputs.append ("out_uniform_index_varying_float.tif")
outputs.append ("out_uniform_index_varying_int.tif")
outputs.append ("out_uniform_index_varying_point.tif")
outputs.append ("out_uniform_index_varying_normal.tif")
outputs.append ("out_uniform_index_varying_vector.tif")
outputs.append ("out_uniform_index_varying_color.tif")
outputs.append ("out_uniform_index_varying_string.tif")
outputs.append ("out_uniform_index_varying_matrix.tif")
outputs.append ("out_uniform_index_varying_ray.tif")
# expect a few LSB failures
failthresh = 0.008
failpercent = 3
|
def fibonacci_element(n, computed = {0: 0, 1: 1}):
""" calculate N'th Fibonacci number. """
if n not in computed:
computed[n] = fibonacci_element(n-1, computed) + fibonacci_element(n-2, computed)
return computed[n]
def sequence_calc(nterms = 1):
""" Calculate Fibonacci sequence from start """
sequence = []
for i in range(nterms):
next_fibonacci_value = fibonacci_element(i)
sequence.append(next_fibonacci_value)
return sequence
def check_number(input_int):
"""
Identify whether a number is part of the fibonacci sequence or not.
we calculate fibinacci from 0 to equil or first number bigger than input number.
If we pass the input number, then we just return False.
return: Identify result and Index number (start from 1)
"""
sequence_index = 0
fibonacci_number = 0
while fibonacci_number <= input_int:
if fibonacci_number == input_int:
secuence_location = sequence_index + 1 # location is started form 1, instead 0 in lists/arrays key.
return [True, secuence_location]
sequence_index += 1
fibonacci_number = fibonacci_element(sequence_index)
return [False, False]
|
#--- Exercício 3 - Foreach
#--- Escreva programa que leia as notas (4) de 10 alunos
#--- Armazene as notas e os nomes em listas
#--- Imprima:
# 1- O nome dos alunos
# 2- Média do aluno
# 3- Resuldo (Aprovado>=7.0)
notas =[]
nomes = []
media = 0
a = 0
b = 1
c = 2
d = 3
for d in range(1,11):
aluno = [input(f'Informe o {d} Nome')]
nomes.append(aluno)
for i in range(1,5):
nota = [float(input(f'Informe a {i} Nota'))]
notas.append(nota)
for alunos in nomes:
media = (notas[a]+notas[b]+notas[c]+notas[d])/4
print(f'\nNome: {alunos}')
print(f'Média: {media}')
if media >= 7:
print('Aprovado!')
else:
print('Reprovado!')
a = a+4
b = b+4
c = c+4
d = d+4
|
def task1(s):
"""
Function which receives a sequence of comma-separated numbers and generate a list and a tuple which contains
every number
Input: string with comma separated numbers
Output: list and tuple with all the numbers
"""
pass
def task2():
"""
Function which receives a sequence of comma-separated numbers and generate a result of their addition and
multiplication
Input: string with comma separated numbers
Output: two integers
"""
pass
def task3():
"""
Function which receives a sequence of comma-separated numbers from console and generate a result of their
addition and multiplication
Input: None
Output: two integers
"""
pass
def task4():
"""
Function which will print and find all such numbers which are divisible by 7 but are not a multiple of 5,
between from 0 to N (argument), both included.
Input: Integer N>0
Output: List of all the integers
"""
pass
def task5():
"""
Function which will check if argument is integer, if yes print and find all such numbers which are divisible by 7
but are not a multiple of 5, between from 0 to N (argument), both included. If not it will print error ant return
empty list.
Input: Integer N>0
Output: List of all the integers
"""
pass
def task6():
"""
Function which will check if arguments are integer, if yes print and find all such numbers which are divisible by
7 but are not a multiple of 5, between from N to M (arguments), both included. If not it will print error ant
return empty list.
Input: Integer M>N>0
Output: List of all the integers
"""
pass
def task7(N):
"""
Function which will calculate factorial of a given numbers (N!)
Input: Integer N>0
Output: N!
"""
pass
def task8():
"""
Function which will calculate factorial of a given numbers (N!)
Output should be string in "aa" notation (e.g. 10.000.000), created by yourself without any string functions.
Input: Integer N>0
Output: N! in aa notation
"""
pass
def task9():
"""
Function which will calculate factorial of a given numbers (N!)
Output should be rounded to milion in milions printed (e.g. "12 milions")
Input: Integer N>0
Output: N! in milions
"""
pass
def task10():
"""
Function which generates a dictionary that contains (i, i*i) such that i is an integral number between 1 and n (
both included) e.g. {1: 1, 2: 4, 3: 9, .... } and print it - in every line there must by key and value.
Input: Integer N>0
Output: Dictionary
"""
pass
def task11():
"""
Function that print and puts into list all sentences where subject is in list_1 and verb is in list_2 and the object is in list_3
Input: three lists (e.g. ["I", "You"], ["like", "dislike"], ["Basketball", "Football", "Volleyball"])
Output: list of sentences
"""
def task12(n: int) -> int:
"""
Create function that returns n-th element of fibonacci chain
Input: Single i nteger
Output: Integer
"""
pass
def task13():
"""
Function that find all such numbers between N and M (both included) such that each digit of the number is
an even number.
Input: Two integers
Output: List of numbers
"""
pass
def task14(a, b):
"""
Function that takes 2 numbers, I,J as input and generates a 2-dimensional array. The element value in the i-th
row and j-th column of the array should be i*j
Input: string
Output: string
"""
pass
if __name__ == '__main__':
num = 29
result = task12(num)
#print(result)
a, b = 7, 8
task14(a, b)
|
NL_MATERIAL = {
"math": {
"title": "Didactiek van wiskundig denken",
"text": "Leermateriaal over wiskunde en didactiek op de universiteit.",
"url": "https://maken.wikiwijs.nl/91192/Wiskundedidactiek_en_ICT",
"files": [
[{
"mime_type": "application/x-zip",
"url": "https://maken.wikiwijs.nl/91192/Wiskundedidactiek_en_ICT",
"title": "Wiskundedidactiek_en_ICT"
}]
],
"description":
"Materiaal voor lerarenopleidingen en professionaliseringstrajecten gericht op wiskundedidactiek en ICT "
"met Theo van den Bogaart",
"language": "nl",
"title_plain": "Wiskunde en Didactiek",
"text_plain": "Leermateriaal over wiskunde en didactiek op de universiteit.",
"external_id": "3522b79c-928c-4249-a7f7-d2bcb3077f10",
"copyright": "cc-by-30",
"lom_educational_levels": ["HBO"],
"publisher_date": "2017-04-16T22:35:09+02:00",
"keywords": ["nerds"],
"authors": [{"name": "Michel van Ast"}, {"name": "Theo van den Bogaart"}, {"name": "Marc de Graaf"}],
"publishers": ["Wikiwijs Maken"],
"disciplines": ["7afbb7a6-c29b-425c-9c59-6f79c845f5f0"],
"harvest_source": "wikiwijsmaken",
"has_parts": [],
"is_part_of": [],
"suggest_phrase": "Leermateriaal over wiskunde en didactiek op de universiteit.",
"suggest_completion": ["Leermateriaal", "over", "wiskunde", "en", "didactiek", "op", "de", "universiteit."],
"analysis_allowed": True,
"ideas": [],
"doi": None,
"technical_type": "document"
},
"biology": {
"title": "Didactiek van biologisch denken",
"text": "Leermateriaal over biologie en didactiek op de universiteit.",
"url": "https://maken.wikiwijs.nl/91192/Biologiedidactiek_en_ICT",
"files": [
[{
"mime_type": "application/x-zip",
"url": "https://maken.wikiwijs.nl/91192/Biologiedidactiek_en_ICT",
"title": "Biologiedidactiek_en_ICT"
}]
],
"description":
"Materiaal voor lerarenopleidingen en professionaliseringstrajecten gericht op biologiedidactiek en ICT "
"met Theo van den Bogaart",
"language": "nl",
"title_plain": "Biologie en Didactiek",
"text_plain": "Leermateriaal over biologie en didactiek op de universiteit.",
"external_id": "wikiwijs:123",
"copyright": "cc-by-30",
"lom_educational_levels": ["HBO"],
"publisher_date": "2017-04-16T22:35:09+02:00",
"keywords": [],
"authors": [{"name": "Michel van Ast"}],
"publishers": ["Wikiwijs Maken"],
"disciplines": [],
"harvest_source": "wikiwijsmaken",
"has_parts": [],
"is_part_of": [],
"suggest_phrase": "Leermateriaal over biologie en didactiek op de universiteit.",
"suggest_completion": ["Leermateriaal", "over", "biologie", "en", "didactiek", "op", "de", "universiteit."],
"analysis_allowed": True,
"ideas": [],
"doi": None,
"technical_type": "document"
}
}
def generate_nl_material(educational_levels=None, title=None, description=None, technical_type=None, source=None,
copyright=None, publisher_date=None, disciplines=None, topic="math", external_id=None):
copy = NL_MATERIAL[topic].copy()
if title:
copy["title"] = title
if description:
copy["description"] = description
if external_id:
copy["external_id"] = external_id
if educational_levels:
copy["lom_educational_levels"] = educational_levels
if technical_type:
copy["technical_type"] = technical_type
if source:
copy["harvest_source"] = source
if copyright:
copy["copyright"] = copyright
if publisher_date:
copy["publisher_date"] = publisher_date
if disciplines:
copy["disciplines"] = disciplines
return copy
|
# Suppose the cover price of a book is $24.95, but bookstores get a 40% discount.
# Shipping costs $3 for the first copy and 75 cents for each additional copy.
# What is the total wholesale cost for 60 copies?
print(round((24.95 - (24.95 * (40 / 100))) * 60 + 3 + 0.75 * 59, 2))
|
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Syntax
def test_functions_get_operation_output_syntax_empty(parser):
parser.parse_literal("""
tosca_definitions_version: tosca_simple_yaml_1_0
node_types:
MyType:
properties:
my_parameter:
type: string
topology_template:
node_templates:
my_node:
type: MyType
properties:
my_parameter: { get_operation_output: [] } # needs at least two args
""").assert_failure()
# Arguments
def test_functions_get_operation_output(parser):
parser.parse_literal("""
tosca_definitions_version: tosca_simple_yaml_1_0
interface_types:
MyType:
my_operation: {}
node_types:
MyType:
properties:
my_parameter:
type: string
interfaces:
MyInterface:
type: MyType
topology_template:
node_templates:
my_node:
type: MyType
properties:
my_parameter: { get_operation_output: [ my_node, MyInterface, my_operation, my_variable ] }
""").assert_success()
# Unicode
def test_functions_get_operation_output_unicode(parser):
parser.parse_literal("""
tosca_definitions_version: tosca_simple_yaml_1_0
interface_types:
類型:
手術: {}
node_types:
類型:
properties:
參數:
type: string
interfaces:
接口:
type: 類型
topology_template:
node_templates:
模板:
type: 類型
properties:
參數: { get_operation_output: [ 模板, 接口, 手術, 變量 ] }
""").assert_success()
|
'''
Global Variables
Variables that are created outside of a function (as in all of the examples above) are known as global variables.
Global variables can be used by everyone, both inside of functions and outside.
'''
#Example
#Create a variable outside of a function, and use it inside the function
x = "awesome"
def myfunction():
print("python is " + x)
myfunction()
'''
If you create a variable with the same name inside a function, this variable will be local, and can only be used inside the function. The global variable with the same name will remain as it was, global and with the original value.
Example
Create a variable inside a function, with the same name as the global variable
'''
x = "awesome"
def myfunc():
x = "fantastic"
print("python is " + x)
myfunc()
print("Python is " + x)
'''
The global Keyword
Normally, when you create a variable inside a function, that variable is local, and can only be used inside that function.
To create a global variable inside a function, you can use the global keyword.
'''
def myfunct():
global y
y = "fantastic"
myfunct()
print("Python is " + y)
# Also, use the global keyword if you want to change a global variable inside a function.
x = "awesome"
def myfunc():
global x
x = "fantastic"
myfunc()
print("Python is " + x)
|
''' 5. b.
To get a string from a given string where
all occurrences of its first char have been
changed to '$', except the first char itself.
'''
word = input("Enter a long word: ") #arastratiosphecomyia
first_char = word[0] # set first character of our string to first_char variable
new_string = first_char # add first_char to our new empty string, we will add more later
for pointer in word[1:]:
if pointer == first_char:
new_string += '$'
else:
new_string += pointer
print(new_string)
|
points = [[0, 0]]
n = int(input())
for i in range(n):
x, y = map(int, input().split())
points.append([x, y])
distance_pairs = []
for i in range(n + 1):
for j in range(i, n + 1):
dx = points[i][0] - points[j][0]
dy = points[i][1] - points[j][1]
distance_pairs.append([dx ** 2 + dy ** 2, i, j])
distance_pairs.sort()
best = [0] * (n+1)
pbest = [0] * (n+1)
pdist = [0] * (n+1)
for pair in distance_pairs:
d = pair[0]
a = pair[1]
b = pair[2]
if d != pdist[a]:
pdist[a] = d
pbest[a] = best[a]
if d != pdist[b]:
pdist[b] = d
pbest[b] = best[b]
if a == 0: # the origin is a special case because we cannot revisit it
best[a] = max(best[a], pbest[b])
else:
best[a] = max(best[a], pbest[b] + 1)
best[b] = max(best[b], pbest[a] + 1)
print(best[0])
|
'''
NetworkX betweenness centrality on a social network
Betweenness centrality is a node importance metric that uses information about the shortest paths in a network. It is defined as the fraction of all possible shortest paths between any pair of nodes that pass through the node.
NetworkX provides the nx.betweenness_centrality(G) function for computing the betweenness centrality of every node in a graph, and it returns a dictionary where the keys are the nodes and the values are their betweenness centrality measures.
INSTRUCTIONS
100XP
Compute the betweenness centrality bet_cen of the nodes in the graph T.
Compute the degree centrality deg_cen of the nodes in the graph T.
Compare betweenness centrality to degree centrality by creating a scatterplot of the two, with list(bet_cen.values()) on the x-axis and list(deg_cen.values()) on the y-axis.
'''
# Compute the betweenness centrality of T: bet_cen
bet_cen = nx.betweenness_centrality(T)
# Compute the degree centrality of T: deg_cen
deg_cen = nx.degree_centrality(T)
# Create a scatter plot of betweenness centrality and degree centrality
plt.scatter(list(bet_cen.values()), list(deg_cen.values()))
# Display the plot
plt.show()
|
#Desafio MDC
def mdc(numeros):
pass
if __name__ == '__main__':
print(mdc([21, 7])) #7
print(mdc([125, 40])) #5
print(mdc([9, 564, 66, 3])) #3
print(mdc([55, 22])) #11
print(mdc([15, 150])) #15
print(mdc([7, 9])) #1
|
N = int(input())
K = int(input())
print(K % N)
|
# Exercício 2.6 - Modifique o programa da listagem 2.11, de forma que ele calcule um
# aumento de 15% para um salário de R$ 750
salario = 750.00
taxa_aumento = 0.15
aumento = salario * taxa_aumento
novo_salario = salario + aumento
print('\nSálario de R$750.00 + aumento de 15' + '% = ' + 'R$%.2f\n' % (novo_salario))
|
"""
def
-> Used to define new functions
-> Binds a function object to a name
-> Executed at runtime
"""
|
'''Test file for file_path_operations.py.'''
master = FileMaster('/Users/person1/Pictures/house.png')
test.describe('Description Test Cases')
test.assert_equals(master.extension(), 'png')
test.assert_equals(master.filename(), 'house')
test.assert_equals(master.dirpath(), '/Users/person1/Pictures/')
|
'''solved, super easy'''
class Solution:
def removeElement(self, nums, val):
"""
:type nums: List[int]
:type val: int
:rtype: int
"""
i = 0
while i < len(nums):
if nums[i] == val:
del nums[i]
else:
i += 1
return len(nums)
if __name__ == '__main__':
assert Solution().removeElement([3, 2, 2, 3], 3) == 2
assert Solution().removeElement([0,1,2,2,3,0,4,2], 2) == 5
|
class Solution:
# @param {int[]} nums a set of distinct positive integers
# @return {int[]} the largest subset
def largestDivisibleSubset(self, nums):
# Write your code here
if not nums:
return 0
nums = sorted(nums)
# n = len(nums)
dp, prev = {}, {}
for num in nums:
dp[num] = 1
prev[num] = -1
last_num = nums[0]
for num in nums:
for factor in self.get_factors(num):
if factor not in dp:
continue
if dp[num] < dp[factor] + 1:
dp[num] = dp[factor] + 1
prev[num] = factor
if dp[num] > dp[last_num]:
last_num = num
return self.get_path(prev, last_num)
def get_path(self, prev, last_num):
path = []
while last_num != -1:
path.append(last_num)
last_num = prev[last_num]
return path[::-1]
def get_factors(self, num):
if num == 1:
return []
factor = 1
factors = []
while factor * factor <= num:
if num % factor == 0:
factors.append(factor)
if factor * factor != num and factor != 1:
factors.append(num // factor)
factor += 1
return factors
|
"""
@Date: 2021/11/06
@description:
"""
|
def complicated_logic(first, second):
print(f"You passed: {first}, {second}")
# return first + second * 12 - 4 * 12
number1 = 10
number2 = 3
result = complicated_logic(number1, number2)
print(result)
|
class Solution:
def powerfulIntegers(self, x: int, y: int, bound: int) -> List[int]:
ans = set()
for i in range(bound):
if pow(x,i) > bound or (x==1 and i>0):
break
for j in range(bound):
if pow(y,j) > bound or (y==1 and j>0):
break
temp = pow(x,i) + pow(y,j)
# print(temp)
if temp <= bound:
ans.add(temp)
return list(ans)
|
class Node():
def __init__(self, val):
self.val = val
self.right = None
self.left = None
def insert(root, val):
if root is None:
return Node(val)
elif val < root.val:
root.left = insert(root.left, val)
elif val > root.val:
root.right = insert(root.right, val)
return root
def insert_iterative(root, val):
newnode = Node(val)
curr = root
prev = None
while curr != None:
prev = curr
if curr.val > val:
curr = curr.left
elif curr.val < val:
curr = curr.right
if prev is None:
return newnode
elif prev.val > val:
prev.left = newnode
else:
prev.right = newnode
return root
def smallest(root):
curr = root
while curr.left is not None:
curr = curr.left
return curr
def delete(root, val):
if root is None:
return root
if val < root.val:
# val is less than root.val
root.left = delete(root.left, val)
elif val > root.val:
# val is greater than root.val
root.right = delete(root.right, val)
else:
# val is equal to root.val
if root.left is None and root.right is None:
#Node is Leaf
root = None
elif root.right is None:
# Node has only left child
root = root.left
elif root.left is None:
# Node has only right child
root = root.right
else:
smallest_node = smallest(root.right)
root.val = smallest.val
root.right = delete(root.right, smallest.val)
return root
def search(root, val):
if root is None:
return False
if root.val == val:
return True
if val < root.val:
return search(root.left, val)
if val > root.val:
return search(root.right, val)
def search_iterative(root, val):
while root != None:
if root.val > val:
root = root.left
elif root.val < val:
root = root.right
else:
return True
return False
def inorder(root):
if root is None:
return
inorder(root.left)
print(root.val, end=" ")
inorder(root.right)
def preorder(root):
if root is None:
return
print(root.val, end=" ")
preorder(root.left)
preorder(root.right)
def postorder(root):
if root is None:
return
preorder(root.left)
preorder(root.right)
print(root.val, end=" ")
def getHeight(root):
if root is None:
return -1
return max(getHeight(root.left), getHeight(root.right)) + 1
root = None
for t in range(int(input().split())):
n = int(input())
for i in range(n):
root.insert(root, int(input()))
inorder(root)
print("\n")
root = delete(root, 12)
inorder(root)
print("\n")
|
class Fjs(object):
def __init__(self, name):
self.name = name
def hello(self):
print("said by : ", self.name)
def __getattr__(self, item):
print("访问了特性1:" + item)
return None
raise AttributeError
def __setattr__(self, key, value):
print("访问了特性2:" + key)
self.__dict__[key] = value
def __getattribute__(self, item):
print("访问了特性3:" + item)
return object.__getattribute__(self, item)
fjs = Fjs("fjs")
print(fjs.name )
print('-------------1-------')
fjs.hello()
print('--------------2------')
fjs.bb
"""
访问了特性:name
fjs
---------------2-----
访问了特性:hello
访问了特性:name
said by : fjs
"""
|
soma = 0
for i in range(0,101):
if(i%2==0):
soma+=i
print("A soma de todos os pares é:", soma)
|
input()
num = set(map(int,input().split()))
prime = set([i for i in range(3,max(num)+1,2)])
for i in range(3,max(num)+1,2):
if i in prime:
prime -= set([i for i in range(i*2,max(num)+1,i)])
prime.add(2)
print(len(num.intersection(prime)))
|
class TestOptimizeO:
"""Test interaction of -O flag and optimize parameter of compile."""
def setup_method(self, method):
space = self.space
self._w_flags = space.sys.get('flags')
# imitate -O
space.appexec([], """():
import sys
flags = list(sys.flags)
flags[3] = 1
sys.flags = type(sys.flags)(flags)
""")
def teardown_method(self, method):
space = self.space
space.setitem(space.sys.w_dict, space.newtext('flags'), self._w_flags)
def test_O_optmize_0(self):
"""Test that assert is not ignored if -O flag is set but optimize=0."""
space = self.space
w_res = space.appexec([], """():
assert False # check that our -O imitation hack works
try:
exec(compile('assert False', '', 'exec', optimize=0))
except AssertionError:
return True
else:
return False
""")
assert space.unwrap(w_res)
def test_O_optimize__1(self):
"""Test that assert is ignored with -O and optimize=-1."""
space = self.space
space.appexec([], """():
exec(compile('assert False', '', 'exec', optimize=-1))
""")
|
# draw a rectangle
# rect(x, y, width, height)
rect(20, 50, 100, 200)
rect(130, 50, 100, 200)
oval(240, 50, 100, 200)
oval(20, 250, 100, 100)
oval(130, 250, 100, 100)
rect(240, 250, 100, 100)
for x in range(20, 300, 50):
rect(x, 370, 40, 40)
for x in range(20, 300, 50):
if random() > 0.5:
rect(x, 420, 40, 40)
else:
oval(x, 420, 40, 40)
|
# Desenvolva um programa que leia seis numeros inteiros e mostre a soma apenas daqueles que forem PARES.
# Se o valor digitado for IMPAR, desconsidere-o
soma = 0
cont = 0
for n in range(1, 7):
n = int(input('Digite um Valor inteiro: '))
if n % 2 == 0:
soma = soma + n
cont = cont + 1
print(f'A soma dos {cont} valores pares informado é {soma} ')
|
"""
Pagination support code.
"""
BUFFER = 5
def paginator(page_num, max_page, buffer_size=BUFFER):
"""
Pagination generator.
Generates a sequence of page numbers, giving the pages at the beginning
and end, and around the current page, with a number of buffer pages on
each side of both. Omitted pages in the sequence are elided into a `None`.
"""
if page_num - buffer_size > 1:
yield 1
if page_num - buffer_size > 2:
yield None
begin = max(1, page_num - buffer_size)
end = min(max_page, page_num + buffer_size)
for i in xrange(begin, end + 1):
yield i
if max_page - page_num - buffer_size > 1:
yield None
if max_page - page_num - buffer_size > 0:
yield max_page
|
scores = {
"John": 81.5,
"Fred": 100,
"Chad": 50,
"Wopper": 30,
"Katie": 73
}
def calc_grade(score):
if score >= 91:
return "Outstanding"
elif score >= 81:
return "Exceeds Expectations"
elif score >= 71:
return "Acceptable"
elif score >= 61:
return "Needs Improvement"
else:
return "You're a fuck up."
for k in scores:
print("%s has a grade of ---> %s" % (k, calc_grade(scores[k])))
|
# eval utils
def statistics_degrees(A_in):
"""
Compute min, max, mean degree
Parameters
----------
A_in: sparse matrix or np.array
The input adjacency matrix.
Returns
-------
d_max. d_min, d_mean
"""
degrees = A_in.sum(axis=0)
return np.max(degrees), np.min(degrees), np.mean(degrees)
def statistics_LCC(A_in):
"""
Compute the size of the largest connected component (LCC)
Parameters
----------
A_in: sparse matrix or np.array
The input adjacency matrix.
Returns
-------
Size of LCC
"""
unique, counts = np.unique(connected_components(A_in)[1], return_counts=True)
LCC = np.where(connected_components(A_in)[1] == np.argmax(counts))[0]
return LCC
def statistics_wedge_count(A_in):
"""
Compute the wedge count of the input graph
Parameters
----------
A_in: sparse matrix or np.array
The input adjacency matrix.
Returns
-------
The wedge count.
"""
degrees = A_in.sum(axis=0).flatten()
return float(np.sum(np.array([0.5 * x * (x - 1) for x in degrees])))
def statistics_claw_count(A_in):
"""
Compute the claw count of the input graph
Parameters
----------
A_in: sparse matrix or np.array
The input adjacency matrix.
Returns
-------
Claw count
"""
degrees = A_in.sum(axis=0).flatten()
return float(np.sum(np.array([1 / 6. * x * (x - 1) * (x - 2) for x in degrees])))
def statistics_triangle_count(A_in):
"""
Compute the triangle count of the input graph
Parameters
----------
A_in: sparse matrix or np.array
The input adjacency matrix.
Returns
-------
Triangle count
"""
A_graph = nx.from_numpy_matrix(A_in)
triangles = nx.triangles(A_graph)
t = np.sum(list(triangles.values())) / 3
return int(t)
def squares(g):
"""
Count the number of squares for each node
Parameters
----------
g: igraph Graph object
The input graph.
Returns
-------
List with N entries (N is number of nodes) that give the number of squares a node is part of.
"""
cliques = g.cliques(min=4, max=4)
result = [0] * g.vcount()
for i, j, k, l in cliques:
result[i] += 1
result[j] += 1
result[k] += 1
result[l] += 1
return result
def statistics_square_count(A_in):
"""
Compute the square count of the input graph
Parameters
----------
A_in: sparse matrix or np.array
The input adjacency matrix.
Returns
-------
Square count
"""
A_igraph = igraph.Graph.Adjacency((A_in > 0).tolist()).as_undirected()
return int(np.sum(squares(A_igraph)) / 4)
def statistics_power_law_alpha(A_in):
"""
Compute the power law coefficient of the degree distribution of the input graph
Parameters
----------
A_in: sparse matrix or np.array
The input adjacency matrix.
Returns
-------
Power law coefficient
"""
degrees = A_in.sum(axis=0).flatten()
return powerlaw.Fit(degrees, xmin=max(np.min(degrees),1)).power_law.alpha
def statistics_gini(A_in):
"""
Compute the Gini coefficient of the degree distribution of the input graph
Parameters
----------
A_in: sparse matrix or np.array
The input adjacency matrix.
Returns
-------
Gini coefficient
"""
n = A_in.shape[0]
degrees = A_in.sum(axis=0).flatten()
degrees_sorted = np.sort(degrees)
G = (2 * np.sum(np.array([i * degrees_sorted[i] for i in range(len(degrees))]))) / (n * np.sum(degrees)) - (
n + 1) / n
return float(G)
def statistics_edge_distribution_entropy(A_in):
"""
Compute the relative edge distribution entropy of the input graph.
Parameters
----------
A_in: sparse matrix or np.array
The input adjacency matrix.
Returns
-------
Rel. edge distribution entropy
"""
degrees = A_in.sum(axis=0).flatten()
m = 0.5 * np.sum(np.square(A_in))
n = A_in.shape[0]
H_er = 1 / np.log(n) * np.sum(-degrees / (2 * float(m)) * np.log((degrees+.0001) / (2 * float(m))))
return H_er
def statistics_compute_cpl(A):
"""Compute characteristic path length."""
P = sp.csgraph.shortest_path(sp.csr_matrix(A))
return P[((1 - np.isinf(P)) * (1 - np.eye(P.shape[0]))).astype(np.bool)].mean()
def compute_graph_statistics(A_in, Z_obs=None):
"""
Parameters
----------
A_in: sparse matrix
The input adjacency matrix.
Z_obs: np.matrix [N, K], where K is the number of classes.
Matrix whose rows are one-hot vectors indicating the class membership of the respective node.
Returns
-------
Dictionary containing the following statistics:
* Maximum, minimum, mean degree of nodes
* Size of the largest connected component (LCC)
* Wedge count
* Claw count
* Triangle count
* Square count
* Power law exponent
* Gini coefficient
* Relative edge distribution entropy
* Assortativity
* Clustering coefficient
* Number of connected components
* Intra- and inter-community density (if Z_obs is passed)
* Characteristic path length
"""
A = A_in.copy()
assert((A == A.T).all())
A_graph = nx.from_numpy_matrix(A).to_undirected()
statistics = {}
d_max, d_min, d_mean = statistics_degrees(A)
# Degree statistics
statistics['d_max'] = d_max
statistics['d_min'] = d_min
statistics['d'] = d_mean
# node number & edger number
statistics['node_num'] = A_graph.number_of_nodes()
statistics['edge_num'] = A_graph.number_of_edges()
# largest connected component
LCC = statistics_LCC(A)
statistics['LCC'] = LCC.shape[0]
# wedge count
statistics['wedge_count'] = statistics_wedge_count(A)
# claw count
statistics['claw_count'] = statistics_claw_count(A)
# triangle count
statistics['triangle_count'] = statistics_triangle_count(A)
# Square count
statistics['square_count'] = statistics_square_count(A)
# power law exponent
statistics['power_law_exp'] = statistics_power_law_alpha(A)
# gini coefficient
statistics['gini'] = statistics_gini(A)
# Relative edge distribution entropy
statistics['rel_edge_distr_entropy'] = statistics_edge_distribution_entropy(A)
# Assortativity
statistics['assortativity'] = nx.degree_assortativity_coefficient(A_graph)
# Clustering coefficient
statistics['clustering_coefficient'] = 3 * statistics['triangle_count'] / (statistics['claw_count']+1)
# Number of connected components
statistics['n_components'] = connected_components(A)[0]
# if Z_obs is not None:
# # inter- and intra-community density
# intra, inter = statistics_cluster_props(A, Z_obs)
# statistics['intra_community_density'] = intra
# statistics['inter_community_density'] = inter
statistics['cpl'] = statistics_compute_cpl(A)
return statistics
|
# Exercício Python 39: Crie um programa que leia o nome e o preço de vários produtos. O programa deverá perguntar se o usuário vai continuar ou não. No final, mostre:
#A) qual é o total gasto na compra.
#B) quantos produtos custam mais de R$1000.
#C) qual é o nome do produto mais barato.
print('~'*30)
print('LISTA DE COMPRAS')
print('~'*30)
prod = input('Insira o nome do produto: ')
preco = float(input('Insira o preço: '))
mais_mil = soma = 0
mais_barato = preco
prod_mais_barato = prod
while True:
soma += preco
if preco > 1000:
mais_mil += 1
if preco < mais_barato:
mais_barato = preco
prod_mais_barato = prod
x = input('Continuar cadastrando [S/N]: ').upper()
if x == 'S':
prod = input('Insira o nome do produto: ')
|
"""
A statement function set holds a set of statement functions that can be used in statements.
"""
class BaseStatementFuncSet(object):
"""
A statement function set holds a set of statement functions that can be used in statements.
"""
def __init__(self):
self.funcs = {}
self.at_creation()
def at_creation(self):
"""
Load statement functions here.
"""
pass
def add(self, func_cls):
"""
Add a statement function's class.
Args:
func_cls: statement function's class
Returns:
None
"""
# save an instance of the function class
self.funcs[func_cls.key] = func_cls
def get_func_class(self, key):
"""
Get statement function's class.
Args:
key: statement function's key.
Returns:
function's class
"""
if key in self.funcs:
return self.funcs[key]
else:
return None
|
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 3 14:53:06 2019
@author: ISHA
"""
arr = [
[ 'XYZ', 1, 88, 56, 45],
[ 'ABC', 2, 45, 86, 52],
[ 'LMN', 3, 87, 39, 40],
[ 'QWS', 4, 96, 86, 85],
[ 'TRE', 5, 76, 56, 53],
[ 'UTH', 6, 35, 79, 48],
[ 'GHJ', 7, 88, 98, 88],
[ 'DFS', 8, 72, 80, 68],
[ 'CVB', 9, 45, 56, 50],
[ 'PQR', 10, 78, 36, 25]]
sumCol=[]
for i in range(len(arr)):
sumCol.append(0)
#sumCol[len(arr)]
#j = len(arr[0]);
for row in range (0,len(arr)):
# sumCol[row] = 0;
for col in range(2,len(arr[row])):
sumCol[row] = sumCol[row] + arr[row][col]
print("Average marks of all Students of T1, T2, T3 : ",sumCol)
print("Data of Students with greatest cluster are :")
print("- - - - - - - - - - - - - - - - - - - - - -")
print("\ Name \ Roll No \ T1 \ T2 \ T3 ")
print("- - - - - - - - - - - - - - - - - - - - - -")
for i in range(len(arr)):
if sumCol[i]>240:
for j in range(len(arr[i])):
print("\ ",arr[i][j], end='\t')
print()
print("- - - - - - - - - - - - - - - - - - - - - -")
|
"""
*graphical color*
Spectral color measures.
"""
# from ._color import Color
# from ._rgb import Rgba
# from ._hsv import Hsba
__all__ = [
"Color",
"Rgba",
"Hsba",
]
|
#!/usr/bin/env python3
'''
Write a function that will find all the anagrams of a word from a list. You will be given two inputs a word and an array with words.
You should return an array of all the anagrams or an empty array if there are none.
'''
def anagrams(word, words):
analis = []
for item in words:
if (sorted(word) == sorted(item)):
analis.append(item)
return analis
#Alternative implementations
def anagrams(word, words):
return [item for item in words if sorted(item)==sorted(word)]
def anagrams(word, words):
return filter(lambda x: sorted(word) == sorted(x), words)
|
YEAR_CHOICES = (
(1,'First'),
(2,'Second'),
(3,'Third'),
(4,'Fourth'),
(5,'Fifth'),
)
|
# -*- coding: utf-8 -*-
"""
Created on Fri May 31 10:11:51 2019
@author: Administrator
"""
class Solution:
def myPow(self, x: float, n: int) -> float:
# if n == 1:
# return x
# if x!=0 and n == 0:
# return 1
# if x == 0 and n <= 0:
# return None
# if n>0:
# if n%2 == 0:
# return self.myPow(x, n//2) * self.myPow(x, n//2)
# else:
# return self.myPow(x, n//2) * self.myPow(x, n//2) * x
# if n<0:
# if n%2 == 0:
# return 1. / ( self.myPow(x, -n//2) * self.myPow(x, -n//2) )
# else:
# return 1. / ( self.myPow(x, -n//2) * self.myPow(x, -n//2) * x )
## if n == 1:
## return x
## if n == 0:
## return 1
# if n == 1:
# return x
# if x!=0 and n == 0:
# return 1
# if x == 0 and n <= 0:
# return None
# if n>0:
# temp = self.myPow(x, n//2)
# if n%2 == 0:
# return temp * temp
# else:
# return temp * temp * x
# if n<0:
# temp = self.myPow(x, -n//2)
# if n%2 == 0:
# return 1. / ( temp * temp )
# else:
# return 1. / ( temp * temp * x )
# if n == 1: return x
# if n == 0: return 1
# t = self.myPow(x, abs(n) // 2)
# if n % 2 == 0:
# t = t * t
# else: t = x * t * t
# if n < 0:
# return 1.0 /t
# return t
if n<0:
n = -n
x = 1. / x
ans = 1
cp = x
while n>=1:
ans = ans*cp**(n%2)
# cp **= 2
cp *= cp
n //= 2
return ans
solu = Solution()
x, n = 2.00000, 10
#x, n = 2.00000, 4
#x, n = 2.10000, 3
#x, n = 2.00000, -2
#x, n = 0.00001, 2147483647#2**31-1#
#x, n = 0.00000, -1
print(solu.myPow(x, n))
|
# day 6...
# count distinct questions or whatever
# parse forms from input file. Split by group!
def parse_forms(file):
raw = file.read()
# Ths smushes each group's responses together, to better facilitate part 1.
# I'm sure I'll regret this in part 2.
# grouplist = ["".join(p.splitlines()) for p in raw.split("\n\n")]
# yeah that doesn't work for part 2 but I can make it work. here
grouplist = [p.splitlines() for p in raw.split("\n\n")]
return grouplist
def main():
with open("input/day6.txt") as f:
group_list = parse_forms(f)
# part 1
sumcounts1 = 0
sumcounts2 = 0
for group in group_list:
groupset = {c for c in ''.join(group)}
sumcounts1 += len(groupset)
sumcounts2 += sum([all([d in e for e in group]) for d in groupset])
print("Part 1:", sumcounts1)
print("Part 2:", sumcounts2)
if __name__ == '__main__':
main()
|
#
# PySNMP MIB module DOCS-RPHY-PTP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DOCS-RPHY-PTP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:53:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint")
clabProjDocsis, = mibBuilder.importSymbols("CLAB-DEF-MIB", "clabProjDocsis")
IfDirection, = mibBuilder.importSymbols("DOCS-IF3-MIB", "IfDirection")
docsRphyRpdDevInfoUniqueId, = mibBuilder.importSymbols("DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId")
IANAPhysicalClass, = mibBuilder.importSymbols("IANA-ENTITY-MIB", "IANAPhysicalClass")
IANAifType, = mibBuilder.importSymbols("IANAifType-MIB", "IANAifType")
ifIndex, InterfaceIndex, InterfaceIndexOrZero = mibBuilder.importSymbols("IF-MIB", "ifIndex", "InterfaceIndex", "InterfaceIndexOrZero")
InetAddressType, InetAddress, InetPortNumber, InetVersion, InetAddressPrefixLength = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress", "InetPortNumber", "InetVersion", "InetAddressPrefixLength")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup")
TimeTicks, ModuleIdentity, ObjectIdentity, Integer32, NotificationType, iso, Counter64, MibIdentifier, Unsigned32, IpAddress, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "ModuleIdentity", "ObjectIdentity", "Integer32", "NotificationType", "iso", "Counter64", "MibIdentifier", "Unsigned32", "IpAddress", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32", "Bits")
AutonomousType, MacAddress, DateAndTime, DisplayString, TimeStamp, TruthValue, PhysAddress, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "AutonomousType", "MacAddress", "DateAndTime", "DisplayString", "TimeStamp", "TruthValue", "PhysAddress", "TextualConvention")
UUIDorZero, = mibBuilder.importSymbols("UUID-TC-MIB", "UUIDorZero")
docsRphyPtpMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32))
docsRphyPtpMib.setRevisions(('2017-04-13 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: docsRphyPtpMib.setRevisionsDescriptions(('Initial version, created by R-OSSI-N-17.1721-3.',))
if mibBuilder.loadTexts: docsRphyPtpMib.setLastUpdated('201704130000Z')
if mibBuilder.loadTexts: docsRphyPtpMib.setOrganization('Cable Television Laboratories, Inc')
if mibBuilder.loadTexts: docsRphyPtpMib.setContactInfo(' Postal: Cable Television Laboratories, Inc. 400 Centennial Parkway Louisville, Colorado 80027-1266 U.S.A. Phone: +1 303-661-9100 Fax: +1 303-661-9199 E-mail: mibs@cablelabs.com')
if mibBuilder.loadTexts: docsRphyPtpMib.setDescription('This MIB module contains the status and reporting objects for the Remote PHY CCAP Core and RPD PTP management. Copyright 2017 Cable Television Laboratories, Inc. All rights reserved.')
docsRphyPtpNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 0))
docsRphyPtpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1))
docsRphyPtpConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2))
docsRphyPtpRpdMibObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1))
docsRphyPtpCcapMibObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2))
docsRphyPtpCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2, 1))
docsRphyPtpGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2, 2))
docsRphyPtpCcapDefaultDataSet = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1))
docsRphyPtpCcapDefaultDataSetTwoStepFlag = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetTwoStepFlag.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetTwoStepFlag.setDescription('This attribute specifies whether the Two Step process is used (i.e., the clock is a two-step clock).')
docsRphyPtpCcapDefaultDataSetClockIdentity = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetClockIdentity.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetClockIdentity.setDescription('This attribute specifies the default Dataset clock identity.')
docsRphyPtpCcapDefaultDataSetPriority1 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetPriority1.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetPriority1.setDescription('This attribute specifies the default Dataset clock Priority1. Lower values take precedence.')
docsRphyPtpCcapDefaultDataSetPriority2 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetPriority2.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetPriority2.setDescription('This attribute specifies the default Dataset clock Priority2. Lower values take precedence.')
docsRphyPtpCcapDefaultDataSetSlaveOnly = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 5), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetSlaveOnly.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetSlaveOnly.setDescription('This attribute specifies whether the SlaveOnly flag is set.')
docsRphyPtpCcapDefaultDataSetQualityClass = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityClass.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityClass.setDescription('This attribute of an ordinary or boundary clock denotes the traceability of the time or frequency distributed by the grandmaster clock. See section 7.6.2.4 in [IEEE 1588].')
docsRphyPtpCcapDefaultDataSetQualityAccuracy = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityAccuracy.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityAccuracy.setDescription('This attribute characterizes a clock for the purpose of the best master clock (BMC) algorithm. See section 7.6.2.5 in [IEEE 1588].')
docsRphyPtpCcapDefaultDataSetQualityOffset = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityOffset.setDescription('This attribute is the offset, scaled, logarithmic representation of the clock variance. See Section 7.6.3.5 in [IEEE 1588].')
docsRphyPtpCcapCurrentDataSet = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 2))
docsRphyPtpCcapCurrentDataSetStepsRemoved = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 2, 1), Unsigned32()).setUnits('steps').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetStepsRemoved.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetStepsRemoved.setDescription('This attribute is the number of communication paths traversed between the local clock and the grandmaster clock. The initialization value is 0.')
docsRphyPtpCcapCurrentDataSetOffsetFromMaster = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 2, 2), Integer32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetOffsetFromMaster.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetOffsetFromMaster.setDescription('This attribute is an implementation-specific representation of the current value of the time difference between a master and a slave as computed by the slave.')
docsRphyPtpCcapCurrentDataSetMeanPathDelay = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 2, 3), Unsigned32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetMeanPathDelay.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetMeanPathDelay.setDescription('This attribute is an implementation-specific representation of the current value of the mean propagation time between a master and slave clock as computed by the slave. Zero means that the path delay is unavailable.')
docsRphyPtpCcapParentDataSet = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3))
docsRphyPtpCcapParentDataSetParentClockId = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentClockId.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentClockId.setDescription('This attribute is the clock identifier of the clock port on the master that issues the Sync messages used in synchronizing this clock.')
docsRphyPtpCcapParentDataSetParentPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentPortNumber.setDescription('This attribute is the port number of the clock port on the master that issues the Sync messages used in synchronizing this clock.')
docsRphyPtpCcapParentDataSetParentStats = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 3), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentStats.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentStats.setDescription('This attribute is set to True if the clock has a port in the slave state and the clock has computed statistically valid estimates of the ClockOffset Scaled Log Variance and the Clock PhaseChangeRate. If either the ClockOffset Scaled Log Variance or the Clock PhaseChangeRate is not computed, then the CCAP core MUST set the value of ParentStats to false.')
docsRphyPtpCcapParentDataSetClockOffset = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 4), Integer32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetClockOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetClockOffset.setDescription("This attribute represents the value of the observed Parent Offset Scaled Log Variance, which is an estimate of the parent clock's PTP variance as observed by the slave clock. The computation of this value is optional, but if not computed, the value of parentStats is FALSE. The initialization value of ClockOffset is 0xFFFF.")
docsRphyPtpCcapParentDataSetPhaseChangeRate = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 5), Integer32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetPhaseChangeRate.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetPhaseChangeRate.setDescription("This attribute represents the value of Phase Change Rate, which is an estimate of the parent clock's phase change rate as observed by the slave clock. If the estimate exceeds the capacity of its data type, this value is set to 0x7FFF FFFF. A positive sign indicates that the parent clock's phase change rate is greater than the rate of the slave clock. The computation of this value is optional, but if not computed,the value of parentStats is FALSE.")
docsRphyPtpCcapParentDataSetGmClockIdentity = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmClockIdentity.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmClockIdentity.setDescription('This attribute represents the clock Identity of the grandmaster clock.')
docsRphyPtpCcapParentDataSetGmPriority1 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmPriority1.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmPriority1.setDescription('This attribute represents the priority1 of the grandmaster clock. Lower values take precedence.')
docsRphyPtpCcapParentDataSetGmPriority2 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmPriority2.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmPriority2.setDescription('This attribute represents the priority2 of the grandmaster clock. Lower values take precedence.')
docsRphyPtpCcapParentDataSetGmQualityClass = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityClass.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityClass.setDescription('This attribute is the clock class for the grandmaster clock. The clock class attribute of an ordinary or boundary clock denotes the traceability of the time or frequency distributed by the grandmaster clock. See section 7.6.2.4 in [IEEE 1588].')
docsRphyPtpCcapParentDataSetGmQualityAccuracy = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityAccuracy.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityAccuracy.setDescription('This attribute characterizes the grandmaster clock for the purpose of the best master clock (BMC) algorithm. See section 7.6.2.5 in [IEEE 1588].')
docsRphyPtpCcapParentDataSetGmQualityOffset = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityOffset.setDescription('This attribute represents the offset, scaled, logarithmic representation of the grandmaster clock variance. See Section 7.6.3.5 in [IEEE 1588].')
docsRphyPtpCcapTimeProperties = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4))
docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid.setDescription('This attribute represents the value of currentUtcOffsetValid is TRUE if the currentUtcOffset is known to be correct.')
docsRphyPtpCcapTimePropertiesCurrentUtcOffset = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 2), Integer32()).setUnits('Seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesCurrentUtcOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesCurrentUtcOffset.setDescription('This attribute represents the offset between International Atomic Time (TAI) and Universal Coordinated Time (UTC).')
docsRphyPtpCcapTimePropertiesLeap59 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 3), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesLeap59.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesLeap59.setDescription('This attribute represents whether or not there are 59 seconds in the last minute of the current UTC day for PTP systems whose epoch is the PTP epoch,; a TRUE value for Leap59 indicates that the last minute of the current UTC day contains 59 seconds.')
docsRphyPtpCcapTimePropertiesLeap61 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 4), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesLeap61.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesLeap61.setDescription('This attribute represents whether or not there are 61 seconds in the last minute of the current UTC day for PTP systems whose epoch is the PTP epoch; a TRUE value for Leap61 indicates that the last minute of the current UTC day contains 61 seconds.')
docsRphyPtpCcapTimePropertiesTimeTraceable = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 5), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesTimeTraceable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesTimeTraceable.setDescription('This attribute represents whether the timescale and the value of currentUtcOffset are traceable to a primary reference. TimeTraceable is TRUE if the timescale and the value of currentUtcOffset are traceable to a primary reference; otherwise, the value is FALSE.')
docsRphyPtpCcapTimePropertiesFreqTraceable = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 6), TruthValue().clone('true')).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesFreqTraceable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesFreqTraceable.setDescription('This attribute represents whether the frequency determining the timescale is traceable to a primary reference. The value of FrequencyTraceable is TRUE if the frequency determining the timescale is traceable to a primary reference; otherwise, the value is FALSE.')
docsRphyPtpCcapTimePropertiesPtpTimescale = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 7), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesPtpTimescale.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesPtpTimescale.setDescription('This attribute is always true for grandmaster clocks with a clock timescale of PTP.')
docsRphyPtpCcapTimePropertiesTimeSource = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesTimeSource.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesTimeSource.setDescription('This attribute represents the source of time used by the grandmaster clock. See Table 7 in [IEEE 1588]. If the time source of the grandmaster clock is unknown, the CCAP Core MUST set the TimeSource value to INTERNAL_OSCILLATOR (0xA0).')
docsRphyPtpCcapPortDataSetTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 5), )
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetTable.setDescription('See section 8.2.5 in [IEEE 1588] for details of the 1588 port dataset.')
docsRphyPtpCcapPortDataSetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 5, 1), ).setIndexNames((0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortDataSetPortNumber"))
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetEntry.setDescription('The conceptual row of docsRphyPtpCcapPortDataSetTable.')
docsRphyPtpCcapPortDataSetPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 5, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)))
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetPortNumber.setDescription('This key attribute is the port number of the local clock port. Port numbers 0 and 65,535 are reserved and cannot be used for real clock ports. See [IEEE 1588] for more information. When a PTP clock has N ports, the CCAP Core MUST set the port number to a value in the interval 1..N.')
docsRphyPtpCcapPortDataSetPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 5, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetPortState.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetPortState.setDescription('This attribute is the state of this PTP clock port. See Table 8 in [IEEE 1588].')
docsRphyPtpCcapPortDataSetMeanPathDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 5, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetMeanPathDelay.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetMeanPathDelay.setDescription('This attribute is an implementation-specific representation of the current value of the mean propagation time between a master and slave clock as computed by the slave. Zero means that the path delay is unavailable.')
docsRphyPtpCcapClockStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6))
docsRphyPtpCcapClockStatusClockState = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("freerun", 1), ("holdover", 2), ("acquiring", 3), ("freqLocked", 4), ("phaseAligned", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusClockState.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusClockState.setDescription('This attribute represents the current state of the clock.')
docsRphyPtpCcapClockStatusLastStateChange = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 2), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusLastStateChange.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusLastStateChange.setDescription('This attribute represents the value in TimeTicks when the clock state last changed.')
docsRphyPtpCcapClockStatusPacketsSent = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 3), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent for this clock.')
docsRphyPtpCcapClockStatusPacketsReceived = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 4), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received for this clock.')
docsRphyPtpCcapClockStatusComputedPhaseOffset = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 5), Unsigned32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusComputedPhaseOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusComputedPhaseOffset.setDescription('This attribute specifies the phase offset that the locking algorithm computed in the last 60 sec interval. 0xFFFFFFFF means offset unknown.')
docsRphyPtpCcapClockStatusCounterDiscontinuityTime = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 6), TimeStamp()).setUnits('TimeTicks').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusCounterDiscontinuityTime.setDescription("This attribute represents the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpCcapCorePtpPortStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7), )
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusTable.setDescription('CorePtpCoreStatus is an instantiation of the abstract class PtpPortStatus and inherits those common attributes')
docsRphyPtpCcapCorePtpPortStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7, 1), ).setIndexNames((0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCorePtpPortStatusPortNumber"))
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusEntry.setDescription('The conceptual row of docsRphyPtpCcapCorePtpPortStatusTable .')
docsRphyPtpCcapCorePtpPortStatusPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPortNumber.setDescription('This key attribute is the port number of the local clock port.')
docsRphyPtpCcapCorePtpPortStatusPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7, 1, 2), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent for this clock port.')
docsRphyPtpCcapCorePtpPortStatusPacketsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7, 1, 3), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received for this clock port.')
docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7, 1, 4), TimeStamp()).setUnits('TimeTicks').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime.setDescription("This attribute represents the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpCcapPortMasterClockStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8), )
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusTable.setDescription('This table contains Port MasterClock Status attributes.')
docsRphyPtpCcapPortMasterClockStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1), ).setIndexNames((0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCorePtpPortStatusPortNumber"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusMasterPriority"))
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusEntry.setDescription('The conceptual row of docsRphyPtpCcapPortMasterClockStatusTable.')
docsRphyPtpCcapPortMasterClockStatusMasterPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 5)))
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterPriority.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterPriority.setDescription('This key attribute is the priority of the master clock configured for the PTP template assigned to this PTP clock port. Low numbers are higher priority.')
docsRphyPtpCcapPortMasterClockStatusPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 2), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent to this master for this slave clock port.')
docsRphyPtpCcapPortMasterClockStatusPacketsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 3), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received from this master for this slave clock port.')
docsRphyPtpCcapPortMasterClockStatusMasterClockId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterClockId.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterClockId.setDescription('This attribute specifies the clock identifier of this master clock.')
docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber.setDescription("This attribute specifies master clock's port number.")
docsRphyPtpCcapPortMasterClockStatusTwoStepFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 6), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusTwoStepFlag.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusTwoStepFlag.setDescription('This attribute specifies whether the Two Step process is used (i.e., the clock is a two-step clock).')
docsRphyPtpCcapPortMasterClockStatusIsBmc = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 7), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusIsBmc.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusIsBmc.setDescription('This attribute represents whether or not this master is the current Best Master Clock (i.e., the master clock currently in use for this slave clock).')
docsRphyPtpCcapPortMasterClockStatusIsMasterConnected = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 8), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusIsMasterConnected.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusIsMasterConnected.setDescription('This attribute is set to TRUE if a signaling session with the master is successfully established. When a slave node receives an announce and a sync message from the master, the CCAP Core SHOULD consider the session to be successfully established.')
docsRphyPtpCcapPortMasterClockStatusStatusDomain = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusStatusDomain.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusStatusDomain.setDescription('This attribute is the PTP master domain.')
docsRphyPtpCcapPortMasterClockStatusFreqOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 10), Unsigned32()).setUnits('PPM').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusFreqOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusFreqOffset.setDescription('This attribute specifies the frequency offset that the locking algorithm computed per master in the last 60 sec interval. 0xFFFFFFFF means offset unknown.')
docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 11), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime.setDescription("This attribute contains the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpRpdCurrentDataSetTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 1), )
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetTable.setDescription('See section 8.2.5 in [IEEE 1588] for details of the 1588 port dataset.')
docsRphyPtpRpdCurrentDataSetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 1, 1), ).setIndexNames((0, "DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId"))
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetEntry.setDescription('The conceptual row of docsRphyPtpRpdCurrentDataSetTable.')
docsRphyPtpRpdCurrentDataSetStepsRemoved = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 1, 1, 1), Unsigned32()).setUnits('steps').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetStepsRemoved.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetStepsRemoved.setDescription('This attribute is the number of communication paths traversed between the local clock and the grandmaster clock. The initialization value is 0.')
docsRphyPtpRpdCurrentDataSetOffsetFromMaster = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 1, 1, 2), Integer32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetOffsetFromMaster.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetOffsetFromMaster.setDescription('This attribute is an implementation-specific representation of the current value of the time difference between a master and a slave as computed by the slave.')
docsRphyPtpRpdCurrentDataSetMeanPathDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 1, 1, 3), Unsigned32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetMeanPathDelay.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetMeanPathDelay.setDescription('This attribute is an implementation-specific representation of the current value of the mean propagation time between a master and slave clock as computed by the slave. Zero means that the path delay is unavailable.')
docsRphyPtpRpdClockStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2), )
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusTable.setDescription('See section 8.2.5 in [IEEE 1588] for details of the 1588 port dataset.')
docsRphyPtpRpdClockStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1), ).setIndexNames((0, "DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId"))
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusEntry.setDescription('The conceptual row of docsRphyPtpRpdClockStatusTable.')
docsRphyPtpRpdClockStatusClockState = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("freerun", 1), ("holdover", 2), ("acquiring", 3), ("freqLocked", 4), ("phaseAligned", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusClockState.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusClockState.setDescription('This attribute represents the current state of the clock.')
docsRphyPtpRpdClockStatusLastStateChange = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 2), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusLastStateChange.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusLastStateChange.setDescription('This attribute represents the value in TimeTicks when the clock state last changed.')
docsRphyPtpRpdClockStatusPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 3), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent for this clock.')
docsRphyPtpRpdClockStatusPacketsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 4), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received for this clock.')
docsRphyPtpRpdClockStatusComputedPhaseOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 5), Unsigned32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusComputedPhaseOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusComputedPhaseOffset.setDescription('This attribute specifies the phase offset that the locking algorithm computed in the last 60 sec interval. 0xFFFFFFFF means offset unknown.')
docsRphyPtpRpdClockStatusCounterDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 6), TimeStamp()).setUnits('TimeTicks').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusCounterDiscontinuityTime.setDescription("This attribute represents the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpRpdPortDataSetTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 3), )
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetTable.setDescription('See section 8.2.5 in [IEEE 1588] for details of the 1588 port dataset.')
docsRphyPtpRpdPortDataSetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 3, 1), ).setIndexNames((0, "DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortDataSetPortNumber"))
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetEntry.setDescription('The conceptual row of docsRphyPtpRpdPortDataSetTable.')
docsRphyPtpRpdPortDataSetPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 3, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)))
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetPortNumber.setDescription('This key attribute is the port number of the local clock port. Port numbers 0 and 65,535 are reserved and cannot be used for real clock ports. See [IEEE 1588] for more information. When a PTP clock has N ports, the CCAP Core MUST set the port number to a value in the interval 1..N.')
docsRphyPtpRpdPortDataSetPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 3, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetPortState.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetPortState.setDescription('This attribute is the state of this PTP clock port. See Table 8 in [IEEE 1588].')
docsRphyPtpRpdPortDataSetMeanPathDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 3, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetMeanPathDelay.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetMeanPathDelay.setDescription('This attribute is an implementation-specific representation of the current value of the mean propagation time between a master and slave clock as computed by the slave. Zero means that the path delay is unavailable.')
docsRphyPtpRpdPtpPortStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4), )
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusTable.setDescription('Port Ptp Status is an instantiation of the abstract class PtpPortStatus and inherits those common attributes')
docsRphyPtpRpdPtpPortStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1), ).setIndexNames((0, "DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusPortNumber"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex"))
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusEntry.setDescription('The conceptual row of docsRphyPtpRpdCorePtpPortStatusTable .')
docsRphyPtpRpdPtpPortStatusPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPortNumber.setDescription('This key attribute is the port number of the local clock port.')
docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex.setDescription('This key attribute is the port number of the local clock port.')
docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 3), Unsigned32())
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex.setDescription('This key attribute is the port number of the local clock port.')
docsRphyPtpRpdPtpPortStatusPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 4), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent for this clock port.')
docsRphyPtpRpdPtpPortStatusPacketsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 5), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received for this clock port.')
docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 6), TimeStamp()).setUnits('TimeTicks').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime.setDescription("This attribute represents the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpRpdPortMasterClockStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5), )
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusTable.setDescription('This table contains Port MasterClock Status attributes.')
docsRphyPtpRpdPortMasterClockStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1), ).setIndexNames((0, "DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusMasterPriority"))
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusEntry.setDescription('The conceptual row of docsRphyPtpRpdPortMasterClockStatusTable.')
docsRphyPtpRpdPortMasterClockStatusMasterPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 5)))
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterPriority.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterPriority.setDescription('This key attribute is the priority of the master clock configured for the PTP template assigned to this PTP clock port. Low numbers are higher priority.')
docsRphyPtpRpdPortMasterClockStatusPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 2), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent to this master for this slave clock port.')
docsRphyPtpRpdPortMasterClockStatusPacketsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 3), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received from this master for this slave clock port.')
docsRphyPtpRpdPortMasterClockStatusMasterClockId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterClockId.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterClockId.setDescription('This attribute specifies the clock identifier of this master clock.')
docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber.setDescription("This attribute specifies master clock's port number.")
docsRphyPtpRpdPortMasterClockStatusTwoStepFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 6), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusTwoStepFlag.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusTwoStepFlag.setDescription('This attribute specifies whether the Two Step process is used (i.e., the clock is a two-step clock).')
docsRphyPtpRpdPortMasterClockStatusIsBmc = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 7), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusIsBmc.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusIsBmc.setDescription('This attribute represents whether or not this master is the current Best Master Clock (i.e., the master clock currently in use for this slave clock).')
docsRphyPtpRpdPortMasterClockStatusIsMasterConnected = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 8), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusIsMasterConnected.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusIsMasterConnected.setDescription('This attribute is set to TRUE if a signaling session with the master is successfully established. When a slave node receives an announce and a sync message from the master, the CCAP Core SHOULD consider the session to be successfully established.')
docsRphyPtpRpdPortMasterClockStatusStatusDomain = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusStatusDomain.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusStatusDomain.setDescription('This attribute is the PTP master domain.')
docsRphyPtpRpdPortMasterClockStatusFreqOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 10), Unsigned32()).setUnits('PPM').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusFreqOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusFreqOffset.setDescription('This attribute specifies the frequency offset that the locking algorithm computed per master in the last 60 sec interval. 0xFFFFFFFF means offset unknown.')
docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 11), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime.setDescription("This attribute contains the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2, 1, 1)).setObjects(("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdGroup"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCoreGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
docsRphyPtpCompliance = docsRphyPtpCompliance.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCompliance.setDescription('The compliance statement for CCAP Core and RPD PTP features.')
docsRphyPtpRpdGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2, 2, 1)).setObjects(("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdCurrentDataSetStepsRemoved"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdCurrentDataSetOffsetFromMaster"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdCurrentDataSetMeanPathDelay"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusClockState"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusLastStateChange"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusComputedPhaseOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusCounterDiscontinuityTime"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortDataSetPortState"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortDataSetMeanPathDelay"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusMasterClockId"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusTwoStepFlag"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusIsBmc"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusIsMasterConnected"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusStatusDomain"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusFreqOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
docsRphyPtpRpdGroup = docsRphyPtpRpdGroup.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdGroup.setDescription('Group of objects implemented in CCAP Cores which represent RPD managed objects derived via the GCP protocol.')
docsRphyPtpCcapCoreGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2, 2, 2)).setObjects(("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetTwoStepFlag"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetClockIdentity"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetPriority1"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetPriority2"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetSlaveOnly"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetQualityClass"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetQualityAccuracy"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetQualityOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCurrentDataSetStepsRemoved"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCurrentDataSetOffsetFromMaster"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCurrentDataSetMeanPathDelay"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetParentClockId"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetParentPortNumber"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetParentStats"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetClockOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetPhaseChangeRate"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmClockIdentity"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmPriority1"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmPriority2"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmQualityClass"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmQualityAccuracy"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmQualityOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesCurrentUtcOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesLeap59"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesLeap61"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesTimeTraceable"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesFreqTraceable"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesPtpTimescale"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesTimeSource"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortDataSetPortState"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortDataSetMeanPathDelay"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusClockState"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusLastStateChange"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusComputedPhaseOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusCounterDiscontinuityTime"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCorePtpPortStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCorePtpPortStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusMasterClockId"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusTwoStepFlag"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusIsBmc"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusIsMasterConnected"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusStatusDomain"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusFreqOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
docsRphyPtpCcapCoreGroup = docsRphyPtpCcapCoreGroup.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCoreGroup.setDescription('Group of objects implemented in CCAP Cores.')
mibBuilder.exportSymbols("DOCS-RPHY-PTP-MIB", docsRphyPtpCcapCurrentDataSetStepsRemoved=docsRphyPtpCcapCurrentDataSetStepsRemoved, docsRphyPtpCcapPortMasterClockStatusTwoStepFlag=docsRphyPtpCcapPortMasterClockStatusTwoStepFlag, docsRphyPtpRpdPortMasterClockStatusMasterPriority=docsRphyPtpRpdPortMasterClockStatusMasterPriority, docsRphyPtpRpdMibObjects=docsRphyPtpRpdMibObjects, docsRphyPtpCcapDefaultDataSetQualityAccuracy=docsRphyPtpCcapDefaultDataSetQualityAccuracy, docsRphyPtpCompliances=docsRphyPtpCompliances, docsRphyPtpCcapClockStatusLastStateChange=docsRphyPtpCcapClockStatusLastStateChange, docsRphyPtpRpdCurrentDataSetMeanPathDelay=docsRphyPtpRpdCurrentDataSetMeanPathDelay, docsRphyPtpCcapParentDataSetGmPriority2=docsRphyPtpCcapParentDataSetGmPriority2, docsRphyPtpRpdPortMasterClockStatusStatusDomain=docsRphyPtpRpdPortMasterClockStatusStatusDomain, docsRphyPtpCcapTimePropertiesLeap59=docsRphyPtpCcapTimePropertiesLeap59, docsRphyPtpCcapTimePropertiesLeap61=docsRphyPtpCcapTimePropertiesLeap61, docsRphyPtpCcapClockStatus=docsRphyPtpCcapClockStatus, docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex=docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex, docsRphyPtpCcapClockStatusComputedPhaseOffset=docsRphyPtpCcapClockStatusComputedPhaseOffset, docsRphyPtpConformance=docsRphyPtpConformance, docsRphyPtpCcapCorePtpPortStatusPortNumber=docsRphyPtpCcapCorePtpPortStatusPortNumber, docsRphyPtpCcapCurrentDataSetOffsetFromMaster=docsRphyPtpCcapCurrentDataSetOffsetFromMaster, docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime=docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime, docsRphyPtpCcapParentDataSetParentStats=docsRphyPtpCcapParentDataSetParentStats, docsRphyPtpObjects=docsRphyPtpObjects, docsRphyPtpCcapDefaultDataSetQualityClass=docsRphyPtpCcapDefaultDataSetQualityClass, docsRphyPtpCcapDefaultDataSetQualityOffset=docsRphyPtpCcapDefaultDataSetQualityOffset, docsRphyPtpRpdPtpPortStatusPortNumber=docsRphyPtpRpdPtpPortStatusPortNumber, docsRphyPtpRpdPortMasterClockStatusTable=docsRphyPtpRpdPortMasterClockStatusTable, docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex=docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex, docsRphyPtpRpdClockStatusClockState=docsRphyPtpRpdClockStatusClockState, docsRphyPtpCcapPortMasterClockStatusMasterPriority=docsRphyPtpCcapPortMasterClockStatusMasterPriority, docsRphyPtpRpdPtpPortStatusPacketsReceived=docsRphyPtpRpdPtpPortStatusPacketsReceived, docsRphyPtpCcapPortMasterClockStatusFreqOffset=docsRphyPtpCcapPortMasterClockStatusFreqOffset, docsRphyPtpRpdCurrentDataSetOffsetFromMaster=docsRphyPtpRpdCurrentDataSetOffsetFromMaster, docsRphyPtpCcapPortMasterClockStatusIsMasterConnected=docsRphyPtpCcapPortMasterClockStatusIsMasterConnected, docsRphyPtpRpdClockStatusPacketsReceived=docsRphyPtpRpdClockStatusPacketsReceived, docsRphyPtpCcapParentDataSetClockOffset=docsRphyPtpCcapParentDataSetClockOffset, docsRphyPtpRpdPortMasterClockStatusIsBmc=docsRphyPtpRpdPortMasterClockStatusIsBmc, docsRphyPtpCompliance=docsRphyPtpCompliance, docsRphyPtpRpdPortDataSetPortNumber=docsRphyPtpRpdPortDataSetPortNumber, docsRphyPtpCcapParentDataSetParentClockId=docsRphyPtpCcapParentDataSetParentClockId, docsRphyPtpCcapClockStatusPacketsSent=docsRphyPtpCcapClockStatusPacketsSent, docsRphyPtpRpdClockStatusCounterDiscontinuityTime=docsRphyPtpRpdClockStatusCounterDiscontinuityTime, docsRphyPtpCcapPortMasterClockStatusIsBmc=docsRphyPtpCcapPortMasterClockStatusIsBmc, docsRphyPtpRpdClockStatusPacketsSent=docsRphyPtpRpdClockStatusPacketsSent, docsRphyPtpCcapParentDataSet=docsRphyPtpCcapParentDataSet, docsRphyPtpCcapCoreGroup=docsRphyPtpCcapCoreGroup, docsRphyPtpCcapPortDataSetTable=docsRphyPtpCcapPortDataSetTable, docsRphyPtpCcapTimePropertiesTimeSource=docsRphyPtpCcapTimePropertiesTimeSource, docsRphyPtpCcapCorePtpPortStatusPacketsReceived=docsRphyPtpCcapCorePtpPortStatusPacketsReceived, docsRphyPtpCcapParentDataSetParentPortNumber=docsRphyPtpCcapParentDataSetParentPortNumber, PYSNMP_MODULE_ID=docsRphyPtpMib, docsRphyPtpCcapTimePropertiesFreqTraceable=docsRphyPtpCcapTimePropertiesFreqTraceable, docsRphyPtpRpdPortMasterClockStatusMasterClockId=docsRphyPtpRpdPortMasterClockStatusMasterClockId, docsRphyPtpRpdClockStatusLastStateChange=docsRphyPtpRpdClockStatusLastStateChange, docsRphyPtpCcapPortMasterClockStatusPacketsSent=docsRphyPtpCcapPortMasterClockStatusPacketsSent, docsRphyPtpCcapDefaultDataSet=docsRphyPtpCcapDefaultDataSet, docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber=docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber, docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime=docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime, docsRphyPtpCcapDefaultDataSetPriority2=docsRphyPtpCcapDefaultDataSetPriority2, docsRphyPtpCcapPortMasterClockStatusTable=docsRphyPtpCcapPortMasterClockStatusTable, docsRphyPtpCcapCorePtpPortStatusEntry=docsRphyPtpCcapCorePtpPortStatusEntry, docsRphyPtpGroups=docsRphyPtpGroups, docsRphyPtpRpdPtpPortStatusTable=docsRphyPtpRpdPtpPortStatusTable, docsRphyPtpRpdPortMasterClockStatusFreqOffset=docsRphyPtpRpdPortMasterClockStatusFreqOffset, docsRphyPtpCcapCorePtpPortStatusPacketsSent=docsRphyPtpCcapCorePtpPortStatusPacketsSent, docsRphyPtpRpdPortDataSetEntry=docsRphyPtpRpdPortDataSetEntry, docsRphyPtpCcapPortMasterClockStatusPacketsReceived=docsRphyPtpCcapPortMasterClockStatusPacketsReceived, docsRphyPtpCcapCurrentDataSet=docsRphyPtpCcapCurrentDataSet, docsRphyPtpCcapDefaultDataSetTwoStepFlag=docsRphyPtpCcapDefaultDataSetTwoStepFlag, docsRphyPtpCcapMibObjects=docsRphyPtpCcapMibObjects, docsRphyPtpRpdPortMasterClockStatusTwoStepFlag=docsRphyPtpRpdPortMasterClockStatusTwoStepFlag, docsRphyPtpCcapParentDataSetGmQualityClass=docsRphyPtpCcapParentDataSetGmQualityClass, docsRphyPtpRpdClockStatusEntry=docsRphyPtpRpdClockStatusEntry, docsRphyPtpCcapCurrentDataSetMeanPathDelay=docsRphyPtpCcapCurrentDataSetMeanPathDelay, docsRphyPtpCcapClockStatusCounterDiscontinuityTime=docsRphyPtpCcapClockStatusCounterDiscontinuityTime, docsRphyPtpRpdPortDataSetPortState=docsRphyPtpRpdPortDataSetPortState, docsRphyPtpCcapParentDataSetGmPriority1=docsRphyPtpCcapParentDataSetGmPriority1, docsRphyPtpCcapTimeProperties=docsRphyPtpCcapTimeProperties, docsRphyPtpCcapParentDataSetGmQualityOffset=docsRphyPtpCcapParentDataSetGmQualityOffset, docsRphyPtpRpdCurrentDataSetEntry=docsRphyPtpRpdCurrentDataSetEntry, docsRphyPtpCcapParentDataSetGmClockIdentity=docsRphyPtpCcapParentDataSetGmClockIdentity, docsRphyPtpCcapPortDataSetMeanPathDelay=docsRphyPtpCcapPortDataSetMeanPathDelay, docsRphyPtpRpdPtpPortStatusEntry=docsRphyPtpRpdPtpPortStatusEntry, docsRphyPtpRpdPortDataSetMeanPathDelay=docsRphyPtpRpdPortDataSetMeanPathDelay, docsRphyPtpRpdPtpPortStatusPacketsSent=docsRphyPtpRpdPtpPortStatusPacketsSent, docsRphyPtpCcapTimePropertiesTimeTraceable=docsRphyPtpCcapTimePropertiesTimeTraceable, docsRphyPtpRpdCurrentDataSetTable=docsRphyPtpRpdCurrentDataSetTable, docsRphyPtpRpdPortMasterClockStatusIsMasterConnected=docsRphyPtpRpdPortMasterClockStatusIsMasterConnected, docsRphyPtpMib=docsRphyPtpMib, docsRphyPtpCcapPortMasterClockStatusMasterClockId=docsRphyPtpCcapPortMasterClockStatusMasterClockId, docsRphyPtpCcapPortMasterClockStatusEntry=docsRphyPtpCcapPortMasterClockStatusEntry, docsRphyPtpCcapClockStatusPacketsReceived=docsRphyPtpCcapClockStatusPacketsReceived, docsRphyPtpCcapTimePropertiesCurrentUtcOffset=docsRphyPtpCcapTimePropertiesCurrentUtcOffset, docsRphyPtpCcapPortDataSetPortState=docsRphyPtpCcapPortDataSetPortState, docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber=docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber, docsRphyPtpRpdCurrentDataSetStepsRemoved=docsRphyPtpRpdCurrentDataSetStepsRemoved, docsRphyPtpCcapTimePropertiesPtpTimescale=docsRphyPtpCcapTimePropertiesPtpTimescale, docsRphyPtpRpdClockStatusComputedPhaseOffset=docsRphyPtpRpdClockStatusComputedPhaseOffset, docsRphyPtpCcapParentDataSetGmQualityAccuracy=docsRphyPtpCcapParentDataSetGmQualityAccuracy, docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid=docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid, docsRphyPtpRpdPortDataSetTable=docsRphyPtpRpdPortDataSetTable, docsRphyPtpCcapDefaultDataSetPriority1=docsRphyPtpCcapDefaultDataSetPriority1, docsRphyPtpRpdPortMasterClockStatusEntry=docsRphyPtpRpdPortMasterClockStatusEntry, docsRphyPtpCcapParentDataSetPhaseChangeRate=docsRphyPtpCcapParentDataSetPhaseChangeRate, docsRphyPtpCcapCorePtpPortStatusTable=docsRphyPtpCcapCorePtpPortStatusTable, docsRphyPtpRpdPortMasterClockStatusPacketsReceived=docsRphyPtpRpdPortMasterClockStatusPacketsReceived, docsRphyPtpCcapDefaultDataSetClockIdentity=docsRphyPtpCcapDefaultDataSetClockIdentity, docsRphyPtpNotifications=docsRphyPtpNotifications, docsRphyPtpRpdPortMasterClockStatusPacketsSent=docsRphyPtpRpdPortMasterClockStatusPacketsSent, docsRphyPtpCcapClockStatusClockState=docsRphyPtpCcapClockStatusClockState, docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime=docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime, docsRphyPtpCcapPortDataSetEntry=docsRphyPtpCcapPortDataSetEntry, docsRphyPtpCcapPortDataSetPortNumber=docsRphyPtpCcapPortDataSetPortNumber, docsRphyPtpCcapPortMasterClockStatusStatusDomain=docsRphyPtpCcapPortMasterClockStatusStatusDomain, docsRphyPtpCcapDefaultDataSetSlaveOnly=docsRphyPtpCcapDefaultDataSetSlaveOnly, docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime=docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime, docsRphyPtpRpdGroup=docsRphyPtpRpdGroup, docsRphyPtpRpdClockStatusTable=docsRphyPtpRpdClockStatusTable)
|
# -*- coding: utf-8 -*-
# @Author: ZwEin
# @Date: 2016-07-08 13:48:24
# @Last Modified by: ZwEin
# @Last Modified time: 2016-07-08 13:48:34
def attr_func_state(attr_vals):
pass
|
# Domains list
DOMAINS = [
{ 'url': 'https://ifmo.su', 'message': '@guryn' }
]
# Notifications link from https://t.me/wbhkbot
WEBHOOK = ''
|
@state_trigger("sensor.power_meter != '9999'")
def load_optimizer(value=None):
pass
|
## Alphabet war
## 7 kyu
## https://www.codewars.com/kata/59377c53e66267c8f6000027
def alphabet_war(fight):
l = dict(zip('wpbs', range(4,0,-1)))
r = dict(zip('mqdz', range(4,0,-1)))
left, right = 0,0
for char in fight:
if char in l:
left += l[char]
elif char in r:
right += r[char]
if left > right:
return 'Left side wins!'
elif right > left:
return 'Right side wins!'
return "Let's fight again!"
|
"""Define routes."""
def includeme(config):
"""App routes."""
config.add_static_view(
'static',
'pyramid_learning_journal:static',
cache_max_age=3600
)
config.add_route('home', '/')
config.add_route('detail', '/journal/{id:\d+}')
config.add_route('new', '/journal/new-entry')
config.add_route('edit', '/journal/{id:\d+}/edit-entry')
config.add_route('delete', '/journal/{id:\d+}/delete-entry')
config.add_route('login', '/login')
config.add_route('logout', '/logout')
config.add_route('api', '/api')
|
class Solution:
# Codes (Accepted), O(n) time and space
def replaceDigits(self, s: str) -> str:
li, n = [], len(s)
for i in range(0, n, 2):
if i+1 < n:
code = ord(s[i]) + int(s[i+1])
li += [s[i], chr(code)]
else:
li.append(s[i])
return "".join(li)
# Straight Forward Codes (Top Voted), O(n) time and space
def replaceDigits(self, s: str) -> str:
a = list(s)
for i in range(1, len(a), 2):
a[i] = chr(ord(a[i - 1]) + int(a[i]))
return ''.join(a)
|
class SubmissionStatus(object):
SUBMITTED = -4
WAITING = -3
JUDGING = -2
WRONG_ANSWER = -1
ACCEPTED = 0
TIME_LIMIT_EXCEEDED = 1
IDLENESS_LIMIT_EXCEEDED = 2
MEMORY_LIMIT_EXCEEDED = 3
RUNTIME_ERROR = 4
SYSTEM_ERROR = 5
COMPILE_ERROR = 6
SCORED = 7
REJECTED = 10
JUDGE_ERROR = 11
PRETEST_PASSED = 12
@staticmethod
def is_judged(status):
return status >= SubmissionStatus.WRONG_ANSWER
@staticmethod
def is_penalty(status):
return SubmissionStatus.is_judged(status) and status != SubmissionStatus.COMPILE_ERROR
@staticmethod
def is_accepted(status):
return status == SubmissionStatus.ACCEPTED or status == SubmissionStatus.PRETEST_PASSED
@staticmethod
def is_scored(status):
return status == SubmissionStatus.SCORED
STATUS_CHOICE = (
(-4, 'Submitted'),
(-3, 'In queue'),
(-2, 'Running'),
(-1, 'Wrong answer'),
(0, 'Accepted'),
(1, 'Time limit exceeded'),
(2, 'Idleness limit exceeded'),
(3, 'Memory limit exceeded'),
(4, 'Runtime error'),
(5, 'Denial of judgement'),
(6, 'Compilation error'),
(7, 'Partial score'),
(10, 'Rejected'),
(11, 'Checker error'),
(12, 'Pretest passed'),
)
|
"""
Given a string str, we need to extract the symbols and words of the string in order.
Example 1:
input: str = "(hi (i am)bye)"
outut:["(","hi","(","i","am",")","bye",")"].
Explanation:Separate symbols and words.
Solution:
Go through the str, push the alphabetical into stack and append it to res list if we meet a non-alpha char.
"""
# Time: O(N), where N is the length of the input string
# Space: O(N) in the worst case as the string is full of alphabetical chars.
class Solution:
"""
@param str: The input string
@return: The answer
"""
def dataSegmentation(self, str):
# Write your code here
res = []
if len(str) == 0:
return res
tmp = ''
for i in range(len(str)):
if str[i].isalpha():
tmp += str[i]
else:
if len(tmp) > 0:
res.append(tmp)
tmp = ''
if str[i] != ' ':
res.append(str[i])
if len(tmp) > 0:
res.append(tmp)
return res
|
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 20 13:51:55 2019
@author: nehap
"""
"""
Input: 5
Output :
* * * * *
* * * *
* * *
* *
*
"""
if __name__=="__main__":
n = int(input("Input: "))
#Initial Spaces
k=n-1
print("Output :")
#Outer loop - controlling number of rows
for i in range(n, 0, -1):
#Inner loop - controlling spaces
for j in range(i, n, 1):
print(end=" ")
#Inner loop - prints stars
for j in range(0, i, 1):
print("*", end=" ")
k=k-1
print("\r")
|
def main():
c = input()
if c != c[::-1]: # -1 шаг строки: от конца к началу
print("It's not palindrome")
else:
print("It's palindrome")
if __name__ == "__main__":
main()
|
str1 = "Liu Kang "
str2 = "Johnny Cage "
str3 = "Scorpion "
str4 = "Sub-Zero "
str5 = "Sonya "
str6 = "Test yo might! "
print(str1 + str2 + str3 + str4 + str5 + str6)
print(str3 * 5)
print(str3 * (5 + 4))
print(str3 * 5 + "4")
today = "Tuesday"
# bool - in operator
print("day" in today)
print("scorpion" in today)
|
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Empresa: Funcao Coppetec
Desenvolvedor: Gustavo Daniel Soares Figueiredo
Data: 14/12/2014
Descricao: Classe criada para gerar os id dos objetos a serem adicionados no banco de dados, evitando assim mais requisições ao banco de dados.
'''
class GenerateID:
def __init__(self):
# Variável que armazena o último id das palavras
self.idWord = 0
# Variável que armazena o último id do mapeamento entre palavra de id
self.idwordHasTxt = 0
# Variável que armazena o último id dos títulos originais.
self.idSource = 0
# Variável que armazena o último id do radical a ser adicionado.
self.idStem = 0
def getIdWord(self):
return self.idWord
def getIdWordHasTxt(self):
return self.idwordHasTxt
def getIdSource(self):
return self.idSource
def getIdStem(self):
return self.idStem;
def incrementIdWord(self):
self.idWord = self.idWord + 1
def incrementIdWordHasTxt(self):
self.idwordHasTxt = self.idwordHasTxt + 1
def incrementIdSource(self):
self.idSource = self.idSource + 1
def incrementIdStem(self):
self.idStem = self.idStem + 1
|
# pylint: disable=missing-docstring
def stupid_function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9): # [too-many-arguments]
return arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.