content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
# -*- coding: utf-8 -*-
description = 'GALAXI motors'
group = 'optional'
tango_base = 'tango://phys.galaxi.kfa-juelich.de:10000/galaxi/'
s7_motor = tango_base + 's7_motor/'
devices = dict(
detz = device('nicos.devices.entangle.MotorAxis',
description = 'Detector Z axis',
tangodevice = s7_motor + 'detz',
precision = 0.01,
),
detx = device('nicos.devices.entangle.MotorAxis',
description = 'Detector X axis',
tangodevice = s7_motor + 'detx',
offset = 0,
precision = 0.01,
fixed = 'Do not move until hardware is in save state',
fixedby = ('admin', 20),
lowlevel = True,
),
bssy = device('nicos.devices.entangle.MotorAxis',
description = 'BSSY axis',
tangodevice = s7_motor + 'bssy',
offset = 0,
precision = 0.01,
),
bspz = device('nicos.devices.entangle.MotorAxis',
description = 'BSPZ axis',
tangodevice = s7_motor + 'bspz',
offset = 0,
precision = 0.01,
),
bspy = device('nicos.devices.entangle.MotorAxis',
description = 'BSPY axis',
tangodevice = s7_motor + 'bspy',
offset = 0,
precision = 0.01,
),
pchi = device('nicos.devices.entangle.MotorAxis',
description = 'PCHI axis',
tangodevice = s7_motor + 'pchi',
offset = 0,
precision = 0.001,
),
pom = device('nicos.devices.entangle.MotorAxis',
description = 'POM axis',
tangodevice = s7_motor + 'pom',
offset = 0,
precision = 0.001,
),
pz = device('nicos.devices.entangle.MotorAxis',
description = 'PZ axis',
tangodevice = s7_motor + 'pz',
offset = 0,
precision = 0.01,
),
py = device('nicos.devices.entangle.MotorAxis',
description = 'PY axis',
tangodevice = s7_motor + 'py',
offset = 0,
precision = 0.01,
),
prefz = device('nicos.devices.entangle.MotorAxis',
description = 'PRefZ axis',
tangodevice = s7_motor + 'prefz',
offset = 0,
precision = 0.01,
),
)
| description = 'GALAXI motors'
group = 'optional'
tango_base = 'tango://phys.galaxi.kfa-juelich.de:10000/galaxi/'
s7_motor = tango_base + 's7_motor/'
devices = dict(detz=device('nicos.devices.entangle.MotorAxis', description='Detector Z axis', tangodevice=s7_motor + 'detz', precision=0.01), detx=device('nicos.devices.entangle.MotorAxis', description='Detector X axis', tangodevice=s7_motor + 'detx', offset=0, precision=0.01, fixed='Do not move until hardware is in save state', fixedby=('admin', 20), lowlevel=True), bssy=device('nicos.devices.entangle.MotorAxis', description='BSSY axis', tangodevice=s7_motor + 'bssy', offset=0, precision=0.01), bspz=device('nicos.devices.entangle.MotorAxis', description='BSPZ axis', tangodevice=s7_motor + 'bspz', offset=0, precision=0.01), bspy=device('nicos.devices.entangle.MotorAxis', description='BSPY axis', tangodevice=s7_motor + 'bspy', offset=0, precision=0.01), pchi=device('nicos.devices.entangle.MotorAxis', description='PCHI axis', tangodevice=s7_motor + 'pchi', offset=0, precision=0.001), pom=device('nicos.devices.entangle.MotorAxis', description='POM axis', tangodevice=s7_motor + 'pom', offset=0, precision=0.001), pz=device('nicos.devices.entangle.MotorAxis', description='PZ axis', tangodevice=s7_motor + 'pz', offset=0, precision=0.01), py=device('nicos.devices.entangle.MotorAxis', description='PY axis', tangodevice=s7_motor + 'py', offset=0, precision=0.01), prefz=device('nicos.devices.entangle.MotorAxis', description='PRefZ axis', tangodevice=s7_motor + 'prefz', offset=0, precision=0.01)) |
class Solution:
def majorityElement(self, nums: List[int]) -> int:
a=int(len(nums)/2)
b=list(set(nums))
for x in b:
if nums.count(x)>a:
return x
| class Solution:
def majority_element(self, nums: List[int]) -> int:
a = int(len(nums) / 2)
b = list(set(nums))
for x in b:
if nums.count(x) > a:
return x |
DEPOSIT_TYPE = 'deposit'
WITHDRAW_TYPE = 'withdraw'
TRANSFER_TYPE = 'transfer'
S3_SERVICE = 's3'
AWS_REGION = 'us-east-1'
| deposit_type = 'deposit'
withdraw_type = 'withdraw'
transfer_type = 'transfer'
s3_service = 's3'
aws_region = 'us-east-1' |
# Time: O(n) | Space: O(1)
def validateSubsequence(array, sequence):
seqIdx = 0
arrIdx = 0
while arrIdx < len(array) and seqIdx < len(sequence):
if array[arrIdx] == sequence[seqIdx]:
seqIdx += 1
arrIdx += 1
return seqIdx == len(sequence)
# Time: O(n) | Space: O(1)
def validateSubsequence2(array, sequence):
seqIdx = 0
for value in array:
if seqIdx == len(sequence):
return True
if sequence[seqIdx] == value:
seqIdx += 1
return seqIdx == len(sequence)
print(validateSubsequence2([5, 1, 22, 25, 6, -1, 8, 10], [1, 6, -1, 10])) | def validate_subsequence(array, sequence):
seq_idx = 0
arr_idx = 0
while arrIdx < len(array) and seqIdx < len(sequence):
if array[arrIdx] == sequence[seqIdx]:
seq_idx += 1
arr_idx += 1
return seqIdx == len(sequence)
def validate_subsequence2(array, sequence):
seq_idx = 0
for value in array:
if seqIdx == len(sequence):
return True
if sequence[seqIdx] == value:
seq_idx += 1
return seqIdx == len(sequence)
print(validate_subsequence2([5, 1, 22, 25, 6, -1, 8, 10], [1, 6, -1, 10])) |
# 1.1 Is Unique:
# Implement an algorithm to determine if a string has all unique characters.
# What if you cannot use additional data structures?
# O(n)
# Assuming ASCII - American Standard Code for Information Interchange
def isUniqueChars(string):
if len(string) > 128:
return False
char_set = [False for _ in range(128)]
for char in string:
val = ord(char) # Return an integer representing the Unicode
if char_set[val]:
# Char already found in the string
return False
char_set[val] = True
return True
# We can reduce our space usage by a factor of eight by using a bit vector.
# We will assume, in the below code,that the string only uses the lowercase letters a through
def InUnique(string):
checker = 0
for char in string:
val = ord(char) - ord('a')
if (checker & (1 << val)) < 0:
return False
checker |= 1 << val
return True
if __name__ == '__main__':
string = 'abcd'
test_one = isUniqueChars(string)
test_two = InUnique(string)
print(test_one)
print(test_two)
| def is_unique_chars(string):
if len(string) > 128:
return False
char_set = [False for _ in range(128)]
for char in string:
val = ord(char)
if char_set[val]:
return False
char_set[val] = True
return True
def in_unique(string):
checker = 0
for char in string:
val = ord(char) - ord('a')
if checker & 1 << val < 0:
return False
checker |= 1 << val
return True
if __name__ == '__main__':
string = 'abcd'
test_one = is_unique_chars(string)
test_two = in_unique(string)
print(test_one)
print(test_two) |
#
# PySNMP MIB module Sentry3-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Sentry3-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:07:04 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, NotificationType, Gauge32, ModuleIdentity, enterprises, Counter64, ObjectIdentity, TimeTicks, Unsigned32, Integer32, IpAddress, Counter32, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "NotificationType", "Gauge32", "ModuleIdentity", "enterprises", "Counter64", "ObjectIdentity", "TimeTicks", "Unsigned32", "Integer32", "IpAddress", "Counter32", "Bits")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
sentry3 = ModuleIdentity((1, 3, 6, 1, 4, 1, 1718, 3))
sentry3.setRevisions(('2016-01-25 16:30', '2014-06-25 12:00', '2014-01-16 18:00', '2013-11-25 09:00', '2013-09-16 10:00', '2013-02-14 09:30', '2012-11-07 14:00', '2012-04-18 14:00', '2012-01-04 11:00', '2011-07-11 16:40', '2011-06-15 13:00', '2011-05-05 11:00', '2010-07-07 12:15', '2009-03-10 16:00', '2008-05-07 15:20', '2007-07-09 14:45', '2007-01-09 14:10', '2006-07-20 12:00', '2006-06-12 09:30', '2005-07-27 11:05', '2005-02-18 11:45', '2005-01-07 12:20', '2004-12-09 13:20', '2004-11-11 12:00', '2003-11-20 13:00', '2003-10-23 19:00', '2003-10-02 11:00', '2003-08-27 16:00', '2003-03-28 17:00', '2003-03-27 17:00',))
if mibBuilder.loadTexts: sentry3.setLastUpdated('201601251630Z')
if mibBuilder.loadTexts: sentry3.setOrganization('Server Technology, Inc.')
serverTech = MibIdentifier((1, 3, 6, 1, 4, 1, 1718))
systemGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 1718, 3, 1))
systemVersion = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: systemVersion.setStatus('current')
systemNICSerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 8))).setMaxAccess("readonly")
if mibBuilder.loadTexts: systemNICSerialNumber.setStatus('current')
systemLocation = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: systemLocation.setStatus('current')
systemTowerCount = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: systemTowerCount.setStatus('current')
systemEnvMonCount = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: systemEnvMonCount.setStatus('current')
systemTotalPower = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 150000))).setUnits('Watts').setMaxAccess("readonly")
if mibBuilder.loadTexts: systemTotalPower.setStatus('current')
systemArea = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setUnits('tenth area units').setMaxAccess("readwrite")
if mibBuilder.loadTexts: systemArea.setStatus('current')
systemWattsPerAreaUnit = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1500000))).setUnits('Watts per area unit').setMaxAccess("readonly")
if mibBuilder.loadTexts: systemWattsPerAreaUnit.setStatus('current')
systemAreaUnit = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("squareMeter", 0), ("squareFoot", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: systemAreaUnit.setStatus('current')
systemPowerFactor = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(50, 100))).setUnits('hundredths').setMaxAccess("readwrite")
if mibBuilder.loadTexts: systemPowerFactor.setStatus('current')
systemFeatures = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 11), Bits().clone(namedValues=NamedValues(("smartLoadShedding", 0), ("snmpPOPS", 1), ("outletControlInhibit", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: systemFeatures.setStatus('current')
systemFeatureKey = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 19))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: systemFeatureKey.setStatus('current')
systemOutletSeqInterval = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: systemOutletSeqInterval.setStatus('current')
systemOutletRebootDelay = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(5, 600))).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: systemOutletRebootDelay.setStatus('current')
systemConfigModifiedCount = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: systemConfigModifiedCount.setStatus('current')
systemTables = MibIdentifier((1, 3, 6, 1, 4, 1, 1718, 3, 2))
towerTable = MibTable((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1), )
if mibBuilder.loadTexts: towerTable.setStatus('current')
towerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1), ).setIndexNames((0, "Sentry3-MIB", "towerIndex"))
if mibBuilder.loadTexts: towerEntry.setStatus('current')
towerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4)))
if mibBuilder.loadTexts: towerIndex.setStatus('current')
towerID = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readonly")
if mibBuilder.loadTexts: towerID.setStatus('current')
towerName = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: towerName.setStatus('current')
towerStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("normal", 0), ("noComm", 1), ("fanFail", 2), ("overTemp", 3), ("nvmFail", 4), ("outOfBalance", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: towerStatus.setStatus('current')
towerInfeedCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: towerInfeedCount.setStatus('current')
towerProductSN = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: towerProductSN.setStatus('current')
towerModelNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readonly")
if mibBuilder.loadTexts: towerModelNumber.setStatus('current')
towerCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 8), Bits().clone(namedValues=NamedValues(("failSafe", 0), ("fuseSense", 1), ("directCurrent", 2), ("threePhase", 3), ("fanSense", 4), ("tempSense", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: towerCapabilities.setStatus('current')
towerVACapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 50000))).setUnits('Volt-Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: towerVACapacity.setStatus('current')
towerVACapacityUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1500))).setUnits('tenth percentage').setMaxAccess("readonly")
if mibBuilder.loadTexts: towerVACapacityUsed.setStatus('current')
towerActivePower = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 50000))).setUnits('Watts').setMaxAccess("readonly")
if mibBuilder.loadTexts: towerActivePower.setStatus('current')
towerApparentPower = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 50000))).setUnits('Volt-Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: towerApparentPower.setStatus('current')
towerPowerFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100))).setUnits('hundredths').setMaxAccess("readonly")
if mibBuilder.loadTexts: towerPowerFactor.setStatus('current')
towerEnergy = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2147483647))).setUnits('Kilowatt-Hours').setMaxAccess("readonly")
if mibBuilder.loadTexts: towerEnergy.setStatus('current')
towerLineFrequency = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 60))).setUnits('Hertz').setMaxAccess("readonly")
if mibBuilder.loadTexts: towerLineFrequency.setStatus('current')
infeedTable = MibTable((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2), )
if mibBuilder.loadTexts: infeedTable.setStatus('current')
infeedEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1), ).setIndexNames((0, "Sentry3-MIB", "towerIndex"), (0, "Sentry3-MIB", "infeedIndex"))
if mibBuilder.loadTexts: infeedEntry.setStatus('current')
infeedIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4)))
if mibBuilder.loadTexts: infeedIndex.setStatus('current')
infeedID = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedID.setStatus('current')
infeedName = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: infeedName.setStatus('current')
infeedCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 4), Bits().clone(namedValues=NamedValues(("onSense", 0), ("loadSense", 1), ("powerControl", 2), ("failSafe", 3), ("defaultOff", 4), ("voltageSense", 5), ("powerSense", 6), ("branchOnSense", 7), ("branchLoadSense", 8)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedCapabilities.setStatus('current')
infeedStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("off", 0), ("on", 1), ("offWait", 2), ("onWait", 3), ("offError", 4), ("onError", 5), ("noComm", 6), ("reading", 7), ("offFuse", 8), ("onFuse", 9)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedStatus.setStatus('current')
infeedLoadStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("normal", 0), ("notOn", 1), ("reading", 2), ("loadLow", 3), ("loadHigh", 4), ("overLoad", 5), ("readError", 6), ("noComm", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedLoadStatus.setStatus('current')
infeedLoadValue = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 60000))).setUnits('hundredth Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedLoadValue.setStatus('current')
infeedLoadHighThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 600))).setUnits('Amps').setMaxAccess("readwrite")
if mibBuilder.loadTexts: infeedLoadHighThresh.setStatus('current')
infeedOutletCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedOutletCount.setStatus('current')
infeedCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 600))).setUnits('Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedCapacity.setStatus('current')
infeedVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 4800))).setUnits('tenth Volts').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedVoltage.setStatus('current')
infeedPower = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 25000))).setUnits('Watts').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedPower.setStatus('current')
infeedApparentPower = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 25000))).setUnits('Volt-Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedApparentPower.setStatus('current')
infeedPowerFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100))).setUnits('hundredths').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedPowerFactor.setStatus('current')
infeedCrestFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1000))).setUnits('tenths').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedCrestFactor.setStatus('current')
infeedEnergy = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2147483647))).setUnits('tenth Kilowatt-Hours').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedEnergy.setStatus('current')
infeedReactance = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("unknown", 0), ("capacitive", 1), ("inductive", 2), ("resistive", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedReactance.setStatus('current')
infeedPhaseVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2640))).setUnits('tenth Volts').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedPhaseVoltage.setStatus('current')
infeedPhaseCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 25500))).setUnits('hundredth Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedPhaseCurrent.setStatus('current')
infeedCapacityUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1500))).setUnits('tenth percentage').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedCapacityUsed.setStatus('current')
infeedLineID = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 21), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedLineID.setStatus('current')
infeedLineToLineID = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 22), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedLineToLineID.setStatus('current')
infeedPhaseID = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 23), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 6))).setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedPhaseID.setStatus('current')
infeedVACapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 24), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 25000))).setUnits('Volt-Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedVACapacity.setStatus('current')
infeedVACapacityUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 25), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1500))).setUnits('tenth percentage').setMaxAccess("readonly")
if mibBuilder.loadTexts: infeedVACapacityUsed.setStatus('current')
outletTable = MibTable((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3), )
if mibBuilder.loadTexts: outletTable.setStatus('current')
outletEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1), ).setIndexNames((0, "Sentry3-MIB", "towerIndex"), (0, "Sentry3-MIB", "infeedIndex"), (0, "Sentry3-MIB", "outletIndex"))
if mibBuilder.loadTexts: outletEntry.setStatus('current')
outletIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64)))
if mibBuilder.loadTexts: outletIndex.setStatus('current')
outletID = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(2, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: outletID.setStatus('current')
outletName = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: outletName.setStatus('current')
outletCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 4), Bits().clone(namedValues=NamedValues(("onSense", 0), ("loadSense", 1), ("powerControl", 2), ("shutdown", 3), ("defaultOn", 4), ("ownInfeed", 5), ("fusedBranch", 6), ("voltageSense", 7), ("powerSense", 8)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: outletCapabilities.setStatus('current')
outletStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("off", 0), ("on", 1), ("offWait", 2), ("onWait", 3), ("offError", 4), ("onError", 5), ("noComm", 6), ("reading", 7), ("offFuse", 8), ("onFuse", 9)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: outletStatus.setStatus('current')
outletLoadStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("normal", 0), ("notOn", 1), ("reading", 2), ("loadLow", 3), ("loadHigh", 4), ("overLoad", 5), ("readError", 6), ("noComm", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: outletLoadStatus.setStatus('current')
outletLoadValue = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 25500))).setUnits('hundredth Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: outletLoadValue.setStatus('current')
outletLoadLowThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setUnits('Amps').setMaxAccess("readwrite")
if mibBuilder.loadTexts: outletLoadLowThresh.setStatus('current')
outletLoadHighThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setUnits('Amps').setMaxAccess("readwrite")
if mibBuilder.loadTexts: outletLoadHighThresh.setStatus('current')
outletControlState = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17))).clone(namedValues=NamedValues(("idleOff", 0), ("idleOn", 1), ("wakeOff", 2), ("wakeOn", 3), ("off", 4), ("on", 5), ("lockedOff", 6), ("lockedOn", 7), ("reboot", 8), ("shutdown", 9), ("pendOn", 10), ("pendOff", 11), ("minimumOff", 12), ("minimumOn", 13), ("eventOff", 14), ("eventOn", 15), ("eventReboot", 16), ("eventShutdown", 17)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: outletControlState.setStatus('current')
outletControlAction = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("on", 1), ("off", 2), ("reboot", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: outletControlAction.setStatus('current')
outletCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255))).setUnits('Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: outletCapacity.setStatus('current')
outletVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2640))).setUnits('tenth Volts').setMaxAccess("readonly")
if mibBuilder.loadTexts: outletVoltage.setStatus('current')
outletPower = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 10000))).setUnits('Watts').setMaxAccess("readonly")
if mibBuilder.loadTexts: outletPower.setStatus('current')
outletApparentPower = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 10000))).setUnits('Volt-Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: outletApparentPower.setStatus('current')
outletPowerFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100))).setUnits('hundredths').setMaxAccess("readonly")
if mibBuilder.loadTexts: outletPowerFactor.setStatus('current')
outletCrestFactor = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1000))).setUnits('tenths').setMaxAccess("readonly")
if mibBuilder.loadTexts: outletCrestFactor.setStatus('current')
outletEnergy = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2147483647))).setUnits('Watt-Hours').setMaxAccess("readonly")
if mibBuilder.loadTexts: outletEnergy.setStatus('current')
outletWakeupState = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("last", 1), ("off", 2), ("on", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: outletWakeupState.setStatus('current')
outletPostOnDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 900))).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: outletPostOnDelay.setStatus('current')
envMonTable = MibTable((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4), )
if mibBuilder.loadTexts: envMonTable.setStatus('current')
envMonEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1), ).setIndexNames((0, "Sentry3-MIB", "envMonIndex"))
if mibBuilder.loadTexts: envMonEntry.setStatus('current')
envMonIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4)))
if mibBuilder.loadTexts: envMonIndex.setStatus('current')
envMonID = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readonly")
if mibBuilder.loadTexts: envMonID.setStatus('current')
envMonName = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: envMonName.setStatus('current')
envMonStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("normal", 0), ("noComm", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: envMonStatus.setStatus('current')
envMonWaterSensorName = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: envMonWaterSensorName.setStatus('current')
envMonWaterSensorStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("normal", 0), ("alarm", 1), ("noComm", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: envMonWaterSensorStatus.setStatus('current')
envMonADCName = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: envMonADCName.setStatus('current')
envMonADCStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("normal", 0), ("reading", 1), ("countLow", 2), ("countHigh", 3), ("readError", 4), ("noComm", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: envMonADCStatus.setStatus('current')
envMonADCCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: envMonADCCount.setStatus('current')
envMonADCLowThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: envMonADCLowThresh.setStatus('current')
envMonADCHighThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: envMonADCHighThresh.setStatus('current')
envMonTempHumidSensorCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2))).setMaxAccess("readonly")
if mibBuilder.loadTexts: envMonTempHumidSensorCount.setStatus('current')
envMonContactClosureCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: envMonContactClosureCount.setStatus('current')
tempHumidSensorTable = MibTable((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5), )
if mibBuilder.loadTexts: tempHumidSensorTable.setStatus('current')
tempHumidSensorEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1), ).setIndexNames((0, "Sentry3-MIB", "envMonIndex"), (0, "Sentry3-MIB", "tempHumidSensorIndex"))
if mibBuilder.loadTexts: tempHumidSensorEntry.setStatus('current')
tempHumidSensorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2)))
if mibBuilder.loadTexts: tempHumidSensorIndex.setStatus('current')
tempHumidSensorID = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readonly")
if mibBuilder.loadTexts: tempHumidSensorID.setStatus('current')
tempHumidSensorName = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: tempHumidSensorName.setStatus('current')
tempHumidSensorStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("found", 0), ("notFound", 1), ("lost", 2), ("noComm", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: tempHumidSensorStatus.setStatus('current')
tempHumidSensorTempStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("normal", 0), ("notFound", 1), ("reading", 2), ("tempLow", 3), ("tempHigh", 4), ("readError", 5), ("lost", 6), ("noComm", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: tempHumidSensorTempStatus.setStatus('current')
tempHumidSensorTempValue = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2540))).setUnits('tenth degrees').setMaxAccess("readonly")
if mibBuilder.loadTexts: tempHumidSensorTempValue.setStatus('current')
tempHumidSensorTempLowThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 254))).setUnits('degrees').setMaxAccess("readwrite")
if mibBuilder.loadTexts: tempHumidSensorTempLowThresh.setStatus('current')
tempHumidSensorTempHighThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 254))).setUnits('degrees').setMaxAccess("readwrite")
if mibBuilder.loadTexts: tempHumidSensorTempHighThresh.setStatus('current')
tempHumidSensorHumidStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("normal", 0), ("notFound", 1), ("reading", 2), ("humidLow", 3), ("humidHigh", 4), ("readError", 5), ("lost", 6), ("noComm", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: tempHumidSensorHumidStatus.setStatus('current')
tempHumidSensorHumidValue = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 100))).setUnits('percentage relative humidity').setMaxAccess("readonly")
if mibBuilder.loadTexts: tempHumidSensorHumidValue.setStatus('current')
tempHumidSensorHumidLowThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percentage relative humidity').setMaxAccess("readwrite")
if mibBuilder.loadTexts: tempHumidSensorHumidLowThresh.setStatus('current')
tempHumidSensorHumidHighThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percentage relative humidity').setMaxAccess("readwrite")
if mibBuilder.loadTexts: tempHumidSensorHumidHighThresh.setStatus('current')
tempHumidSensorTempScale = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("celsius", 0), ("fahrenheit", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: tempHumidSensorTempScale.setStatus('current')
tempHumidSensorTempRecDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 54))).setUnits('degrees').setMaxAccess("readwrite")
if mibBuilder.loadTexts: tempHumidSensorTempRecDelta.setStatus('current')
tempHumidSensorHumidRecDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 20))).setUnits('percentage relative humidity').setMaxAccess("readwrite")
if mibBuilder.loadTexts: tempHumidSensorHumidRecDelta.setStatus('current')
contactClosureTable = MibTable((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6), )
if mibBuilder.loadTexts: contactClosureTable.setStatus('current')
contactClosureEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6, 1), ).setIndexNames((0, "Sentry3-MIB", "envMonIndex"), (0, "Sentry3-MIB", "contactClosureIndex"))
if mibBuilder.loadTexts: contactClosureEntry.setStatus('current')
contactClosureIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4)))
if mibBuilder.loadTexts: contactClosureIndex.setStatus('current')
contactClosureID = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readonly")
if mibBuilder.loadTexts: contactClosureID.setStatus('current')
contactClosureName = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: contactClosureName.setStatus('current')
contactClosureStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("normal", 0), ("alarm", 1), ("noComm", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: contactClosureStatus.setStatus('current')
branchTable = MibTable((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7), )
if mibBuilder.loadTexts: branchTable.setStatus('current')
branchEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1), ).setIndexNames((0, "Sentry3-MIB", "towerIndex"), (0, "Sentry3-MIB", "infeedIndex"), (0, "Sentry3-MIB", "branchIndex"))
if mibBuilder.loadTexts: branchEntry.setStatus('current')
branchIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4)))
if mibBuilder.loadTexts: branchIndex.setStatus('current')
branchID = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(3, 3)).setFixedLength(3)).setMaxAccess("readonly")
if mibBuilder.loadTexts: branchID.setStatus('current')
branchName = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: branchName.setStatus('current')
branchCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 4), Bits().clone(namedValues=NamedValues(("onSense", 0), ("loadSense", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: branchCapabilities.setStatus('current')
branchStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("off", 0), ("on", 1), ("offWait", 2), ("onWait", 3), ("offError", 4), ("onError", 5), ("noComm", 6), ("reading", 7), ("offFuse", 8), ("onFuse", 9)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: branchStatus.setStatus('current')
branchLoadStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("normal", 0), ("notOn", 1), ("reading", 2), ("loadLow", 3), ("loadHigh", 4), ("overLoad", 5), ("readError", 6), ("noComm", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: branchLoadStatus.setStatus('current')
branchLoadValue = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 4000))).setUnits('hundredth Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: branchLoadValue.setStatus('current')
branchLoadHighThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 40))).setUnits('Amps').setMaxAccess("readwrite")
if mibBuilder.loadTexts: branchLoadHighThresh.setStatus('current')
branchCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 40))).setUnits('Amps').setMaxAccess("readonly")
if mibBuilder.loadTexts: branchCapacity.setStatus('current')
eventInformationGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 1718, 3, 99))
eventStatusText = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 99, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readonly")
if mibBuilder.loadTexts: eventStatusText.setStatus('current')
eventStatusCondition = MibScalar((1, 3, 6, 1, 4, 1, 1718, 3, 99, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("nonError", 0), ("error", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: eventStatusCondition.setStatus('current')
sentry3Traps = MibIdentifier((1, 3, 6, 1, 4, 1, 1718, 3, 100))
events = MibIdentifier((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0))
towerStatusEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 1)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "towerID"), ("Sentry3-MIB", "towerName"), ("Sentry3-MIB", "towerStatus"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: towerStatusEvent.setStatus('current')
infeedStatusEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 2)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "infeedID"), ("Sentry3-MIB", "infeedName"), ("Sentry3-MIB", "infeedStatus"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: infeedStatusEvent.setStatus('current')
infeedLoadEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 3)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "infeedID"), ("Sentry3-MIB", "infeedName"), ("Sentry3-MIB", "infeedLoadStatus"), ("Sentry3-MIB", "infeedLoadValue"), ("Sentry3-MIB", "infeedLoadHighThresh"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: infeedLoadEvent.setStatus('current')
outletStatusEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 4)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "outletID"), ("Sentry3-MIB", "outletName"), ("Sentry3-MIB", "outletStatus"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: outletStatusEvent.setStatus('current')
outletLoadEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 5)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "outletID"), ("Sentry3-MIB", "outletName"), ("Sentry3-MIB", "outletLoadStatus"), ("Sentry3-MIB", "outletLoadValue"), ("Sentry3-MIB", "outletLoadLowThresh"), ("Sentry3-MIB", "outletLoadHighThresh"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: outletLoadEvent.setStatus('current')
outletChangeEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 6)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "outletID"), ("Sentry3-MIB", "outletName"), ("Sentry3-MIB", "outletStatus"), ("Sentry3-MIB", "outletControlState"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: outletChangeEvent.setStatus('current')
envMonStatusEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 7)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "envMonID"), ("Sentry3-MIB", "envMonName"), ("Sentry3-MIB", "envMonStatus"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: envMonStatusEvent.setStatus('current')
envMonWaterSensorEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 8)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "envMonID"), ("Sentry3-MIB", "envMonWaterSensorName"), ("Sentry3-MIB", "envMonWaterSensorStatus"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: envMonWaterSensorEvent.setStatus('current')
envMonADCEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 9)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "envMonID"), ("Sentry3-MIB", "envMonADCName"), ("Sentry3-MIB", "envMonADCStatus"), ("Sentry3-MIB", "envMonADCCount"), ("Sentry3-MIB", "envMonADCLowThresh"), ("Sentry3-MIB", "envMonADCHighThresh"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: envMonADCEvent.setStatus('current')
tempHumidSensorStatusEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 10)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "tempHumidSensorID"), ("Sentry3-MIB", "tempHumidSensorName"), ("Sentry3-MIB", "tempHumidSensorStatus"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: tempHumidSensorStatusEvent.setStatus('current')
tempHumidSensorTempEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 11)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "tempHumidSensorID"), ("Sentry3-MIB", "tempHumidSensorName"), ("Sentry3-MIB", "tempHumidSensorTempStatus"), ("Sentry3-MIB", "tempHumidSensorTempValue"), ("Sentry3-MIB", "tempHumidSensorTempLowThresh"), ("Sentry3-MIB", "tempHumidSensorTempHighThresh"), ("Sentry3-MIB", "tempHumidSensorTempScale"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: tempHumidSensorTempEvent.setStatus('current')
tempHumidSensorHumidEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 12)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "tempHumidSensorID"), ("Sentry3-MIB", "tempHumidSensorName"), ("Sentry3-MIB", "tempHumidSensorHumidStatus"), ("Sentry3-MIB", "tempHumidSensorHumidValue"), ("Sentry3-MIB", "tempHumidSensorHumidLowThresh"), ("Sentry3-MIB", "tempHumidSensorHumidHighThresh"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: tempHumidSensorHumidEvent.setStatus('current')
contactClosureEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 13)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "contactClosureID"), ("Sentry3-MIB", "contactClosureName"), ("Sentry3-MIB", "contactClosureStatus"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: contactClosureEvent.setStatus('current')
branchStatusEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 14)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "branchID"), ("Sentry3-MIB", "branchName"), ("Sentry3-MIB", "branchStatus"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: branchStatusEvent.setStatus('current')
branchLoadEvent = NotificationType((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 15)).setObjects(("Sentry3-MIB", "systemLocation"), ("Sentry3-MIB", "branchID"), ("Sentry3-MIB", "branchName"), ("Sentry3-MIB", "branchLoadStatus"), ("Sentry3-MIB", "branchLoadValue"), ("Sentry3-MIB", "branchLoadHighThresh"), ("Sentry3-MIB", "eventStatusText"), ("Sentry3-MIB", "eventStatusCondition"))
if mibBuilder.loadTexts: branchLoadEvent.setStatus('current')
mibBuilder.exportSymbols("Sentry3-MIB", infeedIndex=infeedIndex, infeedID=infeedID, infeedLoadValue=infeedLoadValue, envMonName=envMonName, infeedName=infeedName, systemFeatureKey=systemFeatureKey, branchCapacity=branchCapacity, infeedPhaseID=infeedPhaseID, contactClosureName=contactClosureName, envMonTempHumidSensorCount=envMonTempHumidSensorCount, branchStatus=branchStatus, infeedLoadStatus=infeedLoadStatus, envMonADCEvent=envMonADCEvent, systemOutletSeqInterval=systemOutletSeqInterval, systemOutletRebootDelay=systemOutletRebootDelay, branchCapabilities=branchCapabilities, tempHumidSensorHumidHighThresh=tempHumidSensorHumidHighThresh, infeedLineID=infeedLineID, towerStatus=towerStatus, outletPower=outletPower, branchStatusEvent=branchStatusEvent, systemArea=systemArea, branchName=branchName, towerTable=towerTable, infeedPhaseCurrent=infeedPhaseCurrent, outletWakeupState=outletWakeupState, eventInformationGroup=eventInformationGroup, systemNICSerialNumber=systemNICSerialNumber, towerProductSN=towerProductSN, tempHumidSensorTempStatus=tempHumidSensorTempStatus, systemAreaUnit=systemAreaUnit, outletIndex=outletIndex, envMonWaterSensorEvent=envMonWaterSensorEvent, outletLoadStatus=outletLoadStatus, tempHumidSensorName=tempHumidSensorName, tempHumidSensorTempScale=tempHumidSensorTempScale, towerStatusEvent=towerStatusEvent, outletPowerFactor=outletPowerFactor, infeedPowerFactor=infeedPowerFactor, towerID=towerID, towerVACapacityUsed=towerVACapacityUsed, outletEntry=outletEntry, systemVersion=systemVersion, infeedEnergy=infeedEnergy, infeedCrestFactor=infeedCrestFactor, envMonID=envMonID, infeedTable=infeedTable, towerVACapacity=towerVACapacity, outletControlAction=outletControlAction, outletEnergy=outletEnergy, contactClosureIndex=contactClosureIndex, towerPowerFactor=towerPowerFactor, infeedApparentPower=infeedApparentPower, outletCapabilities=outletCapabilities, infeedStatus=infeedStatus, towerLineFrequency=towerLineFrequency, infeedVACapacity=infeedVACapacity, outletName=outletName, infeedOutletCount=infeedOutletCount, outletID=outletID, envMonADCName=envMonADCName, tempHumidSensorTable=tempHumidSensorTable, outletChangeEvent=outletChangeEvent, envMonWaterSensorStatus=envMonWaterSensorStatus, systemLocation=systemLocation, tempHumidSensorStatus=tempHumidSensorStatus, infeedVACapacityUsed=infeedVACapacityUsed, towerModelNumber=towerModelNumber, towerInfeedCount=towerInfeedCount, towerCapabilities=towerCapabilities, contactClosureStatus=contactClosureStatus, outletControlState=outletControlState, systemWattsPerAreaUnit=systemWattsPerAreaUnit, tempHumidSensorTempHighThresh=tempHumidSensorTempHighThresh, infeedLoadHighThresh=infeedLoadHighThresh, events=events, tempHumidSensorID=tempHumidSensorID, towerEntry=towerEntry, systemGroup=systemGroup, branchTable=branchTable, infeedCapabilities=infeedCapabilities, towerActivePower=towerActivePower, envMonContactClosureCount=envMonContactClosureCount, infeedLineToLineID=infeedLineToLineID, systemTables=systemTables, branchLoadEvent=branchLoadEvent, towerApparentPower=towerApparentPower, contactClosureTable=contactClosureTable, sentry3=sentry3, contactClosureID=contactClosureID, envMonEntry=envMonEntry, envMonStatusEvent=envMonStatusEvent, branchLoadStatus=branchLoadStatus, branchLoadHighThresh=branchLoadHighThresh, contactClosureEvent=contactClosureEvent, serverTech=serverTech, towerEnergy=towerEnergy, branchEntry=branchEntry, outletTable=outletTable, infeedVoltage=infeedVoltage, systemConfigModifiedCount=systemConfigModifiedCount, systemTotalPower=systemTotalPower, outletPostOnDelay=outletPostOnDelay, tempHumidSensorHumidEvent=tempHumidSensorHumidEvent, infeedStatusEvent=infeedStatusEvent, infeedPhaseVoltage=infeedPhaseVoltage, outletStatusEvent=outletStatusEvent, systemTowerCount=systemTowerCount, tempHumidSensorTempLowThresh=tempHumidSensorTempLowThresh, envMonADCHighThresh=envMonADCHighThresh, eventStatusText=eventStatusText, systemEnvMonCount=systemEnvMonCount, outletLoadLowThresh=outletLoadLowThresh, outletApparentPower=outletApparentPower, envMonADCLowThresh=envMonADCLowThresh, tempHumidSensorHumidStatus=tempHumidSensorHumidStatus, envMonTable=envMonTable, outletCrestFactor=outletCrestFactor, systemFeatures=systemFeatures, infeedEntry=infeedEntry, systemPowerFactor=systemPowerFactor, branchIndex=branchIndex, tempHumidSensorIndex=tempHumidSensorIndex, outletCapacity=outletCapacity, tempHumidSensorHumidLowThresh=tempHumidSensorHumidLowThresh, tempHumidSensorHumidValue=tempHumidSensorHumidValue, outletStatus=outletStatus, tempHumidSensorTempRecDelta=tempHumidSensorTempRecDelta, envMonADCCount=envMonADCCount, tempHumidSensorTempValue=tempHumidSensorTempValue, PYSNMP_MODULE_ID=sentry3, branchLoadValue=branchLoadValue, envMonADCStatus=envMonADCStatus, infeedCapacity=infeedCapacity, infeedLoadEvent=infeedLoadEvent, outletVoltage=outletVoltage, infeedReactance=infeedReactance, envMonStatus=envMonStatus, tempHumidSensorStatusEvent=tempHumidSensorStatusEvent, towerName=towerName, infeedCapacityUsed=infeedCapacityUsed, outletLoadValue=outletLoadValue, eventStatusCondition=eventStatusCondition, branchID=branchID, tempHumidSensorEntry=tempHumidSensorEntry, tempHumidSensorHumidRecDelta=tempHumidSensorHumidRecDelta, towerIndex=towerIndex, outletLoadHighThresh=outletLoadHighThresh, infeedPower=infeedPower, envMonWaterSensorName=envMonWaterSensorName, sentry3Traps=sentry3Traps, outletLoadEvent=outletLoadEvent, envMonIndex=envMonIndex, tempHumidSensorTempEvent=tempHumidSensorTempEvent, contactClosureEntry=contactClosureEntry)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, single_value_constraint, constraints_intersection, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueSizeConstraint')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, notification_type, gauge32, module_identity, enterprises, counter64, object_identity, time_ticks, unsigned32, integer32, ip_address, counter32, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'NotificationType', 'Gauge32', 'ModuleIdentity', 'enterprises', 'Counter64', 'ObjectIdentity', 'TimeTicks', 'Unsigned32', 'Integer32', 'IpAddress', 'Counter32', 'Bits')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
sentry3 = module_identity((1, 3, 6, 1, 4, 1, 1718, 3))
sentry3.setRevisions(('2016-01-25 16:30', '2014-06-25 12:00', '2014-01-16 18:00', '2013-11-25 09:00', '2013-09-16 10:00', '2013-02-14 09:30', '2012-11-07 14:00', '2012-04-18 14:00', '2012-01-04 11:00', '2011-07-11 16:40', '2011-06-15 13:00', '2011-05-05 11:00', '2010-07-07 12:15', '2009-03-10 16:00', '2008-05-07 15:20', '2007-07-09 14:45', '2007-01-09 14:10', '2006-07-20 12:00', '2006-06-12 09:30', '2005-07-27 11:05', '2005-02-18 11:45', '2005-01-07 12:20', '2004-12-09 13:20', '2004-11-11 12:00', '2003-11-20 13:00', '2003-10-23 19:00', '2003-10-02 11:00', '2003-08-27 16:00', '2003-03-28 17:00', '2003-03-27 17:00'))
if mibBuilder.loadTexts:
sentry3.setLastUpdated('201601251630Z')
if mibBuilder.loadTexts:
sentry3.setOrganization('Server Technology, Inc.')
server_tech = mib_identifier((1, 3, 6, 1, 4, 1, 1718))
system_group = mib_identifier((1, 3, 6, 1, 4, 1, 1718, 3, 1))
system_version = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(0, 80))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
systemVersion.setStatus('current')
system_nic_serial_number = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 8))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
systemNICSerialNumber.setStatus('current')
system_location = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
systemLocation.setStatus('current')
system_tower_count = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 4))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
systemTowerCount.setStatus('current')
system_env_mon_count = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 4))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
systemEnvMonCount.setStatus('current')
system_total_power = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(-1, 150000))).setUnits('Watts').setMaxAccess('readonly')
if mibBuilder.loadTexts:
systemTotalPower.setStatus('current')
system_area = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 1000))).setUnits('tenth area units').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
systemArea.setStatus('current')
system_watts_per_area_unit = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(-1, 1500000))).setUnits('Watts per area unit').setMaxAccess('readonly')
if mibBuilder.loadTexts:
systemWattsPerAreaUnit.setStatus('current')
system_area_unit = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('squareMeter', 0), ('squareFoot', 1)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
systemAreaUnit.setStatus('current')
system_power_factor = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(50, 100))).setUnits('hundredths').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
systemPowerFactor.setStatus('current')
system_features = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 11), bits().clone(namedValues=named_values(('smartLoadShedding', 0), ('snmpPOPS', 1), ('outletControlInhibit', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
systemFeatures.setStatus('current')
system_feature_key = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 12), display_string().subtype(subtypeSpec=value_size_constraint(0, 19))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
systemFeatureKey.setStatus('current')
system_outlet_seq_interval = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 15))).setUnits('seconds').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
systemOutletSeqInterval.setStatus('current')
system_outlet_reboot_delay = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(5, 600))).setUnits('seconds').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
systemOutletRebootDelay.setStatus('current')
system_config_modified_count = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
systemConfigModifiedCount.setStatus('current')
system_tables = mib_identifier((1, 3, 6, 1, 4, 1, 1718, 3, 2))
tower_table = mib_table((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1))
if mibBuilder.loadTexts:
towerTable.setStatus('current')
tower_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1)).setIndexNames((0, 'Sentry3-MIB', 'towerIndex'))
if mibBuilder.loadTexts:
towerEntry.setStatus('current')
tower_index = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 4)))
if mibBuilder.loadTexts:
towerIndex.setStatus('current')
tower_id = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerID.setStatus('current')
tower_name = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
towerName.setStatus('current')
tower_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('normal', 0), ('noComm', 1), ('fanFail', 2), ('overTemp', 3), ('nvmFail', 4), ('outOfBalance', 5)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerStatus.setStatus('current')
tower_infeed_count = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 4))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerInfeedCount.setStatus('current')
tower_product_sn = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 6), display_string().subtype(subtypeSpec=value_size_constraint(0, 16))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerProductSN.setStatus('current')
tower_model_number = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 7), display_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerModelNumber.setStatus('current')
tower_capabilities = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 8), bits().clone(namedValues=named_values(('failSafe', 0), ('fuseSense', 1), ('directCurrent', 2), ('threePhase', 3), ('fanSense', 4), ('tempSense', 5)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerCapabilities.setStatus('current')
tower_va_capacity = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(-1, 50000))).setUnits('Volt-Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerVACapacity.setStatus('current')
tower_va_capacity_used = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(-1, 1500))).setUnits('tenth percentage').setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerVACapacityUsed.setStatus('current')
tower_active_power = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(-1, 50000))).setUnits('Watts').setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerActivePower.setStatus('current')
tower_apparent_power = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(-1, 50000))).setUnits('Volt-Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerApparentPower.setStatus('current')
tower_power_factor = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(-1, 100))).setUnits('hundredths').setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerPowerFactor.setStatus('current')
tower_energy = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(-1, 2147483647))).setUnits('Kilowatt-Hours').setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerEnergy.setStatus('current')
tower_line_frequency = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 1, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(-1, 60))).setUnits('Hertz').setMaxAccess('readonly')
if mibBuilder.loadTexts:
towerLineFrequency.setStatus('current')
infeed_table = mib_table((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2))
if mibBuilder.loadTexts:
infeedTable.setStatus('current')
infeed_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1)).setIndexNames((0, 'Sentry3-MIB', 'towerIndex'), (0, 'Sentry3-MIB', 'infeedIndex'))
if mibBuilder.loadTexts:
infeedEntry.setStatus('current')
infeed_index = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 4)))
if mibBuilder.loadTexts:
infeedIndex.setStatus('current')
infeed_id = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(2, 2)).setFixedLength(2)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedID.setStatus('current')
infeed_name = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
infeedName.setStatus('current')
infeed_capabilities = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 4), bits().clone(namedValues=named_values(('onSense', 0), ('loadSense', 1), ('powerControl', 2), ('failSafe', 3), ('defaultOff', 4), ('voltageSense', 5), ('powerSense', 6), ('branchOnSense', 7), ('branchLoadSense', 8)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedCapabilities.setStatus('current')
infeed_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=named_values(('off', 0), ('on', 1), ('offWait', 2), ('onWait', 3), ('offError', 4), ('onError', 5), ('noComm', 6), ('reading', 7), ('offFuse', 8), ('onFuse', 9)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedStatus.setStatus('current')
infeed_load_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('normal', 0), ('notOn', 1), ('reading', 2), ('loadLow', 3), ('loadHigh', 4), ('overLoad', 5), ('readError', 6), ('noComm', 7)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedLoadStatus.setStatus('current')
infeed_load_value = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(-1, 60000))).setUnits('hundredth Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedLoadValue.setStatus('current')
infeed_load_high_thresh = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 600))).setUnits('Amps').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
infeedLoadHighThresh.setStatus('current')
infeed_outlet_count = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 64))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedOutletCount.setStatus('current')
infeed_capacity = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(-1, 600))).setUnits('Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedCapacity.setStatus('current')
infeed_voltage = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(-1, 4800))).setUnits('tenth Volts').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedVoltage.setStatus('current')
infeed_power = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(-1, 25000))).setUnits('Watts').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedPower.setStatus('current')
infeed_apparent_power = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(-1, 25000))).setUnits('Volt-Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedApparentPower.setStatus('current')
infeed_power_factor = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(-1, 100))).setUnits('hundredths').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedPowerFactor.setStatus('current')
infeed_crest_factor = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(-1, 1000))).setUnits('tenths').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedCrestFactor.setStatus('current')
infeed_energy = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 16), integer32().subtype(subtypeSpec=value_range_constraint(-1, 2147483647))).setUnits('tenth Kilowatt-Hours').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedEnergy.setStatus('current')
infeed_reactance = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 17), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('unknown', 0), ('capacitive', 1), ('inductive', 2), ('resistive', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedReactance.setStatus('current')
infeed_phase_voltage = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(-1, 2640))).setUnits('tenth Volts').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedPhaseVoltage.setStatus('current')
infeed_phase_current = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(-1, 25500))).setUnits('hundredth Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedPhaseCurrent.setStatus('current')
infeed_capacity_used = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 20), integer32().subtype(subtypeSpec=value_range_constraint(-1, 1500))).setUnits('tenth percentage').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedCapacityUsed.setStatus('current')
infeed_line_id = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 21), display_string().subtype(subtypeSpec=value_size_constraint(0, 4))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedLineID.setStatus('current')
infeed_line_to_line_id = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 22), display_string().subtype(subtypeSpec=value_size_constraint(0, 7))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedLineToLineID.setStatus('current')
infeed_phase_id = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 23), display_string().subtype(subtypeSpec=value_size_constraint(0, 6))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedPhaseID.setStatus('current')
infeed_va_capacity = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 24), integer32().subtype(subtypeSpec=value_range_constraint(-1, 25000))).setUnits('Volt-Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedVACapacity.setStatus('current')
infeed_va_capacity_used = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 2, 1, 25), integer32().subtype(subtypeSpec=value_range_constraint(-1, 1500))).setUnits('tenth percentage').setMaxAccess('readonly')
if mibBuilder.loadTexts:
infeedVACapacityUsed.setStatus('current')
outlet_table = mib_table((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3))
if mibBuilder.loadTexts:
outletTable.setStatus('current')
outlet_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1)).setIndexNames((0, 'Sentry3-MIB', 'towerIndex'), (0, 'Sentry3-MIB', 'infeedIndex'), (0, 'Sentry3-MIB', 'outletIndex'))
if mibBuilder.loadTexts:
outletEntry.setStatus('current')
outlet_index = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 64)))
if mibBuilder.loadTexts:
outletIndex.setStatus('current')
outlet_id = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(2, 4))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletID.setStatus('current')
outlet_name = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
outletName.setStatus('current')
outlet_capabilities = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 4), bits().clone(namedValues=named_values(('onSense', 0), ('loadSense', 1), ('powerControl', 2), ('shutdown', 3), ('defaultOn', 4), ('ownInfeed', 5), ('fusedBranch', 6), ('voltageSense', 7), ('powerSense', 8)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletCapabilities.setStatus('current')
outlet_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=named_values(('off', 0), ('on', 1), ('offWait', 2), ('onWait', 3), ('offError', 4), ('onError', 5), ('noComm', 6), ('reading', 7), ('offFuse', 8), ('onFuse', 9)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletStatus.setStatus('current')
outlet_load_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('normal', 0), ('notOn', 1), ('reading', 2), ('loadLow', 3), ('loadHigh', 4), ('overLoad', 5), ('readError', 6), ('noComm', 7)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletLoadStatus.setStatus('current')
outlet_load_value = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(-1, 25500))).setUnits('hundredth Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletLoadValue.setStatus('current')
outlet_load_low_thresh = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setUnits('Amps').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
outletLoadLowThresh.setStatus('current')
outlet_load_high_thresh = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setUnits('Amps').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
outletLoadHighThresh.setStatus('current')
outlet_control_state = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17))).clone(namedValues=named_values(('idleOff', 0), ('idleOn', 1), ('wakeOff', 2), ('wakeOn', 3), ('off', 4), ('on', 5), ('lockedOff', 6), ('lockedOn', 7), ('reboot', 8), ('shutdown', 9), ('pendOn', 10), ('pendOff', 11), ('minimumOff', 12), ('minimumOn', 13), ('eventOff', 14), ('eventOn', 15), ('eventReboot', 16), ('eventShutdown', 17)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletControlState.setStatus('current')
outlet_control_action = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('none', 0), ('on', 1), ('off', 2), ('reboot', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
outletControlAction.setStatus('current')
outlet_capacity = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(-1, 255))).setUnits('Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletCapacity.setStatus('current')
outlet_voltage = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(-1, 2640))).setUnits('tenth Volts').setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletVoltage.setStatus('current')
outlet_power = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(-1, 10000))).setUnits('Watts').setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletPower.setStatus('current')
outlet_apparent_power = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(-1, 10000))).setUnits('Volt-Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletApparentPower.setStatus('current')
outlet_power_factor = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 16), integer32().subtype(subtypeSpec=value_range_constraint(-1, 100))).setUnits('hundredths').setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletPowerFactor.setStatus('current')
outlet_crest_factor = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 17), integer32().subtype(subtypeSpec=value_range_constraint(-1, 1000))).setUnits('tenths').setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletCrestFactor.setStatus('current')
outlet_energy = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(-1, 2147483647))).setUnits('Watt-Hours').setMaxAccess('readonly')
if mibBuilder.loadTexts:
outletEnergy.setStatus('current')
outlet_wakeup_state = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('last', 1), ('off', 2), ('on', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
outletWakeupState.setStatus('current')
outlet_post_on_delay = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 3, 1, 20), integer32().subtype(subtypeSpec=value_range_constraint(0, 900))).setUnits('seconds').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
outletPostOnDelay.setStatus('current')
env_mon_table = mib_table((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4))
if mibBuilder.loadTexts:
envMonTable.setStatus('current')
env_mon_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1)).setIndexNames((0, 'Sentry3-MIB', 'envMonIndex'))
if mibBuilder.loadTexts:
envMonEntry.setStatus('current')
env_mon_index = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 4)))
if mibBuilder.loadTexts:
envMonIndex.setStatus('current')
env_mon_id = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
envMonID.setStatus('current')
env_mon_name = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
envMonName.setStatus('current')
env_mon_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('normal', 0), ('noComm', 1)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
envMonStatus.setStatus('current')
env_mon_water_sensor_name = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
envMonWaterSensorName.setStatus('current')
env_mon_water_sensor_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('normal', 0), ('alarm', 1), ('noComm', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
envMonWaterSensorStatus.setStatus('current')
env_mon_adc_name = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 7), display_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
envMonADCName.setStatus('current')
env_mon_adc_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('normal', 0), ('reading', 1), ('countLow', 2), ('countHigh', 3), ('readError', 4), ('noComm', 5)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
envMonADCStatus.setStatus('current')
env_mon_adc_count = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(-1, 255))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
envMonADCCount.setStatus('current')
env_mon_adc_low_thresh = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
envMonADCLowThresh.setStatus('current')
env_mon_adc_high_thresh = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
envMonADCHighThresh.setStatus('current')
env_mon_temp_humid_sensor_count = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 2))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
envMonTempHumidSensorCount.setStatus('current')
env_mon_contact_closure_count = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 4, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 4))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
envMonContactClosureCount.setStatus('current')
temp_humid_sensor_table = mib_table((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5))
if mibBuilder.loadTexts:
tempHumidSensorTable.setStatus('current')
temp_humid_sensor_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1)).setIndexNames((0, 'Sentry3-MIB', 'envMonIndex'), (0, 'Sentry3-MIB', 'tempHumidSensorIndex'))
if mibBuilder.loadTexts:
tempHumidSensorEntry.setStatus('current')
temp_humid_sensor_index = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2)))
if mibBuilder.loadTexts:
tempHumidSensorIndex.setStatus('current')
temp_humid_sensor_id = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(2, 2)).setFixedLength(2)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
tempHumidSensorID.setStatus('current')
temp_humid_sensor_name = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
tempHumidSensorName.setStatus('current')
temp_humid_sensor_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('found', 0), ('notFound', 1), ('lost', 2), ('noComm', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
tempHumidSensorStatus.setStatus('current')
temp_humid_sensor_temp_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('normal', 0), ('notFound', 1), ('reading', 2), ('tempLow', 3), ('tempHigh', 4), ('readError', 5), ('lost', 6), ('noComm', 7)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
tempHumidSensorTempStatus.setStatus('current')
temp_humid_sensor_temp_value = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(-1, 2540))).setUnits('tenth degrees').setMaxAccess('readonly')
if mibBuilder.loadTexts:
tempHumidSensorTempValue.setStatus('current')
temp_humid_sensor_temp_low_thresh = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 254))).setUnits('degrees').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
tempHumidSensorTempLowThresh.setStatus('current')
temp_humid_sensor_temp_high_thresh = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 254))).setUnits('degrees').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
tempHumidSensorTempHighThresh.setStatus('current')
temp_humid_sensor_humid_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('normal', 0), ('notFound', 1), ('reading', 2), ('humidLow', 3), ('humidHigh', 4), ('readError', 5), ('lost', 6), ('noComm', 7)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
tempHumidSensorHumidStatus.setStatus('current')
temp_humid_sensor_humid_value = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(-1, 100))).setUnits('percentage relative humidity').setMaxAccess('readonly')
if mibBuilder.loadTexts:
tempHumidSensorHumidValue.setStatus('current')
temp_humid_sensor_humid_low_thresh = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percentage relative humidity').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
tempHumidSensorHumidLowThresh.setStatus('current')
temp_humid_sensor_humid_high_thresh = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setUnits('percentage relative humidity').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
tempHumidSensorHumidHighThresh.setStatus('current')
temp_humid_sensor_temp_scale = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('celsius', 0), ('fahrenheit', 1)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
tempHumidSensorTempScale.setStatus('current')
temp_humid_sensor_temp_rec_delta = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(0, 54))).setUnits('degrees').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
tempHumidSensorTempRecDelta.setStatus('current')
temp_humid_sensor_humid_rec_delta = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 5, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 20))).setUnits('percentage relative humidity').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
tempHumidSensorHumidRecDelta.setStatus('current')
contact_closure_table = mib_table((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6))
if mibBuilder.loadTexts:
contactClosureTable.setStatus('current')
contact_closure_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6, 1)).setIndexNames((0, 'Sentry3-MIB', 'envMonIndex'), (0, 'Sentry3-MIB', 'contactClosureIndex'))
if mibBuilder.loadTexts:
contactClosureEntry.setStatus('current')
contact_closure_index = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 4)))
if mibBuilder.loadTexts:
contactClosureIndex.setStatus('current')
contact_closure_id = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(2, 2)).setFixedLength(2)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
contactClosureID.setStatus('current')
contact_closure_name = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
contactClosureName.setStatus('current')
contact_closure_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 6, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('normal', 0), ('alarm', 1), ('noComm', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
contactClosureStatus.setStatus('current')
branch_table = mib_table((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7))
if mibBuilder.loadTexts:
branchTable.setStatus('current')
branch_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1)).setIndexNames((0, 'Sentry3-MIB', 'towerIndex'), (0, 'Sentry3-MIB', 'infeedIndex'), (0, 'Sentry3-MIB', 'branchIndex'))
if mibBuilder.loadTexts:
branchEntry.setStatus('current')
branch_index = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 4)))
if mibBuilder.loadTexts:
branchIndex.setStatus('current')
branch_id = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(3, 3)).setFixedLength(3)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
branchID.setStatus('current')
branch_name = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
branchName.setStatus('current')
branch_capabilities = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 4), bits().clone(namedValues=named_values(('onSense', 0), ('loadSense', 1)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
branchCapabilities.setStatus('current')
branch_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=named_values(('off', 0), ('on', 1), ('offWait', 2), ('onWait', 3), ('offError', 4), ('onError', 5), ('noComm', 6), ('reading', 7), ('offFuse', 8), ('onFuse', 9)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
branchStatus.setStatus('current')
branch_load_status = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('normal', 0), ('notOn', 1), ('reading', 2), ('loadLow', 3), ('loadHigh', 4), ('overLoad', 5), ('readError', 6), ('noComm', 7)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
branchLoadStatus.setStatus('current')
branch_load_value = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(-1, 4000))).setUnits('hundredth Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
branchLoadValue.setStatus('current')
branch_load_high_thresh = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 40))).setUnits('Amps').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
branchLoadHighThresh.setStatus('current')
branch_capacity = mib_table_column((1, 3, 6, 1, 4, 1, 1718, 3, 2, 7, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(-1, 40))).setUnits('Amps').setMaxAccess('readonly')
if mibBuilder.loadTexts:
branchCapacity.setStatus('current')
event_information_group = mib_identifier((1, 3, 6, 1, 4, 1, 1718, 3, 99))
event_status_text = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 99, 1), display_string().subtype(subtypeSpec=value_size_constraint(0, 20))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
eventStatusText.setStatus('current')
event_status_condition = mib_scalar((1, 3, 6, 1, 4, 1, 1718, 3, 99, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('nonError', 0), ('error', 1)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
eventStatusCondition.setStatus('current')
sentry3_traps = mib_identifier((1, 3, 6, 1, 4, 1, 1718, 3, 100))
events = mib_identifier((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0))
tower_status_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 1)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'towerID'), ('Sentry3-MIB', 'towerName'), ('Sentry3-MIB', 'towerStatus'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
towerStatusEvent.setStatus('current')
infeed_status_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 2)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'infeedID'), ('Sentry3-MIB', 'infeedName'), ('Sentry3-MIB', 'infeedStatus'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
infeedStatusEvent.setStatus('current')
infeed_load_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 3)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'infeedID'), ('Sentry3-MIB', 'infeedName'), ('Sentry3-MIB', 'infeedLoadStatus'), ('Sentry3-MIB', 'infeedLoadValue'), ('Sentry3-MIB', 'infeedLoadHighThresh'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
infeedLoadEvent.setStatus('current')
outlet_status_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 4)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'outletID'), ('Sentry3-MIB', 'outletName'), ('Sentry3-MIB', 'outletStatus'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
outletStatusEvent.setStatus('current')
outlet_load_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 5)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'outletID'), ('Sentry3-MIB', 'outletName'), ('Sentry3-MIB', 'outletLoadStatus'), ('Sentry3-MIB', 'outletLoadValue'), ('Sentry3-MIB', 'outletLoadLowThresh'), ('Sentry3-MIB', 'outletLoadHighThresh'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
outletLoadEvent.setStatus('current')
outlet_change_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 6)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'outletID'), ('Sentry3-MIB', 'outletName'), ('Sentry3-MIB', 'outletStatus'), ('Sentry3-MIB', 'outletControlState'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
outletChangeEvent.setStatus('current')
env_mon_status_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 7)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'envMonID'), ('Sentry3-MIB', 'envMonName'), ('Sentry3-MIB', 'envMonStatus'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
envMonStatusEvent.setStatus('current')
env_mon_water_sensor_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 8)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'envMonID'), ('Sentry3-MIB', 'envMonWaterSensorName'), ('Sentry3-MIB', 'envMonWaterSensorStatus'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
envMonWaterSensorEvent.setStatus('current')
env_mon_adc_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 9)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'envMonID'), ('Sentry3-MIB', 'envMonADCName'), ('Sentry3-MIB', 'envMonADCStatus'), ('Sentry3-MIB', 'envMonADCCount'), ('Sentry3-MIB', 'envMonADCLowThresh'), ('Sentry3-MIB', 'envMonADCHighThresh'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
envMonADCEvent.setStatus('current')
temp_humid_sensor_status_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 10)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'tempHumidSensorID'), ('Sentry3-MIB', 'tempHumidSensorName'), ('Sentry3-MIB', 'tempHumidSensorStatus'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
tempHumidSensorStatusEvent.setStatus('current')
temp_humid_sensor_temp_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 11)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'tempHumidSensorID'), ('Sentry3-MIB', 'tempHumidSensorName'), ('Sentry3-MIB', 'tempHumidSensorTempStatus'), ('Sentry3-MIB', 'tempHumidSensorTempValue'), ('Sentry3-MIB', 'tempHumidSensorTempLowThresh'), ('Sentry3-MIB', 'tempHumidSensorTempHighThresh'), ('Sentry3-MIB', 'tempHumidSensorTempScale'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
tempHumidSensorTempEvent.setStatus('current')
temp_humid_sensor_humid_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 12)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'tempHumidSensorID'), ('Sentry3-MIB', 'tempHumidSensorName'), ('Sentry3-MIB', 'tempHumidSensorHumidStatus'), ('Sentry3-MIB', 'tempHumidSensorHumidValue'), ('Sentry3-MIB', 'tempHumidSensorHumidLowThresh'), ('Sentry3-MIB', 'tempHumidSensorHumidHighThresh'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
tempHumidSensorHumidEvent.setStatus('current')
contact_closure_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 13)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'contactClosureID'), ('Sentry3-MIB', 'contactClosureName'), ('Sentry3-MIB', 'contactClosureStatus'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
contactClosureEvent.setStatus('current')
branch_status_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 14)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'branchID'), ('Sentry3-MIB', 'branchName'), ('Sentry3-MIB', 'branchStatus'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
branchStatusEvent.setStatus('current')
branch_load_event = notification_type((1, 3, 6, 1, 4, 1, 1718, 3, 100, 0, 15)).setObjects(('Sentry3-MIB', 'systemLocation'), ('Sentry3-MIB', 'branchID'), ('Sentry3-MIB', 'branchName'), ('Sentry3-MIB', 'branchLoadStatus'), ('Sentry3-MIB', 'branchLoadValue'), ('Sentry3-MIB', 'branchLoadHighThresh'), ('Sentry3-MIB', 'eventStatusText'), ('Sentry3-MIB', 'eventStatusCondition'))
if mibBuilder.loadTexts:
branchLoadEvent.setStatus('current')
mibBuilder.exportSymbols('Sentry3-MIB', infeedIndex=infeedIndex, infeedID=infeedID, infeedLoadValue=infeedLoadValue, envMonName=envMonName, infeedName=infeedName, systemFeatureKey=systemFeatureKey, branchCapacity=branchCapacity, infeedPhaseID=infeedPhaseID, contactClosureName=contactClosureName, envMonTempHumidSensorCount=envMonTempHumidSensorCount, branchStatus=branchStatus, infeedLoadStatus=infeedLoadStatus, envMonADCEvent=envMonADCEvent, systemOutletSeqInterval=systemOutletSeqInterval, systemOutletRebootDelay=systemOutletRebootDelay, branchCapabilities=branchCapabilities, tempHumidSensorHumidHighThresh=tempHumidSensorHumidHighThresh, infeedLineID=infeedLineID, towerStatus=towerStatus, outletPower=outletPower, branchStatusEvent=branchStatusEvent, systemArea=systemArea, branchName=branchName, towerTable=towerTable, infeedPhaseCurrent=infeedPhaseCurrent, outletWakeupState=outletWakeupState, eventInformationGroup=eventInformationGroup, systemNICSerialNumber=systemNICSerialNumber, towerProductSN=towerProductSN, tempHumidSensorTempStatus=tempHumidSensorTempStatus, systemAreaUnit=systemAreaUnit, outletIndex=outletIndex, envMonWaterSensorEvent=envMonWaterSensorEvent, outletLoadStatus=outletLoadStatus, tempHumidSensorName=tempHumidSensorName, tempHumidSensorTempScale=tempHumidSensorTempScale, towerStatusEvent=towerStatusEvent, outletPowerFactor=outletPowerFactor, infeedPowerFactor=infeedPowerFactor, towerID=towerID, towerVACapacityUsed=towerVACapacityUsed, outletEntry=outletEntry, systemVersion=systemVersion, infeedEnergy=infeedEnergy, infeedCrestFactor=infeedCrestFactor, envMonID=envMonID, infeedTable=infeedTable, towerVACapacity=towerVACapacity, outletControlAction=outletControlAction, outletEnergy=outletEnergy, contactClosureIndex=contactClosureIndex, towerPowerFactor=towerPowerFactor, infeedApparentPower=infeedApparentPower, outletCapabilities=outletCapabilities, infeedStatus=infeedStatus, towerLineFrequency=towerLineFrequency, infeedVACapacity=infeedVACapacity, outletName=outletName, infeedOutletCount=infeedOutletCount, outletID=outletID, envMonADCName=envMonADCName, tempHumidSensorTable=tempHumidSensorTable, outletChangeEvent=outletChangeEvent, envMonWaterSensorStatus=envMonWaterSensorStatus, systemLocation=systemLocation, tempHumidSensorStatus=tempHumidSensorStatus, infeedVACapacityUsed=infeedVACapacityUsed, towerModelNumber=towerModelNumber, towerInfeedCount=towerInfeedCount, towerCapabilities=towerCapabilities, contactClosureStatus=contactClosureStatus, outletControlState=outletControlState, systemWattsPerAreaUnit=systemWattsPerAreaUnit, tempHumidSensorTempHighThresh=tempHumidSensorTempHighThresh, infeedLoadHighThresh=infeedLoadHighThresh, events=events, tempHumidSensorID=tempHumidSensorID, towerEntry=towerEntry, systemGroup=systemGroup, branchTable=branchTable, infeedCapabilities=infeedCapabilities, towerActivePower=towerActivePower, envMonContactClosureCount=envMonContactClosureCount, infeedLineToLineID=infeedLineToLineID, systemTables=systemTables, branchLoadEvent=branchLoadEvent, towerApparentPower=towerApparentPower, contactClosureTable=contactClosureTable, sentry3=sentry3, contactClosureID=contactClosureID, envMonEntry=envMonEntry, envMonStatusEvent=envMonStatusEvent, branchLoadStatus=branchLoadStatus, branchLoadHighThresh=branchLoadHighThresh, contactClosureEvent=contactClosureEvent, serverTech=serverTech, towerEnergy=towerEnergy, branchEntry=branchEntry, outletTable=outletTable, infeedVoltage=infeedVoltage, systemConfigModifiedCount=systemConfigModifiedCount, systemTotalPower=systemTotalPower, outletPostOnDelay=outletPostOnDelay, tempHumidSensorHumidEvent=tempHumidSensorHumidEvent, infeedStatusEvent=infeedStatusEvent, infeedPhaseVoltage=infeedPhaseVoltage, outletStatusEvent=outletStatusEvent, systemTowerCount=systemTowerCount, tempHumidSensorTempLowThresh=tempHumidSensorTempLowThresh, envMonADCHighThresh=envMonADCHighThresh, eventStatusText=eventStatusText, systemEnvMonCount=systemEnvMonCount, outletLoadLowThresh=outletLoadLowThresh, outletApparentPower=outletApparentPower, envMonADCLowThresh=envMonADCLowThresh, tempHumidSensorHumidStatus=tempHumidSensorHumidStatus, envMonTable=envMonTable, outletCrestFactor=outletCrestFactor, systemFeatures=systemFeatures, infeedEntry=infeedEntry, systemPowerFactor=systemPowerFactor, branchIndex=branchIndex, tempHumidSensorIndex=tempHumidSensorIndex, outletCapacity=outletCapacity, tempHumidSensorHumidLowThresh=tempHumidSensorHumidLowThresh, tempHumidSensorHumidValue=tempHumidSensorHumidValue, outletStatus=outletStatus, tempHumidSensorTempRecDelta=tempHumidSensorTempRecDelta, envMonADCCount=envMonADCCount, tempHumidSensorTempValue=tempHumidSensorTempValue, PYSNMP_MODULE_ID=sentry3, branchLoadValue=branchLoadValue, envMonADCStatus=envMonADCStatus, infeedCapacity=infeedCapacity, infeedLoadEvent=infeedLoadEvent, outletVoltage=outletVoltage, infeedReactance=infeedReactance, envMonStatus=envMonStatus, tempHumidSensorStatusEvent=tempHumidSensorStatusEvent, towerName=towerName, infeedCapacityUsed=infeedCapacityUsed, outletLoadValue=outletLoadValue, eventStatusCondition=eventStatusCondition, branchID=branchID, tempHumidSensorEntry=tempHumidSensorEntry, tempHumidSensorHumidRecDelta=tempHumidSensorHumidRecDelta, towerIndex=towerIndex, outletLoadHighThresh=outletLoadHighThresh, infeedPower=infeedPower, envMonWaterSensorName=envMonWaterSensorName, sentry3Traps=sentry3Traps, outletLoadEvent=outletLoadEvent, envMonIndex=envMonIndex, tempHumidSensorTempEvent=tempHumidSensorTempEvent, contactClosureEntry=contactClosureEntry) |
class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
dp=[[0 for _ in range(len(grid[0]))] for _ in range(len(grid))]
for row in range(len(grid)):
for col in range(len(grid[0])):
dp[row][col]=grid[row][col]
if row==0 and col==0:
continue
candidates=set()
if col>0:
candidates.add(dp[row][col-1])
if row>0:
candidates.add(dp[row-1][col])
dp[row][col]+=min(candidates)
return dp[-1][-1] | class Solution:
def min_path_sum(self, grid: List[List[int]]) -> int:
dp = [[0 for _ in range(len(grid[0]))] for _ in range(len(grid))]
for row in range(len(grid)):
for col in range(len(grid[0])):
dp[row][col] = grid[row][col]
if row == 0 and col == 0:
continue
candidates = set()
if col > 0:
candidates.add(dp[row][col - 1])
if row > 0:
candidates.add(dp[row - 1][col])
dp[row][col] += min(candidates)
return dp[-1][-1] |
class Stack:
def __init__(self):
self._elems = []
def isEmpty(self):
return self._elems == []
def top(self):
if self._elems == []:
raise Exception('Stack is empty when using top()!')
else:
return self._elems[-1]
def push(self, elem):
self._elems.append(elem)
def pop(self):
if self._elems == []:
raise Exception('Stack is empty when doing pop()!')
else:
return self._elems.pop()
def size(self):
return len(self._elems)
def sumnum(self):
return sum(self._elems)
pocket = Stack()
n = int(input())
while True:
m = int(input())
if m == 0:
break
if pocket.isEmpty():
pocket.push(m)
elif m > pocket.top():
pocket.pop()
pocket.push(m)
else:
if pocket.size() < n:
pocket.push(m)
print(pocket.sumnum())
| class Stack:
def __init__(self):
self._elems = []
def is_empty(self):
return self._elems == []
def top(self):
if self._elems == []:
raise exception('Stack is empty when using top()!')
else:
return self._elems[-1]
def push(self, elem):
self._elems.append(elem)
def pop(self):
if self._elems == []:
raise exception('Stack is empty when doing pop()!')
else:
return self._elems.pop()
def size(self):
return len(self._elems)
def sumnum(self):
return sum(self._elems)
pocket = stack()
n = int(input())
while True:
m = int(input())
if m == 0:
break
if pocket.isEmpty():
pocket.push(m)
elif m > pocket.top():
pocket.pop()
pocket.push(m)
elif pocket.size() < n:
pocket.push(m)
print(pocket.sumnum()) |
a = int(input())
if a < 10 :
print("small")
| a = int(input())
if a < 10:
print('small') |
#!/usr/bin/env python3
n = int(input())
i = 0
while i < n:
print(n - i)
i = i + 1
| n = int(input())
i = 0
while i < n:
print(n - i)
i = i + 1 |
class Solution:
def canThreePartsEqualSum(self, arr: List[int]) -> bool:
total = sum(arr)
if total % 3 != 0:
return False
avg, count, currentSum = total // 3, 0, 0
for i in arr:
currentSum += i
if currentSum == avg:
count += 1
currentSum = 0
return count >= 3 | class Solution:
def can_three_parts_equal_sum(self, arr: List[int]) -> bool:
total = sum(arr)
if total % 3 != 0:
return False
(avg, count, current_sum) = (total // 3, 0, 0)
for i in arr:
current_sum += i
if currentSum == avg:
count += 1
current_sum = 0
return count >= 3 |
class SingletonMeta(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super().__call__()
return cls._instances[cls]
class ResourceManagerExample(metaclass=SingletonMeta):
def __init__(self, resource=100):
self._resource = resource
@property
def resource(self):
return self._resource
def use_resource(self, demand=10):
if self._resource - demand < 0:
raise Exception("Not enough resource. Cannot proceed")
self._resource -= demand
def return_resource(self, res=10):
self._resource += res
| class Singletonmeta(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super().__call__()
return cls._instances[cls]
class Resourcemanagerexample(metaclass=SingletonMeta):
def __init__(self, resource=100):
self._resource = resource
@property
def resource(self):
return self._resource
def use_resource(self, demand=10):
if self._resource - demand < 0:
raise exception('Not enough resource. Cannot proceed')
self._resource -= demand
def return_resource(self, res=10):
self._resource += res |
class ListNode:
def __init__(self, val, next, *args, **kwargs):
self.val = val
self.next = None
# return super().__init__(*args, **kwargs)
def reverse(self, head):
prev = None
while head:
temp = head.next
head.next = prev
prev = head
head = temp
return prev
class DListNode:
def __init__(self, val, next, prev, *args, **kwargs):
self.val = val
self.next = None
self.prev = None
def reverse(self, head):
curt = None
while head:
curt = head
head = curt.next
curt.next = curt.prev
curt.prev = curt
return curt
pass
| class Listnode:
def __init__(self, val, next, *args, **kwargs):
self.val = val
self.next = None
def reverse(self, head):
prev = None
while head:
temp = head.next
head.next = prev
prev = head
head = temp
return prev
class Dlistnode:
def __init__(self, val, next, prev, *args, **kwargs):
self.val = val
self.next = None
self.prev = None
def reverse(self, head):
curt = None
while head:
curt = head
head = curt.next
curt.next = curt.prev
curt.prev = curt
return curt
pass |
'''All of the below settings apply only within the level that this config file
is situated. However, some of these options can also be applied at a
project-level within settings.py (see the docs for info on which options
transfer). Note that any inconsistencies are resolved in favour of the more
'local' settings, unless the local settings are the default whereas the global
is non-default.
Example: If TESTMASTER_OBLIGATE_ITEM_FIELDS in settings.py is unchanged but you
have edited OBLIGATE_ITEM_FIELDS in this config.py file, those local changes
will be applied to the tests for the callback. On the other hand, if you have
tweaked a global setting in settings.py, that setting will apply to every single
test in the project for which the relevant config.py file displays the default
option.
As for any custom rules you define under ItemRules or RequestRules, these will
be executed before any global custom rules, but they do not replace them.'''
#Equivalent to TESTMASTER_MAX_FIXTURES_PER_CALLBACK in settings.py
MAX_FIXTURES = 10
#Equivalent to TESTMASTER_SKIPPED_FIELDS
SKIPPED_FIELDS = []
#Equivalent to TESTMASTER_REQUEST_SKIPPED_FIELDS
REQUEST_SKIPPED_FIELDS = []
#Equivalent to TESTMASTER_EXCLUDED_HEADERS
EXCLUDED_HEADERS = []
#Equivalent to TESTMASTER_INCLUDED_AUTH_HEADERS
INCLUDED_AUTH_HEADERS = []
#Equivalent to TESTMASTER_INCLUDED_SETTINGS
INCLUDED_SETTINGS = []
# Insert here any field names which you intend to exist in every dictionary
# object outputted for all callback/s applicable at the given level of this file
# (does not affect callbacks which output requests).
#Equivalent to TESTMASTER_OBLIGATE_ITEM_FIELDS
OBLIGATE_ITEM_FIELDS = []
# Insert here any field names which you intend to exist and be non-empty in
# every dictionary object outputted for all callback/s applicable at the given
# level of this file (does not affect callbacks which output requests)
#Equivalent to TESTMASTER_PRIMARY_ITEM_FIELDS
PRIMARY_ITEM_FIELDS = ["Name", "Favorite animal", "Favorite color", "Hometown"]
'''If a field appears in PRIMARY_ITEM_FIELDS and OBLIGATE_ITEM_FIELDS, the former
takes precedence.'''
# Now you can specify any additional requests involving a dynamic download, similar
# to the "scrapy parse" command, but with extra options! These requests will be
# triggered (with their data potentially becoming new fixtures) the next time
# you call "testmaster update" specifying this callback.
# Format = Python dicts, not JSON (i.e. use None & True not null and true);
# field "_class" can be omitted for standard requests
REQUESTS_TO_ADD = [
#{
# "url": "https://examplewebsite011235811.com",
# "headers": {"referer":"...", "content_type": "..."},
# "cookies": {},
# "method": "POST",
# "data": {"x": "y"},
# "_class": "scrapy.http.request.form.FormRequest",
# "meta": {"x": "y"},
# },
# {
# ...
# }
]
# Add your own rules to test for properties of your output! These will be added to
# the default rules which just check for differences against the results of the
# original test.
class ItemRules(object):
# def example_rule(self, item):
# assert(float(item["now_price"].strip('$').replace(',', '')) <=
# float(item["was_price"].strip('$').replace(',', '')))
pass
class RequestRules(object):
# def example_rule(self, request):
# if request["meta"].get("categories", []):
# assert(len(request["meta"]["categories"]) >= 2)
pass
| """All of the below settings apply only within the level that this config file
is situated. However, some of these options can also be applied at a
project-level within settings.py (see the docs for info on which options
transfer). Note that any inconsistencies are resolved in favour of the more
'local' settings, unless the local settings are the default whereas the global
is non-default.
Example: If TESTMASTER_OBLIGATE_ITEM_FIELDS in settings.py is unchanged but you
have edited OBLIGATE_ITEM_FIELDS in this config.py file, those local changes
will be applied to the tests for the callback. On the other hand, if you have
tweaked a global setting in settings.py, that setting will apply to every single
test in the project for which the relevant config.py file displays the default
option.
As for any custom rules you define under ItemRules or RequestRules, these will
be executed before any global custom rules, but they do not replace them."""
max_fixtures = 10
skipped_fields = []
request_skipped_fields = []
excluded_headers = []
included_auth_headers = []
included_settings = []
obligate_item_fields = []
primary_item_fields = ['Name', 'Favorite animal', 'Favorite color', 'Hometown']
'If a field appears in PRIMARY_ITEM_FIELDS and OBLIGATE_ITEM_FIELDS, the former\ntakes precedence.'
requests_to_add = []
class Itemrules(object):
pass
class Requestrules(object):
pass |
class dotEnumerator_t(object):
# no doc
AdditionalId=None
aFilterName=None
aObjects=None
aObjectTypes=None
ClientId=None
Filter=None
MaxPoint=None
MinPoint=None
ModificationStamp=None
MoreObjectsLeft=None
nObjects=None
nObjectToStart=None
ReturnAlsoIfObjectIsCreatedAndDeletedAfterEvent=None
SubFilter=None
ViewId=None
| class Dotenumerator_T(object):
additional_id = None
a_filter_name = None
a_objects = None
a_object_types = None
client_id = None
filter = None
max_point = None
min_point = None
modification_stamp = None
more_objects_left = None
n_objects = None
n_object_to_start = None
return_also_if_object_is_created_and_deleted_after_event = None
sub_filter = None
view_id = None |
def pattern(n):
k = 2 * n - 2
for i in range(0, n-1):
for j in range(0, k):
print(end=" ")
k = k - 2
for j in range(0, i + 1):
print("* ", end="")
print(" ")
k = -1
for i in range(n-1,-1,-1):
for j in range(k,-1,-1):
print(end=" ")
k = k + 2
for j in range(0, i + 1):
print("* ", end="")
print(" ")
#user input
n=int(input("Enter value between 1 and 10"))
pattern(n) | def pattern(n):
k = 2 * n - 2
for i in range(0, n - 1):
for j in range(0, k):
print(end=' ')
k = k - 2
for j in range(0, i + 1):
print('* ', end='')
print(' ')
k = -1
for i in range(n - 1, -1, -1):
for j in range(k, -1, -1):
print(end=' ')
k = k + 2
for j in range(0, i + 1):
print('* ', end='')
print(' ')
n = int(input('Enter value between 1 and 10'))
pattern(n) |
class Solution:
def __init__(self):
self.f = defaultdict(int)
def findFrequentTreeSum(self, root: TreeNode) -> List[int]:
self._post_order(root)
res = []
maxf = 0
for k, v in self.f.items():
if v > maxf:
maxf = v
res = [k]
elif v == maxf:
res.append(k)
return res
def _post_order(self, root):
if not root:
return 0
l = self._post_order(root.left)
r = self._post_order(root.right)
v = l + r + root.val
self.f[v] += 1
return v
| class Solution:
def __init__(self):
self.f = defaultdict(int)
def find_frequent_tree_sum(self, root: TreeNode) -> List[int]:
self._post_order(root)
res = []
maxf = 0
for (k, v) in self.f.items():
if v > maxf:
maxf = v
res = [k]
elif v == maxf:
res.append(k)
return res
def _post_order(self, root):
if not root:
return 0
l = self._post_order(root.left)
r = self._post_order(root.right)
v = l + r + root.val
self.f[v] += 1
return v |
# -*- coding:utf-8 -*-
class Level:
id = ''
word_id = ''
name = ''
| class Level:
id = ''
word_id = ''
name = '' |
class User:
'''
Class that generates new instances of users
'''
users = []
def __init__(self, login_username, password):
'''
___init___ method that helps us define properties for our objects.
Args:
name: New user name
password: New user password
'''
self.login_username = login_username
self.password = password
def save_user(self):
'''
save user details method saves user object into users
'''
User.users.append(self)
@classmethod
def authenticate_user(cls, name, password):
'''
authenticate user loginname and password
Args:
login_username : name used by user to login
password: password for the user
Returns:
password
'''
for user in cls.users:
if user.login_username == name and user.password == password:
return password
| class User:
"""
Class that generates new instances of users
"""
users = []
def __init__(self, login_username, password):
"""
___init___ method that helps us define properties for our objects.
Args:
name: New user name
password: New user password
"""
self.login_username = login_username
self.password = password
def save_user(self):
"""
save user details method saves user object into users
"""
User.users.append(self)
@classmethod
def authenticate_user(cls, name, password):
"""
authenticate user loginname and password
Args:
login_username : name used by user to login
password: password for the user
Returns:
password
"""
for user in cls.users:
if user.login_username == name and user.password == password:
return password |
def __main__( deadlinePlugin ):
job = deadlinePlugin.GetJob()
cpus = list(deadlinePlugin.CpuAffinity())
cpus_linux = [str(x) for x in cpus]
cpus_linux = ','.join(cpus_linux)
# Edwin hex math for building the CPU affinity
cpus_windows = 0
for cpu in cpus:
cpus_windows |= 1 << int(cpu)
cpus_windows = hex(cpus_windows)[2:].upper()
deadlinePlugin.LogInfo("Setting DEADLINE_CPUS_LINUX to {0}".format(cpus_linux))
deadlinePlugin.SetProcessEnvironmentVariable("DEADLINE_CPUS_LINUX", cpus_linux)
deadlinePlugin.LogInfo("Setting DEADLINE_CPUS_WINDOWS to {0}".format(cpus_windows))
deadlinePlugin.SetProcessEnvironmentVariable("DEADLINE_CPUS_WINDOWS", cpus_windows)
| def __main__(deadlinePlugin):
job = deadlinePlugin.GetJob()
cpus = list(deadlinePlugin.CpuAffinity())
cpus_linux = [str(x) for x in cpus]
cpus_linux = ','.join(cpus_linux)
cpus_windows = 0
for cpu in cpus:
cpus_windows |= 1 << int(cpu)
cpus_windows = hex(cpus_windows)[2:].upper()
deadlinePlugin.LogInfo('Setting DEADLINE_CPUS_LINUX to {0}'.format(cpus_linux))
deadlinePlugin.SetProcessEnvironmentVariable('DEADLINE_CPUS_LINUX', cpus_linux)
deadlinePlugin.LogInfo('Setting DEADLINE_CPUS_WINDOWS to {0}'.format(cpus_windows))
deadlinePlugin.SetProcessEnvironmentVariable('DEADLINE_CPUS_WINDOWS', cpus_windows) |
#
# @lc app=leetcode id=448 lang=python3
#
# [448] Find All Numbers Disappeared in an Array
#
# @lc code=start
class Solution:
def findDisappearedNumbers(self, nums: List[int]) -> List[int]:
list = [0] * len(nums)
result = []
for n in nums:
list[n-1] = list[n-1] + 1
for i, c in enumerate(list):
if c == 0:
result.append(i+1)
return result
# @lc code=end
| class Solution:
def find_disappeared_numbers(self, nums: List[int]) -> List[int]:
list = [0] * len(nums)
result = []
for n in nums:
list[n - 1] = list[n - 1] + 1
for (i, c) in enumerate(list):
if c == 0:
result.append(i + 1)
return result |
'''
Created on Feb 5, 2017
@author: safdar
'''
# from operations.vehicledetection.entities import Vehicle
# class VehicleManager(object):
# def __init__(self, lookback_frames, clusterer):
# self.__lookback_frames__ = lookback_frames
# self.__vehicles__ = []
# self.__clusterer__ = clusterer
#
# # Candidate: (center, diagonal, score)
# def add_candidates(self, candidates, continuity_threshold=None):
# existing_vehicles = self.get_vehicles(continuity_threshold=continuity_threshold)
# vehicles_to_add = [Vehicle(candidate.center(), candidate.diagonal(), candidate.score()) for candidate in candidates]
# combined_list = vehicles_to_add + existing_vehicles
# # print ("Existing tracked vehicles: {}".format(len(existing_vehicles)))
# # print ("New tracking candidates: {}".format(len(vehicles_to_add)))
# mergedvehicles = self.__clusterer__.clusterandmerge(combined_list)
# # print ("Post-merge tracked vehicles: {}".format(len(mergedvehicles)))
# self.__vehicles__ = mergedvehicles
#
# def get_vehicles(self, continuity_threshold=None):
# filtered = []
# for vehicle in self.__vehicles__:
# if vehicle.satisfies(continuity_threshold):
# filtered.append(vehicle)
# return filtered
| """
Created on Feb 5, 2017
@author: safdar
""" |
with open("Input.txt") as f:
lines = f.readlines()
# remove whitespace characters like `\n` at the end of each line
lines = [x.strip() for x in lines]
num_lines = len(lines)
width = len(lines[0])
print(f"{num_lines} lines of width {width}")
diffs = [(1, 1), (3, 1), (5, 1), (7, 1), (1, 2)]
hits = []
for diff in diffs:
hit_count = 0
x, y = 0, 0
while y < num_lines - 1:
y += diff[1]
x = (x + diff[0]) % width
if lines[y][x] == '#':
hit_count += 1
if y == num_lines - 1:
print(f"last line = '{lines[y]}'")
print(f"Hit {hit_count} trees for {diff}!")
hits.append(hit_count)
print(f"{hits}")
| with open('Input.txt') as f:
lines = f.readlines()
lines = [x.strip() for x in lines]
num_lines = len(lines)
width = len(lines[0])
print(f'{num_lines} lines of width {width}')
diffs = [(1, 1), (3, 1), (5, 1), (7, 1), (1, 2)]
hits = []
for diff in diffs:
hit_count = 0
(x, y) = (0, 0)
while y < num_lines - 1:
y += diff[1]
x = (x + diff[0]) % width
if lines[y][x] == '#':
hit_count += 1
if y == num_lines - 1:
print(f"last line = '{lines[y]}'")
print(f'Hit {hit_count} trees for {diff}!')
hits.append(hit_count)
print(f'{hits}') |
def pairwise_slow(iterable):
it = iter(iterable)
while True:
yield it.next(), it.next()
| def pairwise_slow(iterable):
it = iter(iterable)
while True:
yield (it.next(), it.next()) |
#
# PySNMP MIB module ASCEND-MIBATMQOS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBATMQOS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:26:36 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)
#
configuration, = mibBuilder.importSymbols("ASCEND-MIB", "configuration")
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Integer32, Counter32, iso, ObjectIdentity, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, TimeTicks, Unsigned32, NotificationType, ModuleIdentity, MibIdentifier, IpAddress, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "Counter32", "iso", "ObjectIdentity", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "TimeTicks", "Unsigned32", "NotificationType", "ModuleIdentity", "MibIdentifier", "IpAddress", "Gauge32")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
class DisplayString(OctetString):
pass
mibatmQosProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 529, 23, 21))
mibatmQosProfileTable = MibTable((1, 3, 6, 1, 4, 1, 529, 23, 21, 1), )
if mibBuilder.loadTexts: mibatmQosProfileTable.setStatus('mandatory')
if mibBuilder.loadTexts: mibatmQosProfileTable.setDescription('A list of mibatmQosProfile profile entries.')
mibatmQosProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1), ).setIndexNames((0, "ASCEND-MIBATMQOS-MIB", "atmQosProfile-ContractName"))
if mibBuilder.loadTexts: mibatmQosProfileEntry.setStatus('mandatory')
if mibBuilder.loadTexts: mibatmQosProfileEntry.setDescription('A mibatmQosProfile entry containing objects that maps to the parameters of mibatmQosProfile profile.')
atmQosProfile_ContractName = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 1), DisplayString()).setLabel("atmQosProfile-ContractName").setMaxAccess("readonly")
if mibBuilder.loadTexts: atmQosProfile_ContractName.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_ContractName.setDescription('The name of the Quality of Service (QoS) contract.')
atmQosProfile_TrafficDescriptorIndex = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 2), Integer32()).setLabel("atmQosProfile-TrafficDescriptorIndex").setMaxAccess("readonly")
if mibBuilder.loadTexts: atmQosProfile_TrafficDescriptorIndex.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_TrafficDescriptorIndex.setDescription('Traffic descriptor index.')
atmQosProfile_TrafficDescriptorType = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(17, 3, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16))).clone(namedValues=NamedValues(("unknownTrafficDescr", 17), ("noclpNoscr", 3), ("noclpScr", 6), ("clpNotaggingScr", 7), ("clpTaggingScr", 8), ("clpTransparentNoscr", 10), ("clpTransparentScr", 11), ("noclpTaggingNoscr", 12), ("noclpNoscrCdvt", 13), ("noclpScrCdvt", 14), ("clpNotaggingScrCdvt", 15), ("clpTaggingScrCdvt", 16)))).setLabel("atmQosProfile-TrafficDescriptorType").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_TrafficDescriptorType.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_TrafficDescriptorType.setDescription('The Traffic Descriptor type.')
atmQosProfile_AtmServiceCategory = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("cbr", 1), ("realTimeVbr", 2), ("nonRealTimeVbr", 3), ("ubr", 4)))).setLabel("atmQosProfile-AtmServiceCategory").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_AtmServiceCategory.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_AtmServiceCategory.setDescription('The ATM Service Category Type. In 7.11.x releases this field was called qos-class.')
atmQosProfile_PeakRateKbitsPerSec = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 6), Integer32()).setLabel("atmQosProfile-PeakRateKbitsPerSec").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_PeakRateKbitsPerSec.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_PeakRateKbitsPerSec.setDescription('The Peak Cell Rate (PCR) expressed in Kbits per second ( Peak Bandwidth in KBits/sec )')
atmQosProfile_PeakCellRateCellsPerSec = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 7), Integer32()).setLabel("atmQosProfile-PeakCellRateCellsPerSec").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_PeakCellRateCellsPerSec.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_PeakCellRateCellsPerSec.setDescription('The Peak Cell Rate (PCR) expressed in cells per second')
atmQosProfile_SustainableRateKbitsPerSec = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 9), Integer32()).setLabel("atmQosProfile-SustainableRateKbitsPerSec").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_SustainableRateKbitsPerSec.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_SustainableRateKbitsPerSec.setDescription('The sustainable cell rate (SCR) expressed in Kbits per second ( Sustainable Bandwidth in Kbits/sec )')
atmQosProfile_SustainableCellRateCellsPerSec = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 10), Integer32()).setLabel("atmQosProfile-SustainableCellRateCellsPerSec").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_SustainableCellRateCellsPerSec.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_SustainableCellRateCellsPerSec.setDescription('The sustainable cell rate (SCR) expressed in cells per second')
atmQosProfile_IgnoreCellDelayVariationTolerance = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("atmQosProfile-IgnoreCellDelayVariationTolerance").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_IgnoreCellDelayVariationTolerance.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_IgnoreCellDelayVariationTolerance.setDescription('Ignore cell-delay-variation-tolerance parameter. When it is set to yes, cell-delay-variation-tolerance parameter is ignored, and an internal parameter is used to tolerate bursty CPE that does not have traffic shaping capability.')
atmQosProfile_CellDelayVariationTolerance = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 12), Integer32()).setLabel("atmQosProfile-CellDelayVariationTolerance").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_CellDelayVariationTolerance.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_CellDelayVariationTolerance.setDescription('Cell delay variation tolerance is expressed in microseconds. It is ignored when ignore-cell-delay-variation-tolerance is yes.')
atmQosProfile_IgnoreMaxBurstSize = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("atmQosProfile-IgnoreMaxBurstSize").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_IgnoreMaxBurstSize.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_IgnoreMaxBurstSize.setDescription('Ignore max-burst-size parameter. When it is set to yes, max-burst-size parameter is ignored, and an internal parameter is used to tolerate bursty CPE that does not have traffic shaping capability.')
atmQosProfile_MaxBurstSize = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 14), Integer32()).setLabel("atmQosProfile-MaxBurstSize").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_MaxBurstSize.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_MaxBurstSize.setDescription('Maximum burst size determines the maximum number of cells that can be transmitted at the peak cell rate before they become candidates for discard or marking. It is ignored when ignore-max-burst-size is yes.')
atmQosProfile_AalType = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("aal0", 1), ("aal5", 2), ("unspecified", 3)))).setLabel("atmQosProfile-AalType").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_AalType.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_AalType.setDescription('ATM Adaptation Layer type')
atmQosProfile_EarlyPacketDiscard = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("atmQosProfile-EarlyPacketDiscard").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_EarlyPacketDiscard.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_EarlyPacketDiscard.setDescription('Applies to egress AAL5 packets. If the first cell in a packet can not be queued then that cell and all the remaining cells in that packet are not queued.')
atmQosProfile_PartialPacketDiscard = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("atmQosProfile-PartialPacketDiscard").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_PartialPacketDiscard.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_PartialPacketDiscard.setDescription('Applies to ingress AAL5 packets. If non-conforming cell is discarded then the remaining cells in the packet (except the last cell) are also discarded.')
atmQosProfile_TagOrDiscard = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("tag", 1), ("discard", 2)))).setLabel("atmQosProfile-TagOrDiscard").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_TagOrDiscard.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_TagOrDiscard.setDescription('The non-conforming CLP=0 SCR cell should be tagged or discarded')
atmQosProfile_SubChannel = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 21), Integer32()).setLabel("atmQosProfile-SubChannel").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_SubChannel.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_SubChannel.setDescription('For DSL technologies that support multiple sub-channels on one line, when the multiple sub-channels are indeed used at same time, this parameter indicates which sub-channel will be used for this QOS profile. When only one sub-channel is used this parameter has no effect... EXAMPLE: in DMT - when the latency is set to BOTH, sub-channel #1 is the FAST channel ( typically useful for voice traffic - voice over ATM or Packet ) while sub-channel #2 is the INTERLEAVE channel ( typically useful for data traffic ).')
atmQosProfile_Action_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noAction", 1), ("createProfile", 2), ("deleteProfile", 3)))).setLabel("atmQosProfile-Action-o").setMaxAccess("readwrite")
if mibBuilder.loadTexts: atmQosProfile_Action_o.setStatus('mandatory')
if mibBuilder.loadTexts: atmQosProfile_Action_o.setDescription('')
mibBuilder.exportSymbols("ASCEND-MIBATMQOS-MIB", mibatmQosProfileTable=mibatmQosProfileTable, mibatmQosProfileEntry=mibatmQosProfileEntry, atmQosProfile_PeakCellRateCellsPerSec=atmQosProfile_PeakCellRateCellsPerSec, atmQosProfile_TrafficDescriptorType=atmQosProfile_TrafficDescriptorType, atmQosProfile_IgnoreCellDelayVariationTolerance=atmQosProfile_IgnoreCellDelayVariationTolerance, atmQosProfile_ContractName=atmQosProfile_ContractName, atmQosProfile_TagOrDiscard=atmQosProfile_TagOrDiscard, atmQosProfile_PartialPacketDiscard=atmQosProfile_PartialPacketDiscard, atmQosProfile_IgnoreMaxBurstSize=atmQosProfile_IgnoreMaxBurstSize, atmQosProfile_Action_o=atmQosProfile_Action_o, atmQosProfile_AtmServiceCategory=atmQosProfile_AtmServiceCategory, atmQosProfile_AalType=atmQosProfile_AalType, atmQosProfile_SustainableCellRateCellsPerSec=atmQosProfile_SustainableCellRateCellsPerSec, atmQosProfile_SustainableRateKbitsPerSec=atmQosProfile_SustainableRateKbitsPerSec, DisplayString=DisplayString, atmQosProfile_EarlyPacketDiscard=atmQosProfile_EarlyPacketDiscard, atmQosProfile_TrafficDescriptorIndex=atmQosProfile_TrafficDescriptorIndex, atmQosProfile_SubChannel=atmQosProfile_SubChannel, atmQosProfile_CellDelayVariationTolerance=atmQosProfile_CellDelayVariationTolerance, atmQosProfile_MaxBurstSize=atmQosProfile_MaxBurstSize, atmQosProfile_PeakRateKbitsPerSec=atmQosProfile_PeakRateKbitsPerSec, mibatmQosProfile=mibatmQosProfile)
| (configuration,) = mibBuilder.importSymbols('ASCEND-MIB', 'configuration')
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, value_size_constraint, single_value_constraint, constraints_union, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueRangeConstraint')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(integer32, counter32, iso, object_identity, bits, mib_scalar, mib_table, mib_table_row, mib_table_column, counter64, time_ticks, unsigned32, notification_type, module_identity, mib_identifier, ip_address, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'Counter32', 'iso', 'ObjectIdentity', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter64', 'TimeTicks', 'Unsigned32', 'NotificationType', 'ModuleIdentity', 'MibIdentifier', 'IpAddress', 'Gauge32')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
class Displaystring(OctetString):
pass
mibatm_qos_profile = mib_identifier((1, 3, 6, 1, 4, 1, 529, 23, 21))
mibatm_qos_profile_table = mib_table((1, 3, 6, 1, 4, 1, 529, 23, 21, 1))
if mibBuilder.loadTexts:
mibatmQosProfileTable.setStatus('mandatory')
if mibBuilder.loadTexts:
mibatmQosProfileTable.setDescription('A list of mibatmQosProfile profile entries.')
mibatm_qos_profile_entry = mib_table_row((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1)).setIndexNames((0, 'ASCEND-MIBATMQOS-MIB', 'atmQosProfile-ContractName'))
if mibBuilder.loadTexts:
mibatmQosProfileEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
mibatmQosProfileEntry.setDescription('A mibatmQosProfile entry containing objects that maps to the parameters of mibatmQosProfile profile.')
atm_qos_profile__contract_name = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 1), display_string()).setLabel('atmQosProfile-ContractName').setMaxAccess('readonly')
if mibBuilder.loadTexts:
atmQosProfile_ContractName.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_ContractName.setDescription('The name of the Quality of Service (QoS) contract.')
atm_qos_profile__traffic_descriptor_index = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 2), integer32()).setLabel('atmQosProfile-TrafficDescriptorIndex').setMaxAccess('readonly')
if mibBuilder.loadTexts:
atmQosProfile_TrafficDescriptorIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_TrafficDescriptorIndex.setDescription('Traffic descriptor index.')
atm_qos_profile__traffic_descriptor_type = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(17, 3, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16))).clone(namedValues=named_values(('unknownTrafficDescr', 17), ('noclpNoscr', 3), ('noclpScr', 6), ('clpNotaggingScr', 7), ('clpTaggingScr', 8), ('clpTransparentNoscr', 10), ('clpTransparentScr', 11), ('noclpTaggingNoscr', 12), ('noclpNoscrCdvt', 13), ('noclpScrCdvt', 14), ('clpNotaggingScrCdvt', 15), ('clpTaggingScrCdvt', 16)))).setLabel('atmQosProfile-TrafficDescriptorType').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_TrafficDescriptorType.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_TrafficDescriptorType.setDescription('The Traffic Descriptor type.')
atm_qos_profile__atm_service_category = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('cbr', 1), ('realTimeVbr', 2), ('nonRealTimeVbr', 3), ('ubr', 4)))).setLabel('atmQosProfile-AtmServiceCategory').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_AtmServiceCategory.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_AtmServiceCategory.setDescription('The ATM Service Category Type. In 7.11.x releases this field was called qos-class.')
atm_qos_profile__peak_rate_kbits_per_sec = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 6), integer32()).setLabel('atmQosProfile-PeakRateKbitsPerSec').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_PeakRateKbitsPerSec.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_PeakRateKbitsPerSec.setDescription('The Peak Cell Rate (PCR) expressed in Kbits per second ( Peak Bandwidth in KBits/sec )')
atm_qos_profile__peak_cell_rate_cells_per_sec = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 7), integer32()).setLabel('atmQosProfile-PeakCellRateCellsPerSec').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_PeakCellRateCellsPerSec.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_PeakCellRateCellsPerSec.setDescription('The Peak Cell Rate (PCR) expressed in cells per second')
atm_qos_profile__sustainable_rate_kbits_per_sec = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 9), integer32()).setLabel('atmQosProfile-SustainableRateKbitsPerSec').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_SustainableRateKbitsPerSec.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_SustainableRateKbitsPerSec.setDescription('The sustainable cell rate (SCR) expressed in Kbits per second ( Sustainable Bandwidth in Kbits/sec )')
atm_qos_profile__sustainable_cell_rate_cells_per_sec = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 10), integer32()).setLabel('atmQosProfile-SustainableCellRateCellsPerSec').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_SustainableCellRateCellsPerSec.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_SustainableCellRateCellsPerSec.setDescription('The sustainable cell rate (SCR) expressed in cells per second')
atm_qos_profile__ignore_cell_delay_variation_tolerance = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setLabel('atmQosProfile-IgnoreCellDelayVariationTolerance').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_IgnoreCellDelayVariationTolerance.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_IgnoreCellDelayVariationTolerance.setDescription('Ignore cell-delay-variation-tolerance parameter. When it is set to yes, cell-delay-variation-tolerance parameter is ignored, and an internal parameter is used to tolerate bursty CPE that does not have traffic shaping capability.')
atm_qos_profile__cell_delay_variation_tolerance = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 12), integer32()).setLabel('atmQosProfile-CellDelayVariationTolerance').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_CellDelayVariationTolerance.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_CellDelayVariationTolerance.setDescription('Cell delay variation tolerance is expressed in microseconds. It is ignored when ignore-cell-delay-variation-tolerance is yes.')
atm_qos_profile__ignore_max_burst_size = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setLabel('atmQosProfile-IgnoreMaxBurstSize').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_IgnoreMaxBurstSize.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_IgnoreMaxBurstSize.setDescription('Ignore max-burst-size parameter. When it is set to yes, max-burst-size parameter is ignored, and an internal parameter is used to tolerate bursty CPE that does not have traffic shaping capability.')
atm_qos_profile__max_burst_size = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 14), integer32()).setLabel('atmQosProfile-MaxBurstSize').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_MaxBurstSize.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_MaxBurstSize.setDescription('Maximum burst size determines the maximum number of cells that can be transmitted at the peak cell rate before they become candidates for discard or marking. It is ignored when ignore-max-burst-size is yes.')
atm_qos_profile__aal_type = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 16), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('aal0', 1), ('aal5', 2), ('unspecified', 3)))).setLabel('atmQosProfile-AalType').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_AalType.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_AalType.setDescription('ATM Adaptation Layer type')
atm_qos_profile__early_packet_discard = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 17), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setLabel('atmQosProfile-EarlyPacketDiscard').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_EarlyPacketDiscard.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_EarlyPacketDiscard.setDescription('Applies to egress AAL5 packets. If the first cell in a packet can not be queued then that cell and all the remaining cells in that packet are not queued.')
atm_qos_profile__partial_packet_discard = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setLabel('atmQosProfile-PartialPacketDiscard').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_PartialPacketDiscard.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_PartialPacketDiscard.setDescription('Applies to ingress AAL5 packets. If non-conforming cell is discarded then the remaining cells in the packet (except the last cell) are also discarded.')
atm_qos_profile__tag_or_discard = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('tag', 1), ('discard', 2)))).setLabel('atmQosProfile-TagOrDiscard').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_TagOrDiscard.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_TagOrDiscard.setDescription('The non-conforming CLP=0 SCR cell should be tagged or discarded')
atm_qos_profile__sub_channel = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 21), integer32()).setLabel('atmQosProfile-SubChannel').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_SubChannel.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_SubChannel.setDescription('For DSL technologies that support multiple sub-channels on one line, when the multiple sub-channels are indeed used at same time, this parameter indicates which sub-channel will be used for this QOS profile. When only one sub-channel is used this parameter has no effect... EXAMPLE: in DMT - when the latency is set to BOTH, sub-channel #1 is the FAST channel ( typically useful for voice traffic - voice over ATM or Packet ) while sub-channel #2 is the INTERLEAVE channel ( typically useful for data traffic ).')
atm_qos_profile__action_o = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 21, 1, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('noAction', 1), ('createProfile', 2), ('deleteProfile', 3)))).setLabel('atmQosProfile-Action-o').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
atmQosProfile_Action_o.setStatus('mandatory')
if mibBuilder.loadTexts:
atmQosProfile_Action_o.setDescription('')
mibBuilder.exportSymbols('ASCEND-MIBATMQOS-MIB', mibatmQosProfileTable=mibatmQosProfileTable, mibatmQosProfileEntry=mibatmQosProfileEntry, atmQosProfile_PeakCellRateCellsPerSec=atmQosProfile_PeakCellRateCellsPerSec, atmQosProfile_TrafficDescriptorType=atmQosProfile_TrafficDescriptorType, atmQosProfile_IgnoreCellDelayVariationTolerance=atmQosProfile_IgnoreCellDelayVariationTolerance, atmQosProfile_ContractName=atmQosProfile_ContractName, atmQosProfile_TagOrDiscard=atmQosProfile_TagOrDiscard, atmQosProfile_PartialPacketDiscard=atmQosProfile_PartialPacketDiscard, atmQosProfile_IgnoreMaxBurstSize=atmQosProfile_IgnoreMaxBurstSize, atmQosProfile_Action_o=atmQosProfile_Action_o, atmQosProfile_AtmServiceCategory=atmQosProfile_AtmServiceCategory, atmQosProfile_AalType=atmQosProfile_AalType, atmQosProfile_SustainableCellRateCellsPerSec=atmQosProfile_SustainableCellRateCellsPerSec, atmQosProfile_SustainableRateKbitsPerSec=atmQosProfile_SustainableRateKbitsPerSec, DisplayString=DisplayString, atmQosProfile_EarlyPacketDiscard=atmQosProfile_EarlyPacketDiscard, atmQosProfile_TrafficDescriptorIndex=atmQosProfile_TrafficDescriptorIndex, atmQosProfile_SubChannel=atmQosProfile_SubChannel, atmQosProfile_CellDelayVariationTolerance=atmQosProfile_CellDelayVariationTolerance, atmQosProfile_MaxBurstSize=atmQosProfile_MaxBurstSize, atmQosProfile_PeakRateKbitsPerSec=atmQosProfile_PeakRateKbitsPerSec, mibatmQosProfile=mibatmQosProfile) |
#
# @lc app=leetcode id=464 lang=python3
#
# [464] Can I Win
#
# @lc code=start
class Solution:
def canIWin(self, maxChoosableInteger: int, desiredTotal: int):
# first player must win
if maxChoosableInteger > desiredTotal:
return True
nums = [num for num in range(1, maxChoosableInteger + 1)]
# will never reach the target, so first player will not win
if sum(nums) < desiredTotal:
return False
self.seen = {}
return self.can_win(nums, desiredTotal)
def can_win(self, nums, target):
if nums[-1] >= target:
return True
if tuple(nums) in self.seen:
return self.seen[tuple(nums)]
for i in range(len(nums)):
# to player2
if not self.can_win(nums[:i] + nums[i+1:], target-nums[i]):
self.seen[tuple(nums)] = True
return True
self.seen[tuple(nums)] = False
return False
# @lc code=end
| class Solution:
def can_i_win(self, maxChoosableInteger: int, desiredTotal: int):
if maxChoosableInteger > desiredTotal:
return True
nums = [num for num in range(1, maxChoosableInteger + 1)]
if sum(nums) < desiredTotal:
return False
self.seen = {}
return self.can_win(nums, desiredTotal)
def can_win(self, nums, target):
if nums[-1] >= target:
return True
if tuple(nums) in self.seen:
return self.seen[tuple(nums)]
for i in range(len(nums)):
if not self.can_win(nums[:i] + nums[i + 1:], target - nums[i]):
self.seen[tuple(nums)] = True
return True
self.seen[tuple(nums)] = False
return False |
def top_level_function1() -> None:
return
class TopLevelClass1:
def __init__(self) -> None:
return
def instance_method1(self) -> None:
return
@classmethod
def class_method1(cls) -> None:
return
def instance_method2(self) -> None:
return
def top_level_function2() -> None:
return
class TopLevelClass2:
def __init__(self) -> None:
return
def instance_method3(self) -> None:
return
@classmethod
def class_method2(cls) -> None:
return
def instance_method4(self) -> None:
return
| def top_level_function1() -> None:
return
class Toplevelclass1:
def __init__(self) -> None:
return
def instance_method1(self) -> None:
return
@classmethod
def class_method1(cls) -> None:
return
def instance_method2(self) -> None:
return
def top_level_function2() -> None:
return
class Toplevelclass2:
def __init__(self) -> None:
return
def instance_method3(self) -> None:
return
@classmethod
def class_method2(cls) -> None:
return
def instance_method4(self) -> None:
return |
def zero_matrix(matrix):
rows = set()
cols = set()
for i in range(len(matrix)):
for j in range(len(matrix[i])):
if matrix[i][j] == 0:
rows.add(i)
cols.add(j)
for row in rows:
for i in range(len(matrix[row])):
matrix[row][i] = 0
for col in cols:
for i in range(len(matrix)):
matrix[i][col] = 0
if __name__ == "__main__":
m = [[0,1,2], [3,4,5], [6,0,7]]
zero_matrix(m)
print(m)
| def zero_matrix(matrix):
rows = set()
cols = set()
for i in range(len(matrix)):
for j in range(len(matrix[i])):
if matrix[i][j] == 0:
rows.add(i)
cols.add(j)
for row in rows:
for i in range(len(matrix[row])):
matrix[row][i] = 0
for col in cols:
for i in range(len(matrix)):
matrix[i][col] = 0
if __name__ == '__main__':
m = [[0, 1, 2], [3, 4, 5], [6, 0, 7]]
zero_matrix(m)
print(m) |
class Order:
def __init__(self):
self.items = []
self.quantities = []
self.prices = []
self.status = "open"
def add_item(self, name, quantity, price):
self.items.append(name)
self.quantities.append(quantity)
self.prices.append(price)
def total_price(self):
total = 0
for i in range(len(self.prices)):
total += self.quantities[i] * self.prices[i]
return total
class PaymentProcessor:
def pay_debit(self, order, security_code):
print("Processing debit payment type")
print(f"Verifying security code: {security_code}")
order.status = "paid"
def pay_credit(self, order, security_code):
print("Processing credit payment type")
print(f"Verifying security code: {security_code}")
order.status = "paid"
order = Order()
order.add_item("Keyboard", 1, 50)
order.add_item("SSD", 1, 150)
order.add_item("USB cable", 2, 5)
print(order.total_price())
processor = PaymentProcessor()
processor.pay_debit(order, "0372846")
| class Order:
def __init__(self):
self.items = []
self.quantities = []
self.prices = []
self.status = 'open'
def add_item(self, name, quantity, price):
self.items.append(name)
self.quantities.append(quantity)
self.prices.append(price)
def total_price(self):
total = 0
for i in range(len(self.prices)):
total += self.quantities[i] * self.prices[i]
return total
class Paymentprocessor:
def pay_debit(self, order, security_code):
print('Processing debit payment type')
print(f'Verifying security code: {security_code}')
order.status = 'paid'
def pay_credit(self, order, security_code):
print('Processing credit payment type')
print(f'Verifying security code: {security_code}')
order.status = 'paid'
order = order()
order.add_item('Keyboard', 1, 50)
order.add_item('SSD', 1, 150)
order.add_item('USB cable', 2, 5)
print(order.total_price())
processor = payment_processor()
processor.pay_debit(order, '0372846') |
class Guerra():
def __init__(self, numTerricolas=3, numMarcianos=3):
self.__terricolasNave = Nave(Guerreros.TERRICOLA, "Millenium Falcon", numTerricolas)
self.__marcianosNave = Nave(Guerreros.MARCIANO, "Wing X", numTerricolas)
def start_war(self):
numTerricolasInNave = self.__terricolasNave.number_of_members()
numMarcianosInNave = self.__marcianosNave.number_of_members()
if(numTerricolasInNave >= numMarcianosInNave):
max_shots = numTerricolasInNave
else:
max_shots = numMarcianosInNave
while(self.are_members_in_both_crews()):
for warrior in range (0,max_shots):
if(warrior < numTerricolasInNave and self.__terricolasNave.isWarriorAlive(warrior)):
shot = self.__terricolasNave.shoot(warrior)
self.__marcianosNave.get_shot(shot)
if(warrior < numMarcianosInNave and self.__marcianosNave.isWarriorAlive(warrior)):
shot = self.__marcianosNave.shoot(warrior)
self.__terricolasNave.get_shot(shot)
if (self.__terricolasNave.membersAlive() > 0):
return 0
elif (self.__marcianosNave.membersAlive() > 0):
return 1
else:
raise Exception
def are_members_in_both_crews(self):
if( (self.__terricolasNave.membersAlive()) > 0 and (self.__marcianosNave.membersAlive()) > 0):
return True
else:
return False
| class Guerra:
def __init__(self, numTerricolas=3, numMarcianos=3):
self.__terricolasNave = nave(Guerreros.TERRICOLA, 'Millenium Falcon', numTerricolas)
self.__marcianosNave = nave(Guerreros.MARCIANO, 'Wing X', numTerricolas)
def start_war(self):
num_terricolas_in_nave = self.__terricolasNave.number_of_members()
num_marcianos_in_nave = self.__marcianosNave.number_of_members()
if numTerricolasInNave >= numMarcianosInNave:
max_shots = numTerricolasInNave
else:
max_shots = numMarcianosInNave
while self.are_members_in_both_crews():
for warrior in range(0, max_shots):
if warrior < numTerricolasInNave and self.__terricolasNave.isWarriorAlive(warrior):
shot = self.__terricolasNave.shoot(warrior)
self.__marcianosNave.get_shot(shot)
if warrior < numMarcianosInNave and self.__marcianosNave.isWarriorAlive(warrior):
shot = self.__marcianosNave.shoot(warrior)
self.__terricolasNave.get_shot(shot)
if self.__terricolasNave.membersAlive() > 0:
return 0
elif self.__marcianosNave.membersAlive() > 0:
return 1
else:
raise Exception
def are_members_in_both_crews(self):
if self.__terricolasNave.membersAlive() > 0 and self.__marcianosNave.membersAlive() > 0:
return True
else:
return False |
class EnvConstants:
EUREKA_SERVER = "EUREKA_SERVER"
APP_IP = "APP_IP"
FLUENTD_IP_PORT = "FLUENTD_IP_PORT"
HTTP_AUTH_USER = "HTTP_AUTH_USER"
HTTP_AUTH_PASSWORD = "HTTP_AUTH_PASSWORD"
TEMPLATES_DIR = "TEMPLATES_DIR"
VARS_DIR = "VARS_DIR"
TEMPLATE = "TEMPLATE"
VARIABLES = "VARIABLES"
WORKSPACE = "WORKSPACE"
PORT = "PORT"
HTTPS_ENABLE = "HTTPS_ENABLE"
HTTPS_CERT = "HTTPS_CERT"
HTTPS_KEY = "HTTPS_KEY"
| class Envconstants:
eureka_server = 'EUREKA_SERVER'
app_ip = 'APP_IP'
fluentd_ip_port = 'FLUENTD_IP_PORT'
http_auth_user = 'HTTP_AUTH_USER'
http_auth_password = 'HTTP_AUTH_PASSWORD'
templates_dir = 'TEMPLATES_DIR'
vars_dir = 'VARS_DIR'
template = 'TEMPLATE'
variables = 'VARIABLES'
workspace = 'WORKSPACE'
port = 'PORT'
https_enable = 'HTTPS_ENABLE'
https_cert = 'HTTPS_CERT'
https_key = 'HTTPS_KEY' |
def add(a,b):
return a+b
def subtraction(a,b):
return a-b
def multiply(a,b):
return a*b
def division(a,b):
return a/b
def modulas(a,b):
return a%b | def add(a, b):
return a + b
def subtraction(a, b):
return a - b
def multiply(a, b):
return a * b
def division(a, b):
return a / b
def modulas(a, b):
return a % b |
{
'targets': [
{
'target_name': 'mysys_ssl',
'type': 'static_library',
'standalone_static_library': 1,
'includes': [ '../config/config.gypi' ],
'cflags!': [ '-O3' ],
'cflags_cc!': [ '-O3' ],
'cflags_c!': [ '-O3' ],
'cflags+': [ '-O2', '-g' ],
'cflags_c+': [ '-O2', '-g' ],
'cflags_cc+': [ '-O2' ],
'sources': [
'my_aes.cc',
'my_md5.cc',
'my_rnd.cc',
'my_sha1.cc',
'my_sha2.cc',
],
# Prevents node's openssl headers from getting in the way
'include_dirs!': [ '<(node_root_dir)/include/node' ],
'include_dirs': [
'.',
'../include',
'../extra/yassl/include',
'../extra/yassl/taocrypt/include',
],
'include_dirs+': [ '<(node_root_dir)/include/node' ],
},
],
}
| {'targets': [{'target_name': 'mysys_ssl', 'type': 'static_library', 'standalone_static_library': 1, 'includes': ['../config/config.gypi'], 'cflags!': ['-O3'], 'cflags_cc!': ['-O3'], 'cflags_c!': ['-O3'], 'cflags+': ['-O2', '-g'], 'cflags_c+': ['-O2', '-g'], 'cflags_cc+': ['-O2'], 'sources': ['my_aes.cc', 'my_md5.cc', 'my_rnd.cc', 'my_sha1.cc', 'my_sha2.cc'], 'include_dirs!': ['<(node_root_dir)/include/node'], 'include_dirs': ['.', '../include', '../extra/yassl/include', '../extra/yassl/taocrypt/include'], 'include_dirs+': ['<(node_root_dir)/include/node']}]} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# Copyright (c) 2018, WeBank Inc. All Rights Reserved
#
################################################################################
# =============================================================================
# TransferVariable Class
# =============================================================================
class Variable(object):
def __init__(self, name, auth):
self.name = name
self.auth = auth
class BaseTransferVariable(object):
def __init__(self, flowid=0):
self.flowid = flowid
self.define_transfer_variable()
def set_flowid(self, flowid):
self.flowid = flowid
def generate_transferid(self, transfer_var, *suffix):
if transfer_var.name.split(".", -1)[-1] not in self.__dict__:
raise ValueError("transfer variable not in class, please check if!!!")
transferid = transfer_var.name + "." + str(self.flowid)
if suffix:
transferid += "." + ".".join(map(str, suffix))
return transferid
def define_transfer_variable(self):
pass
class RsaIntersectTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.rsa_pubkey = Variable(name="RsaIntersectTransferVariable.rsa_pubkey", auth={'src': "host", 'dst': ['guest']})
self.intersect_guest_ids = Variable(name="RsaIntersectTransferVariable.intersect_guest_ids", auth={'src': "guest", 'dst': ['host']})
self.intersect_host_ids_process = Variable(name="RsaIntersectTransferVariable.intersect_host_ids_process", auth={'src': "host", 'dst': ['guest']})
self.intersect_guest_ids_process = Variable(name="RsaIntersectTransferVariable.intersect_guest_ids_process", auth={'src': "host", 'dst': ['guest']})
self.intersect_ids = Variable(name="RsaIntersectTransferVariable.intersect_ids", auth={'src': "guest", 'dst': ['host']})
pass
class RawIntersectTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.send_ids_host = Variable(name="RawIntersectTransferVariable.send_ids_host", auth={'src': "host", 'dst': ['guest']})
self.send_ids_guest = Variable(name="RawIntersectTransferVariable.send_ids_guest", auth={'src': "guest", 'dst': ['host']})
self.intersect_ids_host = Variable(name="RawIntersectTransferVariable.intersect_ids_host", auth={'src': "host", 'dst': ['guest']})
self.intersect_ids_guest = Variable(name="RawIntersectTransferVariable.intersect_ids_guest", auth={'src': "guest", 'dst': ['host']})
pass
class HeteroLRTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.paillier_pubkey = Variable(name="HeteroLRTransferVariable.paillier_pubkey", auth={'src': "arbiter", 'dst': ['host', 'guest']})
self.batch_data_index = Variable(name="HeteroLRTransferVariable.batch_data_index", auth={'src': "guest", 'dst': ['host']})
self.host_forward_dict = Variable(name="HeteroLRTransferVariable.host_forward_dict", auth={'src': "host", 'dst': ['guest']})
self.fore_gradient = Variable(name="HeteroLRTransferVariable.fore_gradient", auth={'src': "guest", 'dst': ['host']})
self.guest_gradient = Variable(name="HeteroLRTransferVariable.guest_gradient", auth={'src': "guest", 'dst': ['arbiter']})
self.guest_optim_gradient = Variable(name="HeteroLRTransferVariable.guest_optim_gradient", auth={'src': "arbiter", 'dst': ['guest']})
self.host_loss_regular = Variable(name="HeteroLRTransferVariable.host_loss_regular", auth={'src': "host", 'dst': ['guest']})
self.loss = Variable(name="HeteroLRTransferVariable.loss", auth={'src': "guest", 'dst': ['arbiter']})
self.is_stopped = Variable(name="HeteroLRTransferVariable.is_stopped", auth={'src': "arbiter", 'dst': ['host', 'guest']})
self.batch_info = Variable(name="HeteroLRTransferVariable.batch_info", auth={'src': "guest", 'dst': ['host', 'arbiter']})
self.host_optim_gradient = Variable(name="HeteroLRTransferVariable.host_optim_gradient", auth={'src': "arbiter", 'dst': ['host']})
self.host_gradient = Variable(name="HeteroLRTransferVariable.host_gradient", auth={'src': "host", 'dst': ['arbiter']})
self.host_prob = Variable(name="HeteroLRTransferVariable.host_prob", auth={'src': "host", 'dst': ['guest']})
pass
class HomoLRTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.paillier_pubkey = Variable(name="HomoLRTransferVariable.paillier_pubkey", auth={'src': "arbiter", 'dst': ['host']})
self.guest_model = Variable(name="HomoLRTransferVariable.guest_model", auth={'src': "guest", 'dst': ['arbiter']})
self.host_model = Variable(name="HomoLRTransferVariable.host_model", auth={'src': "host", 'dst': ['arbiter']})
self.final_model = Variable(name="HomoLRTransferVariable.final_model", auth={'src': "arbiter", 'dst': ['guest', 'host']})
self.to_encrypt_model = Variable(name="HomoLRTransferVariable.to_encrypt_model", auth={'src': "host", 'dst': ['arbiter']})
self.re_encrypted_model = Variable(name="HomoLRTransferVariable.re_encrypted_model", auth={'src': "arbiter", 'dst': ['host']})
self.re_encrypt_times = Variable(name="HomoLRTransferVariable.re_encrypt_times", auth={'src': "host", 'dst': ['arbiter']})
self.converge_flag = Variable(name="HomoLRTransferVariable.converge_flag", auth={'src': "arbiter", 'dst': ['guest', 'host']})
self.guest_loss = Variable(name="HomoLRTransferVariable.guest_loss", auth={'src': "guest", 'dst': ['arbiter']})
self.host_loss = Variable(name="HomoLRTransferVariable.host_loss", auth={'src': "host", 'dst': ['arbiter']})
self.use_encrypt = Variable(name="HomoLRTransferVariable.use_encrypt", auth={'src': "host", 'dst': ['arbiter']})
self.guest_party_weight = Variable(name="HomoLRTransferVariable.guest_party_weight", auth={'src': "guest", 'dst': ['arbiter']})
self.host_party_weight = Variable(name="HomoLRTransferVariable.host_party_weight", auth={'src': "host", 'dst': ['arbiter']})
self.predict_wx = Variable(name="HomoLRTransferVariable.predict_wx", auth={'src': "host", 'dst': ['arbiter']})
self.predict_result = Variable(name="HomoLRTransferVariable.predict_result", auth={'src': "arbiter", 'dst': ['host']})
pass
class HeteroSecureBoostingTreeTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.tree_dim = Variable(name="HeteroSecureBoostingTreeTransferVariable.tree_dim", auth={'src': "guest", 'dst': ['host']})
self.stop_flag = Variable(name="HeteroSecureBoostingTreeTransferVariable.stop_flag", auth={'src': "guest", 'dst': ['host']})
pass
class HeteroDecisionTreeTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.encrypted_grad_and_hess = Variable(name="HeteroDecisionTreeTransferVariable.encrypted_grad_and_hess", auth={'src': "guest", 'dst': ['host']})
self.tree_node_queue = Variable(name="HeteroDecisionTreeTransferVariable.tree_node_queue", auth={'src': "guest", 'dst': ['host']})
self.node_positions = Variable(name="HeteroDecisionTreeTransferVariable.node_positions", auth={'src': "guest", 'dst': ['host']})
self.encrypted_splitinfo_host = Variable(name="HeteroDecisionTreeTransferVariable.encrypted_splitinfo_host", auth={'src': "host", 'dst': ['guest']})
self.federated_best_splitinfo_host = Variable(name="HeteroDecisionTreeTransferVariable.federated_best_splitinfo_host", auth={'src': "guest", 'dst': ['host']})
self.final_splitinfo_host = Variable(name="HeteroDecisionTreeTransferVariable.final_splitinfo_host", auth={'src': "host", 'dst': ['guest']})
self.dispatch_node_host = Variable(name="HeteroDecisionTreeTransferVariable.dispatch_node_host", auth={'src': "guest", 'dst': ['host']})
self.dispatch_node_host_result = Variable(name="HeteroDecisionTreeTransferVariable.dispatch_node_host_result", auth={'src': "host", 'dst': ['guest']})
self.tree = Variable(name="HeteroDecisionTreeTransferVariable.tree", auth={'src': "guest", 'dst': ['host']})
self.predict_data = Variable(name="HeteroDecisionTreeTransferVariable.predict_data", auth={'src': "guest", 'dst': ['host']})
self.predict_data_by_host = Variable(name="HeteroDecisionTreeTransferVariable.predict_data_by_host", auth={'src': "host", 'dst': ['guest']})
self.predict_finish_tag = Variable(name="HeteroDecisionTreeTransferVariable.predict_finish_tag", auth={'src': "guest", 'dst': ['host']})
pass
class HeteroWorkFlowTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.train_data = Variable(name="HeteroWorkFlowTransferVariable.train_data", auth={'src': "guest", 'dst': ['host']})
self.test_data = Variable(name="HeteroWorkFlowTransferVariable.test_data", auth={'src': "guest", 'dst': ['host']})
pass
class HeteroFTLTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.paillier_pubkey = Variable(name="HeteroFTLTransferVariable.paillier_pubkey", auth={'src': "arbiter", 'dst': ['host', 'guest']})
self.batch_data_index = Variable(name="HeteroFTLTransferVariable.batch_data_index", auth={'src': "guest", 'dst': ['host']})
self.host_component_list = Variable(name="HeteroFTLTransferVariable.host_component_list", auth={'src': "host", 'dst': ['guest']})
self.guest_component_list = Variable(name="HeteroFTLTransferVariable.guest_component_list", auth={'src': "guest", 'dst': ['host']})
self.host_precomputed_comp_list = Variable(name="HeteroFTLTransferVariable.host_precomputed_comp_list", auth={'src': "host", 'dst': ['guest']})
self.guest_precomputed_comp_list = Variable(name="HeteroFTLTransferVariable.guest_precomputed_comp_list", auth={'src': "guest", 'dst': ['host']})
self.encrypt_guest_gradient = Variable(name="HeteroFTLTransferVariable.encrypt_guest_gradient", auth={'src': "guest", 'dst': ['arbiter']})
self.decrypt_guest_gradient = Variable(name="HeteroFTLTransferVariable.decrypt_guest_gradient", auth={'src': "arbiter", 'dst': ['guest']})
self.encrypt_host_gradient = Variable(name="HeteroFTLTransferVariable.encrypt_host_gradient", auth={'src': "host", 'dst': ['arbiter']})
self.decrypt_host_gradient = Variable(name="HeteroFTLTransferVariable.decrypt_host_gradient", auth={'src': "arbiter", 'dst': ['host']})
self.encrypt_loss = Variable(name="HeteroFTLTransferVariable.encrypt_loss", auth={'src': "guest", 'dst': ['arbiter']})
self.is_encrypted_ftl_stopped = Variable(name="HeteroFTLTransferVariable.is_encrypted_ftl_stopped", auth={'src': "arbiter", 'dst': ['host', 'guest']})
self.is_stopped = Variable(name="HeteroFTLTransferVariable.is_stopped", auth={'src': "guest", 'dst': ['host']})
self.batch_size = Variable(name="HeteroFTLTransferVariable.batch_size", auth={'src': "guest", 'dst': ['host']})
self.batch_num = Variable(name="HeteroFTLTransferVariable.batch_num", auth={'src': "guest", 'dst': ['arbiter', 'host']})
self.host_prob = Variable(name="HeteroFTLTransferVariable.host_prob", auth={'src': "host", 'dst': ['guest']})
self.pred_prob = Variable(name="HeteroFTLTransferVariable.pred_prob", auth={'src': "guest", 'dst': ['host']})
self.encrypt_prob = Variable(name="HeteroFTLTransferVariable.encrypt_prob", auth={'src': "guest", 'dst': ['arbiter']})
self.decrypt_prob = Variable(name="HeteroFTLTransferVariable.decrypt_prob", auth={'src': "arbiter", 'dst': ['guest']})
self.guest_sample_indexes = Variable(name="HeteroFTLTransferVariable.guest_sample_indexes", auth={'src': "guest", 'dst': ['host']})
self.host_sample_indexes = Variable(name="HeteroFTLTransferVariable.host_sample_indexes", auth={'src': "host", 'dst': ['guest']})
self.guest_public_key = Variable(name="HeteroFTLTransferVariable.guest_public_key", auth={'src': "guest", 'dst': ['host']})
self.host_public_key = Variable(name="HeteroFTLTransferVariable.host_public_key", auth={'src': "host", 'dst': ['guest']})
self.masked_enc_guest_gradients = Variable(name="HeteroFTLTransferVariable.masked_enc_guest_gradients", auth={'src': "guest", 'dst': ['host']})
self.masked_enc_host_gradients = Variable(name="HeteroFTLTransferVariable.masked_enc_host_gradients", auth={'src': "host", 'dst': ['guest']})
self.masked_dec_guest_gradients = Variable(name="HeteroFTLTransferVariable.masked_dec_guest_gradients", auth={'src': "host", 'dst': ['guest']})
self.masked_dec_host_gradients = Variable(name="HeteroFTLTransferVariable.masked_dec_host_gradients", auth={'src': "guest", 'dst': ['host']})
self.masked_enc_loss = Variable(name="HeteroFTLTransferVariable.masked_enc_loss", auth={'src': "guest", 'dst': ['host']})
self.masked_dec_loss = Variable(name="HeteroFTLTransferVariable.masked_dec_loss", auth={'src': "host", 'dst': ['guest']})
self.is_decentralized_enc_ftl_stopped = Variable(name="HeteroFTLTransferVariable.is_decentralized_enc_ftl_stopped", auth={'src': "guest", 'dst': ['host']})
pass
class HeteroDNNLRTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.guest_dec_gradient = Variable(name="HeteroDNNLRTransferVariable.guest_dec_gradient", auth={'src': "arbiter", 'dst': ['guest']})
self.guest_enc_gradient = Variable(name="HeteroDNNLRTransferVariable.guest_enc_gradient", auth={'src': "guest", 'dst': ['arbiter']})
self.host_dec_gradient = Variable(name="HeteroDNNLRTransferVariable.host_dec_gradient", auth={'src': "arbiter", 'dst': ['host']})
self.host_enc_gradient = Variable(name="HeteroDNNLRTransferVariable.host_enc_gradient", auth={'src': "host", 'dst': ['arbiter']})
pass
class HeteroFeatureBinningTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.paillier_pubkey = Variable(name="HeteroFeatureBinningTransferVariable.paillier_pubkey", auth={'src': "guest", 'dst': ['host']})
self.encrypted_label = Variable(name="HeteroFeatureBinningTransferVariable.encrypted_label", auth={'src': "guest", 'dst': ['host']})
self.encrypted_bin_sum = Variable(name="HeteroFeatureBinningTransferVariable.encrypted_bin_sum", auth={'src': "host", 'dst': ['guest']})
pass
class HeteroFeatureSelectionTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.result_left_cols = Variable(name="HeteroFeatureSelectionTransferVariable.result_left_cols", auth={'src': "guest", 'dst': ['host']})
self.host_select_cols = Variable(name="HeteroFeatureSelectionTransferVariable.host_select_cols", auth={'src': "host", 'dst': ['guest']})
pass
class HeteroCorrelationTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.encrypted_data = Variable(name="HeteroCorrelationTransferVariable.encrypted_data", auth={'src': "guest", 'dst': ['host']})
self.inner_product = Variable(name="HeteroCorrelationTransferVariable.inner_product", auth={'src': "host", 'dst': ['guest']})
pass
class SecureAddExampleTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.guest_share = Variable(name="SecureAddExampleTransferVariable.guest_share", auth={'src': "guest", 'dst': ['host']})
self.host_share = Variable(name="SecureAddExampleTransferVariable.host_share", auth={'src': "host", 'dst': ['guest']})
self.host_sum = Variable(name="SecureAddExampleTransferVariable.host_sum", auth={'src': "host", 'dst': ['guest']})
pass
class SampleTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.sample_ids = Variable(name="SampleTransferVariable.sample_ids", auth={'src': "guest", 'dst': ['host']})
pass
class OneVsRestTransferVariable(BaseTransferVariable):
def define_transfer_variable(self):
self.host_classes = Variable(name="OneVsRestTransferVariable.host_classes", auth={'src': "host", 'dst': ['guest']})
self.aggregate_classes = Variable(name="OneVsRestTransferVariable.aggregate_classes", auth={'src': "guest", 'dst': ['host', 'arbiter']})
pass
| class Variable(object):
def __init__(self, name, auth):
self.name = name
self.auth = auth
class Basetransfervariable(object):
def __init__(self, flowid=0):
self.flowid = flowid
self.define_transfer_variable()
def set_flowid(self, flowid):
self.flowid = flowid
def generate_transferid(self, transfer_var, *suffix):
if transfer_var.name.split('.', -1)[-1] not in self.__dict__:
raise value_error('transfer variable not in class, please check if!!!')
transferid = transfer_var.name + '.' + str(self.flowid)
if suffix:
transferid += '.' + '.'.join(map(str, suffix))
return transferid
def define_transfer_variable(self):
pass
class Rsaintersecttransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.rsa_pubkey = variable(name='RsaIntersectTransferVariable.rsa_pubkey', auth={'src': 'host', 'dst': ['guest']})
self.intersect_guest_ids = variable(name='RsaIntersectTransferVariable.intersect_guest_ids', auth={'src': 'guest', 'dst': ['host']})
self.intersect_host_ids_process = variable(name='RsaIntersectTransferVariable.intersect_host_ids_process', auth={'src': 'host', 'dst': ['guest']})
self.intersect_guest_ids_process = variable(name='RsaIntersectTransferVariable.intersect_guest_ids_process', auth={'src': 'host', 'dst': ['guest']})
self.intersect_ids = variable(name='RsaIntersectTransferVariable.intersect_ids', auth={'src': 'guest', 'dst': ['host']})
pass
class Rawintersecttransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.send_ids_host = variable(name='RawIntersectTransferVariable.send_ids_host', auth={'src': 'host', 'dst': ['guest']})
self.send_ids_guest = variable(name='RawIntersectTransferVariable.send_ids_guest', auth={'src': 'guest', 'dst': ['host']})
self.intersect_ids_host = variable(name='RawIntersectTransferVariable.intersect_ids_host', auth={'src': 'host', 'dst': ['guest']})
self.intersect_ids_guest = variable(name='RawIntersectTransferVariable.intersect_ids_guest', auth={'src': 'guest', 'dst': ['host']})
pass
class Heterolrtransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.paillier_pubkey = variable(name='HeteroLRTransferVariable.paillier_pubkey', auth={'src': 'arbiter', 'dst': ['host', 'guest']})
self.batch_data_index = variable(name='HeteroLRTransferVariable.batch_data_index', auth={'src': 'guest', 'dst': ['host']})
self.host_forward_dict = variable(name='HeteroLRTransferVariable.host_forward_dict', auth={'src': 'host', 'dst': ['guest']})
self.fore_gradient = variable(name='HeteroLRTransferVariable.fore_gradient', auth={'src': 'guest', 'dst': ['host']})
self.guest_gradient = variable(name='HeteroLRTransferVariable.guest_gradient', auth={'src': 'guest', 'dst': ['arbiter']})
self.guest_optim_gradient = variable(name='HeteroLRTransferVariable.guest_optim_gradient', auth={'src': 'arbiter', 'dst': ['guest']})
self.host_loss_regular = variable(name='HeteroLRTransferVariable.host_loss_regular', auth={'src': 'host', 'dst': ['guest']})
self.loss = variable(name='HeteroLRTransferVariable.loss', auth={'src': 'guest', 'dst': ['arbiter']})
self.is_stopped = variable(name='HeteroLRTransferVariable.is_stopped', auth={'src': 'arbiter', 'dst': ['host', 'guest']})
self.batch_info = variable(name='HeteroLRTransferVariable.batch_info', auth={'src': 'guest', 'dst': ['host', 'arbiter']})
self.host_optim_gradient = variable(name='HeteroLRTransferVariable.host_optim_gradient', auth={'src': 'arbiter', 'dst': ['host']})
self.host_gradient = variable(name='HeteroLRTransferVariable.host_gradient', auth={'src': 'host', 'dst': ['arbiter']})
self.host_prob = variable(name='HeteroLRTransferVariable.host_prob', auth={'src': 'host', 'dst': ['guest']})
pass
class Homolrtransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.paillier_pubkey = variable(name='HomoLRTransferVariable.paillier_pubkey', auth={'src': 'arbiter', 'dst': ['host']})
self.guest_model = variable(name='HomoLRTransferVariable.guest_model', auth={'src': 'guest', 'dst': ['arbiter']})
self.host_model = variable(name='HomoLRTransferVariable.host_model', auth={'src': 'host', 'dst': ['arbiter']})
self.final_model = variable(name='HomoLRTransferVariable.final_model', auth={'src': 'arbiter', 'dst': ['guest', 'host']})
self.to_encrypt_model = variable(name='HomoLRTransferVariable.to_encrypt_model', auth={'src': 'host', 'dst': ['arbiter']})
self.re_encrypted_model = variable(name='HomoLRTransferVariable.re_encrypted_model', auth={'src': 'arbiter', 'dst': ['host']})
self.re_encrypt_times = variable(name='HomoLRTransferVariable.re_encrypt_times', auth={'src': 'host', 'dst': ['arbiter']})
self.converge_flag = variable(name='HomoLRTransferVariable.converge_flag', auth={'src': 'arbiter', 'dst': ['guest', 'host']})
self.guest_loss = variable(name='HomoLRTransferVariable.guest_loss', auth={'src': 'guest', 'dst': ['arbiter']})
self.host_loss = variable(name='HomoLRTransferVariable.host_loss', auth={'src': 'host', 'dst': ['arbiter']})
self.use_encrypt = variable(name='HomoLRTransferVariable.use_encrypt', auth={'src': 'host', 'dst': ['arbiter']})
self.guest_party_weight = variable(name='HomoLRTransferVariable.guest_party_weight', auth={'src': 'guest', 'dst': ['arbiter']})
self.host_party_weight = variable(name='HomoLRTransferVariable.host_party_weight', auth={'src': 'host', 'dst': ['arbiter']})
self.predict_wx = variable(name='HomoLRTransferVariable.predict_wx', auth={'src': 'host', 'dst': ['arbiter']})
self.predict_result = variable(name='HomoLRTransferVariable.predict_result', auth={'src': 'arbiter', 'dst': ['host']})
pass
class Heterosecureboostingtreetransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.tree_dim = variable(name='HeteroSecureBoostingTreeTransferVariable.tree_dim', auth={'src': 'guest', 'dst': ['host']})
self.stop_flag = variable(name='HeteroSecureBoostingTreeTransferVariable.stop_flag', auth={'src': 'guest', 'dst': ['host']})
pass
class Heterodecisiontreetransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.encrypted_grad_and_hess = variable(name='HeteroDecisionTreeTransferVariable.encrypted_grad_and_hess', auth={'src': 'guest', 'dst': ['host']})
self.tree_node_queue = variable(name='HeteroDecisionTreeTransferVariable.tree_node_queue', auth={'src': 'guest', 'dst': ['host']})
self.node_positions = variable(name='HeteroDecisionTreeTransferVariable.node_positions', auth={'src': 'guest', 'dst': ['host']})
self.encrypted_splitinfo_host = variable(name='HeteroDecisionTreeTransferVariable.encrypted_splitinfo_host', auth={'src': 'host', 'dst': ['guest']})
self.federated_best_splitinfo_host = variable(name='HeteroDecisionTreeTransferVariable.federated_best_splitinfo_host', auth={'src': 'guest', 'dst': ['host']})
self.final_splitinfo_host = variable(name='HeteroDecisionTreeTransferVariable.final_splitinfo_host', auth={'src': 'host', 'dst': ['guest']})
self.dispatch_node_host = variable(name='HeteroDecisionTreeTransferVariable.dispatch_node_host', auth={'src': 'guest', 'dst': ['host']})
self.dispatch_node_host_result = variable(name='HeteroDecisionTreeTransferVariable.dispatch_node_host_result', auth={'src': 'host', 'dst': ['guest']})
self.tree = variable(name='HeteroDecisionTreeTransferVariable.tree', auth={'src': 'guest', 'dst': ['host']})
self.predict_data = variable(name='HeteroDecisionTreeTransferVariable.predict_data', auth={'src': 'guest', 'dst': ['host']})
self.predict_data_by_host = variable(name='HeteroDecisionTreeTransferVariable.predict_data_by_host', auth={'src': 'host', 'dst': ['guest']})
self.predict_finish_tag = variable(name='HeteroDecisionTreeTransferVariable.predict_finish_tag', auth={'src': 'guest', 'dst': ['host']})
pass
class Heteroworkflowtransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.train_data = variable(name='HeteroWorkFlowTransferVariable.train_data', auth={'src': 'guest', 'dst': ['host']})
self.test_data = variable(name='HeteroWorkFlowTransferVariable.test_data', auth={'src': 'guest', 'dst': ['host']})
pass
class Heteroftltransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.paillier_pubkey = variable(name='HeteroFTLTransferVariable.paillier_pubkey', auth={'src': 'arbiter', 'dst': ['host', 'guest']})
self.batch_data_index = variable(name='HeteroFTLTransferVariable.batch_data_index', auth={'src': 'guest', 'dst': ['host']})
self.host_component_list = variable(name='HeteroFTLTransferVariable.host_component_list', auth={'src': 'host', 'dst': ['guest']})
self.guest_component_list = variable(name='HeteroFTLTransferVariable.guest_component_list', auth={'src': 'guest', 'dst': ['host']})
self.host_precomputed_comp_list = variable(name='HeteroFTLTransferVariable.host_precomputed_comp_list', auth={'src': 'host', 'dst': ['guest']})
self.guest_precomputed_comp_list = variable(name='HeteroFTLTransferVariable.guest_precomputed_comp_list', auth={'src': 'guest', 'dst': ['host']})
self.encrypt_guest_gradient = variable(name='HeteroFTLTransferVariable.encrypt_guest_gradient', auth={'src': 'guest', 'dst': ['arbiter']})
self.decrypt_guest_gradient = variable(name='HeteroFTLTransferVariable.decrypt_guest_gradient', auth={'src': 'arbiter', 'dst': ['guest']})
self.encrypt_host_gradient = variable(name='HeteroFTLTransferVariable.encrypt_host_gradient', auth={'src': 'host', 'dst': ['arbiter']})
self.decrypt_host_gradient = variable(name='HeteroFTLTransferVariable.decrypt_host_gradient', auth={'src': 'arbiter', 'dst': ['host']})
self.encrypt_loss = variable(name='HeteroFTLTransferVariable.encrypt_loss', auth={'src': 'guest', 'dst': ['arbiter']})
self.is_encrypted_ftl_stopped = variable(name='HeteroFTLTransferVariable.is_encrypted_ftl_stopped', auth={'src': 'arbiter', 'dst': ['host', 'guest']})
self.is_stopped = variable(name='HeteroFTLTransferVariable.is_stopped', auth={'src': 'guest', 'dst': ['host']})
self.batch_size = variable(name='HeteroFTLTransferVariable.batch_size', auth={'src': 'guest', 'dst': ['host']})
self.batch_num = variable(name='HeteroFTLTransferVariable.batch_num', auth={'src': 'guest', 'dst': ['arbiter', 'host']})
self.host_prob = variable(name='HeteroFTLTransferVariable.host_prob', auth={'src': 'host', 'dst': ['guest']})
self.pred_prob = variable(name='HeteroFTLTransferVariable.pred_prob', auth={'src': 'guest', 'dst': ['host']})
self.encrypt_prob = variable(name='HeteroFTLTransferVariable.encrypt_prob', auth={'src': 'guest', 'dst': ['arbiter']})
self.decrypt_prob = variable(name='HeteroFTLTransferVariable.decrypt_prob', auth={'src': 'arbiter', 'dst': ['guest']})
self.guest_sample_indexes = variable(name='HeteroFTLTransferVariable.guest_sample_indexes', auth={'src': 'guest', 'dst': ['host']})
self.host_sample_indexes = variable(name='HeteroFTLTransferVariable.host_sample_indexes', auth={'src': 'host', 'dst': ['guest']})
self.guest_public_key = variable(name='HeteroFTLTransferVariable.guest_public_key', auth={'src': 'guest', 'dst': ['host']})
self.host_public_key = variable(name='HeteroFTLTransferVariable.host_public_key', auth={'src': 'host', 'dst': ['guest']})
self.masked_enc_guest_gradients = variable(name='HeteroFTLTransferVariable.masked_enc_guest_gradients', auth={'src': 'guest', 'dst': ['host']})
self.masked_enc_host_gradients = variable(name='HeteroFTLTransferVariable.masked_enc_host_gradients', auth={'src': 'host', 'dst': ['guest']})
self.masked_dec_guest_gradients = variable(name='HeteroFTLTransferVariable.masked_dec_guest_gradients', auth={'src': 'host', 'dst': ['guest']})
self.masked_dec_host_gradients = variable(name='HeteroFTLTransferVariable.masked_dec_host_gradients', auth={'src': 'guest', 'dst': ['host']})
self.masked_enc_loss = variable(name='HeteroFTLTransferVariable.masked_enc_loss', auth={'src': 'guest', 'dst': ['host']})
self.masked_dec_loss = variable(name='HeteroFTLTransferVariable.masked_dec_loss', auth={'src': 'host', 'dst': ['guest']})
self.is_decentralized_enc_ftl_stopped = variable(name='HeteroFTLTransferVariable.is_decentralized_enc_ftl_stopped', auth={'src': 'guest', 'dst': ['host']})
pass
class Heterodnnlrtransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.guest_dec_gradient = variable(name='HeteroDNNLRTransferVariable.guest_dec_gradient', auth={'src': 'arbiter', 'dst': ['guest']})
self.guest_enc_gradient = variable(name='HeteroDNNLRTransferVariable.guest_enc_gradient', auth={'src': 'guest', 'dst': ['arbiter']})
self.host_dec_gradient = variable(name='HeteroDNNLRTransferVariable.host_dec_gradient', auth={'src': 'arbiter', 'dst': ['host']})
self.host_enc_gradient = variable(name='HeteroDNNLRTransferVariable.host_enc_gradient', auth={'src': 'host', 'dst': ['arbiter']})
pass
class Heterofeaturebinningtransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.paillier_pubkey = variable(name='HeteroFeatureBinningTransferVariable.paillier_pubkey', auth={'src': 'guest', 'dst': ['host']})
self.encrypted_label = variable(name='HeteroFeatureBinningTransferVariable.encrypted_label', auth={'src': 'guest', 'dst': ['host']})
self.encrypted_bin_sum = variable(name='HeteroFeatureBinningTransferVariable.encrypted_bin_sum', auth={'src': 'host', 'dst': ['guest']})
pass
class Heterofeatureselectiontransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.result_left_cols = variable(name='HeteroFeatureSelectionTransferVariable.result_left_cols', auth={'src': 'guest', 'dst': ['host']})
self.host_select_cols = variable(name='HeteroFeatureSelectionTransferVariable.host_select_cols', auth={'src': 'host', 'dst': ['guest']})
pass
class Heterocorrelationtransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.encrypted_data = variable(name='HeteroCorrelationTransferVariable.encrypted_data', auth={'src': 'guest', 'dst': ['host']})
self.inner_product = variable(name='HeteroCorrelationTransferVariable.inner_product', auth={'src': 'host', 'dst': ['guest']})
pass
class Secureaddexampletransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.guest_share = variable(name='SecureAddExampleTransferVariable.guest_share', auth={'src': 'guest', 'dst': ['host']})
self.host_share = variable(name='SecureAddExampleTransferVariable.host_share', auth={'src': 'host', 'dst': ['guest']})
self.host_sum = variable(name='SecureAddExampleTransferVariable.host_sum', auth={'src': 'host', 'dst': ['guest']})
pass
class Sampletransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.sample_ids = variable(name='SampleTransferVariable.sample_ids', auth={'src': 'guest', 'dst': ['host']})
pass
class Onevsresttransfervariable(BaseTransferVariable):
def define_transfer_variable(self):
self.host_classes = variable(name='OneVsRestTransferVariable.host_classes', auth={'src': 'host', 'dst': ['guest']})
self.aggregate_classes = variable(name='OneVsRestTransferVariable.aggregate_classes', auth={'src': 'guest', 'dst': ['host', 'arbiter']})
pass |
class Solution:
def fourSum(self, nums: List[int], target: int) -> List[List[int]]:
nums.sort()
print(nums)
result =[]
for i in range(len(nums)):
if i> 0 and nums[i] == nums[i-1]:
continue
# print('4sum',nums[i],target- nums[i])
tmp = self.threeSum(i+1,nums,target- nums[i])
# print(tmp)
for t in tmp:
result.append([nums[i],t[0],t[1],t[2]])
return result
def threeSum(self,index, nums: List[int],tar) -> List[List[int]]:
nums.sort()
appear= set([])
result = []
for i in range(index,len(nums)):
#print('3sum',nums[i],tar- nums[i])
tmp = self.twoSum(nums,i+1,tar-nums[i])
for t in tmp:
if (nums[i],t[0],t[1]) not in appear:
merge = [nums[i]] + [*t]
result.append([*merge])
appear.add((nums[i],t[0],t[1]))
return result
def twoSum(self,nums,index,tar):
# print('twoSum',nums[index:])
left,right = index,len(nums)-1
appear = set([])
result = []
while left < right:
if nums[left] + nums[right] == tar:
# print("2sum found",)
if (nums[left], nums[right]) not in appear:
result.append([nums[left], nums[right]])
appear.add((nums[left], nums[right]))
left += 1
elif nums[left] + nums[right] < tar:
left += 1
elif nums[left] + nums[right] > tar:
right -= 1
# print('2sum',result)
return result | class Solution:
def four_sum(self, nums: List[int], target: int) -> List[List[int]]:
nums.sort()
print(nums)
result = []
for i in range(len(nums)):
if i > 0 and nums[i] == nums[i - 1]:
continue
tmp = self.threeSum(i + 1, nums, target - nums[i])
for t in tmp:
result.append([nums[i], t[0], t[1], t[2]])
return result
def three_sum(self, index, nums: List[int], tar) -> List[List[int]]:
nums.sort()
appear = set([])
result = []
for i in range(index, len(nums)):
tmp = self.twoSum(nums, i + 1, tar - nums[i])
for t in tmp:
if (nums[i], t[0], t[1]) not in appear:
merge = [nums[i]] + [*t]
result.append([*merge])
appear.add((nums[i], t[0], t[1]))
return result
def two_sum(self, nums, index, tar):
(left, right) = (index, len(nums) - 1)
appear = set([])
result = []
while left < right:
if nums[left] + nums[right] == tar:
if (nums[left], nums[right]) not in appear:
result.append([nums[left], nums[right]])
appear.add((nums[left], nums[right]))
left += 1
elif nums[left] + nums[right] < tar:
left += 1
elif nums[left] + nums[right] > tar:
right -= 1
return result |
'''
Recall from the video that a pivot table allows you to see all of your variables as a function of two other variables. In this exercise, you will use the .pivot_table() method to see how the users DataFrame entries appear when presented as functions of the 'weekday' and 'city' columns. That is, with the rows indexed by 'weekday' and the columns indexed by 'city'.
Before using the pivot table, print the users DataFrame in the IPython Shell and observe the layout.
'''
# Create the DataFrame with the appropriate pivot table: by_city_day
by_city_day = users.pivot_table(index='weekday',
columns='city',
values=['visitors', 'signups'])
# Print by_city_day
print(by_city_day)
| """
Recall from the video that a pivot table allows you to see all of your variables as a function of two other variables. In this exercise, you will use the .pivot_table() method to see how the users DataFrame entries appear when presented as functions of the 'weekday' and 'city' columns. That is, with the rows indexed by 'weekday' and the columns indexed by 'city'.
Before using the pivot table, print the users DataFrame in the IPython Shell and observe the layout.
"""
by_city_day = users.pivot_table(index='weekday', columns='city', values=['visitors', 'signups'])
print(by_city_day) |
def validBraces(string):
buffer = []
for i in string:
if i == '(' or i == '[' or i == '{':
buffer.append(i)
else:
try:
a = buffer.pop()
except IndexError:
return False
if i == ')' and a != '(':
return False
elif i == ']' and a != '[':
return False
elif i == '}' and a != '{':
return False
if buffer:
return False
else:
return True
| def valid_braces(string):
buffer = []
for i in string:
if i == '(' or i == '[' or i == '{':
buffer.append(i)
else:
try:
a = buffer.pop()
except IndexError:
return False
if i == ')' and a != '(':
return False
elif i == ']' and a != '[':
return False
elif i == '}' and a != '{':
return False
if buffer:
return False
else:
return True |
point_1 = Point(IN1, IN2)
point_2 = Point(IN3, IN4)
point_1.switch_point(1)
print("Point 1 right")
point_2.switch_point(1)
print("Point 2 right")
train = Locomotive(1)
track_enable(1)
print("Throttle 0, 70")
while GPIO.input(T6) == GPIO.HIGH:
train.throttle(0, 70)
train.stop()
print("train stop")
print("Throttle 1, 100")
while GPIO.input(T5) == GPIO.HIGH:
train.throttle(1, 100)
train.stop()
print("train stop")
point_1.switch_point(0)
print("Point 1 left")
point_2.switch_point(0)
print("Point 2 left")
print("Throttle 0, 70")
while GPIO.input(T1) == GPIO.HIGH:
train.throttle(0, 70)
train.stop()
print("train stop") | point_1 = point(IN1, IN2)
point_2 = point(IN3, IN4)
point_1.switch_point(1)
print('Point 1 right')
point_2.switch_point(1)
print('Point 2 right')
train = locomotive(1)
track_enable(1)
print('Throttle 0, 70')
while GPIO.input(T6) == GPIO.HIGH:
train.throttle(0, 70)
train.stop()
print('train stop')
print('Throttle 1, 100')
while GPIO.input(T5) == GPIO.HIGH:
train.throttle(1, 100)
train.stop()
print('train stop')
point_1.switch_point(0)
print('Point 1 left')
point_2.switch_point(0)
print('Point 2 left')
print('Throttle 0, 70')
while GPIO.input(T1) == GPIO.HIGH:
train.throttle(0, 70)
train.stop()
print('train stop') |
class Solution:
def findFrequentTreeSum(self, root: Optional[TreeNode]) -> List[int]:
if root is None:
return []
count = Counter()
def dfs(root: Optional[TreeNode]) -> int:
if root is None:
return 0
sum = root.val + dfs(root.left) + dfs(root.right)
count[sum] += 1
return sum
dfs(root)
maxFreq = max(count.values())
return [sum for sum in count if count[sum] == maxFreq]
| class Solution:
def find_frequent_tree_sum(self, root: Optional[TreeNode]) -> List[int]:
if root is None:
return []
count = counter()
def dfs(root: Optional[TreeNode]) -> int:
if root is None:
return 0
sum = root.val + dfs(root.left) + dfs(root.right)
count[sum] += 1
return sum
dfs(root)
max_freq = max(count.values())
return [sum for sum in count if count[sum] == maxFreq] |
#
# Dutch National Flag
# in-place
def dutch_flag_sort(balls):
r = -1 # red pointer
g = -1 # green pointer
i = 0 # current pointer
while (i < len(balls)):
if balls[i] == 'G':
g += 1
balls[i], balls[g] = balls[g], balls[i]
elif (balls[i] == "R"):
g += 1
balls[i], balls[g] = balls[g], balls[i]
r += 1
balls[g], balls[r] = balls[r], balls[g]
i += 1 | def dutch_flag_sort(balls):
r = -1
g = -1
i = 0
while i < len(balls):
if balls[i] == 'G':
g += 1
(balls[i], balls[g]) = (balls[g], balls[i])
elif balls[i] == 'R':
g += 1
(balls[i], balls[g]) = (balls[g], balls[i])
r += 1
(balls[g], balls[r]) = (balls[r], balls[g])
i += 1 |
load("//packages/bazel:index.bzl", "protractor_web_test_suite")
load("//tools:defaults.bzl", "ts_library")
def example_test(name, srcs, server, data = [], **kwargs):
ts_library(
name = "%s_lib" % name,
testonly = True,
srcs = srcs,
tsconfig = "//modules/playground:tsconfig-e2e.json",
deps = [
"//modules/e2e_util",
"//packages/private/testing",
"@ngdeps//@types/jasminewd2",
"@ngdeps//@types/selenium-webdriver",
"@ngdeps//protractor",
],
)
protractor_web_test_suite(
name = "protractor_tests",
data = ["//packages/bazel/src/protractor/utils"] + data,
on_prepare = "//modules/playground/e2e_test:start-server.js",
server = server,
deps = [
":%s_lib" % name,
"@ngdeps//protractor",
"@ngdeps//selenium-webdriver",
"@ngdeps//yargs",
"@ngdeps//source-map",
],
**kwargs
)
| load('//packages/bazel:index.bzl', 'protractor_web_test_suite')
load('//tools:defaults.bzl', 'ts_library')
def example_test(name, srcs, server, data=[], **kwargs):
ts_library(name='%s_lib' % name, testonly=True, srcs=srcs, tsconfig='//modules/playground:tsconfig-e2e.json', deps=['//modules/e2e_util', '//packages/private/testing', '@ngdeps//@types/jasminewd2', '@ngdeps//@types/selenium-webdriver', '@ngdeps//protractor'])
protractor_web_test_suite(name='protractor_tests', data=['//packages/bazel/src/protractor/utils'] + data, on_prepare='//modules/playground/e2e_test:start-server.js', server=server, deps=[':%s_lib' % name, '@ngdeps//protractor', '@ngdeps//selenium-webdriver', '@ngdeps//yargs', '@ngdeps//source-map'], **kwargs) |
class Collectionitem:
collectionitemcnt = 0
def __init__(self, colldict):
self.colldict = colldict
Collectionitem.collectionitemcnt+=1
def birthyearcreator1(self):
if ("birth_year" in self.colldict['creators'][0]):
byear = self.colldict['creators'][0]['birth_year']
else:
byear = "Unknown"
return byear
def birthyearsall(self):
byearlist = [item.get('birth_year') for item in \
self.colldict['creators']]
return byearlist
def ncreators(self):
return len(self.colldict['creators'])
def ncitations(self):
return len(self.colldict['citations'])
| class Collectionitem:
collectionitemcnt = 0
def __init__(self, colldict):
self.colldict = colldict
Collectionitem.collectionitemcnt += 1
def birthyearcreator1(self):
if 'birth_year' in self.colldict['creators'][0]:
byear = self.colldict['creators'][0]['birth_year']
else:
byear = 'Unknown'
return byear
def birthyearsall(self):
byearlist = [item.get('birth_year') for item in self.colldict['creators']]
return byearlist
def ncreators(self):
return len(self.colldict['creators'])
def ncitations(self):
return len(self.colldict['citations']) |
# Python Object Oriented Programming by Joe Marini course example
# Using the __str__ and __repr__ magic methods
class Book:
def __init__(self, title, author, price):
super().__init__()
self.title = title
self.author = author
self.price = price
self._discount = 0.1
# The __str__ function is used to return a user-friendly string
# representation of the object
def __str__(self):
return f"{self.title} by {self.author}, costs {self.price}"
# TODO: __getattribute__ called when an attr is retrieved. Don't
# directly access the attr name otherwise a recursive loop is created
def __getattribute__(self, name: str):
if name == 'price':
p = super().__getattribute__('price')
d = super().__getattribute__('_discount')
return p - p * d
return super().__getattribute__(name)
# TODO: __setattr__ called when an attribute value is set. Don't set the attr
# directly here otherwise a recursive loop causes a crash
def __setattr__(self, name: str, value) -> None:
if name == 'price' and type(value) is not float:
raise ValueError('Price value must be float')
return super().__setattr__(name, value)
# TODO: __getattr__ called when __getattribute__ lookup fails - you can
# pretty much generate attributes on the fly with this method
def __getattr__(self, name):
return f"{name} property not found"
b1 = Book("War and Peace", "Leo Tolstoy", 39.95)
b2 = Book("The Catcher in the Rye", "JD Salinger", 29.95)
# Try setting and accessing the price
b1.price = 38.95
print(b1)
b2.price = float(40) # using an int will raise an exception
print(b2)
# If an attribute doesn't exist, __getattr__ will be called
print(b1.randomprop)
| class Book:
def __init__(self, title, author, price):
super().__init__()
self.title = title
self.author = author
self.price = price
self._discount = 0.1
def __str__(self):
return f'{self.title} by {self.author}, costs {self.price}'
def __getattribute__(self, name: str):
if name == 'price':
p = super().__getattribute__('price')
d = super().__getattribute__('_discount')
return p - p * d
return super().__getattribute__(name)
def __setattr__(self, name: str, value) -> None:
if name == 'price' and type(value) is not float:
raise value_error('Price value must be float')
return super().__setattr__(name, value)
def __getattr__(self, name):
return f'{name} property not found'
b1 = book('War and Peace', 'Leo Tolstoy', 39.95)
b2 = book('The Catcher in the Rye', 'JD Salinger', 29.95)
b1.price = 38.95
print(b1)
b2.price = float(40)
print(b2)
print(b1.randomprop) |
TAPIERROR_LOGIN = 10001
TAPIERROR_LOGIN_USER = 10002
TAPIERROR_LOGIN_DDA = 10003
TAPIERROR_LOGIN_LICENSE = 10004
TAPIERROR_LOGIN_MODULE = 10005
TAPIERROR_LOGIN_FORCE = 10006
TAPIERROR_LOGIN_STATE = 10007
TAPIERROR_LOGIN_PASS = 10008
TAPIERROR_LOGIN_RIGHT = 10009
TAPIERROR_LOGIN_COUNT = 10010
TAPIERROR_LOGIN_NOTIN_SERVERFLAGUSRES = 10011
TAPIERROR_LOGIN_FREEZE = 10012
TAPIERROR_LOGIN_TOFREEZE = 10013
TAPIERROR_LOGIN_ACCOUNTSTATE = 10014
TAPIERROR_LOGIN_SECCERTIFI = 10015
TAPIERROR_LOGIN_NOSECONDSET = 10016
TAPIERROR_LOGIN_NOTURSTHOST = 10017
TAPITAPIERROR_SECONDCERTIFICATION_FAIL = 14001
TAPITAPIERROR_SECONDCERTIFICATION_TIMEOVER = 14002
TAPIERROR_CONN_DATABASE = 11000
TAPIERROR_OPER_DATABASE = 11001
TAPIERROR_NEED_ONETOONE = 11002
TAPIERROR_EXIST_RELATEINFO = 11003
TAPIERROR_EXIST_RELATEINFOOFGROUP = 11004
TAPIERROR_USERPASSWORD_MOD_SOURCE = 12001
TAPIERROR_USERPASSWORD_MOD_SAME = 12002
TAPIERROR_USERPASSWORD_MOD_COMPLEXITY = 12003
TAPIERROR_CURRENCY_ONLY_ONEBASE = 13001
TAPIERROR_CURRENCY_ONLY_USDHKD = 13002
TAPIERROR_ORDERINSERT_ACCOUNT = 60001
TAPIERROR_ORDERINSERT_ACCOUNT_STATE = 60002
TAPIERROR_ORDERINSERT_TRADECENT_ERROR = 60003
TAPIERROR_ORDERINSERT_CONTRACT = 60011
TAPIERROR_ORDERINSERT_LME_NOTREADY = 60012
TAPIERROR_ORDERINSERT_ERROR_ORDER_TYPE = 60013
TAPIERROR_ORDERINSERT_READY_TYPE_ERROR = 60014
TAPIERROR_ORDERINSERT_ORDER_TYPE_ERROR = 60015
TAPIERROR_ORDER_NOTRADE_ACCOUNT = 60021
TAPIERROR_ORDER_NOTRADE_COM_GROUP = 60022
TAPIERROR_ORDER_NOTRADE_ACC_CONTRACT = 60023
TAPIERROR_ORDER_NOTRADE_SYSTEM = 60024
TAPIERROR_ORDER_CLOSE_ACCOUNT = 60025
TAPIERROR_ORDER_CLOSE_ACC_CONTRACT = 60026
TAPIERROR_ORDER_CLOSE_SYSTEM = 60027
TAPIERROR_ORDER_CLOSE_DAYS = 60028
TAPIERROR_ORDER_NOTRADE_RISK = 60029
TAPIERROR_ORDER_CLOSE_RISK = 60030
TAPIERROR_ORDERINSERT_POSITIONMAX = 60031
TAPIERROR_ORDERINSERT_ONCEMAX = 60032
TAPIERROR_ORDERINSERT_TRADEROUTE = 60033
TAPIERROR_ORDER_IN_MOD_PRICE_ERROR = 60034
TAPIERROR_ORDER_IN_GIVEUP_POS_MAX = 60035
TAPIERROR_UPPERCHANNEL_NOT_LOGIN = 60041
TAPIERROR_UPPERCHANNEL_NOT_FOUND = 60042
TAPIERROR_ORDERINSERT_NOTENOUGHFUND = 60051
TAPIERROR_ORDERINSERT_FEE = 60052
TAPIERROR_ORDERINSERT_MARGIN = 60053
TAPIERROR_ORDERINSERT_BASENOFUND = 60054
TAPIERROR_ORDERINSERT_MARGINAMOUNT = 60055
TAPIERROR_ORDERINSERT_OPENRATIO = 60056
TAPIERROR_ORDERINSERT_GROUP_OPENRATIO = 60057
TAPIERROR_ORDERINSERT_RISKARRAY = 60058
TAPIERROR_ORDERDELETE_NOT_SYSNO = 60061
TAPIERROR_ORDERDELETE_NOT_STATE = 60062
TAPIERROR_ORDERDELETE_NO_INPUT = 60063
TAPIERROR_ORDERMODIFY_NOT_STATE = 60071
TAPIERROR_ORDERMODIFY_BACK_INPUT = 60072
TAPIERROR_ORDERMODIFY_RISK_ORDER = 60073
TAPIERROR_ORDERMODIFY_ERROR_QTY = 60074
TAPIERROR_ORDERMODIFY_ERROR_READY = 60075
TAPIERROR_ORDERINPUT_CANNOTMOVE = 60081
TAPIERROR_ORDERINPUT_REPEAT = 60091
TAPIERROR_CONTRACT_QUOTE = 60101
TAPIERROR_UPPER_ONCEMAX = 60111
TAPIERROR_UPPER_POSITIONMAX = 60112
TAPIERROR_ORDERINSERT_CLOSEMODE = 60121
TAPIERROR_CLOSE_ORDER = 60122
TAPIERROR_CLOSE_MATCH = 60123
TAPIERROR_MOD_DEL_NO_ORDER = 60131
TAPIERROR_MOD_DEL_GATEWAY_DISCON = 60132
TAPIERROR_MATCHINPUT_REPEAT = 60141
TAPIERROR_MATCHINPUT_NO_ORDER = 60142
TAPIERROR_MATCHINPUT_NO_CONTRACT = 60143
TAPIERROR_MATCHINPUT_PARM_ERROR = 60144
TAPIERROR_MATCHINPUT_OSTATE_ERROR = 60145
TAPIERROR_MATCHREMOVE_NO_MATCH = 60151
TAPIERROR_MATCHREMOVE_STATE_ERROR = 60152
TAPIERROR_ORDERINPUT_STATE_ERROR = 60161
TAPIERROR_ORDERINPUT_MOD_ERROR = 60162
TAPIERROR_ORDERREMOVE_ERROR = 60163
TAPIERROR_ORDERINPUT_MOD_STATE_ERROR = 60164
TAPIERROR_ORDEREXCHANGE_STATE_ERROR = 60165
TAPIERROR_ORDERREMOVE_NOT_ERROR = 60166
TAPIERROR_ORDERMARKET_DELETE_NOTFOUND = 60171
TAPIERROR_ORDERMARKET_DEL_ACCOUNT_NE = 60172
TAPIERROR_ORDERMARKET_DEL_COMMODITY_NE = 60173
TAPIERROR_ORDERMARKET_DEL_CONTRACT_NE = 60174
TAPIERROR_ORDERMARKET_DEL_SIDE_EQ = 60175
TAPIERROR_ORDERMARKET_DEL_SIDE_ERROR = 60176
TAPIERROR_ORDERMARKET_OTHER_SIDE_ERROR = 60177
TAPIERROR_ORDERACTIVATE_NOTFOUND_ERROR = 60181
TAPIERROR_ORDERACTIVATE_STATE_ERROR = 60182
TAPIERROR_GW_NOT_READY = 80001
TAPIERROR_GW_INVALID_COMMODITY = 80002
TAPIERROR_GW_INVALID_CONTRACT = 80003
TAPIERROR_GW_INVALID_FIELD = 80004
TAPIERROR_GW_INVALID_PRICE = 80005
TAPIERROR_GW_INVALID_VOLUME = 80006
TAPIERROR_GW_INVALID_TYPE = 80007
TAPIERROR_GW_INVALID_MODE = 80008
TAPIERROR_GW_ORDER_NOT_EXIST = 80009
TAPIERROR_GW_SEND_FAIL = 80010
TAPIERROR_GW_REJ_BYUPPER = 80011
TAPIERROR_TRADEFRONT_MODULETYPEERR = 90001
TAPIERROR_TRADEFRONT_TOOMANYDATA = 90002
TAPIERROR_TRADEFRONT_NODATA = 90003
TAPIERROT_TRADEFRONT_NOUSER = 90004
TAPIERROR_TRADEFRONT_DISCONNECT_TRADE = 90011
TAPIERROR_TRADEFRONT_DISCONNECT_MANAGE = 90012
TAPIERROR_TRADEFRONT_ACCOUNT = 90021
TAPIERROR_TRADEFRONT_ORDER = 90022
TAPIERROR_TRADEFRONT_FREQUENCY = 90023
TAPIERROR_TRADEFRONT_RUFUSE = 90024
TAPIERROR_TRADEFRONT_SELFMATCH = 90025
TAPIERROR_SUCCEED = 0
TAPIERROR_ConnectFail = -1
TAPIERROR_LinkAuthFail = -2
TAPIERROR_HostUnavailable = -3
TAPIERROR_SendDataError = -4
TAPIERROR_TestIDError = -5
TAPIERROR_NotReadyTestNetwork = -6
TAPIERROR_CurTestNotOver = -7
TAPIERROR_NOFrontAvailable = -8
TAPIERROR_DataPathAvaiable = -9
TAPIERROR_RepeatLogin = -10
TAPIERROR_InnerError = -11
TAPIERROR_LastReqNotFinish = -12
TAPIERROR_InputValueError = -13
TAPIERROR_AuthCode_Invalid = -14
TAPIERROR_AuthCode_Expired = -15
TAPIERROR_AuthCode_TypeNotMatch = -16
TAPIERROR_API_NotReady = -17
TAPIERROR_UDP_LISTEN_FAILED = -18
TAPIERROR_UDP_LISTENING = -19
TAPIERROR_NotImplemented = -20
TAPIERROR_CallOneTimeOnly = -21
TAPIERROR_ORDER_FREQUENCY = -22
TAPIERROR_RENTQRY_TOOFAST = -23
TAPIERROR_CALL_NOCONDITION = -24
TAPIERROR_ORDER_NOTFOUND = -25
TAPIERROR_LOGPATH_EMPTY = -26
TAPIERROR_LOGPATH_FAILOPEN = -27
TAPIERROR_RIGHT_TRADER = -28
TAPIERROR_RIGHT_ORDERINPUT = -29
TAPIERROR_RIGHT_LOCALOPERATION = -30
TAPIERROR_RIGHT_ORDERTRANSFER = -31
TAPIERROR_FILLINPUT_SYSTEMNO = -32
TAPIERROR_FILLREMOVE_MATCHNO = -33
TAPIERROR_FILLREQMOVE_NOFUND = -34
TAPIERROR_LOCALMODIFY_ACCOUNT = -35
TAPIERROR_LOCALTRANSFER_ACCOUNT = -36
TAPIERROR_INPUTERROR_PHONE = -37
TAPIERROR_ERROR_CONTACT = -38
TAPIERROR_ERROR_REJESTVERTIFICATE = -39
TAPIERROR_RIGHT_SETPASSWORD = -40
TAPIERROR_RISK_OPERERROR = -41
TAPIERROR_ORDER_MODACCOUNT = -42
TAPIERROR_INPUTERROR_NULL = -10000
TAPIERROR_INPUTERROR_TAPIYNFLAG = -10001
TAPIERROR_INPUTERROR_TAPILOGLEVEL = -10002
TAPIERROR_INPUTERROR_TAPICommodityType = -10003
TAPIERROR_INPUTERROR_TAPICallOrPutFlagType = -10004
TAPIERROR_INPUTERROR_TAPIBucketDateFlag = -11001
TAPIERROR_INPUTERROR_TAPIHisQuoteType = -11002
TAPIERROR_INPUTERROR_TAPIAccountType = -12001
TAPIERROR_INPUTERROR_TAPIUserTypeType = -12002
TAPIERROR_INPUTERROR_TAPIAccountState = -12003
TAPIERROR_INPUTERROR_TAPIAccountFamilyType = -12004
TAPIERROR_INPUTERROR_TAPIOrderTypeType = -12005
TAPIERROR_INPUTERROR_TAPIOrderSourceType = -12006
TAPIERROR_INPUTERROR_TAPITimeInForceType = -12007
TAPIERROR_INPUTERROR_TAPISideType = -12008
TAPIERROR_INPUTERROR_TAPIPositionEffectType = -12009
TAPIERROR_INPUTERROR_TAPIHedgeFlagType = -12010
TAPIERROR_INPUTERROR_TAPIOrderStateType = -12011
TAPIERROR_INPUTERROR_TAPICalculateModeType = -12012
TAPIERROR_INPUTERROR_TAPIMatchSourceType = -12013
TAPIERROR_INPUTERROR_TAPIOpenCloseModeType = -12014
TAPIERROR_INPUTERROR_TAPIFutureAlgType = -12015
TAPIERROR_INPUTERROR_TAPIOptionAlgType = -12016
TAPIERROR_INPUTERROR_TAPIBankAccountLWFlagType = -12017
TAPIERROR_INPUTERROR_TAPIBankAccountStateType = -12018
TAPIERROR_INPUTERROR_TAPIBankAccountSwapStateType = -12019
TAPIERROR_INPUTERROR_TAPIBankAccountTransferStateType = -12020
TAPIERROR_INPUTERROR_TAPIMarginCalculateModeType = -12021
TAPIERROR_INPUTERROR_TAPIOptionMarginCalculateModeType = -12022
TAPIERROR_INPUTERROR_TAPICmbDirectType = -12023
TAPIERROR_INPUTERROR_TAPIDeliveryModeType = -12024
TAPIERROR_INPUTERROR_TAPIContractTypeType = -12025
TAPIERROR_INPUTERROR_TAPIPartyTypeType = -12026
TAPIERROR_INPUTERROR_TAPIPartyCertificateTypeType = -12027
TAPIERROR_INPUTERROR_TAPIMsgReceiverType = -12028
TAPIERROR_INPUTERROR_TAPIMsgTypeType = -12029
TAPIERROR_INPUTERROR_TAPIMsgLevelType = -12030
TAPIERROR_INPUTERROR_TAPITransferDirectType = -12031
TAPIERROR_INPUTERROR_TAPITransferStateType = -12032
TAPIERROR_INPUTERROR_TAPITransferTypeType = -12033
TAPIERROR_INPUTERROR_TAPITransferDeviceIDType = -12034
TAPIERROR_INPUTERROR_TAPITacticsTypeType = -12035
TAPIERROR_INPUTERROR_TAPIORDERACT = -12036
TAPIERROR_INPUTERROR_TAPIBillTypeType = -12037
TAPIERROR_INPUTERROR_TAPIBillFileTypeType = -12038
TAPIERROR_INPUTERROR_TAPIOFFFlagType = -12039
TAPIERROR_INPUTERROR_TAPICashAdjustTypeType = -12040
TAPIERROR_INPUTERROR_TAPITriggerConditionType = -12041
TAPIERROR_INPUTERROR_TAPITriggerPriceTypeType = -12042
TAPIERROR_INPUTERROR_TAPITradingStateType = -12043
TAPIERROR_INPUTERROR_TAPIMarketLevelType = -12044
TAPIERROR_INPUTERROR_TAPIOrderQryTypeType = -12045
TAPIERROR_INPUTERROR_TAPIClientID = -12046
TAPIERROR_INPUTERROR_QryHisQuoteParam = -13001
TAPIERROR_INPUTERROR_TAPIIncludeNAN = -13002
TAPIERROR_INPUTERROR_TAPIPasswordType = -12048
TAPIERROR_DISCONNECT_CLOSE_INIT = 1
TAPIERROR_DISCONNECT_CLOSE_PASS = 2
TAPIERROR_DISCONNECT_READ_ERROR = 3
TAPIERROR_DISCONNECT_WRITE_ERROR = 4
TAPIERROR_DISCONNECT_BUF_FULL = 5
TAPIERROR_DISCONNECT_IOCP_ERROR = 6
TAPIERROR_DISCONNECT_PARSE_ERROR = 7
TAPIERROR_DISCONNECT_CONNECT_TIMEOUT = 8
TAPIERROR_DISCONNECT_INIT_ERROR = 9
TAPIERROR_DISCONNECT_HAS_CONNECTED = 10
TAPIERROR_DISCONNECT_HAS_EXIT = 11
TAPIERROR_DISCONNECT_TRY_LATER = 12
| tapierror_login = 10001
tapierror_login_user = 10002
tapierror_login_dda = 10003
tapierror_login_license = 10004
tapierror_login_module = 10005
tapierror_login_force = 10006
tapierror_login_state = 10007
tapierror_login_pass = 10008
tapierror_login_right = 10009
tapierror_login_count = 10010
tapierror_login_notin_serverflagusres = 10011
tapierror_login_freeze = 10012
tapierror_login_tofreeze = 10013
tapierror_login_accountstate = 10014
tapierror_login_seccertifi = 10015
tapierror_login_nosecondset = 10016
tapierror_login_notursthost = 10017
tapitapierror_secondcertification_fail = 14001
tapitapierror_secondcertification_timeover = 14002
tapierror_conn_database = 11000
tapierror_oper_database = 11001
tapierror_need_onetoone = 11002
tapierror_exist_relateinfo = 11003
tapierror_exist_relateinfoofgroup = 11004
tapierror_userpassword_mod_source = 12001
tapierror_userpassword_mod_same = 12002
tapierror_userpassword_mod_complexity = 12003
tapierror_currency_only_onebase = 13001
tapierror_currency_only_usdhkd = 13002
tapierror_orderinsert_account = 60001
tapierror_orderinsert_account_state = 60002
tapierror_orderinsert_tradecent_error = 60003
tapierror_orderinsert_contract = 60011
tapierror_orderinsert_lme_notready = 60012
tapierror_orderinsert_error_order_type = 60013
tapierror_orderinsert_ready_type_error = 60014
tapierror_orderinsert_order_type_error = 60015
tapierror_order_notrade_account = 60021
tapierror_order_notrade_com_group = 60022
tapierror_order_notrade_acc_contract = 60023
tapierror_order_notrade_system = 60024
tapierror_order_close_account = 60025
tapierror_order_close_acc_contract = 60026
tapierror_order_close_system = 60027
tapierror_order_close_days = 60028
tapierror_order_notrade_risk = 60029
tapierror_order_close_risk = 60030
tapierror_orderinsert_positionmax = 60031
tapierror_orderinsert_oncemax = 60032
tapierror_orderinsert_traderoute = 60033
tapierror_order_in_mod_price_error = 60034
tapierror_order_in_giveup_pos_max = 60035
tapierror_upperchannel_not_login = 60041
tapierror_upperchannel_not_found = 60042
tapierror_orderinsert_notenoughfund = 60051
tapierror_orderinsert_fee = 60052
tapierror_orderinsert_margin = 60053
tapierror_orderinsert_basenofund = 60054
tapierror_orderinsert_marginamount = 60055
tapierror_orderinsert_openratio = 60056
tapierror_orderinsert_group_openratio = 60057
tapierror_orderinsert_riskarray = 60058
tapierror_orderdelete_not_sysno = 60061
tapierror_orderdelete_not_state = 60062
tapierror_orderdelete_no_input = 60063
tapierror_ordermodify_not_state = 60071
tapierror_ordermodify_back_input = 60072
tapierror_ordermodify_risk_order = 60073
tapierror_ordermodify_error_qty = 60074
tapierror_ordermodify_error_ready = 60075
tapierror_orderinput_cannotmove = 60081
tapierror_orderinput_repeat = 60091
tapierror_contract_quote = 60101
tapierror_upper_oncemax = 60111
tapierror_upper_positionmax = 60112
tapierror_orderinsert_closemode = 60121
tapierror_close_order = 60122
tapierror_close_match = 60123
tapierror_mod_del_no_order = 60131
tapierror_mod_del_gateway_discon = 60132
tapierror_matchinput_repeat = 60141
tapierror_matchinput_no_order = 60142
tapierror_matchinput_no_contract = 60143
tapierror_matchinput_parm_error = 60144
tapierror_matchinput_ostate_error = 60145
tapierror_matchremove_no_match = 60151
tapierror_matchremove_state_error = 60152
tapierror_orderinput_state_error = 60161
tapierror_orderinput_mod_error = 60162
tapierror_orderremove_error = 60163
tapierror_orderinput_mod_state_error = 60164
tapierror_orderexchange_state_error = 60165
tapierror_orderremove_not_error = 60166
tapierror_ordermarket_delete_notfound = 60171
tapierror_ordermarket_del_account_ne = 60172
tapierror_ordermarket_del_commodity_ne = 60173
tapierror_ordermarket_del_contract_ne = 60174
tapierror_ordermarket_del_side_eq = 60175
tapierror_ordermarket_del_side_error = 60176
tapierror_ordermarket_other_side_error = 60177
tapierror_orderactivate_notfound_error = 60181
tapierror_orderactivate_state_error = 60182
tapierror_gw_not_ready = 80001
tapierror_gw_invalid_commodity = 80002
tapierror_gw_invalid_contract = 80003
tapierror_gw_invalid_field = 80004
tapierror_gw_invalid_price = 80005
tapierror_gw_invalid_volume = 80006
tapierror_gw_invalid_type = 80007
tapierror_gw_invalid_mode = 80008
tapierror_gw_order_not_exist = 80009
tapierror_gw_send_fail = 80010
tapierror_gw_rej_byupper = 80011
tapierror_tradefront_moduletypeerr = 90001
tapierror_tradefront_toomanydata = 90002
tapierror_tradefront_nodata = 90003
tapierrot_tradefront_nouser = 90004
tapierror_tradefront_disconnect_trade = 90011
tapierror_tradefront_disconnect_manage = 90012
tapierror_tradefront_account = 90021
tapierror_tradefront_order = 90022
tapierror_tradefront_frequency = 90023
tapierror_tradefront_rufuse = 90024
tapierror_tradefront_selfmatch = 90025
tapierror_succeed = 0
tapierror__connect_fail = -1
tapierror__link_auth_fail = -2
tapierror__host_unavailable = -3
tapierror__send_data_error = -4
tapierror__test_id_error = -5
tapierror__not_ready_test_network = -6
tapierror__cur_test_not_over = -7
tapierror_no_front_available = -8
tapierror__data_path_avaiable = -9
tapierror__repeat_login = -10
tapierror__inner_error = -11
tapierror__last_req_not_finish = -12
tapierror__input_value_error = -13
tapierror__auth_code__invalid = -14
tapierror__auth_code__expired = -15
tapierror__auth_code__type_not_match = -16
tapierror_api__not_ready = -17
tapierror_udp_listen_failed = -18
tapierror_udp_listening = -19
tapierror__not_implemented = -20
tapierror__call_one_time_only = -21
tapierror_order_frequency = -22
tapierror_rentqry_toofast = -23
tapierror_call_nocondition = -24
tapierror_order_notfound = -25
tapierror_logpath_empty = -26
tapierror_logpath_failopen = -27
tapierror_right_trader = -28
tapierror_right_orderinput = -29
tapierror_right_localoperation = -30
tapierror_right_ordertransfer = -31
tapierror_fillinput_systemno = -32
tapierror_fillremove_matchno = -33
tapierror_fillreqmove_nofund = -34
tapierror_localmodify_account = -35
tapierror_localtransfer_account = -36
tapierror_inputerror_phone = -37
tapierror_error_contact = -38
tapierror_error_rejestvertificate = -39
tapierror_right_setpassword = -40
tapierror_risk_opererror = -41
tapierror_order_modaccount = -42
tapierror_inputerror_null = -10000
tapierror_inputerror_tapiynflag = -10001
tapierror_inputerror_tapiloglevel = -10002
tapierror_inputerror_tapi_commodity_type = -10003
tapierror_inputerror_tapi_call_or_put_flag_type = -10004
tapierror_inputerror_tapi_bucket_date_flag = -11001
tapierror_inputerror_tapi_his_quote_type = -11002
tapierror_inputerror_tapi_account_type = -12001
tapierror_inputerror_tapi_user_type_type = -12002
tapierror_inputerror_tapi_account_state = -12003
tapierror_inputerror_tapi_account_family_type = -12004
tapierror_inputerror_tapi_order_type_type = -12005
tapierror_inputerror_tapi_order_source_type = -12006
tapierror_inputerror_tapi_time_in_force_type = -12007
tapierror_inputerror_tapi_side_type = -12008
tapierror_inputerror_tapi_position_effect_type = -12009
tapierror_inputerror_tapi_hedge_flag_type = -12010
tapierror_inputerror_tapi_order_state_type = -12011
tapierror_inputerror_tapi_calculate_mode_type = -12012
tapierror_inputerror_tapi_match_source_type = -12013
tapierror_inputerror_tapi_open_close_mode_type = -12014
tapierror_inputerror_tapi_future_alg_type = -12015
tapierror_inputerror_tapi_option_alg_type = -12016
tapierror_inputerror_tapi_bank_account_lw_flag_type = -12017
tapierror_inputerror_tapi_bank_account_state_type = -12018
tapierror_inputerror_tapi_bank_account_swap_state_type = -12019
tapierror_inputerror_tapi_bank_account_transfer_state_type = -12020
tapierror_inputerror_tapi_margin_calculate_mode_type = -12021
tapierror_inputerror_tapi_option_margin_calculate_mode_type = -12022
tapierror_inputerror_tapi_cmb_direct_type = -12023
tapierror_inputerror_tapi_delivery_mode_type = -12024
tapierror_inputerror_tapi_contract_type_type = -12025
tapierror_inputerror_tapi_party_type_type = -12026
tapierror_inputerror_tapi_party_certificate_type_type = -12027
tapierror_inputerror_tapi_msg_receiver_type = -12028
tapierror_inputerror_tapi_msg_type_type = -12029
tapierror_inputerror_tapi_msg_level_type = -12030
tapierror_inputerror_tapi_transfer_direct_type = -12031
tapierror_inputerror_tapi_transfer_state_type = -12032
tapierror_inputerror_tapi_transfer_type_type = -12033
tapierror_inputerror_tapi_transfer_device_id_type = -12034
tapierror_inputerror_tapi_tactics_type_type = -12035
tapierror_inputerror_tapiorderact = -12036
tapierror_inputerror_tapi_bill_type_type = -12037
tapierror_inputerror_tapi_bill_file_type_type = -12038
tapierror_inputerror_tapioff_flag_type = -12039
tapierror_inputerror_tapi_cash_adjust_type_type = -12040
tapierror_inputerror_tapi_trigger_condition_type = -12041
tapierror_inputerror_tapi_trigger_price_type_type = -12042
tapierror_inputerror_tapi_trading_state_type = -12043
tapierror_inputerror_tapi_market_level_type = -12044
tapierror_inputerror_tapi_order_qry_type_type = -12045
tapierror_inputerror_tapi_client_id = -12046
tapierror_inputerror__qry_his_quote_param = -13001
tapierror_inputerror_tapi_include_nan = -13002
tapierror_inputerror_tapi_password_type = -12048
tapierror_disconnect_close_init = 1
tapierror_disconnect_close_pass = 2
tapierror_disconnect_read_error = 3
tapierror_disconnect_write_error = 4
tapierror_disconnect_buf_full = 5
tapierror_disconnect_iocp_error = 6
tapierror_disconnect_parse_error = 7
tapierror_disconnect_connect_timeout = 8
tapierror_disconnect_init_error = 9
tapierror_disconnect_has_connected = 10
tapierror_disconnect_has_exit = 11
tapierror_disconnect_try_later = 12 |
def can_channel_synchronize(channel):
return channel.mirror_channel_url and (channel.mirror_mode == "mirror")
def can_channel_reindex(channel):
return True
| def can_channel_synchronize(channel):
return channel.mirror_channel_url and channel.mirror_mode == 'mirror'
def can_channel_reindex(channel):
return True |
# output from elife04953.xml
expected = [
{
"xlink_href": "elife04953f001",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 1,
"parent_sibling_ordinal": 1,
"parent_component_doi": "10.7554/eLife.04953.003",
"position": 1,
"ordinal": 1,
},
{
"xlink_href": "elife04953fs001",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 2,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 2,
"parent_component_doi": "10.7554/eLife.04953.004",
"p_parent_type": "fig",
"p_parent_ordinal": 1,
"p_parent_sibling_ordinal": 1,
"p_parent_component_doi": "10.7554/eLife.04953.003",
"position": 2,
"ordinal": 2,
},
{
"xlink_href": "elife04953fs002",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 3,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 3,
"parent_component_doi": "10.7554/eLife.04953.005",
"p_parent_type": "fig",
"p_parent_ordinal": 1,
"p_parent_sibling_ordinal": 1,
"p_parent_component_doi": "10.7554/eLife.04953.003",
"position": 3,
"ordinal": 3,
},
{
"xlink_href": "elife04953fs003",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 4,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 4,
"parent_component_doi": "10.7554/eLife.04953.006",
"p_parent_type": "fig",
"p_parent_ordinal": 1,
"p_parent_sibling_ordinal": 1,
"p_parent_component_doi": "10.7554/eLife.04953.003",
"position": 4,
"ordinal": 4,
},
{
"xlink_href": "elife04953fs004",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 5,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 5,
"parent_component_doi": "10.7554/eLife.04953.007",
"p_parent_type": "fig",
"p_parent_ordinal": 1,
"p_parent_sibling_ordinal": 1,
"p_parent_component_doi": "10.7554/eLife.04953.003",
"position": 5,
"ordinal": 5,
},
{
"xlink_href": "elife04953fs005",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 6,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 6,
"parent_component_doi": "10.7554/eLife.04953.008",
"p_parent_type": "fig",
"p_parent_ordinal": 1,
"p_parent_sibling_ordinal": 1,
"p_parent_component_doi": "10.7554/eLife.04953.003",
"position": 6,
"ordinal": 6,
},
{
"xlink_href": "elife04953f002",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 7,
"parent_sibling_ordinal": 2,
"parent_component_doi": "10.7554/eLife.04953.010",
"position": 7,
"ordinal": 7,
},
{
"xlink_href": "elife04953fs006",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 8,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 2,
"parent_component_doi": "10.7554/eLife.04953.011",
"p_parent_type": "fig",
"p_parent_ordinal": 7,
"p_parent_sibling_ordinal": 2,
"p_parent_component_doi": "10.7554/eLife.04953.010",
"position": 8,
"ordinal": 8,
},
{
"xlink_href": "elife04953fs007",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 9,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 3,
"parent_component_doi": "10.7554/eLife.04953.012",
"p_parent_type": "fig",
"p_parent_ordinal": 7,
"p_parent_sibling_ordinal": 2,
"p_parent_component_doi": "10.7554/eLife.04953.010",
"position": 9,
"ordinal": 9,
},
{
"xlink_href": "elife04953fs008",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 10,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 4,
"parent_component_doi": "10.7554/eLife.04953.013",
"p_parent_type": "fig",
"p_parent_ordinal": 7,
"p_parent_sibling_ordinal": 2,
"p_parent_component_doi": "10.7554/eLife.04953.010",
"position": 10,
"ordinal": 10,
},
{
"xlink_href": "elife04953fs009",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 11,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 5,
"parent_component_doi": "10.7554/eLife.04953.014",
"p_parent_type": "fig",
"p_parent_ordinal": 7,
"p_parent_sibling_ordinal": 2,
"p_parent_component_doi": "10.7554/eLife.04953.010",
"position": 11,
"ordinal": 11,
},
{
"xlink_href": "elife04953fs010",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 12,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 6,
"parent_component_doi": "10.7554/eLife.04953.015",
"p_parent_type": "fig",
"p_parent_ordinal": 7,
"p_parent_sibling_ordinal": 2,
"p_parent_component_doi": "10.7554/eLife.04953.010",
"position": 12,
"ordinal": 12,
},
{
"xlink_href": "elife04953f003",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 13,
"parent_sibling_ordinal": 3,
"parent_component_doi": "10.7554/eLife.04953.020",
"position": 13,
"ordinal": 13,
},
{
"xlink_href": "elife04953fs011",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 14,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 2,
"parent_component_doi": "10.7554/eLife.04953.021",
"p_parent_type": "fig",
"p_parent_ordinal": 13,
"p_parent_sibling_ordinal": 3,
"p_parent_component_doi": "10.7554/eLife.04953.020",
"position": 14,
"ordinal": 14,
},
{
"xlink_href": "elife04953fs012",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 15,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 3,
"parent_component_doi": "10.7554/eLife.04953.022",
"p_parent_type": "fig",
"p_parent_ordinal": 13,
"p_parent_sibling_ordinal": 3,
"p_parent_component_doi": "10.7554/eLife.04953.020",
"position": 15,
"ordinal": 15,
},
{
"xlink_href": "elife04953f004",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 16,
"parent_sibling_ordinal": 4,
"parent_component_doi": "10.7554/eLife.04953.009",
"position": 16,
"ordinal": 16,
},
{
"xlink_href": "elife04953f005",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 17,
"parent_sibling_ordinal": 5,
"parent_component_doi": "10.7554/eLife.04953.023",
"position": 17,
"ordinal": 17,
},
{
"xlink_href": "elife04953fs013",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 18,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 2,
"parent_component_doi": "10.7554/eLife.04953.024",
"p_parent_type": "fig",
"p_parent_ordinal": 17,
"p_parent_sibling_ordinal": 5,
"p_parent_component_doi": "10.7554/eLife.04953.023",
"position": 18,
"ordinal": 18,
},
{
"xlink_href": "elife04953fs014",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 19,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 3,
"parent_component_doi": "10.7554/eLife.04953.025",
"p_parent_type": "fig",
"p_parent_ordinal": 17,
"p_parent_sibling_ordinal": 5,
"p_parent_component_doi": "10.7554/eLife.04953.023",
"position": 19,
"ordinal": 19,
},
{
"xlink_href": "elife04953f006",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 20,
"parent_sibling_ordinal": 6,
"parent_component_doi": "10.7554/eLife.04953.027",
"position": 20,
"ordinal": 20,
},
{
"xlink_href": "elife04953fs015",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 21,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 2,
"parent_component_doi": "10.7554/eLife.04953.028",
"p_parent_type": "fig",
"p_parent_ordinal": 20,
"p_parent_sibling_ordinal": 6,
"p_parent_component_doi": "10.7554/eLife.04953.027",
"position": 21,
"ordinal": 21,
},
{
"xlink_href": "elife04953fs016",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 22,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 3,
"parent_component_doi": "10.7554/eLife.04953.029",
"p_parent_type": "fig",
"p_parent_ordinal": 20,
"p_parent_sibling_ordinal": 6,
"p_parent_component_doi": "10.7554/eLife.04953.027",
"position": 22,
"ordinal": 22,
},
{
"xlink_href": "elife04953fs017",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 23,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 4,
"parent_component_doi": "10.7554/eLife.04953.030",
"p_parent_type": "fig",
"p_parent_ordinal": 20,
"p_parent_sibling_ordinal": 6,
"p_parent_component_doi": "10.7554/eLife.04953.027",
"position": 23,
"ordinal": 23,
},
{
"xlink_href": "elife04953f007",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 24,
"parent_sibling_ordinal": 7,
"parent_component_doi": "10.7554/eLife.04953.031",
"position": 24,
"ordinal": 24,
},
{
"xlink_href": "elife04953fs018",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 25,
"parent_asset": "figsupp",
"parent_sibling_ordinal": 2,
"parent_component_doi": "10.7554/eLife.04953.032",
"p_parent_type": "fig",
"p_parent_ordinal": 24,
"p_parent_sibling_ordinal": 7,
"p_parent_component_doi": "10.7554/eLife.04953.031",
"position": 25,
"ordinal": 25,
},
{
"xlink_href": "elife04953f008",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 26,
"parent_sibling_ordinal": 1,
"parent_component_doi": "10.7554/eLife.04953.035",
"p_parent_type": "sub-article",
"p_parent_ordinal": 2,
"p_parent_asset": "resp",
"p_parent_sibling_ordinal": 2,
"p_parent_component_doi": "10.7554/eLife.04953.034",
"position": 26,
"ordinal": 26,
},
{
"xlink_href": "elife04953f009",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 27,
"parent_sibling_ordinal": 2,
"parent_component_doi": "10.7554/eLife.04953.036",
"p_parent_type": "sub-article",
"p_parent_ordinal": 2,
"p_parent_asset": "resp",
"p_parent_sibling_ordinal": 2,
"p_parent_component_doi": "10.7554/eLife.04953.034",
"position": 27,
"ordinal": 27,
},
{
"xlink_href": "elife04953f010",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 28,
"parent_sibling_ordinal": 3,
"parent_component_doi": "10.7554/eLife.04953.037",
"p_parent_type": "sub-article",
"p_parent_ordinal": 2,
"p_parent_asset": "resp",
"p_parent_sibling_ordinal": 2,
"p_parent_component_doi": "10.7554/eLife.04953.034",
"position": 28,
"ordinal": 28,
},
{
"xlink_href": "elife04953f011",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 29,
"parent_sibling_ordinal": 4,
"parent_component_doi": "10.7554/eLife.04953.038",
"p_parent_type": "sub-article",
"p_parent_ordinal": 2,
"p_parent_asset": "resp",
"p_parent_sibling_ordinal": 2,
"p_parent_component_doi": "10.7554/eLife.04953.034",
"position": 29,
"ordinal": 29,
},
{
"xlink_href": "elife04953f012",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 30,
"parent_sibling_ordinal": 5,
"parent_component_doi": "10.7554/eLife.04953.039",
"p_parent_type": "sub-article",
"p_parent_ordinal": 2,
"p_parent_asset": "resp",
"p_parent_sibling_ordinal": 2,
"p_parent_component_doi": "10.7554/eLife.04953.034",
"position": 30,
"ordinal": 30,
},
{
"xlink_href": "elife04953f013",
"type": "graphic",
"parent_type": "fig",
"parent_ordinal": 31,
"parent_sibling_ordinal": 6,
"parent_component_doi": "10.7554/eLife.04953.041",
"p_parent_type": "sub-article",
"p_parent_ordinal": 2,
"p_parent_asset": "resp",
"p_parent_sibling_ordinal": 2,
"p_parent_component_doi": "10.7554/eLife.04953.034",
"position": 31,
"ordinal": 31,
},
]
| expected = [{'xlink_href': 'elife04953f001', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 1, 'parent_sibling_ordinal': 1, 'parent_component_doi': '10.7554/eLife.04953.003', 'position': 1, 'ordinal': 1}, {'xlink_href': 'elife04953fs001', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 2, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 2, 'parent_component_doi': '10.7554/eLife.04953.004', 'p_parent_type': 'fig', 'p_parent_ordinal': 1, 'p_parent_sibling_ordinal': 1, 'p_parent_component_doi': '10.7554/eLife.04953.003', 'position': 2, 'ordinal': 2}, {'xlink_href': 'elife04953fs002', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 3, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 3, 'parent_component_doi': '10.7554/eLife.04953.005', 'p_parent_type': 'fig', 'p_parent_ordinal': 1, 'p_parent_sibling_ordinal': 1, 'p_parent_component_doi': '10.7554/eLife.04953.003', 'position': 3, 'ordinal': 3}, {'xlink_href': 'elife04953fs003', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 4, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 4, 'parent_component_doi': '10.7554/eLife.04953.006', 'p_parent_type': 'fig', 'p_parent_ordinal': 1, 'p_parent_sibling_ordinal': 1, 'p_parent_component_doi': '10.7554/eLife.04953.003', 'position': 4, 'ordinal': 4}, {'xlink_href': 'elife04953fs004', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 5, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 5, 'parent_component_doi': '10.7554/eLife.04953.007', 'p_parent_type': 'fig', 'p_parent_ordinal': 1, 'p_parent_sibling_ordinal': 1, 'p_parent_component_doi': '10.7554/eLife.04953.003', 'position': 5, 'ordinal': 5}, {'xlink_href': 'elife04953fs005', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 6, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 6, 'parent_component_doi': '10.7554/eLife.04953.008', 'p_parent_type': 'fig', 'p_parent_ordinal': 1, 'p_parent_sibling_ordinal': 1, 'p_parent_component_doi': '10.7554/eLife.04953.003', 'position': 6, 'ordinal': 6}, {'xlink_href': 'elife04953f002', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 7, 'parent_sibling_ordinal': 2, 'parent_component_doi': '10.7554/eLife.04953.010', 'position': 7, 'ordinal': 7}, {'xlink_href': 'elife04953fs006', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 8, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 2, 'parent_component_doi': '10.7554/eLife.04953.011', 'p_parent_type': 'fig', 'p_parent_ordinal': 7, 'p_parent_sibling_ordinal': 2, 'p_parent_component_doi': '10.7554/eLife.04953.010', 'position': 8, 'ordinal': 8}, {'xlink_href': 'elife04953fs007', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 9, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 3, 'parent_component_doi': '10.7554/eLife.04953.012', 'p_parent_type': 'fig', 'p_parent_ordinal': 7, 'p_parent_sibling_ordinal': 2, 'p_parent_component_doi': '10.7554/eLife.04953.010', 'position': 9, 'ordinal': 9}, {'xlink_href': 'elife04953fs008', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 10, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 4, 'parent_component_doi': '10.7554/eLife.04953.013', 'p_parent_type': 'fig', 'p_parent_ordinal': 7, 'p_parent_sibling_ordinal': 2, 'p_parent_component_doi': '10.7554/eLife.04953.010', 'position': 10, 'ordinal': 10}, {'xlink_href': 'elife04953fs009', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 11, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 5, 'parent_component_doi': '10.7554/eLife.04953.014', 'p_parent_type': 'fig', 'p_parent_ordinal': 7, 'p_parent_sibling_ordinal': 2, 'p_parent_component_doi': '10.7554/eLife.04953.010', 'position': 11, 'ordinal': 11}, {'xlink_href': 'elife04953fs010', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 12, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 6, 'parent_component_doi': '10.7554/eLife.04953.015', 'p_parent_type': 'fig', 'p_parent_ordinal': 7, 'p_parent_sibling_ordinal': 2, 'p_parent_component_doi': '10.7554/eLife.04953.010', 'position': 12, 'ordinal': 12}, {'xlink_href': 'elife04953f003', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 13, 'parent_sibling_ordinal': 3, 'parent_component_doi': '10.7554/eLife.04953.020', 'position': 13, 'ordinal': 13}, {'xlink_href': 'elife04953fs011', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 14, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 2, 'parent_component_doi': '10.7554/eLife.04953.021', 'p_parent_type': 'fig', 'p_parent_ordinal': 13, 'p_parent_sibling_ordinal': 3, 'p_parent_component_doi': '10.7554/eLife.04953.020', 'position': 14, 'ordinal': 14}, {'xlink_href': 'elife04953fs012', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 15, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 3, 'parent_component_doi': '10.7554/eLife.04953.022', 'p_parent_type': 'fig', 'p_parent_ordinal': 13, 'p_parent_sibling_ordinal': 3, 'p_parent_component_doi': '10.7554/eLife.04953.020', 'position': 15, 'ordinal': 15}, {'xlink_href': 'elife04953f004', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 16, 'parent_sibling_ordinal': 4, 'parent_component_doi': '10.7554/eLife.04953.009', 'position': 16, 'ordinal': 16}, {'xlink_href': 'elife04953f005', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 17, 'parent_sibling_ordinal': 5, 'parent_component_doi': '10.7554/eLife.04953.023', 'position': 17, 'ordinal': 17}, {'xlink_href': 'elife04953fs013', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 18, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 2, 'parent_component_doi': '10.7554/eLife.04953.024', 'p_parent_type': 'fig', 'p_parent_ordinal': 17, 'p_parent_sibling_ordinal': 5, 'p_parent_component_doi': '10.7554/eLife.04953.023', 'position': 18, 'ordinal': 18}, {'xlink_href': 'elife04953fs014', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 19, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 3, 'parent_component_doi': '10.7554/eLife.04953.025', 'p_parent_type': 'fig', 'p_parent_ordinal': 17, 'p_parent_sibling_ordinal': 5, 'p_parent_component_doi': '10.7554/eLife.04953.023', 'position': 19, 'ordinal': 19}, {'xlink_href': 'elife04953f006', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 20, 'parent_sibling_ordinal': 6, 'parent_component_doi': '10.7554/eLife.04953.027', 'position': 20, 'ordinal': 20}, {'xlink_href': 'elife04953fs015', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 21, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 2, 'parent_component_doi': '10.7554/eLife.04953.028', 'p_parent_type': 'fig', 'p_parent_ordinal': 20, 'p_parent_sibling_ordinal': 6, 'p_parent_component_doi': '10.7554/eLife.04953.027', 'position': 21, 'ordinal': 21}, {'xlink_href': 'elife04953fs016', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 22, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 3, 'parent_component_doi': '10.7554/eLife.04953.029', 'p_parent_type': 'fig', 'p_parent_ordinal': 20, 'p_parent_sibling_ordinal': 6, 'p_parent_component_doi': '10.7554/eLife.04953.027', 'position': 22, 'ordinal': 22}, {'xlink_href': 'elife04953fs017', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 23, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 4, 'parent_component_doi': '10.7554/eLife.04953.030', 'p_parent_type': 'fig', 'p_parent_ordinal': 20, 'p_parent_sibling_ordinal': 6, 'p_parent_component_doi': '10.7554/eLife.04953.027', 'position': 23, 'ordinal': 23}, {'xlink_href': 'elife04953f007', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 24, 'parent_sibling_ordinal': 7, 'parent_component_doi': '10.7554/eLife.04953.031', 'position': 24, 'ordinal': 24}, {'xlink_href': 'elife04953fs018', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 25, 'parent_asset': 'figsupp', 'parent_sibling_ordinal': 2, 'parent_component_doi': '10.7554/eLife.04953.032', 'p_parent_type': 'fig', 'p_parent_ordinal': 24, 'p_parent_sibling_ordinal': 7, 'p_parent_component_doi': '10.7554/eLife.04953.031', 'position': 25, 'ordinal': 25}, {'xlink_href': 'elife04953f008', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 26, 'parent_sibling_ordinal': 1, 'parent_component_doi': '10.7554/eLife.04953.035', 'p_parent_type': 'sub-article', 'p_parent_ordinal': 2, 'p_parent_asset': 'resp', 'p_parent_sibling_ordinal': 2, 'p_parent_component_doi': '10.7554/eLife.04953.034', 'position': 26, 'ordinal': 26}, {'xlink_href': 'elife04953f009', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 27, 'parent_sibling_ordinal': 2, 'parent_component_doi': '10.7554/eLife.04953.036', 'p_parent_type': 'sub-article', 'p_parent_ordinal': 2, 'p_parent_asset': 'resp', 'p_parent_sibling_ordinal': 2, 'p_parent_component_doi': '10.7554/eLife.04953.034', 'position': 27, 'ordinal': 27}, {'xlink_href': 'elife04953f010', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 28, 'parent_sibling_ordinal': 3, 'parent_component_doi': '10.7554/eLife.04953.037', 'p_parent_type': 'sub-article', 'p_parent_ordinal': 2, 'p_parent_asset': 'resp', 'p_parent_sibling_ordinal': 2, 'p_parent_component_doi': '10.7554/eLife.04953.034', 'position': 28, 'ordinal': 28}, {'xlink_href': 'elife04953f011', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 29, 'parent_sibling_ordinal': 4, 'parent_component_doi': '10.7554/eLife.04953.038', 'p_parent_type': 'sub-article', 'p_parent_ordinal': 2, 'p_parent_asset': 'resp', 'p_parent_sibling_ordinal': 2, 'p_parent_component_doi': '10.7554/eLife.04953.034', 'position': 29, 'ordinal': 29}, {'xlink_href': 'elife04953f012', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 30, 'parent_sibling_ordinal': 5, 'parent_component_doi': '10.7554/eLife.04953.039', 'p_parent_type': 'sub-article', 'p_parent_ordinal': 2, 'p_parent_asset': 'resp', 'p_parent_sibling_ordinal': 2, 'p_parent_component_doi': '10.7554/eLife.04953.034', 'position': 30, 'ordinal': 30}, {'xlink_href': 'elife04953f013', 'type': 'graphic', 'parent_type': 'fig', 'parent_ordinal': 31, 'parent_sibling_ordinal': 6, 'parent_component_doi': '10.7554/eLife.04953.041', 'p_parent_type': 'sub-article', 'p_parent_ordinal': 2, 'p_parent_asset': 'resp', 'p_parent_sibling_ordinal': 2, 'p_parent_component_doi': '10.7554/eLife.04953.034', 'position': 31, 'ordinal': 31}] |
encoded = "cvpbPGS{abg_gbb_onq_bs_n_ceboyrz}"
decoded = "".join([chr(ord('a') + (ord(c.lower())-ord('a')+13)%26) if c.isalpha() else c for c in encoded])
print(decoded) | encoded = 'cvpbPGS{abg_gbb_onq_bs_n_ceboyrz}'
decoded = ''.join([chr(ord('a') + (ord(c.lower()) - ord('a') + 13) % 26) if c.isalpha() else c for c in encoded])
print(decoded) |
def main():
with open('input.txt') as f:
ids = f.read().splitlines()
ids.sort()
for i in range(len(ids) - 1):
cur = ids[i]
nex = ids[i + 1]
diff = 0
diff_idx = 0
for j in range(len(cur)):
if diff > 1:
break
if cur[j] != nex[j]:
diff += 1
diff_idx = j
else:
if diff == 1:
return cur[:diff_idx] + cur[diff_idx + 1:]
if __name__ == '__main__':
print(main())
| def main():
with open('input.txt') as f:
ids = f.read().splitlines()
ids.sort()
for i in range(len(ids) - 1):
cur = ids[i]
nex = ids[i + 1]
diff = 0
diff_idx = 0
for j in range(len(cur)):
if diff > 1:
break
if cur[j] != nex[j]:
diff += 1
diff_idx = j
else:
if diff == 1:
return cur[:diff_idx] + cur[diff_idx + 1:]
if __name__ == '__main__':
print(main()) |
Images=[(0,255,0,255,0,255 ,
255,0,255,0,255,0,
0,255,0,255,0,255 ,
255,0,255,0,255,0,
0,255,0,255,0,255 ,
255,0,255,0,255,0),
(255,255,255,0,0,0,
0,0,0,255,255,255,
255,255,255,0,0,0,
255,255,255,0,0,0,
0,0,0,255,255,255,
255,255,255,0,0,0,),
(255,255,255,255,255,255,
255,255,255,255,255,255,
0,0,0,0,0,0,
0,0,0,0,0,0,
255,255,255,255,255,255,
255,255,255,255,255,255,)] | images = [(0, 255, 0, 255, 0, 255, 255, 0, 255, 0, 255, 0, 0, 255, 0, 255, 0, 255, 255, 0, 255, 0, 255, 0, 0, 255, 0, 255, 0, 255, 255, 0, 255, 0, 255, 0), (255, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0), (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255)] |
# while True:
# pass
# keyboard interrupt.
class MyEmptyClass:
pass
def initLog(*args):
pass
# pass statement is ignore.
| class Myemptyclass:
pass
def init_log(*args):
pass |
def counting_sort(array, area, index):
counting_array = [0] * area
sorted_array = [0] * len(array)
for j in range(len(array)):
counting_array[ord(array[j][index]) - ord("a")] += 1
for j in range(1, area):
counting_array[j] += counting_array[j - 1]
for j in range(len(array) - 1, -1, -1):
sorted_array[counting_array[ord(array[j][index]) - ord("a")] - 1] = array[j]
counting_array[ord(array[j][index]) - ord("a")] -= 1
return sorted_array
def radix_sort(array, length, phase, area):
counter = 0
for i in range(length, -1, -1):
if counter < phase:
array = counting_sort(array, area, i)
counter += 1
else:
break
return array
fin = open("radixsort.in")
fout = open("radixsort.out", "w")
n, m, k = map(int, fin.readline().split())
array = [0] * n
for i in range(n):
array[i] = fin.readline().rstrip("\n")
area = 26
array = radix_sort(array, m - 1, k, area)
for i in range(n):
print(array[i], file=fout)
fin.close()
fout.close()
| def counting_sort(array, area, index):
counting_array = [0] * area
sorted_array = [0] * len(array)
for j in range(len(array)):
counting_array[ord(array[j][index]) - ord('a')] += 1
for j in range(1, area):
counting_array[j] += counting_array[j - 1]
for j in range(len(array) - 1, -1, -1):
sorted_array[counting_array[ord(array[j][index]) - ord('a')] - 1] = array[j]
counting_array[ord(array[j][index]) - ord('a')] -= 1
return sorted_array
def radix_sort(array, length, phase, area):
counter = 0
for i in range(length, -1, -1):
if counter < phase:
array = counting_sort(array, area, i)
counter += 1
else:
break
return array
fin = open('radixsort.in')
fout = open('radixsort.out', 'w')
(n, m, k) = map(int, fin.readline().split())
array = [0] * n
for i in range(n):
array[i] = fin.readline().rstrip('\n')
area = 26
array = radix_sort(array, m - 1, k, area)
for i in range(n):
print(array[i], file=fout)
fin.close()
fout.close() |
def GCD(a,b):
if b==0:
return a
else:
return GCD(b,a%b)
print("Enter A")
a=int(input())
print("Enter B")
b=int(input())
print("GCD = "+str(GCD(a,b))) | def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
print('Enter A')
a = int(input())
print('Enter B')
b = int(input())
print('GCD = ' + str(gcd(a, b))) |
''' For Loop Break Statement
'''
frui | """ For Loop Break Statement
"""
frui |
n=int(input("Enter n -> "))
res=0
while(n > 0):
temp = n % 10
res = res * 10 + temp
n = n // 10
print(res) | n = int(input('Enter n -> '))
res = 0
while n > 0:
temp = n % 10
res = res * 10 + temp
n = n // 10
print(res) |
class TrainingConfig:
def __init__(self, trainingConfig):
self.downloadStackoverflowEnabled = trainingConfig.get("downloadStackoverflowEnabled", False)
self.includeStackoverflow = trainingConfig.get("includeStackoverflow", True)
self.stackoverflowTags = trainingConfig.get("stackoverflowTags", [])
self.stackoverFlowTopN = trainingConfig.get("stackoverFlowTopN", 50)
self.stackoverflowKey = trainingConfig.get("stackoverflowKey", None)
self.downloadCaseTitlesEnabled = trainingConfig.get("downloadCaseTitlesEnabled", False)
self.includeCaseTitles = trainingConfig.get("includeCaseTitles", True)
self.runExtractionEnabled = trainingConfig.get("runExtractionEnabled", True)
self.extractionRatio = trainingConfig.get("extractionRatio", 0.1)
self.caseTitlesDaysSince = trainingConfig.get("caseTitlesDaysSince", 50)
self.textNGrams = trainingConfig.get("textNGrams", 1)
self.detectorContentSplitted = trainingConfig.get("detectorContentSplitted", False)
self.splitDictionary = trainingConfig.get("splitDictionary", False)
self.trainDetectors = trainingConfig.get("trainDetectors", False)
self.trainUtterances = trainingConfig.get("trainUtterances", False)
self.modelType = trainingConfig.get("modelType", "TfIdfSearchModel")
self.blockOnMissingTestCases = trainingConfig.get("blockOnMissingTestCases", False) | class Trainingconfig:
def __init__(self, trainingConfig):
self.downloadStackoverflowEnabled = trainingConfig.get('downloadStackoverflowEnabled', False)
self.includeStackoverflow = trainingConfig.get('includeStackoverflow', True)
self.stackoverflowTags = trainingConfig.get('stackoverflowTags', [])
self.stackoverFlowTopN = trainingConfig.get('stackoverFlowTopN', 50)
self.stackoverflowKey = trainingConfig.get('stackoverflowKey', None)
self.downloadCaseTitlesEnabled = trainingConfig.get('downloadCaseTitlesEnabled', False)
self.includeCaseTitles = trainingConfig.get('includeCaseTitles', True)
self.runExtractionEnabled = trainingConfig.get('runExtractionEnabled', True)
self.extractionRatio = trainingConfig.get('extractionRatio', 0.1)
self.caseTitlesDaysSince = trainingConfig.get('caseTitlesDaysSince', 50)
self.textNGrams = trainingConfig.get('textNGrams', 1)
self.detectorContentSplitted = trainingConfig.get('detectorContentSplitted', False)
self.splitDictionary = trainingConfig.get('splitDictionary', False)
self.trainDetectors = trainingConfig.get('trainDetectors', False)
self.trainUtterances = trainingConfig.get('trainUtterances', False)
self.modelType = trainingConfig.get('modelType', 'TfIdfSearchModel')
self.blockOnMissingTestCases = trainingConfig.get('blockOnMissingTestCases', False) |
'''
-------------------------
Counting Array Inversions
-------------------------
An array inversion is defined as a single pair of elements A[i] and A[j] in the array 'A'
such that i < j but A[i] > A[j].
This implementation runs in O(n log n) time, and uses a recursive approach similar to Merge Sort in order
to efficiently count the number of split inversions resulting from dividing the input array in two.
'''
def count_inversions(values):
def sort_and_count_inversions(values):
l = len(values)
if l <= 1:
return values, 0
v1 = values[:l/2]
v2 = values[l/2:]
sorted_v1, c1 = sort_and_count_inversions(v1)
sorted_v2, c2 = sort_and_count_inversions(v2)
sorted_values, c3 = merge_and_count_split_inversions(sorted_v1, sorted_v2)
return sorted_values, c1 + c2 + c3
def merge_and_count_split_inversions(l1, l2):
END_OF_LIST = object()
inversion_count = 0
def list_get(l, i):
if len(l) <= i:
return END_OF_LIST
return l[i]
i1 = i2 = 0
l1_len = len(l1)
r = []
while True:
v1 = list_get(l1, i1)
v2 = list_get(l2, i2)
if v1 is END_OF_LIST:
r.extend(l2[i2:])
break
elif v2 is END_OF_LIST:
r.extend(l1[i1:])
break
elif v1 <= v2:
r.append(v1)
i1 += 1
else:
r.append(v2)
inversion_count += (l1_len - i1)
i2 += 1
return r, inversion_count
return sort_and_count_inversions(values)[1]
| """
-------------------------
Counting Array Inversions
-------------------------
An array inversion is defined as a single pair of elements A[i] and A[j] in the array 'A'
such that i < j but A[i] > A[j].
This implementation runs in O(n log n) time, and uses a recursive approach similar to Merge Sort in order
to efficiently count the number of split inversions resulting from dividing the input array in two.
"""
def count_inversions(values):
def sort_and_count_inversions(values):
l = len(values)
if l <= 1:
return (values, 0)
v1 = values[:l / 2]
v2 = values[l / 2:]
(sorted_v1, c1) = sort_and_count_inversions(v1)
(sorted_v2, c2) = sort_and_count_inversions(v2)
(sorted_values, c3) = merge_and_count_split_inversions(sorted_v1, sorted_v2)
return (sorted_values, c1 + c2 + c3)
def merge_and_count_split_inversions(l1, l2):
end_of_list = object()
inversion_count = 0
def list_get(l, i):
if len(l) <= i:
return END_OF_LIST
return l[i]
i1 = i2 = 0
l1_len = len(l1)
r = []
while True:
v1 = list_get(l1, i1)
v2 = list_get(l2, i2)
if v1 is END_OF_LIST:
r.extend(l2[i2:])
break
elif v2 is END_OF_LIST:
r.extend(l1[i1:])
break
elif v1 <= v2:
r.append(v1)
i1 += 1
else:
r.append(v2)
inversion_count += l1_len - i1
i2 += 1
return (r, inversion_count)
return sort_and_count_inversions(values)[1] |
# model settings
model = dict(
type='MOCO',
queue_len=65536,
feat_dim=128,
momentum=0.999,
backbone=dict(
type='ResNet',
depth=18,
num_stages=4,
out_indices=(3,), # no conv-1, x-1: stage-x
norm_cfg=dict(type='BN'),
style='pytorch'),
neck=dict(
type='LinearNeck',
in_channels=512, out_channels=128,
with_avg_pool=True),
head=dict(type='ContrastiveHead', temperature=0.07)
)
| model = dict(type='MOCO', queue_len=65536, feat_dim=128, momentum=0.999, backbone=dict(type='ResNet', depth=18, num_stages=4, out_indices=(3,), norm_cfg=dict(type='BN'), style='pytorch'), neck=dict(type='LinearNeck', in_channels=512, out_channels=128, with_avg_pool=True), head=dict(type='ContrastiveHead', temperature=0.07)) |
class Model:
def __init__(self):
self.flask = wiz.flask
def has(self, key):
if key in self.flask.session:
return True
return False
def delete(self, key):
self.flask.session.pop(key)
def set(self, **kwargs):
for key in kwargs:
self.flask.session[key] = kwargs[key]
def get(self, key=None, default=None):
if key is None:
return self.to_dict()
if key in self.flask.session:
return self.flask.session[key]
return default
def clear(self):
self.flask.session.clear()
def to_dict(self):
return season.stdClass(dict(self.flask.session))
@classmethod
def use(cls):
return cls() | class Model:
def __init__(self):
self.flask = wiz.flask
def has(self, key):
if key in self.flask.session:
return True
return False
def delete(self, key):
self.flask.session.pop(key)
def set(self, **kwargs):
for key in kwargs:
self.flask.session[key] = kwargs[key]
def get(self, key=None, default=None):
if key is None:
return self.to_dict()
if key in self.flask.session:
return self.flask.session[key]
return default
def clear(self):
self.flask.session.clear()
def to_dict(self):
return season.stdClass(dict(self.flask.session))
@classmethod
def use(cls):
return cls() |
class Tracker(object):
def update(self, detections):
matches, unmatched_tracks, unmatched_detections = self._match(detections)
return matches, unmatched_tracks, unmatched_detections
def _match(self, detections):
print("father match called")
pass
class Sun(Tracker):
'''def update(self, detections):
a, b, c = super(Sun, self).update(detections)
print(a, b, c)'''
def _match(self, detections):
return [1, 2, 3], [4, 5, 6], [7, 8, 9]
def main():
c = Sun()
print(c.update([123]))
if __name__ == '__main__':
main()
| class Tracker(object):
def update(self, detections):
(matches, unmatched_tracks, unmatched_detections) = self._match(detections)
return (matches, unmatched_tracks, unmatched_detections)
def _match(self, detections):
print('father match called')
pass
class Sun(Tracker):
"""def update(self, detections):
a, b, c = super(Sun, self).update(detections)
print(a, b, c)"""
def _match(self, detections):
return ([1, 2, 3], [4, 5, 6], [7, 8, 9])
def main():
c = sun()
print(c.update([123]))
if __name__ == '__main__':
main() |
slice[ a.b : c.d ]
slice[ d :: d + 1 ]
slice[ d + 1 :: d ]
slice[ d::d ]
slice[ 0 ]
slice[ -1 ]
slice[ :-1 ]
slice[ ::-1 ]
slice[ :c, c - 1 ]
slice[ c, c + 1, d:: ]
slice[ ham[ c::d ] :: 1 ]
slice[ ham[ cheese ** 2 : -1 ] : 1 : 1, ham[ 1:2 ] ]
slice[ :-1: ]
slice[ lambda: None : lambda: None ]
slice[ lambda x, y, *args, really=2, **kwargs: None :, None:: ]
slice[ 1 or 2 : True and False ]
slice[ not so_simple : 1 < val <= 10 ]
slice[ ( 1 for i in range( 42 ) ) : x ]
slice[ :: [ i for i in range( 42 ) ] ]
async def f():
slice[ await x : [ i async for i in arange( 42 ) ] : 42 ]
# These are from PEP-8:
ham[ 1:9 ], ham[ 1:9:3 ], ham[ :9:3 ], ham[ 1::3 ], ham[ 1:9: ]
ham[ lower:upper ], ham[ lower:upper: ], ham[ lower::step ]
# ham[lower+offset : upper+offset]
ham[ : upper_fn( x ) : step_fn( x ) ], ham[ :: step_fn( x ) ]
ham[ lower + offset : upper + offset ]
| slice[a.b:c.d]
slice[d::d + 1]
slice[d + 1::d]
slice[d::d]
slice[0]
slice[-1]
slice[:-1]
slice[::-1]
slice[:c, c - 1]
slice[c, c + 1, d:]
slice[ham[c::d]::1]
slice[ham[cheese ** 2:-1]:1:1, ham[1:2]]
slice[:-1]
slice[lambda : None:lambda : None]
slice[lambda x, y, *args, really=2, **kwargs: None:, None:]
slice[1 or 2:True and False]
slice[not so_simple:1 < val <= 10]
slice[(1 for i in range(42)):x]
slice[::[i for i in range(42)]]
async def f():
slice[await x:[i async for i in arange(42)]:42]
(ham[1:9], ham[1:9:3], ham[:9:3], ham[1::3], ham[1:9])
(ham[lower:upper], ham[lower:upper], ham[lower::step])
(ham[:upper_fn(x):step_fn(x)], ham[::step_fn(x)])
ham[lower + offset:upper + offset] |
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'includes': [
'symroot.gypi',
],
'targets': [
{
'target_name': 'prog1',
'type': 'executable',
'dependencies': [
'subdir2/prog2.gyp:prog2',
],
'include_dirs': [
'.',
'inc1',
'subdir2/inc2',
'subdir3/inc3',
'subdir2/deeper',
],
'sources': [
'prog1.c',
],
},
],
}
| {'includes': ['symroot.gypi'], 'targets': [{'target_name': 'prog1', 'type': 'executable', 'dependencies': ['subdir2/prog2.gyp:prog2'], 'include_dirs': ['.', 'inc1', 'subdir2/inc2', 'subdir3/inc3', 'subdir2/deeper'], 'sources': ['prog1.c']}]} |
# Generation of 'magic' numbers for bitmasking to extract
# values from cpuid
def bitmask(mask):
'''
First element in `mask` is least-significant bit, last element is most-significant.
'''
result = 0
for index, x in enumerate(mask):
result |= x << index
return result
ways = bitmask([0]*22 + [1]*10)
partitions = bitmask([0]*12 + [1]*10)
line_size = bitmask([1]*12)
print( 'Masks for cache values:')
print( 'ways mask: %d'%ways )
print( 'partitions mask: %d'%partitions )
print( 'line_size mask: %d'%line_size )
| def bitmask(mask):
"""
First element in `mask` is least-significant bit, last element is most-significant.
"""
result = 0
for (index, x) in enumerate(mask):
result |= x << index
return result
ways = bitmask([0] * 22 + [1] * 10)
partitions = bitmask([0] * 12 + [1] * 10)
line_size = bitmask([1] * 12)
print('Masks for cache values:')
print('ways mask: %d' % ways)
print('partitions mask: %d' % partitions)
print('line_size mask: %d' % line_size) |
class Solution(object):
def tribonacci(self, n, memo = dict()):
if n in memo:
return memo[n]
if n == 0:
return 0
if n == 2 or n ==1 :
return 1
else:
var = self.tribonacci(n-1) + self.tribonacci(n-3) + self.tribonacci(n-2)
memo[n] =var
return var
| class Solution(object):
def tribonacci(self, n, memo=dict()):
if n in memo:
return memo[n]
if n == 0:
return 0
if n == 2 or n == 1:
return 1
else:
var = self.tribonacci(n - 1) + self.tribonacci(n - 3) + self.tribonacci(n - 2)
memo[n] = var
return var |
GRAB_SPIDER_CONFIG = {
'global': {
'spider_modules': ['zzz'],
},
}
| grab_spider_config = {'global': {'spider_modules': ['zzz']}} |
NOT_ASSINGNED = 0
MAFIA = 1
DETECTIVE = 2
JOKER = 3
ANGEL = 4
SHEELA = 5
SILENCER = 6
TERORIST = 7
CIVILIAN = 8
| not_assingned = 0
mafia = 1
detective = 2
joker = 3
angel = 4
sheela = 5
silencer = 6
terorist = 7
civilian = 8 |
print('hello world')
i = 10
if i==10:
print('true')
print('i =10')
| print('hello world')
i = 10
if i == 10:
print('true')
print('i =10') |
class StatementRecord:
def __init__(self, s_name, r_name, e_name, s_type, e_type, which_extractor, info_from_set=None, **extra_info):
if info_from_set is None:
self.info_from_set = set([])
else:
self.info_from_set = info_from_set
self.s_name = s_name
self.r_name = r_name
self.e_name = e_name
self.s_type = s_type
self.e_type = e_type
self.which_extractor = which_extractor
self.extra_info = extra_info
def get_s_name(self):
return self.s_name
def get_e_name(self):
return self.e_name
def get_r_name(self):
return self.r_name
def get_info_from_set(self):
return self.info_from_set
def add_info_from(self, extract_way, source_text, belong_doc):
self.info_from_set.add((extract_way, source_text, belong_doc))
def to_json(self):
base = {
"s_name": self.s_name,
"r_name": self.r_name,
"e_name": self.e_name,
"s_type": self.s_type,
"e_type": self.e_type,
"which_extractor": self.which_extractor,
"info_from_set": list(self.get_info_from_set()),
}
return base
def __repr__(self):
return "%r %r %r %r %r" % (self.s_name, self.r_name, self.e_name, self.s_type, self.e_type)
def __hash__(self):
text = self.s_name + "@@" + self.r_name + "@@" + self.e_name
return hash(text)
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__
else:
return False
| class Statementrecord:
def __init__(self, s_name, r_name, e_name, s_type, e_type, which_extractor, info_from_set=None, **extra_info):
if info_from_set is None:
self.info_from_set = set([])
else:
self.info_from_set = info_from_set
self.s_name = s_name
self.r_name = r_name
self.e_name = e_name
self.s_type = s_type
self.e_type = e_type
self.which_extractor = which_extractor
self.extra_info = extra_info
def get_s_name(self):
return self.s_name
def get_e_name(self):
return self.e_name
def get_r_name(self):
return self.r_name
def get_info_from_set(self):
return self.info_from_set
def add_info_from(self, extract_way, source_text, belong_doc):
self.info_from_set.add((extract_way, source_text, belong_doc))
def to_json(self):
base = {'s_name': self.s_name, 'r_name': self.r_name, 'e_name': self.e_name, 's_type': self.s_type, 'e_type': self.e_type, 'which_extractor': self.which_extractor, 'info_from_set': list(self.get_info_from_set())}
return base
def __repr__(self):
return '%r %r %r %r %r' % (self.s_name, self.r_name, self.e_name, self.s_type, self.e_type)
def __hash__(self):
text = self.s_name + '@@' + self.r_name + '@@' + self.e_name
return hash(text)
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__
else:
return False |
DEFAULT_FILE_STORAGE = 'djangae.storage.CloudStorage'
FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024
FILE_UPLOAD_HANDLERS = (
'djangae.storage.BlobstoreFileUploadHandler',
'django.core.files.uploadhandler.MemoryFileUploadHandler',
)
DATABASES = {
'default': {
'ENGINE': 'djangae.db.backends.appengine'
}
}
GENERATE_SPECIAL_INDEXES_DURING_TESTING = False
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
}
}
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
'djangae': {
'level': 'WARN'
}
}
}
EMAIL_BACKEND = 'djangae.mail.AsyncEmailBackend'
# Setting to * is OK, because GAE takes care of domain routing - setting it to anything
# else just causes unnecessary pain when something isn't accessible under a custom domain
ALLOWED_HOSTS = ("*",)
DJANGAE_RUNSERVER_IGNORED_FILES_REGEXES = ['^.+$(?<!\.py)(?<!\.yaml)(?<!\.html)']
# Note that these should match a directory name, not directory path:
DJANGAE_RUNSERVER_IGNORED_DIR_REGEXES = [r"^google_appengine$"]
TEST_RUNNER = 'djangae.test.DjangaeDiscoverRunner'
DJANGAE_USE_LEGACY_CONTAINS_LOGIC = False
| default_file_storage = 'djangae.storage.CloudStorage'
file_upload_max_memory_size = 1024 * 1024
file_upload_handlers = ('djangae.storage.BlobstoreFileUploadHandler', 'django.core.files.uploadhandler.MemoryFileUploadHandler')
databases = {'default': {'ENGINE': 'djangae.db.backends.appengine'}}
generate_special_indexes_during_testing = False
caches = {'default': {'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache'}}
logging = {'version': 1, 'disable_existing_loggers': False, 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}}, 'handlers': {'mail_admins': {'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler'}}, 'loggers': {'django.request': {'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True}, 'djangae': {'level': 'WARN'}}}
email_backend = 'djangae.mail.AsyncEmailBackend'
allowed_hosts = ('*',)
djangae_runserver_ignored_files_regexes = ['^.+$(?<!\\.py)(?<!\\.yaml)(?<!\\.html)']
djangae_runserver_ignored_dir_regexes = ['^google_appengine$']
test_runner = 'djangae.test.DjangaeDiscoverRunner'
djangae_use_legacy_contains_logic = False |
def fizzbuzz(n):
result = []
for count in range (1, n):
if count % 3 == 0 and not count % 5 == 0:
result.append("Fizz")
elif count % 5 == 0 and not count % 3 == 0:
result.append("Buzz")
elif count % 3 == 0 and count % 5 == 0:
result.append("FizzBuzz")
else:
result.append(count)
return result
| def fizzbuzz(n):
result = []
for count in range(1, n):
if count % 3 == 0 and (not count % 5 == 0):
result.append('Fizz')
elif count % 5 == 0 and (not count % 3 == 0):
result.append('Buzz')
elif count % 3 == 0 and count % 5 == 0:
result.append('FizzBuzz')
else:
result.append(count)
return result |
i = 2
print("Even numbers from 1 to 100:")
while i <= 100:
print(i)
i += 2
| i = 2
print('Even numbers from 1 to 100:')
while i <= 100:
print(i)
i += 2 |
'''
lab 7 while loop
'''
#3.1
i = 0
while i <=5:
if i !=3:
print(i)
i = i +1
#3.2
i = 1
result =1
while i <=5:
result = result *i
i = i +1
print(result)
#3.3
i = 1
result =0
while i <=5:
result = result +i
i = i +1
print(result)
#3.4
i = 3
result =1
while i <=8:
result = result *i
i = i +1
print(result)
#3.5
i = 4
result =1
while i <=8:
result = result *i
i = i +1
print(result)
#3.6
num_list = [12,32,43,35]
while num_list:
num_list.remove(num_list[0])
print(num_list) | """
lab 7 while loop
"""
i = 0
while i <= 5:
if i != 3:
print(i)
i = i + 1
i = 1
result = 1
while i <= 5:
result = result * i
i = i + 1
print(result)
i = 1
result = 0
while i <= 5:
result = result + i
i = i + 1
print(result)
i = 3
result = 1
while i <= 8:
result = result * i
i = i + 1
print(result)
i = 4
result = 1
while i <= 8:
result = result * i
i = i + 1
print(result)
num_list = [12, 32, 43, 35]
while num_list:
num_list.remove(num_list[0])
print(num_list) |
class Kerror(Exception):
def __init__(self, technicalMessage, guiMessage=None):
self.technicalMessage = technicalMessage
self.guiMessage = guiMessage
| class Kerror(Exception):
def __init__(self, technicalMessage, guiMessage=None):
self.technicalMessage = technicalMessage
self.guiMessage = guiMessage |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'conditions': [
# In component mode (shared_lib), we build all of skia as a single DLL.
# However, in the static mode, we need to build skia as multiple targets
# in order to support the use case where a platform (e.g. Android) may
# already have a copy of skia as a system library.
['component=="static_library"', {
'targets': [
{
'target_name': 'skia_library',
'type': 'static_library',
'includes': [
'skia_library.gypi',
'skia_common.gypi',
'../build/android/increase_size_for_speed.gypi',
# Disable LTO due to compiler error
# in mems_in_disjoint_alias_sets_p, at alias.c:393
# crbug.com/422255
'../build/android/disable_lto.gypi',
],
},
],
}],
['component=="static_library"', {
'targets': [
{
'target_name': 'skia',
'type': 'none',
'dependencies': [
'skia_library',
'skia_chrome',
],
'export_dependent_settings': [
'skia_library',
'skia_chrome',
],
},
{
'target_name': 'skia_chrome',
'type': 'static_library',
'includes': [
'skia_chrome.gypi',
'skia_common.gypi',
'../build/android/increase_size_for_speed.gypi',
],
},
],
},
{ # component != static_library
'targets': [
{
'target_name': 'skia',
'type': 'shared_library',
'includes': [
'skia_library.gypi',
'skia_chrome.gypi',
'skia_common.gypi',
'../build/android/increase_size_for_speed.gypi',
],
'defines': [
'SKIA_DLL',
'SKIA_IMPLEMENTATION=1',
'GR_GL_IGNORE_ES3_MSAA=0',
],
'direct_dependent_settings': {
'defines': [
'SKIA_DLL',
'GR_GL_IGNORE_ES3_MSAA=0',
],
},
},
{
'target_name': 'skia_library',
'type': 'none',
},
{
'target_name': 'skia_chrome',
'type': 'none',
},
],
}],
],
# targets that are not dependent upon the component type
'targets': [
{
'target_name': 'skia_chrome_opts',
'type': 'static_library',
'include_dirs': [
'..',
'config',
'../third_party/skia/include/core',
],
'conditions': [
[ 'os_posix == 1 and OS != "mac" and OS != "android" and \
target_arch != "arm" and target_arch != "mipsel" and \
target_arch != "arm64" and target_arch != "mips64el"', {
'cflags': [
'-msse2',
],
}],
[ 'target_arch != "arm" and target_arch != "mipsel" and \
target_arch != "arm64" and target_arch != "mips64el"', {
'sources': [
'ext/convolver_SSE2.cc',
],
}],
[ 'target_arch == "mipsel"',{
'cflags': [
'-fomit-frame-pointer',
],
'sources': [
'ext/convolver_mips_dspr2.cc',
],
}],
],
},
{
'target_name': 'image_operations_bench',
'type': 'executable',
'dependencies': [
'../base/base.gyp:base',
'skia',
],
'include_dirs': [
'..',
],
'sources': [
'ext/image_operations_bench.cc',
],
},
{
'target_name': 'filter_fuzz_stub',
'type': 'executable',
'dependencies': [
'../base/base.gyp:base',
'skia.gyp:skia',
],
'sources': [
'tools/filter_fuzz_stub/filter_fuzz_stub.cc',
],
'includes': [
'../build/android/increase_size_for_speed.gypi',
],
},
],
}
| {'conditions': [['component=="static_library"', {'targets': [{'target_name': 'skia_library', 'type': 'static_library', 'includes': ['skia_library.gypi', 'skia_common.gypi', '../build/android/increase_size_for_speed.gypi', '../build/android/disable_lto.gypi']}]}], ['component=="static_library"', {'targets': [{'target_name': 'skia', 'type': 'none', 'dependencies': ['skia_library', 'skia_chrome'], 'export_dependent_settings': ['skia_library', 'skia_chrome']}, {'target_name': 'skia_chrome', 'type': 'static_library', 'includes': ['skia_chrome.gypi', 'skia_common.gypi', '../build/android/increase_size_for_speed.gypi']}]}, {'targets': [{'target_name': 'skia', 'type': 'shared_library', 'includes': ['skia_library.gypi', 'skia_chrome.gypi', 'skia_common.gypi', '../build/android/increase_size_for_speed.gypi'], 'defines': ['SKIA_DLL', 'SKIA_IMPLEMENTATION=1', 'GR_GL_IGNORE_ES3_MSAA=0'], 'direct_dependent_settings': {'defines': ['SKIA_DLL', 'GR_GL_IGNORE_ES3_MSAA=0']}}, {'target_name': 'skia_library', 'type': 'none'}, {'target_name': 'skia_chrome', 'type': 'none'}]}]], 'targets': [{'target_name': 'skia_chrome_opts', 'type': 'static_library', 'include_dirs': ['..', 'config', '../third_party/skia/include/core'], 'conditions': [['os_posix == 1 and OS != "mac" and OS != "android" and target_arch != "arm" and target_arch != "mipsel" and target_arch != "arm64" and target_arch != "mips64el"', {'cflags': ['-msse2']}], ['target_arch != "arm" and target_arch != "mipsel" and target_arch != "arm64" and target_arch != "mips64el"', {'sources': ['ext/convolver_SSE2.cc']}], ['target_arch == "mipsel"', {'cflags': ['-fomit-frame-pointer'], 'sources': ['ext/convolver_mips_dspr2.cc']}]]}, {'target_name': 'image_operations_bench', 'type': 'executable', 'dependencies': ['../base/base.gyp:base', 'skia'], 'include_dirs': ['..'], 'sources': ['ext/image_operations_bench.cc']}, {'target_name': 'filter_fuzz_stub', 'type': 'executable', 'dependencies': ['../base/base.gyp:base', 'skia.gyp:skia'], 'sources': ['tools/filter_fuzz_stub/filter_fuzz_stub.cc'], 'includes': ['../build/android/increase_size_for_speed.gypi']}]} |
# 2.6.9 _strptime.py
# In 2.6 bug in handling BREAK_LOOP followed by JUMP_BACK
# So added rule:
# break_stmt ::= BREAK_LOOP JUMP_BACK
for value in __file__:
if value:
if (value and __name__):
pass
else:
tz = 'a'
break
| for value in __file__:
if value:
if value and __name__:
pass
else:
tz = 'a'
break |
class yrange:
def __init__(self, n):
self.i = 0
self.n = n
def __iter__(self):
return self
def next(self):
if self.i < self.n:
i = self.i
self.i += 1
return i
else:
raise StopIteration()
dias = ['lunes', 'martes', 'miercoles', 'jueves', 'viernes']
mi_iterador = iter(dias)
print(next(mi_iterador))
print(next(mi_iterador))
print(next(mi_iterador))
print(next(mi_iterador))
print(next(mi_iterador))
print(next(mi_iterador))
| class Yrange:
def __init__(self, n):
self.i = 0
self.n = n
def __iter__(self):
return self
def next(self):
if self.i < self.n:
i = self.i
self.i += 1
return i
else:
raise stop_iteration()
dias = ['lunes', 'martes', 'miercoles', 'jueves', 'viernes']
mi_iterador = iter(dias)
print(next(mi_iterador))
print(next(mi_iterador))
print(next(mi_iterador))
print(next(mi_iterador))
print(next(mi_iterador))
print(next(mi_iterador)) |
def get_model_for_training():
return
def load_model():
return
def save_model():
return | def get_model_for_training():
return
def load_model():
return
def save_model():
return |
if __name__ == "__main__":
team_A = Team("A")
team_B = Team("B")
arena = Arena(team_A, team_B)
arena.build_team_one()
arena.build_team_two()
arena.team_battle()
arena.show_stats() | if __name__ == '__main__':
team_a = team('A')
team_b = team('B')
arena = arena(team_A, team_B)
arena.build_team_one()
arena.build_team_two()
arena.team_battle()
arena.show_stats() |
class User:
id = 1
name = 'Test User'
email = 'test@email.com'
def find(self, id):
return self
| class User:
id = 1
name = 'Test User'
email = 'test@email.com'
def find(self, id):
return self |
# Approach 2 - DP
# Time: O(N*sqrt(N))
# Space: O(N)
class Solution:
def winnerSquareGame(self, n: int) -> bool:
dp = [False] * (n+1)
for i in range(1, n+1):
for k in range(1, int(i**0.5)+1):
if dp[i - k*k] == False:
dp[i] = True
break
return dp[n]
| class Solution:
def winner_square_game(self, n: int) -> bool:
dp = [False] * (n + 1)
for i in range(1, n + 1):
for k in range(1, int(i ** 0.5) + 1):
if dp[i - k * k] == False:
dp[i] = True
break
return dp[n] |
# Implements hack/lib/version.sh's kube::version::ldflags() for Bazel.
def version_x_defs():
# This should match the list of packages in kube::version::ldflag
stamp_pkgs = [
"k8s.io/kubernetes/pkg/version",
# In hack/lib/version.sh, this has a vendor/ prefix. That isn't needed here?
"k8s.io/client-go/pkg/version",
]
# This should match the list of vars in kube::version::ldflags
# It should also match the list of vars set in hack/print-workspace-status.sh.
stamp_vars = [
"buildDate",
"gitCommit",
"gitMajor",
"gitMinor",
"gitTreeState",
"gitVersion",
]
# Generate the cross-product.
x_defs = {}
for pkg in stamp_pkgs:
for var in stamp_vars:
x_defs["%s.%s" % (pkg, var)] = "{%s}" % var
return x_defs
| def version_x_defs():
stamp_pkgs = ['k8s.io/kubernetes/pkg/version', 'k8s.io/client-go/pkg/version']
stamp_vars = ['buildDate', 'gitCommit', 'gitMajor', 'gitMinor', 'gitTreeState', 'gitVersion']
x_defs = {}
for pkg in stamp_pkgs:
for var in stamp_vars:
x_defs['%s.%s' % (pkg, var)] = '{%s}' % var
return x_defs |
#
# @lc app=leetcode id=687 lang=python3
#
# [687] Longest Univalue Path
#
# @lc code=start
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def longestUnivaluePath(self, root: TreeNode) -> int:
def helper(node):
if not node: return 0
a = helper(node.left)
b = helper(node.right)
n = 0
left = 0
right = 0
if node.left and node.val == node.left.val:
left = a
if node.right and node.val == node.right.val:
right = b
n = max(left, right)
self.ret = max(self.ret, left+right)
return n + 1
self.ret = 0
helper(root)
return self.ret
# @lc code=end
| class Solution:
def longest_univalue_path(self, root: TreeNode) -> int:
def helper(node):
if not node:
return 0
a = helper(node.left)
b = helper(node.right)
n = 0
left = 0
right = 0
if node.left and node.val == node.left.val:
left = a
if node.right and node.val == node.right.val:
right = b
n = max(left, right)
self.ret = max(self.ret, left + right)
return n + 1
self.ret = 0
helper(root)
return self.ret |
class Circle:
def __init__(self):
print("Parent constractor")
class Point(Circle):
def __init__(self, x, y):
print("Child constractor")
# self.x_point = x
# self.y_point = y
# circle = Circle()
def draw(self):
print(f"draw a point with {self.x_point} and {self.y_point}")
point = Point(1, 8)
point._draw() | class Circle:
def __init__(self):
print('Parent constractor')
class Point(Circle):
def __init__(self, x, y):
print('Child constractor')
def draw(self):
print(f'draw a point with {self.x_point} and {self.y_point}')
point = point(1, 8)
point._draw() |
# !/usr/bin/env python3
# Author: C.K
# Email: theck17@163.com
# DateTime:2021-06-21 19:06:23
# Description:
class Solution:
def summaryRanges(self, nums: List[int]) -> List[str]:
ranges, r = [], []
for n in nums:
if n - 1 not in r:
r = []
ranges += r,
r[1:] = n,
return ['->'.join(map(str, r)) for r in ranges]
if __name__ == "__main__":
pass
| class Solution:
def summary_ranges(self, nums: List[int]) -> List[str]:
(ranges, r) = ([], [])
for n in nums:
if n - 1 not in r:
r = []
ranges += (r,)
r[1:] = (n,)
return ['->'.join(map(str, r)) for r in ranges]
if __name__ == '__main__':
pass |
#
# PySNMP MIB module MSTP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MSTP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:05:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion")
dlink_common_mgmt, = mibBuilder.importSymbols("DLINK-ID-REC-MIB", "dlink-common-mgmt")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
Unsigned32, Bits, MibIdentifier, TimeTicks, ModuleIdentity, NotificationType, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, ObjectIdentity, IpAddress, Gauge32, Counter32, iso = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Bits", "MibIdentifier", "TimeTicks", "ModuleIdentity", "NotificationType", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "ObjectIdentity", "IpAddress", "Gauge32", "Counter32", "iso")
TruthValue, DisplayString, RowStatus, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "DisplayString", "RowStatus", "TextualConvention")
swMSTPMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 171, 12, 15))
if mibBuilder.loadTexts: swMSTPMIB.setLastUpdated('0007150000Z')
if mibBuilder.loadTexts: swMSTPMIB.setOrganization(' ')
class BridgeId(OctetString):
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(8, 8)
fixedLength = 8
swMSTPGblMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 15, 1))
swMSTPCtrl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 15, 2))
swMSTPStpAdminState = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("other", 1), ("disabled", 2), ("enabled", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPStpAdminState.setStatus('current')
swMSTPStpVersion = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("stp", 0), ("rstp", 1), ("mstp", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPStpVersion.setStatus('current')
swMSTPStpMaxAge = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(600, 4000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPStpMaxAge.setStatus('current')
swMSTPStpHelloTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(100, 1000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPStpHelloTime.setStatus('current')
swMSTPStpForwardDelay = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(400, 3000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPStpForwardDelay.setStatus('current')
swMSTPStpMaxHops = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 20))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPStpMaxHops.setStatus('current')
swMSTPStpTxHoldCount = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPStpTxHoldCount.setStatus('current')
swMSTPStpForwardBPDU = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("other", 1), ("disabled", 2), ("enabled", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPStpForwardBPDU.setStatus('current')
swMSTPStpLBD = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("other", 1), ("disabled", 2), ("enabled", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPStpLBD.setStatus('current')
swMSTPStpLBDRecoverTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPStpLBDRecoverTime.setStatus('current')
swMSTPName = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPName.setStatus('current')
swMSTPRevisionLevel = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPRevisionLevel.setStatus('current')
swMSTPInstanceCtrlTable = MibTable((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3), )
if mibBuilder.loadTexts: swMSTPInstanceCtrlTable.setStatus('current')
swMSTPInstanceCtrlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1), ).setIndexNames((0, "MSTP-MIB", "swMSTPInstId"))
if mibBuilder.loadTexts: swMSTPInstanceCtrlEntry.setStatus('current')
swMSTPInstId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstId.setStatus('current')
swMSTPInstVlanRangeList1to64 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: swMSTPInstVlanRangeList1to64.setStatus('current')
swMSTPInstVlanRangeList65to128 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: swMSTPInstVlanRangeList65to128.setStatus('current')
swMSTPInstVlanRangeList129to192 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: swMSTPInstVlanRangeList129to192.setStatus('current')
swMSTPInstVlanRangeList193to256 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: swMSTPInstVlanRangeList193to256.setStatus('current')
swMSTPInstVlanRangeList257to320 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: swMSTPInstVlanRangeList257to320.setStatus('current')
swMSTPInstVlanRangeList321to384 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: swMSTPInstVlanRangeList321to384.setStatus('current')
swMSTPInstVlanRangeList385to448 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: swMSTPInstVlanRangeList385to448.setStatus('current')
swMSTPInstVlanRangeList449to512 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: swMSTPInstVlanRangeList449to512.setStatus('current')
swMSTPInstType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("cist", 0), ("msti", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstType.setStatus('current')
swMSTPInstStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstStatus.setStatus('current')
swMSTPInstPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 61440))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: swMSTPInstPriority.setStatus('current')
swMSTPInstDesignatedRootBridge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 13), BridgeId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstDesignatedRootBridge.setStatus('current')
swMSTPInstExternalRootCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstExternalRootCost.setStatus('current')
swMSTPInstRegionalRootBridge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 15), BridgeId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstRegionalRootBridge.setStatus('current')
swMSTPInstInternalRootCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstInternalRootCost.setStatus('current')
swMSTPInstDesignatedBridge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 17), BridgeId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstDesignatedBridge.setStatus('current')
swMSTPInstRootPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 18), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstRootPort.setStatus('current')
swMSTPInstMaxAge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 19), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstMaxAge.setStatus('current')
swMSTPInstForwardDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 20), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstForwardDelay.setStatus('current')
swMSTPInstLastTopologyChange = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 21), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstLastTopologyChange.setStatus('current')
swMSTPInstTopChangesCount = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 22), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstTopChangesCount.setStatus('current')
swMSTPInstRemainHops = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 23), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPInstRemainHops.setStatus('current')
swMSTPInstRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 24), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: swMSTPInstRowStatus.setStatus('current')
swMSTPPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4), )
if mibBuilder.loadTexts: swMSTPPortTable.setStatus('current')
swMSTPPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1), ).setIndexNames((0, "MSTP-MIB", "swMSTPPort"))
if mibBuilder.loadTexts: swMSTPPortEntry.setStatus('current')
swMSTPPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPPort.setStatus('current')
swMSTPPortOperHelloTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(100, 1000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPPortOperHelloTime.setStatus('current')
swMSTPPortAdminHelloTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(100, 1000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPPortAdminHelloTime.setStatus('current')
swMSTPSTPPortEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPSTPPortEnable.setStatus('current')
swMSTPPortExternalPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200000000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPPortExternalPathCost.setStatus('current')
swMSTPPortMigration = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 6), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPPortMigration.setStatus('current')
swMSTPPortAdminEdgePort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("true", 1), ("false", 2), ("auto", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPPortAdminEdgePort.setStatus('current')
swMSTPPortOperEdgePort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("true", 1), ("false", 2), ("auto", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPPortOperEdgePort.setStatus('current')
swMSTPPortAdminP2P = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("true", 0), ("false", 1), ("auto", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPPortAdminP2P.setStatus('current')
swMSTPPortOperP2P = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("true", 0), ("false", 1), ("auto", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPPortOperP2P.setStatus('current')
swMSTPPortLBD = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("other", 1), ("disabled", 2), ("enabled", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPPortLBD.setStatus('current')
swMSTPPortBPDUFiltering = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("other", 1), ("disabled", 2), ("enabled", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPPortBPDUFiltering.setStatus('current')
swMSTPPortRestrictedRole = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 13), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPPortRestrictedRole.setStatus('current')
swMSTPPortRestrictedTCN = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 14), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPPortRestrictedTCN.setStatus('current')
swMSTPMstPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5), )
if mibBuilder.loadTexts: swMSTPMstPortTable.setStatus('current')
swMSTPMstPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1), ).setIndexNames((0, "MSTP-MIB", "swMSTPMstPort"), (0, "MSTP-MIB", "swMSTPMstPortInsID"))
if mibBuilder.loadTexts: swMSTPMstPortEntry.setStatus('current')
swMSTPMstPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPMstPort.setStatus('current')
swMSTPMstPortInsID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPMstPortInsID.setStatus('current')
swMSTPMstPortDesignatedBridge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 3), BridgeId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPMstPortDesignatedBridge.setStatus('current')
swMSTPMstPortInternalPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200000000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPMstPortInternalPathCost.setStatus('current')
swMSTPMstPortPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 240))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swMSTPMstPortPriority.setStatus('current')
swMSTPMstPortStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("other", 1), ("disabled", 2), ("discarding", 3), ("learning", 4), ("forwarding", 5), ("broken", 6), ("no-stp-enabled", 7), ("err-disabled", 8)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPMstPortStatus.setStatus('current')
swMSTPMstPortRole = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("disable", 0), ("alternate", 1), ("backup", 2), ("root", 3), ("designated", 4), ("master", 5), ("nonstp", 6), ("loopback", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swMSTPMstPortRole.setStatus('current')
mibBuilder.exportSymbols("MSTP-MIB", swMSTPInstanceCtrlTable=swMSTPInstanceCtrlTable, swMSTPPortOperEdgePort=swMSTPPortOperEdgePort, swMSTPMstPortPriority=swMSTPMstPortPriority, PYSNMP_MODULE_ID=swMSTPMIB, swMSTPInstRowStatus=swMSTPInstRowStatus, swMSTPMstPortRole=swMSTPMstPortRole, swMSTPInstInternalRootCost=swMSTPInstInternalRootCost, swMSTPPortMigration=swMSTPPortMigration, swMSTPMstPortTable=swMSTPMstPortTable, swMSTPMIB=swMSTPMIB, swMSTPMstPortInternalPathCost=swMSTPMstPortInternalPathCost, swMSTPMstPortDesignatedBridge=swMSTPMstPortDesignatedBridge, swMSTPMstPort=swMSTPMstPort, swMSTPStpAdminState=swMSTPStpAdminState, swMSTPInstRootPort=swMSTPInstRootPort, swMSTPPortOperP2P=swMSTPPortOperP2P, swMSTPPortTable=swMSTPPortTable, swMSTPInstTopChangesCount=swMSTPInstTopChangesCount, swMSTPInstDesignatedRootBridge=swMSTPInstDesignatedRootBridge, swMSTPPortOperHelloTime=swMSTPPortOperHelloTime, swMSTPPortLBD=swMSTPPortLBD, swMSTPRevisionLevel=swMSTPRevisionLevel, swMSTPMstPortEntry=swMSTPMstPortEntry, swMSTPMstPortStatus=swMSTPMstPortStatus, swMSTPStpTxHoldCount=swMSTPStpTxHoldCount, swMSTPGblMgmt=swMSTPGblMgmt, swMSTPName=swMSTPName, swMSTPStpMaxAge=swMSTPStpMaxAge, swMSTPInstRemainHops=swMSTPInstRemainHops, swMSTPPortBPDUFiltering=swMSTPPortBPDUFiltering, swMSTPPortRestrictedRole=swMSTPPortRestrictedRole, swMSTPCtrl=swMSTPCtrl, swMSTPStpHelloTime=swMSTPStpHelloTime, swMSTPSTPPortEnable=swMSTPSTPPortEnable, swMSTPInstExternalRootCost=swMSTPInstExternalRootCost, swMSTPPortAdminEdgePort=swMSTPPortAdminEdgePort, BridgeId=BridgeId, swMSTPPortExternalPathCost=swMSTPPortExternalPathCost, swMSTPPort=swMSTPPort, swMSTPInstVlanRangeList1to64=swMSTPInstVlanRangeList1to64, swMSTPInstVlanRangeList129to192=swMSTPInstVlanRangeList129to192, swMSTPMstPortInsID=swMSTPMstPortInsID, swMSTPStpForwardBPDU=swMSTPStpForwardBPDU, swMSTPInstVlanRangeList321to384=swMSTPInstVlanRangeList321to384, swMSTPStpLBD=swMSTPStpLBD, swMSTPInstVlanRangeList385to448=swMSTPInstVlanRangeList385to448, swMSTPInstId=swMSTPInstId, swMSTPInstVlanRangeList193to256=swMSTPInstVlanRangeList193to256, swMSTPInstanceCtrlEntry=swMSTPInstanceCtrlEntry, swMSTPInstDesignatedBridge=swMSTPInstDesignatedBridge, swMSTPStpForwardDelay=swMSTPStpForwardDelay, swMSTPPortAdminHelloTime=swMSTPPortAdminHelloTime, swMSTPInstVlanRangeList257to320=swMSTPInstVlanRangeList257to320, swMSTPInstPriority=swMSTPInstPriority, swMSTPInstStatus=swMSTPInstStatus, swMSTPPortEntry=swMSTPPortEntry, swMSTPStpMaxHops=swMSTPStpMaxHops, swMSTPInstType=swMSTPInstType, swMSTPInstForwardDelay=swMSTPInstForwardDelay, swMSTPPortRestrictedTCN=swMSTPPortRestrictedTCN, swMSTPInstLastTopologyChange=swMSTPInstLastTopologyChange, swMSTPInstRegionalRootBridge=swMSTPInstRegionalRootBridge, swMSTPInstMaxAge=swMSTPInstMaxAge, swMSTPInstVlanRangeList449to512=swMSTPInstVlanRangeList449to512, swMSTPStpLBDRecoverTime=swMSTPStpLBDRecoverTime, swMSTPPortAdminP2P=swMSTPPortAdminP2P, swMSTPInstVlanRangeList65to128=swMSTPInstVlanRangeList65to128, swMSTPStpVersion=swMSTPStpVersion)
| (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, single_value_constraint, value_range_constraint, value_size_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion')
(dlink_common_mgmt,) = mibBuilder.importSymbols('DLINK-ID-REC-MIB', 'dlink-common-mgmt')
(object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup')
(unsigned32, bits, mib_identifier, time_ticks, module_identity, notification_type, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, counter64, object_identity, ip_address, gauge32, counter32, iso) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'Bits', 'MibIdentifier', 'TimeTicks', 'ModuleIdentity', 'NotificationType', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter64', 'ObjectIdentity', 'IpAddress', 'Gauge32', 'Counter32', 'iso')
(truth_value, display_string, row_status, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'TruthValue', 'DisplayString', 'RowStatus', 'TextualConvention')
sw_mstpmib = module_identity((1, 3, 6, 1, 4, 1, 171, 12, 15))
if mibBuilder.loadTexts:
swMSTPMIB.setLastUpdated('0007150000Z')
if mibBuilder.loadTexts:
swMSTPMIB.setOrganization(' ')
class Bridgeid(OctetString):
subtype_spec = OctetString.subtypeSpec + value_size_constraint(8, 8)
fixed_length = 8
sw_mstp_gbl_mgmt = mib_identifier((1, 3, 6, 1, 4, 1, 171, 12, 15, 1))
sw_mstp_ctrl = mib_identifier((1, 3, 6, 1, 4, 1, 171, 12, 15, 2))
sw_mstp_stp_admin_state = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('other', 1), ('disabled', 2), ('enabled', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPStpAdminState.setStatus('current')
sw_mstp_stp_version = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('stp', 0), ('rstp', 1), ('mstp', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPStpVersion.setStatus('current')
sw_mstp_stp_max_age = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(600, 4000))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPStpMaxAge.setStatus('current')
sw_mstp_stp_hello_time = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(100, 1000))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPStpHelloTime.setStatus('current')
sw_mstp_stp_forward_delay = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(400, 3000))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPStpForwardDelay.setStatus('current')
sw_mstp_stp_max_hops = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(1, 20))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPStpMaxHops.setStatus('current')
sw_mstp_stp_tx_hold_count = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(1, 10))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPStpTxHoldCount.setStatus('current')
sw_mstp_stp_forward_bpdu = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('other', 1), ('disabled', 2), ('enabled', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPStpForwardBPDU.setStatus('current')
sw_mstp_stp_lbd = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('other', 1), ('disabled', 2), ('enabled', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPStpLBD.setStatus('current')
sw_mstp_stp_lbd_recover_time = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 1000000))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPStpLBDRecoverTime.setStatus('current')
sw_mstp_name = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 1), octet_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPName.setStatus('current')
sw_mstp_revision_level = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPRevisionLevel.setStatus('current')
sw_mstp_instance_ctrl_table = mib_table((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3))
if mibBuilder.loadTexts:
swMSTPInstanceCtrlTable.setStatus('current')
sw_mstp_instance_ctrl_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1)).setIndexNames((0, 'MSTP-MIB', 'swMSTPInstId'))
if mibBuilder.loadTexts:
swMSTPInstanceCtrlEntry.setStatus('current')
sw_mstp_inst_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 15))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstId.setStatus('current')
sw_mstp_inst_vlan_range_list1to64 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(64, 64)).setFixedLength(64)).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
swMSTPInstVlanRangeList1to64.setStatus('current')
sw_mstp_inst_vlan_range_list65to128 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(64, 64)).setFixedLength(64)).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
swMSTPInstVlanRangeList65to128.setStatus('current')
sw_mstp_inst_vlan_range_list129to192 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(64, 64)).setFixedLength(64)).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
swMSTPInstVlanRangeList129to192.setStatus('current')
sw_mstp_inst_vlan_range_list193to256 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 5), octet_string().subtype(subtypeSpec=value_size_constraint(64, 64)).setFixedLength(64)).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
swMSTPInstVlanRangeList193to256.setStatus('current')
sw_mstp_inst_vlan_range_list257to320 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 6), octet_string().subtype(subtypeSpec=value_size_constraint(64, 64)).setFixedLength(64)).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
swMSTPInstVlanRangeList257to320.setStatus('current')
sw_mstp_inst_vlan_range_list321to384 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 7), octet_string().subtype(subtypeSpec=value_size_constraint(64, 64)).setFixedLength(64)).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
swMSTPInstVlanRangeList321to384.setStatus('current')
sw_mstp_inst_vlan_range_list385to448 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(64, 64)).setFixedLength(64)).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
swMSTPInstVlanRangeList385to448.setStatus('current')
sw_mstp_inst_vlan_range_list449to512 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 9), octet_string().subtype(subtypeSpec=value_size_constraint(64, 64)).setFixedLength(64)).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
swMSTPInstVlanRangeList449to512.setStatus('current')
sw_mstp_inst_type = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('cist', 0), ('msti', 1)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstType.setStatus('current')
sw_mstp_inst_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstStatus.setStatus('current')
sw_mstp_inst_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 61440))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
swMSTPInstPriority.setStatus('current')
sw_mstp_inst_designated_root_bridge = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 13), bridge_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstDesignatedRootBridge.setStatus('current')
sw_mstp_inst_external_root_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 14), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstExternalRootCost.setStatus('current')
sw_mstp_inst_regional_root_bridge = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 15), bridge_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstRegionalRootBridge.setStatus('current')
sw_mstp_inst_internal_root_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 16), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstInternalRootCost.setStatus('current')
sw_mstp_inst_designated_bridge = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 17), bridge_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstDesignatedBridge.setStatus('current')
sw_mstp_inst_root_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 18), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstRootPort.setStatus('current')
sw_mstp_inst_max_age = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 19), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstMaxAge.setStatus('current')
sw_mstp_inst_forward_delay = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 20), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstForwardDelay.setStatus('current')
sw_mstp_inst_last_topology_change = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 21), time_ticks()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstLastTopologyChange.setStatus('current')
sw_mstp_inst_top_changes_count = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 22), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstTopChangesCount.setStatus('current')
sw_mstp_inst_remain_hops = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 23), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPInstRemainHops.setStatus('current')
sw_mstp_inst_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 3, 1, 24), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
swMSTPInstRowStatus.setStatus('current')
sw_mstp_port_table = mib_table((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4))
if mibBuilder.loadTexts:
swMSTPPortTable.setStatus('current')
sw_mstp_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1)).setIndexNames((0, 'MSTP-MIB', 'swMSTPPort'))
if mibBuilder.loadTexts:
swMSTPPortEntry.setStatus('current')
sw_mstp_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPPort.setStatus('current')
sw_mstp_port_oper_hello_time = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(100, 1000))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPPortOperHelloTime.setStatus('current')
sw_mstp_port_admin_hello_time = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(100, 1000))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPPortAdminHelloTime.setStatus('current')
sw_mstpstp_port_enable = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPSTPPortEnable.setStatus('current')
sw_mstp_port_external_path_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 200000000))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPPortExternalPathCost.setStatus('current')
sw_mstp_port_migration = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 6), truth_value()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPPortMigration.setStatus('current')
sw_mstp_port_admin_edge_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('true', 1), ('false', 2), ('auto', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPPortAdminEdgePort.setStatus('current')
sw_mstp_port_oper_edge_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('true', 1), ('false', 2), ('auto', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPPortOperEdgePort.setStatus('current')
sw_mstp_port_admin_p2_p = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('true', 0), ('false', 1), ('auto', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPPortAdminP2P.setStatus('current')
sw_mstp_port_oper_p2_p = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('true', 0), ('false', 1), ('auto', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPPortOperP2P.setStatus('current')
sw_mstp_port_lbd = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('other', 1), ('disabled', 2), ('enabled', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPPortLBD.setStatus('current')
sw_mstp_port_bpdu_filtering = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('other', 1), ('disabled', 2), ('enabled', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPPortBPDUFiltering.setStatus('current')
sw_mstp_port_restricted_role = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 13), truth_value()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPPortRestrictedRole.setStatus('current')
sw_mstp_port_restricted_tcn = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 4, 1, 14), truth_value()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPPortRestrictedTCN.setStatus('current')
sw_mstp_mst_port_table = mib_table((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5))
if mibBuilder.loadTexts:
swMSTPMstPortTable.setStatus('current')
sw_mstp_mst_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1)).setIndexNames((0, 'MSTP-MIB', 'swMSTPMstPort'), (0, 'MSTP-MIB', 'swMSTPMstPortInsID'))
if mibBuilder.loadTexts:
swMSTPMstPortEntry.setStatus('current')
sw_mstp_mst_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPMstPort.setStatus('current')
sw_mstp_mst_port_ins_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 15))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPMstPortInsID.setStatus('current')
sw_mstp_mst_port_designated_bridge = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 3), bridge_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPMstPortDesignatedBridge.setStatus('current')
sw_mstp_mst_port_internal_path_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 200000000))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPMstPortInternalPathCost.setStatus('current')
sw_mstp_mst_port_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 240))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swMSTPMstPortPriority.setStatus('current')
sw_mstp_mst_port_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('other', 1), ('disabled', 2), ('discarding', 3), ('learning', 4), ('forwarding', 5), ('broken', 6), ('no-stp-enabled', 7), ('err-disabled', 8)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPMstPortStatus.setStatus('current')
sw_mstp_mst_port_role = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 15, 2, 5, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('disable', 0), ('alternate', 1), ('backup', 2), ('root', 3), ('designated', 4), ('master', 5), ('nonstp', 6), ('loopback', 7)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swMSTPMstPortRole.setStatus('current')
mibBuilder.exportSymbols('MSTP-MIB', swMSTPInstanceCtrlTable=swMSTPInstanceCtrlTable, swMSTPPortOperEdgePort=swMSTPPortOperEdgePort, swMSTPMstPortPriority=swMSTPMstPortPriority, PYSNMP_MODULE_ID=swMSTPMIB, swMSTPInstRowStatus=swMSTPInstRowStatus, swMSTPMstPortRole=swMSTPMstPortRole, swMSTPInstInternalRootCost=swMSTPInstInternalRootCost, swMSTPPortMigration=swMSTPPortMigration, swMSTPMstPortTable=swMSTPMstPortTable, swMSTPMIB=swMSTPMIB, swMSTPMstPortInternalPathCost=swMSTPMstPortInternalPathCost, swMSTPMstPortDesignatedBridge=swMSTPMstPortDesignatedBridge, swMSTPMstPort=swMSTPMstPort, swMSTPStpAdminState=swMSTPStpAdminState, swMSTPInstRootPort=swMSTPInstRootPort, swMSTPPortOperP2P=swMSTPPortOperP2P, swMSTPPortTable=swMSTPPortTable, swMSTPInstTopChangesCount=swMSTPInstTopChangesCount, swMSTPInstDesignatedRootBridge=swMSTPInstDesignatedRootBridge, swMSTPPortOperHelloTime=swMSTPPortOperHelloTime, swMSTPPortLBD=swMSTPPortLBD, swMSTPRevisionLevel=swMSTPRevisionLevel, swMSTPMstPortEntry=swMSTPMstPortEntry, swMSTPMstPortStatus=swMSTPMstPortStatus, swMSTPStpTxHoldCount=swMSTPStpTxHoldCount, swMSTPGblMgmt=swMSTPGblMgmt, swMSTPName=swMSTPName, swMSTPStpMaxAge=swMSTPStpMaxAge, swMSTPInstRemainHops=swMSTPInstRemainHops, swMSTPPortBPDUFiltering=swMSTPPortBPDUFiltering, swMSTPPortRestrictedRole=swMSTPPortRestrictedRole, swMSTPCtrl=swMSTPCtrl, swMSTPStpHelloTime=swMSTPStpHelloTime, swMSTPSTPPortEnable=swMSTPSTPPortEnable, swMSTPInstExternalRootCost=swMSTPInstExternalRootCost, swMSTPPortAdminEdgePort=swMSTPPortAdminEdgePort, BridgeId=BridgeId, swMSTPPortExternalPathCost=swMSTPPortExternalPathCost, swMSTPPort=swMSTPPort, swMSTPInstVlanRangeList1to64=swMSTPInstVlanRangeList1to64, swMSTPInstVlanRangeList129to192=swMSTPInstVlanRangeList129to192, swMSTPMstPortInsID=swMSTPMstPortInsID, swMSTPStpForwardBPDU=swMSTPStpForwardBPDU, swMSTPInstVlanRangeList321to384=swMSTPInstVlanRangeList321to384, swMSTPStpLBD=swMSTPStpLBD, swMSTPInstVlanRangeList385to448=swMSTPInstVlanRangeList385to448, swMSTPInstId=swMSTPInstId, swMSTPInstVlanRangeList193to256=swMSTPInstVlanRangeList193to256, swMSTPInstanceCtrlEntry=swMSTPInstanceCtrlEntry, swMSTPInstDesignatedBridge=swMSTPInstDesignatedBridge, swMSTPStpForwardDelay=swMSTPStpForwardDelay, swMSTPPortAdminHelloTime=swMSTPPortAdminHelloTime, swMSTPInstVlanRangeList257to320=swMSTPInstVlanRangeList257to320, swMSTPInstPriority=swMSTPInstPriority, swMSTPInstStatus=swMSTPInstStatus, swMSTPPortEntry=swMSTPPortEntry, swMSTPStpMaxHops=swMSTPStpMaxHops, swMSTPInstType=swMSTPInstType, swMSTPInstForwardDelay=swMSTPInstForwardDelay, swMSTPPortRestrictedTCN=swMSTPPortRestrictedTCN, swMSTPInstLastTopologyChange=swMSTPInstLastTopologyChange, swMSTPInstRegionalRootBridge=swMSTPInstRegionalRootBridge, swMSTPInstMaxAge=swMSTPInstMaxAge, swMSTPInstVlanRangeList449to512=swMSTPInstVlanRangeList449to512, swMSTPStpLBDRecoverTime=swMSTPStpLBDRecoverTime, swMSTPPortAdminP2P=swMSTPPortAdminP2P, swMSTPInstVlanRangeList65to128=swMSTPInstVlanRangeList65to128, swMSTPStpVersion=swMSTPStpVersion) |
Name=str(input("Por favor escriba su nombre: "))
bn=float(input("Por favor ingrese su salario fijo: "))
vt=float(input("Ingrese su numero de ventas este mes: "))
qc=(vt*0.15)
tl=(qc+bn)
print("TOTAL = R$ ""{:.2f}".format (tl)) | name = str(input('Por favor escriba su nombre: '))
bn = float(input('Por favor ingrese su salario fijo: '))
vt = float(input('Ingrese su numero de ventas este mes: '))
qc = vt * 0.15
tl = qc + bn
print('TOTAL = R$ {:.2f}'.format(tl)) |
LOG_HANDLERS = {
"mrq.logger.MongoHandler": {
"mongodb_logs_size": 16 * 1024 * 1024
}
}
| log_handlers = {'mrq.logger.MongoHandler': {'mongodb_logs_size': 16 * 1024 * 1024}} |
class Base:
def __init__(self, name):
self.name = name
class Foo(Base):
def __init__(self, name, time):
Base.__init__(self, name)
self.time = time
class BaseA:
def __init__(self):
print("BaseA")
class FooA(BaseA):
def __init__(self):
BaseA.__init__(self)
super().__init__()
pass
foo = FooA()
| class Base:
def __init__(self, name):
self.name = name
class Foo(Base):
def __init__(self, name, time):
Base.__init__(self, name)
self.time = time
class Basea:
def __init__(self):
print('BaseA')
class Fooa(BaseA):
def __init__(self):
BaseA.__init__(self)
super().__init__()
pass
foo = foo_a() |
# coding=utf-8
MASTER_NODE_URL = 'https://api.sentinelgroup.io'
KEYSTORE_FILE_PATH = '/root/.sentinel/keystore'
CONFIG_DATA_PATH = '/root/.sentinel/config.json'
LIMIT_1GB = (1.0 * 1024 * 1024 * 1024)
| master_node_url = 'https://api.sentinelgroup.io'
keystore_file_path = '/root/.sentinel/keystore'
config_data_path = '/root/.sentinel/config.json'
limit_1_gb = 1.0 * 1024 * 1024 * 1024 |
# Copyright 2021 by Sergio Valqui. All rights reserved.
# Navigating Object structures
def obj_struct(my_obj):
for att in dir(my_obj):
print(att, getattr(my_obj, att), type(getattr(my_obj, att)).__name__)
# TODO: Differentiate methods, other objects, known structures
# TODO: show values of known structures
# TODO: make it recursive
| def obj_struct(my_obj):
for att in dir(my_obj):
print(att, getattr(my_obj, att), type(getattr(my_obj, att)).__name__) |
class Person:
def __init__(self, first_name, middle, last, nick, title, company, comaddr, homenr, mobile, worknr, faxnr,
email_1, email_2, email_3, home_page, year_b, year_a, home_add, home_phone, note):
self.first_name = first_name
self.middle = middle
self.last = last
self.nick = nick
self.title = title
self.company = company
self.comaddr = comaddr
self.homenr = homenr
self.mobile = mobile
self.worknr = worknr
self.faxnr = faxnr
self.email_1 = email_1
self.email_2 = email_2
self.email_3 = email_3
self.home_page = home_page
self.year_b = year_b
self.year_a = year_a
self.home_add = home_add
self.home_phone = home_phone
self.note = note
| class Person:
def __init__(self, first_name, middle, last, nick, title, company, comaddr, homenr, mobile, worknr, faxnr, email_1, email_2, email_3, home_page, year_b, year_a, home_add, home_phone, note):
self.first_name = first_name
self.middle = middle
self.last = last
self.nick = nick
self.title = title
self.company = company
self.comaddr = comaddr
self.homenr = homenr
self.mobile = mobile
self.worknr = worknr
self.faxnr = faxnr
self.email_1 = email_1
self.email_2 = email_2
self.email_3 = email_3
self.home_page = home_page
self.year_b = year_b
self.year_a = year_a
self.home_add = home_add
self.home_phone = home_phone
self.note = note |
x = []
for i in range(6):
x.append(float(input()))
mn = x[0]
mx = x[0]
for i in range(6):
if(x[i] < mn):
mn = x[i]
if(x[i] > mx):
mx = x[i]
print(mn,mx) | x = []
for i in range(6):
x.append(float(input()))
mn = x[0]
mx = x[0]
for i in range(6):
if x[i] < mn:
mn = x[i]
if x[i] > mx:
mx = x[i]
print(mn, mx) |
CODEDIR = '/home/antonio/Codes/bronchinet/src/'
DATADIR = '/home/antonio/Data/EXACT_Testing/'
BASEDIR = '/home/antonio/Results/AirwaySegmentation_EXACT/'
# NAMES INPUT / OUTPUT DIR
NAME_RAW_IMAGES_RELPATH = 'Images/'
NAME_RAW_LABELS_RELPATH = 'Airways/'
NAME_RAW_ROIMASKS_RELPATH = 'Lungs/'
NAME_RAW_COARSEAIRWAYS_RELPATH = 'CoarseAirways/'
NAME_RAW_CENTRELINES_RELPATH = 'Centrelines/'
NAME_REFERENCE_FILES_RELPATH = 'Images/'
NAME_PROC_IMAGES_RELPATH = 'ImagesWorkData/'
NAME_PROC_LABELS_RELPATH = 'LabelsWorkData/'
NAME_PROC_EXTRALABELS_RELPATH = 'CenlinesWorkData/'
NAME_CROP_BOUNDBOXES_FILE = 'cropBoundingBoxes_images.npy'
NAME_RESCALE_FACTORS_FILE = 'rescaleFactors_images.npy'
NAME_REFERENCE_KEYS_PROCIMAGE_FILE = 'referenceKeys_procimages.npy'
NAME_TRAININGDATA_RELPATH = 'TrainingData/'
NAME_VALIDATIONDATA_RELPATH = 'ValidationData/'
NAME_TESTINGDATA_RELPATH = 'TestingData/'
NAME_MODELSRUN_RELPATH = 'Models/'
NAME_LOSSHISTORY_FILE = 'losshistory.csv'
NAME_CONFIG_PARAMS_FILE = 'configparams.txt'
NAME_TRAINDATA_LOGFILE = 'traindatafiles.txt'
NAME_VALIDDATA_LOGFILE = 'validdatafiles.txt'
NAME_TEMPO_POSTERIORS_RELPATH = 'Predictions/PosteriorsWorkData/'
NAME_POSTERIORS_RELPATH = 'Predictions/Posteriors/'
NAME_PRED_BINARYMASKS_RELPATH = 'Predictions/BinaryMasks/'
NAME_PRED_CENTRELINES_RELPATH = 'Predictions/Centrelines/'
NAME_REFERENCE_KEYS_POSTERIORS_FILE = 'Predictions/referenceKeys_posteriors.npy'
NAME_PRED_RESULT_METRICS_FILE = 'Predictions/result_metrics.csv'
# PREPROCESSING
IS_BINARY_TRAIN_MASKS = True
IS_NORMALIZE_DATA = False
IS_MASK_REGION_INTEREST = True
IS_CROP_IMAGES = True
SIZE_BUFFER_BOUNDBOX_BORDERS = (20, 20, 20)
IS_TWO_BOUNDBOXES_LUNGS = False
IS_SAME_SIZE_BOUNDBOX_ALL_IMAGES = False
SIZE_FIXED_BOUNDBOX_ALL = None
IS_CALC_BOUNDBOX_IN_SLICES = False
IS_RESCALE_IMAGES = False
FIXED_RESCALE_RESOL = None
# DISTRIBUTE DATA TRAIN / VALID / TEST
PROPDATA_TRAIN_VALID_TEST = (0.5, 0.15, 0.35)
# CHOOSE DL BACKEND
TYPE_DNNLIB_USED = 'Pytorch' # 'Keras'
IS_MODEL_GPU = True
IS_MODEL_HALFPREC = False
# TRAINING MODELS
SIZE_IN_IMAGES = (252, 252, 252)
MAX_TRAIN_IMAGES = 100
MAX_VALID_IMAGES = 20
TYPE_NETWORK = 'UNet3DPlugin'
NET_NUM_FEATMAPS = 16
TYPE_OPTIMIZER = 'Adam'
LEARN_RATE = 1.0e-04
TYPE_LOSS = 'DiceCoefficient'
WEIGHT_COMBINED_LOSS = 1000.0
LIST_TYPE_METRICS = []
BATCH_SIZE = 1
NUM_EPOCHS = 1000
IS_VALID_CONVOLUTIONS = True
FREQ_SAVE_CHECK_MODELS = 2
FREQ_VALIDATE_MODELS = 2
IS_USE_VALIDATION_DATA = True
IS_SHUFFLE_TRAINDATA = True
MANUAL_SEED_TRAIN = None
# DATA AUGMENTATION IN TRAINING
IS_GENERATE_PATCHES = True
TYPE_GENERATE_PATCHES = 'random_window'
PROP_OVERLAP_SLIDE_WINDOW = (0.25, 0.0, 0.0)
NUM_RANDOM_PATCHES_EPOCH = 4
IS_TRANSFORM_IMAGES = True
TYPE_TRANSFORM_IMAGES = 'rigid_trans'
TRANS_RIGID_ROTATION_RANGE = (10.0, 7.0, 7.0) # (plane_XY, plane_XZ, plane_YZ)
TRANS_RIGID_SHIFT_RANGE = (0.0, 0.0, 0.0) # (width, height, depth)
TRANS_RIGID_FLIP_DIRS = (True, True, True) # (horizontal, vertical, axialdir)
TRANS_RIGID_ZOOM_RANGE = 0.25 # scale between (1 - val, 1 + val)
TRANS_RIGID_FILL_MODE = 'reflect'
# NOT USED - TRAINING MODELS
# NET_NUM_LEVELS = 5
# TYPE_ACTIVATE_HIDDEN = 'relu'
# TYPE_ACTIVATE_OUTPUT = 'sigmoid'
# NET_IS_USE_DROPOUT = False
# NET_IS_USE_BATCHNORMALIZE = False
# IS_DISABLE_CONVOL_POOLING_LASTLAYER = False
# IS_MULTITHREADING = False
# PREDICTIONS / POST-PROCESSING
PROP_OVERLAP_SLIDE_WINDOW_TEST = (0.5, 0.5, 0.5)
POST_THRESHOLD_VALUE = 0.5
IS_ATTACH_COARSE_AIRWAYS = True
IS_REMOVE_TRACHEA_CALC_METRICS = True
LIST_TYPE_METRICS_RESULT = ['DiceCoefficient',
'AirwayCompleteness',
'AirwayVolumeLeakage',
'AirwayCentrelineLeakage',
'AirwayTreeLength',
'AirwayCentrelineDistanceFalsePositiveError',
'AirwayCentrelineDistanceFalseNegativeError']
METRIC_EVALUATE_THRESHOLD = 'AirwayVolumeLeakage'
| codedir = '/home/antonio/Codes/bronchinet/src/'
datadir = '/home/antonio/Data/EXACT_Testing/'
basedir = '/home/antonio/Results/AirwaySegmentation_EXACT/'
name_raw_images_relpath = 'Images/'
name_raw_labels_relpath = 'Airways/'
name_raw_roimasks_relpath = 'Lungs/'
name_raw_coarseairways_relpath = 'CoarseAirways/'
name_raw_centrelines_relpath = 'Centrelines/'
name_reference_files_relpath = 'Images/'
name_proc_images_relpath = 'ImagesWorkData/'
name_proc_labels_relpath = 'LabelsWorkData/'
name_proc_extralabels_relpath = 'CenlinesWorkData/'
name_crop_boundboxes_file = 'cropBoundingBoxes_images.npy'
name_rescale_factors_file = 'rescaleFactors_images.npy'
name_reference_keys_procimage_file = 'referenceKeys_procimages.npy'
name_trainingdata_relpath = 'TrainingData/'
name_validationdata_relpath = 'ValidationData/'
name_testingdata_relpath = 'TestingData/'
name_modelsrun_relpath = 'Models/'
name_losshistory_file = 'losshistory.csv'
name_config_params_file = 'configparams.txt'
name_traindata_logfile = 'traindatafiles.txt'
name_validdata_logfile = 'validdatafiles.txt'
name_tempo_posteriors_relpath = 'Predictions/PosteriorsWorkData/'
name_posteriors_relpath = 'Predictions/Posteriors/'
name_pred_binarymasks_relpath = 'Predictions/BinaryMasks/'
name_pred_centrelines_relpath = 'Predictions/Centrelines/'
name_reference_keys_posteriors_file = 'Predictions/referenceKeys_posteriors.npy'
name_pred_result_metrics_file = 'Predictions/result_metrics.csv'
is_binary_train_masks = True
is_normalize_data = False
is_mask_region_interest = True
is_crop_images = True
size_buffer_boundbox_borders = (20, 20, 20)
is_two_boundboxes_lungs = False
is_same_size_boundbox_all_images = False
size_fixed_boundbox_all = None
is_calc_boundbox_in_slices = False
is_rescale_images = False
fixed_rescale_resol = None
propdata_train_valid_test = (0.5, 0.15, 0.35)
type_dnnlib_used = 'Pytorch'
is_model_gpu = True
is_model_halfprec = False
size_in_images = (252, 252, 252)
max_train_images = 100
max_valid_images = 20
type_network = 'UNet3DPlugin'
net_num_featmaps = 16
type_optimizer = 'Adam'
learn_rate = 0.0001
type_loss = 'DiceCoefficient'
weight_combined_loss = 1000.0
list_type_metrics = []
batch_size = 1
num_epochs = 1000
is_valid_convolutions = True
freq_save_check_models = 2
freq_validate_models = 2
is_use_validation_data = True
is_shuffle_traindata = True
manual_seed_train = None
is_generate_patches = True
type_generate_patches = 'random_window'
prop_overlap_slide_window = (0.25, 0.0, 0.0)
num_random_patches_epoch = 4
is_transform_images = True
type_transform_images = 'rigid_trans'
trans_rigid_rotation_range = (10.0, 7.0, 7.0)
trans_rigid_shift_range = (0.0, 0.0, 0.0)
trans_rigid_flip_dirs = (True, True, True)
trans_rigid_zoom_range = 0.25
trans_rigid_fill_mode = 'reflect'
prop_overlap_slide_window_test = (0.5, 0.5, 0.5)
post_threshold_value = 0.5
is_attach_coarse_airways = True
is_remove_trachea_calc_metrics = True
list_type_metrics_result = ['DiceCoefficient', 'AirwayCompleteness', 'AirwayVolumeLeakage', 'AirwayCentrelineLeakage', 'AirwayTreeLength', 'AirwayCentrelineDistanceFalsePositiveError', 'AirwayCentrelineDistanceFalseNegativeError']
metric_evaluate_threshold = 'AirwayVolumeLeakage' |
class Student:
def __init__(self, name, school):
self.name = name
self.school = school
self.marks = []
def average(self):
return sum(self.marks) / len(self.marks)
class WorkingStudent(Student):
def __init__(self, name, school, salary):
super().__init__(name, school)
self.salary = salary
# weekly_salary method doesn't perform an actions, it just calculates a value.
def weekly_salary(self):
return self.salary * 37.5
@property # @property is a decorator allowing us to access NO ARGUMENT weeklySalary method as property of the object
def weeklySalary(self):
return self.salary * 37.5
kamran = WorkingStudent("Kamran", 'NIT B', 15.50)
print(kamran.salary)
kamran.marks.append(57)
kamran.marks.append(99)
print(kamran.average())
print(kamran.weekly_salary())
# We are accessing 'weeklySalary' as property of the object. As there's no action to do.
print(kamran.weeklySalary)
| class Student:
def __init__(self, name, school):
self.name = name
self.school = school
self.marks = []
def average(self):
return sum(self.marks) / len(self.marks)
class Workingstudent(Student):
def __init__(self, name, school, salary):
super().__init__(name, school)
self.salary = salary
def weekly_salary(self):
return self.salary * 37.5
@property
def weekly_salary(self):
return self.salary * 37.5
kamran = working_student('Kamran', 'NIT B', 15.5)
print(kamran.salary)
kamran.marks.append(57)
kamran.marks.append(99)
print(kamran.average())
print(kamran.weekly_salary())
print(kamran.weeklySalary) |
#En ciertos casos usar listas y estas al ser dinamicas consumen mucha memoria y eso resulta ser ineficiente
#Para solucionar ese problema es cuando entran las tuplas
#Tuplas elementos de tipo estatico - no se pueden modificar
#Mas eficientes en los recorridos - estructura de datos mas rapida
#Inmutabilidad - no puede cambiar
mi_lista = [1, 2, 3, 4, 5]
mi_tupla = (1, 2, 3, 4, 5)
for numero in mi_tupla:
print(numero)
# Tupla de un solo valor
my_tuple = (1,)
# Desempaquetando una tupla
my_tuple = (1, 2, 3)
x, y, z = my_tuple
# Con funciones
def coordenadas():
return (5, 4)
x, y = coordenadas() | mi_lista = [1, 2, 3, 4, 5]
mi_tupla = (1, 2, 3, 4, 5)
for numero in mi_tupla:
print(numero)
my_tuple = (1,)
my_tuple = (1, 2, 3)
(x, y, z) = my_tuple
def coordenadas():
return (5, 4)
(x, y) = coordenadas() |
#!/usr/bin/env python3
def read_digits():
return map(int, input().strip())
def index_of_nonzero(items):
return next(i for i, x in enumerate(items) if x != 0)
def with_leading_nonzero(items):
index = index_of_nonzero(items)
items.insert(0, items.pop(index))
return items
for _ in range(int(input())):
digits = sorted(read_digits())
print(*with_leading_nonzero(digits), sep='')
| def read_digits():
return map(int, input().strip())
def index_of_nonzero(items):
return next((i for (i, x) in enumerate(items) if x != 0))
def with_leading_nonzero(items):
index = index_of_nonzero(items)
items.insert(0, items.pop(index))
return items
for _ in range(int(input())):
digits = sorted(read_digits())
print(*with_leading_nonzero(digits), sep='') |
a = int(input())
b = int(input())
print(b % a)
| a = int(input())
b = int(input())
print(b % a) |
UNIT = 20
c = 0.01
t = 0.01
def setup():
fullScreen()
background(200,100,155)
def X(x):
return width/2 + x
def Y(x):
return height/2 - x
def draw():
background(0)
global c,t
noStroke()
rectMode(CORNER)
f = [1,1,2,3,5,8,13,21,34,55,89]
e = [(1,-1),(-1,-1),(-1,1),(1,1)]
# after i can have a for loop in here i can zoom out on runtime to have better visual!
o=f[0]*UNIT
fill(o/c)
rect(X(0),Y(0),o*e[0][0],o*e[0][1])
o=f[1]*UNIT
fill(o/c)
rect(X(UNIT),Y(UNIT),o*e[1][0],o*e[1][1])
o=f[2]*UNIT
fill(o/c)
rect(X(0),Y(o),o*e[2][0],o*e[2][1])
o=f[3]*UNIT
fill(o/c)
rect(X(-2*UNIT),Y(0),o*e[3][0],o*e[3][1])
o=f[4]*UNIT
fill(o/c)
rect(X(UNIT),Y(-3*UNIT),o*e[0][0],o*e[0][1])
o=f[5]*UNIT
fill(o/c)
rect(X(6*UNIT),Y(2*UNIT),o*e[1][0],o*e[1][1])
o=f[6]*UNIT
fill(o/c)
rect(X(-2*UNIT),Y(10*UNIT),o*e[2][0],o*e[2][1])
o=f[7]*UNIT
fill(o/c)
rect(X(-15*UNIT),Y(-3*UNIT),o*e[3][0],o*e[3][1])
o=f[8]*UNIT
fill(o/c)
rect(X(6*UNIT),Y(-24*UNIT),o*e[0][0],o*e[0][1])
o=f[9]*UNIT
fill(o/c)
rect(X(40*UNIT),Y(10*UNIT),o*e[1][0],o*e[1][1])
o=f[10]*UNIT
fill(o/c)
rect(X(-15*UNIT),Y(65*UNIT),o*e[2][0],o*e[2][1])
# endfor
c=c+t
t=t+0.00075
# saveFrame("frames/####.png") | unit = 20
c = 0.01
t = 0.01
def setup():
full_screen()
background(200, 100, 155)
def x(x):
return width / 2 + x
def y(x):
return height / 2 - x
def draw():
background(0)
global c, t
no_stroke()
rect_mode(CORNER)
f = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
e = [(1, -1), (-1, -1), (-1, 1), (1, 1)]
o = f[0] * UNIT
fill(o / c)
rect(x(0), y(0), o * e[0][0], o * e[0][1])
o = f[1] * UNIT
fill(o / c)
rect(x(UNIT), y(UNIT), o * e[1][0], o * e[1][1])
o = f[2] * UNIT
fill(o / c)
rect(x(0), y(o), o * e[2][0], o * e[2][1])
o = f[3] * UNIT
fill(o / c)
rect(x(-2 * UNIT), y(0), o * e[3][0], o * e[3][1])
o = f[4] * UNIT
fill(o / c)
rect(x(UNIT), y(-3 * UNIT), o * e[0][0], o * e[0][1])
o = f[5] * UNIT
fill(o / c)
rect(x(6 * UNIT), y(2 * UNIT), o * e[1][0], o * e[1][1])
o = f[6] * UNIT
fill(o / c)
rect(x(-2 * UNIT), y(10 * UNIT), o * e[2][0], o * e[2][1])
o = f[7] * UNIT
fill(o / c)
rect(x(-15 * UNIT), y(-3 * UNIT), o * e[3][0], o * e[3][1])
o = f[8] * UNIT
fill(o / c)
rect(x(6 * UNIT), y(-24 * UNIT), o * e[0][0], o * e[0][1])
o = f[9] * UNIT
fill(o / c)
rect(x(40 * UNIT), y(10 * UNIT), o * e[1][0], o * e[1][1])
o = f[10] * UNIT
fill(o / c)
rect(x(-15 * UNIT), y(65 * UNIT), o * e[2][0], o * e[2][1])
c = c + t
t = t + 0.00075 |
#
# PySNMP MIB module SMON-MIB (http://pysnmp.sf.net)
# ASN.1 source http://mibs.snmplabs.com:80/asn1/SMON-MIB
# Produced by pysmi-0.0.7 at Sun Feb 14 00:28:37 2016
# On host bldfarm platform Linux version 4.1.13-100.fc21.x86_64 by user goose
# Using Python version 3.5.0 (default, Jan 5 2016, 17:11:52)
#
( ObjectIdentifier, Integer, OctetString, ) = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
( ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion")
( InterfaceIndex, ) = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex")
( OwnerString, rmon, ) = mibBuilder.importSymbols("RMON-MIB", "OwnerString", "rmon")
( rmonConformance, LastCreateTime, DataSource, probeConfig, ) = mibBuilder.importSymbols("RMON2-MIB", "rmonConformance", "LastCreateTime", "DataSource", "probeConfig")
( ModuleCompliance, ObjectGroup, NotificationGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup")
( ModuleIdentity, iso, TimeTicks, Gauge32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, Integer32, Counter32, Unsigned32, Counter64, ObjectIdentity, IpAddress, NotificationType, ) = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "iso", "TimeTicks", "Gauge32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "Integer32", "Counter32", "Unsigned32", "Counter64", "ObjectIdentity", "IpAddress", "NotificationType")
( RowStatus, DisplayString, TextualConvention, ) = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention")
switchRMON = ModuleIdentity((1, 3, 6, 1, 2, 1, 16, 22))
if mibBuilder.loadTexts: switchRMON.setLastUpdated('9812160000Z')
if mibBuilder.loadTexts: switchRMON.setOrganization('IETF RMON MIB Working Group')
if mibBuilder.loadTexts: switchRMON.setContactInfo('IETF RMONMIB WG Mailing list: rmonmib@cisco.com\n\n Rich Waterman\n Allot Networks Inc.\n Tel: +1-408-559-0253\n Email: rich@allot.com\n\n Bill Lahaye\n Xylan Corp.\n Tel: +1-800-995-2612\n Email: lahaye@ctron.com\n\n Dan Romascanu\n Lucent Technologies\n Tel: +972-3-645-8414\n Email: dromasca@lucent.com\n\n Steven Waldbusser\n International Network Services\n Tel: +1-415-254-4251\n Email: waldbusser@ins.com')
if mibBuilder.loadTexts: switchRMON.setDescription('The MIB module for managing remote monitoring device\n implementations for Switched Networks')
smonMIBObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 22, 1))
dataSourceCaps = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 22, 1, 1))
smonStats = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 22, 1, 2))
portCopyConfig = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 22, 1, 3))
smonRegistrationPoints = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 22, 1, 4))
class SmonDataSource(ObjectIdentifier, TextualConvention):
pass
smonCapabilities = MibScalar((1, 3, 6, 1, 2, 1, 16, 19, 15), Bits().clone(namedValues=NamedValues(("smonVlanStats", 0), ("smonPrioStats", 1), ("dataSource", 2), ("smonUnusedBit", 3), ("portCopy", 4),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: smonCapabilities.setDescription('An indication of the SMON MIB groups supported\n by this agent.')
dataSourceCapsTable = MibTable((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1), )
if mibBuilder.loadTexts: dataSourceCapsTable.setDescription("This table describes RMON data sources and port copy\n capabilities. An NMS MAY use this table to discover the\n identity and attributes of the data sources on a given agent\n implementation. Similar to the probeCapabilities object,\n actual row-creation operations will succeed or fail based on\n the resources available and parameter values used in each\n row-creation operation.\n\n Upon restart of the RMON agent, the dataSourceTable, ifTable,\n and perhaps entPhysicalTable are initialized for the available\n dataSources.\n\n For each dataSourceCapsEntry representing a VLAN or\n entPhysicalEntry the agent MUST create an associated ifEntry\n with a ifType value of 'propVirtual(53)'. This ifEntry will be\n used as the actual value in RMON control table dataSource\n objects. The assigned ifIndex value is copied into the\n associated dataSourceCapsIfIndex object.\n It is understood that dataSources representing VLANs may not\n always be instantiated immediately upon restart, but rather as\n VLAN usage is detected by the agent. The agent SHOULD attempt\n to create dataSource and interface entries for all dataSources\n as soon as possible.")
dataSourceCapsEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1, 1), ).setIndexNames((1, "SMON-MIB", "dataSourceCapsObject"))
if mibBuilder.loadTexts: dataSourceCapsEntry.setDescription('Entries per data source containing descriptions of data\n source and port copy capabilities. This table is populated by\n the SMON agent with one entry for each supported data\n source.')
dataSourceCapsObject = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1, 1, 1), SmonDataSource())
if mibBuilder.loadTexts: dataSourceCapsObject.setDescription('Defines an object that can be a SMON data source or a\n source or a destination for a port copy operation.')
dataSourceRmonCaps = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1, 1, 2), Bits().clone(namedValues=NamedValues(("countErrFrames", 0), ("countAllGoodFrames", 1), ("countAnyRmonTables", 2), ("babyGiantsCountAsGood", 3),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dataSourceRmonCaps.setDescription(" General attributes of the specified dataSource. Note that\n these are static attributes, which SHOULD NOT be adjusted\n because of current resources or configuration.\n\n - countErrFrames(0)\n The agent sets this bit for the dataSource if errored frames\n received on this dataSource can actually be monitored by the\n agent The agent clears this bit if any errored frames are\n not visible to the RMON data collector.\n\n - countAllGoodFrames(1)\n The agent sets this bit for the dataSource if all good\n frames received on this dataSource can actually be monitored\n by the agent. The agent clears this bit if any good frames\n are not visible for RMON collection, e.g., the dataSource is\n a non-promiscuous interface or an internal switch interface\n which may not receive frames which were switched in hardware\n or dropped by the bridge forwarding function.\n\n - countAnyRmonTables(2)\n The agent sets this bit if this dataSource can actually be\n used in any of the implemented RMON tables, resources\n notwithstanding. The agent clears this bit if this\n dataSourceCapsEntry is present simply to identify a\n dataSource that may only be used as portCopySource and/or a\n portCopyDest, but not the source of an actual RMON data\n collection.\n\n - babyGiantsCountAsGood(3)\n The agent sets this bit if it can distinguish, for counting\n purposes, between true giant frames and frames that exceed\n Ethernet maximum frame size 1518 due to VLAN tagging ('baby\n giants'). Specifically, this BIT means that frames up to\n 1522 octets are counted as good.\n\n Agents not capable of detecting 'baby giants' will clear\n this bit and will view all frames less than or equal to 1518\n octets as 'good frames' and all frames larger than 1518\n octets as 'bad frames' for the purpose of counting in the\n smonVlanIdStats and smonPrioStats tables.\n\n Agents capable of detecting 'baby giants' SHALL consider\n them as 'good frames' for the purpose of counting in the\n smonVlanIdStats and smonPrioStats tables.")
dataSourceCopyCaps = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1, 1, 3), Bits().clone(namedValues=NamedValues(("copySourcePort", 0), ("copyDestPort", 1), ("copySrcTxTraffic", 2), ("copySrcRxTraffic", 3), ("countDestDropEvents", 4), ("copyErrFrames", 5), ("copyUnalteredFrames", 6), ("copyAllGoodFrames", 7),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dataSourceCopyCaps.setDescription('PortCopy function capabilities of the specified dataSource.\n Note that these are static capabilities, which SHOULD NOT be\n adjusted because of current resources or configuration.\n\n - copySourcePort(0)\n The agent sets this bit if this dataSource is capable of\n acting as a source of a portCopy operation. The agent clears\n this bit otherwise.\n\n - copyDestPort(1)\n The agent sets this bit if this dataSource is capable of\n acting as a destination of a portCopy operation. The agent\n clears this bit otherwise.\n\n - copySrcTxTraffic(2)\n If the copySourcePort bit is set:\n The agent sets this bit if this dataSource is capable of\n copying frames transmitted out this portCopy source. The\n agent clears this bit otherwise. This function is needed\n to support full-duplex ports.\n Else:\n this bit SHOULD be cleared.\n\n - copySrcRxTraffic(3)\n If the copySourcePort bit is set:\n The agent sets this bit if this dataSource is capable of\n copying frames received on this portCopy source. The agent\n clears this bit otherwise. This function is needed to\n support full-duplex ports.\n Else:\n this bit SHOULD be cleared.\n\n - countDestDropEvents(4)\n If the copyDestPort bit is set:\n The agent sets this bit if it is capable of incrementing\n portCopyDestDropEvents, when this dataSource is the\n target of a portCopy operation and a frame destined to\n this dataSource is dropped (for RMON counting purposes).\n Else:\n this BIT SHOULD be cleared.\n\n - copyErrFrames(5)\n If the copySourcePort bit is set:\n The agent sets this bit if it is capable of copying all\n errored frames from this portCopy source-port, for\n errored frames received on this dataSource.\n Else:\n this BIT SHOULD be cleared.\n\n - copyUnalteredFrames(6)\n If the copySourcePort bit is set:\n The agent sets the copyUnalteredFrames bit If it is\n capable of copying all frames from this portCopy\n source-port without alteration in any way;\n Else:\n this bit SHOULD be cleared.\n\n - copyAllGoodFrames(7)\n If the copySourcePort bit is set:\n The agent sets this bit for the dataSource if all good\n frames received on this dataSource are normally capable\n of being copied by the agent. The agent clears this bit\n if any good frames are not visible for the RMON portCopy\n operation, e.g., the dataSource is a non-promiscuous\n interface or an internal switch interface which may not\n receive frames which were switched in hardware or\n dropped by the bridge forwarding function.\n Else:\n this bit SHOULD be cleared.')
dataSourceCapsIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1, 1, 4), InterfaceIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dataSourceCapsIfIndex.setDescription("This object contains the ifIndex value of the ifEntry\n associated with this smonDataSource. The agent MUST create\n 'propVirtual' ifEntries for each dataSourceCapsEntry of type\n VLAN or entPhysicalEntry.")
smonVlanStatsControlTable = MibTable((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1), )
if mibBuilder.loadTexts: smonVlanStatsControlTable.setDescription('Controls the setup of VLAN statistics tables.\n\n The statistics collected represent a distribution based on\n the IEEE 802.1Q VLAN-ID (VID), for each good frame attributed\n to the data source for the collection.')
smonVlanStatsControlEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1), ).setIndexNames((0, "SMON-MIB", "smonVlanStatsControlIndex"))
if mibBuilder.loadTexts: smonVlanStatsControlEntry.setDescription('A conceptual row in the smonVlanStatsControlTable.')
smonVlanStatsControlIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535)))
if mibBuilder.loadTexts: smonVlanStatsControlIndex.setDescription('A unique arbitrary index for this smonVlanStatsControlEntry.')
smonVlanStatsControlDataSource = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1, 2), DataSource()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: smonVlanStatsControlDataSource.setDescription('The source of data for this set of VLAN statistics.\n\n This object MAY NOT be modified if the associated\n smonVlanStatsControlStatus object is equal to active(1).')
smonVlanStatsControlCreateTime = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1, 3), LastCreateTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanStatsControlCreateTime.setDescription('The value of sysUpTime when this control entry was last\n activated. This object allows to a management station to\n detect deletion and recreation cycles between polls.')
smonVlanStatsControlOwner = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1, 4), OwnerString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: smonVlanStatsControlOwner.setDescription('Administratively assigned named of the owner of this entry.\n It usually defines the entity that created this entry and is\n therefore using the resources assigned to it, though there is\n no enforcement mechanism, nor assurance that rows created are\n ever used.')
smonVlanStatsControlStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: smonVlanStatsControlStatus.setDescription('The status of this row.\n\n An entry MAY NOT exist in the active state unless all\n objects in the entry have an appropriate value.\n\n If this object is not equal to active(1), all associated\n entries in the smonVlanIdStatsTable SHALL be deleted.')
smonVlanIdStatsTable = MibTable((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2), )
if mibBuilder.loadTexts: smonVlanIdStatsTable.setDescription('Contains the VLAN statistics data.\n The statistics collected represent a distribution based\n on the IEEE 802.1Q VLAN-ID (VID), for each good frame\n attributed to the data source for the collection.\n\n This function applies the same rules for attributing frames\n to VLAN-based collections. RMON VLAN statistics are collected\n after the Ingress Rules defined in section 3.13 of the VLAN\n Specification [20] are applied.\n\n It is possible that entries in this table will be\n garbage-collected, based on agent resources, and VLAN\n configuration. Agents are encouraged to support all 4094\n index values and not garbage collect this table.')
smonVlanIdStatsEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1), ).setIndexNames((0, "SMON-MIB", "smonVlanStatsControlIndex"), (0, "SMON-MIB", "smonVlanIdStatsId"))
if mibBuilder.loadTexts: smonVlanIdStatsEntry.setDescription('A conceptual row in smonVlanIdStatsTable.')
smonVlanIdStatsId = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,4094)))
if mibBuilder.loadTexts: smonVlanIdStatsId.setDescription('The unique identifier of the VLAN monitored for\n this specific statistics collection.\n\n Tagged packets match the VID for the range between 1 and 4094.\n An external RMON probe MAY detect VID=0 on an Inter Switch\n Link, in which case the packet belongs to a VLAN determined by\n the PVID of the ingress port. The VLAN to which such a packet\n belongs can be determined only by a RMON probe internal to the\n switch.')
smonVlanIdStatsTotalPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 2), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsTotalPkts.setDescription('The total number of packets counted on this VLAN.')
smonVlanIdStatsTotalOverflowPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 3), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsTotalOverflowPkts.setDescription('The number of times the associated smonVlanIdStatsTotalPkts\n counter has overflowed.')
smonVlanIdStatsTotalHCPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 4), Counter64()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsTotalHCPkts.setDescription('The total number of packets counted on this VLAN.')
smonVlanIdStatsTotalOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 5), Counter32()).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsTotalOctets.setDescription('The total number of octets counted on this VLAN.')
smonVlanIdStatsTotalOverflowOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 6), Counter32()).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsTotalOverflowOctets.setDescription('The number of times the associated smonVlanIdStatsTotalOctets\n counter has overflowed.')
smonVlanIdStatsTotalHCOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 7), Counter64()).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsTotalHCOctets.setDescription('The total number of octets counted on this VLAN.')
smonVlanIdStatsNUcastPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 8), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsNUcastPkts.setDescription('The total number of non-unicast packets counted on this\n VLAN.')
smonVlanIdStatsNUcastOverflowPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 9), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsNUcastOverflowPkts.setDescription('The number of times the associated smonVlanIdStatsNUcastPkts\n counter has overflowed.')
smonVlanIdStatsNUcastHCPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 10), Counter64()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsNUcastHCPkts.setDescription('The total number of non-unicast packets counted on\n this VLAN.')
smonVlanIdStatsNUcastOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 11), Counter32()).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsNUcastOctets.setDescription('The total number of non-unicast octets counted on\n this VLAN.')
smonVlanIdStatsNUcastOverflowOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 12), Counter32()).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsNUcastOverflowOctets.setDescription('The number of times the associated\n smonVlanIdStatsNUcastOctets counter has overflowed.')
smonVlanIdStatsNUcastHCOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 13), Counter64()).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsNUcastHCOctets.setDescription('The total number of Non-unicast octets counted on\n this VLAN.')
smonVlanIdStatsCreateTime = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 14), LastCreateTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: smonVlanIdStatsCreateTime.setDescription('The value of sysUpTime when this entry was last\n activated. This object allows to a management station to\n detect deletion and recreation cycles between polls.')
smonPrioStatsControlTable = MibTable((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3), )
if mibBuilder.loadTexts: smonPrioStatsControlTable.setDescription('Controls the setup of priority statistics tables.\n\n The smonPrioStatsControlTable allows configuration of\n collections based on the value of the 3-bit user priority\n field encoded in the Tag Control Information (TCI) field\n according to [19],[20].\n\n Note that this table merely reports priority as encoded in\n the VLAN headers, not the priority (if any) given to the\n frame for the actual switching purposes.')
smonPrioStatsControlEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1), ).setIndexNames((0, "SMON-MIB", "smonPrioStatsControlIndex"))
if mibBuilder.loadTexts: smonPrioStatsControlEntry.setDescription('A conceptual row in the smonPrioStatsControlTable.')
smonPrioStatsControlIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535)))
if mibBuilder.loadTexts: smonPrioStatsControlIndex.setDescription('A unique arbitrary index for this smonPrioStatsControlEntry.')
smonPrioStatsControlDataSource = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1, 2), DataSource()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: smonPrioStatsControlDataSource.setDescription('The source of data for this set of VLAN statistics.\n\n This object MAY NOT be modified if the associated\n smonPrioStatsControlStatus object is equal to active(1).')
smonPrioStatsControlCreateTime = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1, 3), LastCreateTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: smonPrioStatsControlCreateTime.setDescription('The value of sysUpTime when this entry was created.\n This object allows to a management station to\n detect deletion and recreation cycles between polls.')
smonPrioStatsControlOwner = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1, 4), OwnerString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: smonPrioStatsControlOwner.setDescription('Administratively assigned named of the owner of this entry.\n It usually defines the entity that created this entry and is\n therefore using the resources assigned to it, though there is\n no enforcement mechanism, nor assurance that rows created are\n ever used.')
smonPrioStatsControlStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: smonPrioStatsControlStatus.setDescription('The status of this row.\n An entry MAY NOT exist in the active state unless all\n objects in the entry have an appropriate value.\n\n If this object is not equal to active(1), all associated\n entries in the smonPrioStatsTable SHALL be deleted.')
smonPrioStatsTable = MibTable((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4), )
if mibBuilder.loadTexts: smonPrioStatsTable.setDescription('Contains the priority statistics. The collections are based\n on the value of the 3-bit user priority field encoded in the\n Tag Control Information (TCI) field according to [19], [20].\n Note that this table merely reports priority as encoded in\n the VLAN headers, not the priority (if any) given to the\n frame for the actual switching purposes.\n\n No garbage collection is designed for this table, as there\n always are at most eight rows per statistical set, and the\n low memory requirements do not justify the implementation of\n such a mechanism.')
smonPrioStatsEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1), ).setIndexNames((0, "SMON-MIB", "smonPrioStatsControlIndex"), (0, "SMON-MIB", "smonPrioStatsId"))
if mibBuilder.loadTexts: smonPrioStatsEntry.setDescription('A conceptual row in smonPrioStatsTable.')
smonPrioStatsId = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,7)))
if mibBuilder.loadTexts: smonPrioStatsId.setDescription('The unique identifier of the priority level monitored for\n this specific statistics collection.')
smonPrioStatsPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 2), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonPrioStatsPkts.setDescription('The total number of packets counted on\n this priority level.')
smonPrioStatsOverflowPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 3), Counter32()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonPrioStatsOverflowPkts.setDescription('The number of times the associated smonPrioStatsPkts\n counter has overflowed.')
smonPrioStatsHCPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 4), Counter64()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonPrioStatsHCPkts.setDescription('The total number of packets counted on\n this priority level.')
smonPrioStatsOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 5), Counter32()).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonPrioStatsOctets.setDescription('The total number of octets counted on\n this priority level.')
smonPrioStatsOverflowOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 6), Counter32()).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonPrioStatsOverflowOctets.setDescription('The number of times the associated smonPrioStatsOctets\n counter has overflowed.')
smonPrioStatsHCOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 7), Counter64()).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: smonPrioStatsHCOctets.setDescription('The total number of octets counted on\n this priority level.')
portCopyTable = MibTable((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1), )
if mibBuilder.loadTexts: portCopyTable.setDescription(" Port Copy provides the ability to copy all frames from a\n specified source to specified destination within a switch.\n Source and destinations MUST be ifEntries, as defined by [22].\n One to one, one to many, many to one and many to many source to\n destination relationships may be configured.\n\n Applicable counters on the destination will increment for all\n packets transiting the port, be it by normal bridging/switching\n or due to packet copy.\n Note that this table manages no RMON data collection by itself,\n and an agent may possibly implement no RMON objects except\n objects related to the port copy operation defined by the\n portCopyCompliance conformance macro. That allows for a switch\n with no other embedded RMON capability to perform port copy\n operations to a destination port at which a different external\n RMON probe is connected.\n\n One to one, many to one and one to many source to destination\n relationships may be configured.\n\n Each row that exists in this table defines such a\n relationship. By disabling a row in this table the port copy\n relationship no longer exists.\n\n The number of entries and the types of port copies (1-1,\n many-1, 1-many) are implementation specific and could\n possibly be dynamic due to changing resource availability.\n\n In order to configure a source to destination portCopy\n relationship, both source and destination interfaces MUST be\n present as an ifEntry in the ifTable and their respective\n ifAdminStatus and ifOperStatus values MUST be equal to\n 'up(1)'. If the value of any of those two objects changes\n after the portCopyEntry is activated, portCopyStatus will\n transition to 'notReady(3)'.\n\n The capability of an interface to be source or destination of\n a port copy operation is described by the 'copySourcePort(0)'\n and 'copyDestPort(1)' bits in dataSourceCopyCaps. Those bits\n SHOULD be appropriately set by the agent, in order to allow\n for a portCopyEntry to be created.\n\n Applicable counters on the destination will increment for all\n packets transmitted, be it by normal bridging/switching or\n due to packet copy.")
portCopyEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1), ).setIndexNames((0, "SMON-MIB", "portCopySource"), (0, "SMON-MIB", "portCopyDest"))
if mibBuilder.loadTexts: portCopyEntry.setDescription('Describes a particular port copy entry.')
portCopySource = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: portCopySource.setDescription('The ifIndex of the source which will have all packets\n redirected to the destination as defined by portCopyDest.')
portCopyDest = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1, 2), InterfaceIndex())
if mibBuilder.loadTexts: portCopyDest.setDescription('Defines the ifIndex destination for the copy operation.')
portCopyDestDropEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1, 3), Counter32()).setUnits('events').setMaxAccess("readonly")
if mibBuilder.loadTexts: portCopyDestDropEvents.setDescription('The total number of events in which port copy packets were\n dropped by the switch at the destination port due to lack of\n resources.\n\n Note that this number is not necessarily the number of\n packets dropped; it is just the number of times this\n condition has been detected.\n\n A single dropped event counter is maintained for each\n portCopyDest. Thus all instances associated with a given\n portCopyDest will have the same portCopyDestDropEvents\n value.')
portCopyDirection = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("copyRxOnly", 1), ("copyTxOnly", 2), ("copyBoth", 3),)).clone('copyBoth')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: portCopyDirection.setDescription("This object affects the way traffic is copied from a switch\n source port, for the indicated port copy operation.\n\n\n If this object has the value 'copyRxOnly(1)', then only\n traffic received on the indicated source port will be copied\n to the indicated destination port.\n\n If this object has the value 'copyTxOnly(2)', then only\n traffic transmitted out the indicated source port will be\n copied to the indicated destination port.\n\n If this object has the value 'copyBoth(3)', then all traffic\n received or transmitted on the indicated source port will be\n copied to the indicated destination port.\n\n The creation and deletion of instances of this object is\n controlled by the portCopyRowStatus object. Note that there\n is no guarantee that changes in the value of this object\n performed while the associated portCopyRowStatus object is\n equal to active will not cause traffic discontinuities in the\n packet stream.")
portCopyStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: portCopyStatus.setDescription("Defines the status of the port copy entry.\n\n In order to configure a source to destination portCopy\n relationship, both source and destination interfaces MUST be\n present as an ifEntry in the ifTable and their respective\n ifAdminStatus and ifOperStatus values MUST be equal to\n 'up(1)'. If the value of any of those two objects changes\n after the portCopyEntry is activated, portCopyStatus will\n transition to 'notReady(3)'.\n\n The capability of an interface to be source or destination of\n a port copy operation is described by the 'copySourcePort(0)'\n and 'copyDestPort(1)' bits in dataSourceCopyCaps. Those bits\n SHOULD be appropriately set by the agent, in order to allow\n for a portCopyEntry to be created.")
smonVlanDataSource = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 22, 1, 4, 1))
smonMIBCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 20, 3))
smonMIBGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 20, 4))
smonMIBCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 16, 20, 3, 1)).setObjects(*(("SMON-MIB", "dataSourceCapsGroup"), ("SMON-MIB", "smonVlanStatsGroup"), ("SMON-MIB", "smonPrioStatsGroup"), ("SMON-MIB", "portCopyConfigGroup"), ("SMON-MIB", "smonInformationGroup"), ("SMON-MIB", "smonHcTo100mbGroup"), ("SMON-MIB", "smonHc100mbPlusGroup"),))
if mibBuilder.loadTexts: smonMIBCompliance.setDescription('Describes the requirements for full conformance with the SMON\n MIB')
smonMIBVlanStatsCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 16, 20, 3, 2)).setObjects(*(("SMON-MIB", "dataSourceCapsGroup"), ("SMON-MIB", "smonVlanStatsGroup"), ("SMON-MIB", "smonInformationGroup"), ("SMON-MIB", "hcVlanTo100mbGroup"), ("SMON-MIB", "hcVlan100mbPlusGroup"),))
if mibBuilder.loadTexts: smonMIBVlanStatsCompliance.setDescription('Describes the requirements for conformance with the SMON MIB\n with support for VLAN Statistics. Mandatory for a SMON probe\n in environment where IEEE 802.1Q bridging is implemented.')
smonMIBPrioStatsCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 16, 20, 3, 3)).setObjects(*(("SMON-MIB", "dataSourceCapsGroup"), ("SMON-MIB", "smonPrioStatsGroup"), ("SMON-MIB", "smonInformationGroup"), ("SMON-MIB", "hcPrioTo100mbGroup"), ("SMON-MIB", "hcPrio100mbPlusGroup"),))
if mibBuilder.loadTexts: smonMIBPrioStatsCompliance.setDescription('Describes the requirements for conformance with the SMON MIB\n with support for priority level Statistics. Mandatory for a\n SMON probe in a environment where IEEE 802.1p\n priority-switching is implemented.')
portCopyCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 16, 20, 3, 4)).setObjects(*(("SMON-MIB", "dataSourceCapsGroup"), ("SMON-MIB", "portCopyConfigGroup"), ("SMON-MIB", "smonInformationGroup"),))
if mibBuilder.loadTexts: portCopyCompliance.setDescription('Describes the requirements for conformance with the port copy\n functionality defined by the SMON MIB')
dataSourceCapsGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 1)).setObjects(*(("SMON-MIB", "dataSourceRmonCaps"), ("SMON-MIB", "dataSourceCopyCaps"), ("SMON-MIB", "dataSourceCapsIfIndex"),))
if mibBuilder.loadTexts: dataSourceCapsGroup.setDescription('Defines the objects that describe the capabilities of RMON\n data sources.')
smonVlanStatsGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 2)).setObjects(*(("SMON-MIB", "smonVlanStatsControlDataSource"), ("SMON-MIB", "smonVlanStatsControlCreateTime"), ("SMON-MIB", "smonVlanStatsControlOwner"), ("SMON-MIB", "smonVlanStatsControlStatus"), ("SMON-MIB", "smonVlanIdStatsTotalPkts"), ("SMON-MIB", "smonVlanIdStatsTotalOctets"), ("SMON-MIB", "smonVlanIdStatsNUcastPkts"), ("SMON-MIB", "smonVlanIdStatsCreateTime"),))
if mibBuilder.loadTexts: smonVlanStatsGroup.setDescription('Defines the switch monitoring specific statistics - per VLAN\n Id on interfaces of 10MB or less.')
smonPrioStatsGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 3)).setObjects(*(("SMON-MIB", "smonPrioStatsControlDataSource"), ("SMON-MIB", "smonPrioStatsControlCreateTime"), ("SMON-MIB", "smonPrioStatsControlOwner"), ("SMON-MIB", "smonPrioStatsControlStatus"), ("SMON-MIB", "smonPrioStatsPkts"), ("SMON-MIB", "smonPrioStatsOctets"),))
if mibBuilder.loadTexts: smonPrioStatsGroup.setDescription('Defines the switch monitoring specific statistics - per VLAN\n Id on interface.')
smonHcTo100mbGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 4)).setObjects(*(("SMON-MIB", "smonVlanIdStatsTotalOverflowOctets"), ("SMON-MIB", "smonVlanIdStatsTotalHCOctets"), ("SMON-MIB", "smonPrioStatsOverflowOctets"), ("SMON-MIB", "smonPrioStatsHCOctets"),))
if mibBuilder.loadTexts: smonHcTo100mbGroup.setDescription('Defines the additional high capacity statistics needed to be\n kept on interfaces with ifSpeed greater than 10MB/sec and\n less than or equal to 100MB/sec.')
smonHc100mbPlusGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 5)).setObjects(*(("SMON-MIB", "smonVlanIdStatsTotalOverflowPkts"), ("SMON-MIB", "smonVlanIdStatsTotalHCPkts"), ("SMON-MIB", "smonVlanIdStatsTotalOverflowOctets"), ("SMON-MIB", "smonVlanIdStatsTotalHCOctets"), ("SMON-MIB", "smonVlanIdStatsNUcastOverflowPkts"), ("SMON-MIB", "smonVlanIdStatsNUcastHCPkts"), ("SMON-MIB", "smonPrioStatsOverflowPkts"), ("SMON-MIB", "smonPrioStatsHCPkts"), ("SMON-MIB", "smonPrioStatsOverflowOctets"), ("SMON-MIB", "smonPrioStatsHCOctets"),))
if mibBuilder.loadTexts: smonHc100mbPlusGroup.setDescription('Defines the additional high capacity statistics needed to be\n kept on interfaces with ifSpeed of more than 100MB/sec. These\n statistics MUST also be kept on smonDataSources of type VLAN\n or entPhysicalEntry.')
hcVlanTo100mbGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 6)).setObjects(*(("SMON-MIB", "smonVlanIdStatsTotalOverflowOctets"), ("SMON-MIB", "smonVlanIdStatsTotalHCOctets"),))
if mibBuilder.loadTexts: hcVlanTo100mbGroup.setDescription('Defines the additional high capacity VLAN statistics\n needed to be kept on interfaces with ifSpeed greater than\n 10MB/sec and less than or equal to 100MB/sec.')
hcVlan100mbPlusGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 7)).setObjects(*(("SMON-MIB", "smonVlanIdStatsTotalOverflowPkts"), ("SMON-MIB", "smonVlanIdStatsTotalHCPkts"), ("SMON-MIB", "smonVlanIdStatsTotalOverflowOctets"), ("SMON-MIB", "smonVlanIdStatsTotalHCOctets"), ("SMON-MIB", "smonVlanIdStatsNUcastOverflowPkts"), ("SMON-MIB", "smonVlanIdStatsNUcastHCPkts"),))
if mibBuilder.loadTexts: hcVlan100mbPlusGroup.setDescription('Defines the additional high capacity VLAN statistics\n needed to be kept on interfaces with ifSpeed of more than\n 100MB/sec. These statistics MUST also be kept on\n smonDataSources of type VLAN or entPhysicalEntry.')
hcPrioTo100mbGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 8)).setObjects(*(("SMON-MIB", "smonPrioStatsOverflowOctets"), ("SMON-MIB", "smonPrioStatsHCOctets"),))
if mibBuilder.loadTexts: hcPrioTo100mbGroup.setDescription('Defines the additional high capacity VLAN priority\n statistics needed to be kept on interfaces with\n ifSpeed of greater than 10MB/sec and less than or equal\n to 100MB/sec.')
hcPrio100mbPlusGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 9)).setObjects(*(("SMON-MIB", "smonPrioStatsOverflowPkts"), ("SMON-MIB", "smonPrioStatsHCPkts"), ("SMON-MIB", "smonPrioStatsOverflowOctets"), ("SMON-MIB", "smonPrioStatsHCOctets"),))
if mibBuilder.loadTexts: hcPrio100mbPlusGroup.setDescription('Defines the additional high capacity VLAN priority\n statistics needed to be kept on interfaces with\n ifSpeed of greater than 100MB/sec. These statistics MUST\n also be kept on smonDataSources of type VLAN or\n entPhysicalEntry.')
smonVlanStatsExtGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 10)).setObjects(*(("SMON-MIB", "smonVlanIdStatsNUcastOctets"), ("SMON-MIB", "smonVlanIdStatsNUcastOverflowOctets"), ("SMON-MIB", "smonVlanIdStatsNUcastHCOctets"),))
if mibBuilder.loadTexts: smonVlanStatsExtGroup.setDescription('Defines the switch monitoring specific statistics for systems\n capable of counting non-unicast octets for a given dataSource\n (as described in the dataSourceRmonCaps object).')
smonInformationGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 11)).setObjects(*(("SMON-MIB", "smonCapabilities"),))
if mibBuilder.loadTexts: smonInformationGroup.setDescription('An indication of the SMON capabilities supported by this\n agent.')
portCopyConfigGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 16, 20, 4, 12)).setObjects(*(("SMON-MIB", "portCopyDestDropEvents"), ("SMON-MIB", "portCopyDirection"), ("SMON-MIB", "portCopyStatus"),))
if mibBuilder.loadTexts: portCopyConfigGroup.setDescription('Defines the control objects for copy port operations.')
mibBuilder.exportSymbols("SMON-MIB", smonVlanIdStatsNUcastOverflowOctets=smonVlanIdStatsNUcastOverflowOctets, smonVlanIdStatsTotalHCPkts=smonVlanIdStatsTotalHCPkts, portCopyDestDropEvents=portCopyDestDropEvents, dataSourceCapsGroup=dataSourceCapsGroup, smonMIBCompliance=smonMIBCompliance, smonPrioStatsControlDataSource=smonPrioStatsControlDataSource, hcVlan100mbPlusGroup=hcVlan100mbPlusGroup, smonVlanIdStatsTotalOverflowOctets=smonVlanIdStatsTotalOverflowOctets, dataSourceCaps=dataSourceCaps, smonMIBVlanStatsCompliance=smonMIBVlanStatsCompliance, smonVlanStatsControlDataSource=smonVlanStatsControlDataSource, smonPrioStatsControlIndex=smonPrioStatsControlIndex, smonVlanStatsControlIndex=smonVlanStatsControlIndex, smonInformationGroup=smonInformationGroup, PYSNMP_MODULE_ID=switchRMON, portCopyEntry=portCopyEntry, smonMIBCompliances=smonMIBCompliances, portCopyDest=portCopyDest, smonMIBObjects=smonMIBObjects, smonVlanStatsControlOwner=smonVlanStatsControlOwner, smonVlanStatsControlStatus=smonVlanStatsControlStatus, smonPrioStatsOverflowPkts=smonPrioStatsOverflowPkts, smonPrioStatsControlTable=smonPrioStatsControlTable, portCopyDirection=portCopyDirection, smonHcTo100mbGroup=smonHcTo100mbGroup, smonPrioStatsControlEntry=smonPrioStatsControlEntry, smonMIBPrioStatsCompliance=smonMIBPrioStatsCompliance, smonVlanIdStatsTotalPkts=smonVlanIdStatsTotalPkts, smonVlanIdStatsId=smonVlanIdStatsId, smonPrioStatsTable=smonPrioStatsTable, portCopyStatus=portCopyStatus, hcPrioTo100mbGroup=hcPrioTo100mbGroup, portCopyConfig=portCopyConfig, dataSourceCopyCaps=dataSourceCopyCaps, smonPrioStatsId=smonPrioStatsId, smonVlanIdStatsTotalHCOctets=smonVlanIdStatsTotalHCOctets, portCopySource=portCopySource, portCopyTable=portCopyTable, dataSourceCapsIfIndex=dataSourceCapsIfIndex, smonVlanStatsControlEntry=smonVlanStatsControlEntry, dataSourceCapsObject=dataSourceCapsObject, smonVlanStatsExtGroup=smonVlanStatsExtGroup, portCopyConfigGroup=portCopyConfigGroup, smonVlanStatsControlCreateTime=smonVlanStatsControlCreateTime, smonVlanIdStatsNUcastOverflowPkts=smonVlanIdStatsNUcastOverflowPkts, smonVlanIdStatsTable=smonVlanIdStatsTable, hcPrio100mbPlusGroup=hcPrio100mbPlusGroup, dataSourceRmonCaps=dataSourceRmonCaps, smonRegistrationPoints=smonRegistrationPoints, smonCapabilities=smonCapabilities, smonMIBGroups=smonMIBGroups, smonVlanIdStatsTotalOverflowPkts=smonVlanIdStatsTotalOverflowPkts, smonHc100mbPlusGroup=smonHc100mbPlusGroup, dataSourceCapsEntry=dataSourceCapsEntry, smonPrioStatsPkts=smonPrioStatsPkts, smonPrioStatsHCPkts=smonPrioStatsHCPkts, smonStats=smonStats, smonVlanDataSource=smonVlanDataSource, smonPrioStatsOctets=smonPrioStatsOctets, smonVlanStatsControlTable=smonVlanStatsControlTable, smonVlanIdStatsTotalOctets=smonVlanIdStatsTotalOctets, SmonDataSource=SmonDataSource, smonPrioStatsEntry=smonPrioStatsEntry, smonVlanIdStatsNUcastOctets=smonVlanIdStatsNUcastOctets, smonVlanIdStatsNUcastHCOctets=smonVlanIdStatsNUcastHCOctets, smonVlanIdStatsCreateTime=smonVlanIdStatsCreateTime, hcVlanTo100mbGroup=hcVlanTo100mbGroup, smonPrioStatsOverflowOctets=smonPrioStatsOverflowOctets, smonPrioStatsHCOctets=smonPrioStatsHCOctets, smonPrioStatsControlOwner=smonPrioStatsControlOwner, dataSourceCapsTable=dataSourceCapsTable, smonPrioStatsControlStatus=smonPrioStatsControlStatus, switchRMON=switchRMON, smonVlanStatsGroup=smonVlanStatsGroup, smonVlanIdStatsNUcastPkts=smonVlanIdStatsNUcastPkts, smonPrioStatsControlCreateTime=smonPrioStatsControlCreateTime, smonPrioStatsGroup=smonPrioStatsGroup, smonVlanIdStatsEntry=smonVlanIdStatsEntry, smonVlanIdStatsNUcastHCPkts=smonVlanIdStatsNUcastHCPkts, portCopyCompliance=portCopyCompliance)
| (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, single_value_constraint, value_size_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion')
(interface_index,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex')
(owner_string, rmon) = mibBuilder.importSymbols('RMON-MIB', 'OwnerString', 'rmon')
(rmon_conformance, last_create_time, data_source, probe_config) = mibBuilder.importSymbols('RMON2-MIB', 'rmonConformance', 'LastCreateTime', 'DataSource', 'probeConfig')
(module_compliance, object_group, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'ObjectGroup', 'NotificationGroup')
(module_identity, iso, time_ticks, gauge32, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, integer32, counter32, unsigned32, counter64, object_identity, ip_address, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'iso', 'TimeTicks', 'Gauge32', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'Integer32', 'Counter32', 'Unsigned32', 'Counter64', 'ObjectIdentity', 'IpAddress', 'NotificationType')
(row_status, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'DisplayString', 'TextualConvention')
switch_rmon = module_identity((1, 3, 6, 1, 2, 1, 16, 22))
if mibBuilder.loadTexts:
switchRMON.setLastUpdated('9812160000Z')
if mibBuilder.loadTexts:
switchRMON.setOrganization('IETF RMON MIB Working Group')
if mibBuilder.loadTexts:
switchRMON.setContactInfo('IETF RMONMIB WG Mailing list: rmonmib@cisco.com\n\n Rich Waterman\n Allot Networks Inc.\n Tel: +1-408-559-0253\n Email: rich@allot.com\n\n Bill Lahaye\n Xylan Corp.\n Tel: +1-800-995-2612\n Email: lahaye@ctron.com\n\n Dan Romascanu\n Lucent Technologies\n Tel: +972-3-645-8414\n Email: dromasca@lucent.com\n\n Steven Waldbusser\n International Network Services\n Tel: +1-415-254-4251\n Email: waldbusser@ins.com')
if mibBuilder.loadTexts:
switchRMON.setDescription('The MIB module for managing remote monitoring device\n implementations for Switched Networks')
smon_mib_objects = mib_identifier((1, 3, 6, 1, 2, 1, 16, 22, 1))
data_source_caps = mib_identifier((1, 3, 6, 1, 2, 1, 16, 22, 1, 1))
smon_stats = mib_identifier((1, 3, 6, 1, 2, 1, 16, 22, 1, 2))
port_copy_config = mib_identifier((1, 3, 6, 1, 2, 1, 16, 22, 1, 3))
smon_registration_points = mib_identifier((1, 3, 6, 1, 2, 1, 16, 22, 1, 4))
class Smondatasource(ObjectIdentifier, TextualConvention):
pass
smon_capabilities = mib_scalar((1, 3, 6, 1, 2, 1, 16, 19, 15), bits().clone(namedValues=named_values(('smonVlanStats', 0), ('smonPrioStats', 1), ('dataSource', 2), ('smonUnusedBit', 3), ('portCopy', 4)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonCapabilities.setDescription('An indication of the SMON MIB groups supported\n by this agent.')
data_source_caps_table = mib_table((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1))
if mibBuilder.loadTexts:
dataSourceCapsTable.setDescription("This table describes RMON data sources and port copy\n capabilities. An NMS MAY use this table to discover the\n identity and attributes of the data sources on a given agent\n implementation. Similar to the probeCapabilities object,\n actual row-creation operations will succeed or fail based on\n the resources available and parameter values used in each\n row-creation operation.\n\n Upon restart of the RMON agent, the dataSourceTable, ifTable,\n and perhaps entPhysicalTable are initialized for the available\n dataSources.\n\n For each dataSourceCapsEntry representing a VLAN or\n entPhysicalEntry the agent MUST create an associated ifEntry\n with a ifType value of 'propVirtual(53)'. This ifEntry will be\n used as the actual value in RMON control table dataSource\n objects. The assigned ifIndex value is copied into the\n associated dataSourceCapsIfIndex object.\n It is understood that dataSources representing VLANs may not\n always be instantiated immediately upon restart, but rather as\n VLAN usage is detected by the agent. The agent SHOULD attempt\n to create dataSource and interface entries for all dataSources\n as soon as possible.")
data_source_caps_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1, 1)).setIndexNames((1, 'SMON-MIB', 'dataSourceCapsObject'))
if mibBuilder.loadTexts:
dataSourceCapsEntry.setDescription('Entries per data source containing descriptions of data\n source and port copy capabilities. This table is populated by\n the SMON agent with one entry for each supported data\n source.')
data_source_caps_object = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1, 1, 1), smon_data_source())
if mibBuilder.loadTexts:
dataSourceCapsObject.setDescription('Defines an object that can be a SMON data source or a\n source or a destination for a port copy operation.')
data_source_rmon_caps = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1, 1, 2), bits().clone(namedValues=named_values(('countErrFrames', 0), ('countAllGoodFrames', 1), ('countAnyRmonTables', 2), ('babyGiantsCountAsGood', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
dataSourceRmonCaps.setDescription(" General attributes of the specified dataSource. Note that\n these are static attributes, which SHOULD NOT be adjusted\n because of current resources or configuration.\n\n - countErrFrames(0)\n The agent sets this bit for the dataSource if errored frames\n received on this dataSource can actually be monitored by the\n agent The agent clears this bit if any errored frames are\n not visible to the RMON data collector.\n\n - countAllGoodFrames(1)\n The agent sets this bit for the dataSource if all good\n frames received on this dataSource can actually be monitored\n by the agent. The agent clears this bit if any good frames\n are not visible for RMON collection, e.g., the dataSource is\n a non-promiscuous interface or an internal switch interface\n which may not receive frames which were switched in hardware\n or dropped by the bridge forwarding function.\n\n - countAnyRmonTables(2)\n The agent sets this bit if this dataSource can actually be\n used in any of the implemented RMON tables, resources\n notwithstanding. The agent clears this bit if this\n dataSourceCapsEntry is present simply to identify a\n dataSource that may only be used as portCopySource and/or a\n portCopyDest, but not the source of an actual RMON data\n collection.\n\n - babyGiantsCountAsGood(3)\n The agent sets this bit if it can distinguish, for counting\n purposes, between true giant frames and frames that exceed\n Ethernet maximum frame size 1518 due to VLAN tagging ('baby\n giants'). Specifically, this BIT means that frames up to\n 1522 octets are counted as good.\n\n Agents not capable of detecting 'baby giants' will clear\n this bit and will view all frames less than or equal to 1518\n octets as 'good frames' and all frames larger than 1518\n octets as 'bad frames' for the purpose of counting in the\n smonVlanIdStats and smonPrioStats tables.\n\n Agents capable of detecting 'baby giants' SHALL consider\n them as 'good frames' for the purpose of counting in the\n smonVlanIdStats and smonPrioStats tables.")
data_source_copy_caps = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1, 1, 3), bits().clone(namedValues=named_values(('copySourcePort', 0), ('copyDestPort', 1), ('copySrcTxTraffic', 2), ('copySrcRxTraffic', 3), ('countDestDropEvents', 4), ('copyErrFrames', 5), ('copyUnalteredFrames', 6), ('copyAllGoodFrames', 7)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
dataSourceCopyCaps.setDescription('PortCopy function capabilities of the specified dataSource.\n Note that these are static capabilities, which SHOULD NOT be\n adjusted because of current resources or configuration.\n\n - copySourcePort(0)\n The agent sets this bit if this dataSource is capable of\n acting as a source of a portCopy operation. The agent clears\n this bit otherwise.\n\n - copyDestPort(1)\n The agent sets this bit if this dataSource is capable of\n acting as a destination of a portCopy operation. The agent\n clears this bit otherwise.\n\n - copySrcTxTraffic(2)\n If the copySourcePort bit is set:\n The agent sets this bit if this dataSource is capable of\n copying frames transmitted out this portCopy source. The\n agent clears this bit otherwise. This function is needed\n to support full-duplex ports.\n Else:\n this bit SHOULD be cleared.\n\n - copySrcRxTraffic(3)\n If the copySourcePort bit is set:\n The agent sets this bit if this dataSource is capable of\n copying frames received on this portCopy source. The agent\n clears this bit otherwise. This function is needed to\n support full-duplex ports.\n Else:\n this bit SHOULD be cleared.\n\n - countDestDropEvents(4)\n If the copyDestPort bit is set:\n The agent sets this bit if it is capable of incrementing\n portCopyDestDropEvents, when this dataSource is the\n target of a portCopy operation and a frame destined to\n this dataSource is dropped (for RMON counting purposes).\n Else:\n this BIT SHOULD be cleared.\n\n - copyErrFrames(5)\n If the copySourcePort bit is set:\n The agent sets this bit if it is capable of copying all\n errored frames from this portCopy source-port, for\n errored frames received on this dataSource.\n Else:\n this BIT SHOULD be cleared.\n\n - copyUnalteredFrames(6)\n If the copySourcePort bit is set:\n The agent sets the copyUnalteredFrames bit If it is\n capable of copying all frames from this portCopy\n source-port without alteration in any way;\n Else:\n this bit SHOULD be cleared.\n\n - copyAllGoodFrames(7)\n If the copySourcePort bit is set:\n The agent sets this bit for the dataSource if all good\n frames received on this dataSource are normally capable\n of being copied by the agent. The agent clears this bit\n if any good frames are not visible for the RMON portCopy\n operation, e.g., the dataSource is a non-promiscuous\n interface or an internal switch interface which may not\n receive frames which were switched in hardware or\n dropped by the bridge forwarding function.\n Else:\n this bit SHOULD be cleared.')
data_source_caps_if_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 1, 1, 1, 4), interface_index()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
dataSourceCapsIfIndex.setDescription("This object contains the ifIndex value of the ifEntry\n associated with this smonDataSource. The agent MUST create\n 'propVirtual' ifEntries for each dataSourceCapsEntry of type\n VLAN or entPhysicalEntry.")
smon_vlan_stats_control_table = mib_table((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1))
if mibBuilder.loadTexts:
smonVlanStatsControlTable.setDescription('Controls the setup of VLAN statistics tables.\n\n The statistics collected represent a distribution based on\n the IEEE 802.1Q VLAN-ID (VID), for each good frame attributed\n to the data source for the collection.')
smon_vlan_stats_control_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1)).setIndexNames((0, 'SMON-MIB', 'smonVlanStatsControlIndex'))
if mibBuilder.loadTexts:
smonVlanStatsControlEntry.setDescription('A conceptual row in the smonVlanStatsControlTable.')
smon_vlan_stats_control_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)))
if mibBuilder.loadTexts:
smonVlanStatsControlIndex.setDescription('A unique arbitrary index for this smonVlanStatsControlEntry.')
smon_vlan_stats_control_data_source = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1, 2), data_source()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
smonVlanStatsControlDataSource.setDescription('The source of data for this set of VLAN statistics.\n\n This object MAY NOT be modified if the associated\n smonVlanStatsControlStatus object is equal to active(1).')
smon_vlan_stats_control_create_time = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1, 3), last_create_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanStatsControlCreateTime.setDescription('The value of sysUpTime when this control entry was last\n activated. This object allows to a management station to\n detect deletion and recreation cycles between polls.')
smon_vlan_stats_control_owner = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1, 4), owner_string()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
smonVlanStatsControlOwner.setDescription('Administratively assigned named of the owner of this entry.\n It usually defines the entity that created this entry and is\n therefore using the resources assigned to it, though there is\n no enforcement mechanism, nor assurance that rows created are\n ever used.')
smon_vlan_stats_control_status = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 1, 1, 5), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
smonVlanStatsControlStatus.setDescription('The status of this row.\n\n An entry MAY NOT exist in the active state unless all\n objects in the entry have an appropriate value.\n\n If this object is not equal to active(1), all associated\n entries in the smonVlanIdStatsTable SHALL be deleted.')
smon_vlan_id_stats_table = mib_table((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2))
if mibBuilder.loadTexts:
smonVlanIdStatsTable.setDescription('Contains the VLAN statistics data.\n The statistics collected represent a distribution based\n on the IEEE 802.1Q VLAN-ID (VID), for each good frame\n attributed to the data source for the collection.\n\n This function applies the same rules for attributing frames\n to VLAN-based collections. RMON VLAN statistics are collected\n after the Ingress Rules defined in section 3.13 of the VLAN\n Specification [20] are applied.\n\n It is possible that entries in this table will be\n garbage-collected, based on agent resources, and VLAN\n configuration. Agents are encouraged to support all 4094\n index values and not garbage collect this table.')
smon_vlan_id_stats_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1)).setIndexNames((0, 'SMON-MIB', 'smonVlanStatsControlIndex'), (0, 'SMON-MIB', 'smonVlanIdStatsId'))
if mibBuilder.loadTexts:
smonVlanIdStatsEntry.setDescription('A conceptual row in smonVlanIdStatsTable.')
smon_vlan_id_stats_id = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094)))
if mibBuilder.loadTexts:
smonVlanIdStatsId.setDescription('The unique identifier of the VLAN monitored for\n this specific statistics collection.\n\n Tagged packets match the VID for the range between 1 and 4094.\n An external RMON probe MAY detect VID=0 on an Inter Switch\n Link, in which case the packet belongs to a VLAN determined by\n the PVID of the ingress port. The VLAN to which such a packet\n belongs can be determined only by a RMON probe internal to the\n switch.')
smon_vlan_id_stats_total_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 2), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsTotalPkts.setDescription('The total number of packets counted on this VLAN.')
smon_vlan_id_stats_total_overflow_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 3), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsTotalOverflowPkts.setDescription('The number of times the associated smonVlanIdStatsTotalPkts\n counter has overflowed.')
smon_vlan_id_stats_total_hc_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 4), counter64()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsTotalHCPkts.setDescription('The total number of packets counted on this VLAN.')
smon_vlan_id_stats_total_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 5), counter32()).setUnits('octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsTotalOctets.setDescription('The total number of octets counted on this VLAN.')
smon_vlan_id_stats_total_overflow_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 6), counter32()).setUnits('octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsTotalOverflowOctets.setDescription('The number of times the associated smonVlanIdStatsTotalOctets\n counter has overflowed.')
smon_vlan_id_stats_total_hc_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 7), counter64()).setUnits('octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsTotalHCOctets.setDescription('The total number of octets counted on this VLAN.')
smon_vlan_id_stats_n_ucast_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 8), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsNUcastPkts.setDescription('The total number of non-unicast packets counted on this\n VLAN.')
smon_vlan_id_stats_n_ucast_overflow_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 9), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsNUcastOverflowPkts.setDescription('The number of times the associated smonVlanIdStatsNUcastPkts\n counter has overflowed.')
smon_vlan_id_stats_n_ucast_hc_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 10), counter64()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsNUcastHCPkts.setDescription('The total number of non-unicast packets counted on\n this VLAN.')
smon_vlan_id_stats_n_ucast_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 11), counter32()).setUnits('octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsNUcastOctets.setDescription('The total number of non-unicast octets counted on\n this VLAN.')
smon_vlan_id_stats_n_ucast_overflow_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 12), counter32()).setUnits('octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsNUcastOverflowOctets.setDescription('The number of times the associated\n smonVlanIdStatsNUcastOctets counter has overflowed.')
smon_vlan_id_stats_n_ucast_hc_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 13), counter64()).setUnits('octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsNUcastHCOctets.setDescription('The total number of Non-unicast octets counted on\n this VLAN.')
smon_vlan_id_stats_create_time = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 2, 1, 14), last_create_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonVlanIdStatsCreateTime.setDescription('The value of sysUpTime when this entry was last\n activated. This object allows to a management station to\n detect deletion and recreation cycles between polls.')
smon_prio_stats_control_table = mib_table((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3))
if mibBuilder.loadTexts:
smonPrioStatsControlTable.setDescription('Controls the setup of priority statistics tables.\n\n The smonPrioStatsControlTable allows configuration of\n collections based on the value of the 3-bit user priority\n field encoded in the Tag Control Information (TCI) field\n according to [19],[20].\n\n Note that this table merely reports priority as encoded in\n the VLAN headers, not the priority (if any) given to the\n frame for the actual switching purposes.')
smon_prio_stats_control_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1)).setIndexNames((0, 'SMON-MIB', 'smonPrioStatsControlIndex'))
if mibBuilder.loadTexts:
smonPrioStatsControlEntry.setDescription('A conceptual row in the smonPrioStatsControlTable.')
smon_prio_stats_control_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)))
if mibBuilder.loadTexts:
smonPrioStatsControlIndex.setDescription('A unique arbitrary index for this smonPrioStatsControlEntry.')
smon_prio_stats_control_data_source = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1, 2), data_source()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
smonPrioStatsControlDataSource.setDescription('The source of data for this set of VLAN statistics.\n\n This object MAY NOT be modified if the associated\n smonPrioStatsControlStatus object is equal to active(1).')
smon_prio_stats_control_create_time = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1, 3), last_create_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonPrioStatsControlCreateTime.setDescription('The value of sysUpTime when this entry was created.\n This object allows to a management station to\n detect deletion and recreation cycles between polls.')
smon_prio_stats_control_owner = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1, 4), owner_string()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
smonPrioStatsControlOwner.setDescription('Administratively assigned named of the owner of this entry.\n It usually defines the entity that created this entry and is\n therefore using the resources assigned to it, though there is\n no enforcement mechanism, nor assurance that rows created are\n ever used.')
smon_prio_stats_control_status = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 3, 1, 5), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
smonPrioStatsControlStatus.setDescription('The status of this row.\n An entry MAY NOT exist in the active state unless all\n objects in the entry have an appropriate value.\n\n If this object is not equal to active(1), all associated\n entries in the smonPrioStatsTable SHALL be deleted.')
smon_prio_stats_table = mib_table((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4))
if mibBuilder.loadTexts:
smonPrioStatsTable.setDescription('Contains the priority statistics. The collections are based\n on the value of the 3-bit user priority field encoded in the\n Tag Control Information (TCI) field according to [19], [20].\n Note that this table merely reports priority as encoded in\n the VLAN headers, not the priority (if any) given to the\n frame for the actual switching purposes.\n\n No garbage collection is designed for this table, as there\n always are at most eight rows per statistical set, and the\n low memory requirements do not justify the implementation of\n such a mechanism.')
smon_prio_stats_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1)).setIndexNames((0, 'SMON-MIB', 'smonPrioStatsControlIndex'), (0, 'SMON-MIB', 'smonPrioStatsId'))
if mibBuilder.loadTexts:
smonPrioStatsEntry.setDescription('A conceptual row in smonPrioStatsTable.')
smon_prio_stats_id = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 7)))
if mibBuilder.loadTexts:
smonPrioStatsId.setDescription('The unique identifier of the priority level monitored for\n this specific statistics collection.')
smon_prio_stats_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 2), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonPrioStatsPkts.setDescription('The total number of packets counted on\n this priority level.')
smon_prio_stats_overflow_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 3), counter32()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonPrioStatsOverflowPkts.setDescription('The number of times the associated smonPrioStatsPkts\n counter has overflowed.')
smon_prio_stats_hc_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 4), counter64()).setUnits('packets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonPrioStatsHCPkts.setDescription('The total number of packets counted on\n this priority level.')
smon_prio_stats_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 5), counter32()).setUnits('octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonPrioStatsOctets.setDescription('The total number of octets counted on\n this priority level.')
smon_prio_stats_overflow_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 6), counter32()).setUnits('octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonPrioStatsOverflowOctets.setDescription('The number of times the associated smonPrioStatsOctets\n counter has overflowed.')
smon_prio_stats_hc_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 2, 4, 1, 7), counter64()).setUnits('octets').setMaxAccess('readonly')
if mibBuilder.loadTexts:
smonPrioStatsHCOctets.setDescription('The total number of octets counted on\n this priority level.')
port_copy_table = mib_table((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1))
if mibBuilder.loadTexts:
portCopyTable.setDescription(" Port Copy provides the ability to copy all frames from a\n specified source to specified destination within a switch.\n Source and destinations MUST be ifEntries, as defined by [22].\n One to one, one to many, many to one and many to many source to\n destination relationships may be configured.\n\n Applicable counters on the destination will increment for all\n packets transiting the port, be it by normal bridging/switching\n or due to packet copy.\n Note that this table manages no RMON data collection by itself,\n and an agent may possibly implement no RMON objects except\n objects related to the port copy operation defined by the\n portCopyCompliance conformance macro. That allows for a switch\n with no other embedded RMON capability to perform port copy\n operations to a destination port at which a different external\n RMON probe is connected.\n\n One to one, many to one and one to many source to destination\n relationships may be configured.\n\n Each row that exists in this table defines such a\n relationship. By disabling a row in this table the port copy\n relationship no longer exists.\n\n The number of entries and the types of port copies (1-1,\n many-1, 1-many) are implementation specific and could\n possibly be dynamic due to changing resource availability.\n\n In order to configure a source to destination portCopy\n relationship, both source and destination interfaces MUST be\n present as an ifEntry in the ifTable and their respective\n ifAdminStatus and ifOperStatus values MUST be equal to\n 'up(1)'. If the value of any of those two objects changes\n after the portCopyEntry is activated, portCopyStatus will\n transition to 'notReady(3)'.\n\n The capability of an interface to be source or destination of\n a port copy operation is described by the 'copySourcePort(0)'\n and 'copyDestPort(1)' bits in dataSourceCopyCaps. Those bits\n SHOULD be appropriately set by the agent, in order to allow\n for a portCopyEntry to be created.\n\n Applicable counters on the destination will increment for all\n packets transmitted, be it by normal bridging/switching or\n due to packet copy.")
port_copy_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1)).setIndexNames((0, 'SMON-MIB', 'portCopySource'), (0, 'SMON-MIB', 'portCopyDest'))
if mibBuilder.loadTexts:
portCopyEntry.setDescription('Describes a particular port copy entry.')
port_copy_source = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1, 1), interface_index())
if mibBuilder.loadTexts:
portCopySource.setDescription('The ifIndex of the source which will have all packets\n redirected to the destination as defined by portCopyDest.')
port_copy_dest = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1, 2), interface_index())
if mibBuilder.loadTexts:
portCopyDest.setDescription('Defines the ifIndex destination for the copy operation.')
port_copy_dest_drop_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1, 3), counter32()).setUnits('events').setMaxAccess('readonly')
if mibBuilder.loadTexts:
portCopyDestDropEvents.setDescription('The total number of events in which port copy packets were\n dropped by the switch at the destination port due to lack of\n resources.\n\n Note that this number is not necessarily the number of\n packets dropped; it is just the number of times this\n condition has been detected.\n\n A single dropped event counter is maintained for each\n portCopyDest. Thus all instances associated with a given\n portCopyDest will have the same portCopyDestDropEvents\n value.')
port_copy_direction = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('copyRxOnly', 1), ('copyTxOnly', 2), ('copyBoth', 3))).clone('copyBoth')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
portCopyDirection.setDescription("This object affects the way traffic is copied from a switch\n source port, for the indicated port copy operation.\n\n\n If this object has the value 'copyRxOnly(1)', then only\n traffic received on the indicated source port will be copied\n to the indicated destination port.\n\n If this object has the value 'copyTxOnly(2)', then only\n traffic transmitted out the indicated source port will be\n copied to the indicated destination port.\n\n If this object has the value 'copyBoth(3)', then all traffic\n received or transmitted on the indicated source port will be\n copied to the indicated destination port.\n\n The creation and deletion of instances of this object is\n controlled by the portCopyRowStatus object. Note that there\n is no guarantee that changes in the value of this object\n performed while the associated portCopyRowStatus object is\n equal to active will not cause traffic discontinuities in the\n packet stream.")
port_copy_status = mib_table_column((1, 3, 6, 1, 2, 1, 16, 22, 1, 3, 1, 1, 5), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
portCopyStatus.setDescription("Defines the status of the port copy entry.\n\n In order to configure a source to destination portCopy\n relationship, both source and destination interfaces MUST be\n present as an ifEntry in the ifTable and their respective\n ifAdminStatus and ifOperStatus values MUST be equal to\n 'up(1)'. If the value of any of those two objects changes\n after the portCopyEntry is activated, portCopyStatus will\n transition to 'notReady(3)'.\n\n The capability of an interface to be source or destination of\n a port copy operation is described by the 'copySourcePort(0)'\n and 'copyDestPort(1)' bits in dataSourceCopyCaps. Those bits\n SHOULD be appropriately set by the agent, in order to allow\n for a portCopyEntry to be created.")
smon_vlan_data_source = mib_identifier((1, 3, 6, 1, 2, 1, 16, 22, 1, 4, 1))
smon_mib_compliances = mib_identifier((1, 3, 6, 1, 2, 1, 16, 20, 3))
smon_mib_groups = mib_identifier((1, 3, 6, 1, 2, 1, 16, 20, 4))
smon_mib_compliance = module_compliance((1, 3, 6, 1, 2, 1, 16, 20, 3, 1)).setObjects(*(('SMON-MIB', 'dataSourceCapsGroup'), ('SMON-MIB', 'smonVlanStatsGroup'), ('SMON-MIB', 'smonPrioStatsGroup'), ('SMON-MIB', 'portCopyConfigGroup'), ('SMON-MIB', 'smonInformationGroup'), ('SMON-MIB', 'smonHcTo100mbGroup'), ('SMON-MIB', 'smonHc100mbPlusGroup')))
if mibBuilder.loadTexts:
smonMIBCompliance.setDescription('Describes the requirements for full conformance with the SMON\n MIB')
smon_mib_vlan_stats_compliance = module_compliance((1, 3, 6, 1, 2, 1, 16, 20, 3, 2)).setObjects(*(('SMON-MIB', 'dataSourceCapsGroup'), ('SMON-MIB', 'smonVlanStatsGroup'), ('SMON-MIB', 'smonInformationGroup'), ('SMON-MIB', 'hcVlanTo100mbGroup'), ('SMON-MIB', 'hcVlan100mbPlusGroup')))
if mibBuilder.loadTexts:
smonMIBVlanStatsCompliance.setDescription('Describes the requirements for conformance with the SMON MIB\n with support for VLAN Statistics. Mandatory for a SMON probe\n in environment where IEEE 802.1Q bridging is implemented.')
smon_mib_prio_stats_compliance = module_compliance((1, 3, 6, 1, 2, 1, 16, 20, 3, 3)).setObjects(*(('SMON-MIB', 'dataSourceCapsGroup'), ('SMON-MIB', 'smonPrioStatsGroup'), ('SMON-MIB', 'smonInformationGroup'), ('SMON-MIB', 'hcPrioTo100mbGroup'), ('SMON-MIB', 'hcPrio100mbPlusGroup')))
if mibBuilder.loadTexts:
smonMIBPrioStatsCompliance.setDescription('Describes the requirements for conformance with the SMON MIB\n with support for priority level Statistics. Mandatory for a\n SMON probe in a environment where IEEE 802.1p\n priority-switching is implemented.')
port_copy_compliance = module_compliance((1, 3, 6, 1, 2, 1, 16, 20, 3, 4)).setObjects(*(('SMON-MIB', 'dataSourceCapsGroup'), ('SMON-MIB', 'portCopyConfigGroup'), ('SMON-MIB', 'smonInformationGroup')))
if mibBuilder.loadTexts:
portCopyCompliance.setDescription('Describes the requirements for conformance with the port copy\n functionality defined by the SMON MIB')
data_source_caps_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 1)).setObjects(*(('SMON-MIB', 'dataSourceRmonCaps'), ('SMON-MIB', 'dataSourceCopyCaps'), ('SMON-MIB', 'dataSourceCapsIfIndex')))
if mibBuilder.loadTexts:
dataSourceCapsGroup.setDescription('Defines the objects that describe the capabilities of RMON\n data sources.')
smon_vlan_stats_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 2)).setObjects(*(('SMON-MIB', 'smonVlanStatsControlDataSource'), ('SMON-MIB', 'smonVlanStatsControlCreateTime'), ('SMON-MIB', 'smonVlanStatsControlOwner'), ('SMON-MIB', 'smonVlanStatsControlStatus'), ('SMON-MIB', 'smonVlanIdStatsTotalPkts'), ('SMON-MIB', 'smonVlanIdStatsTotalOctets'), ('SMON-MIB', 'smonVlanIdStatsNUcastPkts'), ('SMON-MIB', 'smonVlanIdStatsCreateTime')))
if mibBuilder.loadTexts:
smonVlanStatsGroup.setDescription('Defines the switch monitoring specific statistics - per VLAN\n Id on interfaces of 10MB or less.')
smon_prio_stats_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 3)).setObjects(*(('SMON-MIB', 'smonPrioStatsControlDataSource'), ('SMON-MIB', 'smonPrioStatsControlCreateTime'), ('SMON-MIB', 'smonPrioStatsControlOwner'), ('SMON-MIB', 'smonPrioStatsControlStatus'), ('SMON-MIB', 'smonPrioStatsPkts'), ('SMON-MIB', 'smonPrioStatsOctets')))
if mibBuilder.loadTexts:
smonPrioStatsGroup.setDescription('Defines the switch monitoring specific statistics - per VLAN\n Id on interface.')
smon_hc_to100mb_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 4)).setObjects(*(('SMON-MIB', 'smonVlanIdStatsTotalOverflowOctets'), ('SMON-MIB', 'smonVlanIdStatsTotalHCOctets'), ('SMON-MIB', 'smonPrioStatsOverflowOctets'), ('SMON-MIB', 'smonPrioStatsHCOctets')))
if mibBuilder.loadTexts:
smonHcTo100mbGroup.setDescription('Defines the additional high capacity statistics needed to be\n kept on interfaces with ifSpeed greater than 10MB/sec and\n less than or equal to 100MB/sec.')
smon_hc100mb_plus_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 5)).setObjects(*(('SMON-MIB', 'smonVlanIdStatsTotalOverflowPkts'), ('SMON-MIB', 'smonVlanIdStatsTotalHCPkts'), ('SMON-MIB', 'smonVlanIdStatsTotalOverflowOctets'), ('SMON-MIB', 'smonVlanIdStatsTotalHCOctets'), ('SMON-MIB', 'smonVlanIdStatsNUcastOverflowPkts'), ('SMON-MIB', 'smonVlanIdStatsNUcastHCPkts'), ('SMON-MIB', 'smonPrioStatsOverflowPkts'), ('SMON-MIB', 'smonPrioStatsHCPkts'), ('SMON-MIB', 'smonPrioStatsOverflowOctets'), ('SMON-MIB', 'smonPrioStatsHCOctets')))
if mibBuilder.loadTexts:
smonHc100mbPlusGroup.setDescription('Defines the additional high capacity statistics needed to be\n kept on interfaces with ifSpeed of more than 100MB/sec. These\n statistics MUST also be kept on smonDataSources of type VLAN\n or entPhysicalEntry.')
hc_vlan_to100mb_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 6)).setObjects(*(('SMON-MIB', 'smonVlanIdStatsTotalOverflowOctets'), ('SMON-MIB', 'smonVlanIdStatsTotalHCOctets')))
if mibBuilder.loadTexts:
hcVlanTo100mbGroup.setDescription('Defines the additional high capacity VLAN statistics\n needed to be kept on interfaces with ifSpeed greater than\n 10MB/sec and less than or equal to 100MB/sec.')
hc_vlan100mb_plus_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 7)).setObjects(*(('SMON-MIB', 'smonVlanIdStatsTotalOverflowPkts'), ('SMON-MIB', 'smonVlanIdStatsTotalHCPkts'), ('SMON-MIB', 'smonVlanIdStatsTotalOverflowOctets'), ('SMON-MIB', 'smonVlanIdStatsTotalHCOctets'), ('SMON-MIB', 'smonVlanIdStatsNUcastOverflowPkts'), ('SMON-MIB', 'smonVlanIdStatsNUcastHCPkts')))
if mibBuilder.loadTexts:
hcVlan100mbPlusGroup.setDescription('Defines the additional high capacity VLAN statistics\n needed to be kept on interfaces with ifSpeed of more than\n 100MB/sec. These statistics MUST also be kept on\n smonDataSources of type VLAN or entPhysicalEntry.')
hc_prio_to100mb_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 8)).setObjects(*(('SMON-MIB', 'smonPrioStatsOverflowOctets'), ('SMON-MIB', 'smonPrioStatsHCOctets')))
if mibBuilder.loadTexts:
hcPrioTo100mbGroup.setDescription('Defines the additional high capacity VLAN priority\n statistics needed to be kept on interfaces with\n ifSpeed of greater than 10MB/sec and less than or equal\n to 100MB/sec.')
hc_prio100mb_plus_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 9)).setObjects(*(('SMON-MIB', 'smonPrioStatsOverflowPkts'), ('SMON-MIB', 'smonPrioStatsHCPkts'), ('SMON-MIB', 'smonPrioStatsOverflowOctets'), ('SMON-MIB', 'smonPrioStatsHCOctets')))
if mibBuilder.loadTexts:
hcPrio100mbPlusGroup.setDescription('Defines the additional high capacity VLAN priority\n statistics needed to be kept on interfaces with\n ifSpeed of greater than 100MB/sec. These statistics MUST\n also be kept on smonDataSources of type VLAN or\n entPhysicalEntry.')
smon_vlan_stats_ext_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 10)).setObjects(*(('SMON-MIB', 'smonVlanIdStatsNUcastOctets'), ('SMON-MIB', 'smonVlanIdStatsNUcastOverflowOctets'), ('SMON-MIB', 'smonVlanIdStatsNUcastHCOctets')))
if mibBuilder.loadTexts:
smonVlanStatsExtGroup.setDescription('Defines the switch monitoring specific statistics for systems\n capable of counting non-unicast octets for a given dataSource\n (as described in the dataSourceRmonCaps object).')
smon_information_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 11)).setObjects(*(('SMON-MIB', 'smonCapabilities'),))
if mibBuilder.loadTexts:
smonInformationGroup.setDescription('An indication of the SMON capabilities supported by this\n agent.')
port_copy_config_group = object_group((1, 3, 6, 1, 2, 1, 16, 20, 4, 12)).setObjects(*(('SMON-MIB', 'portCopyDestDropEvents'), ('SMON-MIB', 'portCopyDirection'), ('SMON-MIB', 'portCopyStatus')))
if mibBuilder.loadTexts:
portCopyConfigGroup.setDescription('Defines the control objects for copy port operations.')
mibBuilder.exportSymbols('SMON-MIB', smonVlanIdStatsNUcastOverflowOctets=smonVlanIdStatsNUcastOverflowOctets, smonVlanIdStatsTotalHCPkts=smonVlanIdStatsTotalHCPkts, portCopyDestDropEvents=portCopyDestDropEvents, dataSourceCapsGroup=dataSourceCapsGroup, smonMIBCompliance=smonMIBCompliance, smonPrioStatsControlDataSource=smonPrioStatsControlDataSource, hcVlan100mbPlusGroup=hcVlan100mbPlusGroup, smonVlanIdStatsTotalOverflowOctets=smonVlanIdStatsTotalOverflowOctets, dataSourceCaps=dataSourceCaps, smonMIBVlanStatsCompliance=smonMIBVlanStatsCompliance, smonVlanStatsControlDataSource=smonVlanStatsControlDataSource, smonPrioStatsControlIndex=smonPrioStatsControlIndex, smonVlanStatsControlIndex=smonVlanStatsControlIndex, smonInformationGroup=smonInformationGroup, PYSNMP_MODULE_ID=switchRMON, portCopyEntry=portCopyEntry, smonMIBCompliances=smonMIBCompliances, portCopyDest=portCopyDest, smonMIBObjects=smonMIBObjects, smonVlanStatsControlOwner=smonVlanStatsControlOwner, smonVlanStatsControlStatus=smonVlanStatsControlStatus, smonPrioStatsOverflowPkts=smonPrioStatsOverflowPkts, smonPrioStatsControlTable=smonPrioStatsControlTable, portCopyDirection=portCopyDirection, smonHcTo100mbGroup=smonHcTo100mbGroup, smonPrioStatsControlEntry=smonPrioStatsControlEntry, smonMIBPrioStatsCompliance=smonMIBPrioStatsCompliance, smonVlanIdStatsTotalPkts=smonVlanIdStatsTotalPkts, smonVlanIdStatsId=smonVlanIdStatsId, smonPrioStatsTable=smonPrioStatsTable, portCopyStatus=portCopyStatus, hcPrioTo100mbGroup=hcPrioTo100mbGroup, portCopyConfig=portCopyConfig, dataSourceCopyCaps=dataSourceCopyCaps, smonPrioStatsId=smonPrioStatsId, smonVlanIdStatsTotalHCOctets=smonVlanIdStatsTotalHCOctets, portCopySource=portCopySource, portCopyTable=portCopyTable, dataSourceCapsIfIndex=dataSourceCapsIfIndex, smonVlanStatsControlEntry=smonVlanStatsControlEntry, dataSourceCapsObject=dataSourceCapsObject, smonVlanStatsExtGroup=smonVlanStatsExtGroup, portCopyConfigGroup=portCopyConfigGroup, smonVlanStatsControlCreateTime=smonVlanStatsControlCreateTime, smonVlanIdStatsNUcastOverflowPkts=smonVlanIdStatsNUcastOverflowPkts, smonVlanIdStatsTable=smonVlanIdStatsTable, hcPrio100mbPlusGroup=hcPrio100mbPlusGroup, dataSourceRmonCaps=dataSourceRmonCaps, smonRegistrationPoints=smonRegistrationPoints, smonCapabilities=smonCapabilities, smonMIBGroups=smonMIBGroups, smonVlanIdStatsTotalOverflowPkts=smonVlanIdStatsTotalOverflowPkts, smonHc100mbPlusGroup=smonHc100mbPlusGroup, dataSourceCapsEntry=dataSourceCapsEntry, smonPrioStatsPkts=smonPrioStatsPkts, smonPrioStatsHCPkts=smonPrioStatsHCPkts, smonStats=smonStats, smonVlanDataSource=smonVlanDataSource, smonPrioStatsOctets=smonPrioStatsOctets, smonVlanStatsControlTable=smonVlanStatsControlTable, smonVlanIdStatsTotalOctets=smonVlanIdStatsTotalOctets, SmonDataSource=SmonDataSource, smonPrioStatsEntry=smonPrioStatsEntry, smonVlanIdStatsNUcastOctets=smonVlanIdStatsNUcastOctets, smonVlanIdStatsNUcastHCOctets=smonVlanIdStatsNUcastHCOctets, smonVlanIdStatsCreateTime=smonVlanIdStatsCreateTime, hcVlanTo100mbGroup=hcVlanTo100mbGroup, smonPrioStatsOverflowOctets=smonPrioStatsOverflowOctets, smonPrioStatsHCOctets=smonPrioStatsHCOctets, smonPrioStatsControlOwner=smonPrioStatsControlOwner, dataSourceCapsTable=dataSourceCapsTable, smonPrioStatsControlStatus=smonPrioStatsControlStatus, switchRMON=switchRMON, smonVlanStatsGroup=smonVlanStatsGroup, smonVlanIdStatsNUcastPkts=smonVlanIdStatsNUcastPkts, smonPrioStatsControlCreateTime=smonPrioStatsControlCreateTime, smonPrioStatsGroup=smonPrioStatsGroup, smonVlanIdStatsEntry=smonVlanIdStatsEntry, smonVlanIdStatsNUcastHCPkts=smonVlanIdStatsNUcastHCPkts, portCopyCompliance=portCopyCompliance) |
matrix = [
[1, 2, 3, 4],
[5, 6, 0, 8],
[9, 0, 2, 4],
[4, 5, 6, 7]
]
| matrix = [[1, 2, 3, 4], [5, 6, 0, 8], [9, 0, 2, 4], [4, 5, 6, 7]] |
#
# PySNMP MIB module NET-SNMP-PERIODIC-NOTIFY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NET-SNMP-PERIODIC-NOTIFY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:18:12 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection")
netSnmpObjects, netSnmpNotifications, netSnmpModuleIDs = mibBuilder.importSymbols("NET-SNMP-MIB", "netSnmpObjects", "netSnmpNotifications", "netSnmpModuleIDs")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
MibIdentifier, Gauge32, Unsigned32, Counter64, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, NotificationType, ModuleIdentity, iso, Bits, TimeTicks, ObjectIdentity, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "Gauge32", "Unsigned32", "Counter64", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "NotificationType", "ModuleIdentity", "iso", "Bits", "TimeTicks", "ObjectIdentity", "Counter32")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
netSnmpPeriodicNotifyMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5))
netSnmpPeriodicNotifyMib.setRevisions(('2011-04-20 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: netSnmpPeriodicNotifyMib.setRevisionsDescriptions(('First revision.',))
if mibBuilder.loadTexts: netSnmpPeriodicNotifyMib.setLastUpdated('201104200000Z')
if mibBuilder.loadTexts: netSnmpPeriodicNotifyMib.setOrganization('www.net-snmp.org')
if mibBuilder.loadTexts: netSnmpPeriodicNotifyMib.setContactInfo('postal: Wes Hardaker P.O. Box 382 Davis CA 95617 email: net-snmp-coders@lists.sourceforge.net')
if mibBuilder.loadTexts: netSnmpPeriodicNotifyMib.setDescription('Objects for periodic notifications containing data payloads')
nsPNScalars = MibIdentifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 1))
nsPNTables = MibIdentifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 2))
nsPNotifyObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 3))
nsPNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 4))
nsPNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 4, 0))
nsPNotificationObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 4, 1))
nsNotifyPeriodicNotification = NotificationType((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 4, 0, 1))
if mibBuilder.loadTexts: nsNotifyPeriodicNotification.setStatus('current')
if mibBuilder.loadTexts: nsNotifyPeriodicNotification.setDescription('Data delivery notification from a configured list of periodic data sets to deliver. See the snmpd.conf manual page for details about configuring Net-SNMP agents for sending these notifications out on a regular basis.')
nsPNPeriodicTime = MibScalar((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 3, 1), Unsigned32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: nsPNPeriodicTime.setStatus('current')
if mibBuilder.loadTexts: nsPNPeriodicTime.setDescription('The number of seconds between notifications containing this data set.')
nsPNotifyMessageNumber = MibScalar((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 3, 2), Unsigned32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: nsPNotifyMessageNumber.setStatus('current')
if mibBuilder.loadTexts: nsPNotifyMessageNumber.setDescription('Indicates this is the Nth notification in a longer sequence of notifications')
nsPNotifyMaxMessageNumber = MibScalar((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 3, 3), Unsigned32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: nsPNotifyMaxMessageNumber.setStatus('current')
if mibBuilder.loadTexts: nsPNotifyMaxMessageNumber.setDescription('The maximum number of messages this notification sequence will contain.')
mibBuilder.exportSymbols("NET-SNMP-PERIODIC-NOTIFY-MIB", PYSNMP_MODULE_ID=netSnmpPeriodicNotifyMib, nsPNotificationObjects=nsPNotificationObjects, nsPNotificationPrefix=nsPNotificationPrefix, nsPNotifyMessageNumber=nsPNotifyMessageNumber, nsPNotifications=nsPNotifications, nsPNotifyMaxMessageNumber=nsPNotifyMaxMessageNumber, nsPNotifyObjects=nsPNotifyObjects, nsPNTables=nsPNTables, nsNotifyPeriodicNotification=nsNotifyPeriodicNotification, nsPNScalars=nsPNScalars, netSnmpPeriodicNotifyMib=netSnmpPeriodicNotifyMib, nsPNPeriodicTime=nsPNPeriodicTime)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, value_size_constraint, constraints_union, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'ConstraintsIntersection')
(net_snmp_objects, net_snmp_notifications, net_snmp_module_i_ds) = mibBuilder.importSymbols('NET-SNMP-MIB', 'netSnmpObjects', 'netSnmpNotifications', 'netSnmpModuleIDs')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(mib_identifier, gauge32, unsigned32, counter64, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, notification_type, module_identity, iso, bits, time_ticks, object_identity, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibIdentifier', 'Gauge32', 'Unsigned32', 'Counter64', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'NotificationType', 'ModuleIdentity', 'iso', 'Bits', 'TimeTicks', 'ObjectIdentity', 'Counter32')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
net_snmp_periodic_notify_mib = module_identity((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5))
netSnmpPeriodicNotifyMib.setRevisions(('2011-04-20 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
netSnmpPeriodicNotifyMib.setRevisionsDescriptions(('First revision.',))
if mibBuilder.loadTexts:
netSnmpPeriodicNotifyMib.setLastUpdated('201104200000Z')
if mibBuilder.loadTexts:
netSnmpPeriodicNotifyMib.setOrganization('www.net-snmp.org')
if mibBuilder.loadTexts:
netSnmpPeriodicNotifyMib.setContactInfo('postal: Wes Hardaker P.O. Box 382 Davis CA 95617 email: net-snmp-coders@lists.sourceforge.net')
if mibBuilder.loadTexts:
netSnmpPeriodicNotifyMib.setDescription('Objects for periodic notifications containing data payloads')
ns_pn_scalars = mib_identifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 1))
ns_pn_tables = mib_identifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 2))
ns_p_notify_objects = mib_identifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 3))
ns_p_notification_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 4))
ns_p_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 4, 0))
ns_p_notification_objects = mib_identifier((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 4, 1))
ns_notify_periodic_notification = notification_type((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 4, 0, 1))
if mibBuilder.loadTexts:
nsNotifyPeriodicNotification.setStatus('current')
if mibBuilder.loadTexts:
nsNotifyPeriodicNotification.setDescription('Data delivery notification from a configured list of periodic data sets to deliver. See the snmpd.conf manual page for details about configuring Net-SNMP agents for sending these notifications out on a regular basis.')
ns_pn_periodic_time = mib_scalar((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 3, 1), unsigned32()).setMaxAccess('accessiblefornotify')
if mibBuilder.loadTexts:
nsPNPeriodicTime.setStatus('current')
if mibBuilder.loadTexts:
nsPNPeriodicTime.setDescription('The number of seconds between notifications containing this data set.')
ns_p_notify_message_number = mib_scalar((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 3, 2), unsigned32()).setMaxAccess('accessiblefornotify')
if mibBuilder.loadTexts:
nsPNotifyMessageNumber.setStatus('current')
if mibBuilder.loadTexts:
nsPNotifyMessageNumber.setDescription('Indicates this is the Nth notification in a longer sequence of notifications')
ns_p_notify_max_message_number = mib_scalar((1, 3, 6, 1, 4, 1, 8072, 3, 1, 5, 3, 3), unsigned32()).setMaxAccess('accessiblefornotify')
if mibBuilder.loadTexts:
nsPNotifyMaxMessageNumber.setStatus('current')
if mibBuilder.loadTexts:
nsPNotifyMaxMessageNumber.setDescription('The maximum number of messages this notification sequence will contain.')
mibBuilder.exportSymbols('NET-SNMP-PERIODIC-NOTIFY-MIB', PYSNMP_MODULE_ID=netSnmpPeriodicNotifyMib, nsPNotificationObjects=nsPNotificationObjects, nsPNotificationPrefix=nsPNotificationPrefix, nsPNotifyMessageNumber=nsPNotifyMessageNumber, nsPNotifications=nsPNotifications, nsPNotifyMaxMessageNumber=nsPNotifyMaxMessageNumber, nsPNotifyObjects=nsPNotifyObjects, nsPNTables=nsPNTables, nsNotifyPeriodicNotification=nsNotifyPeriodicNotification, nsPNScalars=nsPNScalars, netSnmpPeriodicNotifyMib=netSnmpPeriodicNotifyMib, nsPNPeriodicTime=nsPNPeriodicTime) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.