content
stringlengths
7
1.05M
""" link: https://leetcode.com/problems/subarray-sum-equals-k problem: 求数组中是否存在子串满足其和为给定数字,求满足条件子串数。 solution: 记录前缀和。 """ class Solution: def subarraySum(self, nums: List[int], k: int) -> int: s, cur, res = {0: 1}, 0, 0 for x in nums: if cur + x - k in s: res += s[cur + x - k] cur += x s[cur] = s[cur] + 1 if cur in s else 1 return res
print('\n==== MAIOR/MENOR ====') num1 = float(input('Digite o primeiro número:')) num2 = float(input('Digite o segundo número:')) num3 = float(input('Dugite o terceiro número:')) maior = num1 if num2 > num1 and num2 > num3: maior = num2 if num3 > num1 and num3 > num2: maior = num3 menor = num1 if num2 < num1 and num2 < num3: menor = num2 if num3 < num1 and num3 < num2: menor = num3 print('\nO maior número é: {}!'.format(maior)) print('O menor número é: {}!'.format(menor))
#------------------------------------------------------------- # Name: Michael Dinh # Date: 10/10/2018 # Reference: Pg. 169, Problem #6 # Title: Book Club Points # Inputs: User inputs number of books bought from a store # Processes: Determines point value based on number of books bought # Outputs: Number of points user earns in correlation to number of books input #------------------------------------------------------------- #Start defining modules #getBooks() prompts the user for the number of books bought def getBooks(): books = int(input("Welcome to the Serendipity Booksellers Book Club Awards Points Calculator! Please enter the number of books you've purchased today: ")) return books #defPoints() determines what points tier a user qualifies for based on book value def detPoints(books): if books < 1: print("You've earned 0 points; buy at least one book to qualify!") elif books == 1: print("You've earned 5 points!") elif books == 2: print("You've earned 15 points!") elif books == 3: print("You've earned 30 points!") elif books > 3: print("Super reader! You've earned 60 points!") else: print("Error!") #Define main() def main(): #Intialize local variable books = 0.0 #Begin calling modules books = getBooks() detPoints(books) #Call main main()
def arraypermute(collection, key): return [ str(i) + str(j) for i in collection for j in key ] class FilterModule(object): def filters(self): return { 'arraypermute': arraypermute }
# # PySNMP MIB module SNIA-SML-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SNIA-SML-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:00: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) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") NotificationType, MibIdentifier, ObjectIdentity, Bits, iso, TimeTicks, enterprises, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, Counter32, Gauge32, ModuleIdentity, Counter64, Unsigned32, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "MibIdentifier", "ObjectIdentity", "Bits", "iso", "TimeTicks", "enterprises", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "Counter32", "Gauge32", "ModuleIdentity", "Counter64", "Unsigned32", "IpAddress") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") class UShortReal(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 65535) class CimDateTime(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(24, 24) fixedLength = 24 class UINT64(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(8, 8) fixedLength = 8 class UINT32(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 2147483647) class UINT16(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 65535) snia = MibIdentifier((1, 3, 6, 1, 4, 1, 14851)) experimental = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 1)) common = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 2)) libraries = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3)) smlRoot = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1)) smlMibVersion = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: smlMibVersion.setStatus('mandatory') smlCimVersion = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: smlCimVersion.setStatus('mandatory') productGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 3)) product_Name = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 3, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("product-Name").setMaxAccess("readonly") if mibBuilder.loadTexts: product_Name.setStatus('mandatory') product_IdentifyingNumber = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 3, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("product-IdentifyingNumber").setMaxAccess("readonly") if mibBuilder.loadTexts: product_IdentifyingNumber.setStatus('mandatory') product_Vendor = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 3, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("product-Vendor").setMaxAccess("readonly") if mibBuilder.loadTexts: product_Vendor.setStatus('mandatory') product_Version = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 3, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("product-Version").setMaxAccess("readonly") if mibBuilder.loadTexts: product_Version.setStatus('mandatory') product_ElementName = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 3, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("product-ElementName").setMaxAccess("readonly") if mibBuilder.loadTexts: product_ElementName.setStatus('mandatory') chassisGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4)) chassis_Manufacturer = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("chassis-Manufacturer").setMaxAccess("readonly") if mibBuilder.loadTexts: chassis_Manufacturer.setStatus('mandatory') chassis_Model = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("chassis-Model").setMaxAccess("readonly") if mibBuilder.loadTexts: chassis_Model.setStatus('mandatory') chassis_SerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("chassis-SerialNumber").setMaxAccess("readonly") if mibBuilder.loadTexts: chassis_SerialNumber.setStatus('mandatory') chassis_LockPresent = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("true", 1), ("false", 2)))).setLabel("chassis-LockPresent").setMaxAccess("readonly") if mibBuilder.loadTexts: chassis_LockPresent.setStatus('mandatory') chassis_SecurityBreach = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unknown", 1), ("other", 2), ("noBreach", 3), ("breachAttempted", 4), ("breachSuccessful", 5)))).setLabel("chassis-SecurityBreach").setMaxAccess("readonly") if mibBuilder.loadTexts: chassis_SecurityBreach.setStatus('mandatory') chassis_IsLocked = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("true", 1), ("false", 2)))).setLabel("chassis-IsLocked").setMaxAccess("readonly") if mibBuilder.loadTexts: chassis_IsLocked.setStatus('mandatory') chassis_Tag = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("chassis-Tag").setMaxAccess("readonly") if mibBuilder.loadTexts: chassis_Tag.setStatus('mandatory') chassis_ElementName = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("chassis-ElementName").setMaxAccess("readonly") if mibBuilder.loadTexts: chassis_ElementName.setStatus('mandatory') numberOfsubChassis = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfsubChassis.setStatus('mandatory') subChassisTable = MibTable((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10), ) if mibBuilder.loadTexts: subChassisTable.setStatus('mandatory') subChassisEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 1), ).setIndexNames((0, "SNIA-SML-MIB", "subChassisIndex")) if mibBuilder.loadTexts: subChassisEntry.setStatus('mandatory') subChassisIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 1, 1), UINT32()).setMaxAccess("readonly") if mibBuilder.loadTexts: subChassisIndex.setStatus('mandatory') subChassis_Manufacturer = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("subChassis-Manufacturer").setMaxAccess("readonly") if mibBuilder.loadTexts: subChassis_Manufacturer.setStatus('mandatory') subChassis_Model = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("subChassis-Model").setMaxAccess("readonly") if mibBuilder.loadTexts: subChassis_Model.setStatus('mandatory') subChassis_SerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("subChassis-SerialNumber").setMaxAccess("readonly") if mibBuilder.loadTexts: subChassis_SerialNumber.setStatus('mandatory') subChassis_LockPresent = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("true", 1), ("false", 2)))).setLabel("subChassis-LockPresent").setMaxAccess("readonly") if mibBuilder.loadTexts: subChassis_LockPresent.setStatus('mandatory') subChassis_SecurityBreach = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unknown", 1), ("other", 2), ("noBreach", 3), ("breachAttempted", 4), ("breachSuccessful", 5)))).setLabel("subChassis-SecurityBreach").setMaxAccess("readonly") if mibBuilder.loadTexts: subChassis_SecurityBreach.setStatus('mandatory') subChassis_IsLocked = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("true", 1), ("false", 2)))).setLabel("subChassis-IsLocked").setMaxAccess("readonly") if mibBuilder.loadTexts: subChassis_IsLocked.setStatus('mandatory') subChassis_Tag = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("subChassis-Tag").setMaxAccess("readonly") if mibBuilder.loadTexts: subChassis_Tag.setStatus('mandatory') subChassis_ElementName = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("subChassis-ElementName").setMaxAccess("readonly") if mibBuilder.loadTexts: subChassis_ElementName.setStatus('mandatory') subChassis_OperationalStatus = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 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, 18, 19, 32768))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("ok", 2), ("degraded", 3), ("stressed", 4), ("predictiveFailure", 5), ("error", 6), ("non-RecoverableError", 7), ("starting", 8), ("stopping", 9), ("stopped", 10), ("inService", 11), ("noContact", 12), ("lostCommunication", 13), ("aborted", 14), ("dormant", 15), ("supportingEntityInError", 16), ("completed", 17), ("powerMode", 18), ("dMTFReserved", 19), ("vendorReserved", 32768)))).setLabel("subChassis-OperationalStatus").setMaxAccess("readonly") if mibBuilder.loadTexts: subChassis_OperationalStatus.setStatus('mandatory') subChassis_PackageType = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 4, 10, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 17, 18, 19, 32769))).clone(namedValues=NamedValues(("unknown", 0), ("mainSystemChassis", 17), ("expansionChassis", 18), ("subChassis", 19), ("serviceBay", 32769)))).setLabel("subChassis-PackageType").setMaxAccess("readonly") if mibBuilder.loadTexts: subChassis_PackageType.setStatus('mandatory') storageLibraryGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 5)) storageLibrary_Name = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 5, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("storageLibrary-Name").setMaxAccess("readonly") if mibBuilder.loadTexts: storageLibrary_Name.setStatus('deprecated') storageLibrary_Description = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 5, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("storageLibrary-Description").setMaxAccess("readonly") if mibBuilder.loadTexts: storageLibrary_Description.setStatus('deprecated') storageLibrary_Caption = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 5, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("storageLibrary-Caption").setMaxAccess("readonly") if mibBuilder.loadTexts: storageLibrary_Caption.setStatus('deprecated') storageLibrary_Status = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 5, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10))).setLabel("storageLibrary-Status").setMaxAccess("readonly") if mibBuilder.loadTexts: storageLibrary_Status.setStatus('deprecated') storageLibrary_InstallDate = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 5, 5), CimDateTime()).setLabel("storageLibrary-InstallDate").setMaxAccess("readonly") if mibBuilder.loadTexts: storageLibrary_InstallDate.setStatus('deprecated') mediaAccessDeviceGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6)) numberOfMediaAccessDevices = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfMediaAccessDevices.setStatus('mandatory') mediaAccessDeviceTable = MibTable((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2), ) if mibBuilder.loadTexts: mediaAccessDeviceTable.setStatus('mandatory') mediaAccessDeviceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1), ).setIndexNames((0, "SNIA-SML-MIB", "mediaAccessDeviceIndex")) if mibBuilder.loadTexts: mediaAccessDeviceEntry.setStatus('mandatory') mediaAccessDeviceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 1), UINT32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDeviceIndex.setStatus('mandatory') mediaAccessDeviceObjectType = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unknown", 0), ("wormDrive", 1), ("magnetoOpticalDrive", 2), ("tapeDrive", 3), ("dvdDrive", 4), ("cdromDrive", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDeviceObjectType.setStatus('mandatory') mediaAccessDevice_Name = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("mediaAccessDevice-Name").setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDevice_Name.setStatus('deprecated') mediaAccessDevice_Status = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10))).setLabel("mediaAccessDevice-Status").setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDevice_Status.setStatus('deprecated') mediaAccessDevice_Availability = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21))).clone(namedValues=NamedValues(("other", 1), ("unknown", 2), ("runningFullPower", 3), ("warning", 4), ("inTest", 5), ("notApplicable", 6), ("powerOff", 7), ("offLine", 8), ("offDuty", 9), ("degraded", 10), ("notInstalled", 11), ("installError", 12), ("powerSaveUnknown", 13), ("powerSaveLowPowerMode", 14), ("powerSaveStandby", 15), ("powerCycle", 16), ("powerSaveWarning", 17), ("paused", 18), ("notReady", 19), ("notConfigured", 20), ("quiesced", 21)))).setLabel("mediaAccessDevice-Availability").setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDevice_Availability.setStatus('mandatory') mediaAccessDevice_NeedsCleaning = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("true", 1), ("false", 2)))).setLabel("mediaAccessDevice-NeedsCleaning").setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDevice_NeedsCleaning.setStatus('mandatory') mediaAccessDevice_MountCount = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 7), UINT64()).setLabel("mediaAccessDevice-MountCount").setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDevice_MountCount.setStatus('mandatory') mediaAccessDevice_DeviceID = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("mediaAccessDevice-DeviceID").setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDevice_DeviceID.setStatus('mandatory') mediaAccessDevice_PowerOnHours = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 9), UINT64()).setLabel("mediaAccessDevice-PowerOnHours").setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDevice_PowerOnHours.setStatus('mandatory') mediaAccessDevice_TotalPowerOnHours = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 10), UINT64()).setLabel("mediaAccessDevice-TotalPowerOnHours").setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDevice_TotalPowerOnHours.setStatus('mandatory') mediaAccessDevice_OperationalStatus = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 32768))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("ok", 2), ("degraded", 3), ("stressed", 4), ("predictiveFailure", 5), ("error", 6), ("non-RecoverableError", 7), ("starting", 8), ("stopping", 9), ("stopped", 10), ("inService", 11), ("noContact", 12), ("lostCommunication", 13), ("aborted", 14), ("dormant", 15), ("supportingEntityInError", 16), ("completed", 17), ("powerMode", 18), ("dMTFReserved", 19), ("vendorReserved", 32768)))).setLabel("mediaAccessDevice-OperationalStatus").setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDevice_OperationalStatus.setStatus('mandatory') mediaAccessDevice_Realizes_StorageLocationIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 12), UINT32()).setLabel("mediaAccessDevice-Realizes-StorageLocationIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDevice_Realizes_StorageLocationIndex.setStatus('mandatory') mediaAccessDevice_Realizes_softwareElementIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 6, 2, 1, 13), UINT32()).setLabel("mediaAccessDevice-Realizes-softwareElementIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: mediaAccessDevice_Realizes_softwareElementIndex.setStatus('mandatory') physicalPackageGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 8)) numberOfPhysicalPackages = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 8, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfPhysicalPackages.setStatus('mandatory') physicalPackageTable = MibTable((1, 3, 6, 1, 4, 1, 14851, 3, 1, 8, 2), ) if mibBuilder.loadTexts: physicalPackageTable.setStatus('mandatory') physicalPackageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14851, 3, 1, 8, 2, 1), ).setIndexNames((0, "SNIA-SML-MIB", "physicalPackageIndex")) if mibBuilder.loadTexts: physicalPackageEntry.setStatus('mandatory') physicalPackageIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 8, 2, 1, 1), UINT32()).setMaxAccess("readonly") if mibBuilder.loadTexts: physicalPackageIndex.setStatus('mandatory') physicalPackage_Manufacturer = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 8, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("physicalPackage-Manufacturer").setMaxAccess("readonly") if mibBuilder.loadTexts: physicalPackage_Manufacturer.setStatus('mandatory') physicalPackage_Model = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 8, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("physicalPackage-Model").setMaxAccess("readonly") if mibBuilder.loadTexts: physicalPackage_Model.setStatus('mandatory') physicalPackage_SerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 8, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("physicalPackage-SerialNumber").setMaxAccess("readonly") if mibBuilder.loadTexts: physicalPackage_SerialNumber.setStatus('mandatory') physicalPackage_Realizes_MediaAccessDeviceIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 8, 2, 1, 5), Integer32()).setLabel("physicalPackage-Realizes-MediaAccessDeviceIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: physicalPackage_Realizes_MediaAccessDeviceIndex.setStatus('mandatory') physicalPackage_Tag = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 8, 2, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("physicalPackage-Tag").setMaxAccess("readonly") if mibBuilder.loadTexts: physicalPackage_Tag.setStatus('mandatory') softwareElementGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9)) numberOfSoftwareElements = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfSoftwareElements.setStatus('mandatory') softwareElementTable = MibTable((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2), ) if mibBuilder.loadTexts: softwareElementTable.setStatus('mandatory') softwareElementEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1), ).setIndexNames((0, "SNIA-SML-MIB", "softwareElementIndex")) if mibBuilder.loadTexts: softwareElementEntry.setStatus('mandatory') softwareElementIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1, 1), UINT32()).setMaxAccess("readonly") if mibBuilder.loadTexts: softwareElementIndex.setStatus('mandatory') softwareElement_Name = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("softwareElement-Name").setMaxAccess("readonly") if mibBuilder.loadTexts: softwareElement_Name.setStatus('deprecated') softwareElement_Version = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("softwareElement-Version").setMaxAccess("readonly") if mibBuilder.loadTexts: softwareElement_Version.setStatus('mandatory') softwareElement_SoftwareElementID = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("softwareElement-SoftwareElementID").setMaxAccess("readonly") if mibBuilder.loadTexts: softwareElement_SoftwareElementID.setStatus('mandatory') softwareElement_Manufacturer = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("softwareElement-Manufacturer").setMaxAccess("readonly") if mibBuilder.loadTexts: softwareElement_Manufacturer.setStatus('mandatory') softwareElement_BuildNumber = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("softwareElement-BuildNumber").setMaxAccess("readonly") if mibBuilder.loadTexts: softwareElement_BuildNumber.setStatus('mandatory') softwareElement_SerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("softwareElement-SerialNumber").setMaxAccess("readonly") if mibBuilder.loadTexts: softwareElement_SerialNumber.setStatus('mandatory') softwareElement_CodeSet = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("softwareElement-CodeSet").setMaxAccess("readonly") if mibBuilder.loadTexts: softwareElement_CodeSet.setStatus('deprecated') softwareElement_IdentificationCode = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("softwareElement-IdentificationCode").setMaxAccess("readonly") if mibBuilder.loadTexts: softwareElement_IdentificationCode.setStatus('deprecated') softwareElement_LanguageEdition = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setLabel("softwareElement-LanguageEdition").setMaxAccess("readonly") if mibBuilder.loadTexts: softwareElement_LanguageEdition.setStatus('deprecated') softwareElement_InstanceID = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 9, 2, 1, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("softwareElement-InstanceID").setMaxAccess("readonly") if mibBuilder.loadTexts: softwareElement_InstanceID.setStatus('mandatory') computerSystemGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 10)) computerSystem_ElementName = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 10, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("computerSystem-ElementName").setMaxAccess("readonly") if mibBuilder.loadTexts: computerSystem_ElementName.setStatus('mandatory') computerSystem_OperationalStatus = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 10, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 32768))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("ok", 2), ("degraded", 3), ("stressed", 4), ("predictiveFailure", 5), ("error", 6), ("non-RecoverableError", 7), ("starting", 8), ("stopping", 9), ("stopped", 10), ("inService", 11), ("noContact", 12), ("lostCommunication", 13), ("aborted", 14), ("dormant", 15), ("supportingEntityInError", 16), ("completed", 17), ("powerMode", 18), ("dMTFReserved", 19), ("vendorReserved", 32768)))).setLabel("computerSystem-OperationalStatus").setMaxAccess("readonly") if mibBuilder.loadTexts: computerSystem_OperationalStatus.setStatus('mandatory') computerSystem_Name = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 10, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("computerSystem-Name").setMaxAccess("readonly") if mibBuilder.loadTexts: computerSystem_Name.setStatus('mandatory') computerSystem_NameFormat = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 10, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("computerSystem-NameFormat").setMaxAccess("readonly") if mibBuilder.loadTexts: computerSystem_NameFormat.setStatus('mandatory') computerSystem_Dedicated = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 10, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20))).clone(namedValues=NamedValues(("notDedicated", 0), ("unknown", 1), ("other", 2), ("storage", 3), ("router", 4), ("switch", 5), ("layer3switch", 6), ("centralOfficeSwitch", 7), ("hub", 8), ("accessServer", 9), ("firewall", 10), ("print", 11), ("io", 12), ("webCaching", 13), ("management", 14), ("blockServer", 15), ("fileServer", 16), ("mobileUserDevice", 17), ("repeater", 18), ("bridgeExtender", 19), ("gateway", 20)))).setLabel("computerSystem-Dedicated").setMaxAccess("readonly") if mibBuilder.loadTexts: computerSystem_Dedicated.setStatus('mandatory') computerSystem_PrimaryOwnerContact = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 10, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("computerSystem-PrimaryOwnerContact").setMaxAccess("readonly") if mibBuilder.loadTexts: computerSystem_PrimaryOwnerContact.setStatus('mandatory') computerSystem_PrimaryOwnerName = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 10, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("computerSystem-PrimaryOwnerName").setMaxAccess("readonly") if mibBuilder.loadTexts: computerSystem_PrimaryOwnerName.setStatus('mandatory') computerSystem_Description = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 10, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("computerSystem-Description").setMaxAccess("readonly") if mibBuilder.loadTexts: computerSystem_Description.setStatus('mandatory') computerSystem_Caption = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 10, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("computerSystem-Caption").setMaxAccess("readonly") if mibBuilder.loadTexts: computerSystem_Caption.setStatus('mandatory') computerSystem_Realizes_softwareElementIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 10, 10), UINT32()).setLabel("computerSystem-Realizes-softwareElementIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: computerSystem_Realizes_softwareElementIndex.setStatus('mandatory') changerDeviceGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11)) numberOfChangerDevices = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfChangerDevices.setStatus('mandatory') changerDeviceTable = MibTable((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 2), ) if mibBuilder.loadTexts: changerDeviceTable.setStatus('mandatory') changerDeviceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 2, 1), ).setIndexNames((0, "SNIA-SML-MIB", "changerDeviceIndex")) if mibBuilder.loadTexts: changerDeviceEntry.setStatus('mandatory') changerDeviceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 2, 1, 1), UINT32()).setMaxAccess("readonly") if mibBuilder.loadTexts: changerDeviceIndex.setStatus('mandatory') changerDevice_DeviceID = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("changerDevice-DeviceID").setMaxAccess("readonly") if mibBuilder.loadTexts: changerDevice_DeviceID.setStatus('mandatory') changerDevice_MediaFlipSupported = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setLabel("changerDevice-MediaFlipSupported").setMaxAccess("readonly") if mibBuilder.loadTexts: changerDevice_MediaFlipSupported.setStatus('mandatory') changerDevice_ElementName = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("changerDevice-ElementName").setMaxAccess("readonly") if mibBuilder.loadTexts: changerDevice_ElementName.setStatus('mandatory') changerDevice_Caption = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("changerDevice-Caption").setMaxAccess("readonly") if mibBuilder.loadTexts: changerDevice_Caption.setStatus('mandatory') changerDevice_Description = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 2, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("changerDevice-Description").setMaxAccess("readonly") if mibBuilder.loadTexts: changerDevice_Description.setStatus('mandatory') changerDevice_Availability = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21))).clone(namedValues=NamedValues(("other", 1), ("unknown", 2), ("runningFullPower", 3), ("warning", 4), ("inTest", 5), ("notApplicable", 6), ("powerOff", 7), ("offLine", 8), ("offDuty", 9), ("degraded", 10), ("notInstalled", 11), ("installError", 12), ("powerSaveUnknown", 13), ("powerSaveLowPowerMode", 14), ("powerSaveStandby", 15), ("powerCycle", 16), ("powerSaveWarning", 17), ("paused", 18), ("notReady", 19), ("notConfigured", 20), ("quiesced", 21)))).setLabel("changerDevice-Availability").setMaxAccess("readonly") if mibBuilder.loadTexts: changerDevice_Availability.setStatus('mandatory') changerDevice_OperationalStatus = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 32768))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("ok", 2), ("degraded", 3), ("stressed", 4), ("predictiveFailure", 5), ("error", 6), ("non-RecoverableError", 7), ("starting", 8), ("stopping", 9), ("stopped", 10), ("inService", 11), ("noContact", 12), ("lostCommunication", 13), ("aborted", 14), ("dormant", 15), ("supportingEntityInError", 16), ("completed", 17), ("powerMode", 18), ("dMTFReserved", 19), ("vendorReserved", 32768)))).setLabel("changerDevice-OperationalStatus").setMaxAccess("readonly") if mibBuilder.loadTexts: changerDevice_OperationalStatus.setStatus('mandatory') changerDevice_Realizes_StorageLocationIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 11, 2, 1, 10), UINT32()).setLabel("changerDevice-Realizes-StorageLocationIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: changerDevice_Realizes_StorageLocationIndex.setStatus('mandatory') scsiProtocolControllerGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12)) numberOfSCSIProtocolControllers = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfSCSIProtocolControllers.setStatus('mandatory') scsiProtocolControllerTable = MibTable((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12, 2), ) if mibBuilder.loadTexts: scsiProtocolControllerTable.setStatus('mandatory') scsiProtocolControllerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12, 2, 1), ).setIndexNames((0, "SNIA-SML-MIB", "scsiProtocolControllerIndex")) if mibBuilder.loadTexts: scsiProtocolControllerEntry.setStatus('mandatory') scsiProtocolControllerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12, 2, 1, 1), UINT32()).setMaxAccess("readonly") if mibBuilder.loadTexts: scsiProtocolControllerIndex.setStatus('mandatory') scsiProtocolController_DeviceID = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("scsiProtocolController-DeviceID").setMaxAccess("readonly") if mibBuilder.loadTexts: scsiProtocolController_DeviceID.setStatus('mandatory') scsiProtocolController_ElementName = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("scsiProtocolController-ElementName").setMaxAccess("readonly") if mibBuilder.loadTexts: scsiProtocolController_ElementName.setStatus('mandatory') scsiProtocolController_OperationalStatus = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 32768))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("ok", 2), ("degraded", 3), ("stressed", 4), ("predictiveFailure", 5), ("error", 6), ("non-RecoverableError", 7), ("starting", 8), ("stopping", 9), ("stopped", 10), ("inService", 11), ("noContact", 12), ("lostCommunication", 13), ("aborted", 14), ("dormant", 15), ("supportingEntityInError", 16), ("completed", 17), ("powerMode", 18), ("dMTFReserved", 19), ("vendorReserved", 32768)))).setLabel("scsiProtocolController-OperationalStatus").setMaxAccess("readonly") if mibBuilder.loadTexts: scsiProtocolController_OperationalStatus.setStatus('mandatory') scsiProtocolController_Description = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("scsiProtocolController-Description").setMaxAccess("readonly") if mibBuilder.loadTexts: scsiProtocolController_Description.setStatus('mandatory') scsiProtocolController_Availability = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21))).clone(namedValues=NamedValues(("other", 1), ("unknown", 2), ("runningFullPower", 3), ("warning", 4), ("inTest", 5), ("notApplicable", 6), ("powerOff", 7), ("offLine", 8), ("offDuty", 9), ("degraded", 10), ("notInstalled", 11), ("installError", 12), ("powerSaveUnknown", 13), ("powerSaveLowPowerMode", 14), ("powerSaveStandby", 15), ("powerCycle", 16), ("powerSaveWarning", 17), ("paused", 18), ("notReady", 19), ("notConfigured", 20), ("quiesced", 21)))).setLabel("scsiProtocolController-Availability").setMaxAccess("readonly") if mibBuilder.loadTexts: scsiProtocolController_Availability.setStatus('mandatory') scsiProtocolController_Realizes_ChangerDeviceIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12, 2, 1, 7), UINT32()).setLabel("scsiProtocolController-Realizes-ChangerDeviceIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: scsiProtocolController_Realizes_ChangerDeviceIndex.setStatus('mandatory') scsiProtocolController_Realizes_MediaAccessDeviceIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 12, 2, 1, 8), UINT32()).setLabel("scsiProtocolController-Realizes-MediaAccessDeviceIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: scsiProtocolController_Realizes_MediaAccessDeviceIndex.setStatus('mandatory') storageMediaLocationGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13)) numberOfStorageMediaLocations = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfStorageMediaLocations.setStatus('mandatory') numberOfPhysicalMedias = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfPhysicalMedias.setStatus('mandatory') storageMediaLocationTable = MibTable((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3), ) if mibBuilder.loadTexts: storageMediaLocationTable.setStatus('mandatory') storageMediaLocationEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1), ).setIndexNames((0, "SNIA-SML-MIB", "storageMediaLocationIndex")) if mibBuilder.loadTexts: storageMediaLocationEntry.setStatus('mandatory') storageMediaLocationIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 1), UINT32()).setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocationIndex.setStatus('mandatory') storageMediaLocation_Tag = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("storageMediaLocation-Tag").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_Tag.setStatus('mandatory') storageMediaLocation_LocationType = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("slot", 2), ("magazine", 3), ("mediaAccessDevice", 4), ("interLibraryPort", 5), ("limitedAccessPort", 6), ("door", 7), ("shelf", 8), ("vault", 9)))).setLabel("storageMediaLocation-LocationType").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_LocationType.setStatus('mandatory') storageMediaLocation_LocationCoordinates = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("storageMediaLocation-LocationCoordinates").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_LocationCoordinates.setStatus('mandatory') storageMediaLocation_MediaTypesSupported = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("tape", 2), ("qic", 3), ("ait", 4), ("dtf", 5), ("dat", 6), ("eightmmTape", 7), ("nineteenmmTape", 8), ("dlt", 9), ("halfInchMO", 10), ("catridgeDisk", 11), ("jazDisk", 12), ("zipDisk", 13), ("syQuestDisk", 14), ("winchesterDisk", 15), ("cdRom", 16), ("cdRomXA", 17), ("cdI", 18), ("cdRecordable", 19), ("wORM", 20), ("magneto-Optical", 21), ("dvd", 22), ("dvdRWPlus", 23), ("dvdRAM", 24), ("dvdROM", 25), ("dvdVideo", 26), ("divx", 27), ("floppyDiskette", 28), ("hardDisk", 29), ("memoryCard", 30), ("hardCopy", 31), ("clikDisk", 32), ("cdRW", 33), ("cdDA", 34), ("cdPlus", 35), ("dvdRecordable", 36), ("dvdRW", 37), ("dvdAudio", 38), ("dvd5", 39), ("dvd9", 40), ("dvd10", 41), ("dvd18", 42), ("moRewriteable", 43), ("moWriteOnce", 44), ("moLIMDOW", 45), ("phaseChangeWO", 46), ("phaseChangeRewriteable", 47), ("phaseChangeDualRewriteable", 48), ("ablativeWriteOnce", 49), ("nearField", 50), ("miniQic", 51), ("travan", 52), ("eightmmMetal", 53), ("eightmmAdvanced", 54), ("nctp", 55), ("ltoUltrium", 56), ("ltoAccelis", 57), ("tape9Track", 58), ("tape18Track", 59), ("tape36Track", 60), ("magstar3590", 61), ("magstarMP", 62), ("d2Tape", 63), ("dstSmall", 64), ("dstMedium", 65), ("dstLarge", 66)))).setLabel("storageMediaLocation-MediaTypesSupported").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_MediaTypesSupported.setStatus('mandatory') storageMediaLocation_MediaCapacity = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 6), UINT32()).setLabel("storageMediaLocation-MediaCapacity").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_MediaCapacity.setStatus('mandatory') storageMediaLocation_Association_ChangerDeviceIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 7), UINT32()).setLabel("storageMediaLocation-Association-ChangerDeviceIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_Association_ChangerDeviceIndex.setStatus('mandatory') storageMediaLocation_PhysicalMediaPresent = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setLabel("storageMediaLocation-PhysicalMediaPresent").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_PhysicalMediaPresent.setStatus('mandatory') storageMediaLocation_PhysicalMedia_Removable = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("true", 1), ("false", 2)))).setLabel("storageMediaLocation-PhysicalMedia-Removable").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_PhysicalMedia_Removable.setStatus('mandatory') storageMediaLocation_PhysicalMedia_Replaceable = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("true", 1), ("false", 2)))).setLabel("storageMediaLocation-PhysicalMedia-Replaceable").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_PhysicalMedia_Replaceable.setStatus('mandatory') storageMediaLocation_PhysicalMedia_HotSwappable = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("true", 1), ("false", 2)))).setLabel("storageMediaLocation-PhysicalMedia-HotSwappable").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_PhysicalMedia_HotSwappable.setStatus('mandatory') storageMediaLocation_PhysicalMedia_Capacity = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 14), UINT64()).setLabel("storageMediaLocation-PhysicalMedia-Capacity").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_PhysicalMedia_Capacity.setStatus('mandatory') storageMediaLocation_PhysicalMedia_MediaType = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("tape", 2), ("qic", 3), ("ait", 4), ("dtf", 5), ("dat", 6), ("eightmmTape", 7), ("nineteenmmTape", 8), ("dlt", 9), ("halfInchMO", 10), ("catridgeDisk", 11), ("jazDisk", 12), ("zipDisk", 13), ("syQuestDisk", 14), ("winchesterDisk", 15), ("cdRom", 16), ("cdRomXA", 17), ("cdI", 18), ("cdRecordable", 19), ("wORM", 20), ("magneto-Optical", 21), ("dvd", 22), ("dvdRWPlus", 23), ("dvdRAM", 24), ("dvdROM", 25), ("dvdVideo", 26), ("divx", 27), ("floppyDiskette", 28), ("hardDisk", 29), ("memoryCard", 30), ("hardCopy", 31), ("clikDisk", 32), ("cdRW", 33), ("cdDA", 34), ("cdPlus", 35), ("dvdRecordable", 36), ("dvdRW", 37), ("dvdAudio", 38), ("dvd5", 39), ("dvd9", 40), ("dvd10", 41), ("dvd18", 42), ("moRewriteable", 43), ("moWriteOnce", 44), ("moLIMDOW", 45), ("phaseChangeWO", 46), ("phaseChangeRewriteable", 47), ("phaseChangeDualRewriteable", 48), ("ablativeWriteOnce", 49), ("nearField", 50), ("miniQic", 51), ("travan", 52), ("eightmmMetal", 53), ("eightmmAdvanced", 54), ("nctp", 55), ("ltoUltrium", 56), ("ltoAccelis", 57), ("tape9Track", 58), ("tape18Track", 59), ("tape36Track", 60), ("magstar3590", 61), ("magstarMP", 62), ("d2Tape", 63), ("dstSmall", 64), ("dstMedium", 65), ("dstLarge", 66)))).setLabel("storageMediaLocation-PhysicalMedia-MediaType").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_PhysicalMedia_MediaType.setStatus('mandatory') storageMediaLocation_PhysicalMedia_MediaDescription = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 16), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("storageMediaLocation-PhysicalMedia-MediaDescription").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_PhysicalMedia_MediaDescription.setStatus('mandatory') storageMediaLocation_PhysicalMedia_CleanerMedia = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("true", 1), ("false", 2)))).setLabel("storageMediaLocation-PhysicalMedia-CleanerMedia").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_PhysicalMedia_CleanerMedia.setStatus('mandatory') storageMediaLocation_PhysicalMedia_DualSided = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("true", 1), ("false", 2)))).setLabel("storageMediaLocation-PhysicalMedia-DualSided").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_PhysicalMedia_DualSided.setStatus('mandatory') storageMediaLocation_PhysicalMedia_PhysicalLabel = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 19), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("storageMediaLocation-PhysicalMedia-PhysicalLabel").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_PhysicalMedia_PhysicalLabel.setStatus('mandatory') storageMediaLocation_PhysicalMedia_Tag = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 13, 3, 1, 20), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("storageMediaLocation-PhysicalMedia-Tag").setMaxAccess("readonly") if mibBuilder.loadTexts: storageMediaLocation_PhysicalMedia_Tag.setStatus('mandatory') limitedAccessPortGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 14)) numberOflimitedAccessPorts = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 14, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOflimitedAccessPorts.setStatus('mandatory') limitedAccessPortTable = MibTable((1, 3, 6, 1, 4, 1, 14851, 3, 1, 14, 2), ) if mibBuilder.loadTexts: limitedAccessPortTable.setStatus('mandatory') limitedAccessPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14851, 3, 1, 14, 2, 1), ).setIndexNames((0, "SNIA-SML-MIB", "limitedAccessPortIndex")) if mibBuilder.loadTexts: limitedAccessPortEntry.setStatus('mandatory') limitedAccessPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 14, 2, 1, 1), UINT32()).setMaxAccess("readonly") if mibBuilder.loadTexts: limitedAccessPortIndex.setStatus('mandatory') limitedAccessPort_DeviceID = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 14, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("limitedAccessPort-DeviceID").setMaxAccess("readonly") if mibBuilder.loadTexts: limitedAccessPort_DeviceID.setStatus('mandatory') limitedAccessPort_Extended = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 14, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setLabel("limitedAccessPort-Extended").setMaxAccess("readonly") if mibBuilder.loadTexts: limitedAccessPort_Extended.setStatus('mandatory') limitedAccessPort_ElementName = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 14, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("limitedAccessPort-ElementName").setMaxAccess("readonly") if mibBuilder.loadTexts: limitedAccessPort_ElementName.setStatus('mandatory') limitedAccessPort_Caption = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 14, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("limitedAccessPort-Caption").setMaxAccess("readonly") if mibBuilder.loadTexts: limitedAccessPort_Caption.setStatus('mandatory') limitedAccessPort_Description = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 14, 2, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("limitedAccessPort-Description").setMaxAccess("readonly") if mibBuilder.loadTexts: limitedAccessPort_Description.setStatus('mandatory') limitedAccessPort_Realizes_StorageLocationIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 14, 2, 1, 7), UINT32()).setLabel("limitedAccessPort-Realizes-StorageLocationIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: limitedAccessPort_Realizes_StorageLocationIndex.setStatus('mandatory') fCPortGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15)) numberOffCPorts = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOffCPorts.setStatus('mandatory') fCPortTable = MibTable((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15, 2), ) if mibBuilder.loadTexts: fCPortTable.setStatus('mandatory') fCPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15, 2, 1), ).setIndexNames((0, "SNIA-SML-MIB", "fCPortIndex")) if mibBuilder.loadTexts: fCPortEntry.setStatus('mandatory') fCPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15, 2, 1, 1), UINT32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fCPortIndex.setStatus('mandatory') fCPort_DeviceID = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("fCPort-DeviceID").setMaxAccess("readonly") if mibBuilder.loadTexts: fCPort_DeviceID.setStatus('mandatory') fCPort_ElementName = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("fCPort-ElementName").setMaxAccess("readonly") if mibBuilder.loadTexts: fCPort_ElementName.setStatus('mandatory') fCPort_Caption = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("fCPort-Caption").setMaxAccess("readonly") if mibBuilder.loadTexts: fCPort_Caption.setStatus('mandatory') fCPort_Description = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setLabel("fCPort-Description").setMaxAccess("readonly") if mibBuilder.loadTexts: fCPort_Description.setStatus('mandatory') fCPortController_OperationalStatus = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 32768))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("ok", 2), ("degraded", 3), ("stressed", 4), ("predictiveFailure", 5), ("error", 6), ("non-RecoverableError", 7), ("starting", 8), ("stopping", 9), ("stopped", 10), ("inService", 11), ("noContact", 12), ("lostCommunication", 13), ("aborted", 14), ("dormant", 15), ("supportingEntityInError", 16), ("completed", 17), ("powerMode", 18), ("dMTFReserved", 19), ("vendorReserved", 32768)))).setLabel("fCPortController-OperationalStatus").setMaxAccess("readonly") if mibBuilder.loadTexts: fCPortController_OperationalStatus.setStatus('mandatory') fCPort_PermanentAddress = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15, 2, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setLabel("fCPort-PermanentAddress").setMaxAccess("readonly") if mibBuilder.loadTexts: fCPort_PermanentAddress.setStatus('mandatory') fCPort_Realizes_scsiProtocolControllerIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 15, 2, 1, 8), UINT32()).setLabel("fCPort-Realizes-scsiProtocolControllerIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: fCPort_Realizes_scsiProtocolControllerIndex.setStatus('mandatory') trapGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16)) trapsEnabled = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: trapsEnabled.setStatus('mandatory') trapDriveAlertSummary = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60))).clone(namedValues=NamedValues(("readWarning", 1), ("writeWarning", 2), ("hardError", 3), ("media", 4), ("readFailure", 5), ("writeFailure", 6), ("mediaLife", 7), ("notDataGrade", 8), ("writeProtect", 9), ("noRemoval", 10), ("cleaningMedia", 11), ("unsupportedFormat", 12), ("recoverableSnappedTape", 13), ("unrecoverableSnappedTape", 14), ("memoryChipInCartridgeFailure", 15), ("forcedEject", 16), ("readOnlyFormat", 17), ("directoryCorruptedOnLoad", 18), ("nearingMediaLife", 19), ("cleanNow", 20), ("cleanPeriodic", 21), ("expiredCleaningMedia", 22), ("invalidCleaningMedia", 23), ("retentionRequested", 24), ("dualPortInterfaceError", 25), ("coolingFanError", 26), ("powerSupplyFailure", 27), ("powerConsumption", 28), ("driveMaintenance", 29), ("hardwareA", 30), ("hardwareB", 31), ("interface", 32), ("ejectMedia", 33), ("downloadFailure", 34), ("driveHumidity", 35), ("driveTemperature", 36), ("driveVoltage", 37), ("predictiveFailure", 38), ("diagnosticsRequired", 39), ("lostStatistics", 50), ("mediaDirectoryInvalidAtUnload", 51), ("mediaSystemAreaWriteFailure", 52), ("mediaSystemAreaReadFailure", 53), ("noStartOfData", 54), ("loadingFailure", 55), ("unrecoverableUnloadFailure", 56), ("automationInterfaceFailure", 57), ("firmwareFailure", 58), ("wormMediumIntegrityCheckFailed", 59), ("wormMediumOverwriteAttempted", 60)))).setMaxAccess("readonly") if mibBuilder.loadTexts: trapDriveAlertSummary.setStatus('mandatory') trap_Association_MediaAccessDeviceIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 3), UINT32()).setLabel("trap-Association-MediaAccessDeviceIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: trap_Association_MediaAccessDeviceIndex.setStatus('mandatory') trapChangerAlertSummary = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32))).clone(namedValues=NamedValues(("libraryHardwareA", 1), ("libraryHardwareB", 2), ("libraryHardwareC", 3), ("libraryHardwareD", 4), ("libraryDiagnosticsRequired", 5), ("libraryInterface", 6), ("failurePrediction", 7), ("libraryMaintenance", 8), ("libraryHumidityLimits", 9), ("libraryTemperatureLimits", 10), ("libraryVoltageLimits", 11), ("libraryStrayMedia", 12), ("libraryPickRetry", 13), ("libraryPlaceRetry", 14), ("libraryLoadRetry", 15), ("libraryDoor", 16), ("libraryMailslot", 17), ("libraryMagazine", 18), ("librarySecurity", 19), ("librarySecurityMode", 20), ("libraryOffline", 21), ("libraryDriveOffline", 22), ("libraryScanRetry", 23), ("libraryInventory", 24), ("libraryIllegalOperation", 25), ("dualPortInterfaceError", 26), ("coolingFanFailure", 27), ("powerSupply", 28), ("powerConsumption", 29), ("passThroughMechanismFailure", 30), ("cartridgeInPassThroughMechanism", 31), ("unreadableBarCodeLabels", 32)))).setMaxAccess("readonly") if mibBuilder.loadTexts: trapChangerAlertSummary.setStatus('mandatory') trap_Association_ChangerDeviceIndex = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 5), UINT32()).setLabel("trap-Association-ChangerDeviceIndex").setMaxAccess("readonly") if mibBuilder.loadTexts: trap_Association_ChangerDeviceIndex.setStatus('mandatory') trapPerceivedSeverity = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("information", 2), ("degradedWarning", 3), ("minor", 4), ("major", 5), ("critical", 6), ("fatalNonRecoverable", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: trapPerceivedSeverity.setStatus('mandatory') trapDestinationTable = MibTable((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 7), ) if mibBuilder.loadTexts: trapDestinationTable.setStatus('mandatory') trapDestinationEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 7, 1), ).setIndexNames((0, "SNIA-SML-MIB", "numberOfTrapDestinations")) if mibBuilder.loadTexts: trapDestinationEntry.setStatus('mandatory') numberOfTrapDestinations = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 7, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: numberOfTrapDestinations.setStatus('mandatory') trapDestinationHostType = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 7, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: trapDestinationHostType.setStatus('mandatory') trapDestinationHostAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 7, 1, 3), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: trapDestinationHostAddr.setStatus('mandatory') trapDestinationPort = MibTableColumn((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 7, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: trapDestinationPort.setStatus('mandatory') driveAlert = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1) + (0,0)).setObjects(("SNIA-SML-MIB", "trapDriveAlertSummary"), ("SNIA-SML-MIB", "trap_Association_MediaAccessDeviceIndex"), ("SNIA-SML-MIB", "trapPerceivedSeverity")) changerAlert = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1) + (0,1)).setObjects(("SNIA-SML-MIB", "trapChangerAlertSummary"), ("SNIA-SML-MIB", "trap_Association_ChangerDeviceIndex"), ("SNIA-SML-MIB", "trapPerceivedSeverity")) trapObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 8)) currentOperationalStatus = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 8, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 32768))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("ok", 2), ("degraded", 3), ("stressed", 4), ("predictiveFailure", 5), ("error", 6), ("non-RecoverableError", 7), ("starting", 8), ("stopping", 9), ("stopped", 10), ("inService", 11), ("noContact", 12), ("lostCommunication", 13), ("aborted", 14), ("dormant", 15), ("supportingEntityInError", 16), ("completed", 17), ("powerMode", 18), ("dMTFReserved", 19), ("vendorReserved", 32768)))).setMaxAccess("readonly") if mibBuilder.loadTexts: currentOperationalStatus.setStatus('mandatory') oldOperationalStatus = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16, 8, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 32768))).clone(namedValues=NamedValues(("unknown", 0), ("other", 1), ("ok", 2), ("degraded", 3), ("stressed", 4), ("predictiveFailure", 5), ("error", 6), ("non-RecoverableError", 7), ("starting", 8), ("stopping", 9), ("stopped", 10), ("inService", 11), ("noContact", 12), ("lostCommunication", 13), ("aborted", 14), ("dormant", 15), ("supportingEntityInError", 16), ("completed", 17), ("powerMode", 18), ("dMTFReserved", 19), ("vendorReserved", 32768)))).setMaxAccess("readonly") if mibBuilder.loadTexts: oldOperationalStatus.setStatus('mandatory') libraryAddedTrap = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16) + (0,3)).setObjects(("SNIA-SML-MIB", "storageLibrary_Name")) libraryDeletedTrap = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16) + (0,4)).setObjects(("SNIA-SML-MIB", "storageLibrary_Name")) libraryOpStatusChangedTrap = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16) + (0,5)).setObjects(("SNIA-SML-MIB", "storageLibrary_Name"), ("SNIA-SML-MIB", "currentOperationalStatus"), ("SNIA-SML-MIB", "oldOperationalStatus")) driveAddedTrap = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16) + (0,6)).setObjects(("SNIA-SML-MIB", "storageLibrary_Name"), ("SNIA-SML-MIB", "mediaAccessDevice_DeviceID")) driveDeletedTrap = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16) + (0,7)).setObjects(("SNIA-SML-MIB", "storageLibrary_Name"), ("SNIA-SML-MIB", "mediaAccessDevice_DeviceID")) driveOpStatusChangedTrap = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16) + (0,8)).setObjects(("SNIA-SML-MIB", "storageLibrary_Name"), ("SNIA-SML-MIB", "mediaAccessDevice_DeviceID"), ("SNIA-SML-MIB", "currentOperationalStatus"), ("SNIA-SML-MIB", "oldOperationalStatus")) changerAddedTrap = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16) + (0,9)).setObjects(("SNIA-SML-MIB", "storageLibrary_Name"), ("SNIA-SML-MIB", "changerDevice_DeviceID")) changerDeletedTrap = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16) + (0,10)).setObjects(("SNIA-SML-MIB", "storageLibrary_Name"), ("SNIA-SML-MIB", "changerDevice_DeviceID")) changerOpStatusChangedTrap = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16) + (0,11)).setObjects(("SNIA-SML-MIB", "storageLibrary_Name"), ("SNIA-SML-MIB", "changerDevice_DeviceID"), ("SNIA-SML-MIB", "currentOperationalStatus"), ("SNIA-SML-MIB", "oldOperationalStatus")) physicalMediaAddedTrap = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16) + (0,12)).setObjects(("SNIA-SML-MIB", "storageMediaLocation_PhysicalMedia_Tag")) physicalMediaDeletedTrap = NotificationType((1, 3, 6, 1, 4, 1, 14851, 3, 1, 16) + (0,13)).setObjects(("SNIA-SML-MIB", "storageMediaLocation_PhysicalMedia_Tag")) endOfSmlMib = MibScalar((1, 3, 6, 1, 4, 1, 14851, 3, 1, 17), ObjectIdentifier()) if mibBuilder.loadTexts: endOfSmlMib.setStatus('mandatory') mibBuilder.exportSymbols("SNIA-SML-MIB", storageMediaLocation_PhysicalMedia_CleanerMedia=storageMediaLocation_PhysicalMedia_CleanerMedia, scsiProtocolController_ElementName=scsiProtocolController_ElementName, smlCimVersion=smlCimVersion, product_ElementName=product_ElementName, physicalPackageIndex=physicalPackageIndex, trapDestinationPort=trapDestinationPort, trap_Association_ChangerDeviceIndex=trap_Association_ChangerDeviceIndex, storageLibrary_Caption=storageLibrary_Caption, experimental=experimental, numberOfSoftwareElements=numberOfSoftwareElements, changerDevice_Realizes_StorageLocationIndex=changerDevice_Realizes_StorageLocationIndex, storageMediaLocation_PhysicalMedia_DualSided=storageMediaLocation_PhysicalMedia_DualSided, storageMediaLocation_MediaCapacity=storageMediaLocation_MediaCapacity, subChassis_Manufacturer=subChassis_Manufacturer, chassis_SecurityBreach=chassis_SecurityBreach, scsiProtocolController_DeviceID=scsiProtocolController_DeviceID, mediaAccessDevice_DeviceID=mediaAccessDevice_DeviceID, storageMediaLocation_Association_ChangerDeviceIndex=storageMediaLocation_Association_ChangerDeviceIndex, driveAddedTrap=driveAddedTrap, subChassisIndex=subChassisIndex, subChassis_OperationalStatus=subChassis_OperationalStatus, mediaAccessDevice_MountCount=mediaAccessDevice_MountCount, storageMediaLocationEntry=storageMediaLocationEntry, product_Version=product_Version, mediaAccessDeviceGroup=mediaAccessDeviceGroup, scsiProtocolController_Realizes_MediaAccessDeviceIndex=scsiProtocolController_Realizes_MediaAccessDeviceIndex, trapDestinationHostType=trapDestinationHostType, softwareElementGroup=softwareElementGroup, limitedAccessPort_Extended=limitedAccessPort_Extended, softwareElement_Version=softwareElement_Version, driveOpStatusChangedTrap=driveOpStatusChangedTrap, CimDateTime=CimDateTime, smlMibVersion=smlMibVersion, physicalPackage_Model=physicalPackage_Model, mediaAccessDevice_Realizes_softwareElementIndex=mediaAccessDevice_Realizes_softwareElementIndex, changerDevice_Caption=changerDevice_Caption, scsiProtocolController_Description=scsiProtocolController_Description, mediaAccessDevice_PowerOnHours=mediaAccessDevice_PowerOnHours, libraryOpStatusChangedTrap=libraryOpStatusChangedTrap, physicalMediaAddedTrap=physicalMediaAddedTrap, changerDevice_Availability=changerDevice_Availability, trapGroup=trapGroup, fCPortGroup=fCPortGroup, changerDevice_Description=changerDevice_Description, subChassisEntry=subChassisEntry, fCPortIndex=fCPortIndex, storageMediaLocation_PhysicalMedia_Replaceable=storageMediaLocation_PhysicalMedia_Replaceable, subChassis_SecurityBreach=subChassis_SecurityBreach, storageLibrary_Name=storageLibrary_Name, numberOfSCSIProtocolControllers=numberOfSCSIProtocolControllers, storageLibraryGroup=storageLibraryGroup, computerSystem_OperationalStatus=computerSystem_OperationalStatus, storageMediaLocation_PhysicalMedia_Capacity=storageMediaLocation_PhysicalMedia_Capacity, driveAlert=driveAlert, limitedAccessPort_Realizes_StorageLocationIndex=limitedAccessPort_Realizes_StorageLocationIndex, storageMediaLocation_PhysicalMedia_MediaDescription=storageMediaLocation_PhysicalMedia_MediaDescription, changerDeviceIndex=changerDeviceIndex, numberOfTrapDestinations=numberOfTrapDestinations, limitedAccessPort_ElementName=limitedAccessPort_ElementName, numberOffCPorts=numberOffCPorts, scsiProtocolControllerEntry=scsiProtocolControllerEntry, chassis_IsLocked=chassis_IsLocked, numberOfMediaAccessDevices=numberOfMediaAccessDevices, scsiProtocolController_OperationalStatus=scsiProtocolController_OperationalStatus, changerAddedTrap=changerAddedTrap, trapDriveAlertSummary=trapDriveAlertSummary, trapDestinationHostAddr=trapDestinationHostAddr, physicalPackageGroup=physicalPackageGroup, softwareElementEntry=softwareElementEntry, trapPerceivedSeverity=trapPerceivedSeverity, trapsEnabled=trapsEnabled, UShortReal=UShortReal, fCPort_Caption=fCPort_Caption, subChassis_Model=subChassis_Model, scsiProtocolController_Realizes_ChangerDeviceIndex=scsiProtocolController_Realizes_ChangerDeviceIndex, computerSystem_Caption=computerSystem_Caption, product_IdentifyingNumber=product_IdentifyingNumber, mediaAccessDevice_TotalPowerOnHours=mediaAccessDevice_TotalPowerOnHours, storageMediaLocation_LocationType=storageMediaLocation_LocationType, limitedAccessPortEntry=limitedAccessPortEntry, computerSystem_Name=computerSystem_Name, numberOflimitedAccessPorts=numberOflimitedAccessPorts, numberOfPhysicalPackages=numberOfPhysicalPackages, limitedAccessPort_Description=limitedAccessPort_Description, storageMediaLocation_PhysicalMedia_Removable=storageMediaLocation_PhysicalMedia_Removable, computerSystem_PrimaryOwnerContact=computerSystem_PrimaryOwnerContact, storageMediaLocation_PhysicalMedia_PhysicalLabel=storageMediaLocation_PhysicalMedia_PhysicalLabel, limitedAccessPort_Caption=limitedAccessPort_Caption, productGroup=productGroup, fCPort_PermanentAddress=fCPort_PermanentAddress, libraryAddedTrap=libraryAddedTrap, computerSystem_NameFormat=computerSystem_NameFormat, smlRoot=smlRoot, oldOperationalStatus=oldOperationalStatus, libraries=libraries, mediaAccessDeviceEntry=mediaAccessDeviceEntry, softwareElement_InstanceID=softwareElement_InstanceID, UINT64=UINT64, mediaAccessDeviceIndex=mediaAccessDeviceIndex, storageLibrary_Description=storageLibrary_Description, numberOfPhysicalMedias=numberOfPhysicalMedias, changerDeviceGroup=changerDeviceGroup, changerAlert=changerAlert, mediaAccessDevice_Availability=mediaAccessDevice_Availability, storageMediaLocation_PhysicalMediaPresent=storageMediaLocation_PhysicalMediaPresent, fCPort_Description=fCPort_Description, softwareElement_CodeSet=softwareElement_CodeSet, storageMediaLocation_PhysicalMedia_HotSwappable=storageMediaLocation_PhysicalMedia_HotSwappable, fCPort_Realizes_scsiProtocolControllerIndex=fCPort_Realizes_scsiProtocolControllerIndex, softwareElement_Manufacturer=softwareElement_Manufacturer, changerDeviceEntry=changerDeviceEntry, mediaAccessDevice_Realizes_StorageLocationIndex=mediaAccessDevice_Realizes_StorageLocationIndex, scsiProtocolControllerIndex=scsiProtocolControllerIndex, driveDeletedTrap=driveDeletedTrap, storageMediaLocationGroup=storageMediaLocationGroup, softwareElement_IdentificationCode=softwareElement_IdentificationCode, chassis_ElementName=chassis_ElementName, computerSystemGroup=computerSystemGroup, storageMediaLocationTable=storageMediaLocationTable, subChassis_LockPresent=subChassis_LockPresent, subChassis_IsLocked=subChassis_IsLocked, numberOfStorageMediaLocations=numberOfStorageMediaLocations, trap_Association_MediaAccessDeviceIndex=trap_Association_MediaAccessDeviceIndex, fCPort_ElementName=fCPort_ElementName, UINT32=UINT32, trapChangerAlertSummary=trapChangerAlertSummary, storageMediaLocation_PhysicalMedia_Tag=storageMediaLocation_PhysicalMedia_Tag, endOfSmlMib=endOfSmlMib, softwareElementTable=softwareElementTable, numberOfChangerDevices=numberOfChangerDevices, changerDevice_DeviceID=changerDevice_DeviceID, mediaAccessDevice_Name=mediaAccessDevice_Name, softwareElement_SoftwareElementID=softwareElement_SoftwareElementID, mediaAccessDevice_Status=mediaAccessDevice_Status, limitedAccessPortIndex=limitedAccessPortIndex, product_Name=product_Name, storageLibrary_InstallDate=storageLibrary_InstallDate, subChassis_ElementName=subChassis_ElementName, mediaAccessDevice_OperationalStatus=mediaAccessDevice_OperationalStatus, storageMediaLocation_MediaTypesSupported=storageMediaLocation_MediaTypesSupported, mediaAccessDeviceObjectType=mediaAccessDeviceObjectType, mediaAccessDevice_NeedsCleaning=mediaAccessDevice_NeedsCleaning, physicalMediaDeletedTrap=physicalMediaDeletedTrap, chassis_Manufacturer=chassis_Manufacturer, subChassis_Tag=subChassis_Tag, computerSystem_Dedicated=computerSystem_Dedicated, computerSystem_Description=computerSystem_Description, fCPortController_OperationalStatus=fCPortController_OperationalStatus, snia=snia, changerDevice_MediaFlipSupported=changerDevice_MediaFlipSupported, limitedAccessPortGroup=limitedAccessPortGroup, currentOperationalStatus=currentOperationalStatus, computerSystem_ElementName=computerSystem_ElementName, physicalPackage_Manufacturer=physicalPackage_Manufacturer, scsiProtocolControllerTable=scsiProtocolControllerTable, physicalPackage_SerialNumber=physicalPackage_SerialNumber, computerSystem_Realizes_softwareElementIndex=computerSystem_Realizes_softwareElementIndex, physicalPackage_Realizes_MediaAccessDeviceIndex=physicalPackage_Realizes_MediaAccessDeviceIndex, chassis_LockPresent=chassis_LockPresent, softwareElement_LanguageEdition=softwareElement_LanguageEdition, trapObjects=trapObjects, subChassisTable=subChassisTable, softwareElement_Name=softwareElement_Name, changerDevice_ElementName=changerDevice_ElementName, fCPortTable=fCPortTable, mediaAccessDeviceTable=mediaAccessDeviceTable, softwareElement_SerialNumber=softwareElement_SerialNumber, fCPortEntry=fCPortEntry, storageMediaLocationIndex=storageMediaLocationIndex, physicalPackageEntry=physicalPackageEntry, softwareElement_BuildNumber=softwareElement_BuildNumber, subChassis_SerialNumber=subChassis_SerialNumber, changerDeviceTable=changerDeviceTable, libraryDeletedTrap=libraryDeletedTrap, chassis_Model=chassis_Model, trapDestinationEntry=trapDestinationEntry, scsiProtocolController_Availability=scsiProtocolController_Availability, changerDevice_OperationalStatus=changerDevice_OperationalStatus, changerDeletedTrap=changerDeletedTrap, limitedAccessPort_DeviceID=limitedAccessPort_DeviceID, trapDestinationTable=trapDestinationTable, numberOfsubChassis=numberOfsubChassis, storageMediaLocation_PhysicalMedia_MediaType=storageMediaLocation_PhysicalMedia_MediaType, chassis_Tag=chassis_Tag, scsiProtocolControllerGroup=scsiProtocolControllerGroup, fCPort_DeviceID=fCPort_DeviceID, chassisGroup=chassisGroup, physicalPackage_Tag=physicalPackage_Tag, limitedAccessPortTable=limitedAccessPortTable, computerSystem_PrimaryOwnerName=computerSystem_PrimaryOwnerName, subChassis_PackageType=subChassis_PackageType, UINT16=UINT16, product_Vendor=product_Vendor, chassis_SerialNumber=chassis_SerialNumber, changerOpStatusChangedTrap=changerOpStatusChangedTrap, softwareElementIndex=softwareElementIndex, storageLibrary_Status=storageLibrary_Status, storageMediaLocation_LocationCoordinates=storageMediaLocation_LocationCoordinates, storageMediaLocation_Tag=storageMediaLocation_Tag, physicalPackageTable=physicalPackageTable, common=common)
''' Faça um programa que leia nome e média de um aluno, guardando também a situação em um dicionário. No final, mostre o conteúdo da estrutura na tela. ''' # Fazer um dicionario para aluno aluno = dict() # Pedir nome e média do aluno aluno['nome'] = str(input('Nome: ')) aluno['média'] = float(input(f'Média de {aluno["nome"]}: ')) # Definir a situação do aluno em relação a média if aluno['média'] >= 7: aluno['situação'] = 'Aprovado' elif 5 <= aluno['média'] < 7: aluno['situação'] = 'Recuperação' else: aluno['situação'] = 'Reprovado' print('-=' * 30) # Fazer um for para imprimir na tela for k, v in aluno.items(): print(f'{k} é igual a {v}.')
class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: dic = {} for i in range(len(nums)): if dic.get(target - nums[i]) is not None: return [dic[target - nums[i]], i] dic[nums[i]] = i
""" LeetCode #561: https://leetcode.com/problems/array-partition-i/description/ """ class Solution(object): def arrayPairSum(self, nums): """ :type nums: List[int] :rtype: int """ return sum(sorted(nums)[::2])
#!/usr/bin/env python3 ARP = [ {'mac_addr': '0062.ec29.70fe', 'ip_addr': '10.220.88.1', 'interface': 'gi0/0/0'}, {'mac_addr': 'c89c.1dea.0eb6', 'ip_addr': '10.220.88.20', 'interface': 'gi0/0/0'}, {'mac_addr': 'a093.5141.b780', 'ip_addr': '10.220.88.22', 'interface': 'gi0/0/0'}, {'mac_addr': '0001.00ff.0001', 'ip_addr': '10.220.88.37', 'interface': 'gi0/0/0'}, {'mac_addr': '0002.00ff.0001', 'ip_addr': '10.220.88.38', 'interface': 'gi0/0/0'}, ] print(ARP) x = type(ARP) print(x) y = len(ARP) print(y)
#!/usr/bin/env python # encoding: utf-8 def run(whatweb, pluginname): whatweb.recog_from_file(pluginname, "Script/FocusSlide.js", "southidc") whatweb.recog_from_content(pluginname, "southidc") whatweb.recog_from_file(pluginname,"Script/Html.js", "southidc")
''' width search Explore all of the neighbors nodes at the present depth ''' three_d_array = [[[i for k in range(4)] for j in range(4)] for i in range(4)] sum = three_d_array[1][2][3] + three_d_array[2][3][1] + three_d_array[0][0][0] print(sum)
class MapperError(Exception): """Broken mapper configuration error.""" pass
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next """ 5 5 """ class Solution: def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: root = n = ListNode(0) carry = 0 sum = 0 # loop through, add num and track carry # while both pointers valid while l1 or l2 or carry > 0: if l1: sum += l1.val l1 = l1.next if l2: sum += l2.val l2 = l2.next n.next = ListNode((sum+carry) % 10) n = n.next carry = (sum+carry) // 10 sum = 0 return root.next
def txt_category_to_dict(category_str): """ Parameters ---------- category_str: str of nominal values from dataset meta information Returns ------- dict of the nominal values and their one letter encoding Example ------- "bell=b, convex=x" -> {"bell": "b", "convex": "x"} """ string_as_words = category_str.split() result_dict = {} for word in string_as_words: seperator_pos = word.find("=") key = word[: seperator_pos] val = word[seperator_pos + 1 :][0] result_dict[key] = val return result_dict def replace_comma_in_text(text): """ Parameters ---------- text: str of nominal values for a single mushroom species from primary_data_edited.csv Returns ------- replace commas outside of angular brackets with semicolons (but not inside of them) Example ------- text = "[a, b], [c, d]" return: "[a, b]; [c, d]" """ result_text = "" replace = True for sign in text: if sign == '[': replace = False if sign == ']': replace = True if sign == ',': if replace: result_text += ';' else: result_text += sign else: result_text += sign return result_text def generate_str_of_list_elements_with_indices(list_name, list_size): """ Parameters ---------- list_name: str, name of the list list_size: int, number of list elements Returns ------- str of list elements with angular bracket indexation separated with commas Example ------- list_name = "l" list_size = 3 return = "l[0], l[1], l[2]" """ result_str = "" for i in range(0, list_size): result_str += list_name + "[" + str(i) + "], " return result_str[: -2] # checks if a str is a number that could be interpreted as a float def is_number(val): """ Parameters ---------- val: str, arbitrary input Returns ------- bool, True if val is interpretable as a float and False else """ try: float(val) return True except ValueError: return False if __name__ == "__main__": print(txt_category_to_dict("cobwebby=c, evanescent=e, flaring=r, grooved=g"))
""" Web fragments. """ __version__ = '0.3.2' default_app_config = 'web_fragments.apps.WebFragmentsConfig' # pylint: disable=invalid-name
def f(x): print('a') y = x print('b') while y > 0: print('c') y -= 1 print('d') yield y print('e') print('f') return None for val in f(3): print(val) #gen = f(3) #print(gen) #print(gen.__next__()) #print(gen.__next__()) #print(gen.__next__()) #print(gen.__next__()) # test printing, but only the first chars that match CPython print(repr(f(0))[0:17]) print("PASS")
file = open("test/TopCompiler/"+input("filename: "), mode= "w") sizeOfFunc = input("size of func: ") lines = input("lines of code: ") out = [] for i in range(int(int(lines) / int(sizeOfFunc)+2)): out.append("def func"+str(i)+"() =\n") for c in range(int(sizeOfFunc)): out.append(' println "hello world" \n') file.write("".join(out)) file.close()
#! /usr/bin/env python3 ''' Disjoint Set Class that provides basic functionality. Implemented according the functionality provided here: https://en.wikipedia.org/wiki/Disjoint-set_data_structure @author: Paul Miller (github.com/138paulmiller) ''' class DisjointSet: ''' Disjoint Set : Utility class that helps implement Kruskal MST algorithm Allows to check whether to keys belong to the same set and to union sets together ''' class Element: def __init__(self, key): self.key = key self.parent = self self.rank = 0 def __eq__(self, other): return self.key == other.key def __ne__(self, other): return self.key != other.key def __init__(self): ''' Tree = element map where each node is a (key, parent, rank) Sets are represented as subtrees whose root is identified with a self referential parent ''' self.tree = {} def make_set(self, key): ''' Creates a new singleton set. @params key : id of the element @return None ''' # Create and add a new element to the tree e = self.Element(key) if not key in self.tree.keys(): self.tree[key] = e def find(self, key): ''' Finds a given element in the tree by the key. @params key(hashable) : id of the element @return Element : root of the set which contains element with the key ''' if key in self.tree.keys(): element = self.tree[key] # root is element with itself as parent # if not root continue if element.parent != element: element.parent = self.find(element.parent.key) return element.parent def union(self, element_a, element_b): ''' Creates a new set that contains all elements in both element_a and element_b's sets Pass into union the Elements returned by the find operation @params element_a(Element) : Element or key of set a element_b(Element) : Element of set b @return None ''' root_a = self.find(element_a.key) root_b = self.find(element_b.key) # if not in the same subtree (set) if root_a != root_b: #merge the sets if root_a.rank < root_b.rank: root_a.parent = root_b elif root_a.rank > root_b.rank: root_b.parent = root_a else: # same rank, set and increment arbitrary root as parent root_b.parent = root_a root_a.rank+=1
#!/usr/bin/python #coding=utf-8 ''' @author: sheng @license: ''' SPELL=u'dàdūn' CN=u'大敦' NAME=u'dadun41' CHANNEL='liver' CHANNEL_FULLNAME='LiverChannelofFoot-Jueyin' SEQ='LR1' if __name__ == '__main__': pass
frase = input("Digite uma frase: ").strip().upper() frase = frase.replace(" ","") inverso = frase[::-1] print(f"O inverso de {frase} é {inverso}") if (frase == inverso): print("A frase digitada é um palíndromo!") else: print("A frase digitada não é um palíndromo!")
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under the GNU Public Licence, v2 or any higher version # # Please cite your use of MDAnalysis in published work: # # R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, # D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. # MDAnalysis: A Python package for the rapid analysis of molecular dynamics # simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th # Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. # doi: 10.25080/majora-629e541a-00e # # N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # """ :mod:`MDAnalysis.analysis` --- Analysis code based on MDAnalysis ================================================================ The :mod:`MDAnalysis.analysis` sub-package contains various recipes and algorithms that can be used to analyze MD trajectories. If you use them please check if the documentation mentions any specific caveats and also if there are any published papers associated with these algorithms. Available analysis modules -------------------------- :mod:`~MDAnalysis.analysis.align` Fitting and aligning of coordinate frames, including the option to use a sequence alignment to define equivalent atoms to fit on. :mod:`~MDAnalysis.analysis.contacts` Analyse the number of native contacts relative to a reference state, also known as a "q1-q2" analysis. :mod:`~MDAnalysis.analysis.density` Creating and manipulating densities such as the density ow water molecules around a protein. Makes use of the external GridDataFormats_ package. :mod:`~MDAnalysis.analysis.distances` Functions to calculate distances between atoms and selections; it contains the often-used :func:`~MDAnalysis.analysis.distances.distance_array` function. :mod:`~MDAnalysis.analysis.hbonds` Analyze hydrogen bonds, including both the per frame results as well as the dynamic properties and lifetimes. :mod:`~MDAnalysis.analysis.helanal` Analysis of helices with the HELANAL_ algorithm. :mod:`~MDAnalysis.analysis.hole` Run and process output from the :program:`HOLE` program to analyze pores, tunnels and cavities in proteins. :mod:`~MDAnalysis.analysis.gnm` Gaussian normal mode analysis of MD trajectories with the help of an elastic network. :mod:`~MDAnalysis.analysis.leaflet` Find lipids in the upper and lower (or inner and outer) leaflet of a bilayer; the algorithm can deal with any deformations as long as the two leaflets are topologically distinct. :mod:`~MDAnalysis.analysis.nuclinfo` Analyse the nucleic acid for the backbone dihedrals, chi, sugar pucker, and Watson-Crick distance (minor and major groove distances). :mod:`~MDAnalysis.analysis.psa` Perform Path Similarity Analysis (PSA) on a set of trajectories to measure their mutual similarities, including the ability to perform hierarchical clustering and generate heat map-dendrogram plots. :mod:`~MDAnalysis.analysis.rdf` Calculation of pair distribution functions :mod:`~MDAnalysis.analysis.rms` Calculation of RMSD and RMSF. :mod:`~MDAnalysis.analysis.waterdynamics` Analysis of water. :mod:`~MDAnalysis.analysis.legacy.x3dna` Analysis of helicoidal parameters driven by X3DNA_. (Note that this module is not fully supported any more and needs to be explicitly imported from :mod:`MDAnalysis.analysis.legacy`.) .. _GridDataFormats: https://github.com/orbeckst/GridDataFormats .. _HELANAL: http://www.ccrnp.ncifcrf.gov/users/kumarsan/HELANAL/helanal.html .. _X3DNA: http://x3dna.org/ .. versionchanged:: 0.10.0 The analysis submodules are not automatically imported any more. Manually import any submodule that you need. .. versionchanged:: 0.16.0 :mod:`~MDAnalysis.analysis.legacy.x3dna` was moved to the :mod:`MDAnalysis.analysis.legacy` package """ __all__ = [ 'align', 'base', 'contacts', 'density', 'distances', 'gnm', 'hbonds', 'hydrogenbonds', 'helanal', 'hole', 'leaflet', 'nuclinfo', 'polymer', 'psa', 'rdf', 'rdf_s', 'rms', 'waterdynamics', ]
#!/usr/bin/python # https://code.google.com/codejam/contest/2933486/dashboard # application of insertion sort N = int(input().strip()) for i in range(N): M = int(input().strip()) deck = [] count = 0 for j in range(M): deck.append(input().strip()) p = 0 for k in range(len(deck)): if k > 0 and deck[k] < deck[p]: count += 1 else: p = k print(f'Case #{i + 1}: {count}')
# escreva um programa que pergunte a quantidade de quilometros percorridos por um carro alugado e a quantidade # de dias pelos quais ele foia alugado. calcule o preço a pagar sabenco que o carro custa R$ 60,00 o dia # e R$ 0.15 por km rodado dias = int(input('Quabtos dias ficou com o carro? ')) km = float(input('Quantos quilometros rodados com o carro? ')) res = dias * 60 + km * 0.15 print('O valor a ser pago pelos dias é R$ {:.2f}'.format(res))
def sum(arr: list, start: int, end: int)->int: if start > end: return 0 elif start == end: return arr[start] else: midpoint: int = int(start + (end - start) / 2) return sum(arr, start, midpoint) + sum(arr, midpoint + 1, end) numbers1: list = [] numbers2: list = [1] numbers3: list = [1, 2, 3] print(sum(numbers1, 0, len(numbers1) - 1)) print(sum(numbers2, 0, len(numbers2) - 1)) print(sum(numbers3, 0, len(numbers3) - 1))
class Car: def __init__(self, pMake, pModel, pColor, pPrice): self.make = pMake self.model = pModel self.color = pColor self.price = pPrice def __str__(self): return 'Make = %s, Model = %s, Color = %s, Price = %s' %(self.make, self.model, self.color, self.price) def selecColor(self): self.color = input('What is the new color? ') def calculateTax(self): priceWithTax = 1.1*self.price return priceWithTax myFirstCar = Car(pMake = 'Honda', pModel = 'Civic', pColor = 'White', pPrice = '15000') print(myFirstCar) # changing the price from 15000 to 18000 myFirstCar.price = 18000 print(myFirstCar) myFirstCar.color = 'Orange' print(myFirstCar) finalPrice = myFirstCar.calculateTax() print('The final price is $%s' %(finalPrice))
class SimpleTreeNode: def __init__(self, val, left=None, right=None) -> None: self.val = val self.left = left self.right = right class AdvanceTreeNode: def __init__(self, val, parent=None, left=None, right=None) -> None: self.val = val self.parent: AdvanceTreeNode = parent self.left: AdvanceTreeNode = left self.right: AdvanceTreeNode = right class SingleListNode: def __init__(self, val, next=None) -> None: self.val = val self.next = next class DoubleListNode: def __init__(self, val, next=None, prev=None) -> None: self.val = val self.next = next self.prev = prev
# # PySNMP MIB module CISCO-OPTICAL-MONITOR-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-OPTICAL-MONITOR-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:08:51 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance") Unsigned32, Bits, ObjectIdentity, MibIdentifier, ModuleIdentity, TimeTicks, Counter32, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, iso, Gauge32, Integer32, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Bits", "ObjectIdentity", "MibIdentifier", "ModuleIdentity", "TimeTicks", "Counter32", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "iso", "Gauge32", "Integer32", "Counter64") TextualConvention, TimeStamp, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "TimeStamp", "DisplayString") ciscoOpticalMonitorMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 264)) ciscoOpticalMonitorMIB.setRevisions(('2007-01-02 00:00', '2002-05-10 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoOpticalMonitorMIB.setRevisionsDescriptions(('Add cOpticalMonIfTimeGroup, cOpticalMIBEnableConfigGroup, cOpticalMIBIntervalConfigGroup, cOpticalMonThreshSourceGroup.', 'The initial revision of this MIB.',)) if mibBuilder.loadTexts: ciscoOpticalMonitorMIB.setLastUpdated('200701020000Z') if mibBuilder.loadTexts: ciscoOpticalMonitorMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoOpticalMonitorMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 Tel: +1 800 553-NETS E-mail: [email protected]') if mibBuilder.loadTexts: ciscoOpticalMonitorMIB.setDescription('This MIB module defines objects to monitor optical characteristics and set corresponding thresholds on the optical interfaces in a network element. ') class OpticalParameterType(TextualConvention, Integer32): description = 'This value indicates the optical parameter that is being monitored. Valid values are - power (1) : Optical Power (AC + DC) in 1/10ths of dBm acPower (2) : Optical AC Power in 1/10ths of dBm ambientTemp (3) : Ambient Temperature in 1/10ths of degrees centigrade laserTemp (4) : Laser Temperature in 1/10ths of degrees centigrade biasCurrent (5) : Laser bias current in 100s of microamperes peltierCurrent (6) : Laser peltier current in milliamperes xcvrVoltage (7) : Transceiver voltage in millivolts ' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7)) namedValues = NamedValues(("power", 1), ("acPower", 2), ("ambientTemp", 3), ("laserTemp", 4), ("biasCurrent", 5), ("peltierCurrent", 6), ("xcvrVoltage", 7)) class OpticalParameterValue(TextualConvention, Integer32): description = "The value of the optical parameter that is being monitored. The range of values varies depending on the type of optical parameter being monitored, as identified by a corresponding object with syntax OpticalParameterType. When the optical parameter being monitored is 'power' or 'acPower', the supported range is from -400 to 250, in 1/10ths of dBm. Example: A value of -300 represents a power level of -30.0 dBm. When the optical parameter being monitored is 'laserTemp' or 'ambientTemp', the supported range is from -500 to 850, in 1/10ths of degrees centigrade. Example: A value of 235 represents a temperature reading of 23.5 degrees C. When the optical parameter being monitored is 'biasCurrent', the supported range is from 0 to 10000, in 100s of microamperes. Example: A value of 500 represents a bias current reading of 50,000 microamperes. When the optical parameter being monitored is 'peltierCurrent', the supported range is from -10000 to 10000, in milliamperes. When the optical parameter being monitored is 'xcvrVoltage', the supported range is from 0 to 10000, in millivolts. The distinguished value of '-1000000' indicates that the object has not yet been initialized or does not apply. " status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(-1000000, 1000000) class OpticalIfDirection(TextualConvention, Integer32): description = 'This value indicates the direction being monitored at the optical interface. ' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("receive", 1), ("transmit", 2), ("notApplicable", 3)) class OpticalIfMonLocation(TextualConvention, Integer32): description = "This value applies when there are multiple points at which optical characteristics can be measured, in the given direction, at an interface. It indicates whether the optical characteristics are measured before or after adjustment (e.g. optical amplification or attenuation). The codepoint 'notApplicable' should be used if no amplifier/attenuator exists at an interface. " status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("beforeAdjustment", 1), ("afterAdjustment", 2), ("notApplicable", 3)) class OpticalAlarmStatus(TextualConvention, OctetString): reference = 'Telcordia Technologies Generic Requirements GR-2918-CORE, Issue 4, December 1999, Section 8.11' description = 'A bitmap that indicates the current status of thresholds on an interface. The bit is set to 1 if the threshold is currently being exceeded on the interface and will be set to 0 otherwise. (MSB) (LSB) 7 6 5 4 3 2 1 0 +----------------------+ | | +----------------------+ | | | | | | | +-- High alarm threshold | | +----- High warning threshold | +-------- Low alarm threshold +----------- Low warning threshold To minimize the probability of prematurely reacting to momentary signal variations, a soak time may be incorporated into the status indications in the following manner. The indication is set when the threshold violation persists for a period of time that exceeds the set soak interval. The indication is cleared when no threshold violation occurs for a period of time which exceeds the clear soak interval. In GR-2918-CORE, the recommended set soak interval is 2.5 seconds (plus/minus 0.5 seconds), and the recommended clear soak interval is 10 seconds (plus/minus 0.5 seconds). ' status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(1, 1) fixedLength = 1 class OpticalAlarmSeverity(TextualConvention, Integer32): reference = 'Telcordia Technologies Generic Requirements GR-474-CORE, Issue 1, December 1997, Section 2.2' description = "The severity of a trouble condition. A smaller enumerated integer value indicates that the condition is more severe. The severities are defined as follows: 'critical' An alarm used to indicate a severe, service-affecting condition has occurred and that immediate corrective action is imperative, regardless of the time of day or day of the week. 'major' An alarm used for hardware or software conditions that indicate a serious disruption of service or malfunctioning or failure of important hardware. These troubles require the immediate attention and response of a technician to restore or maintain system capability. The urgency is less than in critical situations because of a lesser immediate or impending effect on service or system performance. 'minor' An alarm used for troubles that do not have a serious effect on service to customers or for troubles in hardware that are not essential to the operation of the system. 'notAlarmed' An event used for troubles that do not require action, for troubles that are reported as a result of manually initiated diagnostics, or for transient events such as crossing warning thresholds. This event can also be used to raise attention to a condition that could possibly be an impending problem. 'notReported' An event used for troubles similar to those described under 'notAlarmed', and that do not cause notifications to be generated. The information for these events is retrievable from the network element. 'cleared' This value indicates that a previously occuring alarm condition has been cleared, or that no trouble condition is present. " status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6)) namedValues = NamedValues(("critical", 1), ("major", 2), ("minor", 3), ("notAlarmed", 4), ("notReported", 5), ("cleared", 6)) class OpticalAlarmSeverityOrZero(TextualConvention, Integer32): description = "A value of either '0' or a valid optical alarm severity." status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 6) class OpticalPMPeriod(TextualConvention, Integer32): description = 'This value indicates the time period over which performance monitoring data has been collected.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("fifteenMin", 1), ("twentyFourHour", 2)) cOpticalMonitorMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 264, 1)) cOpticalMonGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1)) cOpticalPMGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2)) cOpticalMonTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1), ) if mibBuilder.loadTexts: cOpticalMonTable.setStatus('current') if mibBuilder.loadTexts: cOpticalMonTable.setDescription('This table provides objects to monitor optical parameters in a network element. It also provides objects for setting high and low threshold levels, with configurable severities, on these monitored parameters.') cOpticalMonEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalMonDirection"), (0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalMonLocation"), (0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalMonParameterType")) if mibBuilder.loadTexts: cOpticalMonEntry.setStatus('current') if mibBuilder.loadTexts: cOpticalMonEntry.setDescription('An entry in the cOpticalMonTable provides objects to monitor an optical parameter and set threshold levels on that parameter, at an optical interface. Note that the set of monitored optical parameters may vary based on interface type, direction, and monitoring location. Examples of interfaces that can have an entry in this table include optical transceivers, interfaces before and after optical amplifiers, and interfaces before and after optical attenuators.') cOpticalMonDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 1), OpticalIfDirection()) if mibBuilder.loadTexts: cOpticalMonDirection.setStatus('current') if mibBuilder.loadTexts: cOpticalMonDirection.setDescription('This object indicates the direction monitored for the optical interface, in this entry.') cOpticalMonLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 2), OpticalIfMonLocation()) if mibBuilder.loadTexts: cOpticalMonLocation.setStatus('current') if mibBuilder.loadTexts: cOpticalMonLocation.setDescription('This object indicates whether the optical characteristics are measured before or after adjustment (e.g. optical amplification or attenuation), at this interface.') cOpticalMonParameterType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 3), OpticalParameterType()) if mibBuilder.loadTexts: cOpticalMonParameterType.setStatus('current') if mibBuilder.loadTexts: cOpticalMonParameterType.setDescription('This object specifies the optical parameter that is being monitored in this entry.') cOpticalParameterValue = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 4), OpticalParameterValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalParameterValue.setStatus('current') if mibBuilder.loadTexts: cOpticalParameterValue.setDescription('This object gives the value measured for the particular optical parameter specified by the cOpticalMonParameterType object.') cOpticalParamHighAlarmThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 5), OpticalParameterValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalParamHighAlarmThresh.setStatus('current') if mibBuilder.loadTexts: cOpticalParamHighAlarmThresh.setDescription("This object is used to set a high alarm threshold on the optical parameter being monitored. An alarm condition will be raised if the value given by cOpticalParameterValue goes from below the value configured in this object to above the value configured in this object, or if the initial value of cOpticalParameterValue exceeds the value configured in this object. For network elements that incorporate a soak time in the status indications, this alarm will be indicated in the cOpticalParamAlarmStatus object only after it persists for a period of time that equals the set soak interval. The severity level of the alarm is specified by the cOpticalParamHighAlarmSev object. When the cOpticalMonParameterType object is set to 'power' for the receive direction at a transceiver, this object specifies the receiver saturation level.") cOpticalParamHighAlarmSev = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 6), OpticalAlarmSeverity()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalParamHighAlarmSev.setStatus('current') if mibBuilder.loadTexts: cOpticalParamHighAlarmSev.setDescription("This object is used to specify a severity level associated with the high alarm threshold given by the cOpticalParamHighAlarmThresh object. The values 'notAlarmed', 'notReported', and 'cleared' do not apply. The severity level configured in this object must be higher than the level configured in the cOpticalParamHighWarningSev object.") cOpticalParamHighWarningThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 7), OpticalParameterValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalParamHighWarningThresh.setStatus('current') if mibBuilder.loadTexts: cOpticalParamHighWarningThresh.setDescription('This object is used to set a high warning threshold on the optical parameter being monitored. A threshold crossing condition will be indicated if the value given by cOpticalParameterValue goes from below the value configured in this object to above the value configured in this object, or if the initial value of cOpticalParameterValue exceeds the value configured in this object. For network elements that incorporate a soak time in the status indications, this threshold violation will be indicated in the cOpticalParamAlarmStatus object only after it persists for a period of time that equals the set soak interval. This threshold crossing may or may not be alarmed or reported, based on the severity level specified by the cOpticalParamHighWarningSev object.') cOpticalParamHighWarningSev = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 8), OpticalAlarmSeverity()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalParamHighWarningSev.setStatus('current') if mibBuilder.loadTexts: cOpticalParamHighWarningSev.setDescription("This object is used to specify a severity level associated with the high warning threshold given by the cOpticalParamHighWarningThresh object. The values 'critical', 'major', and 'cleared' do not apply. The severity level configured in this object must be lower than the level configured in the cOpticalParamHighAlarmSev object. If this object is set to 'notReported', no notifications will be generated when this threshold is exceeded, irrespective of the value configured in the cOpticalNotifyEnable object.") cOpticalParamLowAlarmThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 9), OpticalParameterValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalParamLowAlarmThresh.setStatus('current') if mibBuilder.loadTexts: cOpticalParamLowAlarmThresh.setDescription("This object is used to set a low alarm threshold on the optical parameter being monitored. An alarm condition will be raised if the value given by cOpticalParameterValue goes from above the value configured in this object to below the value configured in this object, or if the initial value of cOpticalParameterValue is lower than the value configured in this object. For network elements that incorporate a soak time in the status indications, this alarm will be indicated in the cOpticalParamAlarmStatus object only after it persists for a period of time that equals the set soak interval. The severity level of this alarm is specified by the cOpticalParamLowAlarmSev object. When the cOpticalMonParameterType object is set to 'power' for the receive direction and when the interface supports alarms based on loss of light, this object specifies the optical power threshold for declaring loss of light. Also, when optical amplifiers are present in the network, in the receive direction, this value may need to be configured, since the noise floor may be higher than the minimum sensitivity of the receiver.") cOpticalParamLowAlarmSev = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 10), OpticalAlarmSeverity()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalParamLowAlarmSev.setStatus('current') if mibBuilder.loadTexts: cOpticalParamLowAlarmSev.setDescription("This object is used to specify a severity level associated with the low alarm threshold given by the cOpticalParamLowAlarmThresh object. The values 'notAlarmed', 'notReported', and 'cleared' do not apply. The severity level configured in this object must be higher than the level configured in the cOpticalParamLowWarningSev object.") cOpticalParamLowWarningThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 11), OpticalParameterValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalParamLowWarningThresh.setStatus('current') if mibBuilder.loadTexts: cOpticalParamLowWarningThresh.setDescription('This object is used to set a low warning threshold on the optical parameter being monitored. A threshold crossing condition will be indicated if the value given by cOpticalParameterValue goes from above the value configured in this object to below the value configured in this object, or if the initial value of cOpticalParameterValue object is lower than the value configured in this object. For network elements that incorporate a soak time in the status indications, this threshold violation will be indicated in the cOpticalParamAlarmStatus object only after it persists for a period of time that equals the set soak interval. This threshold crossing may or may not be alarmed or reported, based on the severity level specified by the cOpticalParamLowWarningSev object.') cOpticalParamLowWarningSev = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 12), OpticalAlarmSeverity()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalParamLowWarningSev.setStatus('current') if mibBuilder.loadTexts: cOpticalParamLowWarningSev.setDescription("This object is used to specify a severity level associated with the low warning threshold given by the cOpticalParamLowWarningThresh object. The values 'critical', 'major', and 'cleared' do not apply. The severity level configured in this object must be lower than the level configured in the cOpticalParamLowAlarmSev object. If this object is set to 'notReported', no notifications will be generated when this threshold is exceeded, irrespective of the value configured in the cOpticalNotifyEnable object.") cOpticalParamAlarmStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 13), OpticalAlarmStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalParamAlarmStatus.setStatus('current') if mibBuilder.loadTexts: cOpticalParamAlarmStatus.setDescription('This object is used to indicate the current status of the thresholds for the monitored optical parameter on the interface. If a threshold is currently being exceeded on the interface, the corresponding bit in this object will be set to 1. Otherwise, the bit will be set to 0.') cOpticalParamAlarmCurMaxThresh = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 14), OpticalParameterValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalParamAlarmCurMaxThresh.setStatus('current') if mibBuilder.loadTexts: cOpticalParamAlarmCurMaxThresh.setDescription("This object indicates the threshold value of the highest severity threshold that is currently being exceeded on the interface, for the optical parameter. If no threshold value is currently being exceeded, then the value '-1000000' is returned.") cOpticalParamAlarmCurMaxSev = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 15), OpticalAlarmSeverity()).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalParamAlarmCurMaxSev.setStatus('current') if mibBuilder.loadTexts: cOpticalParamAlarmCurMaxSev.setDescription('This object indicates the maximum severity of any thresholds that are currently being exceeded on the interface, for the optical parameter.') cOpticalParamAlarmLastChange = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 16), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalParamAlarmLastChange.setStatus('current') if mibBuilder.loadTexts: cOpticalParamAlarmLastChange.setDescription('This object specifies the value of sysUpTime at the last time a threshold related to a particular optical parameter was exceeded or cleared on the interface.') cOpticalMon15MinValidIntervals = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 17), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalMon15MinValidIntervals.setStatus('current') if mibBuilder.loadTexts: cOpticalMon15MinValidIntervals.setDescription('This object gives the number of previous 15 minute intervals for which valid performance monitoring data has been stored on the interface. The value of this object will be n (where n is the maximum number of 15 minute intervals supported at this interface), unless the measurement was (re-)started within the last (nx15) minutes, in which case the value will be the number of previous 15 minute intervals for which the agent has some data.') cOpticalMon24HrValidIntervals = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 18), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalMon24HrValidIntervals.setStatus('current') if mibBuilder.loadTexts: cOpticalMon24HrValidIntervals.setDescription('This object gives the number of previous 24 hour intervals for which valid performance monitoring data has been stored on the interface. The value of this object will be 0 if the measurement was (re-)started within the last 24 hours, or 1 otherwise.') cOpticalParamThreshSource = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 1, 1, 19), Bits().clone(namedValues=NamedValues(("highAlarmDefThresh", 0), ("highWarnDefThresh", 1), ("lowAlarmDefThresh", 2), ("lowWarnDefThresh", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalParamThreshSource.setStatus('current') if mibBuilder.loadTexts: cOpticalParamThreshSource.setDescription("This object indicates if the current value of a particular threshold in this entry is user configured value or it is a system default value. It also allows user to specify the list of thresholds for this entry which should be restored to their system default values. The bit 'highAlarmThresh' corresponds to the object cOpticalParamHighAlarmThresh. The bit 'highWarnThresh' corresponds to the object cOpticalParamHighWarningThresh. The bit 'lowAlarmThresh' corresponds to the object cOpticalParamLowAlarmThresh. The bit 'lowWarnThresh' corresponds to the object cOpticalParamLowWarningThresh. A value of 0 for a bit indicates that corresponding object has system default value of threshold. A value of 1 for a bit indicates that corresponding object has user configured threshold value. A user may only change value of each of the bits to zero. Setting a bit to 0 will reset the corresponding threshold to its default value. System will change a bit from 0 to 1 when its corresponding threshold is changed by user from its default to any other value.") cOpticalNotifyEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 2), OpticalAlarmSeverityOrZero()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalNotifyEnable.setStatus('current') if mibBuilder.loadTexts: cOpticalNotifyEnable.setDescription("This object specifies the minimum severity threshold governing the generation of cOpticalMonParameterStatus notifications. For example, if the value of this object is set to 'major', then the agent generates these notifications if and only if the severity of the alarm being indicated is 'major' or 'critical'. The values of 'notReported', and 'cleared' do not apply. The value of '0' disables the generation of notifications.") cOpticalMonEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 3), Bits().clone(namedValues=NamedValues(("all", 0)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalMonEnable.setStatus('current') if mibBuilder.loadTexts: cOpticalMonEnable.setDescription("This object specifies the types of transceivers for which optical monitoring is enabled. A value of 1 for the bit 'all', specifies that optical monitoring functionality is enabled for all the types of transceivers which are supported by system and have optical monitoring capability.") cOpticalMonPollInterval = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 4), Unsigned32()).setUnits('minutes').setMaxAccess("readwrite") if mibBuilder.loadTexts: cOpticalMonPollInterval.setStatus('current') if mibBuilder.loadTexts: cOpticalMonPollInterval.setDescription('This object specifies the interval in minutes after which optical transceiver data will be polled by system repeatedly and updated in cOpticalMonTable when one or more bits in cOpticalMonEnable is set.') cOpticalMonIfTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 5), ) if mibBuilder.loadTexts: cOpticalMonIfTable.setStatus('current') if mibBuilder.loadTexts: cOpticalMonIfTable.setDescription('This table contains the list of optical interfaces populated in cOpticalMonTable.') cOpticalMonIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 5, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: cOpticalMonIfEntry.setStatus('current') if mibBuilder.loadTexts: cOpticalMonIfEntry.setDescription('An entry containing the information for a particular optical interface.') cOpticalMonIfTimeInSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 1, 5, 1, 1), Unsigned32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalMonIfTimeInSlot.setStatus('current') if mibBuilder.loadTexts: cOpticalMonIfTimeInSlot.setDescription('This object indicates when this optical transceiver was detected by the system.') cOpticalPMCurrentTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 1), ) if mibBuilder.loadTexts: cOpticalPMCurrentTable.setStatus('current') if mibBuilder.loadTexts: cOpticalPMCurrentTable.setDescription('This table contains performance monitoring data for the various optical parameters, collected over the current 15 minute or the current 24 hour interval.') cOpticalPMCurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 1, 1), ).setIndexNames((0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMCurrentPeriod"), (0, "IF-MIB", "ifIndex"), (0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMCurrentDirection"), (0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMCurrentLocation"), (0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMCurrentParamType")) if mibBuilder.loadTexts: cOpticalPMCurrentEntry.setStatus('current') if mibBuilder.loadTexts: cOpticalPMCurrentEntry.setDescription('An entry in the cOpticalPMCurrentTable. It contains performance monitoring data for a monitored optical parameter at an interface, collected over the current 15 minute or the current 24 hour interval. Note that the set of monitored optical parameters may vary based on interface type, direction, and monitoring location. Examples of interfaces that can have an entry in this table include optical transceivers, interfaces before and after optical amplifiers, and interfaces before and after optical attenuators.') cOpticalPMCurrentPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 1, 1, 1), OpticalPMPeriod()) if mibBuilder.loadTexts: cOpticalPMCurrentPeriod.setStatus('current') if mibBuilder.loadTexts: cOpticalPMCurrentPeriod.setDescription('This object indicates whether the optical parameter values given in this entry are collected over the current 15 minute or the current 24 hour interval.') cOpticalPMCurrentDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 1, 1, 2), OpticalIfDirection()) if mibBuilder.loadTexts: cOpticalPMCurrentDirection.setStatus('current') if mibBuilder.loadTexts: cOpticalPMCurrentDirection.setDescription('This object indicates the direction monitored for the optical interface, in this entry.') cOpticalPMCurrentLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 1, 1, 3), OpticalIfMonLocation()) if mibBuilder.loadTexts: cOpticalPMCurrentLocation.setStatus('current') if mibBuilder.loadTexts: cOpticalPMCurrentLocation.setDescription('This object indicates whether the optical characteristics are measured before or after adjustment (e.g. optical amplification or attenuation), at this interface.') cOpticalPMCurrentParamType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 1, 1, 4), OpticalParameterType()) if mibBuilder.loadTexts: cOpticalPMCurrentParamType.setStatus('current') if mibBuilder.loadTexts: cOpticalPMCurrentParamType.setDescription('This object specifies the optical parameter that is being monitored, in this entry.') cOpticalPMCurrentMaxParam = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 1, 1, 5), OpticalParameterValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalPMCurrentMaxParam.setStatus('current') if mibBuilder.loadTexts: cOpticalPMCurrentMaxParam.setDescription('This object gives the maximum value measured for the monitored optical parameter, in the current 15 minute or the current 24 hour interval.') cOpticalPMCurrentMinParam = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 1, 1, 6), OpticalParameterValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalPMCurrentMinParam.setStatus('current') if mibBuilder.loadTexts: cOpticalPMCurrentMinParam.setDescription('This object gives the minimum value measured for the monitored optical parameter, in the current 15 minute or the current 24 hour interval.') cOpticalPMCurrentMeanParam = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 1, 1, 7), OpticalParameterValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalPMCurrentMeanParam.setStatus('current') if mibBuilder.loadTexts: cOpticalPMCurrentMeanParam.setDescription('This object gives the average value of the monitored optical parameter, in the current 15 minute or the current 24 hour interval.') cOpticalPMCurrentUnavailSecs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 86400))).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalPMCurrentUnavailSecs.setStatus('current') if mibBuilder.loadTexts: cOpticalPMCurrentUnavailSecs.setDescription('This object is used to indicate the number of seconds, in the current 15 minute or the current 24 hour interval, for which the optical performance data is not accounted for. In the receive direction, the performance data could be unavailable during these periods for multiple reasons like the interface being administratively down or if there is a Loss of Light alarm on the interface. In the transmit direction, performance data could be unavailable when the laser is shutdown.') cOpticalPMIntervalTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 2), ) if mibBuilder.loadTexts: cOpticalPMIntervalTable.setStatus('current') if mibBuilder.loadTexts: cOpticalPMIntervalTable.setDescription('This table stores performance monitoring data for the various optical parameters, collected over previous intervals. This table can have entries for one complete 24 hour interval and up to 96 complete 15 minute intervals. A system is required to store at least 4 completed 15 minute intervals. The number of valid 15 minute intervals in this table is indicated by the cOpticalMon15MinValidIntervals object and the number of valid 24 hour intervals is indicated by the cOpticalMon24HrValidIntervals object.') cOpticalPMIntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 2, 1), ).setIndexNames((0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMIntervalPeriod"), (0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMIntervalNumber"), (0, "IF-MIB", "ifIndex"), (0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMIntervalDirection"), (0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMIntervalLocation"), (0, "CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMIntervalParamType")) if mibBuilder.loadTexts: cOpticalPMIntervalEntry.setStatus('current') if mibBuilder.loadTexts: cOpticalPMIntervalEntry.setDescription('An entry in the cOpticalPMIntervalTable. It contains performance monitoring data for an optical parameter, collected over a previous interval. Note that the set of monitored optical parameters may vary based on interface type, direction, and monitoring location. Examples of interfaces that can have an entry in this table include optical transceivers, interfaces before and after optical amplifiers, and interfaces before and after optical attenuators.') cOpticalPMIntervalPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 2, 1, 1), OpticalPMPeriod()) if mibBuilder.loadTexts: cOpticalPMIntervalPeriod.setStatus('current') if mibBuilder.loadTexts: cOpticalPMIntervalPeriod.setDescription('This object indicates whether the optical parameter values, given in this entry, are collected over a period of 15 minutes or 24 hours.') cOpticalPMIntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))) if mibBuilder.loadTexts: cOpticalPMIntervalNumber.setStatus('current') if mibBuilder.loadTexts: cOpticalPMIntervalNumber.setDescription('A number between 1 and 96, which identifies the interval for which the set of optical parameter values is available. The interval identified by 1 is the most recently completed 15 minute or 24 hour interval, and the interval identified by N is the interval immediately preceding the one identified by N-1.') cOpticalPMIntervalDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 2, 1, 3), OpticalIfDirection()) if mibBuilder.loadTexts: cOpticalPMIntervalDirection.setStatus('current') if mibBuilder.loadTexts: cOpticalPMIntervalDirection.setDescription('This object indicates the direction monitored for the optical interface, in this entry.') cOpticalPMIntervalLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 2, 1, 4), OpticalIfMonLocation()) if mibBuilder.loadTexts: cOpticalPMIntervalLocation.setStatus('current') if mibBuilder.loadTexts: cOpticalPMIntervalLocation.setDescription('This object indicates whether the optical characteristics are measured before or after adjustment (e.g. optical amplification or attenuation), at this interface.') cOpticalPMIntervalParamType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 2, 1, 5), OpticalParameterType()) if mibBuilder.loadTexts: cOpticalPMIntervalParamType.setStatus('current') if mibBuilder.loadTexts: cOpticalPMIntervalParamType.setDescription('This object specifies the optical parameter that is being monitored, in this entry.') cOpticalPMIntervalMaxParam = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 2, 1, 6), OpticalParameterValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalPMIntervalMaxParam.setStatus('current') if mibBuilder.loadTexts: cOpticalPMIntervalMaxParam.setDescription('This object gives the maximum value measured for the optical parameter, in a particular 15 minute or 24 hour interval.') cOpticalPMIntervalMinParam = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 2, 1, 7), OpticalParameterValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalPMIntervalMinParam.setStatus('current') if mibBuilder.loadTexts: cOpticalPMIntervalMinParam.setDescription('This object gives the minimum value measured for the optical parameter, in a particular 15 minute or 24 hour interval.') cOpticalPMIntervalMeanParam = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 2, 1, 8), OpticalParameterValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalPMIntervalMeanParam.setStatus('current') if mibBuilder.loadTexts: cOpticalPMIntervalMeanParam.setDescription('This object gives the average value of the measured optical parameter, in a particular 15 minute or 24 hour interval.') cOpticalPMIntervalUnavailSecs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 264, 1, 2, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 86400))).setMaxAccess("readonly") if mibBuilder.loadTexts: cOpticalPMIntervalUnavailSecs.setStatus('current') if mibBuilder.loadTexts: cOpticalPMIntervalUnavailSecs.setDescription('This object is used to indicate the number of seconds, in the particular 15 minute or 24 hour interval, for which the optical performance data is not accounted for. In the receive direction, the performance data could be unavailable during these periods for multiple reasons like the interface being administratively down or if there is a Loss of Light alarm on the interface. In the transmit direction, performance data could be unavailable when the laser is shutdown.') cOpticalMonitorMIBNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 264, 2)) cOpticalMonNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 264, 2, 0)) cOpticalMonParameterStatus = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 264, 2, 0, 1)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParameterValue"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamAlarmStatus"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamAlarmCurMaxThresh"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamAlarmCurMaxSev"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamAlarmLastChange")) if mibBuilder.loadTexts: cOpticalMonParameterStatus.setStatus('current') if mibBuilder.loadTexts: cOpticalMonParameterStatus.setDescription("This notification is sent when any threshold related to an optical parameter is exceeded or cleared on an interface. This notification may be suppressed under the following conditions: - depending on the value of the cOpticalNotifyEnable object, or - if the severity of the threshold as specified by the cOpticalParamHighWarningSev or cOpticalParamLowWarningSev object is 'notReported'. ") cOpticalMonitorMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 264, 3)) cOpticalMonitorMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 1)) cOpticalMonitorMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 2)) cOpticalMonitorMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 1, 1)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBMonGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBThresholdGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBSeverityGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBPMGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBNotifyEnableGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBNotifGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMonitorMIBCompliance = cOpticalMonitorMIBCompliance.setStatus('deprecated') if mibBuilder.loadTexts: cOpticalMonitorMIBCompliance.setDescription('The compliance statement for network elements that monitor optical characteristics and set thresholds on the optical interfaces in a network element.') cOpticalMonitorMIBComplianceRev = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 1, 2)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBMonGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBThresholdGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBSeverityGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBPMGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMonIfTimeGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBNotifyEnableGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBNotifGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBEnableConfigGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMIBIntervalConfigGroup"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMonThreshSourceGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMonitorMIBComplianceRev = cOpticalMonitorMIBComplianceRev.setStatus('current') if mibBuilder.loadTexts: cOpticalMonitorMIBComplianceRev.setDescription('The compliance statement for network elements that monitor optical characteristics and set thresholds on the optical interfaces in a network element.') cOpticalMIBMonGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 2, 1)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParameterValue")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMIBMonGroup = cOpticalMIBMonGroup.setStatus('current') if mibBuilder.loadTexts: cOpticalMIBMonGroup.setDescription('A mandatory object that provides monitoring of optical characteristics.') cOpticalMIBThresholdGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 2, 2)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamHighAlarmThresh"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamHighWarningThresh"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamLowAlarmThresh"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamLowWarningThresh"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamAlarmStatus"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamAlarmCurMaxThresh"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamAlarmLastChange")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMIBThresholdGroup = cOpticalMIBThresholdGroup.setStatus('current') if mibBuilder.loadTexts: cOpticalMIBThresholdGroup.setDescription('A collection of objects that support thresholds on optical parameters and provide status information when the thresholds are exceeded or cleared.') cOpticalMIBSeverityGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 2, 3)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamHighAlarmSev"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamHighWarningSev"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamLowAlarmSev"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamLowWarningSev"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamAlarmCurMaxSev")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMIBSeverityGroup = cOpticalMIBSeverityGroup.setStatus('current') if mibBuilder.loadTexts: cOpticalMIBSeverityGroup.setDescription('A collection of objects that support severities for thresholds on optical parameters.') cOpticalMIBPMGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 2, 4)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMon15MinValidIntervals"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMon24HrValidIntervals"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMCurrentMaxParam"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMCurrentMinParam"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMCurrentMeanParam"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMCurrentUnavailSecs"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMIntervalMaxParam"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMIntervalMinParam"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMIntervalMeanParam"), ("CISCO-OPTICAL-MONITOR-MIB", "cOpticalPMIntervalUnavailSecs")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMIBPMGroup = cOpticalMIBPMGroup.setStatus('current') if mibBuilder.loadTexts: cOpticalMIBPMGroup.setDescription('A collection of objects that provide optical performance monitoring data for 15 minute and 24 hour intervals.') cOpticalMIBNotifyEnableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 2, 5)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalNotifyEnable")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMIBNotifyEnableGroup = cOpticalMIBNotifyEnableGroup.setStatus('current') if mibBuilder.loadTexts: cOpticalMIBNotifyEnableGroup.setDescription('An object to control the generation of notifications.') cOpticalMIBNotifGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 2, 6)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMonParameterStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMIBNotifGroup = cOpticalMIBNotifGroup.setStatus('current') if mibBuilder.loadTexts: cOpticalMIBNotifGroup.setDescription('A notification generated when a threshold on an optical parameter is exceeded or cleared.') cOpticalMonIfTimeGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 2, 7)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMonIfTimeInSlot")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMonIfTimeGroup = cOpticalMonIfTimeGroup.setStatus('current') if mibBuilder.loadTexts: cOpticalMonIfTimeGroup.setDescription('A collection of object(s) that provide time related information for transceivers in the system.') cOpticalMIBEnableConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 2, 8)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMonEnable")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMIBEnableConfigGroup = cOpticalMIBEnableConfigGroup.setStatus('current') if mibBuilder.loadTexts: cOpticalMIBEnableConfigGroup.setDescription('A collection of object(s) to enable/disable optical monitoring.') cOpticalMIBIntervalConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 2, 9)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalMonPollInterval")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMIBIntervalConfigGroup = cOpticalMIBIntervalConfigGroup.setStatus('current') if mibBuilder.loadTexts: cOpticalMIBIntervalConfigGroup.setDescription('A collection of object(s) to specify polling interval for monitoring optical transceivers.') cOpticalMonThreshSourceGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 264, 3, 2, 10)).setObjects(("CISCO-OPTICAL-MONITOR-MIB", "cOpticalParamThreshSource")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cOpticalMonThreshSourceGroup = cOpticalMonThreshSourceGroup.setStatus('current') if mibBuilder.loadTexts: cOpticalMonThreshSourceGroup.setDescription('A collection of object(s) to restore a given threshold to its default value.') mibBuilder.exportSymbols("CISCO-OPTICAL-MONITOR-MIB", OpticalParameterValue=OpticalParameterValue, cOpticalMonitorMIBComplianceRev=cOpticalMonitorMIBComplianceRev, cOpticalPMCurrentParamType=cOpticalPMCurrentParamType, cOpticalPMIntervalLocation=cOpticalPMIntervalLocation, cOpticalPMCurrentTable=cOpticalPMCurrentTable, OpticalAlarmSeverityOrZero=OpticalAlarmSeverityOrZero, cOpticalPMIntervalUnavailSecs=cOpticalPMIntervalUnavailSecs, cOpticalMonGroup=cOpticalMonGroup, cOpticalParamThreshSource=cOpticalParamThreshSource, cOpticalMonThreshSourceGroup=cOpticalMonThreshSourceGroup, cOpticalPMCurrentMaxParam=cOpticalPMCurrentMaxParam, cOpticalMIBMonGroup=cOpticalMIBMonGroup, cOpticalMon15MinValidIntervals=cOpticalMon15MinValidIntervals, cOpticalParamLowAlarmThresh=cOpticalParamLowAlarmThresh, OpticalIfDirection=OpticalIfDirection, cOpticalMonIfEntry=cOpticalMonIfEntry, cOpticalPMCurrentLocation=cOpticalPMCurrentLocation, cOpticalPMGroup=cOpticalPMGroup, cOpticalParamAlarmStatus=cOpticalParamAlarmStatus, cOpticalPMIntervalParamType=cOpticalPMIntervalParamType, cOpticalMIBEnableConfigGroup=cOpticalMIBEnableConfigGroup, cOpticalMonParameterType=cOpticalMonParameterType, OpticalIfMonLocation=OpticalIfMonLocation, ciscoOpticalMonitorMIB=ciscoOpticalMonitorMIB, cOpticalMIBThresholdGroup=cOpticalMIBThresholdGroup, cOpticalPMCurrentDirection=cOpticalPMCurrentDirection, cOpticalPMCurrentMinParam=cOpticalPMCurrentMinParam, cOpticalMIBNotifGroup=cOpticalMIBNotifGroup, OpticalPMPeriod=OpticalPMPeriod, cOpticalParamHighAlarmThresh=cOpticalParamHighAlarmThresh, cOpticalMonitorMIBObjects=cOpticalMonitorMIBObjects, cOpticalPMIntervalEntry=cOpticalPMIntervalEntry, cOpticalParamLowWarningSev=cOpticalParamLowWarningSev, cOpticalPMCurrentUnavailSecs=cOpticalPMCurrentUnavailSecs, cOpticalMonIfTimeInSlot=cOpticalMonIfTimeInSlot, OpticalParameterType=OpticalParameterType, cOpticalNotifyEnable=cOpticalNotifyEnable, cOpticalParamHighAlarmSev=cOpticalParamHighAlarmSev, cOpticalPMIntervalTable=cOpticalPMIntervalTable, cOpticalMonIfTable=cOpticalMonIfTable, cOpticalPMIntervalMaxParam=cOpticalPMIntervalMaxParam, cOpticalMonitorMIBNotifications=cOpticalMonitorMIBNotifications, cOpticalMonPollInterval=cOpticalMonPollInterval, cOpticalParamAlarmCurMaxThresh=cOpticalParamAlarmCurMaxThresh, cOpticalParamAlarmLastChange=cOpticalParamAlarmLastChange, cOpticalMIBSeverityGroup=cOpticalMIBSeverityGroup, cOpticalMIBIntervalConfigGroup=cOpticalMIBIntervalConfigGroup, cOpticalPMCurrentPeriod=cOpticalPMCurrentPeriod, cOpticalMon24HrValidIntervals=cOpticalMon24HrValidIntervals, cOpticalMonDirection=cOpticalMonDirection, cOpticalPMIntervalPeriod=cOpticalPMIntervalPeriod, cOpticalParamHighWarningSev=cOpticalParamHighWarningSev, cOpticalMonitorMIBCompliance=cOpticalMonitorMIBCompliance, cOpticalMonitorMIBCompliances=cOpticalMonitorMIBCompliances, OpticalAlarmSeverity=OpticalAlarmSeverity, OpticalAlarmStatus=OpticalAlarmStatus, PYSNMP_MODULE_ID=ciscoOpticalMonitorMIB, cOpticalPMIntervalMinParam=cOpticalPMIntervalMinParam, cOpticalMonEntry=cOpticalMonEntry, cOpticalMonNotificationPrefix=cOpticalMonNotificationPrefix, cOpticalParamLowWarningThresh=cOpticalParamLowWarningThresh, cOpticalParamLowAlarmSev=cOpticalParamLowAlarmSev, cOpticalPMCurrentEntry=cOpticalPMCurrentEntry, cOpticalMIBNotifyEnableGroup=cOpticalMIBNotifyEnableGroup, cOpticalMIBPMGroup=cOpticalMIBPMGroup, cOpticalParamAlarmCurMaxSev=cOpticalParamAlarmCurMaxSev, cOpticalMonIfTimeGroup=cOpticalMonIfTimeGroup, cOpticalParameterValue=cOpticalParameterValue, cOpticalMonitorMIBConformance=cOpticalMonitorMIBConformance, cOpticalPMIntervalDirection=cOpticalPMIntervalDirection, cOpticalParamHighWarningThresh=cOpticalParamHighWarningThresh, cOpticalPMIntervalMeanParam=cOpticalPMIntervalMeanParam, cOpticalPMIntervalNumber=cOpticalPMIntervalNumber, cOpticalMonParameterStatus=cOpticalMonParameterStatus, cOpticalMonTable=cOpticalMonTable, cOpticalMonLocation=cOpticalMonLocation, cOpticalMonEnable=cOpticalMonEnable, cOpticalMonitorMIBGroups=cOpticalMonitorMIBGroups, cOpticalPMCurrentMeanParam=cOpticalPMCurrentMeanParam)
name = 'Bob' if name == 'Alice': print('Hi Alice') print('Done')
def tup(name, len): ret = '(' for i in range(len): ret += f'{name}{i}, ' return ret + ')' for i in range(10): print( f'impl_unzip!({tup("T",i)}, {tup("A",i)}, {tup("s",i)}, {tup("t",i)});')
class SubrectangleQueries: def __init__(self, rectangle: List[List[int]]): self.rec = rectangle self.newRec = [] def updateSubrectangle(self, row1: int, col1: int, row2: int, col2: int, newValue: int) -> None: self.newRec.append((row1, col1, row2, col2, newValue)) def getValue(self, row: int, col: int) -> int: for i in range(len(self.newRec) - 1, -1, -1): if self.newRec[i][0] <= row <= self.newRec[i][2] and self.newRec[i][1] <= col <= self.newRec[i][3]: return self.newRec[i][4] return self.rec[row][col] # Your SubrectangleQueries object will be instantiated and called as such: # obj = SubrectangleQueries(rectangle) # obj.updateSubrectangle(row1,col1,row2,col2,newValue) # param_2 = obj.getValue(row,col)
# model model = Model() i0 = Input("op_shape", "TENSOR_INT32", "{4}") weights = Parameter("ker", "TENSOR_FLOAT32", "{1, 3, 3, 1}", [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]) i1 = Input("in", "TENSOR_FLOAT32", "{1, 4, 4, 1}" ) pad = Int32Scalar("pad_same", 1) s_x = Int32Scalar("stride_x", 1) s_y = Int32Scalar("stride_y", 1) i2 = Output("op", "TENSOR_FLOAT32", "{1, 4, 4, 1}") model = model.Operation("TRANSPOSE_CONV_EX", i0, weights, i1, pad, s_x, s_y).To(i2) # Example 1. Input in operand 0, input0 = {i0: # output shape [1, 4, 4, 1], i1: # input 0 [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0]} output0 = {i2: # output 0 [29.0, 62.0, 83.0, 75.0, 99.0, 192.0, 237.0, 198.0, 207.0, 372.0, 417.0, 330.0, 263.0, 446.0, 485.0, 365.0]} # Instantiate an example Example((input0, output0))
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 30 13:28:17 2020 @author: Robinson Montes Carlos Murcia """
{ "targets": [ { "target_name": "cityhash", "include_dirs": ["cityhash/"], "sources": [ "binding.cc", "cityhash/city.cc" ] } ] }
# def positive_or_negative(value): # if value > 0: # return "Positive!" # elif value < 0: # return "Negative!" # else: # return "It's zero!" # number = int(input("Wprowadz liczbe: ")) # print(positive_or_negative(number)) def calculator(operation, a, b): if operation == "add": return a + b elif operation == "subtract": return a - b elif operation == "multiple": return a * b elif operation == "divide": return a / b else: print("There is no such an operation!") operacja = str(input("Co chcesz zrobic? ")) num1 = int(input("Pierwszy skladnik: ")) num2 = int(input("Drugi skladnik: ")) print(calculator(operacja, num1, num2))
pkgname = "eventlog" pkgver = "0.2.13" pkgrel = 0 _commit = "a5c19163ba131f79452c6dfe4e31c2b4ce4be741" build_style = "gnu_configure" hostmakedepends = ["pkgconf", "automake", "libtool"] pkgdesc = "API to format and send structured log messages" maintainer = "q66 <[email protected]>" license = "BSD-3-Clause" url = "https://github.com/balabit/eventlog" source = f"{url}/archive/{_commit}.tar.gz" sha256 = "ddd8c19cf70adced542eeb067df275cb2c0d37a5efe1ba9123102eb9b4967c7b" def pre_configure(self): self.do("autoreconf", "-if") def post_install(self): self.install_license("COPYING") @subpackage("eventlog-devel") def _devel(self): return self.default_devel()
"""Echoes everything you say. Usage: /echo /echo Hi! Type 'cancel' to stop echoing. """ def handle_update(bot, update, update_queue, **kwargs): """Echo messages that user sends. This is the main function that modulehander calls. Args: bot (telegram.Bot): Telegram bot itself update (telegram.Update): Update that will be processed update_queue (Queue): Queue containing all incoming and unhandled updates kwargs: All unused keyword arguments. See more from python-telegram-bot """ try: # e.g. message is "/echo I'm talking to a bot!" text = update.message.text.split(' ', 1)[1] except IndexError: # e.g message is just "/echo" text = "What do you want me to echo?" bot.sendMessage(chat_id=update.message.chat_id, text=text) # If module is more conversational, it can utilize the update_queue while True: update = update_queue.get() if update.message.text == "": text = "Couldn't echo that" bot.sendMessage(chat_id=update.message.chat_id, text=text) elif update.message.text.lower() == "cancel": text = "Ok, I'll stop echoing..." bot.sendMessage(chat_id=update.message.chat_id, text=text) break elif update.message.text.startswith('/'): # User accesses another bot update_queue.put(update) break else: bot.sendMessage( chat_id=update.message.chat_id, text=update.message.text)
# # PySNMP MIB module CISCO-COMPRESSION-SERVICE-ADAPTER-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-COMPRESSION-SERVICE-ADAPTER-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:36:21 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") ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") cardIndex, = mibBuilder.importSymbols("OLD-CISCO-CHASSIS-MIB", "cardIndex") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") ModuleIdentity, TimeTicks, MibIdentifier, Gauge32, Counter32, iso, Bits, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, NotificationType, Unsigned32, Integer32, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "TimeTicks", "MibIdentifier", "Gauge32", "Counter32", "iso", "Bits", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "NotificationType", "Unsigned32", "Integer32", "Counter64") DisplayString, TruthValue, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TruthValue", "TextualConvention") ciscoCompressionServiceAdapterMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 57)) if mibBuilder.loadTexts: ciscoCompressionServiceAdapterMIB.setLastUpdated('9608150000Z') if mibBuilder.loadTexts: ciscoCompressionServiceAdapterMIB.setOrganization('Cisco Systems, Inc.') ciscoCSAMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 57, 1)) csaStats = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1)) csaStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1), ) if mibBuilder.loadTexts: csaStatsTable.setStatus('current') csaStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1, 1), ).setIndexNames((0, "OLD-CISCO-CHASSIS-MIB", "cardIndex")) if mibBuilder.loadTexts: csaStatsEntry.setStatus('current') csaInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: csaInOctets.setStatus('current') csaOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: csaOutOctets.setStatus('current') csaInPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: csaInPackets.setStatus('current') csaOutPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: csaOutPackets.setStatus('current') csaInPacketsDrop = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: csaInPacketsDrop.setStatus('current') csaOutPacketsDrop = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: csaOutPacketsDrop.setStatus('current') csaNumberOfRestarts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: csaNumberOfRestarts.setStatus('current') csaCompressionRatio = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1, 1, 8), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: csaCompressionRatio.setStatus('current') csaDecompressionRatio = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1, 1, 9), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: csaDecompressionRatio.setStatus('current') csaEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 57, 1, 1, 1, 1, 10), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: csaEnable.setStatus('current') ciscoCSAMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 57, 3)) csaMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 57, 3, 1)) csaMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 57, 3, 2)) csaMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 57, 3, 1, 1)).setObjects(("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", "csaMIBGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csaMIBCompliance = csaMIBCompliance.setStatus('current') csaMIBGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 57, 3, 2, 1)).setObjects(("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", "csaInOctets"), ("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", "csaOutOctets"), ("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", "csaInPackets"), ("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", "csaOutPackets"), ("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", "csaInPacketsDrop"), ("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", "csaOutPacketsDrop"), ("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", "csaNumberOfRestarts"), ("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", "csaCompressionRatio"), ("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", "csaDecompressionRatio"), ("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", "csaEnable")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): csaMIBGroup = csaMIBGroup.setStatus('current') mibBuilder.exportSymbols("CISCO-COMPRESSION-SERVICE-ADAPTER-MIB", ciscoCompressionServiceAdapterMIB=ciscoCompressionServiceAdapterMIB, csaOutPacketsDrop=csaOutPacketsDrop, csaStatsTable=csaStatsTable, csaInPacketsDrop=csaInPacketsDrop, csaNumberOfRestarts=csaNumberOfRestarts, csaMIBGroups=csaMIBGroups, csaStatsEntry=csaStatsEntry, csaInOctets=csaInOctets, csaEnable=csaEnable, csaMIBCompliance=csaMIBCompliance, ciscoCSAMIBConformance=ciscoCSAMIBConformance, csaDecompressionRatio=csaDecompressionRatio, csaMIBCompliances=csaMIBCompliances, ciscoCSAMIBObjects=ciscoCSAMIBObjects, csaCompressionRatio=csaCompressionRatio, csaOutOctets=csaOutOctets, csaOutPackets=csaOutPackets, csaStats=csaStats, csaMIBGroup=csaMIBGroup, PYSNMP_MODULE_ID=ciscoCompressionServiceAdapterMIB, csaInPackets=csaInPackets)
user_input = '5,4,25,18,22,9' user_numbers = user_input.split(',') user_numbers_as_int = [] for number in user_numbers: user_numbers_as_int.append(int(number)) print(user_numbers_as_int) print([number for number in user_numbers]) print([number*2 for number in user_numbers]) print([int(number) for number in user_numbers])
line = "Please have a nice day" # This takes a parameter, what prefix we're looking for. line_new = line.startswith('Please') print(line_new) #Does it start with a lowercase p? # And then we get back a False because, # no, it doesn't start with a lowercase p line_new = line.startswith('p') print(line_new)
a=[1,2] for i,s in enumerate(a): print(i,"index contains",s)
def gen_help(bot_name): return''' Hello! I am a telegram bot that generates duckduckgo links from tg directly. I am an inline bot, you can access it via @{bot_name}. If you have any questions feel free to leave issue at http://github.com/cleac/tgsearchbot '''.format(bot_name=bot_name)
#class Solution: # def checkPowersOfThree(self, n: int) -> bool: #def checkPowersOfThree(n): # def divisible_by_3(k): # return k % 3 == 0 # #if 1 <= n <= 2: # if n == 2: # return False # if divisible_by_3(n): # return checkPowersOfThree(n//3) # else: # n = n - 1 # if divisible_by_3(n): # return checkPowersOfThree(n//3) # else: # return False qualified = {1, 3, 4, 9} def checkPowersOfThree(n): if n in qualified: return True remainder = n % 3 if remainder == 2: return False #elif remainder == 1: # reduced = (n-1) // 3 # if checkPowersOfThree(reduced): # qualified.add(reduced) # return True # else: # return False else: reduced = (n-remainder) // 3 if checkPowersOfThree(reduced): qualified.add(reduced) return True else: return False if __name__ == "__main__": n = 12 print(f"{checkPowersOfThree(n)}") n = 91 print(f"{checkPowersOfThree(n)}") n = 21 print(f"{checkPowersOfThree(n)}")
n = int(input('Enter A Number:')) count = 1 for i in range(count, 11, 1): print (f'{n} * {count} = {n*count}') count +=1
# Sum of the diagonals of a spiral square diagonal # OPTIMAL (<0.1s) # # APPROACH: # Generate the numbers in the spiral with a simple algorithm until # the desdired side is obtained, SQUARE_SIDE = 1001 DUMMY_SQUARE_SIDE = 5 DUMMY_RESULT = 101 def generate_numbers(limit): current = 1 internal_square = 1 steps = 0 while internal_square <= limit: yield current if current == internal_square**2: internal_square += 2 steps += 2 current += steps def sum_diagonals(square_side): return sum(generate_numbers(square_side)) assert sum_diagonals(DUMMY_SQUARE_SIDE) == DUMMY_RESULT result = sum_diagonals(SQUARE_SIDE)
def left_join(d1, d2): """ Function that a LEFT JOINs 2 dictionaries into a single data structure. All the values in the first dictionary are returned, and if values exist in the “right” dictionary, they are added to the {results dictionary}. If no values exist in the right dictionary, then None should be added to the {results dictionary} The key in dictionary case-sensitive, for example "cat" and "Cat" will be treated as a different keys. Input: {dictionary1}, {dictionary2} Output: {results dictionary} """ results = {} for key in d1: results[key]=[d1[key]] val = None if key in d2: val = d2[key] results[key].append(val) return results
""" Представление данных. """ class Pars: def __init__(self, date, lesson, group, time, teacher): self.date_lesson = date self.lesson = lesson self.group = group self.time = time self.teacher = teacher
def get_data(query): """[summary] make variable of chart.graphs.drawgraph.Graph().CustomDraw(kwargs) from querydict. The querydict from index.html Args: query ([type]): [description] querydict like <QueryDict: {'csrfmiddlewaretoken': ['2aboKu6bYhaa5OiUS5cWLytPpUpEMFLLqsYlZAE3MWervMwfoQ3HP9RlRcjEl9Uj'], 'smaperiod1': ['26'], 'smaperiod2': ['52'], 'emaperiod1': ['7'], 'emaperiod2': ['14'], 'bbandN': ['20'], 'bbandk': ['2.0'], 'rsiperiod': ['14'], 'rsibuythread': ['30.0'], 'rsisellthread': ['70.0'], 'macdfastperiod': ['12'], 'macdslowperiod': ['26'], 'macdsignaleriod': ['9'], 'ichimokut': ['12'], 'ichimokuk': ['26'], 'ichimokus': ['52']}> """ kwargs = {} kwargs["Sma"] = {"params": (int(query["smaperiod1"]), int(query["smaperiod2"]))} kwargs["Ema"] = {"params": (int(query["emaperiod1"]), int(query["emaperiod2"]))} kwargs["DEma"] = {"params": (int(query["demaperiod1"]), int(query["demaperiod2"]))} kwargs["Bb"] = {"params": (int(query["bbandN"]), float(query["bbandk"]))} kwargs["Rsi"] = {"params": (int(query["rsiperiod"]), float(query["rsibuythread"]), float(query["rsisellthread"]))} kwargs["Macd"] = {"params": (int(query["macdfastperiod"]), int(query["macdslowperiod"]), int(query["macdsignalperiod"]))} kwargs["Ichimoku"] = {"params": (int(query["ichimokut"]), int(query["ichimokuk"]), int(query["ichimokus"]))} return kwargs
PI = 3.14 SALES_TAX = 6 if __name__ == '__main__': print('Constant file directly executed') else: print('Constant file is imported')
# ------------------------------------------------------------------------ # Copyright 2015 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ------------------------------------------------------------------------ class Configuration: """Compiler-specific configuration abstract base class""" def __init__(self, context): """ Initialize the Configuration object Arguments: context -- the scons configure context """ if type(self) is Configuration: raise TypeError('abstract class cannot be instantiated') self._context = context # scons configure context self._env = context.env # scons environment def check_c99_flags(self): """ Check if command line flag is required to enable C99 support. Returns 1 if no flag is required, 0 if no flag was found, and the actual flag if one was found. CFLAGS will be updated with appropriate C99 flag, accordingly. """ return self._check_flags(self._c99_flags(), self._c99_test_program(), '.c', 'CFLAGS') def check_cxx11_flags(self): """ Check if command line flag is required to enable C++11 support. Returns 1 if no flag is required, 0 if no flag was found, and the actual flag if one was found. CXXFLAGS will be updated with appropriate C++11 flag, accordingly. """ return self._check_flags(self._cxx11_flags(), self._cxx11_test_program(), '.cpp', 'CXXFLAGS') def has_pthreads_support(self): """ Check if PThreads are supported by this system Returns 1 if this system DOES support pthreads, 0 otherwise """ return self._context.TryCompile(self._pthreads_test_program(), '.c') # -------------------------------------------------------------- # Check if flag is required to build the given test program. # # Arguments: # test_flags -- list of flags that may be needed to build # test_program # test_program -- program used used to determine if one of the # given flags is required to for a successful # build # test_extension -- file extension associated with the test # program, e.g. '.cpp' for C++ and '.c' for C # flags_key -- key used to retrieve compiler flags that may # be updated by this check from the SCons # environment # -------------------------------------------------------------- def _check_flags(self, test_flags, test_program, test_extension, flags_key): # Check if no additional flags are required. ret = self._context.TryCompile(test_program, test_extension) if ret is 0: # Try flags known to enable compiler features needed by # the test program. last_flags = self._env[flags_key] for flag in test_flags: self._env.Append(**{flags_key : flag}) ret = self._context.TryCompile(test_program, test_extension) if ret: # Found a flag! return flag else: # Restore original compiler flags for next flag # test. self._env.Replace(**{flags_key : last_flags}) return ret # ------------------------------------------------------------ # Return test program to be used when checking for basic C99 # support. # # Subclasses should implement this template method or use the # default test program found in the DefaultConfiguration class # through composition. # ------------------------------------------------------------ def _c99_test_program(self): raise NotImplementedError('unimplemented method') # -------------------------------------------------------------- # Get list of flags that could potentially enable C99 support. # # Subclasses should implement this template method if flags are # needed to enable C99 support. # -------------------------------------------------------------- def _c99_flags(self): raise NotImplementedError('unimplemented method') # ------------------------------------------------------------ # Return test program to be used when checking for basic C++11 # support. # # Subclasses should implement this template method or use the # default test program found in the DefaultConfiguration class # through composition. # ------------------------------------------------------------ def _cxx11_test_program(self): raise NotImplementedError('unimplemented method') # -------------------------------------------------------------- # Get list of flags that could potentially enable C++11 support. # # Subclasses should implement this template method if flags are # needed to enable C++11 support. # -------------------------------------------------------------- def _cxx11_flags(self): raise NotImplementedError('unimplemented method') # -------------------------------------------------------------- # Return a test program to be used when checking for PThreads # support # # -------------------------------------------------------------- def _pthreads_test_program(self): return """ #include <unistd.h> #include <pthread.h> int main() { #ifndef _POSIX_THREADS # error POSIX Threads support not available #endif return 0; } """
{ 'targets': [ { 'target_name': 'electron-dragdrop-win', 'include_dirs': [ '<!(node -e "require(\'nan\')")', ], 'defines': [ 'UNICODE', '_UNICODE'], 'sources': [ ], 'conditions': [ ['OS=="win"', { 'sources': [ "src/addon.cpp", "src/Worker.cpp", "src/v8utils.cpp", "src/ole/DataObject.cpp", "src/ole/DropSource.cpp", "src/ole/EnumFormat.cpp", "src/ole/Stream.cpp", "src/ole/ole.cpp" ], }], ['OS!="win"', { 'sources': [ "src/addon-unsupported-platform.cc" ], }] ] } ] }
def format_reader_port_message(message, reader_port, error): return f'{message} with {reader_port}. Error: {error}' def format_reader_message(message, vendor_id, product_id, serial_number): return f'{message} with ' \ f'vendor_id={vendor_id}, ' \ f'product_id={product_id} and ' \ f'serial_number={serial_number}' class ReaderNotFound(Exception): def __init__(self, vendor_id, product_id, serial_number): super(ReaderNotFound, self).__init__( format_reader_message('No RFID Reader found', vendor_id, product_id, serial_number) ) class ReaderCouldNotConnect(Exception): def __init__(self, reader_port, error): super(ReaderCouldNotConnect, self).__init__( format_reader_port_message('Could not connect to reader', reader_port, error) )
word="boy" print(word) reverse=[] l=list(word) for i in l: reverse=[i]+reverse reverse="".join(reverse) print(reverse) l=[1,2,3,4] print(l) r=[] for i in l: r=[i]+r print(r)
path = '08-File-Handling-Lab-Resources/File Reader/numbers.txt' file = open(path, 'r') num_sum = 0 for num in file: num_sum += int(num) print(num) # read print(num_sum) print(file.read()) # .read(n) n = number
class BindingTypes: JSFunction = 1 JSObject = 2 class Binding(object): def __init__(self, type, src, dest): self.type = type self.src = src self.dest = dest
def faculty_evaluation_result(nev, rar, som, oft, voft, alw): ''' Write code to calculate faculty evaluation rating according to asssignment instructions :param nev: Never :param rar: Rarely :param som: Sometimes :param oft: Often :param voft: Very Often :param alw: Always :return: rating as a string''' total = nev + rar + som + oft + voft + alw nev_ratio = nev / total rar_ratio = rar / total som_ratio = som / total oft_ratio = oft / total voft_ratio = voft / total alw_ratio = alw / total if alw_ratio + voft_ratio >= 0.9: return "Excellent" elif alw_ratio + voft_ratio + oft_ratio >= 0.8: return "Very Good" elif alw_ratio + voft_ratio + oft_ratio + som_ratio >= 0.7: return "Good" elif alw_ratio + voft_ratio + oft_ratio + som_ratio + rar_ratio >= 0.6: return "Needs Improvement" else: return "Unacceptable" def get_ratings(nev,rar,som, oft,voft, alw): ''' Students aren't expected to know this material yet! ''' ratings = [] total = nev + rar + som + oft + voft + alw ratings.append(round(alw / total, 2)) ratings.append(round(voft / total, 2)) ratings.append(round(oft / total, 2)) ratings.append(round(som / total, 2)) ratings.append(round(rar / total, 2)) ratings.append(round(nev / total, 2)) return ratings
HTTP_HOST = '' HTTP_PORT = 8080 FLASKY_MAIL_SUBJECT_PREFIX = "(Info)" FLASKY_MAIL_SENDER = '[email protected]' FLASKY_ADMIN = '[email protected]' SECRET_KEY = "\x02|\x86.\\\xea\xba\x89\xa3\xfc\r%s\x9e\x06\x9d\x01\x9c\x84\xa1b+uC" LOG = "/var/flasky" # WSGI Settings WSGI_LOG = 'default' # Flask-Log Settings LOG_LEVEL = 'debug' LOG_FILENAME = "logs/error.log" LOG_BACKUP_COUNT = 10 LOG_MAX_BYTE = 1024 * 1024 * 10 LOG_FORMATTER = '%(asctime)s - %(levelname)s - %(message)s' LOG_ENABLE_CONSOLE = True # Flask-Mail settings MAIL_SERVER = 'smtp.126.com' MAIL_PORT = 25 MAIL_USE_TLS = False MAIL_USE_SSL = False MAIL_USERNAME = '[email protected]' MAIL_PASSWORD = 'Newegg@123456$'
class Action: def __init__(self, fun, id=None): self._fun = fun self._id = id def fun(self): return self._fun def id(self): return self._id
def encode(plaintext, key): """Encodes plaintext Encode the message by shifting each character by the offset of a character in the key. """ ciphertext = "" i, j = 0, 0 # key, plaintext indices # strip all non-alpha characters from key key2 = "" for x in key: key2 += x if x.isalpha() else "" # shift each character for x in plaintext: if 97 <= ord(x) <= 122: # if character is alphabetic lowercase ciphertext += chr(((ord(x) - 97) + (ord(key2[i].lower()) - 97)) % 26 + 97) i += 1 elif 65 <= ord(x) <= 90: # if character is alphabetic uppercase ciphertext += chr(((ord(x) - 65) + (ord(key2[i].upper()) - 65)) % 26 + 65) i += 1 else: # non-alphabetic characters do not change ciphertext += x j += 1 if i == len(key2): i = 0 return ciphertext def decode(ciphertext, key): """Decode ciphertext message with a key.""" plaintext = "" i, j = 0, 0 # key, ciphertext indices # strip all non-alpha characters from key key2 = "" for x in key: key2 += x if x.isalpha() else "" # shift each character for x in ciphertext: if 97 <= ord(x) <= 122: # if character is alphabetic lowercase plaintext += chr(((ord(x) - 97) - (ord(key2[i].lower()) - 97)) % 26 + 97) i += 1 elif 65 <= ord(x) <= 90: # if character is alphabetic uppercase plaintext += chr(((ord(x) - 65) - (ord(key2[i].upper()) - 65)) % 26 + 65) i += 1 else: # non-alphabetic characters do not change plaintext += x j += 1 if i == len(key2): i = 0 return plaintext
# criar uma matriz identidade de tamanho NxN, onde N é informado pelo usuário. # Criar uma segunda matriz que é o dobro da primeira. # 1 0 0 # 0 1 0 # 0 0 1 def criaMatriz (n, m): mat = [0]*n for i in range(m): mat[i] = [0] * n return mat def criaMatrizEye(n): mat = criaMatriz(n,n) for i in range(n): mat[i][i] = 1 return mat def mostraMatriz(mat, n): for i in range(n): print(mat[i][:]) print ('\n') n = int(input('Tamanho matriz: ')) mat1 = criaMatrizEye(n) mat2 = criaMatriz(n,n) # chama as funções e imprime mostraMatriz(mat1, n) mostraMatriz(mat2, n) # multiplica a matriz 1 for i in range(n): for j in range(n): mat2[i][j] = mat1[i][j] * 2 mostraMatriz(mat2, n)
# -*- coding: utf-8 -*- word_regexes = { 'en': r'[A-Za-z]+', 'pl': r'[A-Za-zęóąśłżźćń]+', 'ru': r'[АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя]+', 'uk': r'[АаБбВвГ㥴ДдЕеЄєЖжЗзИиІіЇїЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЬЮюЯя]+', 'tr': r'[a-zA-ZçÇğĞüÜöÖşŞıİ]+', } alphabets = { 'en': 'abcdefghijklmnopqrstuvwxyz', 'pl': 'abcdefghijklmnopqrstuvwxyzęóąśłżźćń', 'ru': 'шиюынжсяплзухтвкйеобмцьёгдщэарчфъ', 'uk': 'фагксщроємшплуьцнжхїйювязтибґідеч', 'tr': 'abcçdefgğhıijklmnoöprsştuüvyzqwxÇĞİÜÖ', }
class dotIFC2X3_Product_t(object): # no doc Description = None IFC2X3_OwnerHistory = None Name = None ObjectType = None
''' ############################################### # ####################################### # #### ######## Simple Calculator ########## #### # ####################################### # ############################################### ## ## ########################################## ############ Version 2 ################# ########################################## ## ## ''' ''' The version 2 of SimpleCalc.py adds extra functionality but due to my limited approach, has to remove to some functions as well, which hope so will be added along with these new functions in the later version. This version can tell total number of inputs, their summation and and average, no matter how many inputs you give it, but as the same time this version unable to calculate multiple and devision of the numbers. ''' print("Type 'done' to Quit.") sum = 0 count = 0 while True: num = input('Input your number: ') if num == 'done': print('goodbye') break try: fnum = float(num) except: print('bad input') continue sum = sum + fnum count = count + 1 print('----Total Inputs:', count) print('----Sum:', sum) print('----Average:', sum/count)
print('=' * 12 + 'Desafio 72' + '=' * 12) numeros = ( 'Zero', 'Um', 'Dois', 'Três', 'Quatro', 'Cinco', 'Seis', 'Sete', 'Oito', 'Nove', 'Dez', 'Onze', 'Doze', 'Treze', 'Catorze', 'Quinze', 'Dezesseis', 'Dezessete', 'Dezoito', 'Dezenove', 'Vinte') while True: escolha = int(input('Digite um número entre 0 e 20: ')) while escolha < 0 or escolha > 20: escolha = int(input('Número Inválido. Digite outro número: ')) print(f'O número escolhido foi "{numeros[escolha]}"') resp = input("Deseja continuar? [S/N] ").strip().upper() while resp[0] not in "SN": resp = input("Deseja continuar? [S/N] ").strip().upper() if resp == 'N': break
def handle_error_response(resp): codes = { -1: FactomAPIError, -32008: BlockNotFound, -32009: MissingChainHead, -32010: ReceiptCreationError, -32011: RepeatedCommit, -32600: InvalidRequest, -32601: MethodNotFound, -32602: InvalidParams, -32603: InternalError, -32700: ParseError, } error = resp.json().get('error', {}) message = error.get('message') code = error.get('code', -1) data = error.get('data', {}) raise codes[code](message=message, code=code, data=data, response=resp) class FactomAPIError(Exception): response = None data = {} code = -1 message = "An unknown error occurred" def __init__(self, message=None, code=None, data={}, response=None): self.response = response if message: self.message = message if code: self.code = code if data: self.data = data def __str__(self): if self.code: return '{}: {}'.format(self.code, self.message) return self.message class BlockNotFound(FactomAPIError): pass class MissingChainHead(FactomAPIError): pass class ReceiptCreationError(FactomAPIError): pass class RepeatedCommit(FactomAPIError): pass class InvalidRequest(FactomAPIError): pass class MethodNotFound(FactomAPIError): pass class InvalidParams(FactomAPIError): pass class InternalError(FactomAPIError): pass class ParseError(FactomAPIError): pass
# # @lc app=leetcode.cn id=292 lang=python3 # # [292] Nim 游戏 # # https://leetcode-cn.com/problems/nim-game/description/ # # algorithms # Easy (69.62%) # Likes: 501 # Dislikes: 0 # Total Accepted: 102.9K # Total Submissions: 146K # Testcase Example: '4' # # 你和你的朋友,两个人一起玩 Nim 游戏: # # # 桌子上有一堆石头。 # 你们轮流进行自己的回合,你作为先手。 # 每一回合,轮到的人拿掉 1 - 3 块石头。 # 拿掉最后一块石头的人就是获胜者。 # # # 假设你们每一步都是最优解。请编写一个函数,来判断你是否可以在给定石头数量为 n 的情况下赢得游戏。如果可以赢,返回 true;否则,返回 false # 。 # # # # 示例 1: # # # 输入:n = 4 # 输出:false # 解释:如果堆中有 4 块石头,那么你永远不会赢得比赛; # 因为无论你拿走 1 块、2 块 还是 3 块石头,最后一块石头总是会被你的朋友拿走。 # # # 示例 2: # # # 输入:n = 1 # 输出:true # # # 示例 3: # # # 输入:n = 2 # 输出:true # # # # # 提示: # # # 1 # # # # @lc code=start # 1. Solution1, 数学推理, Time: O(1), Space: O(1), Runtime: 44% # - 剩下石头是`4`的倍数则会输 class Solution: def canWinNim(self, n: int) -> bool: return n % 4 != 0 # @lc code=end
# Encapsulate the pairs of int multiples to related string monikers class MultipleMoniker: mul = 0 mon = "" def __init__(self, multiple, moniker) -> None: self.mul = multiple self.mon = moniker # Define object to contain methods class FizzBuzz: # Define the int to start counting at start = 1 # Define the max number to count to maxi = 0 # Define the multiples and the corresponding descriptor terms mmPair = [MultipleMoniker(3, "Fizz"), MultipleMoniker(5, "Buzz")] # Define the array that will hold the designation array = [] def __init__(self, max_int, start = 1) -> None: self.start = start self.maxi = max_int self.init_with_max() # Generate sequence up to and including maxi def init_with_max(self, max_i=0): if max_i != 0 : self.maxi = max_i tmp_array = [] for i in range(self.start, self.maxi + 1): tmp_str = "" for m in range(len(self.mmPair)): if i % self.mmPair[m].mul == 0: tmp_str += self.mmPair[m].mon if tmp_str == "": tmp_str += format(i) tmp_array.append(tmp_str) #print(f"{i}|:{self.array[i-self.start]}") self.array = tmp_array # Generate class STR for printout def __str__(self): ret_str = f"FizzBuzz({self.maxi}):" for i in self.array: ret_str += i + ", " return ret_str def add_multiple_moniker(self, multiple, moniker): self.mmPair.append(MultipleMoniker(multiple, moniker)) def main(): # Test FizzBuzz Class Init x1 = 42 x2 = 15 # Calculate sequence & Print Output to terminal print("TEST_1:") F1 = FizzBuzz(x1) print(F1) print("TEST_2:") F2 = FizzBuzz(x2) print(F2) # Add "Fuzz" as a designator for a multiple of 7 F1.add_multiple_moniker(7, "Fuzz") F1.init_with_max(105) print(F1) if __name__ == "__main__": main()
""" Load and Display an OBJ Shape. The loadShape() command is used to read simple SVG (Scalable Vector Graphics) files and OBJ (Object) files into a Processing sketch. This example loads an OBJ file of a rocket and displays it to the screen. """ ry = 0 def setup(): size(640, 360, P3D) global rocket rocket = loadShape("rocket.obj") def draw(): background(0) lights() translate(width / 2, height / 2 + 100, -200) rotateZ(PI) rotateY(ry) shape(rocket) ry += 0.02
print("Zadávejte celá čísla za každým Enter: nebo jen Enter pro ukončení") total = 0 count = 0 while True: line = input("číslo: ") if line: try: number = int(line) except ValueError as err: print(err) continue total += number count += 1 else: break if count: print("počet =", count, "celkem =", total, "průměr =", total/count)
class ContentType: """AI Model content types.""" MODEL_PUBLISHING = 'application/vnd.iris.ai.model-publishing+json' MODEL_TRAINING = 'application/vnd.iris.ai.model-training+json'
# # 1265. Print Immutable Linked List in Reverse # # Q: https://leetcode.com/problems/print-immutable-linked-list-in-reverse/ # A: https://leetcode.com/problems/print-immutable-linked-list-in-reverse/discuss/436558/Javascript-Python3-C%2B%2B-1-Liners # class Solution: def printLinkedListInReverse(self, head: 'ImmutableListNode') -> None: if head: self.printLinkedListInReverse(head.getNext()) head.printValue()
class Grid: def __init__(self, grid: [[int]]): self.grid = grid self.flashes = 0 self.ticks = 0 self.height = len(grid) self.width = len(grid[0]) self.flashed_cells: [str] = [] def tick(self): self.ticks += 1 i = 0 for row in self.grid: j = 0 for col in row: self.grid[i][j] += 1 j += 1 i += 1 should_refresh_grid = True while should_refresh_grid: should_refresh_grid = False i = 0 for row in self.grid: j = 0 for col in row: if self.grid[i][j] > 9 and not self.is_flashed(j, i): self.flash(j, i) should_refresh_grid = True j += 1 i += 1 for flashed_cell in self.flashed_cells: x = int(flashed_cell.split(';')[0]) y = int(flashed_cell.split(';')[1]) self.grid[y][x] = 0 self.flashed_cells.clear() def flash(self, x: int, y: int): self.flashes += 1 self.mark_flashed_cell(x, y) for _y in range(-1, 2): for _x in range(-1, 2): # if not middle if (abs(_x) + abs(_y)) != 0: observing_point_x = x + _x observing_point_y = y + _y if observing_point_x >= 0 and observing_point_y >= 0 and observing_point_x < self.width and observing_point_y < self.height: self.grid[observing_point_y][observing_point_x] += 1 def is_flashed(self, x: int, y :int): if ';'.join([str(x), str(y)]) in self.flashed_cells: return True return False def mark_flashed_cell(self, x: int, y: int): if not self.is_flashed(x, y): self.flashed_cells.append(';'.join([str(x), str(y)])) @staticmethod def create_from_lines(lines: [str]): grid = [] for line in lines: grid.append([int(number) for number in list(line.strip())]) return Grid(grid)
fid = { "2": "亞洲無碼原創區", "15": "亞洲有碼原創區", "4": "歐美原創區", "25": "國產原創區", "5": "動漫原創區", "26": "中字原創區", "27": "轉帖交流區" } base_url = "http://www.t66y.com" page_path = "thread0806.php" page_num = list(range(1, 101)) headers = { "Connection": "keep-alive", "Cache-Control": "max-age=0", "Upgrade-Insecure-Requests": 1, "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8" } class PageHandler(object): def __init__(self, con): self.__con = con pass def handle(self, html): self.__con.request("get", "http://www.baidu.com") print(html)
#6. Дан список чисел. Выведите все элементы списка, которые больше предыдущего элемента. def bigger_then_pred(values): number_that_bigger_then_pred = [] for index, value in enumerate(values): if value > values[index - 1]: number_that_bigger_then_pred.append(value) return number_that_bigger_then_pred print(bigger_then_pred([-1, -2, -1, -5,6, 7, 9, 2, 4]))
#%% text=open('new.txt', 'r+') text.write('Hello file') for i in range(0, 11): text.write(str(i)) print(text.seek(2)) #%% #file operations Read & Write text=open('sampletxt.txt', 'r') text= text.read() print(text) text=text.split(' ') print(text)
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"load_audio": "00_core.ipynb", "AudioMono": "00_core.ipynb", "duration": "00_core.ipynb", "SpecImage": "00_core.ipynb", "ArrayAudioBase": "00_core.ipynb", "ArraySpecBase": "00_core.ipynb", "ArrayMaskBase": "00_core.ipynb", "TensorAudio": "00_core.ipynb", "TensorSpec": "00_core.ipynb", "TensorMask": "00_core.ipynb", "Spectify": "00_core.ipynb", "Decibelify": "00_core.ipynb", "Mel_Binify_lib": "00_core.ipynb", "MFCCify": "00_core.ipynb", "create": "00_core.ipynb", "encodes": "00_core.ipynb", "audio2tensor": "00_core.ipynb", "spec2tensor": "00_core.ipynb", "Resample": "00_core.ipynb", "Clip": "00_core.ipynb", "Normalize": "00_core.ipynb", "PhaseManager": "00_core.ipynb", "ResampleSignal": "00b_core.base.ipynb", "AudioBase": "00b_core.base.ipynb", "SpecBase": "00b_core.base.ipynb", "show_batch": "00b_core.base.ipynb", "time_bins": "01_utils.ipynb", "stft": "01_utils.ipynb", "istft": "01_utils.ipynb", "fill": "01_utils.ipynb", "randomComplex": "01_utils.ipynb", "complex2real": "01_utils.ipynb", "real2complex": "01_utils.ipynb", "complex_mult": "01_utils.ipynb", "get_shape": "01_utils.ipynb", "join_audios": "01_utils.ipynb", "Mixer": "01_utils.ipynb", "Unet_Trimmer": "01_utils.ipynb", "setup_graph": "02_plot.ipynb", "ColorMeshPlotter": "02_plot.ipynb", "cmap_dict": "02_plot.ipynb", "cmap": "02_plot.ipynb", "pre_plot": "02_plot.ipynb", "post_plot": "02_plot.ipynb", "show_audio": "02_plot.ipynb", "show_spec": "02_plot.ipynb", "show_mask": "02_plot.ipynb", "hear_audio": "02_plot.ipynb", "get_audio_files": "03_data.ipynb", "AudioBlock": "03_data.ipynb", "audio_extensions": "03_data.ipynb", "#fn": "04_Trainer.ipynb", "fn": "04_Trainer.ipynb", "pipe": "04_Trainer.ipynb", "Tensorify": "04_Trainer.ipynb", "AudioDataset": "04_Trainer.ipynb", "loss_func": "04_Trainer.ipynb", "bs": "04_Trainer.ipynb", "shuffle": "04_Trainer.ipynb", "workers": "04_Trainer.ipynb", "seed": "04_Trainer.ipynb", "dataset": "04_Trainer.ipynb", "n": "04_Trainer.ipynb", "train_dl": "04_Trainer.ipynb", "valid_dl": "04_Trainer.ipynb", "test_dl": "04_Trainer.ipynb", "dataiter": "04_Trainer.ipynb", "data": "04_Trainer.ipynb", "model": "04_Trainer.ipynb", "n_epochs": "04_Trainer.ipynb", "n_samples": "04_Trainer.ipynb", "n_iter": "04_Trainer.ipynb", "optimizer": "04_Trainer.ipynb", "state": "04_Trainer.ipynb", "safe_div": "05_Masks.ipynb", "MaskBase": "05_Masks.ipynb", "MaskBinary": "05_Masks.ipynb", "MaskcIRM": "05_Masks.ipynb", "Maskify": "05_Masks.ipynb", "SiamesePiar": "06_Pipe.ipynb", "Group": "06_Pipe.ipynb", "NanFinder": "06_Pipe.ipynb", "AudioPipe": "06_Pipe.ipynb", "init_weights": "07_Model.ipynb", "conv_block": "07_Model.ipynb", "up_conv": "07_Model.ipynb", "Recurrent_block": "07_Model.ipynb", "RRCNN_block": "07_Model.ipynb", "single_conv": "07_Model.ipynb", "Attention_block": "07_Model.ipynb", "U_Net": "07_Model.ipynb"} modules = ["core.py", "base.py", "utils.py", "plot.py", "data.py", "training.py", "masks.py", "pipe.py", "models.py"] doc_url = "https://holyfiddlex.github.io/speechsep/" git_url = "https://github.com/holyfiddlex/speechsep/tree/master/" def custom_doc_links(name): return None
class ObjAlreadyExist(Exception): """Is used when is created multiple objects of same RestApi class.""" def __init__(self, cls=None, message=None): if not (cls and message): message = "RestApi object was created twice." elif not message: message = "{} object was created twice.".format(cls.__name__) super().__init__(message) class AbortException(Exception): pass
""" focal_point =========== The *focal_point* extension allows you to drag a marker on image thumbnails while editing, thus specifying the most relevant portion of the image. You can then use these coordinates in templates for image cropping. - To install it, add the extension module to your ``INSTALLED_APPS`` setting:: INSTALLED_APPS = ( # ... your apps here ... 'media_tree.contrib.media_extensions.images.focal_point' ) - If you are not using ``django.contrib.staticfiles``, copy the contents of the ``static`` folder to the static root of your project. If you are using the ``staticfiles`` app, just run the usual command to collect static files:: $ ./manage.py collectstatic .. Note:: This extension adds the fields ``focal_x`` and ``focal_y`` to the ``FileNode`` model. You are going to have to add these fields to the database table yourself by modifying the ``media_tree_filenode`` table with a database client, **unless you installed it before running** ``syncdb``). """
def leiaDinheiro(msg): valido = False valor = 0 while not valido: din = str(input(msg)).strip().replace(',', '.') if din.isalpha() or din == '': print(f'\033[0;31mERRO! \"{din}\" é um preço inválido!\033[m') else: valido = True return float(din)
version = "1.0" version_maj = 1 version_min = 0
digits = {'0': 'zero', '1': 'jeden', '2': 'dwa', '3': 'trzy', '4': 'cztery', '5': 'pięć', \ '6': 'sześć', '7': 'siedem', '8': 'osiem', '9': 'dziewięć'} user_input = input("Wpisz cyfry, a ja zamienię je na słowa: \n") for i in range(len(user_input)): if user_input[i] not in '0123456789': continue else: print(digits[user_input[i]], end=' ')
r = range(5) # Counts from 0 to 4 for i in r: print(i) r = range(1,6) # Counts from 1 to 5 for i in r: print(i) # Step Value r = range(1,15,3) # Counts from 1 to 15 with a gap of '3', thereby, counting till '13' only as 16 is not in the range for i in r: print(i)
# Apartado 24 (Clases) """ ¿En qué consiste la Programación Orientada a Objetos (POO)? - En trasladar la naturaleza de los objetos de la vida real a código de programación (en algún lenguaje de programación, como Python). Los objetos de la realidad tienen características (atributos o propiedades) y funcionalidades o comportamientos ( funciones o métodos). Ventajas: - Modularización ( división en pequeñas partes) de un programa completo. - Código fuente muy reutilizable. - Código fuente más fácil de incrementar en el futuro y de mantener. - Si existe un fallo en una pequeña parte del código el programa completo no debe fallar necesariamente. Además, es más fácil de corregir esos fallos. - Encapsulamiento: Ocultamiento del funcionamiento interno de un objeto. """ class Persona: # Propiedades, características o atributos: apellidos = "" nombre = "" edad = 0 despierta = False # Funcionalidades: def despertar(self): # self: Parámetro que hace referencia a la instancia perteneciente a la clase. self.despierta = True print("Buen día.") persona1 = Persona() persona1.apellidos = "Salmoral Parramon" print(persona1.apellidos) persona1.despertar() print(persona1.despierta) persona2 = Persona() persona2.apellidos = "Paz Torres" print(persona2.apellidos) print(persona2.despierta)
# --- Day 3: Toboggan Trajectory --- line_list = [line.rstrip("\n") for line in open("input.txt")] def slopecheck(hori, vert): pos = 0 found = 0 i = 0 for line in line_list: if i % vert == 0: if line[pos % len(line)] == "#": found += 1 pos += hori i += 1 return found a = slopecheck(1, 1) b = slopecheck(3, 1) c = slopecheck(5, 1) d = slopecheck(7, 1) e = slopecheck(1, 2) """ print(a) print(b) print(c) print(d) print(e) print(a*b*c*d*e) """
#093_Cadastro_de_jogadores.py jogador = {} gols = [] totgols = 0 print("") jogador['Nome'] = str(input("Nome: ")) jogador['Partidas Jogadas'] = int(input("Quantidades de partidas: ")) for i in range(0,jogador['Partidas Jogadas']): g = int(input(f" Quantidades de gols na {i+1}º partida: ")) gols.append(g) totgols += g jogador['Gols'] = gols[:] jogador['Total de Gols'] = totgols # ou sum(gols) print("") print(jogador) print("") for k, v in jogador.items(): print(f"{k}: {v}") print("") print(f"O jogador {jogador['Nome']} jogou {len(jogador['Gols'])} partidas") for i, v in enumerate(jogador['Gols']): print(f" -> na {i+1}º partida fez {v} gols") print(f" No total de {totgols} gols")
# kgen_extra.py kgen_file_header = \ """ ! KGEN-generated Fortran source file ! ! Filename : %s ! Generated at: %s ! KGEN version: %s """ kgen_subprograms = \ """FUNCTION kgen_get_newunit() RESULT(new_unit) INTEGER, PARAMETER :: UNIT_MIN=100, UNIT_MAX=1000000 LOGICAL :: is_opened INTEGER :: nunit, new_unit, counter new_unit = -1 DO counter=UNIT_MIN, UNIT_MAX inquire(UNIT=counter, OPENED=is_opened) IF (.NOT. is_opened) THEN new_unit = counter EXIT END IF END DO END FUNCTION SUBROUTINE kgen_error_stop( msg ) IMPLICIT NONE CHARACTER(LEN=*), INTENT(IN) :: msg WRITE (*,*) msg STOP 1 END SUBROUTINE """ kgen_print_counter = \ """SUBROUTINE kgen_print_counter(counter) INTEGER, INTENT(IN) :: counter PRINT *, "KGEN writes input state variables at count = ", counter END SUBROUTINE SUBROUTINE kgen_print_mpirank_counter(rank, counter) INTEGER, INTENT(IN) :: rank, counter PRINT *, "KGEN writes input state variables at count = ", counter, " on mpirank = ", rank END SUBROUTINE""" kgen_verify_intrinsic_checkpart = \ """check_status%%numTotal = check_status%%numTotal + 1 IF ( var %s ref_var ) THEN check_status%%numIdentical = check_status%%numIdentical + 1 if(kgen_verboseLevel == 3) then WRITE(*,*) WRITE(*,*) trim(adjustl(varname)), " is IDENTICAL( ", var, " )." endif ELSE if(kgen_verboseLevel > 0) then WRITE(*,*) WRITE(*,*) trim(adjustl(varname)), " is NOT IDENTICAL." if(kgen_verboseLevel == 3) then WRITE(*,*) "KERNEL: ", var WRITE(*,*) "REF. : ", ref_var end if end if check_status%%numOutTol = check_status%%numOutTol + 1 END IF""" kgen_verify_numeric_array = \ """check_status%%numTotal = check_status%%numTotal + 1 IF ( ALL( var %(eqtest)s ref_var ) ) THEN check_status%%numIdentical = check_status%%numIdentical + 1 if(kgen_verboseLevel == 3) then WRITE(*,*) WRITE(*,*) "All elements of ", trim(adjustl(varname)), " are IDENTICAL." !WRITE(*,*) "KERNEL: ", var !WRITE(*,*) "REF. : ", ref_var IF ( ALL( var == 0 ) ) THEN if(kgen_verboseLevel == 3) then WRITE(*,*) "All values are zero." end if END IF end if ELSE allocate(temp(%(allocshape)s)) allocate(temp2(%(allocshape)s)) n = count(var/=ref_var) where(abs(ref_var) > kgen_minvalue) temp = ((var-ref_var)/ref_var)**2 temp2 = (var-ref_var)**2 elsewhere temp = (var-ref_var)**2 temp2 = temp endwhere nrmsdiff = sqrt(sum(temp)/real(n)) rmsdiff = sqrt(sum(temp2)/real(n)) if (nrmsdiff > kgen_tolerance) then check_status%%numOutTol = check_status%%numOutTol+1 else check_status%%numInTol = check_status%%numInTol+1 endif deallocate(temp,temp2) END IF""" kgen_verify_nonreal_array = \ """check_status%%numTotal = check_status%%numTotal + 1 IF ( ALL( var %(eqtest)s ref_var ) ) THEN check_status%%numIdentical = check_status%%numIdentical + 1 if(kgen_verboseLevel == 3) then WRITE(*,*) WRITE(*,*) "All elements of ", trim(adjustl(varname)), " are IDENTICAL." !WRITE(*,*) "KERNEL: ", var !WRITE(*,*) "REF. : ", ref_var IF ( ALL( var == 0 ) ) THEN WRITE(*,*) "All values are zero." END IF end if ELSE if(kgen_verboseLevel > 0) then WRITE(*,*) WRITE(*,*) trim(adjustl(varname)), " is NOT IDENTICAL." WRITE(*,*) count( var /= ref_var), " of ", size( var ), " elements are different." end if check_status%%numOutTol = check_status%%numOutTol+1 END IF""" kgen_utils_file_head = \ """ INTEGER, PARAMETER :: kgen_dp = selected_real_kind(15, 307) INTEGER, PARAMETER :: CHECK_IDENTICAL = 1 INTEGER, PARAMETER :: CHECK_IN_TOL = 2 INTEGER, PARAMETER :: CHECK_OUT_TOL = 3 REAL(kind=kgen_dp) :: kgen_tolerance = 1.0D-15, kgen_minvalue = 1.0D-15 INTEGER :: kgen_verboselevel = 1 interface kgen_tostr module procedure kgen_tostr_args1 module procedure kgen_tostr_args2 module procedure kgen_tostr_args3 module procedure kgen_tostr_args4 module procedure kgen_tostr_args5 module procedure kgen_tostr_args6 end interface ! PERTURB: add following interface interface kgen_perturb_real module procedure kgen_perturb_real4_dim1 module procedure kgen_perturb_real4_dim2 module procedure kgen_perturb_real4_dim3 module procedure kgen_perturb_real8_dim1 module procedure kgen_perturb_real8_dim2 module procedure kgen_perturb_real8_dim3 end interface type check_t logical :: Passed integer :: numOutTol integer :: numTotal integer :: numIdentical integer :: numInTol integer :: rank end type check_t public kgen_dp, check_t, kgen_init_verify, kgen_init_check, kgen_tolerance public kgen_minvalue, kgen_verboselevel, kgen_print_check, kgen_perturb_real public CHECK_NOT_CHECKED, CHECK_IDENTICAL, CHECK_IN_TOL, CHECK_OUT_TOL public kgen_get_newunit, kgen_error_stop """ kgen_utils_array_sumcheck = \ """ subroutine kgen_array_sumcheck(varname, sum1, sum2, finish) character(*), intent(in) :: varname real(kind=8), intent(in) :: sum1, sum2 real(kind=8), parameter :: max_rel_diff = 1.E-10 real(kind=8) :: diff, rel_diff logical, intent(in), optional :: finish logical checkresult if ( sum1 == sum2 ) then checkresult = .TRUE. else checkresult = .FALSE. diff = ABS(sum2 - sum1) if ( .NOT. (sum1 == 0._8) ) then rel_diff = ABS(diff / sum1) if ( rel_diff > max_rel_diff ) then print *, '' print *, 'SUM of array, "', varname, '", is different.' print *, 'From file : ', sum1 print *, 'From array: ', sum2 print *, 'Difference: ', diff print *, 'Normalized difference: ', rel_diff if ( present(finish) .AND. finish ) then stop end if end if else print *, '' print *, 'SUM of array, "', varname, '", is different.' print *, 'From file : ', sum1 print *, 'From array: ', sum2 print *, 'Difference: ', diff if ( present(finish) .AND. finish ) then stop end if end if end if end subroutine """ kgen_utils_file_tostr = \ """ function kgen_tostr_args1(idx1) result(tostr) integer, intent(in) :: idx1 character(len=64) :: str_idx1 character(len=64) :: tostr write(str_idx1, *) idx1 tostr = trim(adjustl(str_idx1)) end function function kgen_tostr_args2(idx1, idx2) result(tostr) integer, intent(in) :: idx1, idx2 character(len=64) :: str_idx1, str_idx2 character(len=128) :: tostr write(str_idx1, *) idx1 write(str_idx2, *) idx2 tostr = trim(adjustl(str_idx1)) // ", " // trim(adjustl(str_idx2)) end function function kgen_tostr_args3(idx1, idx2, idx3) result(tostr) integer, intent(in) :: idx1, idx2, idx3 character(len=64) :: str_idx1, str_idx2, str_idx3 character(len=192) :: tostr write(str_idx1, *) idx1 write(str_idx2, *) idx2 write(str_idx3, *) idx3 tostr = trim(adjustl(str_idx1)) // ", " // trim(adjustl(str_idx2)) & // ", " // trim(adjustl(str_idx3)) end function function kgen_tostr_args4(idx1, idx2, idx3, idx4) result(tostr) integer, intent(in) :: idx1, idx2, idx3, idx4 character(len=64) :: str_idx1, str_idx2, str_idx3, str_idx4 character(len=256) :: tostr write(str_idx1, *) idx1 write(str_idx2, *) idx2 write(str_idx3, *) idx3 write(str_idx4, *) idx4 tostr = trim(adjustl(str_idx1)) // ", " // trim(adjustl(str_idx2)) & // ", " // trim(adjustl(str_idx3)) // ", " // trim(adjustl(str_idx4)) end function function kgen_tostr_args5(idx1, idx2, idx3, idx4, idx5) result(tostr) integer, intent(in) :: idx1, idx2, idx3, idx4, idx5 character(len=64) :: str_idx1, str_idx2, str_idx3, str_idx4, str_idx5 character(len=320) :: tostr write(str_idx1, *) idx1 write(str_idx2, *) idx2 write(str_idx3, *) idx3 write(str_idx4, *) idx4 write(str_idx5, *) idx5 tostr = trim(adjustl(str_idx1)) // ", " // trim(adjustl(str_idx2)) & // ", " // trim(adjustl(str_idx3)) // ", " // trim(adjustl(str_idx4)) & // ", " // trim(adjustl(str_idx5)) end function function kgen_tostr_args6(idx1, idx2, idx3, idx4, idx5, idx6) result(tostr) integer, intent(in) :: idx1, idx2, idx3, idx4, idx5, idx6 character(len=64) :: str_idx1, str_idx2, str_idx3, str_idx4, str_idx5, str_idx6 character(len=384) :: tostr write(str_idx1, *) idx1 write(str_idx2, *) idx2 write(str_idx3, *) idx3 write(str_idx4, *) idx4 write(str_idx5, *) idx5 write(str_idx6, *) idx6 tostr = trim(adjustl(str_idx1)) // ", " // trim(adjustl(str_idx2)) & // ", " // trim(adjustl(str_idx3)) // ", " // trim(adjustl(str_idx4)) & // ", " // trim(adjustl(str_idx5)) // ", " // trim(adjustl(str_idx6)) end function """ kgen_utils_file_checksubr = \ """ subroutine kgen_perturb_real4_dim1(var, pertlim) real*4, intent(inout), dimension(:) :: var real*4, intent(in) :: pertlim integer, allocatable :: rndm_seed(:) integer :: rndm_seed_sz real*4 :: pertval integer :: idx1 call random_seed(size=rndm_seed_sz) allocate(rndm_seed(rndm_seed_sz)) rndm_seed = 121869 call random_seed(put=rndm_seed) do idx1=1,size(var, dim=1) call random_number(pertval) pertval = 2.0_4*pertlim*(0.5_4 - pertval) var(idx1) = var(idx1)*(1.0_4 + pertval) end do deallocate(rndm_seed) end subroutine subroutine kgen_perturb_real4_dim2(var, pertlim) real*4, intent(inout), dimension(:,:) :: var real*4, intent(in) :: pertlim integer, allocatable :: rndm_seed(:) integer :: rndm_seed_sz real*4 :: pertval integer :: idx1,idx2 call random_seed(size=rndm_seed_sz) allocate(rndm_seed(rndm_seed_sz)) rndm_seed = 121869 call random_seed(put=rndm_seed) do idx1=1,size(var, dim=1) do idx2=1,size(var, dim=2) call random_number(pertval) pertval = 2.0_4*pertlim*(0.5_4 - pertval) var(idx1,idx2) = var(idx1,idx2)*(1.0_4 + pertval) end do end do deallocate(rndm_seed) end subroutine subroutine kgen_perturb_real4_dim3(var, pertlim) real*4, intent(inout), dimension(:,:,:) :: var real*4, intent(in) :: pertlim integer, allocatable :: rndm_seed(:) integer :: rndm_seed_sz real*4 :: pertval integer :: idx1,idx2,idx3 call random_seed(size=rndm_seed_sz) allocate(rndm_seed(rndm_seed_sz)) rndm_seed = 121869 call random_seed(put=rndm_seed) do idx1=1,size(var, dim=1) do idx2=1,size(var, dim=2) do idx3=1,size(var, dim=3) call random_number(pertval) pertval = 2.0_4*pertlim*(0.5_4 - pertval) var(idx1,idx2,idx3) = var(idx1,idx2,idx3)*(1.0_4 + pertval) end do end do end do deallocate(rndm_seed) end subroutine subroutine kgen_perturb_real8_dim1(var, pertlim) real*8, intent(inout), dimension(:) :: var real*8, intent(in) :: pertlim integer, allocatable :: rndm_seed(:) integer :: rndm_seed_sz real*8 :: pertval integer :: idx1 call random_seed(size=rndm_seed_sz) allocate(rndm_seed(rndm_seed_sz)) rndm_seed = 121869 call random_seed(put=rndm_seed) do idx1=1,size(var, dim=1) call random_number(pertval) pertval = 2.0_8*pertlim*(0.5_8 - pertval) var(idx1) = var(idx1)*(1.0_8 + pertval) end do deallocate(rndm_seed) end subroutine subroutine kgen_perturb_real8_dim2(var, pertlim) real*8, intent(inout), dimension(:,:) :: var real*8, intent(in) :: pertlim integer, allocatable :: rndm_seed(:) integer :: rndm_seed_sz real*8 :: pertval integer :: idx1,idx2 call random_seed(size=rndm_seed_sz) allocate(rndm_seed(rndm_seed_sz)) rndm_seed = 121869 call random_seed(put=rndm_seed) do idx1=1,size(var, dim=1) do idx2=1,size(var, dim=2) call random_number(pertval) pertval = 2.0_8*pertlim*(0.5_8 - pertval) var(idx1,idx2) = var(idx1,idx2)*(1.0_8 + pertval) end do end do deallocate(rndm_seed) end subroutine subroutine kgen_perturb_real8_dim3(var, pertlim) real*8, intent(inout), dimension(:,:,:) :: var real*8, intent(in) :: pertlim integer, allocatable :: rndm_seed(:) integer :: rndm_seed_sz real*8 :: pertval integer :: idx1,idx2,idx3 call random_seed(size=rndm_seed_sz) allocate(rndm_seed(rndm_seed_sz)) rndm_seed = 121869 call random_seed(put=rndm_seed) do idx1=1,size(var, dim=1) do idx2=1,size(var, dim=2) do idx3=1,size(var, dim=3) call random_number(pertval) pertval = 2.0_8*pertlim*(0.5_8 - pertval) var(idx1,idx2,idx3) = var(idx1,idx2,idx3)*(1.0_8 + pertval) end do end do end do deallocate(rndm_seed) end subroutine subroutine kgen_init_verify(verboseLevel, tolerance, minValue) integer, intent(in), optional :: verboseLevel real(kind=kgen_dp), intent(in), optional :: tolerance real(kind=kgen_dp), intent(in), optional :: minValue if(present(verboseLevel)) then kgen_verboseLevel = verboseLevel end if if(present(tolerance)) then kgen_tolerance = tolerance end if if(present(minvalue)) then kgen_minvalue = minvalue end if end subroutine kgen_init_verify subroutine kgen_init_check(check, rank) type(check_t), intent(inout) :: check integer, intent(in), optional :: rank check%Passed = .TRUE. check%numOutTol = 0 check%numInTol = 0 check%numTotal = 0 check%numIdentical = 0 if(present(rank)) then check%rank = rank else check%rank = 0 endif end subroutine kgen_init_check subroutine kgen_print_check(kname, check) character(len=*) :: kname type(check_t), intent(in) :: check write (*,*) TRIM(kname),': Tolerance for normalized RMS: ',kgen_tolerance !write (*,*) TRIM(kname),':',check%numFatal,'fatal errors,',check%numWarning,'warnings detected, and',check%numIdentical,'identical out of',check%numTotal,'variables checked' write (*,*) TRIM(kname),': Number of variables checked: ',check%numTotal write (*,*) TRIM(kname),': Number of Identical results: ',check%numIdentical write (*,*) TRIM(kname),': Number of variables within tolerance(not identical): ',check%numInTol write (*,*) TRIM(kname),': Number of variables out of tolerance: ', check%numOutTol if (check%numOutTol> 0) then write(*,*) TRIM(kname),': Verification FAILED' else write(*,*) TRIM(kname),': Verification PASSED' endif end subroutine kgen_print_check """ kgen_get_newunit = \ """ FUNCTION kgen_get_newunit() RESULT ( new_unit ) INTEGER, PARAMETER :: UNIT_MIN=100, UNIT_MAX=1000000 LOGICAL :: is_opened INTEGER :: nunit, new_unit, counter REAL :: r CALL RANDOM_SEED new_unit = -1 DO counter=1, UNIT_MAX CALL RANDOM_NUMBER(r) nunit = INT(r*UNIT_MAX+UNIT_MIN) INQUIRE (UNIT=nunit, OPENED=is_opened) IF (.NOT. is_opened) THEN new_unit = nunit EXIT END IF END DO END FUNCTION kgen_get_newunit """ kgen_error_stop = \ """ SUBROUTINE kgen_error_stop( msg ) IMPLICIT NONE CHARACTER(LEN=*), INTENT(IN) :: msg WRITE (*,*) msg STOP 1 END SUBROUTINE """ kgen_rankthread = \ """ SUBROUTINE kgen_rankthreadinvoke( str, rank, thread, invoke ) CHARACTER(*), INTENT(IN) :: str INTEGER, INTENT(OUT) :: rank, thread, invoke INTEGER :: pos1, pos2, i, e pos1 = 1 rank = -1 thread = -1 invoke = -1 DO pos2 = INDEX(str(pos1:), ".") IF (pos2 == 0) THEN READ(str(pos1:),*,IOSTAT=e) i IF ( e == 0 ) THEN rank = thread thread = invoke READ(str(pos1:), *) invoke END IF EXIT END IF READ(str(pos1:pos1+pos2-2),*,IOSTAT=e) i IF ( e == 0 ) THEN rank = thread thread = invoke READ(str(pos1:pos1+pos2-2), *) invoke END IF pos1 = pos2+pos1 END DO END SUBROUTINE """ rdtsc = \ """ .file "rdtsc.s" .text .globl rdtsc_ .type rdtsc_, @function rdtsc_: rdtsc movl %eax,%ecx movl %edx,%eax shlq $32,%rax addq %rcx,%rax ret .size rdtsc_, .-rdtsc_"""
def sum(*n): total=0 for n1 in n: total=total+n1 print("the sum=",total) sum() sum(10) sum(10,20) sum(10,20,30,40)
""" Django configurations for the project. These configurations include: * settings: Project-wide settings, which may be customized per environment. * urls: Routes URLs to views (i.e., Python functions). * wsgi: The default Web Server Gateway Interface. """
name = 'late_binding' version = "1.0" @late() def tools(): return ["util"] def commands(): env.PATH.append("{root}/bin")
# functions # i.e., len() where the () designate a function # functions that are related to str course = "python programming" # here we have a kind of function called a "method" which # comes after a str and designated by a "." # in Py all everything is an object # and objects have "functions" # and "functions" have "methods" print(course.upper()) print(course) print(course.capitalize()) print(course.istitle()) print(course.title()) # you can make a new var/str based off of a method applied to another str/var upper_course = course.upper() print(upper_course) lower_course = upper_course.lower() print(lower_course) # striping white space unstriped_course = " The unstriped Python Course" print(unstriped_course) striped_course = unstriped_course.strip() print(striped_course) # there's also .lstrip and .rstrip for removing text either from l or r # how to find the index of a character(s) print(course.find("ra")) # in this case, "ra" is at the 11 index within the str # replacing print(course.replace("python", "Our new Python"), (course.replace("programming", "Programming Course"))) # in and not in print(course) print("py" in course) # this is true because "py" is in "python" print("meat balls" not in course) # this is also true because "meatballs" are not in the str 'course'
#!/usr/bin/python """ Fizz Buzz in python 3 P Campbell February 2018 """ for i in range(1,101): if i % 3 == 0 or i % 5 == 0 : if i % 3 == 0: msg = "Fizz" if i % 5 == 0: msg += "Buzz" print (msg) msg = "" else: print (i)
print(""" 087) Aprimore o desafio anterior, mostrando no final: A) A soma de todos os valores somaDosPares digitados. B) A soma dos valores da terceira coluna. C) O maior valor da segunda linha. """) tamanhoDaMatriz = 3 matriz = [] saida = '' somaDosPares = somaDosNumerosDaTerceiraColuna = 0 titulo = f' Usando números inteiros preencha \ a matriz {tamanhoDaMatriz}x{tamanhoDaMatriz} a seguir ' print('-'*len(titulo)) print(f'{titulo}') print('-'*len(titulo)) for linha in range(tamanhoDaMatriz): matriz.append([]) for coluna in range(tamanhoDaMatriz): numero = int(input(f'Célula [{linha},{coluna}]: ').strip()) if numero%2 == 0: somaDosPares += numero if coluna == 2: somaDosNumerosDaTerceiraColuna += numero matriz[linha].append(numero) saida += f'[ {matriz[linha][coluna]:^3} ]' saida += '\n' maiorValorDaSegundaLinha = max(matriz[1]) print('-'*len(titulo)) print(saida[:-1]) print('-'*len(titulo)) print(f'A) A soma dos valores pares é {somaDosPares}.') print(f'B) A soma dos valores da terceira coluna é \ {somaDosNumerosDaTerceiraColuna}.') print(f'C) O maior valor da segunda linha é {maiorValorDaSegundaLinha}.')
class DirectoryObjectSecurity(ObjectSecurity): """ Provides the ability to control access to directory objects without direct manipulation of Access Control Lists (ACLs). """ def AccessRuleFactory(self,identityReference,accessMask,isInherited,inheritanceFlags,propagationFlags,type,objectType=None,inheritedObjectType=None): """ AccessRuleFactory(self: DirectoryObjectSecurity,identityReference: IdentityReference,accessMask: int,isInherited: bool,inheritanceFlags: InheritanceFlags,propagationFlags: PropagationFlags,type: AccessControlType,objectType: Guid,inheritedObjectType: Guid) -> AccessRule Initializes a new instance of the System.Security.AccessControl.AccessRule class with the specified values. identityReference: The identity to which the access rule applies. It must be an object that can be cast as a System.Security.Principal.SecurityIdentifier. accessMask: The access mask of this rule. The access mask is a 32-bit collection of anonymous bits,the meaning of which is defined by the individual integrators. isInherited: true if this rule is inherited from a parent container. inheritanceFlags: Specifies the inheritance properties of the access rule. propagationFlags: Specifies whether inherited access rules are automatically propagated. The propagation flags are ignored if inheritanceFlags is set to System.Security.AccessControl.InheritanceFlags.None. type: Specifies the valid access control type. objectType: The identity of the class of objects to which the new access rule applies. inheritedObjectType: The identity of the class of child objects which can inherit the new access rule. Returns: The System.Security.AccessControl.AccessRule object that this method creates. """ pass def AddAccessRule(self,*args): """ AddAccessRule(self: DirectoryObjectSecurity,rule: ObjectAccessRule) Adds the specified access rule to the Discretionary Access Control List (DACL) associated with this System.Security.AccessControl.DirectoryObjectSecurity object. rule: The access rule to add. """ pass def AddAuditRule(self,*args): """ AddAuditRule(self: DirectoryObjectSecurity,rule: ObjectAuditRule) Adds the specified audit rule to the System Access Control List (SACL) associated with this System.Security.AccessControl.DirectoryObjectSecurity object. rule: The audit rule to add. """ pass def AuditRuleFactory(self,identityReference,accessMask,isInherited,inheritanceFlags,propagationFlags,flags,objectType=None,inheritedObjectType=None): """ AuditRuleFactory(self: DirectoryObjectSecurity,identityReference: IdentityReference,accessMask: int,isInherited: bool,inheritanceFlags: InheritanceFlags,propagationFlags: PropagationFlags,flags: AuditFlags,objectType: Guid,inheritedObjectType: Guid) -> AuditRule Initializes a new instance of the System.Security.AccessControl.AuditRule class with the specified values. identityReference: The identity to which the audit rule applies. It must be an object that can be cast as a System.Security.Principal.SecurityIdentifier. accessMask: The access mask of this rule. The access mask is a 32-bit collection of anonymous bits,the meaning of which is defined by the individual integrators. isInherited: true if this rule is inherited from a parent container. inheritanceFlags: Specifies the inheritance properties of the audit rule. propagationFlags: Specifies whether inherited audit rules are automatically propagated. The propagation flags are ignored if inheritanceFlags is set to System.Security.AccessControl.InheritanceFlags.None. flags: Specifies the conditions for which the rule is audited. objectType: The identity of the class of objects to which the new audit rule applies. inheritedObjectType: The identity of the class of child objects which can inherit the new audit rule. Returns: The System.Security.AccessControl.AuditRule object that this method creates. """ pass def GetAccessRules(self,includeExplicit,includeInherited,targetType): """ GetAccessRules(self: DirectoryObjectSecurity,includeExplicit: bool,includeInherited: bool,targetType: Type) -> AuthorizationRuleCollection Gets a collection of the access rules associated with the specified security identifier. includeExplicit: true to include access rules explicitly set for the object. includeInherited: true to include inherited access rules. targetType: The security identifier for which to retrieve access rules. This must be an object that can be cast as a System.Security.Principal.SecurityIdentifier object. Returns: The collection of access rules associated with the specified System.Security.Principal.SecurityIdentifier object. """ pass def GetAuditRules(self,includeExplicit,includeInherited,targetType): """ GetAuditRules(self: DirectoryObjectSecurity,includeExplicit: bool,includeInherited: bool,targetType: Type) -> AuthorizationRuleCollection Gets a collection of the audit rules associated with the specified security identifier. includeExplicit: true to include audit rules explicitly set for the object. includeInherited: true to include inherited audit rules. targetType: The security identifier for which to retrieve audit rules. This must be an object that can be cast as a System.Security.Principal.SecurityIdentifier object. Returns: The collection of audit rules associated with the specified System.Security.Principal.SecurityIdentifier object. """ pass def RemoveAccessRule(self,*args): """ RemoveAccessRule(self: DirectoryObjectSecurity,rule: ObjectAccessRule) -> bool Removes access rules that contain the same security identifier and access mask as the specified access rule from the Discretionary Access Control List (DACL) associated with this System.Security.AccessControl.DirectoryObjectSecurity object. rule: The access rule to remove. Returns: true if the access rule was successfully removed; otherwise,false. """ pass def RemoveAccessRuleAll(self,*args): """ RemoveAccessRuleAll(self: DirectoryObjectSecurity,rule: ObjectAccessRule) Removes all access rules that have the same security identifier as the specified access rule from the Discretionary Access Control List (DACL) associated with this System.Security.AccessControl.DirectoryObjectSecurity object. rule: The access rule to remove. """ pass def RemoveAccessRuleSpecific(self,*args): """ RemoveAccessRuleSpecific(self: DirectoryObjectSecurity,rule: ObjectAccessRule) Removes all access rules that exactly match the specified access rule from the Discretionary Access Control List (DACL) associated with this System.Security.AccessControl.DirectoryObjectSecurity object. rule: The access rule to remove. """ pass def RemoveAuditRule(self,*args): """ RemoveAuditRule(self: DirectoryObjectSecurity,rule: ObjectAuditRule) -> bool Removes audit rules that contain the same security identifier and access mask as the specified audit rule from the System Access Control List (SACL) associated with this System.Security.AccessControl.CommonObjectSecurity object. rule: The audit rule to remove. Returns: true if the audit rule was successfully removed; otherwise,false. """ pass def RemoveAuditRuleAll(self,*args): """ RemoveAuditRuleAll(self: DirectoryObjectSecurity,rule: ObjectAuditRule) Removes all audit rules that have the same security identifier as the specified audit rule from the System Access Control List (SACL) associated with this System.Security.AccessControl.DirectoryObjectSecurity object. rule: The audit rule to remove. """ pass def RemoveAuditRuleSpecific(self,*args): """ RemoveAuditRuleSpecific(self: DirectoryObjectSecurity,rule: ObjectAuditRule) Removes all audit rules that exactly match the specified audit rule from the System Access Control List (SACL) associated with this System.Security.AccessControl.DirectoryObjectSecurity object. rule: The audit rule to remove. """ pass def ResetAccessRule(self,*args): """ ResetAccessRule(self: DirectoryObjectSecurity,rule: ObjectAccessRule) Removes all access rules in the Discretionary Access Control List (DACL) associated with this System.Security.AccessControl.DirectoryObjectSecurity object and then adds the specified access rule. rule: The access rule to reset. """ pass def SetAccessRule(self,*args): """ SetAccessRule(self: DirectoryObjectSecurity,rule: ObjectAccessRule) Removes all access rules that contain the same security identifier and qualifier as the specified access rule in the Discretionary Access Control List (DACL) associated with this System.Security.AccessControl.DirectoryObjectSecurity object and then adds the specified access rule. rule: The access rule to set. """ pass def SetAuditRule(self,*args): """ SetAuditRule(self: DirectoryObjectSecurity,rule: ObjectAuditRule) Removes all audit rules that contain the same security identifier and qualifier as the specified audit rule in the System Access Control List (SACL) associated with this System.Security.AccessControl.DirectoryObjectSecurity object and then adds the specified audit rule. rule: The audit rule to set. """ pass @staticmethod def __new__(self,*args): #cannot find CLR constructor """ __new__(cls: type) __new__(cls: type,securityDescriptor: CommonSecurityDescriptor) """ pass AccessRulesModified=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets a Boolean value that specifies whether the access rules associated with this System.Security.AccessControl.ObjectSecurity object have been modified. """ AuditRulesModified=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets a Boolean value that specifies whether the audit rules associated with this System.Security.AccessControl.ObjectSecurity object have been modified. """ GroupModified=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets a Boolean value that specifies whether the group associated with the securable object has been modified. """ IsContainer=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets a Boolean value that specifies whether this System.Security.AccessControl.ObjectSecurity object is a container object. """ IsDS=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets a Boolean value that specifies whether this System.Security.AccessControl.ObjectSecurity object is a directory object. """ OwnerModified=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets a Boolean value that specifies whether the owner of the securable object has been modified. """
#this is to make change from dollar bills change=float(input("Enter an amount to make change for :")) print("Your change is..") print(int(change//20), "twenties") change=change % 20 print(int(change//10), "tens") change=change % 10 print(int(change//5), "fives") change=change % 5 print(int(change//1), "ones") change=change % 1 print(int(change//0.25), "quarters") change=change % 0.25 print(int(change//0.1),"dimes") change=change % 0.1 print(int(change//0.05), "nickels") change=change % 0.05 print(int(change//0.01), "pennies") change=change % 0.01
def calc_fuel(mass): fuel = int(mass / 3) - 2 return fuel with open("input.txt") as infile: fuel_sum = 0 for line in infile: mass = int(line.strip()) fuel = calc_fuel(mass) fuel_sum += fuel print(fuel_sum)
def main() -> None: a, b, c = map(int, input().split()) d = [a, b, c] d.sort() print("Yes" if d[1] == b else "No") if __name__ == "__main__": main()
def sums(target): ans = 0 sumlist=[] count = 1 for num in range(target): sumlist.append(count) count = count + 1 ans = sum(sumlist) print(ans) #print(sumlist) target = int(input("")) sums(target)
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http: // www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Const Class # this is a auto generated file generated by Cheetah # Libre Office Version: 7.3 # Namespace: com.sun.star.drawing class BarCodeErrorCorrection(object): """ Const Class These constants identify the type of Error Correction for a Bar Code. The Error Correction for a Bar code is a measure that helps a Bar code to recover, if it is destroyed. Level L (Low) 7% of codewords can be restored. Level M (Medium) 15% of codewords can be restored. Level Q (Quartile) 25% of codewords can be restored. Level H (High) 30% of codewords can be restored. More Info - here **since** LibreOffice 7.3 See Also: `API BarCodeErrorCorrection <https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1drawing_1_1BarCodeErrorCorrection.html>`_ """ __ooo_ns__: str = 'com.sun.star.drawing' __ooo_full_ns__: str = 'com.sun.star.drawing.BarCodeErrorCorrection' __ooo_type_name__: str = 'const' LOW = 1 MEDIUM = 2 QUARTILE = 3 HIGH = 4 __all__ = ['BarCodeErrorCorrection']
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified). __all__ = ['print_hello'] # Cell def print_hello(to): "Print hello to the user" return f"Hello, {to}!"
## @ingroup methods-mission-segments # expand_state.py # # Created: Jul 2014, SUAVE Team # Modified: Jan 2016, E. Botero # ---------------------------------------------------------------------- # Expand State # ---------------------------------------------------------------------- ## @ingroup methods-mission-segments def expand_state(segment): """Makes all vectors in the state the same size. Assumptions: N/A Source: N/A Inputs: state.numerics.number_control_points [Unitless] Outputs: N/A Properties Used: N/A """ n_points = segment.state.numerics.number_control_points segment.state.expand_rows(n_points) return
# Keys are ISO 3166-2:PL abbr. VOIVODESHIPS = { "DS": {"teryt": "02", "name_pl": "dolnośląskie"}, "KP": {"teryt": "04", "name_pl": "kujawsko-pomorskie"}, "LU": {"teryt": "06", "name_pl": "lubelskie"}, "LB": {"teryt": "08", "name_pl": "lubuskie"}, "LD": {"teryt": "10", "name_pl": "łódzkie"}, "MA": {"teryt": "12", "name_pl": "małopolskie"}, "MZ": {"teryt": "14", "name_pl": "mazowieckie"}, "OP": {"teryt": "16", "name_pl": "opolskie"}, "PK": {"teryt": "18", "name_pl": "podkarpackie"}, "PD": {"teryt": "20", "name_pl": "podlaskie"}, "PM": {"teryt": "22", "name_pl": "pomorskie"}, "SL": {"teryt": "24", "name_pl": "śląskie"}, "SK": {"teryt": "26", "name_pl": "świętokrzyskie"}, "WN": {"teryt": "28", "name_pl": "warmińsko-mazurskie"}, "WP": {"teryt": "30", "name_pl": "wielkopolskie"}, "ZP": {"teryt": "32", "name_pl": "zachodniopomorskie"}, }