content
stringlengths 7
1.05M
|
---|
#
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2016, Ilya Etingof <[email protected]>
# License: http://pysnmp.sf.net/license.html
#
# PySNMP MIB module SNMP-COMMUNITY-MIB (http://pysnmp.sf.net)
# ASN.1 source file:///usr/share/snmp/mibs/SNMP-COMMUNITY-MIB.txt
# Produced by pysmi-0.0.5 at Sat Sep 19 16:28:11 2015
# On host grommit.local platform Darwin version 14.4.0 by user ilya
# Using Python version 2.7.6 (default, Sep 9 2014, 15:04:36)
#
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
( ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "ValueRangeConstraint")
( SnmpAdminString, SnmpEngineID, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString", "SnmpEngineID")
( snmpTargetAddrEntry, SnmpTagValue, ) = mibBuilder.importSymbols("SNMP-TARGET-MIB", "snmpTargetAddrEntry", "SnmpTagValue")
( NotificationGroup, ModuleCompliance, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup")
( Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, MibIdentifier, Bits, TimeTicks, Counter64, Unsigned32, ModuleIdentity, Gauge32, snmpModules, iso, ObjectIdentity, IpAddress, Counter32, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "MibIdentifier", "Bits", "TimeTicks", "Counter64", "Unsigned32", "ModuleIdentity", "Gauge32", "snmpModules", "iso", "ObjectIdentity", "IpAddress", "Counter32")
( StorageType, DisplayString, RowStatus, TextualConvention, ) = mibBuilder.importSymbols("SNMPv2-TC", "StorageType", "DisplayString", "RowStatus", "TextualConvention")
snmpCommunityMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 18)).setRevisions(("2000-03-06 00:00", "1999-05-13 00:00",))
if mibBuilder.loadTexts: snmpCommunityMIB.setLastUpdated('200003060000Z')
if mibBuilder.loadTexts: snmpCommunityMIB.setOrganization('SNMPv3 Working Group')
if mibBuilder.loadTexts: snmpCommunityMIB.setContactInfo('WG-email: [email protected]\n Subscribe: [email protected]\n In msg body: subscribe snmpv3\n\n Chair: Russ Mundy\n TIS Labs at Network Associates\n Postal: 3060 Washington Rd\n Glenwood MD 21738\n USA\n Email: [email protected]\n Phone: +1-301-854-6889\n\n Co-editor: Rob Frye\n CoSine Communications\n Postal: 1200 Bridge Parkway\n Redwood City, CA 94065\n USA\n E-mail: [email protected]\n Phone: +1 703 725 1130\n\n Co-editor: David B. Levi\n Nortel Networks\n Postal: 3505 Kesterwood Drive\n Knoxville, TN 37918\n E-mail: [email protected]\n Phone: +1 423 686 0432\n\n Co-editor: Shawn A. Routhier\n Integrated Systems Inc.\n Postal: 333 North Ave 4th Floor\n Wakefield, MA 01880\n E-mail: [email protected]\n Phone: +1 781 245 0804\n\n Co-editor: Bert Wijnen\n Lucent Technologies\n Postal: Schagen 33\n 3461 GL Linschoten\n Netherlands\n Email: [email protected]\n Phone: +31-348-407-775\n ')
if mibBuilder.loadTexts: snmpCommunityMIB.setDescription('This MIB module defines objects to help support coexistence\n between SNMPv1, SNMPv2c, and SNMPv3.')
snmpCommunityMIBObjects = MibIdentifier((1, 3, 6, 1, 6, 3, 18, 1))
snmpCommunityMIBConformance = MibIdentifier((1, 3, 6, 1, 6, 3, 18, 2))
snmpCommunityTable = MibTable((1, 3, 6, 1, 6, 3, 18, 1, 1), )
if mibBuilder.loadTexts: snmpCommunityTable.setDescription("The table of community strings configured in the SNMP\n engine's Local Configuration Datastore (LCD).")
snmpCommunityEntry = MibTableRow((1, 3, 6, 1, 6, 3, 18, 1, 1, 1), ).setIndexNames((1, "SNMP-COMMUNITY-MIB", "snmpCommunityIndex"))
if mibBuilder.loadTexts: snmpCommunityEntry.setDescription('Information about a particular community string.')
snmpCommunityIndex = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1,32)))
if mibBuilder.loadTexts: snmpCommunityIndex.setDescription('The unique index value of a row in this table.')
snmpCommunityName = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 2), OctetString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunityName.setDescription('The community string for which a row in this table\n represents a configuration.')
snmpCommunitySecurityName = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 3), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1,32))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunitySecurityName.setDescription('A human readable string representing the corresponding\n value of snmpCommunityName in a Security Model\n independent format.')
snmpCommunityContextEngineID = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 4), SnmpEngineID()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunityContextEngineID.setDescription('The contextEngineID indicating the location of the\n context in which management information is accessed\n when using the community string specified by the\n corresponding instance of snmpCommunityName.\n\n The default value is the snmpEngineID of the entity in\n which this object is instantiated.')
snmpCommunityContextName = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 5), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0,32)).clone(hexValue="")).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunityContextName.setDescription('The context in which management information is accessed\n when using the community string specified by the corresponding\n instance of snmpCommunityName.')
snmpCommunityTransportTag = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 6), SnmpTagValue().clone(hexValue="")).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunityTransportTag.setDescription('This object specifies a set of transport endpoints\n from which a command responder application will accept\n management requests. If a management request containing\n this community is received on a transport endpoint other\n than the transport endpoints identified by this object,\n the request is deemed unauthentic.\n\n The transports identified by this object are specified\n\n in the snmpTargetAddrTable. Entries in that table\n whose snmpTargetAddrTagList contains this tag value\n are identified.\n\n If the value of this object has zero-length, transport\n endpoints are not checked when authenticating messages\n containing this community string.')
snmpCommunityStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 7), StorageType()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunityStorageType.setDescription("The storage type for this conceptual row in the\n snmpCommunityTable. Conceptual rows having the value\n 'permanent' need not allow write-access to any\n columnar object in the row.")
snmpCommunityStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 8), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunityStatus.setDescription('The status of this conceptual row in the snmpCommunityTable.\n\n An entry in this table is not qualified for activation\n until instances of all corresponding columns have been\n initialized, either through default values, or through\n Set operations. The snmpCommunityName and\n snmpCommunitySecurityName objects must be explicitly set.\n\n There is no restriction on setting columns in this table\n when the value of snmpCommunityStatus is active(1).')
snmpTargetAddrExtTable = MibTable((1, 3, 6, 1, 6, 3, 18, 1, 2), )
if mibBuilder.loadTexts: snmpTargetAddrExtTable.setDescription('The table of mask and mms values associated with the\n\n snmpTargetAddrTable.\n\n The snmpTargetAddrExtTable augments the\n snmpTargetAddrTable with a transport address mask value\n and a maximum message size value. The transport address\n mask allows entries in the snmpTargetAddrTable to define\n a set of addresses instead of just a single address.\n The maximum message size value allows the maximum\n message size of another SNMP entity to be configured for\n use in SNMPv1 (and SNMPv2c) transactions, where the\n message format does not specify a maximum message size.')
snmpTargetAddrExtEntry = MibTableRow((1, 3, 6, 1, 6, 3, 18, 1, 2, 1), )
snmpTargetAddrEntry.registerAugmentions(("SNMP-COMMUNITY-MIB", "snmpTargetAddrExtEntry"))
snmpTargetAddrExtEntry.setIndexNames(*snmpTargetAddrEntry.getIndexNames())
if mibBuilder.loadTexts: snmpTargetAddrExtEntry.setDescription('Information about a particular mask and mms value.')
snmpTargetAddrTMask = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 2, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255)).clone(hexValue="")).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetAddrTMask.setDescription('The mask value associated with an entry in the\n snmpTargetAddrTable. The value of this object must\n have the same length as the corresponding instance of\n snmpTargetAddrTAddress, or must have length 0. An\n attempt to set it to any other value will result in\n an inconsistentValue error.\n\n The value of this object allows an entry in the\n snmpTargetAddrTable to specify multiple addresses.\n The mask value is used to select which bits of\n a transport address must match bits of the corresponding\n instance of snmpTargetAddrTAddress, in order for the\n transport address to match a particular entry in the\n snmpTargetAddrTable. Bits which are 1 in the mask\n value indicate bits in the transport address which\n must match bits in the snmpTargetAddrTAddress value.\n\n Bits which are 0 in the mask indicate bits in the\n transport address which need not match. If the\n length of the mask is 0, the mask should be treated\n as if all its bits were 1 and its length were equal\n to the length of the corresponding value of\n snmpTargetAddrTable.\n\n This object may not be modified while the value of the\n corresponding instance of snmpTargetAddrRowStatus is\n active(1). An attempt to set this object in this case\n will result in an inconsistentValue error.')
snmpTargetAddrMMS = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0,0),ValueRangeConstraint(484,2147483647),)).clone(484)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetAddrMMS.setDescription('The maximum message size value associated with an entry\n in the snmpTargetAddrTable.')
snmpTrapAddress = MibScalar((1, 3, 6, 1, 6, 3, 18, 1, 3), IpAddress()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: snmpTrapAddress.setDescription('The value of the agent-addr field of a Trap PDU which\n is forwarded by a proxy forwarder application using\n an SNMP version other than SNMPv1. The value of this\n object SHOULD contain the value of the agent-addr field\n from the original Trap PDU as generated by an SNMPv1\n agent.')
snmpTrapCommunity = MibScalar((1, 3, 6, 1, 6, 3, 18, 1, 4), OctetString()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: snmpTrapCommunity.setDescription('The value of the community string field of an SNMPv1\n message containing a Trap PDU which is forwarded by a\n a proxy forwarder application using an SNMP version\n other than SNMPv1. The value of this object SHOULD\n contain the value of the community string field from\n the original SNMPv1 message containing a Trap PDU as\n generated by an SNMPv1 agent.')
snmpCommunityMIBCompliances = MibIdentifier((1, 3, 6, 1, 6, 3, 18, 2, 1))
snmpCommunityMIBGroups = MibIdentifier((1, 3, 6, 1, 6, 3, 18, 2, 2))
snmpCommunityMIBCompliance = ModuleCompliance((1, 3, 6, 1, 6, 3, 18, 2, 1, 1)).setObjects(*(("SNMP-COMMUNITY-MIB", "snmpCommunityGroup"),))
if mibBuilder.loadTexts: snmpCommunityMIBCompliance.setDescription('The compliance statement for SNMP engines which\n implement the SNMP-COMMUNITY-MIB.')
snmpProxyTrapForwardCompliance = ModuleCompliance((1, 3, 6, 1, 6, 3, 18, 2, 1, 2)).setObjects(*(("SNMP-COMMUNITY-MIB", "snmpProxyTrapForwardGroup"),))
if mibBuilder.loadTexts: snmpProxyTrapForwardCompliance.setDescription('The compliance statement for SNMP engines which\n contain a proxy forwarding application which is\n capable of forwarding SNMPv1 traps using SNMPv2c\n or SNMPv3.')
snmpCommunityGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 18, 2, 2, 1)).setObjects(*(("SNMP-COMMUNITY-MIB", "snmpCommunityName"), ("SNMP-COMMUNITY-MIB", "snmpCommunitySecurityName"), ("SNMP-COMMUNITY-MIB", "snmpCommunityContextEngineID"), ("SNMP-COMMUNITY-MIB", "snmpCommunityContextName"), ("SNMP-COMMUNITY-MIB", "snmpCommunityTransportTag"), ("SNMP-COMMUNITY-MIB", "snmpCommunityStorageType"), ("SNMP-COMMUNITY-MIB", "snmpCommunityStatus"), ("SNMP-COMMUNITY-MIB", "snmpTargetAddrTMask"), ("SNMP-COMMUNITY-MIB", "snmpTargetAddrMMS"),))
if mibBuilder.loadTexts: snmpCommunityGroup.setDescription('A collection of objects providing for configuration\n of community strings for SNMPv1 (and SNMPv2c) usage.')
snmpProxyTrapForwardGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 18, 2, 2, 3)).setObjects(*(("SNMP-COMMUNITY-MIB", "snmpTrapAddress"), ("SNMP-COMMUNITY-MIB", "snmpTrapCommunity"),))
if mibBuilder.loadTexts: snmpProxyTrapForwardGroup.setDescription('Objects which are used by proxy forwarding applications\n when translating traps between SNMP versions. These are\n used to preserve SNMPv1-specific information when\n\n translating to SNMPv2c or SNMPv3.')
mibBuilder.exportSymbols("SNMP-COMMUNITY-MIB", snmpCommunityContextName=snmpCommunityContextName, snmpCommunityMIBConformance=snmpCommunityMIBConformance, snmpCommunityName=snmpCommunityName, PYSNMP_MODULE_ID=snmpCommunityMIB, snmpCommunityMIBCompliance=snmpCommunityMIBCompliance, snmpCommunityContextEngineID=snmpCommunityContextEngineID, snmpCommunityEntry=snmpCommunityEntry, snmpCommunityMIBGroups=snmpCommunityMIBGroups, snmpCommunityMIB=snmpCommunityMIB, snmpCommunitySecurityName=snmpCommunitySecurityName, snmpProxyTrapForwardCompliance=snmpProxyTrapForwardCompliance, snmpCommunityTransportTag=snmpCommunityTransportTag, snmpTargetAddrExtTable=snmpTargetAddrExtTable, snmpCommunityMIBObjects=snmpCommunityMIBObjects, snmpTrapAddress=snmpTrapAddress, snmpCommunityMIBCompliances=snmpCommunityMIBCompliances, snmpCommunityIndex=snmpCommunityIndex, snmpCommunityGroup=snmpCommunityGroup, snmpTrapCommunity=snmpTrapCommunity, snmpCommunityStorageType=snmpCommunityStorageType, snmpTargetAddrTMask=snmpTargetAddrTMask, snmpCommunityTable=snmpCommunityTable, snmpTargetAddrExtEntry=snmpTargetAddrExtEntry, snmpCommunityStatus=snmpCommunityStatus, snmpProxyTrapForwardGroup=snmpProxyTrapForwardGroup, snmpTargetAddrMMS=snmpTargetAddrMMS)
|
# hangman_lib.py
# A set of library functions for use with your Hangman game
def print_hangman_image(mistakes=6):
"""Prints out a gallows image for hangman. The image printed depends on
the number of mistakes (0-6)."""
if mistakes <= 0:
print(''' ____________________
| .__________________|
| | / /
| |/ /
| | /
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
""""""""""""""""""""""""|
|"|"""""""""""""""""""|"|
| | | |
: : : :
. . . .''')
elif mistakes == 1:
print(''' ___________.._______
| .__________))______|
| | / / ||
| |/ / ||
| | / ||.-''.
| |/ |/ _ \\
| | || `/,|
| | (\\\\`_.'
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
""""""""""""""""""""""""|
|"|"""""""""""""""""""|"|
| | | |
: : : :
. . . .''')
elif mistakes == 2:
print(''' ___________.._______
| .__________))______|
| | / / ||
| |/ / ||
| | / ||.-''.
| |/ |/ _ \\
| | || `/,|
| | (\\\\`_.'
| | -`--'
| | |. .|
| | | |
| | | . |
| | | |
| | || ||
| |
| |
| |
| |
""""""""""""""""""""""""|
|"|"""""""""""""""""""|"|
| | | |
: : : :
. . . .''')
elif mistakes == 3:
print(''' ___________.._______
| .__________))______|
| | / / ||
| |/ / ||
| | / ||.-''.
| |/ |/ _ \\
| | || `/,|
| | (\\\\`_.'
| | .-`--'
| | /Y . .|
| | // | |
| | // | . |
| | ') | |
| | || ||
| |
| |
| |
| |
""""""""""""""""""""""""|
|"|"""""""""""""""""""|"|
| | | |
: : : :
. . . .''')
elif mistakes == 4:
print(''' ___________.._______
| .__________))______|
| | / / ||
| |/ / ||
| | / ||.-''.
| |/ |/ _ \\
| | || `/,|
| | (\\\\`_.'
| | .-`--'.
| | /Y . . Y\\
| | // | | \\\\
| | // | . | \\\\
| | ') | | (`
| | || ||
| |
| |
| |
| |
""""""""""""""""""""""""|
|"|"""""""""""""""""""|"|
| | | |
: : : :
. . . .''')
elif mistakes == 5:
print(''' ___________.._______
| .__________))______|
| | / / ||
| |/ / ||
| | / ||.-''.
| |/ |/ _ \\
| | || `/,|
| | (\\\\`_.'
| | .-`--'.
| | /Y . . Y\\
| | // | | \\\\
| | // | . | \\\\
| | ') | | (`
| | ||'||
| | ||
| | ||
| | ||
| | / |
""""""""""""""""""""""""|
|"|"""""""""""""""""""|"|
| | | |
: : : :
. . . .''')
else: # mistakes >= 6
print(''' ___________.._______
| .__________))______|
| | / / ||
| |/ / ||
| | / ||.-''.
| |/ |/ _ \\
| | || `/,|
| | (\\\\`_.'
| | .-`--'.
| | /Y . . Y\\
| | // | | \\\\
| | // | . | \\\\
| | ') | | (`
| | ||'||
| | || ||
| | || ||
| | || ||
| | / | | \\
""""""""""|_`-' `-' |"""|
|"|"""""""\ \ '"|"|
| | \ \ | |
: : \ \ : :
. . `' . .''')
|
def apply(df, model, rel_ev, rel_act, parameters=None):
if parameters is None:
parameters = {}
ret = {}
for persp in rel_ev:
df = rel_ev[persp]
df = df[df["event_activity_merge"].isin(rel_act[persp])]
df = df.groupby([persp, persp+"_2", "event_activity_merge"]).first()
r = df.groupby("event_activity_merge").size().to_dict()
ret[persp] = r
return ret
|
class ListReader():
def __init__(self, aList: list):
self.list = aList
def __enter__(self) -> list:
print("will print a list:")
return self.list
def __exit__(self, expType, expVal, expTrace):
print("end")
aList = [1, 2, 3, 4, 5, 6]
with ListReader(aList) as lr:
print(lr)
# will print a list:
# [1, 2, 3, 4, 5, 6]
# end
|
class RateLimit:
def __init__(self):
self.rateLimitType = ""
self.interval = ""
self.intervalNum = 0
self.limit = 0
class ExchangeFilter:
def __init__(self):
self.filterType = ""
self.maxOrders = 0
class Symbol:
def __init__(self):
self.symbol = ""
self.pair = ""
self.contractType = ""
self.onboardDate = ""
self.contractStatus = ""
self.contractSize = 0.0
self.deliveryDate = ""
self.maintMarginPercent = 0.0
self.requiredMarginPercent = 0.0
self.baseAsset = ""
self.quoteAsset = ""
self.marginAsset = ""
self.pricePrecision = None
self.quantityPrecision = None
self.baseAssetPrecision = None
self.quotePrecision = None
self.orderTypes = list()
self.timeInForce = list()
self.filters = list()
class ExchangeInformation:
def __init__(self):
self.timezone = ""
self.serverTime = 0
self.rateLimits = list()
self.exchangeFilters = list()
self.symbols = list()
@staticmethod
def json_parse(json_data):
result = ExchangeInformation()
result.timezone = json_data.get_string("timezone")
result.serverTime = json_data.get_int("serverTime")
data_list = json_data.get_array("rateLimits")
element_list = list()
for item in data_list.get_items():
element = RateLimit()
element.rateLimitType = item.get_string("rateLimitType")
element.interval = item.get_string("interval")
element.intervalNum = item.get_int("intervalNum")
element.limit = item.get_int("limit")
element_list.append(element)
result.rateLimits = element_list
data_list = json_data.get_array("exchangeFilters")
element_list = list()
for item in data_list.get_items():
element = ExchangeFilter()
element.filterType = item.get_string("filterType")
if element.filterType == "EXCHANGE_MAX_NUM_ORDERS":
element.maxNumOrders = item.get_int("maxNumOrders")
elif element.filterType == "EXCHANGE_MAX_ALGO_ORDERS":
element.maxNumAlgoOrders = item.get_int("maxNumAlgoOrders")
element_list.append(element)
result.exchangeFilters = element_list
data_list = json_data.get_array("symbols")
element_list = list()
for item in data_list.get_items():
element = Symbol()
element.symbol = item.get_string("symbol")
element.pair = item.get_string("pair")
element.contractType = item.get_string("contractType")
element.deliveryDate = item.get_string("deliveryDate")
element.onboardDate = item.get_string("onboardDate")
element.contractStatus = item.get_string("contractStatus")
element.contractSize = item.get_float("contractSize")
element.maintMarginPercent = item.get_float("maintMarginPercent")
element.requiredMarginPercent = item.get_float("requiredMarginPercent")
element.baseAsset = item.get_string("baseAsset")
element.quoteAsset = item.get_string("quoteAsset")
element.marginAsset = item.get_string("marginAsset")
element.pricePrecision = item.get_int("pricePrecision")
element.quantityPrecision = item.get_int("quantityPrecision")
element.baseAssetPrecision = item.get_int("baseAssetPrecision")
element.quotePrecision = item.get_int("quotePrecision")
element.orderTypes = item.get_object("orderTypes").convert_2_list()
element.timeInForce = item.get_object("timeInForce").convert_2_list()
val_list = item.get_array("filters")
filter_list = list()
for jtem in val_list.get_items():
filter_list.append(jtem.convert_2_dict())
element.filters = filter_list
element_list.append(element)
result.symbols = element_list
return result
|
# Faça um programa que leia uma frase pelo teclado e mostre:
# Quantas vezes aparece a letra "A".
# Em que posição ela aparece a primira vez.
# Em que posiçao ela aparece a última vez.
frase = str(input("Digite uma Frase qualquer: "))
frase = frase.lower()
print('Letra A:',frase.count('a'))
print('Primeiro A pos:',frase.find('a'))
print('Último A pos:',frase.rfind('a'))
|
"""
redis client and lua script api
"""
VERSION = "0.0.1"
|
"""-----------------------------------------------------------------------------
finalize.py (Last Updated: 10/16/2020)
The purpose of this script is to finalize the rt-cloud session. Specifically,
here we want to dowload any important files from the cloud back to the stimulus
computer and maybe even delete files from the cloud that we don't want to
stay there (maybe for privacy purposes).
-----------------------------------------------------------------------------"""
print(""
"-----------------------------------------------------------------------------\n"
"The finalize script has not been implemented for this project.\n\n"
"To implement, please edit finalize.py. For an example as to how you can\n"
"do this, refer to the finalize.py script in the sample project for the\n"
"rtcloud framework. Go to https://github.com/brainiak/rt-cloud.git for the\n"
"repo and navigate to projects/sample/\n"
"-----------------------------------------------------------------------------")
|
def remove_middle(a, b, c):
cross = (a[0] - b[0]) * (c[1] - b[1]) - (a[1] - b[1]) * (c[0] - b[0])
dot = (a[0] - b[0]) * (c[0] - b[0]) + (a[1] - b[1]) * (c[1] - b[1])
return cross < 0 or cross == 0 and dot <= 0
def convex_hull(points):
spoints = sorted(points)
hull = []
for p in spoints + spoints[::-1]:
while len(hull) >= 2 and remove_middle(hull[-2], hull[-1], p):
hull.pop()
hull.append(p)
hull.pop()
return hull
|
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'api',
'type': 'static_library',
'sources': [
'<@(schema_files)',
],
# TODO(jschuh): http://crbug.com/167187 size_t -> int
'msvs_disabled_warnings': [ 4267 ],
'includes': [
'../../../../build/json_schema_bundle_compile.gypi',
'../../../../build/json_schema_compile.gypi',
],
'variables': {
'chromium_code': 1,
# Disable schema compiler to generate model extension API code.
# Only register the extension functions in extension system.
'non_compiled_schema_files': [
'adview.json',
'browsing_data.json',
'chromeos_info_private.json',
'extension.json',
'idltest.idl',
'infobars.json',
'media_player_private.json',
'music_manager_private.idl',
'preferences_private.json',
'principals_private.idl',
'top_sites.json',
],
'conditions': [
['OS!="android"', {
'schema_files': [
'activity_log_private.json',
'alarms.idl',
'app_current_window_internal.idl',
'app_runtime.idl',
'app_window.idl',
'audio.idl',
'autotest_private.idl',
'bluetooth.idl',
'bookmark_manager_private.json',
'bookmarks.json',
'braille_display_private.idl',
'cast_channel.idl',
'cloud_print_private.json',
'command_line_private.json',
'content_settings.json',
'context_menus.json',
'cookies.json',
'debugger.json',
'desktop_capture.json',
'developer_private.idl',
'dial.idl',
'dns.idl',
'downloads.idl',
'downloads_internal.idl',
'echo_private.json',
'enterprise_platform_keys_private.json',
'events.json',
'experimental_accessibility.json',
'experimental_discovery.idl',
'feedback_private.idl',
'file_browser_private.idl',
'file_system.idl',
'file_system_provider.idl',
'font_settings.json',
'gcm.json',
'hangouts_private.idl',
'history.json',
'i18n.json',
'identity.idl',
'identity_private.idl',
'idle.json',
'image_writer_private.idl',
'input_ime.json',
'location.idl',
'management.json',
'manifest_types.json',
'mdns.idl',
'media_galleries.idl',
'media_galleries_private.idl',
'metrics_private.json',
'networking_private.json',
'notifications.idl',
'omnibox.json',
'page_capture.json',
'permissions.json',
'power.idl',
'push_messaging.idl',
'runtime.json',
'serial.idl',
'sessions.json',
'signed_in_devices.idl',
'socket.idl',
'sockets_tcp.idl',
'sockets_tcp_server.idl',
'sockets_udp.idl',
'storage.json',
'sync_file_system.idl',
'system_cpu.idl',
'system_display.idl',
'system_indicator.idl',
'system_memory.idl',
'system_network.idl',
'system_private.json',
'system_storage.idl',
'tab_capture.idl',
'tabs.json',
'terminal_private.json',
'test.json',
'types.json',
'usb.idl',
'virtual_keyboard_private.json',
'web_navigation.json',
'web_request.json',
# Despite the name, this API does not rely on any
# WebRTC-specific bits and as such does not belong in
# the enable_webrtc=0 section below.
'webrtc_audio_private.idl',
'webstore_private.json',
'webview.json',
'windows.json',
],
}, { # OS=="android"
'schema_files': [
# These should be eliminated. See crbug.com/305852.
'activity_log_private.json',
'alarms.idl',
'app_runtime.idl',
'app_window.idl',
'context_menus.json',
'downloads.idl',
'events.json',
'feedback_private.idl',
'file_system.idl',
'manifest_types.json',
'omnibox.json',
'permissions.json',
'runtime.json',
'storage.json',
'sync_file_system.idl',
'tab_capture.idl',
'tabs.json',
'types.json',
'web_navigation.json',
'web_request.json',
'windows.json',
],
}],
['chromeos==1', {
'schema_files': [
'diagnostics.idl',
'file_browser_handler_internal.json',
'first_run_private.json',
'log_private.idl',
'screenlock_private.idl',
'wallpaper.json',
'wallpaper_private.json',
],
}],
['enable_webrtc==1', {
'schema_files': [
'cast_streaming_rtp_stream.idl',
'cast_streaming_session.idl',
'cast_streaming_udp_transport.idl',
'webrtc_logging_private.idl',
],
}],
],
'cc_dir': 'chrome/common/extensions/api',
'root_namespace': 'extensions::api',
},
'dependencies': [
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/sync/sync.gyp:sync',
],
'conditions': [
['chromeos==1', {
'dependencies': [
'<(DEPTH)/chrome/chrome.gyp:drive_proto',
],
}],
],
},
],
}
|
#!/usr/bin/env python
# encoding: utf-8
class Solution:
def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool:
# adjacency matrix of the directed graph
self.graph = collections.defaultdict(list)
for to_node, from_node in prerequisites:
self.graph[from_node].append(to_node)
# node's state: 0=unknown; 1=visiting; 2=visited
self.state = [0] * numCourses
# check if there's cycle
for n in range(numCourses):
if self.dfs_is_cycle(n):
return False
# no cycle, then success
return True
def dfs_is_cycle(self, node):
if self.state[node] == 1: return True
if self.state[node] == 2: return False
# mark node as visiting
self.state[node] = 1
# traverse its neighbor's node
for next_node in self.graph[node]:
if self.dfs_is_cycle(next_node):
return True
self.state[node] = 2
return False
|
def file_from_tar(context, tar, member):
return tar.extractfile(member).read()
def static_file(context, path):
with open(path, 'rb') as fobj:
return fobj.read()
|
#Find the BITWISE NOT of the given number
a = int(input())
b = ~a
print(b)
|
#!/usr/bin/env python3
def merge_chars(string, block):
for i in range(0, len(string), block):
s = ''
for c in string[i:i+block]:
if c not in s:
s += c
print(s)
if __name__ == '__main__':
merge_chars(input(), int(input()))
|
# Crie uma tupla preenchida com os 20 primeiros colocados da tabela do Campeonato Brasileiro de Futebol, na ordem de
# colocação. Depois mostre:
# Apenas os 5 primeiros colocados
# Os últimos 4 colocados da tabela
# Uma lista com os times em ordem alfabética
# Em que posição na tabela está o time da Chapecoense
colocacao = ('Atlético-MG', 'Flamengo', 'Palmeiras', 'Fortaleza',
'Corinthians', 'Red Bull Bragantino', 'Athletico PR',
'Internacional', 'Fluminense', 'América-MG', 'Atlético-GO',
'Cuiabá-MT', 'Ceará', 'São Paulo', 'Juventude', 'Santos',
'Grêmio', 'Bahia', 'Sport', 'Chapecoense')
cont = 0
# Adptei somente para o TOP4 da tabela
print('\033[1;33;4;40m TABELA DO BRASILEIRÃO (ATUALIZADA) ')
for c in colocacao:
cont += 1
print(f'\033[1;36m{cont}º colocado é {c}')
print(f'\n\033[m\033[1;34;40mOs times do G4 são:\033[m\n\033[1;34;40m{colocacao[0:4]}\033[m')
print(f'\n\033[1;33;40mOs times da ZONA DE REBAIXAMENTO são:\033[m\n\033[1;33;40m{colocacao[-4:]}\033[m')
print(f'\n\033[1;35;40mA ordem alfabética da TABELA é:\n{sorted(colocacao)}\033[m')
print(f'\n\033[1;31;40mO time da Chapecoense se encontra na {colocacao.index("Chapecoense")+1}º posição\033[m')
|
def solve():
direction = 0 # north = 0, east = 1, south = 2, west = 3
x = 0
y = 0
moves = [x for x in input().split(',')]
visited = []
for elem in moves:
elem = elem.strip()
turn = elem[0]
length = int(elem[1:])
if (turn == "R"):
direction = abs((direction + 1) % 4)
elif (turn == "L"):
direction = abs((direction - 1) % 4)
if (direction == 0):
for _ in range(length):
y += 1
visit = (x, y)
if visit in visited:
return (abs(x) + abs(y))
else:
visited.append(visit)
elif (direction == 1):
for _ in range(length):
x += 1
visit = (x, y)
if visit in visited:
return (abs(x) + abs(y))
else:
visited.append(visit)
elif (direction == 2):
for _ in range(length):
y -= 1
visit = (x, y)
if visit in visited:
return (abs(x) + abs(y))
else:
visited.append(visit)
else:
for _ in range(length):
x -= 1
visit = (x, y)
if visit in visited:
return (abs(x) + abs(y))
else:
visited.append(visit)
print (solve())
|
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
DEVELOPER_SIGN_ON_CLIENT_ID = "04b07795-8ddb-461a-bbee-02f9e1bf7b46"
AZURE_VSCODE_CLIENT_ID = "aebc6443-996d-45c2-90f0-388ff96faa56"
VSCODE_CREDENTIALS_SECTION = "VS Code Azure"
DEFAULT_REFRESH_OFFSET = 300
DEFAULT_TOKEN_REFRESH_RETRY_DELAY = 30
class AzureAuthorityHosts:
AZURE_CHINA = "login.chinacloudapi.cn"
AZURE_GERMANY = "login.microsoftonline.de"
AZURE_GOVERNMENT = "login.microsoftonline.us"
AZURE_PUBLIC_CLOUD = "login.microsoftonline.com"
class KnownAuthorities(AzureAuthorityHosts):
"""Alias of :class:`AzureAuthorityHosts`"""
class EnvironmentVariables:
AZURE_CLIENT_ID = "AZURE_CLIENT_ID"
AZURE_CLIENT_SECRET = "AZURE_CLIENT_SECRET"
AZURE_TENANT_ID = "AZURE_TENANT_ID"
CLIENT_SECRET_VARS = (AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID)
AZURE_CLIENT_CERTIFICATE_PATH = "AZURE_CLIENT_CERTIFICATE_PATH"
AZURE_CLIENT_CERTIFICATE_PASSWORD = "AZURE_CLIENT_CERTIFICATE_PASSWORD"
CERT_VARS = (AZURE_CLIENT_ID, AZURE_CLIENT_CERTIFICATE_PATH, AZURE_TENANT_ID)
AZURE_USERNAME = "AZURE_USERNAME"
AZURE_PASSWORD = "AZURE_PASSWORD"
USERNAME_PASSWORD_VARS = (AZURE_CLIENT_ID, AZURE_USERNAME, AZURE_PASSWORD)
AZURE_POD_IDENTITY_AUTHORITY_HOST = "AZURE_POD_IDENTITY_AUTHORITY_HOST"
IDENTITY_ENDPOINT = "IDENTITY_ENDPOINT"
IDENTITY_HEADER = "IDENTITY_HEADER"
IDENTITY_SERVER_THUMBPRINT = "IDENTITY_SERVER_THUMBPRINT"
IMDS_ENDPOINT = "IMDS_ENDPOINT"
MSI_ENDPOINT = "MSI_ENDPOINT"
MSI_SECRET = "MSI_SECRET"
AZURE_AUTHORITY_HOST = "AZURE_AUTHORITY_HOST"
AZURE_IDENTITY_DISABLE_MULTITENANTAUTH = "AZURE_IDENTITY_DISABLE_MULTITENANTAUTH"
AZURE_REGIONAL_AUTHORITY_NAME = "AZURE_REGIONAL_AUTHORITY_NAME"
AZURE_FEDERATED_TOKEN_FILE = "AZURE_FEDERATED_TOKEN_FILE"
TOKEN_EXCHANGE_VARS = (AZURE_AUTHORITY_HOST, AZURE_TENANT_ID, AZURE_FEDERATED_TOKEN_FILE)
|
"""
Conditioner
===========
Create simple 'if this then that' style rules in your Django application. Comes with a bunch of ready to use actions
and conditions, but is also easily extensible and allows model specific actions/conditions.
"""
default_app_config = 'conditioner.apps.ConditionerAppConfig'
__title__ = 'django-conditioner'
__version__ = '0.1.0'
__author__ = 'Omni Digital'
__license__ = 'MIT'
__url__ = 'https://github.com/omni-digital/django-conditioner'
|
def Glados(thoughts, eyes, eye, tongue):
return f"""
{thoughts}
{thoughts}
\#+ \@ \# \# M#\@
. .X X.%##\@;# \# +\@#######X. \@#%
,==. ,######M+ -#####%M####M- \#
:H##M%:=##+ .M##M,;#####/+#######% ,M#
.M########= =\@#\@.=#####M=M#######= X#
:\@\@MMM##M. -##M.,#######M#######. = M
\@##..###:. .H####. \@\@ X,
\############: \###,/####; /##= \@#. M
,M## ;##,\@#M;/M#M \@# X#% X#
.%= \######M## \##.M#: ./#M ,M \#M ,#\$
\##/ \$## \#+;#: \#### ;#/ M M- \@# :
\#+ \#M\@MM###M-;M \#:\$#-##\$H# .#X \@ + \$#. \#
\######/.: \#%=# M#:MM./#.-# \@#: H#
+,.= \@###: /\@ %#,\@ \##\@X \#,-#\@.##% .\@#
\#####+;/##/ \@## \@#,+ /#M . X,
;###M#\@ M###H .#M- ,##M ;\@\@; \###
.M#M##H ;####X ,\@#######M/ -M###\$ -H
.M###% X####H .\@\@MM\@; ;\@#M\@
H#M /\@####/ ,++. / ==-,
,=/:, .+X\@MMH\@#H \#####\$=
"""
|
live = 'yes'
def love():
live
|
class Solution(object):
def removeCoveredIntervals(self, intervals):
"""
:type intervals: List[List[int]]
:rtype: int
"""
# Sort by start point.
# If two intervals share the same start point
# put the longer one to be the first.
intervals.sort(key=lambda x: (x[0], -x[1]))
count = 0
prevEnd = 0
for _, end in intervals:
# if current interval is not covered
# by the previous one
if end > prevEnd:
count += 1
prevEnd = end
return count
|
# exercise-02 Length of Phrase
# Write the code that:
# 1. Prompts the user to enter a phrase:
# Please enter a word or phrase:
# 2. Print the following message:
# - What you entered is xx characters long
# 3. Return to step 1, unless the word 'quit' was entered.
while True:
input_word_phrase = input('Please enter a word or phrase ')
if input_word_phrase == "quit":
break
print(f'What you entered is {len(input_word_phrase)} characters long')
|
KEY_PRESSES = {
'1ADGJMPTW* #': 1,
'BEHKNQUX0': 2,
'CFILORVY': 3,
'23456S8Z': 4,
'79': 5
}
def presses(phrase):
total = 0
for a in phrase.upper():
for k, v in KEY_PRESSES.iteritems():
if a in k:
total += v
break
return total
|
# 04 sKeyword Arguments
# def increment(number, by):
# return number + by
# result = increment(2, 1)
# print(result)
# It also works like this
def increment(number, by):
return number + by
print(increment(2, by=1))
# by=1 Its the keyword arguent, if a function as multiple arguments, the code can be more readable by using keyword arguments.
|
with open("day16.txt") as f:
data = f.readline()
data = data.split(",")
programs = [chr(i) for i in range(97, 113)]
for instruction in data:
type_ = instruction[0]
if type_ == "s":
length = int(instruction[1:])
programs = programs[-length:] + programs[:len(programs)-length]
if type_ == "x":
values = instruction[1:].split('/')
a = int(values[0])
b = int(values[1])
temp = programs[a]
programs[a] = programs[b]
programs[b] = temp
if type_ == "p":
a, b = instruction[1:].split('/')
indA = programs.index(a)
indB = programs.index(b)
programs[indA] = b
programs[indB] = a
print("Result =", "".join(programs))
|
#
# Simple class for dealing with Parameter.
# Parameter has a name, a value, an error and some bounds
# Names are also latex names.
class Parameter:
def __init__(self, name, value, err=0, bounds=None, Ltxname=None):
self.name = name
if Ltxname:
self.Ltxname = Ltxname
else:
self.Ltxname = name
self.value = value
# this is the estimate of error
self.error = err
if bounds == None:
self.bounds = (value-5*err, value+5*err)
else:
self.bounds = bounds
def sameParam(self, param2):
return self.name == param2.name
def setLatexName(self, Ltx):
self.Ltxname = Ltx
def setValue(self, val):
self.value = val
def setError(self, err):
self.error = err
def setBounds(self, low, high):
self.bounds = [low, high]
|
def enter_text(text):
print(text)
input("Press Enter key.")
return(0)
def nostop(text):
enter_text(text)
return(0)
def message(text):
enter_text(text)
exit(0)
def error(text):
enter_text(text)
exit(9001)
def fatal(text):
error(text)
#return true if yes, false if no
def yes_no(prompt):
opt = "x"
while opt == "x":
print("\n%s" % prompt)
opt = input("[y/n]: ")
if opt.lower().strip() == "y":
return(True)
elif opt.lower().strip() == "n":
return(False)
else:
opt = "x"
|
"""AyudaEnPython: https://www.facebook.com/groups/ayudapython
"""
mayor = 0
suma = 0
for _ in range(10):
edad = int(input("Ingresar edad: "))
if edad >= 18:
mayor += 1
suma += edad
print(f"Promedio: {suma / 10}")
print(f"Mayores de edad: {mayor}")
|
lista = [1, 13, 15, 7]
lista_animal = ['cachorro', 'gato', 'elefante', 'arara']
#Ordenando a lista
lista.sort()
lista_animal.sort()
print(lista)
print(lista_animal)
#Revertendo a ordem da lista
lista_animal.reverse()
print(lista_animal)
|
class xcconfig_item_base(object):
def __init__(self, line):
line_end = line.find('//');
if line_end > 0:
line = line[:line_end];
self.contents = line;
self.type = 'EMPTY';
def __repr__(self):
if self.isValid():
return '(%s : %s : %s)' % (type(self), self.type, self.contents);
else:
return '(%s : IGNORED LINE)' % (type(self));
def __attrs(self):
return (self.type, self.contents);
def __eq__(self, other):
return isinstance(other, xcconfig_item_base) and self.type == other.type and self.contents == other.contents;
def __hash__(self):
return hash(self.__attrs());
def isValid(self):
return self.type != 'EMPTY';
|
# -*- coding: utf-8 -*-
"""
A module containing the Edge Validator functions which can be registered as callbacks to
:class:`~nodeeditor.node_edge.Edge` class.
Example of registering Edge Validator callbacks:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can register validation callbacks once for example on the bottom of node_edge.py file or on the
application start with calling this:
.. code-block:: python
from nodeeditor.node_edge_validators import *
Edge.registerEdgeValidator(edge_validator_debug)
Edge.registerEdgeValidator(edge_cannot_connect_two_outputs_or_two_inputs)
Edge.registerEdgeValidator(edge_cannot_connect_input_and_output_of_same_node)
"""
DEBUG = False
def print_error(*args):
"""Helper method which prints to console if `DEBUG` is set to `True`"""
if DEBUG: print("Edge Validation Error:", *args)
def edge_validator_debug(input: 'Socket', output: 'Socket') -> bool:
"""This will consider edge always valid, however writes bunch of debug stuff into console"""
print("VALIDATING:")
print(input, "input" if input.is_input else "output", "of node", input.node)
for s in input.node.inputs+input.node.outputs: print("\t", s, "input" if s.is_input else "output")
print(output, "input" if input.is_input else "output", "of node", output.node)
for s in output.node.inputs+output.node.outputs: print("\t", s, "input" if s.is_input else "output")
return True
def edge_cannot_connect_two_outputs_or_two_inputs(input: 'Socket', output: 'Socket') -> bool:
"""Edge is invalid if it connects 2 output sockets or 2 input sockets"""
if input.is_output and output.is_output:
print_error("Connecting 2 outputs")
return False
if input.is_input and output.is_input:
print_error("Connecting 2 inputs")
return False
return True
def edge_cannot_connect_input_and_output_of_same_node(input: 'Socket', output:'Socket') -> bool:
"""Edge is invalid if it connects the same node"""
if input.node == output.node:
print_error("Connecting the same node")
return False
return True
|
"""
1
/ \
/ \
/ \
2 3
/ \ /
4 5 6
/ / \
7 8 9
The correct output should look like this:
preorder: 1 2 4 7 5 3 6 8 9
inorder: 7 4 2 5 1 8 6 9 3
postorder: 7 4 5 2 8 9 6 3 1
level-order: 1 2 3 4 5 6 7 8 9
"""
# pre-order, in-order, and post-order tree traversal are called Depth First Search (DFS),
# since they visit the tree by proceeding deeper and deeper until it reaches the leaf nodes.
# Usually use recursion, or use _stack_ to simulate recursion by using iterative methods
# level-order traversal is Breadth First Search (BFS), since it visits the nodes level by level.
#++++++++++++++++++\
# Find the maximum height (depth) of a Binary Tree
def maxHeight(node):
if node is None:
return 0
left_height = maxHeight(node.left)
right_height = maxHeight(node.right)
if left_height > right_height:
return left_height + 1
else:
return right_height + 1
def max_iterative(node):
# Any DFS could be modified to solve this problem
# Or use BFS, record how many levels
stack = []
height = 0
while node or stack:
if node:
stack.append(node)
if len(stack) > height:
height = len(stack)
node = node.left
else:
node = stack.pop()
node = node.right
return height
# Find longest path of two leaves (diameter)
def diameter(node):
if node is None:
return 0
lheight = maxHeight(node.left)
rheight = manHeight(node.right)
ldiameter = diameter(node.left)
rdiameter = diameter(node.right)
return max(lheight+rheight+1, max(ldiameter, rdiameter))
# Serialize and Deserialize (a preorder way)
def serialize(node):
if node == None:
return
visit(node.value)
serialize(node.left)
serialize(node.right)
def deserialize(a):
if a is None:
return
if a[0] is None:
return None
node = Node(a[0])
a = a[1:] # Since list has no has_next function
node.left = deserialize(a)
node.right = deserialize(a)
return node
|
'''
Take name and two grades from many students
ONE LIST -> Nested list
Show a final grade from each student with the average grade
first show the final grade
Then ask if want to get the individual grade
'''
main_grade = list()
while True:
name = str(input('Name: '))
grade1 = float(input('First grade: '))
grade2 = float(input('Second grade: '))
avg = (grade1 + grade2)/2
main_grade.append([name,[grade1, grade2], avg])
opt = str(input("Continue? [Y/N] ")).lower()
if 'n' in opt:
break
for i, a in enumerate(main_grade):
print(f'{i}: {a[0]:^20}:{a[2]}')
|
class Bag:
def __init__(self, bag_name):
self.name = bag_name
self.children_names = [bag_name]
self.children_counts = [1]
self.contained_bags = 0
def is_empty(self):
return len(self.children_names) == 0
def contains(self, bag_name):
return bag_name in self.children_names
def unpack_once(self, rules):
new_children = {}
for name, count in zip(self.children_names, self.children_counts):
rule = rules[name]
for childname, childcount in zip(rule.children_names, rule.children_counts):
if childname in new_children:
new_children[childname] += count * childcount
else:
new_children[childname] = count * childcount
new_children_names = []
new_children_counts = []
for name in new_children:
new_children_names.append(name)
new_children_counts.append(new_children[name])
self.children_counts = new_children_counts
self.children_names = new_children_names
self.contained_bags += sum(new_children_counts)
def __repr__(self):
repr_str = f"BAG: {self.name} = "
for name, count in zip(self.children_names, self.children_counts):
repr_str += f"{name}:{count} "
return repr_str
|
def schoolbook_operand_scanning(SRC1, SRC2, DEST, t, n):
"""
This generates a simple static schoolbook multiplication of n by n;
assumes SRC1 and SRC2 registers with pointers to where n elements live,
writes 2n-1 elements to the DEST pointer
"""
yield "mov r11, #0"
for i in range(2*n - 1):
yield f"strh r11, [{DEST}, #{2*i}]"
for i in range(n):
yield f"ldrh r10, [{SRC1}, #{2*i}]"
for j in range(n):
yield f"ldrh r12, [{SRC2}, #{2*j}]"
yield f"ldrh r11, [{DEST}, #{2*(i + j)}]"
yield "mla r11, r10, r12, r11"
yield f"strh r11, [{DEST}, #{2*(i + j)}]"
|
# Networking settings
HOST = 'localhost'
PORT = 8000
TIMEOUT = 500
KEEP_ALIVE = False
# Validator settings
VALIDATOR_HOST = 'localhost'
VALIDATOR_PORT = 4004
# Database settings
DB_HOST = 'localhost'
DB_PORT = 28015
DB_NAME = 'marketplace'
# Runtime settings
DEBUG = True
# Secret keys
# WARNING! These defaults are insecure, and should be changed for deployment
SECRET_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' # any string
AES_KEY = 'ffffffffffffffffffffffffffffffff' # 32 character hex string
BATCHER_PRIVATE_KEY = '1111111111111111111111111111111111111111111111111111111111111111' # 64 character hex string
BATCHER_PRIVATE_KEY_FILE_NAME_HOSPITAL = 'hospitalWEB'
# BATCHER_PRIVATE_KEY_FILE_NAME_DOCTOR = 'doctorWEB'
BATCHER_PRIVATE_KEY_FILE_NAME_PATIENT = 'patientWEB'
BATCHER_PRIVATE_KEY_FILE_NAME_INVESTIGATOR = 'investigatorWEB'
# BATCHER_PRIVATE_KEY_FILE_NAME_INSURANCE = 'insuranceWEB'
|
"""
Counting Sort is kind of algorithm that works only to integers.
The idea is to pre-allocate array of arrays with the len of source list,
then traverse unsorted list putting each num at correct place (index) using some key function (`j % len(src)-1` in my case),
finally traverse that array of arrays items in order and return them.
Given n keys are integers (fitting in a word) ∈ 0, 1, . . . , k − 1
Linear-time Sorting; Time and Space complexity both are Θ(n + k)
Implementation adopted from MIT 6.006 course. Here is more explanation about it
https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/lecture-videos/MIT6_006F11_lec07.pdf
"""
def count_sort(src):
L = [[] for _ in range(len(src))] # e.g., [[], [], [], [], []]
for j in src:
L[j % len(src)-1].append(j) # e.g., [[1, 1], [2], [], [4], [5]]
output = []
for i in L:
output.extend(i)
return output
if __name__ == '__main__':
unsorted_int_list = [4, 1, 2, 5, 1]
assert count_sort(unsorted_int_list) == [1, 1, 2, 4, 5]
|
"""
Exceptions for events app
To have so many exception types might be a little over the top, but ...
"""
class EventException(Exception):
"""Base exception type for events app"""
class UserRegistrationException(EventException):
"""Base class for exceptions that can be raised when a user trys to register for an event"""
def __init__(self, *args, event=None, user=None):
super().__init__(*args)
self.event = event
self.user = user
class RegistrationNotRequiredException(UserRegistrationException):
"""Raised when a user tries to register to an event without registration"""
class RegistrationNotOpen(UserRegistrationException):
"""Raised when a user tries to register to and that is not open for registration"""
class RegistrationAlreadyExists(UserRegistrationException):
"""Raised if user already registered to the event"""
class RegistrationNotAllowed(UserRegistrationException):
"""Raised if the user is not allowed to register to an event"""
class EventFullException(UserRegistrationException):
"""Raised if all places are taken on an event"""
class DeregistrationClosed(UserRegistrationException):
"""Raised when a user tries to deregister from an event after the deregistration deadline"""
class UserAttendanceException(EventException):
"""Base class for exceptions that can be raised when a user trys to register for an event"""
def __init__(
self,
*args,
eventregistration=None,
user=None,
identification_string=None,
method=None
):
super().__init__(*args)
self.eventregistration = eventregistration
self.identification_string = identification_string
self.method = None
class EventNotStartedException(EventException):
"""Raised when a user tries to start an event before event has started"""
class UserNotAttending(UserAttendanceException):
"""Raised whten the user is on the waiting list"""
class UserAlreadyRegistered(UserAttendanceException):
"""Raised when users attendance already has been registered"""
class UserNotPaid(UserAttendanceException):
"""Raised when the user has not paid for their ticket. This exception is not used but might be used in the future"""
|
#Faça um programa que leia tres numeros e mostre qual é o maior e qual é o menor.
numero = float(input('Digite um numero: '))
numeroII = float(input('Digite outro numero: '))
numeroIII = float(input('Digite outro numero: '))
if numero > numeroII:
maior = numero
else:
maior = numeroII
if maior > numeroIII:
print('O maior número é o {}'.format(maior))
else:
print('O maior numero é o {}'.format(numeroIII))
if numero < numeroII:
menor = numero
else:
menor = numeroII
if menor < numeroIII:
print('Menor numero é o {}'.format(menor))
else:
print('Menor numero é o {}'.format(numeroIII))
|
ROLES = ["administrator", "developer", "newswriter", "repositories"]
# Scenario: Try to add a role that 'admin' already has.
try:
output = instance.execute(
["sudo", "criticctl", "addrole",
"--name", "admin",
"--role", "administrator"])
expected_output = "admin: user already has role 'administrator'"
if expected_output not in output.splitlines():
logger.error("Expected output not found: %r\n%s"
% (expected_output, output))
except testing.virtualbox.GuestCommandError as error:
logger.error("correct criticctl usage failed:\n%s"
% error.stdout)
# Scenario: Try to delete a role 'alice' doesn't have.
try:
output = instance.execute(
["sudo", "criticctl", "delrole",
"--name", "alice",
"--role", "administrator"])
expected_output = "alice: user doesn't have role 'administrator'"
if expected_output not in output.splitlines():
logger.error("Expected output not found: %r\n%s"
% (expected_output, output))
except testing.virtualbox.GuestCommandError as error:
logger.error("correct criticctl usage failed:\n%s"
% error.stdout)
# Scenario: Try to add a role to a non-existing user.
try:
instance.execute(
["sudo", "criticctl", "addrole",
"--name", "nosuchuser",
"--role", "administrator"])
except testing.virtualbox.GuestCommandError as error:
if "nosuchuser: no such user" not in error.stdout.splitlines():
logger.error("criticctl failed with unexpected error message:\n%s"
% error.stdout)
else:
logger.error("incorrect criticctl usage did not fail: "
"addrole, non-existing user")
# Scenario: Try to delete a role from a non-existing user.
try:
instance.execute(
["sudo", "criticctl", "delrole",
"--name", "nosuchuser",
"--role", "administrator"])
except testing.virtualbox.GuestCommandError as error:
if "nosuchuser: no such user" not in error.stdout.splitlines():
logger.error("criticctl failed with unexpected error message:\n%s"
% error.stdout)
else:
logger.error("incorrect criticctl usage did not fail: "
"delrole, non-existing user")
# Scenario: Try to add an invalid role.
try:
instance.execute(
["sudo", "criticctl", "addrole",
"--name", "alice",
"--role", "joker"])
except testing.virtualbox.GuestCommandError as error:
if "invalid choice: 'joker'" not in error.stderr:
logger.error("criticctl failed with unexpected error message:\n%s"
% error.stderr)
else:
logger.error("incorrect criticctl usage did not fail: "
"addrole, invalid role")
# Scenario: Try to delete an invalid role.
try:
instance.execute(
["sudo", "criticctl", "delrole",
"--name", "alice",
"--role", "joker"])
except testing.virtualbox.GuestCommandError as error:
if "invalid choice: 'joker'" not in error.stderr:
logger.error("criticctl failed with unexpected error message:\n%s"
% error.stderr)
else:
logger.error("incorrect criticctl usage did not fail: "
"delrole, invalid role")
# Scenario: Add and then delete each role.
def test_role(role):
try:
instance.execute(
["sudo", "criticctl", "addrole",
"--name", "alice",
"--role", role])
except testing.virtualbox.GuestCommandError as error:
logger.error("correct criticctl usage failed:\n%s"
% error.stdout)
else:
try:
instance.execute(
["sudo", "criticctl", "delrole",
"--name", "alice",
"--role", role])
except testing.virtualbox.GuestCommandError as error:
logger.error("correct criticctl usage failed:\n%s"
% error.stdout)
for role in ROLES:
test_role(role)
|
assert 1 + 1 == 2
try:
assert 1 + 1 == 3
except AssertionError as err:
print(err.__class__)
try:
assert 2 + 2 == 5, 'Only for very large values of 2'
except AssertionError as err:
print(err)
"""
<class 'AssertionError'>
Only for very large values of 2
"""
|
'''
Created on Aug 15, 2009
@author: santiago
'''
|
class KeyValueStorage:
def __init__(self, name, env, wtx, dupsort=False):
self.name = name.encode("utf-8")
self.env = env
self.main_db = self.env.open_db(self.name + b'_main_db', txn=wtx, dupsort=dupsort)
def put(self, key, value, wtx, dupdata=False):
return wtx.put( bytes(key), bytes(value), db=self.main_db, dupdata=dupdata)
def get(self, key, rtx):
return rtx.get( bytes(key), db=self.main_db)
def remove(self, key, wtx, value=None):
return wtx.delete( bytes(key), value= value, db=self.main_db)
def has(self, key, rtx):
return not (self.get( bytes(key), rtx=rtx)==None)
|
a = input()
print(a)
name = input("Enter your name: ")
print(f'Welcome {name}!')
age = input("Enter your age:")
print(age)
print("Hello " + input("Enter your name ")+"!")
None
weapons = None
print(weapons)
name = input("Enter your name")
# print(name)
print(f'Welcome {name} !')
print("Hello " + input("Enter your name ") + "!")
None
weapons = None
print(weapons)
|
def parse_bytes(value, default=0, suffixes='bkmgtp'):
# 将输入的内容(500K,2.5M)转化为字节的int
try:
last = value[-1].lower()
except(TypeError, KeyError, IndexError):
return default
if last in suffixes:
mul = 1024 ** suffixes.index(last)
value = value[:-1]
else:
mul = 1
try:
return round(float(value) * mul)
except ValueError:
return default
|
# edad = int(input("Escribe tu edad: "))
# if edad > 17:
# print('Eres mayor de edad')
# else:
# print('Eres menor de edad')
numero = int(input('Escribe un número: '))
if numero > 5:
print('Es mayor a 5')
elif numero == 5:
print('Es igual a 5')
else:
print('Es menor a 5')
#if True:
# pass
#else:
# pass
#pass palabra reservada para saltar el bloque
#----------------------------------------------------------
# num_1 = int(input('Escoge un entero: '))
# num_2 = int(input('Escoge otro entero: '))
# if num_1 > num_2:
# print('El primer numero es mayor que el segundo')
# elif num_1 < num_2:
# print('El segundo numero es mayor que el primero')
# else:
# print('Los dos numeros son iguales')
|
def scala_proto_register_toolchains():
native.register_toolchains("@io_bazel_rules_scala//scala_proto:default_toolchain")
def scala_proto_register_enable_all_options_toolchain():
native.register_toolchains("@io_bazel_rules_scala//scala_proto:enable_all_options_toolchain")
|
class Generator(nn.Module):
def __init__(self):
super().__init__()
self.noise_branch = nn.Sequential(
nn.ConvTranspose2d(noise_dim, d * 8, kernel_size=4, stride=1, padding=0, bias=False),
norm_layer(d * 8),
nn.ReLU(True)
)
self.label_branch = nn.Sequential(
nn.ConvTranspose2d(10, d * 8, 4, 1, 0, bias=False),
norm_layer(d * 8),
nn.ReLU(True)
)
self.generator = nn.Sequential(
nn.ConvTranspose2d( d * 16, d * 8, 4, 2, 1, bias=False),
norm_layer(d * 8),
nn.ReLU(True),
nn.ConvTranspose2d(d * 8, d * 4, 4, 2, 1, bias=False),
norm_layer(d * 4),
nn.ReLU(True),
nn.ConvTranspose2d(d * 4, 1, 4, 2, 1, bias=False),
nn.Tanh()
)
def forward(self, z, y):
z = self.noise_branch(z)
y = self.label_branch(y)
zy_concatenated = torch.cat([z, y], dim=1)
o = self.generator(zy_concatenated)
return o
Generator()(torch.randn(10, noise_dim, 1, 1), one_hot(y)).shape
|
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
QUERY_FORMAT = "?q={}"
DASHBOARDS_API_URL = "api/v1/dashboard/"
DASHBOARDS_API_URL_WITH_QUERY_FORMAT = DASHBOARDS_API_URL + QUERY_FORMAT
DASHBOARD_API_URL_FORMAT = DASHBOARDS_API_URL + "{}"
EXPORT_DASHBOARDS_API_URL = DASHBOARDS_API_URL + "export/"
EXPORT_DASHBOARDS_API_URL_WITH_QUERY_FORMAT = EXPORT_DASHBOARDS_API_URL + QUERY_FORMAT
GET_DASHBOARD_VIEW_URL_FORMAT = "/spotrix/dashboard/{}/"
SAVE_DASHBOARD_URL_FORMAT = "/spotrix/save_dash/{}/"
COPY_DASHBOARD_URL_FORMAT = "/spotrix/copy_dash/{}/"
ADD_SLICES_URL_FORMAT = "/spotrix/add_slices/{}/"
DELETE_DASHBOARD_VIEW_URL_FORMAT = "/dashboard/delete/{}"
GET_DASHBOARDS_LIST_VIEW = "/dashboard/list/"
NEW_DASHBOARD_URL = "/dashboard/new/"
GET_CHARTS_API_URL = "/api/v1/chart/"
GAMMA_ROLE_NAME = "Gamma"
ADMIN_USERNAME = "admin"
GAMMA_USERNAME = "gamma"
DASHBOARD_SLUG_OF_ACCESSIBLE_TABLE = "births"
DEFAULT_DASHBOARD_SLUG_TO_TEST = "births"
WORLD_HEALTH_SLUG = "world_health"
|
t = int(input())
answer = []
for a in range(t):
val = int(input())
if(val == 2):
answer.append(2)
elif(val%2 == 1):
answer.append(1)
else:
answer.append(0)
for b in answer:
print(str(b))
|
# Module version
py_version_info = (1, 0, 8)
js_version_info = (0, 1, 13)
# Module version accessible using vitessce.__version__
__version__ = '%s.%s.%s' % (
py_version_info[0], py_version_info[1], py_version_info[2])
|
############### задача 11: номер последнего числа, равного х
def main():
err, num = find('in.txt')
if err==0:
print("answer", num)
elif err==1:
print("Can't open the file")
elif err==2:
print("Bad value")
elif err==3:
print("File is empty")
else:
print("Error")
###############
def find(fn):
val, num = None, None
try:
with open(fn, 'r') as f:
i=0
for word in [s for s1 in f for s2 in s1.split('\n') for s3 in s2.split('\t') for s4 in s3.split(',') for s in s4.split(' ') if s!='']:
try:
x=int(word)
if val==None:
val=x
num=0
else:
if x==val:
num=i
i+=1
except ValueError:
return 2, 0
if num==None:
return 3, 0
else:
return 0, num
except FileNotFoundError:
return 1, 0
###############
main()
|
#isEqual(cad1: "abcd", cad2= "abcd") -> True
def isEqual(cad1,cad2):
diccCad = {}
for key in cad1:
if key in diccCad:
diccCad[key] += 1
else:
diccCad[key] = 1
for key in cad2:
if key in diccCad:
diccCad[key] -= 1
else:
return False
for (key) in diccCad:
if diccCad[key] != 0:
return False
return True
print(isEqual("pancho","panchos"))
|
# Copyright (C) 2019-2021 HERE Europe B.V.
# SPDX-License-Identifier: MIT
"""Project version information."""
# Module version
version_info = (1, 1, 1)
# Module version accessible using here_map_widget.__version__
__version__ = "%s.%s.%s" % (version_info[0], version_info[1], version_info[2],)
EXTENSION_VERSION = "^1.1.1"
|
def run():
my_list = [1, 'Hello', True, 4.5]
my_dict = {'firstname': 'Hector', 'lastname': "Olvera"}
super_list = [
{"firstname": 'Facundo', 'lastname': 'García'},
{'firstname': 'Miguel', 'lastname': 'Torres'},
{'firstname': 'Pepe', 'lastname': 'Rodelo'},
]
super_dict = {
"natural_nums": [0, 1, 2, 3],
"interger_nums": [-2, -1, 0, 1, 2],
"floating_nums": [1.1, -2.3, 4.5],
}
for key, value in super_dict.items():
print(key, '-', value)
if(__name__ == '__main__'):
run()
|
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
SECRET_KEY = 1
INSTALLED_APPS = [
'django_counter_cache_field',
'tests',
]
DEBUG = False
SITE_ID = 1
|
description = 'setup for the status monitor'
group = 'special'
_reactorBlock = Block('Reactor', [
BlockRow(Field(name='Reactor power', dev='ReactorPower', width=6),
)
],
)
_shutterBlock = Block('Shutter', [
BlockRow(Field(name='Prim. shutter', dev='prim_shutt'),
Field(name='Sec. sutter', dev='sec_shutt'),
)
],
)
_hoverBlock = Block('Hover feet', [
BlockRow(Field(name='Gonio/opt.Bench', dev='hover_mono'),
Field(name='Detector', dev='hover_theta'),
)
],
)
_counterBlock = Block('Counter', [
BlockRow(Field(name='Counter', dev='det1'),
Field(name='Monitor', dev='mon1'),
Field(name='Time', dev='timer'),
),
BlockRow(Field(name='Counter rate', dev='det1rate'),
Field(name='Monitor rate', dev='mon1rate'),
)
],
)
_ls340Block = Block('LakeShore', [
BlockRow(Field(name='Temperature', dev='T_ls340'),
Field(name='Target', key='T_ls340/setpoint', unit='K')),
BlockRow(Field(name='Sensor A', dev='T_ls340_A'),
Field(name='Sensor B', dev='T_ls340_B')),
],
setups='',
)
_outsideWorldBlock = Block('Outside world', [
BlockRow(Field(name='Next U-Bahn U6', dev='ubahn', istext=True),
Field(name='Outside T', dev='meteo')),
],
)
_secondRow = Row(
Column(_reactorBlock),
Column(_shutterBlock))
_thirdRow = Row(
Column(_counterBlock),
Column( _ls340Block),
)
_forthRow = Row(
Column(_outsideWorldBlock),
Column(_hoverBlock),
)
devices = dict(
Monitor = device('nicos.services.monitor.qt.Monitor',
title = 'NICOS status monitor',
loglevel = 'info',
cache = 'resictrl.resi.frm2:14869',
# cache = 'localhost',
font = 'Luxi Sans',
fontsize = 10,
timefontsize = 12,
valuefont = 'Droid Sans Mono',
padding = 0,
layout = [_secondRow, _thirdRow, _forthRow],
),
)
|
size = int(input())
matrix = []
for c in range(size):
col = [int(n) for n in input().split(' ')]
matrix.append(col)
primary_diagonal_sum = 0
for i in range(size):
primary_diagonal_sum += matrix[i][i]
print(primary_diagonal_sum)
|
class DetectBaseNotImplementedError(NotImplementedError):
pass
class DetectBase:
def _notimplestr(self, param):
return (
"resource detect must have "
f"{param}\" property."
)
@property
def resource(self):
raise DetectBaseNotImplementedError(
self._notimplestr("resource")
)
@property
def mode(self):
raise DetectBaseNotImplementedError(
self._notimplestr("mode")
)
@property
def check(self):
raise DetectBaseNotImplementedError(
self._notimplestr("check")
)
@property
def threshold(self):
raise DetectBaseNotImplementedError(
self._notimplestr("threshold")
)
@property
def percent(self):
raise DetectBaseNotImplementedError(
self._notimplestr("percent")
)
|
#
# PySNMP MIB module CISCO-LWAPP-DOT11-CCX-CLIENT-DIAG-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-LWAPP-DOT11-CCX-CLIENT-DIAG-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:05:02 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint")
CLDot11ClientDiagAssocReason, CiscoLwappDot11ClientAuthMethod = mibBuilder.importSymbols("CISCO-LWAPP-DOT11-CLIENT-CCX-TC-MIB", "CLDot11ClientDiagAssocReason", "CiscoLwappDot11ClientAuthMethod")
ciscoLwappDot11ClientCcxMIBObjects, cldcClientMacAddress = mibBuilder.importSymbols("CISCO-LWAPP-DOT11-CLIENT-MIB", "ciscoLwappDot11ClientCcxMIBObjects", "cldcClientMacAddress")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
CiscoMilliSeconds, = mibBuilder.importSymbols("CISCO-TC", "CiscoMilliSeconds")
InetAddressType, InetAddress = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
iso, MibIdentifier, NotificationType, ObjectIdentity, Unsigned32, TimeTicks, Integer32, Bits, Counter32, Gauge32, Counter64, IpAddress, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "MibIdentifier", "NotificationType", "ObjectIdentity", "Unsigned32", "TimeTicks", "Integer32", "Bits", "Counter32", "Gauge32", "Counter64", "IpAddress", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn")
MacAddress, DisplayString, TruthValue, TextualConvention, RowStatus, TimeStamp = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "DisplayString", "TruthValue", "TextualConvention", "RowStatus", "TimeStamp")
ciscoLwappDot11CcxClientDiagMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2))
ciscoLwappDot11CcxClientDiagMIB.setRevisions(('2006-04-10 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoLwappDot11CcxClientDiagMIB.setRevisionsDescriptions(('Initial version of this MIB module.',))
if mibBuilder.loadTexts: ciscoLwappDot11CcxClientDiagMIB.setLastUpdated('200606240000Z')
if mibBuilder.loadTexts: ciscoLwappDot11CcxClientDiagMIB.setOrganization('Cisco Systems Inc.')
if mibBuilder.loadTexts: ciscoLwappDot11CcxClientDiagMIB.setContactInfo(' Cisco Systems, Customer Service Postal: 170 West Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS Email: [email protected]')
if mibBuilder.loadTexts: ciscoLwappDot11CcxClientDiagMIB.setDescription("This MIB is intended to be implemented on all those devices operating as Central Controllers (CC) that terminate the Light Weight Access Point Protocol (LWAPP) tunnel from Light-weight Access Points. Link Test is performed to learn the backhaul link quality between two mesh neighboring mesh nodes. The arrangement of the controller (referred to as CC in the diagram) and mesh nodes (RAP and MAP) LWAPP APs ,client(MN) and NMS appear as follows. +.......+ +.......+ + + + + + NMS + + NMS + + + + + +.......+ +.......+ . . . . . . . . . . . . . . +......+ +......+ +......+ +......+ + + + + + + + + + CC + + CC + + CC + + CC + + + + + + + + + +......+ +......+ +......+ +......+ .. . . . .. . . . . . . . . . . . . . . . . . . . . . . . +......+ +......+ +......+ +......+ +......+ + + + + + + + + + + + RAP + + RAP + + RAP + + RAP + + RAP + + + + + + + + + + + +......+ +......+ +......+ +......+ +......+ . . . . . . . . . . . . . . . . . . . . . . . . . +......+ +......+ +......+ +......+ +......+ + + + + + + + + + + + MAP + + MN + + MAP + + MAP + + MAP + + + + + + + + + + + +......+ +......+ +......+ +......+ +......+ . . .. . . . . .. . . . . .. . . . . . . +......+ +......+ +......+ +......+. +......+ + + + + + + + + + + + MAP + + MAP + + MAP + + MAP + + MN + + + + + + + + + + + +......+ +......+ +......+ +......+ +......+ The LWAPP tunnel exists between the controller and the APs. The MNs communicate with the APs through the protocol defined by the 802.11 standard. The controllers and the IDS systems exchange information through Cisco proprietary event exchange mechanisms. LWAPP APs, upon bootup, discover and join one of the controllers and the controller pushes the configuration, that includes the WLAN parameters, to the LWAPP APs. The APs then encapsulate all the 802.11 frames from wireless clients inside LWAPP frames and forward the LWAPP frames to the controller. GLOSSARY Access Point ( AP ) An entity that contains an 802.11 medium access control ( MAC ) and physical layer ( PHY ) interface and provides access to the distribution services via the wireless medium for associated clients. LWAPP APs encapsulate all the 802.11 frames in LWAPP frames and sends them to the controller to which it is logically connected. Central Controller ( CC ) The central entity that terminates the LWAPP protocol tunnel from the LWAPP APs. Throughout this MIB, this entity is also referred to as 'controller'. Mobile Node ( MN ) A roaming 802.11 wireless device in a wireless network associated with an access point. Mobile Node and client are used interchangeably. Network Management System ( NMS ) The station from which the administrator manages the wired and wireless networks. Mesh Node A mesh node is defined as a physical or logical entity in the mesh network participating in forming the mesh backhaul. There are two types of mesh nodes supported in Cisco mesh network:RAP and MAP. Root AP (RAP) The AP forming the bridge between a wired and a mesh network with an Ethernet interface to the wired network and a 802.11 radio interface to the mesh network Mesh AP (MAP). The AP extending wireless coverage similar to a repeater in a mesh network and consists of a 802.11 uplink and a 802.11 downlink. On a single-radio backhaul, both uplink and downlink exist on the same radio and are logical links only. On a multi-radio backhaul, they may exist on different radios.MAP APs associates directly with RAP APs or with another MAP AP. Each association of AP (MAP-MAP or RAP-MAP) with another AP forms parent-child relationship. Mesh Network Network starting with the wireless backhaul downlink of the RAP and all the entities below except any attached network to the Ethernet link of MAPs. A mesh network below a single RAP is also referred to as a 'Mesh Sector'.A mesh network consists of mesh nodes. A single mesh network is always augmented to a single wired network. Mesh Link A logical 802.11 link between two mesh nodes. A single link is point-to-point. All point-to-multipoint links are considered as multiple mesh links. Often referred to as mesh backhaul link. Mesh Backhaul A Mesh backhaul consists of mesh nodes and mesh links terminating at a RAP. This necessarily creates a one- to-one relationship between a 'mesh network', 'mesh sector' and a 'mesh backhaul' where these terms can be used interchangeably. SNR Signal to Noise ratio on the 802.11 radio. Bridged network The bridged network is defined as the network(s) attached to the Ethernet port of any MAP. There can be multiple such networks attached to a single mesh network. REFERENCE [1] Wireless LAN Medium Access Control ( MAC ) and Physical Layer ( PHY ) Specifications. [2] Draft-obara-capwap-lwapp-00.txt, IETF Light Weight Access Point Protocol ")
ciscoLwappDot11CcxClientDiagMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0))
ciscoLwappDot11CcxClientDiagMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 1))
ciscoLwappDot11CcxClientDiagMIBNotifObjs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 2))
ciscoClientCcxDiagRequest = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1))
ciscoClientCcxDiagResponse = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2))
ciscoClientCcxDiagStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 3))
class CiscoLwappCcxDiagResponseStatus(TextualConvention, Integer32):
description = 'This attribute represents the response status of the ccx diag tests.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 3, 4, 5))
namedValues = NamedValues(("successful", 0), ("fail", 1), ("refused", 3), ("incapable", 4), ("unknown", 5))
class CiscoLwappCcxDiagTestStatus(TextualConvention, Integer32):
description = 'This attribute represents the last test status of the ccx diag tests.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 3, 4, 5))
namedValues = NamedValues(("successful", 0), ("pending", 1), ("timeout", 3), ("stopped", 4), ("mismatch", 5))
class CiscoLwappDot11ClientDot1xCredential(TextualConvention, Integer32):
description = 'This attribute represents the dotx credential identifier.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 255))
namedValues = NamedValues(("pre-sharedkey", 0), ("username-password", 1), ("xdot", 2), ("other-cert", 3), ("one-time-password", 4), ("secure-id-token", 5), ("none", 255))
class CiscoLwappDot11ClientAbortTestReason(TextualConvention, Integer32):
description = 'This attribute represents the reason for abortion of ccx diag test.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2))
namedValues = NamedValues(("reserved", 0), ("timeout", 1), ("cancelled-by-operator", 2))
class CiscoLwappDot11ClientInitiateTest(TextualConvention, Integer32):
description = 'This attribute says whether the test is to be started or aborted.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("initiate-test", 1), ("abort-test", 2))
cldccDiagDhcpTestReqTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 1), )
if mibBuilder.loadTexts: cldccDiagDhcpTestReqTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDhcpTestReqTable.setDescription('This table contains request params for dhcp test to be performed by the client.')
cldccDiagDhcpTestReqEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 1, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagDhcpTestReqEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDhcpTestReqEntry.setDescription('There is an entry in the table identified by the client mac address.')
cldccDiagDhcpTestReqRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 1, 1, 1), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagDhcpTestReqRowStatus.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDhcpTestReqRowStatus.setDescription('This field is used to add/remove entries from this table.To add a row in this table, createAndGo row status will be used.To remove a row, this field will be set to destroy.')
cldccDiagDhcpTestRespTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 1), )
if mibBuilder.loadTexts: cldccDiagDhcpTestRespTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDhcpTestRespTable.setDescription('This table contains response for dhcp test performed by the client.')
cldccDiagDhcpTestRespEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 1, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagDhcpTestRespEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDhcpTestRespEntry.setDescription('There is an entry in the table identified by the client mac address.')
cldccDiagDhcpTestRespDhcpOffer = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 1, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 256))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagDhcpTestRespDhcpOffer.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDhcpTestRespDhcpOffer.setDescription('This field will have the complete set of DHCP options returned in the DHCP Offer.')
cldccDiagPingTestReqTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 2), )
if mibBuilder.loadTexts: cldccDiagPingTestReqTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestReqTable.setDescription('This table contains the parameters for DNS ping test request.')
cldccDiagPingTestReqEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 2, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagPingTestReqEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestReqEntry.setDescription('There is an entry in the table where each entry is identified by the client mac address.')
cldccDiagPingTestType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("dns-server", 1), ("default-gw", 2)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagPingTestType.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestType.setDescription('This field is used to distinguish the type of test.It can be a ping to the dns server or the default gateway.')
cldccDiagPingTestReqRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 2, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagPingTestReqRowStatus.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestReqRowStatus.setDescription('This field is used to add/remove entries from this table.To add a row in this table, createAndGo row status will be used.To remove a row, this field will be set to destroy.')
cldccDiagPingTestRespTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 2), )
if mibBuilder.loadTexts: cldccDiagPingTestRespTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestRespTable.setDescription('This table contains response for Dns ping test request.')
cldccDiagPingTestRespEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 2, 2), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagPingTestRespEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestRespEntry.setDescription('There is an entry in the table where each entry is identified by the client mac address.')
cldccDiagPingTestRespIPAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 2, 2, 1), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagPingTestRespIPAddressType.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestRespIPAddressType.setDescription('The value of this field shall be the IP address type of the destination of the ICMP echo request frames.')
cldccDiagPingTestRespIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 2, 2, 2), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagPingTestRespIPAddress.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestRespIPAddress.setDescription('The value of this field shall be the IP address of the destination of the ICMP Echo Request frames.')
cldccDiagPingTestRespDestMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 2, 2, 3), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagPingTestRespDestMacAddress.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestRespDestMacAddress.setDescription('The value of this field shall be the MAC address of the destination of the ICMP Echo Request frames.')
cldccDiagPingTestRespPingsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 2, 2, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagPingTestRespPingsSent.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestRespPingsSent.setDescription('The value of this field shall be the number of ICMP Echo Request frames sent.')
cldccDiagPingTestRespPingsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 2, 2, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagPingTestRespPingsReceived.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestRespPingsReceived.setDescription('The value of this field shall be the number of ICMP Echo Response frames received.')
cldccDiagPingTestRespMinEchoTIme = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 2, 2, 6), CiscoMilliSeconds()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagPingTestRespMinEchoTIme.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestRespMinEchoTIme.setDescription('The value of this field shall be the shortest time,in milliseconds, between the transmission of an ICMP echo request frame and the receipt of the corresponding ICMP Echo Response frame.')
cldccDiagPingTestRespMaxEchoTIme = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 2, 2, 7), CiscoMilliSeconds()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagPingTestRespMaxEchoTIme.setStatus('current')
if mibBuilder.loadTexts: cldccDiagPingTestRespMaxEchoTIme.setDescription('The value of this field shall be the longest time in milliseconds,between the transmission of an ICMP echo Request between the transmission of an ICMP echo request frame and the receipt of the corresponding ICMP echo response frame. ICMP echo request frames for which no corresponding response is received shall be ignored in the determination of this value.')
cldccDiagDnsNameResolTestReqTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 3), )
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestReqTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestReqTable.setDescription('This table contains Dns Name resolution request params to be used for sending out a Diagnostic request to a client for resolving a network name.')
cldccDiagDnsNameResolTestReqEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 3, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestReqEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestReqEntry.setDescription('There is an entry in the table where each entry is identified by the client mac address.')
cldccDiagDnsNameResolTestReqNetworkName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 3, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 256))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestReqNetworkName.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestReqNetworkName.setDescription('This is the name of the network which will be resolved by the client and the result reported to the controller.')
cldccDiagDnsNameResolTestReqRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 3, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestReqRowStatus.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestReqRowStatus.setDescription('This field is used to add/remove entries from this table.To add a row in this table, createAndGo row status will be used.To remove a row, this field will be set to destroy.')
cldccDiagDnsNameResolTestRespTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 3), )
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestRespTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestRespTable.setDescription('This table contains Dns Name Resolution test results sent by the client to the controller.')
cldccDiagDnsNameResolTestRespEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 3, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestRespEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestRespEntry.setDescription('There is an entry in the table where each entry is identified by a client mac address.')
cldccDiagDnsNameResolTestRespIpAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 3, 1, 1), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestRespIpAddressType.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestRespIpAddressType.setDescription('This is type of the ip address of the DNS server whose name was sent in the request.')
cldccDiagDnsNameResolTestRespIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 3, 1, 2), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestRespIpAddress.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestRespIpAddress.setDescription('This is the ip address of the DNS server whose name was sent in the request.')
cldccDiagDnsNameResolTestRespServerName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 256))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestRespServerName.setStatus('current')
if mibBuilder.loadTexts: cldccDiagDnsNameResolTestRespServerName.setDescription('This is the name of the server whose ip address was resolved.')
cldccDiagAssociationTestReqTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 4), )
if mibBuilder.loadTexts: cldccDiagAssociationTestReqTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssociationTestReqTable.setDescription('This table contains association test request values for various clients.')
cldccDiagAssociationTestReqEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 4, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagAssociationTestReqEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssociationTestReqEntry.setDescription('There is an entry in the table for each entry identified by the client mac address.')
cldccDiagAssocTestReqBssid = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 4, 1, 1), MacAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAssocTestReqBssid.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssocTestReqBssid.setDescription('This is the bssid of the AP which the client has to try connecting to as a part of association test.')
cldccDiagAssocTestReqSsid = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 4, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAssocTestReqSsid.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssocTestReqSsid.setDescription('This is the name of the SSID which the client has to try connecting to as a part of association test.')
cldccDiagAssocTestReqChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAssocTestReqChannel.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssocTestReqChannel.setDescription('This is channel number on which the client will try to connect to the AP.')
cldccDiagAssocTestReqBand = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAssocTestReqBand.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssocTestReqBand.setDescription('This is band on which the client will try to connect to the AP.')
cldccDiagAssocTestReqPhyType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAssocTestReqPhyType.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssocTestReqPhyType.setDescription('This is phy type.')
cldccDiagAssocTestReqRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 4, 1, 6), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAssocTestReqRowStatus.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssocTestReqRowStatus.setDescription('This field is used to add/remove entries from this table.To add a row in this table, createAndGo row status will be used.To remove a row, this field will be set to destroy.')
cldccDiagAssociationTestRespTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 4), )
if mibBuilder.loadTexts: cldccDiagAssociationTestRespTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssociationTestRespTable.setDescription('This table contains association test response values for various clients.')
cldccDiagAssociationTestRespEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 4, 4), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagAssociationTestRespEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssociationTestRespEntry.setDescription('There is an entry in the table for each entry identified by the client mac address.')
cldccDiagAssociationTestRespIsAssocComplete = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 4, 4, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagAssociationTestRespIsAssocComplete.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssociationTestRespIsAssocComplete.setDescription('Value of this field shall be 1 if the 802.11 association concluded normally,0 otherwise.')
cldccDiagAssocTestRespReturnedStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 4, 4, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagAssocTestRespReturnedStatus.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssocTestRespReturnedStatus.setDescription('Value of this field shall be the value returned in the final 802.11 association response frame during the test. ')
cldccDiagAuthenticationTestReqTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 5), )
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqTable.setDescription('This table contains association test request values for various clients.')
cldccDiagAuthenticationTestReqEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 5, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqEntry.setDescription('There is an entry in the table for each entry identified by the client mac address.')
cldccDiagAuthenticationTestReqBssid = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 5, 1, 1), MacAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqBssid.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqBssid.setDescription('This is the name of the AP which the client has to try connecting to as a part of authentication test.')
cldccDiagAuthenticationTestReqProfileId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 5, 1, 2), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqProfileId.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqProfileId.setDescription('This is the name of the ProfileId which the client has to try connecting to as a part of authentication test.')
cldccDiagAuthenticationTestReqChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 5, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqChannel.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqChannel.setDescription('This attribute represents the channel number.')
cldccDiagAuthenticationTestReqBand = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 5, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqBand.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqBand.setDescription('This attribute represents the band.')
cldccDiagAuthenticationTestReqPhyType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 5, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqPhyType.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqPhyType.setDescription('This attribute represents the phy type.')
cldccDiagAuthenticationTestReqRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 5, 1, 9), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqRowStatus.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestReqRowStatus.setDescription('This field is used to add/remove entries from this table.To add a row in this table,createAndGo row status will be used.To remove a row, this field will be set to destroy.')
cldccDiagAuthenticationTestRespTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 5), )
if mibBuilder.loadTexts: cldccDiagAuthenticationTestRespTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestRespTable.setDescription('This table contains authentication test response values for various clients.')
cldccDiagAuthenticationTestRespEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 5, 5), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagAuthenticationTestRespEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestRespEntry.setDescription('There is an entry in the table for each entry identified by the client mac address.')
cldccDiagAuthenticationTestRespIsCompleted = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 5, 5, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagAuthenticationTestRespIsCompleted.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestRespIsCompleted.setDescription('Value of this field shall be 1 if the 802.11 association concluded normally,0 otherwise.')
cldccDiagAuthenticationTestRespReturnedStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 5, 5, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagAuthenticationTestRespReturnedStatus.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestRespReturnedStatus.setDescription('Value of this field shall be the value returned in the final 802.11 authentication response frame during the test ')
cldccDiagAuthenticationTestRespEAPMethod = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 5, 5, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagAuthenticationTestRespEAPMethod.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAuthenticationTestRespEAPMethod.setDescription('Value of this field shall be the EAP method returned in the final 802.11 authentication response frame during the test. ')
cldccDiagMsgDisplayReqTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 6), )
if mibBuilder.loadTexts: cldccDiagMsgDisplayReqTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagMsgDisplayReqTable.setDescription('This table contains message display request values for various clients.')
cldccDiagMsgDisplayReqEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 6, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagMsgDisplayReqEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagMsgDisplayReqEntry.setDescription('There is an entry in the table for each entry identified by the client mac address.')
cldccDiagMsgDisplayMsgType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 6, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33))).clone(namedValues=NamedValues(("invalid-ssid", 1), ("invalid-network-settings", 2), ("wlan-capability-mismatch", 3), ("bad-credentials", 4), ("call-support", 5), ("problem-resolved", 6), ("resolution-incomplete", 7), ("try-again-later", 8), ("user-action-required", 9), ("trouble-shooting-refused-by-network", 10), ("retrieving-client-reports", 11), ("retrieving-client-logs", 12), ("retrieval-complete", 13), ("begining-association-test", 14), ("begining-dhcp-test", 15), ("begining-network-connectivity-test", 16), ("begining-dns-ping-test", 17), ("begining-name-resolution-test", 18), ("begining-dot1x-test", 19), ("redirecting-client-to-a-profile", 20), ("test-complete", 21), ("test-passed", 22), ("test-failed", 23), ("cancel-diag-channel-operation", 24), ("log-retrieval-refused", 25), ("client-report-retrieval-refused", 26), ("test-request-refused-by-client", 27), ("invalid-network-address", 28), ("known-problem-with-network", 29), ("scheduled-maint-period", 30), ("wlan-security-incorrect", 31), ("waln-encryption-incorrect", 32), ("wlan-auth-incorrect", 33)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagMsgDisplayMsgType.setStatus('current')
if mibBuilder.loadTexts: cldccDiagMsgDisplayMsgType.setDescription('This attribute represents the type of message to be displayed.')
cldccDiagMsgDisplayReqRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 6, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagMsgDisplayReqRowStatus.setStatus('current')
if mibBuilder.loadTexts: cldccDiagMsgDisplayReqRowStatus.setDescription('This field is used to add/remove entries from this table. To add a row in this table, createAndGo row status will be used.To remove a row, this field will be set to destroy.')
cldccDiagProfileRedirectReqTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 7), )
if mibBuilder.loadTexts: cldccDiagProfileRedirectReqTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagProfileRedirectReqTable.setDescription('This table contains profile redirect request values for various clients.')
cldccDiagProfileRedirectReqEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 7, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagProfileRedirectReqEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagProfileRedirectReqEntry.setDescription('There is an entry in the table for each entry identified by the client mac address.')
cldccDiagProfileRedirectReqProfileId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 7, 1, 1), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagProfileRedirectReqProfileId.setStatus('current')
if mibBuilder.loadTexts: cldccDiagProfileRedirectReqProfileId.setDescription('This attribute represents the profile Id to which the client should be redirected.')
cldccDiagProfileRedirectReqRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 1, 7, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cldccDiagProfileRedirectReqRowStatus.setStatus('current')
if mibBuilder.loadTexts: cldccDiagProfileRedirectReqRowStatus.setDescription('This field is used to add/remove entries from this table. To add a row in this table, createAndGo row status will be used.To remove a row, this field will be set to destroy.')
cldccDiagMsgDisplayRespTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 6), )
if mibBuilder.loadTexts: cldccDiagMsgDisplayRespTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagMsgDisplayRespTable.setDescription('This table contains message display request values for various clients.')
cldccDiagMsgDisplayRespEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 6, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagMsgDisplayRespEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagMsgDisplayRespEntry.setDescription('There is an entry in the table for each entry identified by the client mac address.')
cldccDiagMsgDisplayRespString = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 6, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 256))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagMsgDisplayRespString.setStatus('current')
if mibBuilder.loadTexts: cldccDiagMsgDisplayRespString.setDescription('This is string which was sent to the client for display.')
cldccDiagTestLoggedFrameTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 8), )
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameTable.setDescription('This table contains logged frame data.')
cldccDiagTestLoggedFrameEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 8, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"), (0, "CISCO-LWAPP-DOT11-CCX-CLIENT-DIAG-MIB", "cldccDiagTestLoggedFrameIndex"))
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameEntry.setDescription('There is an entry in the table where each entry is identified by the client mac address.')
cldccDiagTestLoggedFrameIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 8, 1, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameIndex.setStatus('current')
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameIndex.setDescription('The value of this field shall be the ordinal value of the logged frame.')
cldccDiagTestLoggedFrameDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 8, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("up", 0), ("down", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameDirection.setStatus('current')
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameDirection.setDescription('The value of this field shall be zero, when the logged frame in the Frame Content field is sent from (transmitted by) the client. It shall be one, otherwise.')
cldccDiagTestLoggedFrameTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 8, 1, 3), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameTimeStamp.setStatus('current')
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameTimeStamp.setDescription('The value of this field shall be the timestamp value of the logged frame.')
cldccDiagTestLoggedFrameData = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 2, 8, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 4096))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameData.setStatus('current')
if mibBuilder.loadTexts: cldccDiagTestLoggedFrameData.setDescription('The value of this field shall be the actual frame that was transmitted or received.')
cldccDiagTestStatusTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 3, 1), )
if mibBuilder.loadTexts: cldccDiagTestStatusTable.setStatus('current')
if mibBuilder.loadTexts: cldccDiagTestStatusTable.setDescription('This table contains the status params for all the tests performed on the client.')
cldccDiagTestStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 3, 1, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-CLIENT-MIB", "cldcClientMacAddress"))
if mibBuilder.loadTexts: cldccDiagTestStatusEntry.setStatus('current')
if mibBuilder.loadTexts: cldccDiagTestStatusEntry.setDescription('There is an entry in the table identified by the client mac address.')
cldccDiagTestLastTestStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 3, 1, 1, 1), CiscoLwappCcxDiagTestStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagTestLastTestStatus.setStatus('current')
if mibBuilder.loadTexts: cldccDiagTestLastTestStatus.setDescription('This field is used to represent the status of the last test performed.')
cldccDiagTestLastResponseStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 0, 3, 1, 1, 2), CiscoLwappCcxDiagResponseStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldccDiagTestLastResponseStatus.setStatus('current')
if mibBuilder.loadTexts: cldccDiagTestLastResponseStatus.setDescription('This field is used to represent the response of the last test performed.')
cldccDiagClientMacAddress = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 2, 1), MacAddress()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: cldccDiagClientMacAddress.setStatus('current')
if mibBuilder.loadTexts: cldccDiagClientMacAddress.setDescription('This object indicates the macaddress of the client associated to the diagnostic WLAN. ')
cldccDiagAssocReasonCode = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 2, 2), CLDot11ClientDiagAssocReason()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: cldccDiagAssocReasonCode.setStatus('current')
if mibBuilder.loadTexts: cldccDiagAssocReasonCode.setDescription('This object indicates the reason code for which the client has associated the diagnostic WLAN.')
cldccDiagClientAssociatedToDiagWlan = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 599, 3, 2, 1, 1)).setObjects(("CISCO-LWAPP-DOT11-CCX-CLIENT-DIAG-MIB", "cldccDiagClientMacAddress"), ("CISCO-LWAPP-DOT11-CCX-CLIENT-DIAG-MIB", "cldccDiagAssocReasonCode"))
if mibBuilder.loadTexts: cldccDiagClientAssociatedToDiagWlan.setStatus('current')
if mibBuilder.loadTexts: cldccDiagClientAssociatedToDiagWlan.setDescription('This notification is generated when a client associates to a diagnostic WLAN. ')
mibBuilder.exportSymbols("CISCO-LWAPP-DOT11-CCX-CLIENT-DIAG-MIB", cldccDiagProfileRedirectReqProfileId=cldccDiagProfileRedirectReqProfileId, cldccDiagTestLoggedFrameIndex=cldccDiagTestLoggedFrameIndex, cldccDiagAuthenticationTestRespTable=cldccDiagAuthenticationTestRespTable, cldccDiagDhcpTestReqRowStatus=cldccDiagDhcpTestReqRowStatus, cldccDiagAssociationTestReqEntry=cldccDiagAssociationTestReqEntry, cldccDiagPingTestRespEntry=cldccDiagPingTestRespEntry, PYSNMP_MODULE_ID=ciscoLwappDot11CcxClientDiagMIB, ciscoLwappDot11CcxClientDiagMIBObjects=ciscoLwappDot11CcxClientDiagMIBObjects, ciscoLwappDot11CcxClientDiagMIBNotifObjs=ciscoLwappDot11CcxClientDiagMIBNotifObjs, cldccDiagAssocTestReqBssid=cldccDiagAssocTestReqBssid, cldccDiagAuthenticationTestRespEAPMethod=cldccDiagAuthenticationTestRespEAPMethod, cldccDiagMsgDisplayReqRowStatus=cldccDiagMsgDisplayReqRowStatus, cldccDiagPingTestRespTable=cldccDiagPingTestRespTable, cldccDiagProfileRedirectReqTable=cldccDiagProfileRedirectReqTable, cldccDiagAuthenticationTestReqBssid=cldccDiagAuthenticationTestReqBssid, cldccDiagDhcpTestReqEntry=cldccDiagDhcpTestReqEntry, cldccDiagTestStatusTable=cldccDiagTestStatusTable, cldccDiagAssocTestReqSsid=cldccDiagAssocTestReqSsid, cldccDiagMsgDisplayReqEntry=cldccDiagMsgDisplayReqEntry, cldccDiagDnsNameResolTestRespServerName=cldccDiagDnsNameResolTestRespServerName, cldccDiagAssocTestRespReturnedStatus=cldccDiagAssocTestRespReturnedStatus, cldccDiagMsgDisplayRespString=cldccDiagMsgDisplayRespString, cldccDiagMsgDisplayRespEntry=cldccDiagMsgDisplayRespEntry, CiscoLwappDot11ClientDot1xCredential=CiscoLwappDot11ClientDot1xCredential, cldccDiagPingTestReqTable=cldccDiagPingTestReqTable, cldccDiagPingTestReqEntry=cldccDiagPingTestReqEntry, cldccDiagAuthenticationTestRespEntry=cldccDiagAuthenticationTestRespEntry, cldccDiagAssociationTestRespEntry=cldccDiagAssociationTestRespEntry, cldccDiagDnsNameResolTestReqNetworkName=cldccDiagDnsNameResolTestReqNetworkName, cldccDiagPingTestReqRowStatus=cldccDiagPingTestReqRowStatus, ciscoClientCcxDiagResponse=ciscoClientCcxDiagResponse, cldccDiagTestLoggedFrameTimeStamp=cldccDiagTestLoggedFrameTimeStamp, cldccDiagAssocTestReqRowStatus=cldccDiagAssocTestReqRowStatus, cldccDiagAuthenticationTestReqChannel=cldccDiagAuthenticationTestReqChannel, cldccDiagPingTestRespIPAddressType=cldccDiagPingTestRespIPAddressType, cldccDiagPingTestRespDestMacAddress=cldccDiagPingTestRespDestMacAddress, cldccDiagMsgDisplayReqTable=cldccDiagMsgDisplayReqTable, cldccDiagAuthenticationTestRespIsCompleted=cldccDiagAuthenticationTestRespIsCompleted, CiscoLwappDot11ClientAbortTestReason=CiscoLwappDot11ClientAbortTestReason, cldccDiagTestLastResponseStatus=cldccDiagTestLastResponseStatus, ciscoClientCcxDiagStatus=ciscoClientCcxDiagStatus, cldccDiagTestStatusEntry=cldccDiagTestStatusEntry, cldccDiagAuthenticationTestReqEntry=cldccDiagAuthenticationTestReqEntry, cldccDiagPingTestRespIPAddress=cldccDiagPingTestRespIPAddress, cldccDiagDhcpTestRespDhcpOffer=cldccDiagDhcpTestRespDhcpOffer, cldccDiagDnsNameResolTestRespIpAddress=cldccDiagDnsNameResolTestRespIpAddress, cldccDiagAssociationTestReqTable=cldccDiagAssociationTestReqTable, cldccDiagAuthenticationTestReqTable=cldccDiagAuthenticationTestReqTable, cldccDiagAuthenticationTestReqRowStatus=cldccDiagAuthenticationTestReqRowStatus, cldccDiagPingTestRespPingsSent=cldccDiagPingTestRespPingsSent, CiscoLwappCcxDiagTestStatus=CiscoLwappCcxDiagTestStatus, cldccDiagAuthenticationTestReqPhyType=cldccDiagAuthenticationTestReqPhyType, cldccDiagDnsNameResolTestRespIpAddressType=cldccDiagDnsNameResolTestRespIpAddressType, CiscoLwappCcxDiagResponseStatus=CiscoLwappCcxDiagResponseStatus, cldccDiagDhcpTestRespTable=cldccDiagDhcpTestRespTable, cldccDiagPingTestRespMinEchoTIme=cldccDiagPingTestRespMinEchoTIme, cldccDiagAuthenticationTestReqBand=cldccDiagAuthenticationTestReqBand, cldccDiagDnsNameResolTestReqTable=cldccDiagDnsNameResolTestReqTable, cldccDiagMsgDisplayRespTable=cldccDiagMsgDisplayRespTable, cldccDiagDhcpTestReqTable=cldccDiagDhcpTestReqTable, cldccDiagClientAssociatedToDiagWlan=cldccDiagClientAssociatedToDiagWlan, cldccDiagAssociationTestRespTable=cldccDiagAssociationTestRespTable, ciscoLwappDot11CcxClientDiagMIB=ciscoLwappDot11CcxClientDiagMIB, CiscoLwappDot11ClientInitiateTest=CiscoLwappDot11ClientInitiateTest, cldccDiagTestLoggedFrameEntry=cldccDiagTestLoggedFrameEntry, cldccDiagDnsNameResolTestRespEntry=cldccDiagDnsNameResolTestRespEntry, cldccDiagAssocTestReqPhyType=cldccDiagAssocTestReqPhyType, cldccDiagDnsNameResolTestRespTable=cldccDiagDnsNameResolTestRespTable, cldccDiagAssocTestReqChannel=cldccDiagAssocTestReqChannel, cldccDiagPingTestRespPingsReceived=cldccDiagPingTestRespPingsReceived, cldccDiagAssocReasonCode=cldccDiagAssocReasonCode, cldccDiagClientMacAddress=cldccDiagClientMacAddress, cldccDiagMsgDisplayMsgType=cldccDiagMsgDisplayMsgType, cldccDiagDnsNameResolTestReqEntry=cldccDiagDnsNameResolTestReqEntry, cldccDiagTestLastTestStatus=cldccDiagTestLastTestStatus, cldccDiagAssociationTestRespIsAssocComplete=cldccDiagAssociationTestRespIsAssocComplete, cldccDiagAuthenticationTestRespReturnedStatus=cldccDiagAuthenticationTestRespReturnedStatus, ciscoClientCcxDiagRequest=ciscoClientCcxDiagRequest, cldccDiagPingTestRespMaxEchoTIme=cldccDiagPingTestRespMaxEchoTIme, cldccDiagDhcpTestRespEntry=cldccDiagDhcpTestRespEntry, ciscoLwappDot11CcxClientDiagMIBNotifs=ciscoLwappDot11CcxClientDiagMIBNotifs, cldccDiagDnsNameResolTestReqRowStatus=cldccDiagDnsNameResolTestReqRowStatus, cldccDiagTestLoggedFrameDirection=cldccDiagTestLoggedFrameDirection, cldccDiagProfileRedirectReqRowStatus=cldccDiagProfileRedirectReqRowStatus, cldccDiagTestLoggedFrameTable=cldccDiagTestLoggedFrameTable, cldccDiagTestLoggedFrameData=cldccDiagTestLoggedFrameData, cldccDiagAssocTestReqBand=cldccDiagAssocTestReqBand, cldccDiagPingTestType=cldccDiagPingTestType, cldccDiagProfileRedirectReqEntry=cldccDiagProfileRedirectReqEntry, cldccDiagAuthenticationTestReqProfileId=cldccDiagAuthenticationTestReqProfileId)
|
b1 = True
b2 = True
tab_TT = (b1 == True and b2 == False) or (b1 == False and b2 == True)
## version courte
## tab_TT = (b1 and not b2) or (not b1 and b2)
b1 = True
b2 = False
tab_TF = (b1 == True and b2 == False) or (b1 == False and b2 == True)
b1 = False
b2 = True
tab_FT = (b1 == True and b2 == False) or (b1 == False and b2 == True)
b1 = False
b2 = False
tab_FF = (b1 == True and b2 == False) or (b1 == False and b2 == True)
print('b2 \\ b1 |', True, ' |', False)
print('-'*22)
print(True, ' |', tab_TT, '|', tab_FT)
print(False, ' |', tab_TF, ' |', tab_FF)
# cet operateur est le ou exclusif (xor)
# il peut s'écrire simplement b1 != b2
|
userInput = input("Enter your Sentence: ").upper()
translated = ""
i = len(userInput)-1
while i >= 0:
translated += userInput[i]
i-=1
print(translated)
|
"""
Tipo string
Em Python, um dado é considerado do tipo string sempre que:
- Estiver entre àspas simples -> 'uma string', '234', 'a', 'True', '42,3'
- Estiver entre àspas simples -> "uma string", "234", "a", "True", "42,3"
- Estiver entre àspas simples -> '''uma string''', '''234''', '''a''', '''True''', '''42,3'''
nome = 'Geek University'
print(nome)
print(type(nome))
nome = "Gina's Bar"
print(nome)
print(type(nome))
nome = 'Angelina \nJolie'
print(nome)
print(type(nome))
nome = 'Angelina Jolie'
print(nome)
print(type(nome))
print(nome.upper())
print(nome.lower())
print(nome.split()) # Transforma em uma lista de string
print(nome[0:4]) # Slice de string
print(nome[5:15]) # Slice de string
# [ 0, 1]
# ['Geek', 'University']
print(nome.split()[0])
print(nome.split()[1])
"""
# Estiver entre àspas duplas triplas -> """uma string""", """234""", """a""", """True""", """42,3"""
# [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
# ['G', 'e', 'e', 'k', ' ', 'U', 'n', 'i', 'v', 'e', 'r', 's', 'i', 't', 'y']
nome = 'Geek University'
"""
[::-1] -> Comece do primeiro elemento, vá até o ultimo elemento e inverta
"""
print(nome[::-1]) # Inversão da String Pythônico
print(nome.replace('e', 'i'))
print(type(nome))
nome = 'ana' # Palíndromo
print(nome)
print(nome[::-1])
texto = 'socorram me subino onibus em marrocos' # Palíndromo
print(texto)
print(texto[::-1])
nome = r'Angelina \nJolie'
print(nome)
print(type(nome))
nome = """Angelina
Jolie"""
print(nome)
print(type(nome))
|
def part1(lines):
return 0
def part2(lines):
return 0
if __name__ == '__main__':
with open('input.txt', 'r') as f:
lines = f.read().splitlines()
print(part1(lines))
print(part2(lines))
|
class ValidatorLR0001:
value = None
def __get__(self, obj, objtype=None):
return self.value
def __set__(self, obj, value):
if value is not None:
if not isinstance(value, LR0001):
raise TypeError(f'Expected {value!r} to be LR0100 object')
self.value = value
class LR0001:
def __init__(self, year: int, month: int):
self._year = year
self._month = month
@property
def year(self):
return self._year
@property
def month(self):
return self._month
|
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load(":oss_shim.bzl", "target_utils")
def _wrap_bash_build_in_common_boilerplate(
self_dependency,
bash,
rule_type,
target_name,
volume_min_free_bytes = None):
return """
# CAREFUL: To avoid inadvertently masking errors, we should
# only perform command substitutions with variable
# assignments.
set -ue -o pipefail
# Ensures that changes to the sources of the rule macros cause automatic
# builds & tests on the artifacts they produce.
echo $(location {self_dependency}) > /dev/null
start_time=\\$(date +%s)
# Common sense would tell us to find helper programs via:
# os.path.dirname(os.path.abspath(__file__))
# The benefit of using \\$(exe) is that it does not bake an absolute
# paths into our command. This means the Buck cache continues working
# even if the user moves the repo. `exe` vs `location` is explained in
# `image_package.bzl`. We need `binary_path` because the `exe` macro
# won't get expanded inside a \\$( ... ) context.
binary_path=( $(exe //antlir:artifacts-dir) )
artifacts_dir=\\$( "${{binary_path[@]}}" )
# Future-proofing: keep all Buck target subvolumes under
# "targets/" in the per-repo volume, so that we can easily
# add other types of subvolumes in the future.
binary_path=( $(exe //antlir:volume-for-repo) )
volume_dir=\\$( "${{binary_path[@]}}" "$artifacts_dir" {min_free_bytes} )
subvolumes_dir="$volume_dir/targets"
mkdir -m 0700 -p "$subvolumes_dir"
# Capture output to a tempfile to hide logspam on successful runs.
my_log=`mktemp`
log_on_error() {{
exit_code="$?"
# Always persist the log for debugging purposes.
collected_logs="$artifacts_dir/image_build.log"
(
echo "\n\\$(date) --" \
"\\$(($(date +%s) - start_time)) sec --" \
"{log_description}\n"
cat "$my_log" || :
) |& flock "$collected_logs" tee -a "$collected_logs"
# If we had an error, also dump the log to stderr.
if [[ "$exit_code" != 0 || -n "${{ANTLIR_DEBUG:-}}" ]] ; then
cat "$my_log" 1>&2
fi
rm "$my_log"
}}
# Careful: do NOT replace this with (...) || (...), it will lead
# to `set -e` not working as you expect, because bash is awful.
trap log_on_error EXIT
(
# Log all commands now that stderr is redirected.
set -x
{bash}
# It is always a terrible idea to mutate Buck outputs after creation.
# We have two special reasons that make it even more terrible:
# - [image_layer] Uses a hardlink-based refcounting scheme, as
# and keeps subvolumes in a special location.
# - [image_package] Speeds up the build for the `sendstream_stack`
# format by hardlinking duplicated outputs between targets.
#
# Not using "chmod -R" since Buck cleanup is fragile and cannot handle
# read-only directories.
find "$OUT" '!' -type d -print0 | xargs -0 --no-run-if-empty chmod a-w
) &> >(
# We should not write directly to the file because it appears that
# `systemd-nspawn` with a non-root user will `chown` its stderr
# or stdout. This seems insane, and it prevents us from accessing
# our own logs here. So, proxy the log through a dummy `cat` to
# prevent that `chown` from being able to find the underlying file.
cat > "$my_log"
)
""".format(
bash = bash,
min_free_bytes = volume_min_free_bytes if volume_min_free_bytes else "None",
log_description = "{}:{}(name={})".format(
native.package_name(),
rule_type,
target_name,
),
self_dependency = self_dependency,
)
def _current_target(target_name):
return target_utils.to_label(
# Note: we don't use the `config.get_current_repo_name()` here because
# currently in the OSS setup the current repo ends up being `@`, which
# doesn't work when we compile the layer. It doesn't work because
# a target like `//antlir/compiler/test_images:parent_layer` is not
# equivalent to `@//antlir/compiler/test_images:parent_layer`.
# Technically we should use the current repo name when constructing
# __all__ target labels. That would require a hefty refactor for all
# usages of hard coded targets. This should be done but can wait until
# the OSS repository is ready to be embedded/included in other projects
# as a proper repo/cell.
"",
native.package_name(),
target_name,
)
image_utils = struct(
current_target = _current_target,
wrap_bash_build_in_common_boilerplate =
_wrap_bash_build_in_common_boilerplate,
)
|
def generate_config(context):
"""
Generates config
"""
project_id = context.properties['project']
billing = context.properties['billing']
concurrent_api_activation = context.properties['concurrent_api_activation']
resources = []
for index, api in enumerate(context.properties['apis']):
depends_on = [project_id, billing]
# Serialize the activation of all the apis by making api_n depend on api_n-1
if (not concurrent_api_activation) and index != 0:
depends_on.append(
get_api_resource_name(project_id, context.properties['apis'][index-1])
)
resources.append({
'name': get_api_resource_name(project_id, api),
'type': 'deploymentmanager.v2.virtual.enableService',
'metadata': {
'dependsOn': depends_on
},
'properties': {
'consumerId': 'project:' + project_id,
'serviceName': api
}
})
return {
'resources': resources
}
def get_api_resource_name(project_id, api_name):
return project_id + '-' + api_name
|
class Singleton:
_instance = None
def __new__(cls):
if not isinstance(cls._instance, cls):
cls._instance = super(Singleton, cls).__new__(cls)
return cls._instance
|
class Solution:
def numJewelsInStones(self, J: str, S: str) -> int:
d = {}
for letter in J:
d[letter] = 1
count = 0
for letter in S:
if letter in d:
count += 1
return count
|
# -*- coding: utf-8 -*-
#
#
class ResultStr(object):
"""docstring for ResultStr"""
def __init__(self, arg=None):
super(ResultStr, self).__init__()
self.arg = arg
def TrainingResultStr(self, epoch, loss, acc, duration, training=True):
loss_str = self.Loss2Str(loss, decimal_places=6)
acc_str = self.Acc2Str(acc, decimal_places=6)
training_state = ""
if training:
training_state = "[TrainProcess] "
else:
training_state = "[ValProcess] "
info_str = training_state + "e: " + str(epoch) + ', ' +\
loss_str + ', ' + acc_str + ' (%.3f s/epoch)' % duration
return info_str
def TrainingIntermediateResult(self, epoch, loss, acc):
loss_str = self.Loss2Str(loss, decimal_places=3)
acc_str = self.Acc2Str(acc, decimal_places=3)
info_str = 'e: ' + str(epoch) + ', ' +\
loss_str + ', ' + acc_str
return info_str
def Loss2Str(self, loss, info_str=None, decimal_places=3):
if info_str == None:
info_str = []
info_str = self.__GenInfoStr("l", len(loss))
res = self.__Data2Str(loss, info_str, decimal_places)
return res
def Acc2Str(self, acc, info_str=None, decimal_places=3):
if info_str == None:
info_str = []
info_str = self.__GenInfoStr("a", len(acc))
res = self.__Data2Str(acc, info_str, decimal_places)
return res
def __GenInfoStr(self, info_str, num):
res = []
for i in range(num):
res.append(info_str + str(i))
return res
def __Data2Str(self, data, info_str, decimal_places):
assert len(data) == len(info_str)
res = ""
char_interval = ", "
for i in range(len(info_str)):
res = res + info_str[i] + \
(": %." + str(decimal_places) + "f") % data[i] + char_interval
char_offset = len(char_interval)
res = res[:len(res)-char_offset]
return res
|
{
'conditions': [
['OS=="win"', {
'variables': {
'MAGICK_ROOT%': 'C:\\Program Files\\ImageMagick-6.9.12-Q16\\',
# download the dll binary and check off for libraries and includes
'OSX_VER%': "0",
}
}],
['OS=="mac"', {
'variables': {
# matches 10.9.X , 10.10 and outputs 10.9, 10.10, 10.11, 10.12, 10.13
'OSX_VER%': "<!(sw_vers | grep 'ProductVersion:' | grep -o '10.[0-9]*')",
}
}, {
'variables': {
'OSX_VER%': "0",
}
}]
],
"targets": [
{
"target_name": "imagemagick",
"sources": [ "src/imagemagick.cc" ],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
"include_dirs" : [
"<!(node -e \"require('nan')\")"
],
"conditions": [
['OS=="win"', {
"libraries": [
'-l<(MAGICK_ROOT)/lib/CORE_RL_magick_.lib',
'-l<(MAGICK_ROOT)/lib/CORE_RL_Magick++_.lib',
'-l<(MAGICK_ROOT)/lib/CORE_RL_wand_.lib',
],
'include_dirs': [
'<(MAGICK_ROOT)/include',
]
}],
['OS=="win" and target_arch!="x64"', {
'defines': [
'_SSIZE_T_',
]
}],
['OSX_VER == "10.9" or OSX_VER == "10.10" or OSX_VER == "10.11" or OSX_VER == "10.12" or OSX_VER == "10.13"', {
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'OTHER_CFLAGS': [
'<!@(pkg-config --cflags ImageMagick++)'
],
'OTHER_CPLUSPLUSFLAGS' : [
'<!@(pkg-config --cflags ImageMagick++)',
'-std=c++11',
'-stdlib=libc++',
],
'OTHER_LDFLAGS': ['-stdlib=libc++'],
'MACOSX_DEPLOYMENT_TARGET': '10.7', # -mmacosx-version-min=10.7
},
"libraries": [
'<!@(pkg-config --libs ImageMagick++)',
],
'cflags': [
'<!@(pkg-config --cflags ImageMagick++)'
],
}],
['OS=="mac"', {
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'OTHER_CFLAGS': [
'<!@(pkg-config --cflags ImageMagick++)'
]
},
"libraries": [
'<!@(pkg-config --libs ImageMagick++)',
],
'cflags': [
'<!@(pkg-config --cflags ImageMagick++)'
],
}],
['OS=="linux" or OS=="solaris" or OS=="freebsd"', { # not windows not mac
"libraries": [
'<!@(pkg-config --libs ImageMagick++)',
],
'cflags': [
'<!@(pkg-config --cflags ImageMagick++)'
],
}]
]
}]
}
|
def main() -> None:
K = 10**4
def normalize(number: str) -> int:
parts = number.split(".")
if len(parts) == 1:
return int(parts[0]) * K
a, b = parts
return int(a) * K + int(b) * 10 ** (4 - len(b))
cx, cy, r = map(normalize, input().split())
def count_up_y(x: int) -> int:
assert x % K == 0
rhs = r * r - (x - cx) ** 2
if rhs < 0:
return 0
def search_max() -> int:
lo, hi = cy, cy + r + 1
while hi - lo > 1:
y = (lo + hi) >> 1
lhs = (y - cy) ** 2
if lhs <= rhs:
lo = y
else:
hi = y
# print(lo, hi)
return lo // K * K
def search_min() -> int:
lo, hi = cy - r - 1, cy
while hi - lo > 1:
y = (lo + hi) >> 1
lhs = (y - cy) ** 2
if lhs <= rhs:
hi = y
else:
lo = y
return (hi + K - 1) // K * K
y_max = search_max()
y_min = search_min()
assert y_max % K == 0 and y_min % K == 0
assert (y_max - y_min) // K >= -1
return (y_max - y_min) // K + 1
x0 = (cx - r + K - 1) // K * K
x1 = (cx + r) // K * K
print(x0, x1)
print(cx, cy, r)
print(sum(count_up_y(x) for x in range(x0, x1 + 1, K)))
if __name__ == "__main__":
main()
|
#
# PySNMP MIB module NBS-SFF-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NBS-SFF-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:17:37 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")
ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion")
nbs, = mibBuilder.importSymbols("NBS-CMMC-MIB", "nbs")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Bits, NotificationType, IpAddress, Gauge32, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, Unsigned32, Counter64, Counter32, MibIdentifier, iso, ModuleIdentity, Integer32 = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "NotificationType", "IpAddress", "Gauge32", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "Unsigned32", "Counter64", "Counter32", "MibIdentifier", "iso", "ModuleIdentity", "Integer32")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
nbsSffMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 629, 204))
if mibBuilder.loadTexts: nbsSffMib.setLastUpdated('200808221035Z')
if mibBuilder.loadTexts: nbsSffMib.setOrganization('NBS')
if mibBuilder.loadTexts: nbsSffMib.setContactInfo('For technical support, please contact your service channel')
if mibBuilder.loadTexts: nbsSffMib.setDescription('MIB for representing SFF MSA standards')
class InterfaceIndex(TextualConvention, Integer32):
description = "A unique value, greater than zero, for each interface or interface sub-layer in the managed system. It is recommended that values are assigned contiguously starting from 1. The value for each interface sub-layer must remain constant at least from one re-initialization of the entity's network management system to the next re-initialization."
status = 'current'
displayHint = 'd'
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 2147483647)
nbsSffObjects = ObjectIdentity((1, 3, 6, 1, 4, 1, 629, 204, 1))
if mibBuilder.loadTexts: nbsSffObjects.setStatus('current')
if mibBuilder.loadTexts: nbsSffObjects.setDescription('all MIB objects in nbsSFF MIB.')
nbsSffMsaGrp = ObjectIdentity((1, 3, 6, 1, 4, 1, 629, 204, 1, 1))
if mibBuilder.loadTexts: nbsSffMsaGrp.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaGrp.setDescription('All SFF MSA objects.')
nbsSffWdmGrp = ObjectIdentity((1, 3, 6, 1, 4, 1, 629, 204, 1, 2))
if mibBuilder.loadTexts: nbsSffWdmGrp.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmGrp.setDescription('All DWDM MSA objects.')
nbsSffDiagnosticsGrp = ObjectIdentity((1, 3, 6, 1, 4, 1, 629, 204, 1, 3))
if mibBuilder.loadTexts: nbsSffDiagnosticsGrp.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagnosticsGrp.setDescription('All Diagnostics objects.')
nbsSffMsxGrp = ObjectIdentity((1, 3, 6, 1, 4, 1, 629, 204, 1, 4))
if mibBuilder.loadTexts: nbsSffMsxGrp.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsxGrp.setDescription('All SFF MSA Extension objects.')
nbsSffMsaTable = MibTable((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1), )
if mibBuilder.loadTexts: nbsSffMsaTable.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaTable.setDescription('Operations, Administration, and Management information')
nbsSffMsaEntry = MibTableRow((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1), ).setIndexNames((0, "NBS-SFF-MIB", "nbsSffMsaPhysicalIfIndex"))
if mibBuilder.loadTexts: nbsSffMsaEntry.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaEntry.setDescription('Represents a SFF MSA details of a port.')
nbsSffMsaPhysicalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 1), Integer32())
if mibBuilder.loadTexts: nbsSffMsaPhysicalIfIndex.setReference('rfc1213 (MIB-II)')
if mibBuilder.loadTexts: nbsSffMsaPhysicalIfIndex.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaPhysicalIfIndex.setDescription('ifIndex from MIB2')
nbsSffMsaIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaIdentifier.setReference('Specification for SFP MSA, Table 3.2')
if mibBuilder.loadTexts: nbsSffMsaIdentifier.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaIdentifier.setDescription('The identifier value specifies the physical device described by the serial information. This value shall be included in the serial data. The following is the list of identifier values: 1 - unknown 2 - GBIC 3 - Module/Connector soldered to mother board 4 - SFP Transceiver 5 - 300 pin XBI 6 - XENPAK 7 - XFP 8 - XFF 9 - XFP-E 10 - XPAK 11 - X2 12 - DWDM 13 - QSFP 14 to 128 - Reserved 129 to 256 - Vendor specific')
nbsSffMsaExtIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaExtIdentifier.setReference('Specification for SFP MSA')
if mibBuilder.loadTexts: nbsSffMsaExtIdentifier.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaExtIdentifier.setDescription('The field should be set to 04h for all SFP modules indicating serial ID module definition.')
nbsSffMsaOpticalConnector = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaOpticalConnector.setReference('Specification for SFP MSA, Table 3.3')
if mibBuilder.loadTexts: nbsSffMsaOpticalConnector.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaOpticalConnector.setDescription('The Connector value indicates the external connector provided on the interface.This value shall be included in the serial data. Here is the list of values: 1 - unknown 2 - SC 3 - Fiber Channel Style 1 copper connector 4 - Fiber Channel Style 2 copper connector 5 - BNC/TNC 6 - Fiber Channel coaxial headers 7 - Fiberjack 8 - LC 9 - MT-RJ 10 - MU 11 - SG 12 - Optical pigtail 13 to 31 - Reserved 32 - HSSDC II 33 - Copper pigtail 34 to 128 - Reserved 129 to 256 - Vendor specific')
nbsSffMsaTransceiverCodes = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaTransceiverCodes.setReference('Specification for SFP MSA, Table 3.4')
if mibBuilder.loadTexts: nbsSffMsaTransceiverCodes.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaTransceiverCodes.setDescription('The following bit significant indicators define the electronic or optical interfaces that are supported by the SFP transceiver. At least one bit shall be set in this field. For Fibre Channel SFPs, the Fibre Channel speed, transmission media, transmitter technology, and distance capability shall all be indicated. Reserved Standard Compliance Codes BitIndex Byte Bit Description 3 0-7 Reserved 4 4-7 Reserved SONET Compliance codes 12 4 3 - Reserved 13 4 2 - OC48 Long reach 14 4 1 - OC48 Intermediate reach 15 4 0 - OC48 Short reach 16 5 7 - Reserved 17 5 6 - OC 12 Single mode long reach 18 5 5 - OC 12 Single mode inter reach 19 5 4 - OC 12 Multi-mode short reach 20 5 3 - Reserved 21 5 2 - OC 3 Single mode long reach 22 5 1 - OC 3 Single mode inter reach 23 5 0 - OC 3 Multi-mode short reach Gigabit Ethernet Compliance codes 24-27 6 4-7 - Reserved 28 6 3 - 1000BASE-T 29 6 2 - 1000BASE-CX 30 6 1 - 1000BASE-LX 31 6 0 - 1000BASE-SX Fiber Channel link length 32 7 7 - Very long distance 33 7 6 - Short distance 34 7 5 - Intermediate distance 35 7 4 - Long distance Fibre Channel transmitter technology 36-37 7 2 to 3 - Reserved 38 7 1 - Longwave laser 39 7 0 - Electrical inter-enclosure 40 8 7 - Electrical intra-enclosure 41 8 6 - Shortwave laster without OFC 42 8 5 - Shortwave laster with OFC 43 8 4 - Longwave laser 44-47 8 0 to 3 - Reserved Fiber channel transmission media 48 9 7 - Twin Axial pair 49 9 6 - Shielded Twisted Pair 50 9 5 - Miniature coax 51 9 4 - Video coax 52 9 3 - Multi-mode, 62.5m 53 9 2 - Multi-mode, 50 m 54 9 1 - Reserved 55 9 0 - Single Mode Fiber channel speed 56-58 10 5-7 - Reserved 59 10 4 - 400 MBps 60 10 3 - Reserved 61 10 2 - 200 MBps 62 10 1 - Reserved 63 10 0 - 100 MBps')
nbsSffMsaSerialEncoding = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("notSupported", 1), ("lineCode8To10", 2), ("lineCode4To5", 3), ("nrz", 4), ("manchester", 5), ("sonetScrambled", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaSerialEncoding.setReference('Specification for SFP MSA, Table 3.5')
if mibBuilder.loadTexts: nbsSffMsaSerialEncoding.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaSerialEncoding.setDescription('The encoding value indicates the serial encoding mechanism that is the nominal design target of the particular transceiver. The value shall be contained in the serial data.')
nbsSffMsaNominalBitRate = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaNominalBitRate.setReference('Specification for SFP MSA, BR, Nominal')
if mibBuilder.loadTexts: nbsSffMsaNominalBitRate.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaNominalBitRate.setDescription('The nominal bit rate (BR, nominal) is specified in units of 100 Megabits per second, rounded off to the nearest 100 Megabits per second. The bit rate includes those bits necessary to encode and delimit the signal as well as those bits carrying data information. A value of 0 indicates that the bit rate is not specified and must be determined from the transceiver technology. The actual information transfer rate will depend on the encoding of the data, as defined by the encoding value.')
nbsSffMsaLinkLengthSmfKm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaLinkLengthSmfKm.setReference('Specification for SFP MSA, Length (9m) - Km')
if mibBuilder.loadTexts: nbsSffMsaLinkLengthSmfKm.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaLinkLengthSmfKm.setDescription('This value specifies the link length that is supported by the transceiver while operating in compliance with the applicable standards using single mode fiber. The value is in units of kilometers. A value of 255 means that the transceiver supports a link length greater than 254 km. A value of zero means that the transceiver does not support single mode fiber or that the length information must be determined from the transceiver technology.')
nbsSffMsaLinkLengthSmf100m = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaLinkLengthSmf100m.setReference('Specification for SFP MSA, Length (9m)')
if mibBuilder.loadTexts: nbsSffMsaLinkLengthSmf100m.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaLinkLengthSmf100m.setDescription('This value specifies the link length that is supported by the transceiver while operating in compliance with the applicable standards using single mode fiber. The value is in units of 100 meters. A value of 255 means that the transceiver supports a link length greater than 25.4 km. A value of zero means that the transceiver does not support single mode fiber or that the length information must be determined from the transceiver technology.')
nbsSffMsaLinkLengthMmf10m = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaLinkLengthMmf10m.setReference('Specification for SFP MSA, Length (50m)')
if mibBuilder.loadTexts: nbsSffMsaLinkLengthMmf10m.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaLinkLengthMmf10m.setDescription('This value specifies link length that is supported by the transceiver while operating in compliance with applicable standards using 50 micron multimode OM2 [500MHz*km at 850nm,] fiber. The value is in units of 10 meters. A value of 255 means that the transceiver supports a link length greater than 2.54 km. A value of zero means that the transceiver does not support 50 micron multimode fiber or that the length information must be determined from the transceiver technology.')
nbsSffMsaLinkLength625Mmf10m = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaLinkLength625Mmf10m.setReference('Specification for SFP MSA, Length (62.5m)')
if mibBuilder.loadTexts: nbsSffMsaLinkLength625Mmf10m.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaLinkLength625Mmf10m.setDescription('This value specifies link length that is supported by the transceiver while operating in compliance with applicable standards using 62.5 micron multimode OM1 [200 MHz*km at 850nm, 500 MHz*km at 1310nm] fiber. The value is in units of 10 meters. A value of 255 means that the transceiver supports a link length greater than 2.54 km. A value of zero means that the transceiver does not support 62.5 micron multimode fiber or that the length information must determined from the transceiver technology. It is common for a multimode transceiver to support OM1, OM2 and OM3 fiber.')
nbsSffMsaCopperLinkLength = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaCopperLinkLength.setReference('Specification for SFP MSA, Length Copper')
if mibBuilder.loadTexts: nbsSffMsaCopperLinkLength.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaCopperLinkLength.setDescription('This value specifies the minimum link length that is supported by the transceiver while operating in compliance with the applicable standards using copper cable. The value is in units of 1 meter. A value of 255 means that the transceiver supports a link length greater than 254 meters. A value of zero means that the transceiver does not support copper cables or that the length information must be determined from the transceiver technology. Further information about the cable design, equalization, and connectors is usually required to guarantee meeting a particular length requirement.')
nbsSffMsaVendorName = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaVendorName.setReference('Specification for SFP MSA, Vendor name')
if mibBuilder.loadTexts: nbsSffMsaVendorName.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaVendorName.setDescription('The vendor name is a 16 character field that contains ASCII characters, The vendor name shall be the full name of the corporation, a commonly accepted abbreviation of the name of the corporation, the SCSI company code for the corporation, or the stock exchange code for the corporation. At least one of the vendor name or the vendor OUI fields shall contain valid serial data.')
nbsSffMsaVendorOUI = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 14), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3, 3)).setFixedLength(3)).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaVendorOUI.setReference('Specification for SFP MSA, Vendor OUI')
if mibBuilder.loadTexts: nbsSffMsaVendorOUI.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaVendorOUI.setDescription('The vendor organizationally unique identifier field (vendor OUI) is a 3-byte field that contains the IEEE Company Identifier for the vendor. A value of all zero in the 3-byte field indicates that the Vendor OUI is unspecified.')
nbsSffMsaVendorPartNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 15), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaVendorPartNumber.setReference('Specification for SFP MSA, Vendor PN')
if mibBuilder.loadTexts: nbsSffMsaVendorPartNumber.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaVendorPartNumber.setDescription('The vendor part number (vendor PN) is a 16-byte field that contains ASCII characters, left-aligned, defining the vendor part number or product name. Unlike the MSA standard, agent returns size 0 string if the part number is unspecified and there will be no white space padding.')
nbsSffMsaVendorRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 16), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaVendorRevision.setReference('Specification for SFP MSA, Vendor Rev')
if mibBuilder.loadTexts: nbsSffMsaVendorRevision.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaVendorRevision.setDescription("The vendor revision number (vendor rev) is a 4-byte field that contains ASCII characters, defining the vendor's product revision number. Unlike the MSA standard, agent returns size 0 string if the part number is unspecified and there will be no white space padding.")
nbsSffMsaBaseChecksumMatch = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaBaseChecksumMatch.setReference('Specification for SFP MSA, CC_BASE')
if mibBuilder.loadTexts: nbsSffMsaBaseChecksumMatch.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaBaseChecksumMatch.setDescription("The check code is a one byte code that can be used to verify that the first 64 (0-63) bytes of serial information in the SFP transceiver is valid.Returns yes if checksum matches, no if checksum doesn't match.")
nbsSffMsaLossOfSignalImplemented = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 18), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaLossOfSignalImplemented.setReference('Specification for SFP MSA Table 3.6')
if mibBuilder.loadTexts: nbsSffMsaLossOfSignalImplemented.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaLossOfSignalImplemented.setDescription('Byte 65 Bit 1. Signal as defined in the specification')
nbsSffMsaLossOfSignalInverted = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 19), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaLossOfSignalInverted.setReference('Specification for SFP MSA Table 3.6')
if mibBuilder.loadTexts: nbsSffMsaLossOfSignalInverted.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaLossOfSignalInverted.setDescription('Byte 65 Bit 2. Signal as defined in the specification')
nbsSffMsaTxFault = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 20), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaTxFault.setReference('Specification for SFP MSA Table 3.6')
if mibBuilder.loadTexts: nbsSffMsaTxFault.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaTxFault.setDescription('Byte 65 Bit 3.TX_FAULT signal implemented. Reset definition in Section III')
nbsSffMsaTxDisable = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 21), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaTxDisable.setReference('Specification for SFP MSA Table 3.6')
if mibBuilder.loadTexts: nbsSffMsaTxDisable.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaTxDisable.setDescription('Byte 65 Bit 4.TX_DISABLE is implemented and disables the serial output.')
nbsSffMsaRateSelectImplemented = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaRateSelectImplemented.setReference('Specification for SFP MSA Table 3.6')
if mibBuilder.loadTexts: nbsSffMsaRateSelectImplemented.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaRateSelectImplemented.setDescription('Byte 65 Bit 5.If this bit is set then active control of the rate select pin is required to change rates. If bit is not set, no control of pin is required. In all cases, compliance with multiple rate standards should be determined by Transceiver codes in bytes 4,5,6, and 10. See table 3.4')
nbsSffMsaMaxBitRate = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 23), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaMaxBitRate.setReference('Specification for SFP MSA BR,max')
if mibBuilder.loadTexts: nbsSffMsaMaxBitRate.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaMaxBitRate.setDescription('The upper bit rate limit at which the SFP transceiver will still meet its specifications (BR, max) is specified in units of 1% above the nominal bit rate. A value of zero indicates that this field is not specified.')
nbsSffMsaMinBitRate = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 24), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaMinBitRate.setReference('Specification for SFP MSA BR,min')
if mibBuilder.loadTexts: nbsSffMsaMinBitRate.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaMinBitRate.setDescription('The lower bit rate limit at which the SFP transceiver will still meet its specifications (BR, min) is specified in units of 1% below the nominal bit rate. A value of zero indicates that this field is not specified.')
nbsSffMsaVendorSerialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 25), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaVendorSerialNumber.setReference('Specification for SFP MSA Vendor SN')
if mibBuilder.loadTexts: nbsSffMsaVendorSerialNumber.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaVendorSerialNumber.setDescription("The vendor serial number (vendor SN) is a 16 character field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h), defining the vendor's serial number for the SFP transceiver. A value of all zero in the 16-byte field indicates that the vendor SN is unspecified.")
nbsSffMsaVendorDateCode = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 26), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(6, 8))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaVendorDateCode.setReference('Specification for SFP MSA Table 3.7')
if mibBuilder.loadTexts: nbsSffMsaVendorDateCode.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaVendorDateCode.setDescription("The date code is an 8-byte field that contains the vendor's date code in ASCII characters. The date code is mandatory.")
nbsSffMsaExtChecksumMatch = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 1, 1, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsaExtChecksumMatch.setReference('Specification for SFP MSA, CC_BASE')
if mibBuilder.loadTexts: nbsSffMsaExtChecksumMatch.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsaExtChecksumMatch.setDescription('The check code is a one byte code that can be used to verify that the first 32 bytes of extended serial information in the SFP transceiver is valid. The check code shall be the low order 8 bits of the sum of the contents of all the bytes from byte 64 to byte 94, inclusive.')
nbsSffWdmTable = MibTable((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1), )
if mibBuilder.loadTexts: nbsSffWdmTable.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmTable.setDescription('Operations, Administration, and Management information')
nbsSffWdmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1), ).setIndexNames((0, "NBS-SFF-MIB", "nbsSffMsaPhysicalIfIndex"))
if mibBuilder.loadTexts: nbsSffWdmEntry.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmEntry.setDescription('Represents WDM properties of a port.')
nbsSffWdmClassOfPower = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("under1W", 1), ("oneToOneAndHalfW", 2), ("overOneAndHalfW", 3), ("reserved", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmClassOfPower.setReference('Specification for DWDM SFP Transceiver, section 2.2.3')
if mibBuilder.loadTexts: nbsSffWdmClassOfPower.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmClassOfPower.setDescription('Extended identifier of class of Power.')
nbsSffWdmClassOfTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("class0", 1), ("class1", 2), ("class2", 3), ("class3", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmClassOfTemperature.setReference('Specification for DWDM SFP Transceiver, section 2.2.3')
if mibBuilder.loadTexts: nbsSffWdmClassOfTemperature.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmClassOfTemperature.setDescription('Extended identifier of class of Temperature. class0 - Temperature in [-5, 70C] class1 - Temperature in [-40, 85C] class2 - reserved class3 - defined by MIB objects nbsSffDwdmMaxCaseTemperature & nbsSffDwdmMinCaseTemperature')
nbsSffWdmClassOfWdm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("noWdm", 1), ("cwdm", 2), ("dwdm", 3), ("reserved", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmClassOfWdm.setReference('Specification for DWDM SFP Transceiver, section 2.2.3')
if mibBuilder.loadTexts: nbsSffWdmClassOfWdm.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmClassOfWdm.setDescription('Extended identifier of class of WDM. 1 - No WDM 2 - CWDM 3 - DWDM 4 - Reserved')
nbsSffWdmOpticalReach = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmOpticalReach.setReference('Specification for DWDM SFP Transceiver, section 2.2.8')
if mibBuilder.loadTexts: nbsSffWdmOpticalReach.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmOpticalReach.setDescription('This value specifies the link length in kilometers that is supported by the transceiver while operating in compliance with the applicable standards using single mode fiber.')
nbsSffWdmMaxCaseTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-2147483647, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmMaxCaseTemperature.setReference('Specification for DWDM SFP Transceiver, section 2.2.9')
if mibBuilder.loadTexts: nbsSffWdmMaxCaseTemperature.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmMaxCaseTemperature.setDescription('This field defines the maximum operating case temperature in Celsius.')
nbsSffWdmMinCaseTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-2147483647, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmMinCaseTemperature.setReference('Specification for DWDM SFP Transceiver, section 2.2.10')
if mibBuilder.loadTexts: nbsSffWdmMinCaseTemperature.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmMinCaseTemperature.setDescription('This field defines the minimum operating case temperature in Celsius.')
nbsSffWdmMaxSupplyCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmMaxSupplyCurrent.setReference('Specification for DWDM SFP Transceiver, section 2.2.11')
if mibBuilder.loadTexts: nbsSffWdmMaxSupplyCurrent.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmMaxSupplyCurrent.setDescription('This field defines the maximum supply current, in milli Amps, which the module will consume under worst case conditions.')
nbsSffWdmNumberOfChannels = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmNumberOfChannels.setReference('Specification for DWDM SFP Transceiver, section 2.2.12')
if mibBuilder.loadTexts: nbsSffWdmNumberOfChannels.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmNumberOfChannels.setDescription('This specifies the tuning range from 1 to 63, where 1 indicates this module is not tunable by user commands.')
nbsSffWdmChannelSpacing = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("notTunable", 1), ("ghz50", 2), ("ghz100", 3), ("ghz200", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmChannelSpacing.setReference('Specification for DWDM SFP Transceiver, section 2.2.12')
if mibBuilder.loadTexts: nbsSffWdmChannelSpacing.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmChannelSpacing.setDescription('This field identifies the densest channel spacing the module is compatible with and the number of channels over which the module may be tuned by user command.')
nbsSffWdmVariableDecisionThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notSupported", 1), ("supported", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmVariableDecisionThreshold.setReference('Specification for DWDM SFP Transceiver, section 2.2.14')
if mibBuilder.loadTexts: nbsSffWdmVariableDecisionThreshold.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmVariableDecisionThreshold.setDescription('DWDM Variable Decission Threshold.')
nbsSffWdmWavelengthMonitorType = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("wavelength", 1), ("laserTemperature", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmWavelengthMonitorType.setReference('Specification for DWDM SFP Transceiver, section 2.2.14')
if mibBuilder.loadTexts: nbsSffWdmWavelengthMonitorType.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmWavelengthMonitorType.setDescription('DWDM Wavelength monitor type in A2 byte.')
nbsSffWdmExtTransmitPowerType = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("pwrDefault", 1), ("pwrExtended", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmExtTransmitPowerType.setReference('Specification for DWDM SFP Transceiver, section 2.2.14')
if mibBuilder.loadTexts: nbsSffWdmExtTransmitPowerType.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmExtTransmitPowerType.setDescription('DWDM Extended Transmit Power Type.')
nbsSffWdmVariableOpticalAttenuator = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notImplemented", 1), ("implemented", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmVariableOpticalAttenuator.setReference('Specification for DWDM SFP Transceiver, section 2.2.14')
if mibBuilder.loadTexts: nbsSffWdmVariableOpticalAttenuator.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmVariableOpticalAttenuator.setDescription('DWDM Variable Optical Atttenuator.')
nbsSffWdmPilotToneFunctionality = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("pilotToneNone", 1), ("pilotToneDetection", 2), ("pilotToneInjection", 3), ("pilotToneInjectionDetection", 4), ("pilotToneEnhanced", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmPilotToneFunctionality.setReference('Specification for DWDM SFP Transceiver, section 2.2.14')
if mibBuilder.loadTexts: nbsSffWdmPilotToneFunctionality.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmPilotToneFunctionality.setDescription('DWDM Pilot Tone Functionality.')
nbsSffWdmOptionalInterruptPin = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notSupported", 1), ("supported", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmOptionalInterruptPin.setReference('Specification for DWDM SFP Transceiver, section 2.2.14')
if mibBuilder.loadTexts: nbsSffWdmOptionalInterruptPin.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmOptionalInterruptPin.setDescription('DWDM Optional Interrupt Pin.')
nbsSffWdmLaserWavelength = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 2, 1, 1, 16), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 150))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffWdmLaserWavelength.setReference('Specification for DWDM SFP Transceiver, section 2.2.18')
if mibBuilder.loadTexts: nbsSffWdmLaserWavelength.setStatus('current')
if mibBuilder.loadTexts: nbsSffWdmLaserWavelength.setDescription('Nominal transmitter output wavelength. The laser wavelength is equal to the 16 bit integer value in nm (16 bit value with byte 60 as high order byte and byte 61 as low order byte) and with the fractional part of the wavelength in units of 0.01nm (byte 62)')
nbsSffDiagsTable = MibTable((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1), )
if mibBuilder.loadTexts: nbsSffDiagsTable.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTable.setDescription('Operations, Administration, and Management information')
nbsSffDiagsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1), ).setIndexNames((0, "NBS-SFF-MIB", "nbsSffMsaPhysicalIfIndex"))
if mibBuilder.loadTexts: nbsSffDiagsEntry.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsEntry.setDescription('Represents Digital Diagnostics of a port.')
nbsSffDiagsRateIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("notSupported", 1), ("rate421G", 2), ("rate842GRx", 3), ("rate842GRxTx", 4), ("rate842GTx", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsRateIdentifier.setReference('Table 3.6a of SFF-8472 Rev 10.3 Diagnostic monitoring interface for optical transceiver')
if mibBuilder.loadTexts: nbsSffDiagsRateIdentifier.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsRateIdentifier.setDescription('The rate identifier byte refers to several (optional) industry standard definitions of Rate_Select or Application_Select control behaviors, intended to manage transceiver optimization for multiple operating rates.')
nbsSffDiagsLinkLengthOm3 = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsLinkLengthOm3.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3)')
if mibBuilder.loadTexts: nbsSffDiagsLinkLengthOm3.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsLinkLengthOm3.setDescription('This value specifies link length that is supported by the transceiver while operating in compliance with applicable standards using 50 micron multimode OM3 [2000 MHz*km] fiber. The value is in units of 10 meters. A value of 255 means that the transceiver supports a link length greater than 2.54 km. A value of zero means that the transceiver does not support 50 micron multimode fiber or that the length information must be determined from the transceiver technology.')
nbsSffDiagsLaserWavelength = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsLaserWavelength.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3)')
if mibBuilder.loadTexts: nbsSffDiagsLaserWavelength.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsLaserWavelength.setDescription('Nominal transmitter output wavelength at room temperature. 16 bit value with byte 60 as high order byte and byte 61 as low order byte. The laser wavelength is equal to the the 16 bit integer value in nm. This field allows the user to read the laser wavelength directly, so it is not necessary to infer it from the transceiver Code for Electronic Compatibility (bytes 3 to 10). This also allows specification of wavelengths not covered in bytes 3 to 10, such as those used in coarse WDM systems.')
nbsSffDiagsLROutputImplemented = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsLROutputImplemented.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.7')
if mibBuilder.loadTexts: nbsSffDiagsLROutputImplemented.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsLROutputImplemented.setDescription('Byte 64, bit 0. Value of 1 identifies a conventional limiting (or unspecified) receiver output. Value of 2 identifies a linear receiver output.')
nbsSffDiagsPowerLevelDeclaration = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("level1", 1), ("level2", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsPowerLevelDeclaration.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.7')
if mibBuilder.loadTexts: nbsSffDiagsPowerLevelDeclaration.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsPowerLevelDeclaration.setDescription('Byte 64, bit 1. Value 1 identifies Power Level 1 (or unspecified) requirements. Value 2 identifies a Power Level2 requirements.')
nbsSffDiagsCooledTranDeclaration = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("uncooled", 1), ("cooled", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsCooledTranDeclaration.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.7')
if mibBuilder.loadTexts: nbsSffDiagsCooledTranDeclaration.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsCooledTranDeclaration.setDescription(' Byte 64, bit 2. Value 1 identifies a conventional uncooled (or unspecified) laser implementation. Value 2 identifies a cooled laser transmitter implementation.')
nbsSffDiagsAddressChangeRequired = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsAddressChangeRequired.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.9')
if mibBuilder.loadTexts: nbsSffDiagsAddressChangeRequired.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsAddressChangeRequired.setDescription('Byte 92, bit 2 indicates whether or not it is necessary for the host to perform an address change sequence before accessing information at 2-wire serial address A2h. If this bit is not set, the host may simply read from either address, A0h or A2h, by using that value in the address byte during the 2-wire communication sequence. If the bit is set, the defined sequence must be executed prior to accessing information at address A2h.')
nbsSffDiagsPowerMeasurementType = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("oma", 1), ("averagePower", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsPowerMeasurementType.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.9')
if mibBuilder.loadTexts: nbsSffDiagsPowerMeasurementType.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsPowerMeasurementType.setDescription('Byte 92, bit 3 indicates whether the received power measurement represents average input optical power or OMA. If the bit is set, average power is monitored. If it is not, OMA is monitored.')
nbsSffDiagsExternallyCalibrated = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsExternallyCalibrated.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.9')
if mibBuilder.loadTexts: nbsSffDiagsExternallyCalibrated.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsExternallyCalibrated.setDescription('Byte 92, bit 4 Externally Calibrated Two calibration options are possible if bit 6 has been set indicating that digital diagnostic monitoring has been implemented. If bit 4 is set, the reported values are A/D counts which must be converted to real world units using calibration values read using 2 wire serial address 1010001X (A2h) from bytes 56 to 95.')
nbsSffDiagsInternallyCalibrated = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsInternallyCalibrated.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.9')
if mibBuilder.loadTexts: nbsSffDiagsInternallyCalibrated.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsInternallyCalibrated.setDescription('Byte 92, bit 5 Internally Calibrated. Two calibration options are possible if bit 6 has been set indicating that digital diagnostic monitoring has been implemented. If bit 5, Internally calibrated is set, the transceiver directly reports calibrated values in units of current, power etc.')
nbsSffDiagsDDMonitoringImplemented = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsDDMonitoringImplemented.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.9')
if mibBuilder.loadTexts: nbsSffDiagsDDMonitoringImplemented.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsDDMonitoringImplemented.setDescription('Byte 92, bit 6. If this bit is set indicating that digital diagnostic monitoring has been implemented, received power monitoring, transmitted power monitoring, bias current monitoring, supply voltage monitoring and temperature monitoring must all be implemented. Additionally, alarm and warning thresholds must be written as specified in this document at locations 00 to 55 on 2 wire serial address 1010001X (A2h)')
nbsSffDiagsOptRateSelectControl = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notImplemented", 1), ("implemented", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsOptRateSelectControl.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.10')
if mibBuilder.loadTexts: nbsSffDiagsOptRateSelectControl.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsOptRateSelectControl.setDescription('Byte 93 bit 1. Optional Rate Select control implemented per SFF-8431. Sets to 1 if not implemented, 2 if implemented.')
nbsSffDiagsOptAppSelectControl = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notImplemented", 1), ("implemented", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsOptAppSelectControl.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.10')
if mibBuilder.loadTexts: nbsSffDiagsOptAppSelectControl.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsOptAppSelectControl.setDescription('Based on byte 93 bit 2. Optional Application Select control implemented per SFF-8079. Sets to 1 if not implemented, 2 if implemented.')
nbsSffDiagsOptSoftRSControlMon = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notImplemented", 1), ("implemented", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsOptSoftRSControlMon.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.10 and Table 3.11')
if mibBuilder.loadTexts: nbsSffDiagsOptSoftRSControlMon.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsOptSoftRSControlMon.setDescription('Based on byte 93 bit 3. Optional soft RATE_SELECT control and monitoring implemented. Sets to 1 if not implemented, 2 if implemented.')
nbsSffDiagsOptSoftRxLoSMonitoring = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notImplemented", 1), ("implemented", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsOptSoftRxLoSMonitoring.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.10 and Table 3.11')
if mibBuilder.loadTexts: nbsSffDiagsOptSoftRxLoSMonitoring.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsOptSoftRxLoSMonitoring.setDescription('Based on byte 93 bit 4. Optional soft RX_LOS monitoring implemented. Sets to 1 if not implemented, 2 if implemented.')
nbsSffDiagsOptSoftTxFaultMonitoring = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notImplemented", 1), ("implemented", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsOptSoftTxFaultMonitoring.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.10 and Table 3.11')
if mibBuilder.loadTexts: nbsSffDiagsOptSoftTxFaultMonitoring.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsOptSoftTxFaultMonitoring.setDescription('Based on byte 93 bit 5. Optional soft TX_FAULT monitoring implemented. Sets to 1 if not implemented, 2 if implemented.')
nbsSffDiagsOptSoftTxDisable = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notImplemented", 1), ("implemented", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsOptSoftTxDisable.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.10 and Table 3.11')
if mibBuilder.loadTexts: nbsSffDiagsOptSoftTxDisable.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsOptSoftTxDisable.setDescription('Based on byte 93 bit 6. Optional soft TX_DISABLE control and monitoring implemented.Sets to 1 if not implemented, 2 if implemented.')
nbsSffDiagsOptAlarmWarningFlags = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notImplemented", 1), ("implemented", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsOptAlarmWarningFlags.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.10')
if mibBuilder.loadTexts: nbsSffDiagsOptAlarmWarningFlags.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsOptAlarmWarningFlags.setDescription('Based on byte 93 bit 7. Optional Alarm/warning flags implemented for all monitored quantities.Sets to 1 if not implemented, 2 if implemented. See Table 3.18')
nbsSffDiags8472Compliance = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("notSupported", 1), ("rev9dot3of8472", 2), ("rev9dot5of8472", 3), ("rev10dot2of8472", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiags8472Compliance.setReference('Specification for Diagnostic monitoring interface for optical transceiver (SFF-8472 rev 10.3), Table 3.12')
if mibBuilder.loadTexts: nbsSffDiags8472Compliance.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiags8472Compliance.setDescription('Byte 94 contains an unsigned integer that indicates which feature set(s) are implemented in the transceiver.')
nbsSffDiagsTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-2147483647, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTemperature.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsTemperature.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTemperature.setDescription('Module temperature in centigradese.')
nbsSffDiagsTempLowAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 21), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTempLowAlarm.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsTempLowAlarm.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTempLowAlarm.setDescription('Predefined temperature for low alarm threshold in Centigrades.')
nbsSffDiagsTempLowWarn = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 22), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTempLowWarn.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsTempLowWarn.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTempLowWarn.setDescription('Predefined temperature for low warning threshold in Centigrades')
nbsSffDiagsTempHighWarn = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 23), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTempHighWarn.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsTempHighWarn.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTempHighWarn.setDescription('Predefined temperature for high warning threshold in Centigrades')
nbsSffDiagsTempHighAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 24), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTempHighAlarm.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsTempHighAlarm.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTempHighAlarm.setDescription('Predefined temperature for high alarm threshold in Centigrades')
nbsSffDiagsVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 25), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsVoltage.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsVoltage.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsVoltage.setDescription('Internally measured supply voltage in transceiver in the units of Volts. Bytes 98 & 99 of Address A2h')
nbsSffDiagsVoltLowAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 26), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsVoltLowAlarm.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsVoltLowAlarm.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsVoltLowAlarm.setDescription('Predefined voltage for low alarm threshold in the units of Volts.')
nbsSffDiagsVoltLowWarn = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 27), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsVoltLowWarn.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsVoltLowWarn.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsVoltLowWarn.setDescription('Predefined voltage for low warning threshold in the units of Volts.')
nbsSffDiagsVoltHighWarn = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 28), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsVoltHighWarn.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsVoltHighWarn.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsVoltHighWarn.setDescription('Predefined voltage for high warning threshold in the units of Volts.')
nbsSffDiagsVoltHighAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 29), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsVoltHighAlarm.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsVoltHighAlarm.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsVoltHighAlarm.setDescription('Predefined voltage for high alarm threshold in the units of Volts.')
nbsSffDiagsBiasCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 30), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsBiasCurrent.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsBiasCurrent.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsBiasCurrent.setDescription('Internally measured TX Bias Current in the units of mA. Bytes 100 & 101 of Address A2h')
nbsSffDiagsBiasLowAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 31), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsBiasLowAlarm.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsBiasLowAlarm.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsBiasLowAlarm.setDescription('Predefined bias current for low alarm threshold in the units of mA')
nbsSffDiagsBiasLowWarn = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 32), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsBiasLowWarn.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsBiasLowWarn.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsBiasLowWarn.setDescription('Predefined bias current for low warning threshold in the units of mA')
nbsSffDiagsBiasHighWarn = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 33), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsBiasHighWarn.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsBiasHighWarn.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsBiasHighWarn.setDescription('Predefined bias current for high warning threshold in the units of mA')
nbsSffDiagsBiasHighAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 34), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsBiasHighAlarm.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsBiasHighAlarm.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsBiasHighAlarm.setDescription('Predefined bias current for high alarm threshold in the units of mA')
nbsSffDiagsTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 35), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTxPower.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsTxPower.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTxPower.setDescription('Measured TX output power in the units of dBm.')
nbsSffDiagsTxPowerLowAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 36), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTxPowerLowAlarm.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerLowAlarm.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerLowAlarm.setDescription('Predefined Tx output power for low alarm threshold in the units of dBm.')
nbsSffDiagsTxPowerLowWarn = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 37), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTxPowerLowWarn.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerLowWarn.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerLowWarn.setDescription('Predefined Tx output power for low warning threshold in the units of dBm.')
nbsSffDiagsTxPowerHighWarn = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 38), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTxPowerHighWarn.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerHighWarn.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerHighWarn.setDescription('Predefined Tx output power for high warning threshold in the units of dBm.')
nbsSffDiagsTxPowerHighAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 39), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTxPowerHighAlarm.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerHighAlarm.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerHighAlarm.setDescription('Predefined Tx output power for high alarm threshold in the units of dBm.')
nbsSffDiagsRxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 40), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsRxPower.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.16')
if mibBuilder.loadTexts: nbsSffDiagsRxPower.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsRxPower.setDescription('Measured received optical power. Received power, RX_PWR, is given in uW by the following equation: Rx_PWR (uW) = Rx_PWR(4) * Rx_PWR AD 4 (16 bit unsigned integer) + Rx_PWR(3) * Rx_PWR AD 3 (16 bit unsigned integer) + Rx_PWR(2) * Rx_PWR AD 2 (16 bit unsigned integer) + Rx_PWR(1) * Rx_PWR AD (16 bit unsigned integer) + Rx_PWR(0)')
nbsSffDiagsRxPowerLowAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 41), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsRxPowerLowAlarm.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsRxPowerLowAlarm.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsRxPowerLowAlarm.setDescription('Predefined Rx input power for low alarm threshold in the units of dBm.')
nbsSffDiagsRxPowerLowWarn = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 42), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsRxPowerLowWarn.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsRxPowerLowWarn.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsRxPowerLowWarn.setDescription('Predefined Rx input power for low warning threshold in the units of dBm.')
nbsSffDiagsRxPowerHighWarn = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 43), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsRxPowerHighWarn.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsRxPowerHighWarn.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsRxPowerHighWarn.setDescription('Predefined Rx input power for high warning threshold in the units of dBm.')
nbsSffDiagsRxPowerHighAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 44), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsRxPowerHighAlarm.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.15')
if mibBuilder.loadTexts: nbsSffDiagsRxPowerHighAlarm.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsRxPowerHighAlarm.setDescription('Predefined Rx input power for high alarm threshold in the units of dBm.')
nbsSffDiagsDataReadyBarState = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 45), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsDataReadyBarState.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsDataReadyBarState.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsDataReadyBarState.setDescription('Indicates transceiver has achieved power up and data is ready. Bit remains high until data is ready to be read at which time the device sets the bit low. Byte 110, bit 0 of A2h')
nbsSffDiagsRxLosState = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 46), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsRxLosState.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsRxLosState.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsRxLosState.setDescription('Digital state of the RX_LOS Output Pin. Updated within 100ms of change on pin. Byte 110, bit 1 of A2h')
nbsSffDiagsTxFaultState = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 47), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTxFaultState.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsTxFaultState.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTxFaultState.setDescription('Digital state of the TX Fault Output Pin. Updated within 100ms of change on pin. Byte 110, bit 2 of A2h')
nbsSffDiagsSoftRateSelect = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 48), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsSoftRateSelect.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsSoftRateSelect.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsSoftRateSelect.setDescription('Read/write bit that allows software rate select control. Writing 1 selects full bandwidth operation. This bit is ORd with the hard Rate_Select, AS(0) or RS(0) pin value. See Table 3.11 for timing requirements. Default at power up is logic zero/low. If Soft Rate Select is not implemented, the transceiver ignores the value of this bit. Note: Specific transceiver behaviors of this bit are identified in Table 3.6a and referenced documents. See Table 3.18a, byte 118, bit 3 for Soft RS(1) Select. Byte 110, bit 3 of A2h')
nbsSffDiagsRateSelectState0 = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 49), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsRateSelectState0.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsRateSelectState0.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsRateSelectState0.setDescription('Digital state of the SFP Rate_Select Input Pin. Updated within 100ms of change on pin. Note: This pin is also known as AS(0) in SFF-8079 and RS(0) in SFF-8431. Byte 110, bit 4 of A2h')
nbsSffDiagsRS1State = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 50), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsRS1State.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsRS1State.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsRS1State.setDescription('Reserved for digital state of input pin AS(1) per SFF-8079 and RS(1) per SFF-8431. Updated within 100ms of change on pin. See A2h Byte 118, Bit 3 for Soft RS(1) Select control information. Byte 110, bit 5 of A2h')
nbsSffDiagsSoftTxDisableSelect = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 51), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsSoftTxDisableSelect.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsSoftTxDisableSelect.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsSoftTxDisableSelect.setDescription('Read/write bit that allows software disable of laser. Writing 1 disables laser. See Table 3.11 for enable/ disable timing requirements. This bit is OR d with the hard TX_DISABLE pin value. Note, per SFP MSA TX_DISABLE pin is default enabled unless pulled low by hardware. If Soft TX Disable is not implemented, the transceiver ignores the value of this bit. Default power up value is zero/low. Byte 110, bit 6 of A2h')
nbsSffDiagsTxDisableState = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 52), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTxDisableState.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.17')
if mibBuilder.loadTexts: nbsSffDiagsTxDisableState.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTxDisableState.setDescription('Digital state of the TX Disable Input Pin. Updated within 100ms of change on pin.')
nbsSffDiagsBiasCurrentSlope = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 53), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsBiasCurrentSlope.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.16')
if mibBuilder.loadTexts: nbsSffDiagsBiasCurrentSlope.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsBiasCurrentSlope.setDescription('Fixed decimal (unsigned) calibration data, laser bias current measured in mA.')
nbsSffDiagsBiasCurrentOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 54), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsBiasCurrentOffset.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.16')
if mibBuilder.loadTexts: nbsSffDiagsBiasCurrentOffset.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsBiasCurrentOffset.setDescription("Fixed decimal (signed two's complement) calibration data, laser bias current measured in mA.")
nbsSffDiagsTxPowerSlope = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 55), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTxPowerSlope.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.16')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerSlope.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerSlope.setDescription('Fixed decimal (unsigned) calibration data, transmitter coupled output power in the units of dBm.')
nbsSffDiagsTxPowerOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 56), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTxPowerOffset.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.16')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerOffset.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTxPowerOffset.setDescription("Fixed decimal (signed two's complement) calibration data, transmitter coupled output power in the units of dBm.")
nbsSffDiagsTemperatureSlope = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 57), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTemperatureSlope.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.16')
if mibBuilder.loadTexts: nbsSffDiagsTemperatureSlope.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTemperatureSlope.setDescription('Fixed decimal (unsigned) calibration data, internal module temperature in C')
nbsSffDiagsTemperatureOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 58), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsTemperatureOffset.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.16')
if mibBuilder.loadTexts: nbsSffDiagsTemperatureOffset.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsTemperatureOffset.setDescription("Fixed decimal (signed two's complement) calibration data, internal module temperature in C")
nbsSffDiagsVoltageSlope = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 59), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsVoltageSlope.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.16')
if mibBuilder.loadTexts: nbsSffDiagsVoltageSlope.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsVoltageSlope.setDescription('Fixed decimal (unsigned) calibration data, internal module supply voltage in Volts.')
nbsSffDiagsVoltageOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 60), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsVoltageOffset.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.16')
if mibBuilder.loadTexts: nbsSffDiagsVoltageOffset.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsVoltageOffset.setDescription("Fixed decimal (signed two's complement) calibration data, internal module supply voltage in Volts.")
nbsSffDiagsPowerLevelSelect = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 61), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsPowerLevelSelect.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.18a of A2h')
if mibBuilder.loadTexts: nbsSffDiagsPowerLevelSelect.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsPowerLevelSelect.setDescription('Reserved for SFF-8431 Power Level (maximum power dissipation) enable. Value of zero disables Power Level 2 (1.0 Watt max). Value of one enables Power Level 2 (1.5 Watt max). Refer to Table 3.7 for Power Level declaration. Refer to Table 3.11 for timing.')
nbsSffDiagsPowerLevelOpState = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 62), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsPowerLevelOpState.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.18a of A2h')
if mibBuilder.loadTexts: nbsSffDiagsPowerLevelOpState.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsPowerLevelOpState.setDescription('Reserved for SFF-8431 Power Level (maximum power dissipation) status.Value of zero indicates Power Level 1 operation (1.0 Watt max) Value of one indicates Power Level 2 operation (1.5 Watt max).Refer to Table 3.7 for Power Level declaration. Refer to Table 3.11 for timing.')
nbsSffDiagsSoftRSSelect = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 3, 1, 1, 63), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffDiagsSoftRSSelect.setReference('Diagnostic Monitoring Interface for Optical Transceivers, SFF-8472 Rev 10.3 Table 3.18a of A2h')
if mibBuilder.loadTexts: nbsSffDiagsSoftRSSelect.setStatus('current')
if mibBuilder.loadTexts: nbsSffDiagsSoftRSSelect.setDescription('Read/write bit that allows software Tx rate control. Writing 1 selects full speed Tx operation. This bit is OR d with the hard RS(1) pin value.See Table 3.11 for timing requirements. Default at power up is logic zero/low. If Soft RS(1) is not implemented, the transceiver ignores the value of this bit. Note: Specific transceiver behaviors of this bit are identified in Table 3.6a and referenced documents. See Table 3.17, byte 110, bit 3 for Soft RS(0) Select.')
nbsSffMsxTableSize = MibScalar((1, 3, 6, 1, 4, 1, 629, 204, 1, 4, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsxTableSize.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsxTableSize.setDescription('The number of entries in nbsSffMsxTable')
nbsSffMsxTable = MibTable((1, 3, 6, 1, 4, 1, 629, 204, 1, 4, 2), )
if mibBuilder.loadTexts: nbsSffMsxTable.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsxTable.setDescription('Non-standardized extensions to the Multi-Source Agreement')
nbsSffMsxEntry = MibTableRow((1, 3, 6, 1, 4, 1, 629, 204, 1, 4, 2, 1), ).setIndexNames((0, "NBS-SFF-MIB", "nbsSffMsxPhysicalIfIndex"))
if mibBuilder.loadTexts: nbsSffMsxEntry.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsxEntry.setDescription('Pluggable Transceiver information and settings yet to be standardized')
nbsSffMsxPhysicalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 4, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nbsSffMsxPhysicalIfIndex.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsxPhysicalIfIndex.setDescription('MIB2 ifIndex of this port')
nbsSffMsxHasSgmiiPhy = MibTableColumn((1, 3, 6, 1, 4, 1, 629, 204, 1, 4, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("notSupported", 1), ("no", 2), ("yes", 3))).clone('no')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: nbsSffMsxHasSgmiiPhy.setStatus('current')
if mibBuilder.loadTexts: nbsSffMsxHasSgmiiPhy.setDescription('Some Gigabit Ethernet compatible SFP transeivers, such as SFP-FDSGMII-M and SFP-FDSGMII-LR, have a built-in SGMII PHY. Those that do require special autonegotiation processing, without which autonegotiation will fail and the port will be unable to pass traffic. If the SFP has a built-in SGMII PHY, the user should set this to yes(3).')
mibBuilder.exportSymbols("NBS-SFF-MIB", nbsSffDiagsOptSoftRxLoSMonitoring=nbsSffDiagsOptSoftRxLoSMonitoring, nbsSffDiagsOptAppSelectControl=nbsSffDiagsOptAppSelectControl, nbsSffWdmNumberOfChannels=nbsSffWdmNumberOfChannels, nbsSffMsxHasSgmiiPhy=nbsSffMsxHasSgmiiPhy, nbsSffMsaExtChecksumMatch=nbsSffMsaExtChecksumMatch, nbsSffDiagsEntry=nbsSffDiagsEntry, nbsSffWdmExtTransmitPowerType=nbsSffWdmExtTransmitPowerType, nbsSffDiagsLinkLengthOm3=nbsSffDiagsLinkLengthOm3, nbsSffDiagsVoltage=nbsSffDiagsVoltage, nbsSffWdmGrp=nbsSffWdmGrp, nbsSffMsaGrp=nbsSffMsaGrp, nbsSffDiagsBiasCurrentSlope=nbsSffDiagsBiasCurrentSlope, nbsSffDiagsInternallyCalibrated=nbsSffDiagsInternallyCalibrated, nbsSffMsaTable=nbsSffMsaTable, nbsSffMsaMinBitRate=nbsSffMsaMinBitRate, nbsSffDiagsBiasHighWarn=nbsSffDiagsBiasHighWarn, nbsSffDiagsBiasCurrentOffset=nbsSffDiagsBiasCurrentOffset, nbsSffWdmClassOfTemperature=nbsSffWdmClassOfTemperature, nbsSffDiagsPowerLevelOpState=nbsSffDiagsPowerLevelOpState, nbsSffWdmOptionalInterruptPin=nbsSffWdmOptionalInterruptPin, nbsSffDiagsOptSoftTxDisable=nbsSffDiagsOptSoftTxDisable, nbsSffDiagsOptSoftRSControlMon=nbsSffDiagsOptSoftRSControlMon, nbsSffMsaSerialEncoding=nbsSffMsaSerialEncoding, nbsSffMsaIdentifier=nbsSffMsaIdentifier, PYSNMP_MODULE_ID=nbsSffMib, nbsSffMsaTransceiverCodes=nbsSffMsaTransceiverCodes, nbsSffDiagsBiasHighAlarm=nbsSffDiagsBiasHighAlarm, nbsSffDiagsOptSoftTxFaultMonitoring=nbsSffDiagsOptSoftTxFaultMonitoring, nbsSffWdmMaxCaseTemperature=nbsSffWdmMaxCaseTemperature, nbsSffWdmWavelengthMonitorType=nbsSffWdmWavelengthMonitorType, nbsSffDiagsRxLosState=nbsSffDiagsRxLosState, nbsSffMsaLinkLengthSmf100m=nbsSffMsaLinkLengthSmf100m, nbsSffDiagsSoftRSSelect=nbsSffDiagsSoftRSSelect, nbsSffDiagsTempHighWarn=nbsSffDiagsTempHighWarn, nbsSffMsxTableSize=nbsSffMsxTableSize, nbsSffDiagsBiasLowAlarm=nbsSffDiagsBiasLowAlarm, nbsSffWdmVariableOpticalAttenuator=nbsSffWdmVariableOpticalAttenuator, nbsSffMsaLossOfSignalInverted=nbsSffMsaLossOfSignalInverted, nbsSffWdmLaserWavelength=nbsSffWdmLaserWavelength, nbsSffMsxEntry=nbsSffMsxEntry, nbsSffMsaCopperLinkLength=nbsSffMsaCopperLinkLength, nbsSffDiagsTempLowAlarm=nbsSffDiagsTempLowAlarm, nbsSffDiagsRxPowerHighWarn=nbsSffDiagsRxPowerHighWarn, nbsSffDiagsRateSelectState0=nbsSffDiagsRateSelectState0, nbsSffDiagsTxPowerHighWarn=nbsSffDiagsTxPowerHighWarn, nbsSffDiagsExternallyCalibrated=nbsSffDiagsExternallyCalibrated, nbsSffDiagsCooledTranDeclaration=nbsSffDiagsCooledTranDeclaration, nbsSffDiagsSoftTxDisableSelect=nbsSffDiagsSoftTxDisableSelect, nbsSffDiagsRS1State=nbsSffDiagsRS1State, nbsSffDiagsTxFaultState=nbsSffDiagsTxFaultState, nbsSffMsaVendorSerialNumber=nbsSffMsaVendorSerialNumber, nbsSffMsxPhysicalIfIndex=nbsSffMsxPhysicalIfIndex, nbsSffMsaExtIdentifier=nbsSffMsaExtIdentifier, nbsSffMsaVendorRevision=nbsSffMsaVendorRevision, nbsSffDiagsDDMonitoringImplemented=nbsSffDiagsDDMonitoringImplemented, nbsSffMsaTxFault=nbsSffMsaTxFault, nbsSffMsaLinkLengthSmfKm=nbsSffMsaLinkLengthSmfKm, nbsSffMsaRateSelectImplemented=nbsSffMsaRateSelectImplemented, nbsSffDiagnosticsGrp=nbsSffDiagnosticsGrp, nbsSffDiagsLROutputImplemented=nbsSffDiagsLROutputImplemented, nbsSffDiagsPowerLevelSelect=nbsSffDiagsPowerLevelSelect, nbsSffMsxTable=nbsSffMsxTable, nbsSffMib=nbsSffMib, nbsSffDiagsTxDisableState=nbsSffDiagsTxDisableState, nbsSffDiagsVoltageOffset=nbsSffDiagsVoltageOffset, nbsSffDiagsTemperature=nbsSffDiagsTemperature, nbsSffWdmTable=nbsSffWdmTable, nbsSffDiagsTempHighAlarm=nbsSffDiagsTempHighAlarm, nbsSffMsaNominalBitRate=nbsSffMsaNominalBitRate, nbsSffWdmVariableDecisionThreshold=nbsSffWdmVariableDecisionThreshold, nbsSffDiagsVoltLowAlarm=nbsSffDiagsVoltLowAlarm, nbsSffDiagsTxPowerLowWarn=nbsSffDiagsTxPowerLowWarn, nbsSffMsaVendorPartNumber=nbsSffMsaVendorPartNumber, nbsSffMsaLinkLength625Mmf10m=nbsSffMsaLinkLength625Mmf10m, nbsSffDiagsOptRateSelectControl=nbsSffDiagsOptRateSelectControl, nbsSffDiagsBiasLowWarn=nbsSffDiagsBiasLowWarn, nbsSffDiagsTxPowerHighAlarm=nbsSffDiagsTxPowerHighAlarm, nbsSffDiagsRxPowerLowWarn=nbsSffDiagsRxPowerLowWarn, nbsSffDiagsTemperatureOffset=nbsSffDiagsTemperatureOffset, nbsSffDiags8472Compliance=nbsSffDiags8472Compliance, nbsSffDiagsTxPower=nbsSffDiagsTxPower, nbsSffDiagsTempLowWarn=nbsSffDiagsTempLowWarn, nbsSffMsaMaxBitRate=nbsSffMsaMaxBitRate, nbsSffDiagsDataReadyBarState=nbsSffDiagsDataReadyBarState, nbsSffDiagsVoltHighWarn=nbsSffDiagsVoltHighWarn, nbsSffDiagsTxPowerOffset=nbsSffDiagsTxPowerOffset, nbsSffDiagsRxPowerLowAlarm=nbsSffDiagsRxPowerLowAlarm, nbsSffDiagsTxPowerLowAlarm=nbsSffDiagsTxPowerLowAlarm, nbsSffDiagsVoltLowWarn=nbsSffDiagsVoltLowWarn, nbsSffMsaLossOfSignalImplemented=nbsSffMsaLossOfSignalImplemented, nbsSffDiagsAddressChangeRequired=nbsSffDiagsAddressChangeRequired, nbsSffDiagsPowerLevelDeclaration=nbsSffDiagsPowerLevelDeclaration, nbsSffMsxGrp=nbsSffMsxGrp, nbsSffDiagsSoftRateSelect=nbsSffDiagsSoftRateSelect, nbsSffWdmPilotToneFunctionality=nbsSffWdmPilotToneFunctionality, nbsSffDiagsVoltageSlope=nbsSffDiagsVoltageSlope, nbsSffWdmChannelSpacing=nbsSffWdmChannelSpacing, nbsSffMsaOpticalConnector=nbsSffMsaOpticalConnector, nbsSffDiagsRxPowerHighAlarm=nbsSffDiagsRxPowerHighAlarm, nbsSffDiagsPowerMeasurementType=nbsSffDiagsPowerMeasurementType, nbsSffWdmMaxSupplyCurrent=nbsSffWdmMaxSupplyCurrent, nbsSffMsaLinkLengthMmf10m=nbsSffMsaLinkLengthMmf10m, nbsSffMsaVendorOUI=nbsSffMsaVendorOUI, nbsSffObjects=nbsSffObjects, nbsSffMsaVendorDateCode=nbsSffMsaVendorDateCode, nbsSffDiagsBiasCurrent=nbsSffDiagsBiasCurrent, nbsSffDiagsRxPower=nbsSffDiagsRxPower, nbsSffWdmOpticalReach=nbsSffWdmOpticalReach, nbsSffMsaTxDisable=nbsSffMsaTxDisable, nbsSffDiagsRateIdentifier=nbsSffDiagsRateIdentifier, nbsSffWdmClassOfWdm=nbsSffWdmClassOfWdm, nbsSffDiagsTxPowerSlope=nbsSffDiagsTxPowerSlope, nbsSffWdmEntry=nbsSffWdmEntry, nbsSffDiagsTemperatureSlope=nbsSffDiagsTemperatureSlope, nbsSffWdmMinCaseTemperature=nbsSffWdmMinCaseTemperature, nbsSffMsaPhysicalIfIndex=nbsSffMsaPhysicalIfIndex, nbsSffDiagsLaserWavelength=nbsSffDiagsLaserWavelength, nbsSffMsaVendorName=nbsSffMsaVendorName, InterfaceIndex=InterfaceIndex, nbsSffDiagsTable=nbsSffDiagsTable, nbsSffDiagsOptAlarmWarningFlags=nbsSffDiagsOptAlarmWarningFlags, nbsSffDiagsVoltHighAlarm=nbsSffDiagsVoltHighAlarm, nbsSffMsaBaseChecksumMatch=nbsSffMsaBaseChecksumMatch, nbsSffMsaEntry=nbsSffMsaEntry, nbsSffWdmClassOfPower=nbsSffWdmClassOfPower)
|
farmer = {
'kb': '''
Farmer(Mac)
Rabbit(Pete)
Mother(MrsMac, Mac)
Mother(MrsRabbit, Pete)
(Rabbit(r) & Farmer(f)) ==> Hates(f, r)
(Mother(m, c)) ==> Loves(m, c)
(Mother(m, r) & Rabbit(r)) ==> Rabbit(m)
(Farmer(f)) ==> Human(f)
(Mother(m, h) & Human(h)) ==> Human(m)
''',
# Note that this order of conjuncts
# would result in infinite recursion:
# '(Human(h) & Mother(m, h)) ==> Human(m)'
'queries':'''
Human(x)
Hates(x, y)
''',
# 'limit': 1,
}
weapons = {
'kb': '''
(American(x) & Weapon(y) & Sells(x, y, z) & Hostile(z)) ==> Criminal(x)
Owns(Nono, M1)
Missile(M1)
(Missile(x) & Owns(Nono, x)) ==> Sells(West, x, Nono)
Missile(x) ==> Weapon(x)
Enemy(x, America) ==> Hostile(x)
American(West)
Enemy(Nono, America)
''',
'queries':'''
Criminal(x)
''',
}
war = {
'kb': '''
Country(USA)
Country(GreatBritain)
Country(Iran)
Country(France)
Country(Germany)
Country(Iraq)
Person(Jim)
Person(Sam)
Person(Carl)
Allies(USA,GreatBritain)
Allies(USA,France)
Allies(USA,Germany)
Attacks(Jim,Iran)
Attacks(Carl,Sam)
Attacks(Iran,France)
Attacks(Iraq,Germany)
Region(MiddleEast)
Contains(MiddleEast,Iran,Iraq)
Person(x) & Country(y) & Attacks(x,y) ==> Dead(x)
Person(x) & Person(y) & Attacks(x,y) ==> Dead(y)
Attacks(x,y) & Country(x) & Country(y) ==> DeclaresWar(y,x)
DeclaresWar(x,y) & Allies(USA,x) ==> Destroyed(y)
Region(x) & Contains(x,y,z) & Destroyed(y) & Destroyed(z) ==> Sad(x)
Mother(Lucy,Sam)
Mother(Linda,Carl)
Mother(x,y) & Dead(y) ==> Sad(x)
''',
#Contains Countries who can be allies and attack eachother. When one country attacks another, war is declared.
# If the USA is an ally of an attacked country, then the attacker is destroyed.
# There are also persons who can attack countries, but cannot start wars and die because of their efforts.
# Persons can kill other persons as well. Persons also have mothers who are sad if their
# child is dead. Regions contain countries and are sad if all of their countries are destroyed.
'queries':'''
Dead(x)
Destroyed(x)
DeclaresWar(Germany, x)
Sad(x)
''',
}
Examples = {
# 'farmer': farmer,
# 'weapons': weapons,
'war': war,
}
#DeclaresWar(x,y) & ~(Attacks(x,y)) ==> Attacks(x,y)
# Allies(x,y) ==> Allies(y,x)
# Allies(x,y) & Allies(y,z) ==> Allies(x,z)
|
"""Configuration of OSP-core warnings."""
attributes_cannot_modify_in_place = True
"""Warns when a user fetches a mutable attribute of a CUDS object.
For example `fr = city.City(name='Freiburg', coordinates=[1, 2]);
fr.coordinates`.
"""
|
# Copyright 2010 Curtis McEnroe <[email protected]>
# Licensed under the GNU GPLv3
class Scope:
def __init__(self, parent=None):
self.bindings = {}
self.parent = parent
def __getitem__(self, key):
# If bound in this scope, return that
if self.bindings.has_key(key):
return self.bindings[key]
# Otherwise, look for it in the parent scope
elif self.parent:
return self.parent[key]
# If we have no parent, key is not bound at all
else:
raise NameError("name '%s' is not bound" % key)
def __setitem__(self, key, value):
# Will shadow any bindings in the parent scope
self.bindings[key] = value
def __delitem__(self, key):
del(self.bindings[key])
def __repr__(self):
# For debugging...
if self.parent:
return repr(self.parent) + '\n' + repr(self.bindings)
else:
return repr(self.bindings)
def has_key(self, key):
return self.bindings.has_key(key)
|
def soma(x: float, y: float) -> float:
return x + y
def main() -> None:
print(soma(10, 40))
print(soma(30, 30))
if __name__== '__main__':
main()
|
l=float(input('Diga a largura da sua parede em metros: '))
a=float(input('Diga a altura da sua parede em metros: '))
print('A área de sua parede tem {:.2f} m² e para pintá-la '.format(l*a),end=
'você precisará de {:.2f} litros de tinta.'.format((l*a)/2))
|
rol_enviar_notificaiones_servidor = "Server"
time_resend_mail = 300
minimo_nivel_bateria = 30 #3.0V
|
#!/usr/bin/env python
__author__ = "Christopher and Cody Reichert"
__copyright__ = "Copyright 2015, SimplyRETS Inc. <[email protected]>"
__credits__ = ["Christopher Reichert", "Cody Reichert"]
__license__ = "MIT"
__version__ = "0.1"
__maintainer__ = "Christopher Reichert"
__email__ = "[email protected]"
__status__ = "Production"
class MlsInformation:
""" NOTE: This class is auto generated by the SimplyRets code
generator program. Do not edit the class manually.
"""
def __init__(self):
self.simplyRetsTypes = {
'status': 'str',
'area': 'str',
'daysOnMarket': 'long'
}
# MLS Status Code. Compliant with data dictionary v1.3 ListingStatus
self.status = None # str
# MLS Area. Generally a subdivision or community name.
self.area = None # str
# Amount of days the property has been Active
self.daysOnMarket = None # long
|
STDIN_FILENO = 0
STDOUT_FILENO = 1
STDERR_FILENO = 2
DEFAULT_PORT = 0xdb9
DEFAULT_IP = '127.0.0.1'
DEFAULT_CONNECT_TIMEOUT = 10.
|
#14) Longest Collatz sequence
#The following iterative sequence is defined for the set of positive integers:
#n → n/2 (n is even)
#n → 3n + 1 (n is odd)
#Using the rule above and starting with 13, we generate the following sequence: 13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1
#It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.
#Which starting number, under one million, produces the longest chain?
#NOTE: Once the chain starts the terms are allowed to go above one million.
# Solution
def collatz(n):
nums = []
while n > 1:
nums.append(n)
n=(n//2,n*3+1)[int(n%2)]
return nums+[1]
def collatz_count(n, d = {1: 1}):
stack = []
while n not in d:
stack.append(n)
n = n * 3 + 1 if n & 1 else n // 2
c = d[n]
while stack:
c += 1
d[stack.pop()] = c
return c
counts = [(x, collatz_count(x)) for x in range(1, 10**6)]
sorted(counts, key=lambda tup: tup[1], reverse = True)[0]
|
"""
A unival tree (which stands for "universal value") is a tree where all nodes under it have the same value.
Given the root to a binary tree, count the number of unival subtrees.
"""
class BinaryTree(object):
def __init__(self, value):
self.value = value
self.left = None
self.right = None
class Solution:
def universal_value(self, tree):
pass # TODO
root = BinaryTree(0)
root.left = BinaryTree(1)
root.right = BinaryTree(0)
root.right.left = BinaryTree(1)
root.right.left.left = BinaryTree(1)
root.right.left.right = BinaryTree(1)
root.right.right = BinaryTree(0)
# print(root)
print(Solution().universal_value(root))
|
#Simay Hoşmeyve
#180401017
degerler = []
with open ("veriler.txt","r")as dosya:
for line in dosya.readlines():
degerler.append(int(line))
def textYazdir(katsayi,sonuc,ilk,son):
text = open("sonuc.txt", "a",encoding="utf-8")
text.write(str(len(katsayi)-1)+'. derece\n')
text.write('Katsayılar:')
text.write('\n')
for i in katsayi:
text.write(str(i))
text.write('\n')
text.write('\n')
text.write('Veriler:')
text.write('\n')
for i in range(ilk,son):
text.write('Veri:')
text.write(str(degerler[i]))
text.write('\t')
text.write('Sonuç:')
text.write(str(sonuc[i-ilk]))
text.write('\n')
text.write('#'*50)
text.write('\n')
text.close
def karekok(sayi):
#NEWTON RAPHSON İLE KAREKÖK HESAPLAMA
def f(x):
return(x**2-sayi)
#x**2=sayi eşitliğinden a sayısının karekökü hesaplanır
def fi(x):
return(2*x)
x2,t=0,1
def hata(x1,x2):
return((x1-x2)/x1)
x1 =100 #yaklaştırma istenen bir tahmin
while(abs(hata(t,x2))> 0.0001):
x2 = x1 - f(x1)/fi(x1)
t=x1
x1=x2
return x1
def hataPayi(sonuc,ilk,son):
n=son-ilk
yi = 0
for i in range(ilk,son):
yi+=degerler[i]
y_ort = yi/n
Sr = 0
for i in range(ilk,son):
Sr = (sonuc[i-ilk] - degerler[i]) ** 2 + Sr
St = 0
for i in range(ilk,son):
St = St + (degerler[i] - y_ort)**2
rkare= abs((St-Sr)/St)
r = karekok(rkare)
return r
def linearsolver(A,b):#matris hesaplama
n = len(A)
M = A
i = 0
for x in M:
x.append(b[i])
i += 1
for k in range(n):
for i in range(k,n):
if abs(M[i][k]) > abs(M[k][k]):
M[k], M[i] = M[i],M[k]
else:
pass
for j in range(k+1,n):
q = float(M[j][k] / M[k][k])
for m in range(k, n+1):
M[j][m] -= q * M[k][m]
x = [0 for i in range(n)]
x[n-1] = float(M[n-1][n]/M[n-1][n-1])
for i in range (n-1,-1,-1):
z = 0
for j in range(i+1,n):
z = z + float(M[i][j])*x[j]
x[i] = float(M[i][n] - z)/M[i][i]
return x
def yaklastirma(ilk,son):
korelasyon=[]
aralik = son-ilk
for derece in range(1,7):
x_val = []
#y_val = []
for i in range(aralik):
#y_val.append(degerler[i])
x_val.append(i+1)
matris = [[0 for i in range(derece+1)] for j in range(derece+1)]
x=len(matris)
for i in range(x): #x toplamları
for j in range(x):
sum_x=0
for k in range(aralik):
matris[0][0] = len(x_val)
sum_x +=x_val[k]**(i+j)
matris[i][j] = sum_x
xy_sonuc = [] #xy carpımlarının toplamları
for m in range(x):
sum_xy = 0
for n in range(ilk,son):
sum_xy = sum_xy + (degerler[n]*(x_val[n-ilk]**m))
xy_sonuc.append(sum_xy)
katsayi=linearsolver(matris,xy_sonuc)
sonuc= []
for i in range(aralik):
toplam = 0
for j in range(len(katsayi)):
toplam = toplam + katsayi[j]*((i+1)**j)
if j == derece:
sonuc.append(int(toplam))
k = hataPayi(sonuc,ilk,son)
korelasyon.append(k)
textYazdir(katsayi,sonuc,ilk,son)
max = 100
index=0
for i in range(len(korelasyon)):
temp = abs(1-korelasyon[i])
if temp<max:
max = temp
index = i+1
dosya = open('sonuc.txt','a+')
dosya.write(str(ilk)+'-'+str(son)+' verilerinde en uygun derece: '+str(index)+'\n')
dosya.write('Korelasyonu: '+str(korelasyon[index-1])+'\n')
dosya.write('\n')
dosya.close()
yaklastirma(0,len(degerler))
a = 0
b = 10
while(b<=len(degerler)):#10lu aralıklar icin yaklastirma
yaklastirma(a,b)
a += 10
b += 10
|
s=input().split()
n1=str(s[0].replace('7','0'))
op=s[1]
n2=str(s[2].replace('7','0'))
res=str(int(n1)+int(n2)) if op=='+' else str(int(n1)*int(n2))
res=int(res.replace('7','0'))
print(res)
|
class MyMsp430Constants:
ACT_PXY_ADC = 0x40
ACT_PXY_DACDMA = 0x41
ACT_PXY_NMI = 0x42
ACT_PXY_PORT1 = 0x43
ACT_PXY_PORT2 = 0x44
ACT_PXY_TIMERA0 = 0x45
ACT_PXY_TIMERA1 = 0x46
ACT_PXY_TIMERB0 = 0x47
ACT_PXY_TIMERB1 = 0x48
ACT_PXY_UART0RX = 0x49
ACT_PXY_UART0TX = 0x4A
ACT_PXY_UART1RX = 0x4B
ACT_PXY_UART1TX = 0x4C
ACT_TIMER = 0x31
ACT_MAIN = 0x1
ACT_A = 0x2
ACT_B = 0x3
name = {
ACT_PXY_ADC : 'int_ADC' ,
ACT_PXY_DACDMA : 'int_DACDMA' ,
ACT_PXY_NMI : 'int_NMI' ,
ACT_PXY_PORT1 : 'int_PORT1' ,
ACT_PXY_PORT2 : 'int_PORT2' ,
ACT_PXY_TIMERA0 : 'int_TIMERA0',
ACT_PXY_TIMERA1 : 'int_TIMERA1',
ACT_PXY_TIMERB0 : 'int_TIMERB0',
ACT_PXY_TIMERB1 : 'int_TIMERB1',
ACT_PXY_UART0RX : 'int_UART0RX',
ACT_PXY_UART0TX : 'int_UART0TX',
ACT_PXY_UART1RX : 'int_UART1RX',
ACT_PXY_UART1TX : 'int_UART1TX',
ACT_TIMER : 'VTimer',
ACT_MAIN : 'Main',
ACT_A : 'ActA',
ACT_B : 'ActB'
}
|
def prenom():
prenom = input("Bonjour ! Quel est votre prénom?\n")
if (prenom == 'Johnny'):
print("Je te déteste!")
elif(prenom =='Paul'):
print("Hello my love !")
elif(prenom =='Marc'):
print("Hello my love !")
elif(prenom =='Ismael'):
print ("salut, désolé pas le temps de te parler.")
prenom()
|
# A Python program to demonstrate both packing and
# unpacking.
# A sample python function that takes three arguments
# and prints them
def fun1(a, b, c):
print(a, b, c)
# Another sample function.
# This is an example of PACKING. All arguments passed
# to fun2 are packed into tuple *args.
def fun2(*args):
# Convert args tuple to a list so we can modify it
args = list(args)
# Modifying args
args[0] = 'Wikitechy'
args[1] = 'awesome'
# UNPACKING args and calling fun1()
fun1(*args)
# Driver code
fun2('Hello', 'beautiful', 'world!')
|
# Coding Challenge 2
### Chelsea Lizardo
### NRS 528
#
#
#3 Ask the user for an input of their current age, and tell them how many years until they reach retirement (65 years old).
name = input("What is your name: ")
age = int(input("How old are you: "))
year = str((2021 - age)+65)
#print name input + " will be 65 years old in the year " + year
print(name + " will be 65 years old in the year " + year)
# Feedback - Great take on the task, but you don't actaully answer the challenge, add the uears until retirement as well
|
__name__ = "bootstrap-scoped"
__version__ = "0.1.0"
__url__ = "https://github.com/achillesrasquinha/bootstrap-scoped"
__author__ = "Achilles Rasquinha"
__email__ = "[email protected]"
__description__ = "Scope your Bootstrap assets in a jiffy!"
__license__ = "MIT"
__keywords__ = ["bootstrap", "scoped", "css", "sass", "scss", "less", "command"]
|
"""
Copy out of the top of sympy.core.compatibility as of
b8aa2de87d537eddde044c13f2eaaab99a5dcfe7
This can be deleted when we depend on sympy 0.7.0 or later
"""
"""
Reimplementations of constructs introduced in later versions of Python than we
support.
"""
# These are in here because telling if something is an iterable just by calling
# hasattr(obj, "__iter__") behaves differently in Python 2 and Python 3. In
# particular, hasattr(str, "__iter__") is False in Python 2 and True in Python 3.
# I think putting them here also makes it easier to use them in the core.
def iterable(i, exclude=(basestring, dict)):
"""
Return a boolean indicating whether i is an iterable in the sympy sense.
When sympy is working with iterables, it is almost always assuming
that the iterable is not a string or a mapping, so those are excluded
by default. If you want a pure python definition, make exclude=None. To
exclude multiple items, pass them as a tuple.
See also: is_sequence
Examples:
>>> things = [[1], (1,), set([1]), (j for j in [1, 2]), {1:2}, '1', 1]
In the test below, Python 2 prints output including e.g ``<type 'list'``
where Python 3 prints e.g. ``<class 'list'>``.
>>> for i in things: #doctest: +IGNORE_OUTPUT
... print iterable(i), type(i)
True <type 'list'>
True <type 'tuple'>
True <type 'set'>
True <type 'generator'>
False <type 'dict'>
False <type 'str'>
False <type 'int'>
>>> iterable({}, exclude=None)
True
>>> iterable({}, exclude=str)
True
>>> iterable("no", exclude=str)
False
"""
try:
iter(i)
except TypeError:
return False
if exclude:
return not isinstance(i, exclude)
return True
def is_sequence(i, include=None):
"""
Return a boolean indicating whether i is a sequence in the sympy
sense. If anything that fails the test below should be included as
being a sequence for your application, set 'include' to that object's
type; multiple types should be passed as a tuple of types.
Note: although generators can generate a sequence, they often need special
handling to make sure their elements are captured before the generator is
exhausted, so these are not included by default in the definition of a
sequence.
See also: iterable
Examples:
>>> from nipy.fixes.sympy.utilities.compatibility import is_sequence
>>> from types import GeneratorType
>>> is_sequence([])
True
>>> is_sequence(set())
False
>>> is_sequence('abc')
False
>>> is_sequence('abc', include=str)
True
>>> generator = (c for c in 'abc')
>>> is_sequence(generator)
False
>>> is_sequence(generator, include=(str, GeneratorType))
True
"""
return (hasattr(i, '__getitem__') and
iterable(i) or
bool(include) and
isinstance(i, include))
|
def process_image(img):
# 1) Define source and destination points for perspective transform
dst_size = 5
source = np.float32([[200, 95],[300, 140],[10, 140],[118, 95]])
destination = np.float32([[165, 135],[165, 145],[155, 145],[155, 135]])
# 2) Apply perspective transform
warped = perspect_transform(img, source, destination)
# 3) Apply color threshold to identify navigable terrain/obstacles/rock samples
rgb_nav_min = (170,170,170)
rgb_nav_max = (255, 255, 255)
navigable_threshed = color_thresh(warped, rgb_nav_min, rgb_nav_max)
rgb_obs_min = (0,0,0)
rgb_obs_max = (170,170,170)
threshed_obstacles = color_thresh(warped,rgb_obs_min, rgb_obs_max)
rgb_rock_min = (110, 110, 5)
rgb_rock_max = (210, 210, 145)
threshed_rocks = color_thresh(warped, rgb_rock_min, rgb_rock_max)
# 4) Convert thresholded image pixel values to rover-centric coords
x_nav_px, y_nav_px = rover_coords(navigable_threshed)
x_obs_px, y_obs_px = rover_coords(threshed_obstacles)
# 5) Convert rover-centric pixel values to world coords
xpos = data.xpos[data.count]
ypos = data.ypos[data.count]
yaw = data.yaw[data.count]
w_size = data.worldmap.shape[0]
scale = 2 * dst_size # defines how big squares are in the perspective transform
nav_x_w, nav_y_w = pix_to_world(x_nav_px, y_nav_px, xpos, ypos, yaw, w_size, scale)
obs_x_w, obs_y_w = pix_to_world(x_obs_px, y_obs_px, xpos, ypos, yaw, w_size, scale)
# to account for overlap between the two
data.worldmap[nav_y_w, nav_x_w, 2] += 1
data.worldmap[obs_y_w, obs_x_w, 0] += 1
nav_pix = data.worldmap[:,:, 2] > 2 # blue channel
data.worldmap[nav_pix,0] = 0 # red channel
data.worldmap[nav_pix,2] = 255 # blue channel
obs_pix = data.worldmap[:,:, 0] > 6 # red channel
data.worldmap[obs_pix,0] = 255 # red channel
output_image = np.zeros((img.shape[0] + data.worldmap.shape[0], img.shape[1]*2, 3))
# Populate regions of the image with various output
output_image[0:img.shape[0], 0:img.shape[1]] = img
warped = perspect_transform(img, source, destination)
output_image[0:img.shape[0], img.shape[1]:] = warped # warped image in the upper right
# Overlay worldmap with ground truth map
map_add = cv2.addWeighted(data.worldmap, 1, data.ground_truth, 0.5, 0)
# Flip map overlay so y-axis points upward and add to output_image
output_image[img.shape[0]:, 0:data.worldmap.shape[1]] = np.flipud(map_add)
# Put some text over the image
cv2.putText(output_image,"Populate this image with your analyses to make a video!", (20, 20),
cv2.FONT_HERSHEY_COMPLEX, 0.4, (255, 255, 255), 1)
data.count += 1 # Keep track of the index in the Databucket()
return output_image
|
class Solution:
def isPalindrome(self, s):
"""
:type s: str
:rtype: bool
"""
i, j = 0, (len(s) - 1)
while i < j:
while i < j and not s[i].isalnum():
i += 1
while i < j and not s[j].isalnum():
j -= 1
if s[i].lower() != s[j].lower():
return False
i += 1
j -= 1
return True
if __name__ == "__main__":
print(Solution().isPalindrome("A man, a plan, a canal: Panama"))
"""
The isalnum() method checks whether the string consists of alphanumeric characters.
Time Complexity = O(n)
Space Complexity = O(1)
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
Note: For the purpose of this problem, we define empty string as valid palindrome.
Example:
Input: "A man, a plan, a canal: Panama"
Output: true
"""
|
# -*- encoding: utf-8 -*-
def spam():
pass
def grok():
pass
blah = 42
__all__ = {'spam', 'grok'}
|
description = 'NOK5a using Beckhoff controllers'
group = 'lowlevel'
instrument_values = configdata('instrument.values')
showcase_values = configdata('cf_showcase.showcase_values')
optic_values = configdata('cf_optic.optic_values')
tango_base = instrument_values['tango_base']
code_base = instrument_values['code_base']
index_r = 2
index_s = 3
devices = {
'%s' % setupname : device(code_base + 'beckhoff.nok.DoubleMotorBeckhoffNOK',
description = '%s layer optic' % setupname,
tangodevice = tango_base + 'optic/io/modbus',
addresses = [0x3020+index_r*10, 0x3020+index_s*10],
ruler = [267.689, 279.73], # abs enc! 79.6439,
nok_start = 2418.50,
nok_end = 4137.70,
nok_gap = 1.0,
nok_motor = [3108.00, 3888.00],
unit = 'mm, mm',
fmtstr = '%.2f, %.2f',
inclinationlimits = (-9.99, 9.99),
masks = {
'ng': 0.0 + optic_values['ng'], # 2021-03-18 11:52:07 TheoMH ok
'rc': 0.0 + optic_values['ng'], # 2021-03-18 11:52:07 TheoMH ok
'vc': 0.0 + optic_values['vc'], # 2021-03-18 11:52:07 TheoMH ok
'fc': 0.0 + optic_values['fc'], # 2021-03-18 11:52:07 TheoMH ok
# 'pola': showcase_values['pola'],
},
),
}
|
# Crie um programa que leia um número inteiro e mostre na tela se ele é
# PAR ou ÍMPAR.#
#minha resolução do desafio
n = int(input('Digite um número qualquer: '))
if n % 2 == 0:
print('O número {} é Par'.format(n))
else:
print('O número {} é Ímpar'.format(n))
# resolução do Professor Guanabara
"""
número = int(input('Me diga um número qualquer: '))
resultado = número % 2
if resultado == 0:
print('O número {} é PAR'.format(número))
else:
print('O número {} é ÍMPAR'.format(número))
"""
|
# coding: utf-8
class StackUnderflow(ValueError):
pass
class SStack(object):
"""采用动态顺序表实现的栈"""
def __init__(self):
self._elems = []
def is_empty(self):
return len(self._elems) == 0
def top(self):
if self.is_empty():
raise StackUnderflow("in SStack.top")
return self._elems[-1]
def push(self, elem):
self._elems.append(elem)
def pop(self):
if self.is_empty():
raise StackUnderflow("in SStack.pop")
return self._elems.pop()
|
DATA_DIR = '/floyd/input'
PTB_DIR = '_ptb'
BROWN_DIR = '_brown'
GUTENBERG_DIR = '_gutenberg'
BIBLE_DIR = '_bible'
WIKITEXT2_DIR = '_wikitext2'
WIKITEXT103_DIR = '_wikitext103'
TRAIN = 'train'
TEST = 'test'
VAL = 'val'
MODEL_DIR = 'bin'
FLOYD = True
|
val = int(input('Digite o valor que você quer sacar: R$ '))
total = val
ced = 50
totced = 0
while True:
if total >= ced:
total -= ced
totced += 1
else:
print(f'Total de {totced} cédulas de {ced} reais')
if ced == 50:
ced == 20
elif ced == 20:
ced == 10
elif ced == 10:
ced = 1
totced == 0
if total == 0:
break
'''valor = int(input("informe o valor a ser sacado : "))
nota50 = valor // 50
valor %= 50
nota20 = valor // 20
valor %= 20
nota10 = valor // 10
valor %= 10
nota1 = valor // 1
print(f"notas de 50 = {nota50}")
print(f"notas de 20 = {nota20}")
print(f"notas de 10 = {nota10}")
print(f"notas de 1 = {nota1}")'''
|
def textPreprocessing(text):
p_words = ['.','?','!',':',';','-','[',']','{','}','(',')','’',',','"',]
s_words = ['i', 'a', 'about', 'am', 'an', 'are', 'as', 'at', 'be', 'by', 'for', 'from', 'how', 'in', 'is', 'it', 'of', 'on', 'or', 'that', 'the', 'this', 'to', 'was', 'what', 'when', 'where', 'who', 'will', 'with']
new_line = ""
for letter in text:
if letter not in p_words:
new_line += letter
new_line = new_line.split()
new_words = []
for word in new_line:
word = word.lower()
if word not in s_words:
new_words.append(word)
checked_words = []
for i in new_words:
if i.endswith('ing'):
i = i.removesuffix('ing')
checked_words.append(i)
elif i.endswith('ed'):
i = i.removesuffix('ed')
checked_words.append(i)
elif i.endswith('s'):
i = i.removesuffix('s')
checked_words.append(i)
else:
checked_words.append(i)
return checked_words
print(textPreprocessing("I think, therefore I am."))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.