content
stringlengths 7
1.05M
|
---|
#
# PySNMP MIB module A3COM-HUAWEI-LPBKDT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-HUAWEI-LPBKDT-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 16:50:56 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)
#
h3cCommon, = mibBuilder.importSymbols("A3COM-HUAWEI-OID-MIB", "h3cCommon")
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint")
ifIndex, ifDescr = mibBuilder.importSymbols("IF-MIB", "ifIndex", "ifDescr")
VlanId, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "VlanId")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Bits, ObjectIdentity, NotificationType, iso, ModuleIdentity, Integer32, Counter32, Counter64, TimeTicks, Unsigned32, IpAddress, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "ObjectIdentity", "NotificationType", "iso", "ModuleIdentity", "Integer32", "Counter32", "Counter64", "TimeTicks", "Unsigned32", "IpAddress", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
h3cLpbkdt = ModuleIdentity((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 95))
h3cLpbkdt.setRevisions(('2009-03-30 17:41', '2008-09-27 15:04',))
if mibBuilder.loadTexts: h3cLpbkdt.setLastUpdated('200903301741Z')
if mibBuilder.loadTexts: h3cLpbkdt.setOrganization('H3C Technologies Co., Ltd.')
h3cLpbkdtNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 95, 1))
h3cLpbkdtObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 95, 2))
h3cLpbkdtTrapPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 95, 1, 0))
h3cLpbkdtTrapLoopbacked = NotificationType((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 95, 1, 0, 1)).setObjects(("IF-MIB", "ifIndex"), ("IF-MIB", "ifDescr"))
if mibBuilder.loadTexts: h3cLpbkdtTrapLoopbacked.setStatus('current')
h3cLpbkdtTrapRecovered = NotificationType((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 95, 1, 0, 2)).setObjects(("IF-MIB", "ifIndex"), ("IF-MIB", "ifDescr"))
if mibBuilder.loadTexts: h3cLpbkdtTrapRecovered.setStatus('current')
h3cLpbkdtTrapPerVlanLoopbacked = NotificationType((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 95, 1, 0, 3)).setObjects(("IF-MIB", "ifIndex"), ("IF-MIB", "ifDescr"), ("A3COM-HUAWEI-LPBKDT-MIB", "h3cLpbkdtVlanID"))
if mibBuilder.loadTexts: h3cLpbkdtTrapPerVlanLoopbacked.setStatus('current')
h3cLpbkdtTrapPerVlanRecovered = NotificationType((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 95, 1, 0, 4)).setObjects(("IF-MIB", "ifIndex"), ("IF-MIB", "ifDescr"), ("A3COM-HUAWEI-LPBKDT-MIB", "h3cLpbkdtVlanID"))
if mibBuilder.loadTexts: h3cLpbkdtTrapPerVlanRecovered.setStatus('current')
h3cLpbkdtVlanID = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 95, 2, 1), VlanId()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: h3cLpbkdtVlanID.setStatus('current')
mibBuilder.exportSymbols("A3COM-HUAWEI-LPBKDT-MIB", PYSNMP_MODULE_ID=h3cLpbkdt, h3cLpbkdtTrapRecovered=h3cLpbkdtTrapRecovered, h3cLpbkdtTrapPerVlanLoopbacked=h3cLpbkdtTrapPerVlanLoopbacked, h3cLpbkdt=h3cLpbkdt, h3cLpbkdtNotifications=h3cLpbkdtNotifications, h3cLpbkdtTrapPrefix=h3cLpbkdtTrapPrefix, h3cLpbkdtTrapPerVlanRecovered=h3cLpbkdtTrapPerVlanRecovered, h3cLpbkdtObjects=h3cLpbkdtObjects, h3cLpbkdtTrapLoopbacked=h3cLpbkdtTrapLoopbacked, h3cLpbkdtVlanID=h3cLpbkdtVlanID)
|
"""TODO: package docstring."""
def hello():
"""Say hello."""
print("Hello world!")
|
__title__ = 'https'
__author__ = 'Gloryness'
__license__ = 'MIT License'
|
class BoundedQueue:
# Constructor, which creates a new empty queue:
def __init__(self, capacity):
assert isinstance(capacity, int), ('Error: Type error: %s' % (type(capacity)))
assert capacity >= 0, ('Error: Illegal capacity: %d' % (capacity))
self.__items = []
self.__capacity = capacity
# Adds a new item to the back of the queue, and returns nothing:
def enqueue(self, item):
if len(self.__items) >= self.__capacity:
raise Exception('Error: Queue is full')
self.__items.append(item)
# Removes and returns the front-most item in the queue.
# Returns nothing if the queue is empty.
def dequeue(self):
if len(self.__items) <= 0:
raise Exception('Error: Queue is empty')
return self.__items.pop(0)
# Returns the front-most item in the queue, and DOES NOT change the queue.
def peek(self):
if len(self.__items) <= 0:
raise Exception('Error: Queue is empty')
return self.__items[0]
# Returns True if the queue is empty, and False otherwise:
def isEmpty(self):
return len(self.__items) == 0
# Returns True if the queue is full, and False otherwise:
def isFull(self):
return len(self.__items) == self.__capacity
# Returns the number of items in the queue:
def size(self):
return len(self.__items)
# Returns the capacity of the queue:
def capacity(self):
return self.__capacity
# Removes all items from the queue, and sets the size to 0
# clear() should not change the capacity
def clear(self):
self.__items = []
# Returns a string representation of the queue:
def __str__(self):
str_exp = ""
for item in self.__items:
str_exp += (str(item) + " ")
return str_exp
# Returns a string representation of the object
# bounded queue:
def __repr__(self):
return str(self) + " Max=" + str(self.__capacity)
def show(self):
return self._items
|
def answer(question):
words = question \
.rstrip("?") \
.replace("plus", "+") \
.replace("minus", "-") \
.replace("multiplied by", '*') \
.replace("divided by", "/") \
.replace("raised to the", "^") \
.split()
for i in range(len(words) - 2):
if words[i] == "^" and words[i + 2] == "power":
words[i + 2] = ""
if (words[i + 1][:1].isdigit()
and (words[i + 1].endswith("1st")
or words[i + 1].endswith("2nd")
or words[i + 1].endswith("th"))):
words[i + 1] = words[i + 1][:-2]
result = None
operator = None
for word in words[2:]:
if word == "":
continue
elif result is None and operator is None and isinteger(word):
result = int(word)
elif result is not None and operator is not None and isinteger(word):
if operator == "+":
result += int(word)
elif operator == "-":
result -= int(word)
elif operator == "*":
result *= int(word)
elif operator == "/":
result //= int(word)
elif operator == "^":
result **= int(word)
operator = None
elif result is not None and operator is None and word in list("+-*/^"):
operator = word
else:
raise ValueError(r".+")
if words[:2] != ["What", "is"] or result is None or operator is not None:
raise ValueError(r".+")
return result
def isinteger(number):
return number.isdigit() or (number[1:].isdigit() and number[0] == "-")
|
def sorted_nosize_search(listy, num):
# Adapted to work with a Python sorted
# array and handle the index error exception
exp_backoff = index = 0
limit = False
while not limit:
try:
temp = listy[index]
if temp > num:
limit = True
else:
index = 2 ** exp_backoff
exp_backoff += 1
except IndexError:
limit = True
return bi_search(listy, num, index // 2, index)
def bi_search(listy, num, low, high):
while low <= high:
middle = (high + low) // 2
try:
value_at = listy[middle]
except IndexError:
value_at = -1
if num < value_at or value_at == -1:
high = middle - 1
elif num > value_at:
low = middle + 1
else:
return middle
return -1
test_cases = [
(([1, 2, 3, 4, 5, 6, 7, 8, 9], 0), -1),
(([1, 2, 3, 4, 5, 6, 7, 8, 9], 1), 0),
(([1, 2, 3, 4, 5, 6, 7, 8, 9], 2), 1),
(([1, 2, 3, 4, 5, 6, 7, 8, 9], 3), 2),
(([1, 2, 3, 4, 5, 6, 7, 8, 9], 4), 3),
(([1, 2, 3, 4, 5, 6, 7, 8, 9], 5), 4),
(([1, 2, 3, 4, 5, 6, 7, 8, 9], 6), 5),
(([1, 2, 3, 4, 5, 6, 7, 8, 9], 7), 6),
(([1, 2, 3, 4, 5, 6, 7, 8, 9], 8), 7),
(([1, 2, 3, 4, 5, 6, 7, 8, 9], 9), 8),
(([1, 2, 3, 4, 5, 6, 7, 8, 9], 10), -1),
]
testable_functions = [sorted_nosize_search]
def run_tests():
for function in testable_functions:
for (n, m), expected in test_cases:
calculated = function(n, m)
error_msg = f"{function.__name__}: {calculated} != {expected}"
assert function(n, m) == expected, error_msg
if __name__ == "__main__":
run_tests()
|
# -*- coding: utf-8 -*-
"""
Package of optimizers.
"""
|
class Solution:
def singleNumber(self, nums: List[int]) -> int:
counts = {}
for num in nums:
if num in counts:
counts[num] += 1
else:
counts[num] = 1
if counts[num] == 3:
counts.pop(num)
return list(counts.keys())[0]
|
#
# PySNMP MIB module CXIoHardware-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CXIoHardware-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:17:22 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion")
cxIoHardware, Alias = mibBuilder.importSymbols("CXProduct-SMI", "cxIoHardware", "Alias")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
NotificationType, Gauge32, MibIdentifier, ObjectIdentity, Unsigned32, Bits, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, iso, Counter64, NotificationType, Integer32, Counter32, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Gauge32", "MibIdentifier", "ObjectIdentity", "Unsigned32", "Bits", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "iso", "Counter64", "NotificationType", "Integer32", "Counter32", "IpAddress")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
cxIoCardAdmTable = MibTable((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 1), )
if mibBuilder.loadTexts: cxIoCardAdmTable.setStatus('mandatory')
cxIoCardAdmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 1, 1), ).setIndexNames((0, "CXIoHardware-MIB", "cxIoCardAdmIndex"))
if mibBuilder.loadTexts: cxIoCardAdmEntry.setStatus('mandatory')
cxIoCardAdmIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cxIoCardAdmIndex.setStatus('mandatory')
cxIoCardAdmRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("invalid", 1), ("valid", 2), ("disabled", 3))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cxIoCardAdmRowStatus.setStatus('mandatory')
cxIoCardAdmAlias = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 1, 1, 3), Alias()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cxIoCardAdmAlias.setStatus('mandatory')
cxIoCardAdmPhysSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 1, 1, 4), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cxIoCardAdmPhysSlot.setStatus('mandatory')
cxIoCardAdmType = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("iuscFourPortCard", 1), ("lanCard", 2), ("vceCmpCard", 3), ("tokenRingCard", 4), ("ethernetCard", 5), ("isdnCard", 6), ("digitalVceCmpCard", 7), ("highSpeedFr4LIDCard", 8), ("octalV34ModemCard", 9)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cxIoCardAdmType.setStatus('mandatory')
cxIoCardAdmState = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("invalid", 1), ("valid", 2))).clone('valid')).setMaxAccess("readonly")
if mibBuilder.loadTexts: cxIoCardAdmState.setStatus('mandatory')
cxIoPortAdmTable = MibTable((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 2), )
if mibBuilder.loadTexts: cxIoPortAdmTable.setStatus('mandatory')
cxIoPortAdmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 2, 1), ).setIndexNames((0, "CXIoHardware-MIB", "cxIoPortAdmIndex"))
if mibBuilder.loadTexts: cxIoPortAdmEntry.setStatus('mandatory')
cxIoPortAdmIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cxIoPortAdmIndex.setStatus('mandatory')
cxIoPortAdmRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("invalid", 1), ("valid", 2), ("disabled", 3))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cxIoPortAdmRowStatus.setStatus('mandatory')
cxIoPortAdmAlias = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 2, 1, 3), Alias()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cxIoPortAdmAlias.setStatus('mandatory')
cxIoPortAdmCardAlias = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 2, 1, 4), Alias()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cxIoPortAdmCardAlias.setStatus('mandatory')
cxIoPortAdmCardLocalIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 2, 1, 5), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cxIoPortAdmCardLocalIndex.setStatus('mandatory')
cxIoCardOperTable = MibTable((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 3), )
if mibBuilder.loadTexts: cxIoCardOperTable.setStatus('mandatory')
cxIoCardOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 3, 1), ).setIndexNames((0, "CXIoHardware-MIB", "cxIoCardOperPhysSlot"))
if mibBuilder.loadTexts: cxIoCardOperEntry.setStatus('mandatory')
cxIoCardOperPhysSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 3, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cxIoCardOperPhysSlot.setStatus('mandatory')
cxIoCardOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("invalid", 1), ("valid", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cxIoCardOperState.setStatus('mandatory')
cxIoCardOperType = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 255))).clone(namedValues=NamedValues(("iuscFourPortCard", 1), ("lanCard", 2), ("vceCmpCard", 3), ("tokenRingCard", 4), ("ethernetCard", 5), ("isdnCard", 6), ("digitalVceCmpCard", 7), ("highSpeedFr4LIDCard", 8), ("octalV34ModemCard", 9), ("other", 255)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cxIoCardOperType.setStatus('mandatory')
cxIoCardOperRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 3, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cxIoCardOperRevision.setStatus('mandatory')
cxIoCardOperAssemblyAndEco = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 3, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cxIoCardOperAssemblyAndEco.setStatus('mandatory')
cxIoCardOperSpecialEco = MibTableColumn((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 3, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cxIoCardOperSpecialEco.setStatus('mandatory')
cxIoHwCardTypeTrapReport = MibScalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cxIoHwCardTypeTrapReport.setStatus('mandatory')
cxIHMibLevel = MibScalar((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cxIHMibLevel.setStatus('mandatory')
cxIoHwCardTypeTrap = NotificationType((1, 3, 6, 1, 4, 1, 495, 2, 1, 5, 2) + (0,1)).setObjects(("CXIoHardware-MIB", "cxIoCardOperPhysSlot"), ("CXIoHardware-MIB", "cxIoCardOperState"), ("CXIoHardware-MIB", "cxIoCardOperType"))
mibBuilder.exportSymbols("CXIoHardware-MIB", cxIoCardOperPhysSlot=cxIoCardOperPhysSlot, cxIoHwCardTypeTrapReport=cxIoHwCardTypeTrapReport, cxIoPortAdmAlias=cxIoPortAdmAlias, cxIoCardAdmPhysSlot=cxIoCardAdmPhysSlot, cxIoCardAdmEntry=cxIoCardAdmEntry, cxIoPortAdmTable=cxIoPortAdmTable, cxIoPortAdmCardAlias=cxIoPortAdmCardAlias, cxIoCardOperAssemblyAndEco=cxIoCardOperAssemblyAndEco, cxIoCardAdmAlias=cxIoCardAdmAlias, cxIoCardOperSpecialEco=cxIoCardOperSpecialEco, cxIHMibLevel=cxIHMibLevel, cxIoCardOperEntry=cxIoCardOperEntry, cxIoPortAdmIndex=cxIoPortAdmIndex, cxIoCardAdmIndex=cxIoCardAdmIndex, cxIoCardOperType=cxIoCardOperType, cxIoCardAdmType=cxIoCardAdmType, cxIoCardAdmState=cxIoCardAdmState, cxIoCardOperState=cxIoCardOperState, cxIoCardOperRevision=cxIoCardOperRevision, cxIoCardAdmTable=cxIoCardAdmTable, cxIoPortAdmEntry=cxIoPortAdmEntry, cxIoHwCardTypeTrap=cxIoHwCardTypeTrap, cxIoCardOperTable=cxIoCardOperTable, cxIoCardAdmRowStatus=cxIoCardAdmRowStatus, cxIoPortAdmRowStatus=cxIoPortAdmRowStatus, cxIoPortAdmCardLocalIndex=cxIoPortAdmCardLocalIndex)
|
# -*- coding: utf-8 -*-
# ISO 693-1 language codes from pycountry
Iso2Language = {
u'aa': u'Afar',
u'ab': u'Abkhazian',
u'af': u'Afrikaans',
u'ak': u'Akan',
u'sq': u'Albanian',
u'am': u'Amharic',
u'ar': u'Arabic',
u'an': u'Aragonese',
u'hy': u'Armenian',
u'as': u'Assamese',
u'av': u'Avaric',
u'ae': u'Avestan',
u'ay': u'Aymara',
u'az': u'Azerbaijani',
u'ba': u'Bashkir',
u'bm': u'Bambara',
u'eu': u'Basque',
u'be': u'Belarusian',
u'bn': u'Bengali',
u'bh': u'Bihari languages',
u'bi': u'Bislama',
u'bs': u'Bosnian',
u'br': u'Breton',
u'bg': u'Bulgarian',
u'my': u'Burmese',
u'ca': u'Catalan; Valencian',
u'ch': u'Chamorro',
u'ce': u'Chechen',
u'zh': u'Chinese',
u'cu': u'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic',
u'cv': u'Chuvash',
u'kw': u'Cornish',
u'co': u'Corsican',
u'cr': u'Cree',
u'cs': u'Czech',
u'da': u'Danish',
u'dv': u'Divehi; Dhivehi; Maldivian',
u'nl': u'Dutch; Flemish',
u'dz': u'Dzongkha',
u'en': u'English',
u'eo': u'Esperanto',
u'et': u'Estonian',
u'ee': u'Ewe',
u'fo': u'Faroese',
u'fj': u'Fijian',
u'fi': u'Finnish',
u'fr': u'French',
u'fy': u'Western Frisian',
u'ff': u'Fulah',
u'ka': u'Georgian',
u'de': u'German',
u'gd': u'Gaelic; Scottish Gaelic',
u'ga': u'Irish',
u'gl': u'Galician',
u'gv': u'Manx',
u'el': u'Greek, Modern (1453-)',
u'gn': u'Guarani',
u'gu': u'Gujarati',
u'ht': u'Haitian; Haitian Creole',
u'ha': u'Hausa',
u'he': u'Hebrew',
u'hz': u'Herero',
u'hi': u'Hindi',
u'ho': u'Hiri Motu',
u'hr': u'Croatian',
u'hu': u'Hungarian',
u'ig': u'Igbo',
u'is': u'Icelandic',
u'io': u'Ido',
u'ii': u'Sichuan Yi; Nuosu',
u'iu': u'Inuktitut',
u'ie': u'Interlingue; Occidental',
u'ia': u'Interlingua (International Auxiliary Language Association)',
u'id': u'Indonesian',
u'ik': u'Inupiaq',
u'it': u'Italian',
u'jv': u'Javanese',
u'ja': u'Japanese',
u'kl': u'Kalaallisut; Greenlandic',
u'kn': u'Kannada',
u'ks': u'Kashmiri',
u'kr': u'Kanuri',
u'kk': u'Kazakh',
u'km': u'Central Khmer',
u'ki': u'Kikuyu; Gikuyu',
u'rw': u'Kinyarwanda',
u'ky': u'Kirghiz; Kyrgyz',
u'kv': u'Komi',
u'kg': u'Kongo',
u'ko': u'Korean',
u'kj': u'Kuanyama; Kwanyama',
u'ku': u'Kurdish',
u'lo': u'Lao',
u'la': u'Latin',
u'lv': u'Latvian',
u'li': u'Limburgan; Limburger; Limburgish',
u'ln': u'Lingala',
u'lt': u'Lithuanian',
u'lb': u'Luxembourgish; Letzeburgesch',
u'lu': u'Luba-Katanga',
u'lg': u'Ganda',
u'mk': u'Macedonian',
u'mh': u'Marshallese',
u'ml': u'Malayalam',
u'mi': u'Maori',
u'mr': u'Marathi',
u'ms': u'Malay',
u'mg': u'Malagasy',
u'mt': u'Maltese',
u'mo': u'Moldavian; Moldovan',
u'mn': u'Mongolian',
u'na': u'Nauru',
u'nv': u'Navajo; Navaho',
u'nr': u'Ndebele, South; South Ndebele',
u'nd': u'Ndebele, North; North Ndebele',
u'ng': u'Ndonga',
u'ne': u'Nepali',
u'nn': u'Norwegian Nynorsk; Nynorsk, Norwegian',
u'nb': u'Bokm\xe5l, Norwegian; Norwegian Bokm\xe5l',
u'no': u'Norwegian',
u'ny': u'Chichewa; Chewa; Nyanja',
u'oc': u'Occitan (post 1500)',
u'oj': u'Ojibwa',
u'or': u'Oriya',
u'om': u'Oromo',
u'os': u'Ossetian; Ossetic',
u'pa': u'Panjabi; Punjabi',
u'fa': u'Persian',
u'pi': u'Pali',
u'pl': u'Polish',
u'pt': u'Portuguese',
u'ps': u'Pushto; Pashto',
u'qu': u'Quechua',
u'rm': u'Romansh',
u'ro': u'Romanian',
u'rn': u'Rundi',
u'ru': u'Russian',
u'sg': u'Sango',
u'sa': u'Sanskrit',
u'si': u'Sinhala; Sinhalese',
u'sk': u'Slovak',
u'sl': u'Slovenian',
u'se': u'Northern Sami',
u'sm': u'Samoan',
u'sn': u'Shona',
u'sd': u'Sindhi',
u'so': u'Somali',
u'st': u'Sotho, Southern',
u'es': u'Spanish; Castilian',
u'sc': u'Sardinian',
u'sr': u'Serbian',
u'ss': u'Swati',
u'su': u'Sundanese',
u'sw': u'Swahili',
u'sv': u'Swedish',
u'ty': u'Tahitian',
u'ta': u'Tamil',
u'tt': u'Tatar',
u'te': u'Telugu',
u'tg': u'Tajik',
u'tl': u'Tagalog',
u'th': u'Thai',
u'bo': u'Tibetan',
u'ti': u'Tigrinya',
u'to': u'Tonga (Tonga Islands)',
u'tn': u'Tswana',
u'ts': u'Tsonga',
u'tk': u'Turkmen',
u'tr': u'Turkish',
u'tw': u'Twi',
u'ug': u'Uighur; Uyghur',
u'uk': u'Ukrainian',
u'ur': u'Urdu',
u'uz': u'Uzbek',
u've': u'Venda',
u'vi': u'Vietnamese',
u'vo': u'Volap\xfck',
u'cy': u'Welsh',
u'wa': u'Walloon',
u'wo': u'Wolof',
u'xh': u'Xhosa',
u'yi': u'Yiddish',
u'yo': u'Yoruba',
u'za': u'Zhuang; Chuang',
u'zu': u'Zulu',
}
|
"""
headers:
Set-Cookie:
description: Session cookie
schema:
type: string
example: SESSIONID=abcde12345; Path=/
"\0Set-Cookie":
description: CSRF token
schema:
type: string
example: CSRFTOKEN=fghijk678910; Path=/; HttpOnly
"""
|
#
# PySNMP MIB module PPPOE-MGMT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PPPOE-MGMT-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:41:53 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint")
dlink_common_mgmt, = mibBuilder.importSymbols("DLINK-ID-REC-MIB", "dlink-common-mgmt")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Integer32, ModuleIdentity, Counter32, Unsigned32, MibIdentifier, Counter64, IpAddress, Bits, TimeTicks, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, ObjectIdentity, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "ModuleIdentity", "Counter32", "Unsigned32", "MibIdentifier", "Counter64", "IpAddress", "Bits", "TimeTicks", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "ObjectIdentity", "NotificationType")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
swPPPoEMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 171, 12, 79))
if mibBuilder.loadTexts: swPPPoEMIB.setLastUpdated('0904020000Z')
if mibBuilder.loadTexts: swPPPoEMIB.setOrganization('D-Link Corp')
if mibBuilder.loadTexts: swPPPoEMIB.setContactInfo('http://support.dlink.com')
if mibBuilder.loadTexts: swPPPoEMIB.setDescription('The structure of PPPoE management for the proprietary enterprise.')
swPPPoEMgmtCtrl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 79, 1))
swPPPoECirIDInsertState = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 79, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPPPoECirIDInsertState.setStatus('current')
if mibBuilder.loadTexts: swPPPoECirIDInsertState.setDescription('This object indicates the status of the PPPoE circuit ID insertion state of the switch.')
swPPPoECirIDInsertPortMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 79, 1, 2))
swPPPoECirIDInsertPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 12, 79, 1, 2, 1), )
if mibBuilder.loadTexts: swPPPoECirIDInsertPortTable.setStatus('current')
if mibBuilder.loadTexts: swPPPoECirIDInsertPortTable.setDescription('The table specifies the PPPoE circuit ID insertion function specified by the port.')
swPPPoECirIDInsertPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 12, 79, 1, 2, 1, 1), ).setIndexNames((0, "PPPOE-MGMT-MIB", "swPPPoECirIDInsertPortIndex"))
if mibBuilder.loadTexts: swPPPoECirIDInsertPortEntry.setStatus('current')
if mibBuilder.loadTexts: swPPPoECirIDInsertPortEntry.setDescription('A list of information contained in swPPPoECirIDInsertPortTable.')
swPPPoECirIDInsertPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 79, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: swPPPoECirIDInsertPortIndex.setStatus('current')
if mibBuilder.loadTexts: swPPPoECirIDInsertPortIndex.setDescription("This object indicates the module's port number. The range is from 1 to the maximum port number specified in the module")
swPPPoECirIDInsertPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 79, 1, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPPPoECirIDInsertPortState.setStatus('current')
if mibBuilder.loadTexts: swPPPoECirIDInsertPortState.setDescription('This object indicates the PPPoE circuit ID insertion function state on the port.')
swPPPoECirIDInsertPortCirID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 79, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("switch-ip", 1), ("switch-mac", 2), ("udf-string", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPPPoECirIDInsertPortCirID.setStatus('current')
if mibBuilder.loadTexts: swPPPoECirIDInsertPortCirID.setDescription('This object indicates the port circuit ID.')
swPPPoECirIDInsertPortUDFString = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 79, 1, 2, 1, 1, 4), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPPPoECirIDInsertPortUDFString.setStatus('current')
if mibBuilder.loadTexts: swPPPoECirIDInsertPortUDFString.setDescription('This object indicates the user define string when the circuit ID is UDF string.')
mibBuilder.exportSymbols("PPPOE-MGMT-MIB", swPPPoECirIDInsertPortIndex=swPPPoECirIDInsertPortIndex, swPPPoECirIDInsertPortMgmt=swPPPoECirIDInsertPortMgmt, swPPPoECirIDInsertPortCirID=swPPPoECirIDInsertPortCirID, PYSNMP_MODULE_ID=swPPPoEMIB, swPPPoECirIDInsertPortEntry=swPPPoECirIDInsertPortEntry, swPPPoEMgmtCtrl=swPPPoEMgmtCtrl, swPPPoECirIDInsertPortUDFString=swPPPoECirIDInsertPortUDFString, swPPPoECirIDInsertState=swPPPoECirIDInsertState, swPPPoECirIDInsertPortState=swPPPoECirIDInsertPortState, swPPPoEMIB=swPPPoEMIB, swPPPoECirIDInsertPortTable=swPPPoECirIDInsertPortTable)
|
'''
digital media index:
0 - digital media id
1 - owner_id
2 - name
3 - description
4 - file_path
5 - thumbnail_path
6 - category_id
7 - media_type_id
8 - price
9 - approved
'''
##############################################
# Search logic #
##############################################
def search(conn, params):
q = Q_Container(conn, params)
if q.term != '':
results = term_search(q)
else:
results = no_term_search(q)
results = final_check(q, results)
return results
def term_search(q):
results = term_query(q)
results = filter_by_category(q, results)
results = filter_by_type(q, results)
results = filter_by_license(q, results)
results = filter_by_approved(results)
return results
def no_term_search(q):
if q.category == 'all':
results = get_all_table(q)
else:
results = get_all_category(q)
results = filter_by_type(q, results)
results = filter_by_license(q, results)
results = filter_by_approved(results)
return results
def filter_by_category(q, results):
if q.category == 'all':
return results
for result in results[:]:
if result[6] != q.category:
results.remove(result)
return results
def filter_by_type(q, results):
if len(q.media_types) == 0:
return results
for result in results[:]:
if result[7] not in q.media_types:
results.remove(result)
return results
def filter_by_approved(results):
for result in results[:]:
if result[9] == 0:
results.remove(result)
return results
def filter_by_license(q, results):
if q.license == 'free':
for result in results[:]:
if result[8] > 0:
results.remove(result)
elif q.license == 'paid':
for result in results[:]:
if result[8] == 0:
results.remove(result)
else:
return results
return results
def final_check(q, results):
if len(results) > 0:
return results
else:
if q.term == '' and q.category == 'all' and len(q.media_types) == 0:
results = get_all_table(q)
elif q.term != '':
results = term_query(q)
elif q.category != 'all':
results = get_all_category(q)
results = filter_by_category(q, results)
elif len(q.media_types) > 0:
results = get_all_table(q)
results = filter_by_type(q, results)
if len(results) == 0:
return get_all_table(q)
return results
##############################################
# functions that access the db #
##############################################
def term_query(q):
q.conn.query("SELECT * FROM digital_media WHERE `name` LIKE %s OR `description` LIKE %s", ("%" + q.term + "%","%" + q.term + "%"))
data = q.conn.fetchall()
q.conn.commit()
return data
def get_all_category(q):
q.conn.query("SELECT * FROM `digital_media` WHERE `category` = %s", (q.category,))
data = q.conn.fetchall()
q.conn.commit()
return data
def get_all_table(q):
q.conn.query("SELECT * FROM digital_media")
data = q.conn.fetchall()
q.conn.commit()
return data
#################################################
# Query parameter container object #
#################################################
class Q_Container(object):
def __init__(self, conn, params):
self.conn = conn
self.term = params['term']
self.category = params['category']
self.license = params['license']
self.media_types = []
if 'image_check' in params:
self.media_types.append('image')
if 'video_check' in params:
self.media_types.append('video')
if 'audio_check' in params:
self.media_types.append('audio')
if 'document_check' in params:
self.media_types.append('document')
|
def solve(*args):
min_number = min(args[0])
max_number = max(args[0])
summary = sum(args[0])
print(f'The minimum number is {min_number}')
print(f'The maximum number is {max_number}')
print(f'The sum number is: {summary}')
solve(list(map(int, input().split())))
|
w, h = 4, 100
list_of_gedung = [[0 for x in range(w)] for y in range(h)]
def createVertex(upperbackleft_x, upperbackleft_y, upperbackleft_z, upperbackright_x, upperbackright_y, upperbackright_z, upperfrontleft_x, upperfrontleft_y, upperfrontleft_z, upperfrontright_x, upperfrontright_y, upperfrontright_z, underbackleft_x, underbackleft_y, underbackleft_z, underbackright_x, underbackright_y, underbackright_z, underfrontleft_x, underfrontleft_y, underfrontleft_z, underfrontright_x, underfrontright_y, underfrontright_z):
vertex = []
#TR1 (left side)
vertex.append(underbackleft_x)
vertex.append(underbackleft_y)
vertex.append(underbackleft_z)
vertex.append(underfrontleft_x)
vertex.append(underfrontleft_y)
vertex.append(underfrontleft_z)
vertex.append(upperfrontleft_x)
vertex.append(upperfrontleft_y)
vertex.append(upperfrontleft_z)
#TR2 (Backside)
vertex.append(upperbackright_x)
vertex.append(upperbackright_y)
vertex.append(upperbackright_z)
vertex.append(underbackleft_x)
vertex.append(underbackleft_y)
vertex.append(underbackleft_z)
vertex.append(upperbackleft_x)
vertex.append(upperbackleft_y)
vertex.append(upperbackleft_z)
#TR3 (under side)
vertex.append(underfrontright_x)
vertex.append(underfrontright_y)
vertex.append(underfrontright_z)
vertex.append(underbackleft_x)
vertex.append(underbackleft_y)
vertex.append(underbackleft_z)
vertex.append(underbackright_x)
vertex.append(underbackright_y)
vertex.append(underbackright_z)
#TR4 (back side)
vertex.append(upperbackright_x)
vertex.append(upperbackright_y)
vertex.append(upperbackright_z)
vertex.append(underbackright_x)
vertex.append(underbackright_y)
vertex.append(underbackright_z)
vertex.append(underbackleft_x)
vertex.append(underbackleft_y)
vertex.append(underbackleft_z)
# TR5 (backside)
vertex.append(underbackleft_x)
vertex.append(underbackleft_y)
vertex.append(underbackleft_z)
vertex.append(upperfrontleft_x)
vertex.append(upperfrontleft_y)
vertex.append(upperfrontleft_z)
vertex.append(upperbackleft_x)
vertex.append(upperbackleft_y)
vertex.append(upperbackleft_z)
#TR6 (under side)
vertex.append(underbackleft_x)
vertex.append(underbackleft_y)
vertex.append(underbackleft_z)
vertex.append(underfrontright_x)
vertex.append(underfrontright_y)
vertex.append(underfrontright_z)
vertex.append(underfrontleft_x)
vertex.append(underfrontleft_y)
vertex.append(underfrontleft_z)
#TR7 (front side)
vertex.append(underfrontright_x)
vertex.append(underfrontright_y)
vertex.append(underfrontright_z)
vertex.append(upperfrontleft_x)
vertex.append(upperfrontleft_y)
vertex.append(upperfrontleft_z)
vertex.append(underfrontleft_x)
vertex.append(underfrontleft_y)
vertex.append(underfrontleft_z)
#TR8 (right side)
vertex.append(upperfrontright_x)
vertex.append(upperfrontright_y)
vertex.append(upperfrontright_z)
vertex.append(underbackright_x)
vertex.append(underbackright_y)
vertex.append(underbackright_z)
vertex.append(upperbackright_x)
vertex.append(upperbackright_y)
vertex.append(upperbackright_z)
#TR9 (right side)
vertex.append(underbackright_x)
vertex.append(underbackright_y)
vertex.append(underbackright_z)
vertex.append(upperfrontright_x)
vertex.append(upperfrontright_y)
vertex.append(upperfrontright_z)
vertex.append(underfrontright_x)
vertex.append(underfrontright_y)
vertex.append(underfrontright_z)
#TR10 (upper side)
vertex.append(upperfrontright_x)
vertex.append(upperfrontright_y)
vertex.append(upperfrontright_z)
vertex.append(upperbackright_x)
vertex.append(upperbackright_y)
vertex.append(upperbackright_z)
vertex.append(upperbackleft_x)
vertex.append(upperbackleft_y)
vertex.append(upperbackleft_z)
#TR11 (upper side)
vertex.append(upperfrontright_x)
vertex.append(upperfrontright_y)
vertex.append(upperfrontright_z)
vertex.append(upperbackleft_x)
vertex.append(upperbackleft_y)
vertex.append(upperbackleft_z)
vertex.append(upperfrontleft_x)
vertex.append(upperfrontleft_y)
vertex.append(upperfrontleft_z)
#TR12
vertex.append(upperfrontright_x)
vertex.append(upperfrontright_y)
vertex.append(upperfrontright_z)
vertex.append(upperfrontleft_x)
vertex.append(upperfrontleft_y)
vertex.append(upperfrontleft_z)
vertex.append(underfrontright_x)
vertex.append(underfrontright_y)
vertex.append(underfrontright_z)
return vertex
def createBuilding(underbackright_x, underbackright_y, underbackright_z, underbackleft_x, underbackleft_y, underbackleft_z, underfrontleft_x, underfrontleft_y, underfrontleft_z, underfrontright_x, underfrontright_y, underfrontright_z, tinggi):
# tinggi = 0.5
upperbackleft_x = underbackleft_x
upperbackleft_y = underbackleft_y
upperbackleft_z = underbackleft_z + tinggi
upperbackright_x = underbackright_x
upperbackright_y = underbackright_y
upperbackright_z = underbackright_z + tinggi
upperfrontright_x = underfrontright_x
upperfrontright_y = underfrontright_y
upperfrontright_z = underfrontright_z + tinggi
upperfrontleft_x = underfrontleft_x
upperfrontleft_y = underfrontleft_y
upperfrontleft_z = underfrontleft_z + tinggi
return createVertex(upperbackleft_x, upperbackleft_y, upperbackleft_z, upperbackright_x, upperbackright_y, upperbackright_z, upperfrontleft_x, upperfrontleft_y, upperfrontleft_z, upperfrontright_x, upperfrontright_y, upperfrontright_z, underbackleft_x, underbackleft_y, underbackleft_z, underbackright_x, underbackright_y, underbackright_z, underfrontleft_x, underfrontleft_y, underfrontleft_z, underfrontright_x, underfrontright_y, underfrontright_z)
def createAllBuilding():
vertex_data = []
i = 0
# albar
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
# altim
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
# cbar
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.35)
i += 1
# ctim
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.35)
i += 1
# l5
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.4)
i += 1
# l6
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.4)
i += 1
# l7
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.4)
i += 1
# l8
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.4)
i += 1
# pau
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.7)
i += 1
# perpus
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.5)
i += 1
# mektan
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.4)
i += 1
# comlabs
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.45)
i += 1
# pln
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.45)
i += 1
# tvst
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.5)
i += 1
# oktagon
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.5)
i += 1
# labir utara
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.65)
i += 1
# labir selatan
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.65)
i += 1
# labir tengah
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.6)
i += 1
# belakang perpus
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.7)
i += 1
# belakang pau
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.7)
i += 1
# jalanan
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
i += 1
vertex_data += createBuilding(list_of_gedung[i][0][0], list_of_gedung[i][0][1], list_of_gedung[i][0][2],
list_of_gedung[i][1][0], list_of_gedung[i][1][1], list_of_gedung[i][1][2],
list_of_gedung[i][2][0], list_of_gedung[i][2][1], list_of_gedung[i][2][2],
list_of_gedung[i][3][0], list_of_gedung[i][3][1], list_of_gedung[i][3][2], 0.2)
return vertex_data
|
## @file
# Module to gather dependency information for ASKAP packages
#
# @copyright (c) 2006 CSIRO
# Australia Telescope National Facility (ATNF)
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# PO Box 76, Epping NSW 1710, Australia
# [email protected]
#
# This file is part of the ASKAP software distribution.
#
# The ASKAP software distribution is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the License
# or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
#
# @author Malte Marquarding <[email protected]>
#
## This is an ordered dict, i.e. the keys are in the order in
# which they have been added. It has the same interface as dict
# but only the functions which are in use have been implemented
class OrderedDict:
## Create an empty container
# @param self the object reference
def __init__(self):
self._list = []
## Return the length of the container (the number of keys)
# @return an integer value
def __len__(self):
return len(self._list)
## Insert an item into the container
# @param self the object reference
# @param key the key of the item
# @param value the value of the item
def __setitem__(self, key, value):
self._list.append([key, value])
## Retrieve an item from the container using its key
# @param self the object reference
# @param i the key of the item to retrieve
# @return the value of the item
def __getitem__(self, i):
found = False
for key, value in self.iteritems():
if key == i:
return value
if not found:
raise KeyError(str(i))
## Get the keys of the container
# @param self the object reference
# @return a list of keys
def keys(self):
return [i[0] for i in self._list]
## Determine if a key exists in the container
# @param self the object reference
# @param k the name of the key
# @return a boolean inidcatinf if the key exists
def has_key(self, k):
return (k in self.keys())
def __contains__(self, k):
return self.has_key(k)
## Get the values of the container
# @param self the object reference
# @return a list of values
def values(self):
return [i[1] for i in self._list]
## Return a generator for this container
# @param self the object reference
# @return a generator returning (key, value) tuples
def iteritems(self):
for i in self._list:
yield i[0], i[1]
## Move an existing item to the end of the container
# @param self the object reference
# @param key the key of the item
def toend(self, key):
value = self.__getitem__(key)
del self._list[self.keys().index(key)]
self._list.append([key, value])
|
## Sum of odd numbers
## 7 kyu
## https://www.codewars.com/kata/55fd2d567d94ac3bc9000064
def row_sum_odd_numbers(n):
total = 0
row_sum= 0
for i in range(n-1,0, -1):
total += i
starting_odd = total * 2 + 1
for i in range(1,n+1):
row_sum += starting_odd
starting_odd += 2
return row_sum |
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("//tools:bazel_hash_dict.bzl", "BAZEL_HASH_DICT")
BAZEL_VERSIONS = BAZEL_HASH_DICT.keys()
def _zfill(v, l = 5):
"""zfill a string by padding 0s to the left of the string till it is the link
specified by l.
"""
return "0" * (l - len(v)) + v
def _unfill(v, l = 5):
"""unfill takes a zfilled string and returns it to the original value"""
return [
str(int(v[l * i:l * (i + 1)]))
for i in range(len(v) // l)
]
def GET_LATEST_BAZEL_VERSIONS(count = 3):
"""GET_LATEST_BAZEL_VERSIONS count and returns a list
of the latest $count minor versions at their latest patch.
Example:
["0.1.0", "0.1.1", "0.2.0", "0.3.0"] => ["0.1.1", "0.2.0", "0.3.0"]
Arguments:
count: The number of versions to return.
"""
version_tuple_list = []
for v in BAZEL_VERSIONS:
version_tuple_list.append("".join([_zfill(x, 5) for x in v.split(".")]))
already_handled_major_minors = []
toReturn = []
# By padding everything with a consistent number of 0s we can sort using
# string sort and get a list in order.
for v in reversed(sorted(version_tuple_list)):
if len(toReturn) >= count:
break
major_minor = v[0:10]
if major_minor in already_handled_major_minors:
continue
already_handled_major_minors.append(major_minor)
toReturn.append(_unfill(v))
return [".".join(v) for v in toReturn]
|
#
# PySNMP MIB module RFC1253-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RFC1253-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:00:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Integer32, ModuleIdentity, Gauge32, Counter64, iso, Counter32, TimeTicks, NotificationType, ObjectIdentity, MibIdentifier, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, Unsigned32, mib_2 = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "ModuleIdentity", "Gauge32", "Counter64", "iso", "Counter32", "TimeTicks", "NotificationType", "ObjectIdentity", "MibIdentifier", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "Unsigned32", "mib-2")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
ospf = MibIdentifier((1, 3, 6, 1, 2, 1, 14))
class AreaID(IpAddress):
pass
class RouterID(IpAddress):
pass
class Metric(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 65535)
class BigMetric(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 16777215)
class TruthValue(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("true", 1), ("false", 2))
class Status(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("enabled", 1), ("disabled", 2))
class Validation(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("valid", 1), ("invalid", 2))
class PositiveInteger(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 4294967295)
class HelloRange(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 65535)
class UpToMaxAge(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 3600)
class InterfaceIndex(Integer32):
pass
class DesignatedRouterPriority(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 255)
class TOSType(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 31)
ospfGeneralGroup = MibIdentifier((1, 3, 6, 1, 2, 1, 14, 1))
ospfRouterId = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 1), RouterID()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfRouterId.setStatus('mandatory')
ospfAdminStat = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 2), Status()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfAdminStat.setStatus('mandatory')
ospfVersionNumber = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2))).clone(namedValues=NamedValues(("version2", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVersionNumber.setStatus('mandatory')
ospfAreaBdrRtrStatus = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 4), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaBdrRtrStatus.setStatus('mandatory')
ospfASBdrRtrStatus = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 5), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfASBdrRtrStatus.setStatus('mandatory')
ospfExternLSACount = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 6), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfExternLSACount.setStatus('mandatory')
ospfExternLSACksumSum = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfExternLSACksumSum.setStatus('mandatory')
ospfTOSSupport = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 8), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfTOSSupport.setStatus('mandatory')
ospfOriginateNewLSAs = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfOriginateNewLSAs.setStatus('mandatory')
ospfRxNewLSAs = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfRxNewLSAs.setStatus('mandatory')
ospfAreaTable = MibTable((1, 3, 6, 1, 2, 1, 14, 2), )
if mibBuilder.loadTexts: ospfAreaTable.setStatus('mandatory')
ospfAreaEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 2, 1), ).setIndexNames((0, "RFC1253-MIB", "ospfAreaId"))
if mibBuilder.loadTexts: ospfAreaEntry.setStatus('mandatory')
ospfAreaId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 1), AreaID()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfAreaId.setStatus('mandatory')
ospfAuthType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfAuthType.setStatus('mandatory')
ospfImportASExtern = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 3), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfImportASExtern.setStatus('mandatory')
ospfSpfRuns = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfSpfRuns.setStatus('mandatory')
ospfAreaBdrRtrCount = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 5), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaBdrRtrCount.setStatus('mandatory')
ospfASBdrRtrCount = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 6), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfASBdrRtrCount.setStatus('mandatory')
ospfAreaLSACount = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 7), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaLSACount.setStatus('mandatory')
ospfAreaLSACksumSum = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaLSACksumSum.setStatus('mandatory')
ospfStubAreaTable = MibTable((1, 3, 6, 1, 2, 1, 14, 3), )
if mibBuilder.loadTexts: ospfStubAreaTable.setStatus('mandatory')
ospfStubAreaEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 3, 1), ).setIndexNames((0, "RFC1253-MIB", "ospfStubAreaID"), (0, "RFC1253-MIB", "ospfStubTOS"))
if mibBuilder.loadTexts: ospfStubAreaEntry.setStatus('mandatory')
ospfStubAreaID = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 3, 1, 1), AreaID()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfStubAreaID.setStatus('mandatory')
ospfStubTOS = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 3, 1, 2), TOSType()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfStubTOS.setStatus('mandatory')
ospfStubMetric = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 3, 1, 3), BigMetric()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfStubMetric.setStatus('mandatory')
ospfStubStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 3, 1, 4), Validation().clone('valid')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfStubStatus.setStatus('mandatory')
ospfLsdbTable = MibTable((1, 3, 6, 1, 2, 1, 14, 4), )
if mibBuilder.loadTexts: ospfLsdbTable.setStatus('mandatory')
ospfLsdbEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 4, 1), ).setIndexNames((0, "RFC1253-MIB", "ospfLsdbAreaId"), (0, "RFC1253-MIB", "ospfLsdbType"), (0, "RFC1253-MIB", "ospfLsdbLSID"), (0, "RFC1253-MIB", "ospfLsdbRouterId"))
if mibBuilder.loadTexts: ospfLsdbEntry.setStatus('mandatory')
ospfLsdbAreaId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 1), AreaID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbAreaId.setStatus('mandatory')
ospfLsdbType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("routerLink", 1), ("networkLink", 2), ("summaryLink", 3), ("asSummaryLink", 4), ("asExternalLink", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbType.setStatus('mandatory')
ospfLsdbLSID = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 3), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbLSID.setStatus('mandatory')
ospfLsdbRouterId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 4), RouterID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbRouterId.setStatus('mandatory')
ospfLsdbSequence = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbSequence.setStatus('mandatory')
ospfLsdbAge = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbAge.setStatus('mandatory')
ospfLsdbChecksum = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbChecksum.setStatus('mandatory')
ospfLsdbAdvertisement = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 8), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbAdvertisement.setStatus('mandatory')
ospfAreaRangeTable = MibTable((1, 3, 6, 1, 2, 1, 14, 5), )
if mibBuilder.loadTexts: ospfAreaRangeTable.setStatus('mandatory')
ospfAreaRangeEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 5, 1), ).setIndexNames((0, "RFC1253-MIB", "ospfAreaRangeAreaID"), (0, "RFC1253-MIB", "ospfAreaRangeNet"))
if mibBuilder.loadTexts: ospfAreaRangeEntry.setStatus('mandatory')
ospfAreaRangeAreaID = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 5, 1, 1), AreaID()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfAreaRangeAreaID.setStatus('mandatory')
ospfAreaRangeNet = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 5, 1, 2), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfAreaRangeNet.setStatus('mandatory')
ospfAreaRangeMask = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 5, 1, 3), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfAreaRangeMask.setStatus('mandatory')
ospfAreaRangeStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 5, 1, 4), Validation().clone('valid')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfAreaRangeStatus.setStatus('mandatory')
ospfHostTable = MibTable((1, 3, 6, 1, 2, 1, 14, 6), )
if mibBuilder.loadTexts: ospfHostTable.setStatus('mandatory')
ospfHostEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 6, 1), ).setIndexNames((0, "RFC1253-MIB", "ospfHostIpAddress"), (0, "RFC1253-MIB", "ospfHostTOS"))
if mibBuilder.loadTexts: ospfHostEntry.setStatus('mandatory')
ospfHostIpAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 6, 1, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfHostIpAddress.setStatus('mandatory')
ospfHostTOS = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 6, 1, 2), TOSType()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfHostTOS.setStatus('mandatory')
ospfHostMetric = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 6, 1, 3), Metric()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfHostMetric.setStatus('mandatory')
ospfHostStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 6, 1, 4), Validation().clone('valid')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfHostStatus.setStatus('mandatory')
ospfIfTable = MibTable((1, 3, 6, 1, 2, 1, 14, 7), )
if mibBuilder.loadTexts: ospfIfTable.setStatus('mandatory')
ospfIfEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 7, 1), ).setIndexNames((0, "RFC1253-MIB", "ospfIfIpAddress"), (0, "RFC1253-MIB", "ospfAddressLessIf"))
if mibBuilder.loadTexts: ospfIfEntry.setStatus('mandatory')
ospfIfIpAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfIpAddress.setStatus('mandatory')
ospfAddressLessIf = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfAddressLessIf.setStatus('mandatory')
ospfIfAreaId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 3), AreaID().clone(hexValue="00000000")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfAreaId.setStatus('mandatory')
ospfIfType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("broadcast", 1), ("nbma", 2), ("pointToPoint", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfType.setStatus('mandatory')
ospfIfAdminStat = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 5), Status().clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfAdminStat.setStatus('mandatory')
ospfIfRtrPriority = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 6), DesignatedRouterPriority().clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfRtrPriority.setStatus('mandatory')
ospfIfTransitDelay = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 7), UpToMaxAge().clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfTransitDelay.setStatus('mandatory')
ospfIfRetransInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 8), UpToMaxAge().clone(5)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfRetransInterval.setStatus('mandatory')
ospfIfHelloInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 9), HelloRange().clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfHelloInterval.setStatus('mandatory')
ospfIfRtrDeadInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 10), PositiveInteger().clone(40)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfRtrDeadInterval.setStatus('mandatory')
ospfIfPollInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 11), PositiveInteger().clone(120)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfPollInterval.setStatus('mandatory')
ospfIfState = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("down", 1), ("loopback", 2), ("waiting", 3), ("pointToPoint", 4), ("designatedRouter", 5), ("backupDesignatedRouter", 6), ("otherDesignatedRouter", 7))).clone('down')).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfState.setStatus('mandatory')
ospfIfDesignatedRouter = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 13), IpAddress().clone(hexValue="00000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfDesignatedRouter.setStatus('mandatory')
ospfIfBackupDesignatedRouter = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 14), IpAddress().clone(hexValue="00000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfBackupDesignatedRouter.setStatus('mandatory')
ospfIfEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 15), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfEvents.setStatus('mandatory')
ospfIfAuthKey = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 16), OctetString().clone(hexValue="0000000000000000")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfAuthKey.setStatus('mandatory')
ospfIfMetricTable = MibTable((1, 3, 6, 1, 2, 1, 14, 8), )
if mibBuilder.loadTexts: ospfIfMetricTable.setStatus('mandatory')
ospfIfMetricEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 8, 1), ).setIndexNames((0, "RFC1253-MIB", "ospfIfMetricIpAddress"), (0, "RFC1253-MIB", "ospfIfMetricAddressLessIf"), (0, "RFC1253-MIB", "ospfIfMetricTOS"))
if mibBuilder.loadTexts: ospfIfMetricEntry.setStatus('mandatory')
ospfIfMetricIpAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 8, 1, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfMetricIpAddress.setStatus('mandatory')
ospfIfMetricAddressLessIf = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 8, 1, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfMetricAddressLessIf.setStatus('mandatory')
ospfIfMetricTOS = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 8, 1, 3), TOSType()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfMetricTOS.setStatus('mandatory')
ospfIfMetricMetric = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 8, 1, 4), Metric()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfMetricMetric.setStatus('mandatory')
ospfIfMetricStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 8, 1, 5), Validation().clone('valid')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfIfMetricStatus.setStatus('mandatory')
ospfVirtIfTable = MibTable((1, 3, 6, 1, 2, 1, 14, 9), )
if mibBuilder.loadTexts: ospfVirtIfTable.setStatus('mandatory')
ospfVirtIfEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 9, 1), ).setIndexNames((0, "RFC1253-MIB", "ospfVirtIfAreaID"), (0, "RFC1253-MIB", "ospfVirtIfNeighbor"))
if mibBuilder.loadTexts: ospfVirtIfEntry.setStatus('mandatory')
ospfVirtIfAreaID = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 1), AreaID()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfVirtIfAreaID.setStatus('mandatory')
ospfVirtIfNeighbor = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 2), RouterID()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfVirtIfNeighbor.setStatus('mandatory')
ospfVirtIfTransitDelay = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 3), UpToMaxAge().clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfVirtIfTransitDelay.setStatus('mandatory')
ospfVirtIfRetransInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 4), UpToMaxAge().clone(5)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfVirtIfRetransInterval.setStatus('mandatory')
ospfVirtIfHelloInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 5), HelloRange().clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfVirtIfHelloInterval.setStatus('mandatory')
ospfVirtIfRtrDeadInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 6), PositiveInteger().clone(60)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfVirtIfRtrDeadInterval.setStatus('mandatory')
ospfVirtIfState = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 4))).clone(namedValues=NamedValues(("down", 1), ("pointToPoint", 4))).clone('down')).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtIfState.setStatus('mandatory')
ospfVirtIfEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtIfEvents.setStatus('mandatory')
ospfVirtIfAuthKey = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 9), OctetString().clone(hexValue="0000000000000000")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfVirtIfAuthKey.setStatus('mandatory')
ospfVirtIfStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 10), Validation().clone('valid')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfVirtIfStatus.setStatus('mandatory')
ospfNbrTable = MibTable((1, 3, 6, 1, 2, 1, 14, 10), )
if mibBuilder.loadTexts: ospfNbrTable.setStatus('mandatory')
ospfNbrEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 10, 1), ).setIndexNames((0, "RFC1253-MIB", "ospfNbrIpAddr"), (0, "RFC1253-MIB", "ospfNbrAddressLessIndex"))
if mibBuilder.loadTexts: ospfNbrEntry.setStatus('mandatory')
ospfNbrIpAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfNbrIpAddr.setStatus('mandatory')
ospfNbrAddressLessIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 2), InterfaceIndex()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfNbrAddressLessIndex.setStatus('mandatory')
ospfNbrRtrId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 3), RouterID().clone(hexValue="00000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrRtrId.setStatus('mandatory')
ospfNbrOptions = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrOptions.setStatus('mandatory')
ospfNbrPriority = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 5), DesignatedRouterPriority().clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfNbrPriority.setStatus('mandatory')
ospfNbrState = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("down", 1), ("attempt", 2), ("init", 3), ("twoWay", 4), ("exchangeStart", 5), ("exchange", 6), ("loading", 7), ("full", 8))).clone('down')).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrState.setStatus('mandatory')
ospfNbrEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrEvents.setStatus('mandatory')
ospfNbrLSRetransQLen = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 8), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrLSRetransQLen.setStatus('mandatory')
ospfNBMANbrStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 9), Validation().clone('valid')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfNBMANbrStatus.setStatus('mandatory')
ospfVirtNbrTable = MibTable((1, 3, 6, 1, 2, 1, 14, 11), )
if mibBuilder.loadTexts: ospfVirtNbrTable.setStatus('mandatory')
ospfVirtNbrEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 11, 1), ).setIndexNames((0, "RFC1253-MIB", "ospfVirtNbrArea"), (0, "RFC1253-MIB", "ospfVirtNbrRtrId"))
if mibBuilder.loadTexts: ospfVirtNbrEntry.setStatus('mandatory')
ospfVirtNbrArea = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 1), AreaID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrArea.setStatus('mandatory')
ospfVirtNbrRtrId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 2), RouterID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrRtrId.setStatus('mandatory')
ospfVirtNbrIpAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 3), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrIpAddr.setStatus('mandatory')
ospfVirtNbrOptions = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrOptions.setStatus('mandatory')
ospfVirtNbrState = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("down", 1), ("attempt", 2), ("init", 3), ("twoWay", 4), ("exchangeStart", 5), ("exchange", 6), ("loading", 7), ("full", 8)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrState.setStatus('mandatory')
ospfVirtNbrEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrEvents.setStatus('mandatory')
ospfVirtNbrLSRetransQLen = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 7), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrLSRetransQLen.setStatus('mandatory')
mibBuilder.exportSymbols("RFC1253-MIB", DesignatedRouterPriority=DesignatedRouterPriority, ospfLsdbTable=ospfLsdbTable, ospfSpfRuns=ospfSpfRuns, ospfIfMetricIpAddress=ospfIfMetricIpAddress, ospfIfTransitDelay=ospfIfTransitDelay, ospfAdminStat=ospfAdminStat, ospfVirtIfRtrDeadInterval=ospfVirtIfRtrDeadInterval, ospfStubAreaTable=ospfStubAreaTable, ospfAuthType=ospfAuthType, ospfIfEvents=ospfIfEvents, PositiveInteger=PositiveInteger, ospfVirtNbrState=ospfVirtNbrState, ospfHostTOS=ospfHostTOS, ospfAreaRangeMask=ospfAreaRangeMask, ospfIfIpAddress=ospfIfIpAddress, ospfIfState=ospfIfState, TruthValue=TruthValue, ospfNbrEntry=ospfNbrEntry, ospfNbrTable=ospfNbrTable, ospfIfMetricEntry=ospfIfMetricEntry, ospfRouterId=ospfRouterId, ospfIfMetricMetric=ospfIfMetricMetric, ospfVirtIfNeighbor=ospfVirtIfNeighbor, ospfIfHelloInterval=ospfIfHelloInterval, ospfVirtNbrEntry=ospfVirtNbrEntry, Status=Status, ospfStubMetric=ospfStubMetric, ospfOriginateNewLSAs=ospfOriginateNewLSAs, ospfAreaRangeEntry=ospfAreaRangeEntry, ospfVirtIfRetransInterval=ospfVirtIfRetransInterval, ospfNBMANbrStatus=ospfNBMANbrStatus, AreaID=AreaID, InterfaceIndex=InterfaceIndex, ospfIfRetransInterval=ospfIfRetransInterval, ospfASBdrRtrStatus=ospfASBdrRtrStatus, ospfNbrIpAddr=ospfNbrIpAddr, ospfNbrOptions=ospfNbrOptions, ospfIfMetricTOS=ospfIfMetricTOS, ospfIfRtrPriority=ospfIfRtrPriority, ospfStubStatus=ospfStubStatus, ospfVirtNbrEvents=ospfVirtNbrEvents, Metric=Metric, ospfAreaId=ospfAreaId, ospfExternLSACksumSum=ospfExternLSACksumSum, ospfIfType=ospfIfType, ospfIfDesignatedRouter=ospfIfDesignatedRouter, ospfIfMetricStatus=ospfIfMetricStatus, ospfNbrEvents=ospfNbrEvents, ospfIfMetricAddressLessIf=ospfIfMetricAddressLessIf, ospfVirtIfHelloInterval=ospfVirtIfHelloInterval, ospfAreaTable=ospfAreaTable, ospfHostTable=ospfHostTable, ospfIfTable=ospfIfTable, ospfVirtIfTransitDelay=ospfVirtIfTransitDelay, ospfLsdbAdvertisement=ospfLsdbAdvertisement, ospfVirtNbrArea=ospfVirtNbrArea, ospfAreaLSACount=ospfAreaLSACount, ospfHostIpAddress=ospfHostIpAddress, ospfIfMetricTable=ospfIfMetricTable, ospfVirtIfTable=ospfVirtIfTable, ospfNbrAddressLessIndex=ospfNbrAddressLessIndex, ospfLsdbAreaId=ospfLsdbAreaId, ospfLsdbLSID=ospfLsdbLSID, ospfAreaLSACksumSum=ospfAreaLSACksumSum, ospfAreaEntry=ospfAreaEntry, ospfVirtIfState=ospfVirtIfState, ospfTOSSupport=ospfTOSSupport, ospfGeneralGroup=ospfGeneralGroup, HelloRange=HelloRange, ospfStubAreaEntry=ospfStubAreaEntry, ospfHostMetric=ospfHostMetric, ospfNbrLSRetransQLen=ospfNbrLSRetransQLen, RouterID=RouterID, ospfNbrRtrId=ospfNbrRtrId, ospf=ospf, ospfAreaBdrRtrCount=ospfAreaBdrRtrCount, ospfAreaBdrRtrStatus=ospfAreaBdrRtrStatus, ospfVirtIfEvents=ospfVirtIfEvents, ospfHostStatus=ospfHostStatus, ospfVirtNbrRtrId=ospfVirtNbrRtrId, ospfVirtNbrOptions=ospfVirtNbrOptions, ospfLsdbSequence=ospfLsdbSequence, BigMetric=BigMetric, ospfAreaRangeStatus=ospfAreaRangeStatus, ospfAreaRangeNet=ospfAreaRangeNet, ospfVirtNbrLSRetransQLen=ospfVirtNbrLSRetransQLen, ospfVirtNbrIpAddr=ospfVirtNbrIpAddr, ospfIfAuthKey=ospfIfAuthKey, ospfRxNewLSAs=ospfRxNewLSAs, ospfIfAdminStat=ospfIfAdminStat, ospfLsdbType=ospfLsdbType, ospfExternLSACount=ospfExternLSACount, ospfAreaRangeTable=ospfAreaRangeTable, ospfIfAreaId=ospfIfAreaId, UpToMaxAge=UpToMaxAge, ospfHostEntry=ospfHostEntry, ospfASBdrRtrCount=ospfASBdrRtrCount, ospfVersionNumber=ospfVersionNumber, ospfStubAreaID=ospfStubAreaID, ospfLsdbChecksum=ospfLsdbChecksum, ospfVirtIfEntry=ospfVirtIfEntry, ospfAddressLessIf=ospfAddressLessIf, ospfAreaRangeAreaID=ospfAreaRangeAreaID, ospfIfBackupDesignatedRouter=ospfIfBackupDesignatedRouter, ospfLsdbAge=ospfLsdbAge, ospfLsdbEntry=ospfLsdbEntry, ospfIfPollInterval=ospfIfPollInterval, ospfVirtIfAreaID=ospfVirtIfAreaID, ospfVirtNbrTable=ospfVirtNbrTable, ospfNbrState=ospfNbrState, ospfIfEntry=ospfIfEntry, TOSType=TOSType, ospfImportASExtern=ospfImportASExtern, ospfVirtIfAuthKey=ospfVirtIfAuthKey, ospfVirtIfStatus=ospfVirtIfStatus, ospfLsdbRouterId=ospfLsdbRouterId, Validation=Validation, ospfIfRtrDeadInterval=ospfIfRtrDeadInterval, ospfNbrPriority=ospfNbrPriority, ospfStubTOS=ospfStubTOS)
|
# -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| This file is subject to the terms and conditions defined in file |
#| 'LICENSE.txt', which is part of this source code package. |
#| |
#|---------------------------------------------------------------------------|
#| Copyright (c) 2017 Liang ZOU and contributors |
#| See the full list at https://github.com/liangdzou/pycall/contributors |
#| |
#|---------------------------------------------------------------------------|
#| test.py -- a test program that uses pycall |
#| |
#| Author: Liang, ZOU |
#| |
#| Purpose: Show how to use pycall |
#| |
#+---------------------------------------------------------------------------+
def testFunc(message):
print("Python: python function testFunc is executed!")
print("Python: The message is \"", message, "\"")
result = 2017
print("Python: The result should be \"", result, "\"")
return result
|
# MIT OC - CS600 - Introduction to Computer Science and Programming
# Problem Set 1: 3 Simple Problems - Problem 1 Min Payment
# Name: Luke Young
# Collaborators: None
# Time Spent: 01:00 (hr:min)
# 2018 04 21 00:20
# Program: Finding remaining balance after minimum payment
#
# Write a program that does the following:
# Use raw_input() to ask for the following three floating point numbers:
# 1. the outstanding balance on the credit card
# 2. annual interest rate
# 3. minimum monthly payment rate
#
# For each month, print the minimum monthly payment, remaining balance,
# principle paid in the format shown in the test cases below.
# All numbers should be rounded to the nearest penny. Finally, print the result,
# which should include the total amount paid that year and the remaining balance.
balance = 0.0
apr = 0.0
minRate = 0.0
balance = float(raw_input("What is your current Balance? "))
apr = float(raw_input("What is the annual interest rate as a decimal? "))
minRate = float(raw_input("What is the minimum payment rate as a decimal? "))
minPay = 0.0
principle = 0.0
payTotal = 0.0
# main algorithm
for month in range(1, 13): #runs 12 times
print("Month: " + str(month))
minPay = round((balance * minRate), 2)
principle = round((minPay - (apr / 12 * balance)), 2)
balance = round((balance - principle), 2)
payTotal += round(minPay, 2)
print("Minimum monthly payment: " + str(minPay))
print("Principle paid: " + str(principle))
print("Remaining balance: " + str(balance))
# end for loop
# print results
print("RESULT")
print("Total amount paid: " + str(payTotal))
print("Remaining balance: " + str(balance))
|
# -*- coding: utf-8 -*-
"""
plugin
~~~~
plugin manager and plugin api
:copyright: (c) 2017 by Baidu, Inc.
:license: Apache, see LICENSE for more details.
""" |
getInvoiceTopLevelItems = [
{
'categoryCode': 'sov_sec_ip_addresses_priv',
'createDate': '2018-04-04T23:15:20-06:00',
'description': '64 Portable Private IP Addresses',
'id': 724951323,
'oneTimeAfterTaxAmount': '0',
'recurringAfterTaxAmount': '0',
'hostName': 'bleg',
'domainName': 'beh.com',
'category': {'name': 'Private (only) Secondary VLAN IP Addresses'},
'children': [
{
'id': 12345,
'category': {'name': 'Fake Child Category'},
'description': 'Blah',
'oneTimeAfterTaxAmount': 55.50,
'recurringAfterTaxAmount': 0.10
}
],
'location': {'name': 'fra02'}
}
]
|
#!/usr/bin/env python3
#this program will write out my full name and preferred pronouns
print("Fabian Arias, he/him/his") #print out Fabian Arias, he/him/his
|
class DSF_SIC_Map(object):
"""docstring for SIC_Map"""
def __init__(self, dsffile = 'crsp/dsf.csv', sicfile = 'sic_codes.txt'):
self.dsf = pd.read_csv("dsf.csv", dtype = {'CUSIP': np.str, 'PRC': np.float}, na_values = {'PRC': '-'})
self.sic = pd.read_table(sicfile, header = 1)
self.sic.columns = ['HSICCD', 'SICNAME']
def process(self, day = 20100101, columns = ['PERMNO', 'DATE', 'PRC', 'VOL', 'SHROUT', 'RET', 'HSICCD']):
self.dsf_startdate(date = day)
self.dsf_subset(to_keep = columns)
self.sic_merge()
def dsf_startdate(self, date = 20100101):
self.dsf = self.dsf[self.dsf.DATE >= date]
def dsf_subset(self, to_keep = ['PERMNO', 'DATE', 'PRC', 'VOL', 'SHROUT', 'RET', 'HSICCD']):
self.dsf = self.dsf[to_keep]
def sic_merge(self):
self.clean_dsf = self.dsf.merge(self.sic, how = "left") |
class Serial:
def __init__(self, port=None, baudrate=None, timeout=None):
pass
def reset_output_buffer(self):
pass
def reset_input_buffer(self):
pass
def writable(self):
return True
def write(self, bytes):
pass
def flush(self):
pass
def readline(self):
return b"DONE\r\n"
|
"""
Python2-specific versions of various functions used by stomp.py
"""
NULL = '\x00'
def input_prompt(prompt):
"""
Get user input
:rtype: str
"""
return raw_input(prompt)
def decode(byte_data, encoding=''):
"""
Decode the byte data to a string - in the case of this Py2 version, we can't really do anything (Py3 differs).
:param bytes byte_data:
:rtype: str
"""
return byte_data # no way to know if it's unicode or not, so just pass through unmolested
def encode(char_data, encoding='utf-8'):
"""
Encode the parameter as a byte string.
:param char_data:
:rtype: bytes
"""
if type(char_data) is unicode:
return char_data.encode(encoding, 'replace')
else:
return char_data
def pack(pieces=()):
"""
Join a sequence of strings together (note: py3 version differs)
:param list pieces:
:rtype: bytes
"""
return ''.join(pieces)
def join(chars=()):
"""
Join a sequence of characters into a string.
:param bytes chars:
:rtype str:
"""
return ''.join(chars)
|
"""CIS 122 Winter 2018 Week 1 Problem set #1-3
Author: Jamie Thayer
Credit: Just me, Jamie Thayer. Referenced https://docs.python.org/3/library/ to check function names
Description: Introduction to programming Week-1 problem set. Use of Python numeric data types and
operations to solve a variety of small problems."""
"""Problem 1. Attempting to buy some t-shirts"""
print ('---Problem 1. The cost of green dye seems to have gone up')
print ()
cost_green = 15
cost_yellow = 10
ttl_shirts = 128
ttl_green = ttl_shirts // 2
#Bug: Division not rounding. '//' was needed to round result to a whole interger
ttl_yellow = ttl_shirts - ttl_green
ttl_green_cost = ttl_green * cost_green
ttl_yellow_cost = ttl_yellow * cost_yellow
ttl_cost = ttl_yellow_cost + ttl_green_cost
print ('Total Cost: ' + str(ttl_cost))
print ()
print ()
"""Used str() to print ttl_cost alongside 'Total Cost: ' to make a nicer display. Also used a
couple blank print() lines for the same purpose"""
"""Problem 2. The Skill to counting Skittles"""
print ('---Problem 2. The Skill to counting Skittles')
print ()
orange = 7
#If one were to find they had only 6 orange skittles, they would just need to change this line
green = orange * 3
purple = orange + green
red = purple / 2
yellow = 100 - orange - green - purple - red
#Declaration of variables, including initial orange skittle count
candy_total = orange + green + purple + red + yellow
"""Candy total inserted to check the consistancy of my program with various numbers of orange skittles.
This value should always be 100 as long as the program is functioning properly."""
print ('Orange Skittle Count: ' + str(orange))
print (' Green Skittle Count: ' + str(green))
print ('Purple Skittle Count: ' + str(purple))
print (' Red Skittle Count: ' + str(int(red)))
print ('Yellow Skittle Count: ' + str(int(yellow)))
print (' Total Candy Count: ' + str(int(candy_total)))
print ()
print ()
"""Spaces inserted to align numbers for a better display. Attempted .center, .rjust, and format()
in numerous ways but couldn't get it to work properly. --- str() and int() have been inserted as a way to
print the number alongside text and without the floating zero"""
"""Problem 3. Because 3.154e+7 seconds in a year wasn't catchy enough"""
print ('---Problem 3. Because 31536000 seconds wasn\'t catchy enough')
print ()
song_number = 525600
#Making sure this number is actually the number of minutes in a year
days_inYear = 365
hours_inDay = 24
minutes_inHour = 60
seconds_inMinute = 60
#various known time convertions
minutes_inYear = days_inYear * hours_inDay * minutes_inHour
seconds_inYear = days_inYear * hours_inDay * minutes_inHour * seconds_inMinute
#declaring variables with math operators combining previous known variables
print (' Number referenced in the song: ' + str(song_number))
print ('Minutes in a year calculated with Python: ' + str(minutes_inYear))
print ()
#Simply printing the original song number and the combined variable minutes_inYear to check consistancy
print ('Seconds in a year, simply because I was curious: ' + str(seconds_inYear))
print ()
#Printed seconds_inYear because I have the power to now, and I was curious
|
def is_even(x):
if (x % 2 == 0):
return True
return False
print([x for x in range(100) if is_even(x)]) |
# terrascript/data/AdrienneCohea/nomadutility.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:22:45 UTC)
__all__ = []
|
n1 = float(input('Digite a P1: '))
n2 = float(input('Digite a P2: '))
M = (n1+n2)/2
if M > 7:
print(f'Aluno APROVADO com média {M}')
elif 5 >= M or M < 6.75:
print(f'Aluno em RECUPERAÇÃO com média {M}')
else:
print(f'Aluno REPROVADO com média {M}')
|
# Este es el ejercicio del grupo tercero c
# del dia 13 de septiembre de 2021
# esta linea coloca un mensaje en la consola
print("Este programa hace operaciones basicas")
num1 = 130
numero_2 = 345
suma = num1 + numero_2 # la resta se hace con el simbolo '-'
multip = num1 * numero_2 # la dicision se hace con una '/'
print("la suma es: ")
print(suma)
print("La multiplicacion da como resultado: ", multip)
|
score = input('Please enter your score.')
score_float = float(score)
if (score_float >= 0.9 and score_float < 1.0) :
grade = 'A'
elif (score_float >= 0.8 and score_float < 1.0) :
grade = 'B'
elif (score_float >= 0.7 and score_float < 1.0) :
grade = 'C'
elif (score_float >= 0.6 and score_float < 1.0) :
grade = 'D'
elif (score_float < 0.6 and score_float > 0.0) :
grade = 'F'
else:
grade = 'Error'
print(grade)
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
assert any(list(map(lambda x: x > 4, range(8))))
assert any(map(lambda x: x > 4, range(8)))
assert not any(list(map(lambda x: x < 0, range(8))))
assert not any((map(lambda x: x < 0, range(8))))
|
class User:
'''
This class generates new user instances
'''
def __init__(self, fullname, email, username, password):
self.fullname = fullname
self.email = email
self.username = username
self.password = password
user_list = []
def save_user(self):
'''
This method saves new created user objects into user list
'''
User.user_list.append(self)
@classmethod
def user_exists(cls, username):
'''
Checks if the user exists in the user list.
Args:
username:username to search if the user already exists and returns a boolean, True or False.
'''
for user in cls.user_list:
if user.username == username:
return True
else:
return False
@classmethod
def find_by_username(cls, username):
'''
Finds a user depending on if the user already exists
'''
for user in cls.user_list:
if user.username == username:
return user
else:
return 0
|
"""
Datos de entrada
precio_final-->pf-->int
precio_publico-->pp-->int
Datos de salida
descuento-->d-->float
"""
#Entradas
pf=int(input("Ingrese el precio final: "))
pp=int(input("Ingrese el precio al público: "))
#Caja negra
r=((pp-pf)/pp)*100
#Salidas
print(f"El porcentaje de descuento fue de: {r}%") |
class Solution(object):
def numDistinct(self, s, t):
"""
:type s: str
:type t: str
:rtype: int
"""
dp = [[0 for j in range(len(t) + 1)] for i in range(len(s) + 1)]
for i in range(len(s) + 1):
dp[i][0] = 1
for i in range(1, len(s) + 1):
for j in range(1, len(t) + 1):
dp[i][j] = dp[i - 1][j] + (dp[i - 1][j - 1] if s[i - 1] == t[j - 1] else 0)
return dp[-1][-1] |
class VehicleDevice:
def __init__(self, data, controller):
self._id = data['id']
self._vehicle_id = data['vehicle_id']
self._vin = data['vin']
self._state = data['state']
self._controller = controller
self.should_poll = True
def _name(self):
return 'Tesla Model {} {}'.format(
str(self._vin[3]).upper(), self.type)
def _uniq_name(self):
return 'Tesla Model {} {} {}'.format(
str(self._vin[3]).upper(), self._vin, self.type)
def id(self):
return self._id
@staticmethod
def is_armable():
return False
@staticmethod
def is_armed():
return False
|
#=======================================================================================
# Open a domain template.
#=======================================================================================
selectCustomTemplate("wls/wlserver/common/templates/wls/wls.jar")
loadTemplates()
setOption('NodeManagerType','ManualNodeManagerSetup')
setOption('ServerStartMode','prod')
setOption('OverwriteDomain','true')
domain=cd('/')
domain.setName('demo-wls')
#=======================================================================================
# Configure the Administration Server and SSL port.
#
# To enable access by both local and remote processes, you should not set the
# listen address for the server instance (that is, it should be left blank or not set).
# In this case, the server instance will determine the address of the machine and
# listen on it.
#=======================================================================================
cd('/Servers/AdminServer')
cmo.setName('admin_server')
cmo.setListenAddress('')
cmo.setListenPort(7001)
create('AdminServer','SSL')
cd('SSL/AdminServer')
cmo.setName('admin_server')
cmo.setListenPort(8001)
cmo.setEnabled(True)
cd('/Security/demo-wls/User/weblogic')
cmo.setPassword('admin123')
domain.setProductionModeEnabled(True)
writeDomain('domains/demo-wls')
closeTemplate()
# enable boot without password
os.makedirs('domains/demo-wls/servers/admin_server/security')
bootprops=open('domains/demo-wls/servers/admin_server/security/boot.properties','w')
bootprops.write('username=%s\npassword=%s\n' % ('weblogic','admin123'))
bootprops.close()
exit()
|
def create_matrix(rows, columns):
result = []
for r in range(rows):
row = ["" for c in range(columns)]
result.append(row)
return result
def print_result(matrix):
for el in matrix:
print("".join(el))
rows, columns = map(int, input().split())
snake = input()
matrix = create_matrix(rows, columns)
snake_index = 0
for r in range(rows):
if r % 2 == 0:
for c in range(columns):
if snake_index == len(snake):
snake_index = 0
matrix[r][c] = snake[snake_index]
snake_index += 1
else:
for c in range(columns - 1, -1, -1):
if snake_index == len(snake):
snake_index = 0
matrix[r][c] = snake[snake_index]
snake_index += 1
print_result(matrix) |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
CONST_OUTBOUND_TYPE_LOAD_BALANCER = "loadBalancer"
CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING = "userDefinedRouting"
CONST_SCALE_SET_PRIORITY_REGULAR = "Regular"
CONST_SCALE_SET_PRIORITY_SPOT = "Spot"
CONST_SPOT_EVICTION_POLICY_DELETE = "Delete"
CONST_SPOT_EVICTION_POLICY_DEALLOCATE = "Deallocate"
CONST_HTTP_APPLICATION_ROUTING_ADDON_NAME = "httpApplicationRouting"
CONST_MONITORING_ADDON_NAME = "omsagent"
CONST_MONITORING_LOG_ANALYTICS_WORKSPACE_RESOURCE_ID = "logAnalyticsWorkspaceResourceID"
CONST_VIRTUAL_NODE_ADDON_NAME = "aciConnector"
CONST_VIRTUAL_NODE_SUBNET_NAME = "SubnetName"
CONST_AZURE_POLICY_ADDON_NAME = "azurepolicy"
CONST_KUBE_DASHBOARD_ADDON_NAME = "kubeDashboard"
CONST_OS_DISK_TYPE_MANAGED = "Managed"
CONST_OS_DISK_TYPE_EPHEMERAL = "Ephemeral"
# IngressApplicaitonGateway configuration keys
CONST_INGRESS_APPGW_ADDON_NAME = "IngressApplicationGateway"
CONST_INGRESS_APPGW_APPLICATION_GATEWAY_NAME = "applicationGatewayName"
CONST_INGRESS_APPGW_APPLICATION_GATEWAY_ID = "applicationGatewayId"
CONST_INGRESS_APPGW_SUBNET_ID = "subnetId"
CONST_INGRESS_APPGW_SUBNET_PREFIX = "subnetPrefix"
CONST_INGRESS_APPGW_WATCH_NAMESPACE = "watchNamespace"
# Open Service Mesh configuration keys
CONST_OPEN_SERVICE_MESH_ADDON_NAME = "openServiceMesh"
CONST_NODEPOOL_MODE_SYSTEM = "System"
CONST_NODEPOOL_MODE_USER = "User"
# refer https://docs.microsoft.com/en-us/rest/api/storageservices/
# naming-and-referencing-containers--blobs--and-metadata#container-names
CONST_CONTAINER_NAME_MAX_LENGTH = 63
# confcom addon keys
CONST_CONFCOM_ADDON_NAME = "ACCSGXDevicePlugin"
CONST_ACC_SGX_QUOTE_HELPER_ENABLED = "ACCSGXQuoteHelperEnabled"
# private dns zone mode
CONST_PRIVATE_DNS_ZONE_SYSTEM = "system"
CONST_PRIVATE_DNS_ZONE_NONE = "none"
ADDONS = {
'http_application_routing': CONST_HTTP_APPLICATION_ROUTING_ADDON_NAME,
'monitoring': CONST_MONITORING_ADDON_NAME,
'virtual-node': CONST_VIRTUAL_NODE_ADDON_NAME,
'azure-policy': CONST_AZURE_POLICY_ADDON_NAME,
'kube-dashboard': CONST_KUBE_DASHBOARD_ADDON_NAME,
'ingress-appgw': CONST_INGRESS_APPGW_ADDON_NAME,
'open-service-mesh': CONST_OPEN_SERVICE_MESH_ADDON_NAME,
"confcom": CONST_CONFCOM_ADDON_NAME,
'gitops': 'gitops'
}
|
"""
Problem 11.
Assume that two variables, varA and varB, are assigned values,
either numbers or strings. Write a piece of Python code that
prints out one of the following messages:
* "string involved" if either varA or varB are strings
* "bigger" if varA is larger than varB
* "equal" if varA is equal to varB
* "smaller" if varA is smaller than varB
"""
if type(varA) == str or type(varB) == str:
print("string involved")
elif varA > varB:
print("bigger")
elif varA == varB:
print("equal")
else:
print("smaller")
|
cars = 100.00 #number of cars available for the day
space_in_a_car = 4.00 #amount of space in a cars
drivers = 30.00 #number of available drivers
passengers = 90.00 #number of available passengers
cars_not_driven = cars - drivers #calculation for cars that are not used
cars_driven = drivers #calculation for cars that are used
carpool_capacity = cars_driven * space_in_a_car #calculation for carpool_capacity
average_passengers_per_car = passengers / cars_driven #calculation for average
print("There are", cars, "cars available")
print("There are only", drivers, "drivers available")
print("There will be", cars_not_driven, "empty cars today")
print("We can transport", carpool_capacity, "people today.")
print("We have", passengers, "to carpool today.")
print("We need to put about", average_passengers_per_car, "in each car.")
|
"""ll are a list which are linked
starts at head and ends at tail
Look up: O(n)
Insert: O(n)
Delete: O(n)
Append: O(1)
Prepend: 0(1)
"""
# * define class node which will act as a blue print for each node
class Node():
def __init__(self, data): # we pass the data we want tthe node to hold
self.data = data # data passed is stored in self.data
self.next = None # pointer, always points to null or None
class LinkedList():
def __init__(self):
self.head = None # when list is created, it is empty and ther is no node ot topoint to, so head will point to none at the time
# since list is empty when created, we will point the tail to whatever the head is pointing to
self.tail = self.head
self.length = 0
# ? Appending add nodes to the end of the LL
def append(self, data): # creates a new instance of Node class
new_node = Node(data) # new node with info that user is inputing
if self.head == None: # check if its empty
self.head = new_node # point head to new node
self.tail = self.head # tail to the head
self.length = 1
"""
▲
|
head and tail point to the same node
"""
else:
self.tail.next = new_node # next pointer of the last node point to the new node
self.tail = new_node # update tail to point to the new node
self.length += 1
"""
① ----▸ ②
head last node
tail
--------
#* ① ----▸ ② -----------▸ ③
#* head last node *# tail (pointer updated)
"""
# ? add node at the head of the list
def prepend(self, data):
new_node = Node(data)
new_node.next = self.head
# update the head to point to the new node as we want the new node to be new first node (new head)
self.head = new_node
self.length += 1
# ? print values in the nodes of the LL
def print_list(self):
# check if its empty
if self.head == None:
print("Empty")
else:
current_node = self.head
while current_node is not None: # loop until the node we created becomes None
print(current_node.data, end=" ")
current_node = current_node.next
print()
# def printThis(self):
# arr = []
# currNode = self.head
# while currNode is not None:
# arr.append(currNode.data)
# currNode = currNode.next
# return arr
# ? this part allows us to insert data a specific position (even the middle)
def insert(self, position, data):
if position >= self.length:
print("This position is not available. Insert at the end of the list")
new_node = Node(data)
self.tail.next = new_node
self.tail = new_node
self.length += 1
if position == 0: # follow prepend position and add at head
new_node = Node(data)
new_node.next = self.head
self.head = new_node
self.length += 1
return
if position < self.length: # if position is in between, then we create a temp node which traverses the list upto the previous position of the position we want to enter the new node
new_node = Node(data)
current_node = self.head
for i in range(position-1): # traversale of the list its an O(n)
current_node = current_node.next # temp node
# temp position and new node point to the same position --> we want to insert the new node here
new_node.next = current_node.next
current_node.next = new_node # update next of the temp node to point to the new node
self.length += 1
return
def delete_by_value(self, data):
if self.head == None:
print("Linked list is empty. Nothing to delete")
return
current_node = self.head
if current_node.data == data: # if input val = head
self.head = self.head.next # head -> input val
if self.head == None or self.head.next == None: # check if there's 1 or 0 nodes in the list
# update tail to be equal to the head
self.tail = self.head
self.length -= 1 # head gets disconnected from list
return
while current_node != None and current_node.next.data != data:
# taverse list and check every node
# loop until either the current node becomes NONE (end of the list) or until the data of the node next to the current node equals the data we want deleted
current_node = current_node.next
if current_node is not None: # this would mean the next node of the current node is the one we want deleted
current_node.next = current_node.next.next
if current_node.next == None:
self.tail = current_node
self.length -= 1
return
else:
print("Cant find value")
return
def delete_by_position(self, position):
if self.head == None:
print("Linked list is empty. Nothing to delete")
return
if position is 0: # if input val = head
self.head = self.head.next # head -> input val
if self.head == None or self.head.next == None: # check if there's 1 or 0 nodes in the list
# update tail to be equal to the head
self.tail = self.head
self.length -= 1 # head gets disconnected from list
return
if position >= self.length:
position = self.length-1
current_node = self.head
for i in range(position - 1):
current_node = current_node.next
current_node.next = current_node.next.next
self.length -= 1
if current_node.next == None:
self.tail = current_node
return
if __name__ == '__main__':
ll = LinkedList()
ll.print_list()
# empty
ll.append(5)
ll.append(2)
ll.append(9)
ll.print_list()
print("length of the list: ", ll.length)
ll.prepend(4)
ll.print_list()
ll.insert(2, 7)
ll.print_list()
ll.delete_by_value(7)
print("by val")
ll.print_list()
ll.delete_by_position(8)
print("by pos")
ll.print_list()
print("print this")
print(ll.head.data)
print(ll.tail.data)
# ll.printThis()
# print(LinkedList())
|
class Solution:
def findMaximumXOR(self, nums: List[int]) -> int:
ans = mask = 0
for x in range(32)[::-1]:
mask += 1 << x
prefixSet = set([n & mask for n in nums])
temp = ans | 1 << x
for prefix in prefixSet:
if temp ^ prefix in prefixSet:
ans = temp
break
return ans
|
#
# PySNMP MIB module OMNI-gx2CM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/OMNI-gx2CM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:23:48 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection")
gx2Cm, = mibBuilder.importSymbols("GX2HFC-MIB", "gx2Cm")
gi, motproxies = mibBuilder.importSymbols("NLS-BBNIDENT-MIB", "gi", "motproxies")
trapNETrapLastTrapTimeStamp, trapNetworkElemModelNumber, trapNetworkElemAvailStatus, trapChangedValueDisplayString, trapChangedValueInteger, trapNetworkElemSerialNum, trapNetworkElemOperState, trapNetworkElemAdminState, trapChangedObjectId, trapText, trapIdentifier, trapNetworkElemAlarmStatus, trapPerceivedSeverity = mibBuilder.importSymbols("NLSBBN-TRAPS-MIB", "trapNETrapLastTrapTimeStamp", "trapNetworkElemModelNumber", "trapNetworkElemAvailStatus", "trapChangedValueDisplayString", "trapChangedValueInteger", "trapNetworkElemSerialNum", "trapNetworkElemOperState", "trapNetworkElemAdminState", "trapChangedObjectId", "trapText", "trapIdentifier", "trapNetworkElemAlarmStatus", "trapPerceivedSeverity")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
sysUpTime, = mibBuilder.importSymbols("SNMPv2-MIB", "sysUpTime")
iso, IpAddress, Unsigned32, MibIdentifier, Counter64, Integer32, Counter32, NotificationType, TimeTicks, Bits, ModuleIdentity, NotificationType, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "IpAddress", "Unsigned32", "MibIdentifier", "Counter64", "Integer32", "Counter32", "NotificationType", "TimeTicks", "Bits", "ModuleIdentity", "NotificationType", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
class Float(Counter32):
pass
gx2cmDescriptor = MibIdentifier((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 1))
gx2cmFactoryTable = MibTable((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2), )
if mibBuilder.loadTexts: gx2cmFactoryTable.setStatus('mandatory')
gx2cmFactoryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1), ).setIndexNames((0, "OMNI-gx2CM-MIB", "gx2cmFactoryTableIndex"))
if mibBuilder.loadTexts: gx2cmFactoryEntry.setStatus('mandatory')
gx2cmNetworkTable = MibTable((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3), )
if mibBuilder.loadTexts: gx2cmNetworkTable.setStatus('mandatory')
gx2cmNetworkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2), ).setIndexNames((0, "OMNI-gx2CM-MIB", "gx2cmNetworkTableIndex"))
if mibBuilder.loadTexts: gx2cmNetworkEntry.setStatus('mandatory')
gx2cmAnalogTable = MibTable((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4), )
if mibBuilder.loadTexts: gx2cmAnalogTable.setStatus('mandatory')
gx2cmAnalogEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3), ).setIndexNames((0, "OMNI-gx2CM-MIB", "gx2cmTableIndex"))
if mibBuilder.loadTexts: gx2cmAnalogEntry.setStatus('mandatory')
gx2cmDigitalTable = MibTable((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5), )
if mibBuilder.loadTexts: gx2cmDigitalTable.setStatus('mandatory')
gx2cmDigitalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4), ).setIndexNames((0, "OMNI-gx2CM-MIB", "gx2cmDigitalTableIndex"))
if mibBuilder.loadTexts: gx2cmDigitalEntry.setStatus('mandatory')
gx2cmStatusTable = MibTable((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6), )
if mibBuilder.loadTexts: gx2cmStatusTable.setStatus('mandatory')
gx2cmStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5), ).setIndexNames((0, "OMNI-gx2CM-MIB", "gx2cmStatusTableIndex"))
if mibBuilder.loadTexts: gx2cmStatusEntry.setStatus('mandatory')
gx2cmAMCTable = MibTable((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7), )
if mibBuilder.loadTexts: gx2cmAMCTable.setStatus('mandatory')
gx2cmAMCEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6), ).setIndexNames((0, "OMNI-gx2CM-MIB", "gx2cmAMCTableIndex"))
if mibBuilder.loadTexts: gx2cmAMCEntry.setStatus('mandatory')
gx2cmSecurityTable = MibTable((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8), )
if mibBuilder.loadTexts: gx2cmSecurityTable.setStatus('mandatory')
gx2cmSecurityEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7), ).setIndexNames((0, "OMNI-gx2CM-MIB", "gx2cmSecurityTableIndex"))
if mibBuilder.loadTexts: gx2cmSecurityEntry.setStatus('mandatory')
gx2cmDiagnosticTable = MibTable((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9), )
if mibBuilder.loadTexts: gx2cmDiagnosticTable.setStatus('mandatory')
gx2cmDiagnosticEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8), ).setIndexNames((0, "OMNI-gx2CM-MIB", "gx2cmDiagnosticTableIndex"))
if mibBuilder.loadTexts: gx2cmDiagnosticEntry.setStatus('mandatory')
gx2cmDownloadTable = MibTable((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 10), )
if mibBuilder.loadTexts: gx2cmDownloadTable.setStatus('mandatory')
gx2cmDownloadEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 10, 9), ).setIndexNames((0, "OMNI-gx2CM-MIB", "gx2cmDownloadTableIndex"))
if mibBuilder.loadTexts: gx2cmDownloadEntry.setStatus('mandatory')
cmTrapHistoryTable = MibTable((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11), )
if mibBuilder.loadTexts: cmTrapHistoryTable.setStatus('mandatory')
cmTrapHistoryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10), ).setIndexNames((0, "OMNI-gx2CM-MIB", "cmTrapHistoryTableIndex"))
if mibBuilder.loadTexts: cmTrapHistoryEntry.setStatus('mandatory')
gx2cmTableIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: gx2cmTableIndex.setStatus('mandatory')
labelModTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelModTemp.setStatus('optional')
uomModTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: uomModTemp.setStatus('optional')
majorHighModTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 4), Float()).setMaxAccess("readonly")
if mibBuilder.loadTexts: majorHighModTemp.setStatus('mandatory')
majorLowModTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 5), Float()).setMaxAccess("readonly")
if mibBuilder.loadTexts: majorLowModTemp.setStatus('mandatory')
minorHighModTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 6), Float()).setMaxAccess("readonly")
if mibBuilder.loadTexts: minorHighModTemp.setStatus('mandatory')
minorLowModTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 7), Float()).setMaxAccess("readonly")
if mibBuilder.loadTexts: minorLowModTemp.setStatus('mandatory')
currentValueModTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 8), Float()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentValueModTemp.setStatus('mandatory')
stateFlagModTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateFlagModTemp.setStatus('mandatory')
minValueModTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 10), Float()).setMaxAccess("readonly")
if mibBuilder.loadTexts: minValueModTemp.setStatus('optional')
maxValueModTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 11), Float()).setMaxAccess("readonly")
if mibBuilder.loadTexts: maxValueModTemp.setStatus('optional')
alarmStateModTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 4, 3, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("noAlarm", 1), ("majorLowAlarm", 2), ("minorLowAlarm", 3), ("minorHighAlarm", 4), ("majorHighAlarm", 5), ("informational", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alarmStateModTemp.setStatus('mandatory')
gx2cmDigitalTableIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: gx2cmDigitalTableIndex.setStatus('mandatory')
labelRemoteLocal = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelRemoteLocal.setStatus('obsolete')
enumRemoteLocal = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: enumRemoteLocal.setStatus('obsolete')
valueRemoteLocal = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("local", 1), ("remote", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueRemoteLocal.setStatus('obsolete')
stateFlagRemoteLocal = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateFlagRemoteLocal.setStatus('obsolete')
labelResetSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelResetSlot.setStatus('optional')
enumResetSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: enumResetSlot.setStatus('optional')
valueResetSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 8), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueResetSlot.setStatus('mandatory')
stateResetSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateResetSlot.setStatus('mandatory')
labelIdShelf = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelIdShelf.setStatus('optional')
enumIdShelf = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: enumIdShelf.setStatus('optional')
valueIdShelf = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueIdShelf.setStatus('mandatory')
stateFlagIdShelf = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateFlagIdShelf.setStatus('mandatory')
labelResetAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelResetAlarm.setStatus('optional')
enumResetAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 15), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: enumResetAlarm.setStatus('optional')
valueResetAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 16), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueResetAlarm.setStatus('mandatory')
stateFlagResetAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 5, 4, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateFlagResetAlarm.setStatus('mandatory')
gx2cmStatusTableIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: gx2cmStatusTableIndex.setStatus('mandatory')
labelShelfAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelShelfAlarm.setStatus('optional')
valueShelfAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("ok", 1), ("undetermined", 2), ("warning", 3), ("minor", 4), ("major", 5), ("critical", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: valueShelfAlarm.setStatus('mandatory')
stateShelfAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateShelfAlarm.setStatus('mandatory')
labelDataCrc = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelDataCrc.setStatus('optional')
valueDataCrc = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("ok", 1), ("undetermined", 2), ("warning", 3), ("minor", 4), ("major", 5), ("critical", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: valueDataCrc.setStatus('mandatory')
stateDataCrc = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateDataCrc.setStatus('mandatory')
labelFlashStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelFlashStatus.setStatus('optional')
valueFlashStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("ok", 1), ("undetermined", 2), ("warning", 3), ("minor", 4), ("major", 5), ("critical", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: valueFlashStatus.setStatus('mandatory')
stateFlashStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateFlashStatus.setStatus('mandatory')
labelBootStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelBootStatus.setStatus('optional')
valueBootStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("ok", 1), ("undetermined", 2), ("warning", 3), ("minor", 4), ("major", 5), ("critical", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: valueBootStatus.setStatus('mandatory')
stateBootStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateBootStatus.setStatus('mandatory')
labelAlmLimCrc = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelAlmLimCrc.setStatus('optional')
valueAlmLimCrc = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("ok", 1), ("undetermined", 2), ("warning", 3), ("minor", 4), ("major", 5), ("critical", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: valueAlmLimCrc.setStatus('mandatory')
stateAlmLimCrc = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 6, 5, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateAlmLimCrc.setStatus('mandatory')
gx2cmFactoryTableIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: gx2cmFactoryTableIndex.setStatus('mandatory')
bootControlByte = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bootControlByte.setStatus('mandatory')
bootStatusByte = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bootStatusByte.setStatus('mandatory')
bank0CRC = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bank0CRC.setStatus('mandatory')
bank1CRC = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bank1CRC.setStatus('mandatory')
prgEEPROMByte = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: prgEEPROMByte.setStatus('mandatory')
factoryCRC = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: factoryCRC.setStatus('mandatory')
calculateCRC = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: calculateCRC.setStatus('mandatory')
hourMeter = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hourMeter.setStatus('mandatory')
flashPrgCnt0 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: flashPrgCnt0.setStatus('mandatory')
flashPrgCnt1 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: flashPrgCnt1.setStatus('mandatory')
flashBank0 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: flashBank0.setStatus('mandatory')
flashBank1 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: flashBank1.setStatus('mandatory')
localMacAdd = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: localMacAdd.setStatus('mandatory')
netWorkMacAdd = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 2, 1, 15), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netWorkMacAdd.setStatus('mandatory')
gx2cmNetworkTableIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: gx2cmNetworkTableIndex.setStatus('mandatory')
labelLocalEthIPAdd = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelLocalEthIPAdd.setStatus('optional')
valueLocalEthIPAdd = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueLocalEthIPAdd.setStatus('mandatory')
labelLocalEthMask = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelLocalEthMask.setStatus('optional')
valueLocalEthMask = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueLocalEthMask.setStatus('mandatory')
labelNetworkEthAdd = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelNetworkEthAdd.setStatus('optional')
valueNetworkEthAdd = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueNetworkEthAdd.setStatus('mandatory')
labelNetworkEthMask = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelNetworkEthMask.setStatus('optional')
valueNetworkEthMask = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueNetworkEthMask.setStatus('mandatory')
labelShelfSerialNum = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelShelfSerialNum.setStatus('optional')
valueShelfSerialNum = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: valueShelfSerialNum.setStatus('mandatory')
labelGateWayIPAdd = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelGateWayIPAdd.setStatus('optional')
valueGateWayIPAdd = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueGateWayIPAdd.setStatus('mandatory')
labelTrapDestination = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelTrapDestination.setStatus('optional')
valueTrapDestination = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 15), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueTrapDestination.setStatus('mandatory')
labelTFTPserver = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 16), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelTFTPserver.setStatus('optional')
valueTFTPserver = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 17), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueTFTPserver.setStatus('mandatory')
labelTrap2Destination = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 18), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelTrap2Destination.setStatus('optional')
valueTrap2Destination = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 19), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueTrap2Destination.setStatus('mandatory')
labelTrap3Destination = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 20), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelTrap3Destination.setStatus('optional')
valueTrap3Destination = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 21), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueTrap3Destination.setStatus('mandatory')
labelTrap4Destination = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 22), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelTrap4Destination.setStatus('optional')
valueTrap4Destination = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 23), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueTrap4Destination.setStatus('mandatory')
labelTrap5Destination = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 24), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelTrap5Destination.setStatus('optional')
valueTrap5Destination = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 25), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueTrap5Destination.setStatus('mandatory')
labelISDNMode = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 26), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelISDNMode.setStatus('optional')
valueISDNMode = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueISDNMode.setStatus('mandatory')
labelISDNModemIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 28), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelISDNModemIPAddress.setStatus('optional')
valueISDNModemIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 29), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueISDNModemIPAddress.setStatus('mandatory')
labelISDNTrapTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 30), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelISDNTrapTimeout.setStatus('optional')
valueISDNTrapTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 31), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3600))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueISDNTrapTimeout.setStatus('mandatory')
labelISDNPingTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 32), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelISDNPingTimeout.setStatus('optional')
valueISDNPingTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 33), Integer32().subtype(subtypeSpec=ValueRangeConstraint(100, 5000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueISDNPingTimeout.setStatus('mandatory')
labelISDNBackoffTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 34), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelISDNBackoffTimer.setStatus('optional')
valueISDNBackoffTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 3, 2, 35), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3600))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueISDNBackoffTimer.setStatus('mandatory')
gx2cmSecurityTableIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: gx2cmSecurityTableIndex.setStatus('mandatory')
labelSecurityMode = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelSecurityMode.setStatus('optional')
enumSecurityMode = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: enumSecurityMode.setStatus('optional')
valueSecurityMode = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("read-only", 1), ("operator-access", 2), ("factory-access", 3), ("remote-write-only", 4), ("local-write-only", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: valueSecurityMode.setStatus('mandatory')
stateSecurityMode = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateSecurityMode.setStatus('mandatory')
labelPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelPassword.setStatus('optional')
valuePassword = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valuePassword.setStatus('mandatory')
statePassword = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: statePassword.setStatus('mandatory')
labelFactoryChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelFactoryChgString.setStatus('optional')
valueFactoryChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("writeonly")
if mibBuilder.loadTexts: valueFactoryChgString.setStatus('mandatory')
stateFactoryChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateFactoryChgString.setStatus('mandatory')
labelOperatorChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelOperatorChgString.setStatus('optional')
valueOperatorChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("writeonly")
if mibBuilder.loadTexts: valueOperatorChgString.setStatus('mandatory')
stateOperatorChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateOperatorChgString.setStatus('mandatory')
labelReadOnlyChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 15), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelReadOnlyChgString.setStatus('optional')
valueReadOnlyChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 16), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("writeonly")
if mibBuilder.loadTexts: valueReadOnlyChgString.setStatus('mandatory')
stateReadOnlyChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateReadOnlyChgString.setStatus('mandatory')
labelRemoteOnlyChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 18), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelRemoteOnlyChgString.setStatus('optional')
valueRemoteOnlyChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 19), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("writeonly")
if mibBuilder.loadTexts: valueRemoteOnlyChgString.setStatus('mandatory')
stateRemoteOnlyChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateRemoteOnlyChgString.setStatus('mandatory')
labelLocalOnlyChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 21), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: labelLocalOnlyChgString.setStatus('optional')
valueLocalOnlyChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 22), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("writeonly")
if mibBuilder.loadTexts: valueLocalOnlyChgString.setStatus('mandatory')
stateLocalOnlyChgString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 8, 7, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("hidden", 1), ("read-only", 2), ("updateable", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: stateLocalOnlyChgString.setStatus('mandatory')
gx2cmAMCTableIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: gx2cmAMCTableIndex.setStatus('mandatory')
valueAMCslot1 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot1.setStatus('mandatory')
serialAMCslot1 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot1.setStatus('mandatory')
agentIDAMCslot1 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot1.setStatus('mandatory')
valueAMCslot2 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot2.setStatus('mandatory')
serialAMCslot2 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot2.setStatus('mandatory')
agentIDAMCslot2 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot2.setStatus('mandatory')
valueAMCslot3 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot3.setStatus('mandatory')
serialAMCslot3 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot3.setStatus('mandatory')
agentIDAMCslot3 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot3.setStatus('mandatory')
valueAMCslot4 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot4.setStatus('mandatory')
serialAMCslot4 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot4.setStatus('mandatory')
agentIDAMCslot4 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot4.setStatus('mandatory')
valueAMCslot5 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot5.setStatus('mandatory')
serialAMCslot5 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 15), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot5.setStatus('mandatory')
agentIDAMCslot5 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot5.setStatus('mandatory')
valueAMCslot6 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot6.setStatus('mandatory')
serialAMCslot6 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 18), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot6.setStatus('mandatory')
agentIDAMCslot6 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 19), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot6.setStatus('mandatory')
valueAMCslot7 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot7.setStatus('mandatory')
serialAMCslot7 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 21), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot7.setStatus('mandatory')
agentIDAMCslot7 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 22), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot7.setStatus('mandatory')
valueAMCslot8 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot8.setStatus('mandatory')
serialAMCslot8 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 24), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot8.setStatus('mandatory')
agentIDAMCslot8 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 25), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot8.setStatus('mandatory')
valueAMCslot9 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot9.setStatus('mandatory')
serialAMCslot9 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 27), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot9.setStatus('mandatory')
agentIDAMCslot9 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 28), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot9.setStatus('mandatory')
valueAMCslot10 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 29), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot10.setStatus('mandatory')
serialAMCslot10 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 30), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot10.setStatus('mandatory')
agentIDAMCslot10 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 31), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot10.setStatus('mandatory')
valueAMCslot11 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot11.setStatus('mandatory')
serialAMCslot11 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 33), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot11.setStatus('mandatory')
agentIDAMCslot11 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 34), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot11.setStatus('mandatory')
valueAMCslot12 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot12.setStatus('mandatory')
serialAMCslot12 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 36), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot12.setStatus('mandatory')
agentIDAMCslot12 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 37), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot12.setStatus('mandatory')
valueAMCslot13 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 38), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot13.setStatus('mandatory')
serialAMCslot13 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 39), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot13.setStatus('mandatory')
agentIDAMCslot13 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 40), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot13.setStatus('mandatory')
valueAMCslot14 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 41), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot14.setStatus('mandatory')
serialAMCslot14 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 42), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot14.setStatus('mandatory')
agentIDAMCslot14 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 43), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot14.setStatus('mandatory')
valueAMCslot15 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 44), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot15.setStatus('mandatory')
serialAMCslot15 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 45), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot15.setStatus('mandatory')
agentIDAMCslot15 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 46), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot15.setStatus('mandatory')
valueAMCslot16 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 47), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot16.setStatus('mandatory')
serialAMCslot16 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 48), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot16.setStatus('mandatory')
agentIDAMCslot16 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 49), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot16.setStatus('mandatory')
valueAMCslot17 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 50), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot17.setStatus('mandatory')
serialAMCslot17 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 51), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot17.setStatus('mandatory')
agentIDAMCslot17 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 52), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot17.setStatus('mandatory')
valueAMCslot18 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 53), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("force", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: valueAMCslot18.setStatus('mandatory')
serialAMCslot18 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 54), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: serialAMCslot18.setStatus('mandatory')
agentIDAMCslot18 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 55), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentIDAMCslot18.setStatus('mandatory')
autoQuickSwapCnt = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 7, 6, 56), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("timeroff", 1), ("onehour", 2), ("oneday", 3), ("oneweek", 4)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: autoQuickSwapCnt.setStatus('mandatory')
gx2cmDiagnosticTableIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: gx2cmDiagnosticTableIndex.setStatus('mandatory')
ledTestValue = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ledTestValue.setStatus('mandatory')
bpTestCnt = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 3), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: bpTestCnt.setStatus('mandatory')
successTransSlot1 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 4), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot1.setStatus('mandatory')
successTransSlot2 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 5), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot2.setStatus('mandatory')
successTransSlot3 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 6), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot3.setStatus('mandatory')
successTransSlot4 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 7), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot4.setStatus('mandatory')
successTransSlot5 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 8), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot5.setStatus('mandatory')
successTransSlot6 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 9), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot6.setStatus('mandatory')
successTransSlot7 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 10), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot7.setStatus('mandatory')
successTransSlot8 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 11), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot8.setStatus('mandatory')
successTransSlot9 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 12), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot9.setStatus('mandatory')
successTransSlot10 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 13), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot10.setStatus('mandatory')
successTransSlot11 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 14), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot11.setStatus('mandatory')
successTransSlot12 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 15), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot12.setStatus('mandatory')
successTransSlot13 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 16), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot13.setStatus('mandatory')
successTransSlot14 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 17), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot14.setStatus('mandatory')
successTransSlot15 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 18), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot15.setStatus('mandatory')
successTransSlot16 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 19), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot16.setStatus('mandatory')
successTransSlot17 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 20), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot17.setStatus('mandatory')
successTransSlot18 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 21), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: successTransSlot18.setStatus('mandatory')
failureTransSlot1 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 22), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot1.setStatus('mandatory')
failureTransSlot2 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 23), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot2.setStatus('mandatory')
failureTransSlot3 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 24), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot3.setStatus('mandatory')
failureTransSlot4 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 25), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot4.setStatus('mandatory')
failureTransSlot5 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 26), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot5.setStatus('mandatory')
failureTransSlot6 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 27), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot6.setStatus('mandatory')
failureTransSlot7 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 28), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot7.setStatus('mandatory')
failureTransSlot8 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 29), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot8.setStatus('mandatory')
failureTransSlot9 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 30), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot9.setStatus('mandatory')
failureTransSlot10 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 31), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot10.setStatus('mandatory')
failureTransSlot11 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 32), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot11.setStatus('mandatory')
failureTransSlot12 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 33), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot12.setStatus('mandatory')
failureTransSlot13 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 34), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot13.setStatus('mandatory')
failureTransSlot14 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 35), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot14.setStatus('mandatory')
failureTransSlot15 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 36), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot15.setStatus('mandatory')
failureTransSlot16 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 37), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot16.setStatus('mandatory')
failureTransSlot17 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 38), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot17.setStatus('mandatory')
failureTransSlot18 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 39), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: failureTransSlot18.setStatus('mandatory')
fanTestMode = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 40), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fanTestMode.setStatus('mandatory')
fanControl = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 41), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fanControl.setStatus('mandatory')
relayTestMode = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 42), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: relayTestMode.setStatus('mandatory')
relayControl = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 43), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("open", 1), ("closed", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: relayControl.setStatus('mandatory')
slotPollMode = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 44), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: slotPollMode.setStatus('mandatory')
bootCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 45), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: bootCount.setStatus('mandatory')
objectTableData = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 46), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: objectTableData.setStatus('mandatory')
setSysTime = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 9, 8, 47), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: setSysTime.setStatus('mandatory')
gx2cmDownloadTableIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 10, 9, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: gx2cmDownloadTableIndex.setStatus('mandatory')
downloadValue = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 10, 9, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: downloadValue.setStatus('mandatory')
autoDownloadReset = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 10, 9, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("deactivate", 1), ("activate", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: autoDownloadReset.setStatus('mandatory')
downloadFilename = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 10, 9, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: downloadFilename.setStatus('mandatory')
downloadState = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 10, 9, 5), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: downloadState.setStatus('mandatory')
switchFwBank = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 10, 9, 6), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: switchFwBank.setStatus('mandatory')
cmTrapHistoryTableIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmTrapHistoryTableIndex.setStatus('mandatory')
netrapId = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapId.setStatus('mandatory')
netrapNetworkElemModelNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapNetworkElemModelNumber.setStatus('mandatory')
netrapNetworkElemSerialNum = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapNetworkElemSerialNum.setStatus('mandatory')
netrapPerceivedSeverity = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapPerceivedSeverity.setStatus('mandatory')
netrapNetworkElemOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapNetworkElemOperState.setStatus('mandatory')
netrapNetworkElemAlarmStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapNetworkElemAlarmStatus.setStatus('mandatory')
netrapNetworkElemAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapNetworkElemAdminState.setStatus('mandatory')
netrapNetworkElemAvailStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapNetworkElemAvailStatus.setStatus('mandatory')
netrapText = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapText.setStatus('mandatory')
netrapLastTrapTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 11), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapLastTrapTimeStamp.setStatus('mandatory')
netrapChangedObjectId = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapChangedObjectId.setStatus('mandatory')
netrapAdditionalInfoInteger1 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapAdditionalInfoInteger1.setStatus('mandatory')
netrapAdditionalInfoInteger2 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapAdditionalInfoInteger2.setStatus('mandatory')
netrapAdditionalInfoInteger3 = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapAdditionalInfoInteger3.setStatus('mandatory')
netrapChangedValueDisplayString = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 16), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapChangedValueDisplayString.setStatus('mandatory')
netrapChangedValueOID = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 17), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapChangedValueOID.setStatus('mandatory')
netrapChangedValueIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapChangedValueIpAddress.setStatus('mandatory')
netrapChangedValueInteger = MibTableColumn((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3, 11, 10, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: netrapChangedValueInteger.setStatus('mandatory')
trapCMConfigChangeInteger = NotificationType((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3) + (0,1)).setObjects(("NLSBBN-TRAPS-MIB", "trapIdentifier"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemModelNumber"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemSerialNum"), ("NLSBBN-TRAPS-MIB", "trapPerceivedSeverity"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemOperState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAlarmStatus"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAdminState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAvailStatus"), ("NLSBBN-TRAPS-MIB", "trapText"), ("NLSBBN-TRAPS-MIB", "trapChangedObjectId"), ("NLSBBN-TRAPS-MIB", "trapChangedValueInteger"), ("NLSBBN-TRAPS-MIB", "trapNETrapLastTrapTimeStamp"))
trapCMConfigChangeDisplayString = NotificationType((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3) + (0,2)).setObjects(("NLSBBN-TRAPS-MIB", "trapIdentifier"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemModelNumber"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemSerialNum"), ("NLSBBN-TRAPS-MIB", "trapPerceivedSeverity"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemOperState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAlarmStatus"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAdminState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAvailStatus"), ("NLSBBN-TRAPS-MIB", "trapText"), ("NLSBBN-TRAPS-MIB", "trapChangedObjectId"), ("NLSBBN-TRAPS-MIB", "trapChangedValueDisplayString"), ("NLSBBN-TRAPS-MIB", "trapNETrapLastTrapTimeStamp"))
trapCMModuleTempAlarm = NotificationType((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3) + (0,3)).setObjects(("NLSBBN-TRAPS-MIB", "trapIdentifier"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemModelNumber"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemSerialNum"), ("NLSBBN-TRAPS-MIB", "trapPerceivedSeverity"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemOperState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAlarmStatus"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAdminState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAvailStatus"), ("NLSBBN-TRAPS-MIB", "trapText"), ("NLSBBN-TRAPS-MIB", "trapChangedObjectId"), ("NLSBBN-TRAPS-MIB", "trapChangedValueInteger"), ("NLSBBN-TRAPS-MIB", "trapNETrapLastTrapTimeStamp"))
trapCMEEPROMAlarm = NotificationType((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3) + (0,4)).setObjects(("NLSBBN-TRAPS-MIB", "trapIdentifier"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemModelNumber"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemSerialNum"), ("NLSBBN-TRAPS-MIB", "trapPerceivedSeverity"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemOperState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAlarmStatus"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAdminState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAvailStatus"), ("NLSBBN-TRAPS-MIB", "trapText"), ("NLSBBN-TRAPS-MIB", "trapChangedObjectId"), ("NLSBBN-TRAPS-MIB", "trapChangedValueInteger"), ("NLSBBN-TRAPS-MIB", "trapNETrapLastTrapTimeStamp"))
trapCMFlashAlarm = NotificationType((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3) + (0,5)).setObjects(("NLSBBN-TRAPS-MIB", "trapIdentifier"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemModelNumber"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemSerialNum"), ("NLSBBN-TRAPS-MIB", "trapPerceivedSeverity"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemOperState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAlarmStatus"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAdminState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAvailStatus"), ("NLSBBN-TRAPS-MIB", "trapText"), ("NLSBBN-TRAPS-MIB", "trapChangedObjectId"), ("NLSBBN-TRAPS-MIB", "trapChangedValueInteger"), ("NLSBBN-TRAPS-MIB", "trapNETrapLastTrapTimeStamp"))
trapCMHardwareAlarm = NotificationType((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3) + (0,6)).setObjects(("NLSBBN-TRAPS-MIB", "trapIdentifier"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemModelNumber"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemSerialNum"), ("NLSBBN-TRAPS-MIB", "trapPerceivedSeverity"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemOperState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAlarmStatus"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAdminState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAvailStatus"), ("NLSBBN-TRAPS-MIB", "trapText"), ("NLSBBN-TRAPS-MIB", "trapChangedObjectId"), ("NLSBBN-TRAPS-MIB", "trapChangedValueInteger"), ("NLSBBN-TRAPS-MIB", "trapNETrapLastTrapTimeStamp"))
trapCMInitEEPROMAlarm = NotificationType((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3) + (0,7)).setObjects(("NLSBBN-TRAPS-MIB", "trapIdentifier"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemModelNumber"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemSerialNum"), ("NLSBBN-TRAPS-MIB", "trapPerceivedSeverity"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemOperState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAlarmStatus"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAdminState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAvailStatus"), ("NLSBBN-TRAPS-MIB", "trapText"), ("NLSBBN-TRAPS-MIB", "trapChangedObjectId"), ("NLSBBN-TRAPS-MIB", "trapChangedValueInteger"), ("NLSBBN-TRAPS-MIB", "trapNETrapLastTrapTimeStamp"))
trapCMBootAlarm = NotificationType((1, 3, 6, 1, 4, 1, 1166, 6, 1, 2, 3) + (0,8)).setObjects(("NLSBBN-TRAPS-MIB", "trapIdentifier"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemModelNumber"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemSerialNum"), ("NLSBBN-TRAPS-MIB", "trapPerceivedSeverity"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemOperState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAlarmStatus"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAdminState"), ("NLSBBN-TRAPS-MIB", "trapNetworkElemAvailStatus"), ("NLSBBN-TRAPS-MIB", "trapText"), ("NLSBBN-TRAPS-MIB", "trapChangedObjectId"), ("NLSBBN-TRAPS-MIB", "trapChangedValueInteger"), ("NLSBBN-TRAPS-MIB", "trapNETrapLastTrapTimeStamp"))
mibBuilder.exportSymbols("OMNI-gx2CM-MIB", successTransSlot18=successTransSlot18, valueISDNPingTimeout=valueISDNPingTimeout, valueAMCslot11=valueAMCslot11, failureTransSlot4=failureTransSlot4, gx2cmNetworkTableIndex=gx2cmNetworkTableIndex, successTransSlot13=successTransSlot13, failureTransSlot13=failureTransSlot13, failureTransSlot16=failureTransSlot16, trapCMFlashAlarm=trapCMFlashAlarm, successTransSlot8=successTransSlot8, netrapChangedValueDisplayString=netrapChangedValueDisplayString, labelTrap2Destination=labelTrap2Destination, gx2cmStatusTable=gx2cmStatusTable, alarmStateModTemp=alarmStateModTemp, relayControl=relayControl, successTransSlot15=successTransSlot15, netrapNetworkElemModelNumber=netrapNetworkElemModelNumber, enumRemoteLocal=enumRemoteLocal, gx2cmDescriptor=gx2cmDescriptor, agentIDAMCslot12=agentIDAMCslot12, valueLocalEthIPAdd=valueLocalEthIPAdd, valueNetworkEthAdd=valueNetworkEthAdd, netrapNetworkElemSerialNum=netrapNetworkElemSerialNum, valueIdShelf=valueIdShelf, gx2cmDigitalEntry=gx2cmDigitalEntry, netrapId=netrapId, gx2cmDigitalTableIndex=gx2cmDigitalTableIndex, serialAMCslot18=serialAMCslot18, bootCount=bootCount, factoryCRC=factoryCRC, stateFlagResetAlarm=stateFlagResetAlarm, labelTFTPserver=labelTFTPserver, trapCMConfigChangeInteger=trapCMConfigChangeInteger, agentIDAMCslot1=agentIDAMCslot1, enumIdShelf=enumIdShelf, minorHighModTemp=minorHighModTemp, successTransSlot2=successTransSlot2, flashPrgCnt0=flashPrgCnt0, autoDownloadReset=autoDownloadReset, trapCMInitEEPROMAlarm=trapCMInitEEPROMAlarm, labelTrap5Destination=labelTrap5Destination, majorLowModTemp=majorLowModTemp, gx2cmSecurityEntry=gx2cmSecurityEntry, gx2cmAMCTable=gx2cmAMCTable, currentValueModTemp=currentValueModTemp, successTransSlot1=successTransSlot1, serialAMCslot4=serialAMCslot4, serialAMCslot8=serialAMCslot8, valueResetSlot=valueResetSlot, enumSecurityMode=enumSecurityMode, successTransSlot10=successTransSlot10, switchFwBank=switchFwBank, stateOperatorChgString=stateOperatorChgString, agentIDAMCslot15=agentIDAMCslot15, hourMeter=hourMeter, stateBootStatus=stateBootStatus, valueTrap3Destination=valueTrap3Destination, valueISDNBackoffTimer=valueISDNBackoffTimer, stateFlagIdShelf=stateFlagIdShelf, labelReadOnlyChgString=labelReadOnlyChgString, netrapNetworkElemAvailStatus=netrapNetworkElemAvailStatus, gx2cmDiagnosticTableIndex=gx2cmDiagnosticTableIndex, failureTransSlot2=failureTransSlot2, labelTrap3Destination=labelTrap3Destination, gx2cmDownloadTableIndex=gx2cmDownloadTableIndex, autoQuickSwapCnt=autoQuickSwapCnt, netrapLastTrapTimeStamp=netrapLastTrapTimeStamp, labelLocalOnlyChgString=labelLocalOnlyChgString, valueAMCslot4=valueAMCslot4, labelRemoteLocal=labelRemoteLocal, serialAMCslot2=serialAMCslot2, agentIDAMCslot11=agentIDAMCslot11, labelISDNTrapTimeout=labelISDNTrapTimeout, valueISDNTrapTimeout=valueISDNTrapTimeout, valueAMCslot17=valueAMCslot17, valueAMCslot16=valueAMCslot16, failureTransSlot7=failureTransSlot7, trapCMConfigChangeDisplayString=trapCMConfigChangeDisplayString, valueTrap2Destination=valueTrap2Destination, gx2cmAMCEntry=gx2cmAMCEntry, valueAMCslot3=valueAMCslot3, valueResetAlarm=valueResetAlarm, labelModTemp=labelModTemp, valueReadOnlyChgString=valueReadOnlyChgString, valueAMCslot7=valueAMCslot7, valueAMCslot6=valueAMCslot6, labelResetAlarm=labelResetAlarm, calculateCRC=calculateCRC, Float=Float, stateShelfAlarm=stateShelfAlarm, stateFactoryChgString=stateFactoryChgString, serialAMCslot9=serialAMCslot9, agentIDAMCslot13=agentIDAMCslot13, successTransSlot3=successTransSlot3, failureTransSlot15=failureTransSlot15, downloadValue=downloadValue, netrapPerceivedSeverity=netrapPerceivedSeverity, serialAMCslot17=serialAMCslot17, stateLocalOnlyChgString=stateLocalOnlyChgString, labelFactoryChgString=labelFactoryChgString, agentIDAMCslot3=agentIDAMCslot3, netrapNetworkElemOperState=netrapNetworkElemOperState, gx2cmStatusEntry=gx2cmStatusEntry, gx2cmNetworkTable=gx2cmNetworkTable, netrapChangedValueInteger=netrapChangedValueInteger, valueAMCslot14=valueAMCslot14, valueLocalEthMask=valueLocalEthMask, minValueModTemp=minValueModTemp, gx2cmDiagnosticTable=gx2cmDiagnosticTable, labelISDNMode=labelISDNMode, labelOperatorChgString=labelOperatorChgString, valueAMCslot13=valueAMCslot13, stateFlagModTemp=stateFlagModTemp, stateFlagRemoteLocal=stateFlagRemoteLocal, stateRemoteOnlyChgString=stateRemoteOnlyChgString, valueNetworkEthMask=valueNetworkEthMask, valueTrapDestination=valueTrapDestination, valuePassword=valuePassword, gx2cmSecurityTable=gx2cmSecurityTable, serialAMCslot7=serialAMCslot7, setSysTime=setSysTime, netrapNetworkElemAlarmStatus=netrapNetworkElemAlarmStatus, gx2cmTableIndex=gx2cmTableIndex, labelFlashStatus=labelFlashStatus, enumResetAlarm=enumResetAlarm, agentIDAMCslot10=agentIDAMCslot10, agentIDAMCslot17=agentIDAMCslot17, stateSecurityMode=stateSecurityMode, cmTrapHistoryEntry=cmTrapHistoryEntry, agentIDAMCslot7=agentIDAMCslot7, labelDataCrc=labelDataCrc, labelAlmLimCrc=labelAlmLimCrc, valueISDNMode=valueISDNMode, netrapText=netrapText, valueAMCslot15=valueAMCslot15, labelBootStatus=labelBootStatus, stateReadOnlyChgString=stateReadOnlyChgString, failureTransSlot9=failureTransSlot9, valueAMCslot1=valueAMCslot1, gx2cmNetworkEntry=gx2cmNetworkEntry, valueAMCslot9=valueAMCslot9, trapCMEEPROMAlarm=trapCMEEPROMAlarm, valueTFTPserver=valueTFTPserver, valueAMCslot12=valueAMCslot12, failureTransSlot17=failureTransSlot17, serialAMCslot10=serialAMCslot10, labelPassword=labelPassword, serialAMCslot13=serialAMCslot13, labelIdShelf=labelIdShelf, valueBootStatus=valueBootStatus, gx2cmStatusTableIndex=gx2cmStatusTableIndex, bootStatusByte=bootStatusByte, valueAMCslot2=valueAMCslot2, gx2cmFactoryEntry=gx2cmFactoryEntry, maxValueModTemp=maxValueModTemp, labelRemoteOnlyChgString=labelRemoteOnlyChgString, agentIDAMCslot18=agentIDAMCslot18, valueLocalOnlyChgString=valueLocalOnlyChgString, flashBank0=flashBank0, failureTransSlot6=failureTransSlot6, valueSecurityMode=valueSecurityMode, valueGateWayIPAdd=valueGateWayIPAdd, bank0CRC=bank0CRC, valueFlashStatus=valueFlashStatus, valueAMCslot18=valueAMCslot18, gx2cmDigitalTable=gx2cmDigitalTable, valueTrap5Destination=valueTrap5Destination, serialAMCslot5=serialAMCslot5, stateDataCrc=stateDataCrc, labelTrap4Destination=labelTrap4Destination, gx2cmFactoryTableIndex=gx2cmFactoryTableIndex, serialAMCslot16=serialAMCslot16, ledTestValue=ledTestValue, failureTransSlot3=failureTransSlot3, valueAMCslot8=valueAMCslot8, failureTransSlot5=failureTransSlot5, failureTransSlot10=failureTransSlot10, localMacAdd=localMacAdd, valueRemoteOnlyChgString=valueRemoteOnlyChgString, bank1CRC=bank1CRC, prgEEPROMByte=prgEEPROMByte, gx2cmDownloadEntry=gx2cmDownloadEntry, labelNetworkEthAdd=labelNetworkEthAdd, failureTransSlot14=failureTransSlot14, successTransSlot14=successTransSlot14, valueRemoteLocal=valueRemoteLocal, majorHighModTemp=majorHighModTemp, valueAMCslot5=valueAMCslot5, netrapNetworkElemAdminState=netrapNetworkElemAdminState, agentIDAMCslot5=agentIDAMCslot5, serialAMCslot12=serialAMCslot12, netrapAdditionalInfoInteger1=netrapAdditionalInfoInteger1, agentIDAMCslot4=agentIDAMCslot4, labelTrapDestination=labelTrapDestination, labelResetSlot=labelResetSlot, labelShelfAlarm=labelShelfAlarm, cmTrapHistoryTable=cmTrapHistoryTable, downloadFilename=downloadFilename, labelLocalEthIPAdd=labelLocalEthIPAdd, failureTransSlot18=failureTransSlot18, successTransSlot7=successTransSlot7, valueTrap4Destination=valueTrap4Destination, stateFlashStatus=stateFlashStatus, labelNetworkEthMask=labelNetworkEthMask, serialAMCslot6=serialAMCslot6, successTransSlot11=successTransSlot11, stateResetSlot=stateResetSlot, labelShelfSerialNum=labelShelfSerialNum, successTransSlot6=successTransSlot6, enumResetSlot=enumResetSlot, agentIDAMCslot6=agentIDAMCslot6, valueDataCrc=valueDataCrc, labelSecurityMode=labelSecurityMode, agentIDAMCslot14=agentIDAMCslot14, failureTransSlot11=failureTransSlot11, uomModTemp=uomModTemp, relayTestMode=relayTestMode, agentIDAMCslot9=agentIDAMCslot9, cmTrapHistoryTableIndex=cmTrapHistoryTableIndex, flashPrgCnt1=flashPrgCnt1, labelLocalEthMask=labelLocalEthMask, successTransSlot9=successTransSlot9, netrapAdditionalInfoInteger2=netrapAdditionalInfoInteger2, gx2cmFactoryTable=gx2cmFactoryTable, valueShelfAlarm=valueShelfAlarm, statePassword=statePassword, serialAMCslot1=serialAMCslot1, objectTableData=objectTableData, bootControlByte=bootControlByte, gx2cmAnalogTable=gx2cmAnalogTable, gx2cmDownloadTable=gx2cmDownloadTable, stateAlmLimCrc=stateAlmLimCrc, valueISDNModemIPAddress=valueISDNModemIPAddress, successTransSlot12=successTransSlot12, failureTransSlot12=failureTransSlot12, labelISDNPingTimeout=labelISDNPingTimeout, downloadState=downloadState, netrapChangedValueOID=netrapChangedValueOID, agentIDAMCslot16=agentIDAMCslot16, netWorkMacAdd=netWorkMacAdd, valueAlmLimCrc=valueAlmLimCrc, labelISDNModemIPAddress=labelISDNModemIPAddress, successTransSlot17=successTransSlot17, serialAMCslot14=serialAMCslot14, netrapChangedObjectId=netrapChangedObjectId, netrapAdditionalInfoInteger3=netrapAdditionalInfoInteger3, flashBank1=flashBank1, trapCMHardwareAlarm=trapCMHardwareAlarm, bpTestCnt=bpTestCnt, gx2cmAMCTableIndex=gx2cmAMCTableIndex, successTransSlot16=successTransSlot16, trapCMModuleTempAlarm=trapCMModuleTempAlarm, valueFactoryChgString=valueFactoryChgString, fanTestMode=fanTestMode)
mibBuilder.exportSymbols("OMNI-gx2CM-MIB", gx2cmSecurityTableIndex=gx2cmSecurityTableIndex, minorLowModTemp=minorLowModTemp, serialAMCslot3=serialAMCslot3, valueOperatorChgString=valueOperatorChgString, netrapChangedValueIpAddress=netrapChangedValueIpAddress, agentIDAMCslot2=agentIDAMCslot2, labelGateWayIPAdd=labelGateWayIPAdd, trapCMBootAlarm=trapCMBootAlarm, agentIDAMCslot8=agentIDAMCslot8, slotPollMode=slotPollMode, successTransSlot4=successTransSlot4, gx2cmAnalogEntry=gx2cmAnalogEntry, gx2cmDiagnosticEntry=gx2cmDiagnosticEntry, valueShelfSerialNum=valueShelfSerialNum, labelISDNBackoffTimer=labelISDNBackoffTimer, valueAMCslot10=valueAMCslot10, serialAMCslot11=serialAMCslot11, serialAMCslot15=serialAMCslot15, successTransSlot5=successTransSlot5, fanControl=fanControl, failureTransSlot8=failureTransSlot8, failureTransSlot1=failureTransSlot1)
|
# -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class OracleDBConfigRedoLogGroupConf(object):
"""Implementation of the 'OracleDBConfig_RedoLogGroupConf' model.
GROUP1 : {DST1/CH1.log, DST2/CH1.log}
GROUP2 : {DST1/CH2.log, DST2/CH2.log}
GROUP3 : {DST1/CH3.log, DST2/CH3.log}
Attributes:
group_member_vec (list of string): List of members of this redo log
group.
member_prefix (string): Log member name prefix.
num_groups (int): Number of redo log groups.
size_mb (int): Size of the member in MB.
"""
# Create a mapping from Model property names to API property names
_names = {
"group_member_vec":'groupMemberVec',
"member_prefix":'memberPrefix',
"num_groups":'numGroups',
"size_mb":'sizeMb'
}
def __init__(self,
group_member_vec=None,
member_prefix=None,
num_groups=None,
size_mb=None):
"""Constructor for the OracleDBConfigRedoLogGroupConf class"""
# Initialize members of the class
self.group_member_vec = group_member_vec
self.member_prefix = member_prefix
self.num_groups = num_groups
self.size_mb = size_mb
@classmethod
def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object as
obtained from the deserialization of the server's response. The keys
MUST match property names in the API description.
Returns:
object: An instance of this structure class.
"""
if dictionary is None:
return None
# Extract variables from the dictionary
group_member_vec = dictionary.get('groupMemberVec')
member_prefix = dictionary.get('memberPrefix')
num_groups = dictionary.get('numGroups')
size_mb = dictionary.get('sizeMb')
# Return an object of this model
return cls(group_member_vec,
member_prefix,
num_groups,
size_mb)
|
str = input().strip()
n = int(input())
def check(s):
if s=='a'or s=='e' or s=='i' or s=='o' or s=='u':
return True
return False
def non_vowels(str,n):
i,index =0,0
start = 0
res = 0
non_vowels = 0
disturb_flag = True
while index<len(str):
if disturb_flag:
if not check(str[index]):
non_vowels +=1
else:
if not check(str[start]) and check(str[index]):
non_vowels -=1
elif not check(str[index]):
non_vowels +=1
if non_vowels<n:
disturb_flag = True
start +=1
if disturb_flag and non_vowels>=n:
if res==0:
res = index +1
else:
res = res+1
disturb_flag = False
index +=1
if disturb_flag:
return -1
return res
res = non_vowels(str,n)
print(res) |
low = int(input())
high = int(input())
x = int(input())
#first from bottom
num = low
while num <=high:
tverrsum = sum([int(i) for i in str(num)])
if tverrsum == x:
print(num)
break
num+=1
#first from top
num = high
while num >= low:
tverrsum = sum([int(i) for i in str(num)])
if tverrsum == x:
print(num)
break
num-=1
|
PLAYGROUND = """
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8/>
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, minimal-ui">
<title>GraphQL Playground</title>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/[email protected]/build/static/css/index.css" />
<link rel="shortcut icon" href="//cdn.jsdelivr.net/npm/[email protected]/build/favicon.png" />
<script src="//cdn.jsdelivr.net/npm/[email protected]/build/static/js/middleware.js"></script>
</head>
<body>
<div id="root">
<style>
body {
background-color: rgb(23, 42, 58);
font-family: Open Sans, sans-serif;
height: 90vh;
}
#root {
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.loading {
font-size: 32px;
font-weight: 200;
color: rgba(255, 255, 255, .6);
margin-left: 20px;
}
img {
width: 78px;
height: 78px;
}
.title {
font-weight: 400;
}
</style>
<img src='//cdn.jsdelivr.net/npm/graphql-playground-react/build/logo.png' alt=''>
<div class="loading"> Loading
<span class="title">GraphQL Playground</span>
</div>
</div>
<script>window.addEventListener('load', function (event) {
GraphQLPlayground.init(document.getElementById('root'), {
// options as 'endpoint' belong here
})
})</script>
</body>
</html>
"""
|
print("Python Program to print the sum and average of natural numbers!")
limit = int(input("Enter the limit of numbers:"))
sumOfNumbers = (limit * (limit + 1)) / 2
averageOfNumbers = sumOfNumbers / limit
print("The sum of", limit, "natural numbers is", sumOfNumbers)
print("The Average of", limit, "natural number is", averageOfNumbers) |
instructions = [['addi', '$v0', '$zero', '0'], ['lw', '$t9', '0', '$a0'], ['addi', '$v0', '$v0', '1'], ['sw', '$t9', '$0', '$a1'], ['addi', '$a0', '$a0', '4'], ['addi', '$a1', '$a1', '4']]
MIPS_FORMAT = {
'Mnemonic': ['add','addi','addiu','addu','and','andi','beq','blez','bne','bgtz','div','divu','j','jal','jr','lb','lbu','lhu','lui','lw','mfhi','mthi','mflo','mtlo','mfc0','mult','multu','nor','xor','or','ori','sb','sh','slt','slti','sltiu','sltu','sll','srl','sra','sub','subu','sw'],
'Type': ['R','I','I','R','R','I','I','I','I','I','R','R','J','J','R','I','I','I','I','I','R','R','R','R','R','R','R','R','R','R','I','I','I','R','I','I','R','R','R','R','R','R','I'],
'Opcode': ['000000','001000','001001','000000','000000','001100','000100','000110','000101','000111','000000','000000','000010','000011','000000','100000','100100','100101','001111','100011','000000','000000','000000','000000','010000','000000','000000','000000','000000','000000','001101','101000','101001','000000','001010','001011','000000','000000','000000','000000','000000','000000','101011'],
'Funct': ['100000','NA','NA','100001','100100','NA','NA','NA','NA','NA','011010','011011','NA','NA','001000','NA','NA','NA','NA','NA','010000','010001','010010','010011','NA','011000','011001','100111','100110','100101','NA','NA','NA','101010','NA','NA','101011','000000','000010','000011','100010','100011','NA']}
MIPS_REGISTERS = {'$0': '00000', '$zero': '00000', '$at': '00001', '$v0': '00010', '$v1': '00011', '$a0': '00100', '$a1': '00101', '$a2': '00110', '$a3': '00111', '$t0': '01000', '$t1': '01001', '$t2': '01010', '$t3': '01011', '$t4': '01100', '$t5': '01101', '$t6': '01110', '$t7': '01111', '$s0': '10000', '$s1': '10001', '$s2': '10010', '$s3': '10011', '$s4': '10100', '$s5': '10101', '$s6': '10110', '$s7': '10111', '$t8': '11000', '$t9': '11001', '$k0': '11010', '$k1': '11011', '$gp': '11100','$sp': '11101', '$fp': '11110', '$ra': '11111'}
for i in range (len(instructions)):
if (instructions[i][0] in MIPS_FORMAT['Mnemonic']):
index = MIPS_FORMAT['Mnemonic'].index(instructions[i][0])
if(MIPS_FORMAT['Type'][index] == 'R'):
opcode = MIPS_FORMAT['Opcode'][index]
rs_register = instructions[i][2]
rt_register = instructions[i][3]
rd_register = instructions[i][1]
shamt = '00000'
func_code = MIPS_FORMAT['Funct'][index]
print('______________________________________\n| Assembled MIPS ' + MIPS_FORMAT['Type'][index] + '-type Machine Code | \n\n⦿ decimal:', int(opcode,2), int(MIPS_REGISTERS[rs_register],2), int(MIPS_REGISTERS[rt_register],2), int(MIPS_REGISTERS[rd_register],2), int(shamt,2), int(func_code,2), '\n⦿ binary:', opcode, MIPS_REGISTERS[rs_register], MIPS_REGISTERS[rt_register], MIPS_REGISTERS[rd_register], shamt, func_code, '\n⦿ hexadecimal:',hex(int(opcode + MIPS_REGISTERS[rs_register] + MIPS_REGISTERS[rt_register] + MIPS_REGISTERS[rd_register] + shamt + func_code,2)))
elif(MIPS_FORMAT['Type'][index] == 'I'):
opcode = MIPS_FORMAT['Opcode'][index]
if ('$' not in instructions[i][2]):
rs_register = bin(int(instructions[i][2],16))
rs_register = rs_register.replace('0b', '')
else:
rs_register = MIPS_REGISTERS[instructions[i][2]]
if len(rs_register) != 5:
rs_register = '{:>05d}'.format(int(rs_register))
if ('$' not in instructions[i][1]):
rt_register = bin(int(instructions[i][1],16))
rt_register = rt_register.replace('0b', '')
else:
rt_register = MIPS_REGISTERS[instructions[i][1]]
if len(rt_register) != 5:
rt_register = '{:>05d}'.format(int(rt_register))
if ('$' not in instructions[i][3]):
immediate = bin(int(instructions[i][3],16))
immediate = immediate.replace('0b', '')
else:
immediate = MIPS_REGISTERS[instructions[i][3]]
if len(immediate) != 16:
immediate = '{:>016d}'.format(int(immediate))
print('______________________________________\n| Assembled MIPS ' + MIPS_FORMAT['Type'][index] + '-type Machine Code | \n\n⦿ decimal:', int(opcode,2), int(rs_register,2), int(rt_register,2), int(immediate,2), '\n⦿ binary:', opcode, rs_register, rt_register, immediate, '\n⦿ hexadecimal:',hex(int(opcode + rs_register + rt_register + immediate,2)))
elif(MIPS_FORMAT['Type'][index] == 'J'):
opcode = MIPS_FORMAT['Opcode'][index]
immediate = bin(int(instructions[i][1],16))
immediate = immediate.replace('0b', '')
if len(immediate) != 26:
immediate = '{:>026d}'.format(int(immediate))
print('______________________________________\n| Assembled MIPS ' + MIPS_FORMAT['Type'][index] + '-type Machine Code | \n\n⦿ decimal:', int(opcode,2), int(immediate,2), '\n⦿ binary:', opcode, immediate, '\n⦿ hexadecimal:',hex(int(opcode + immediate,2))) |
"""This module was written by Gerd Woetzel:
http://mail.python.org/pipermail/python-list/2005-January/261304.html
This module is derived from Modules/rotormodule.c and translated
into Python. I have appended the Copyright by Lance Ellinghouse
below. The rotor module has been removed from the Python 2.4
distribution because
the rotor module uses an insecure algorithm and is deprecated.
==============================================================
Of course, this does still hold. However, I think this module might
be used and adapted for demonstration purposes and might help some
poor users who have encrypted (or obfuscated) some old stuff with
the rotor module and have no access to older Python versions any
more.
Documentation can be found in
Python Library Reference, Guido van Rossum, Fred L. Drake, Jr., editor,
PythonLabs, Release 2.3.4 May 20, 2004
<http://www.python.org/doc/2.3.4/lib/module-rotor.html>
#####################################################################
Copyright 1994 by Lance Ellinghouse,
Cathedral City, California Republic, United States of America.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Lance Ellinghouse
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE BE LIABLE FOR ANY SPECIAL,
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#####################################################################
"""
class newrotor(object):
def __init__(self, key, n_rotors=6):
self.n_rotors = n_rotors
self.setkey(key)
def setkey(self, key):
self.key = key
self.rotors = None
self.positions = [None, None]
def encrypt(self, buf):
# Reset (encrypt) positions and encryptmore
self.positions[0] = None
return self.cryptmore(buf, 0)
def encryptmore(self, buf):
return self.cryptmore(buf, 0)
def decrypt(self, buf):
# Reset decrypt positions and decryptmore
self.positions[1] = None
return self.cryptmore(buf, 1)
def decryptmore(self, buf):
return self.cryptmore(buf, 1)
def cryptmore(self, buf, do_decrypt):
size, nr, rotors, pos = self.get_rotors(do_decrypt)
outbuf = []
append = outbuf.append
for c in map(ord, buf):
if do_decrypt:
# Apply decrypt rotors and xor in reverse order
for i in xrange(nr-1,-1,-1):
c = pos[i] ^ rotors[i][c]
else:
# Apply xor and ecrypt rotors
for i in xrange(nr):
c = rotors[i][c ^ pos[i]]
append(c)
# Advance rotors, i.e. add the (fixed) rotor increments to the
# variable rotor positions with carry.
# Note: In the C-implementation, the result of the carry addition
# was stored to an "unsigned char". Hence the next carry
# is lost if pos[i] == size-1 and pnew >= size.
# Masking with 0xff simulates this behavior.
#
pnew = 0 # (pnew >= size) works as "carry bit"
for i in xrange(nr):
pnew = ((pos[i] + (pnew >= size)) & 0xff) + rotors[i][size]
pos[i] = pnew % size
return ''.join(map(chr, outbuf))
def get_rotors(self, do_decrypt):
# Return a tuple (size, nr, rotors, positions) where
# - size is the rotor size (== 256, because of 8-bit bytes)
# - nr is the number of rotors.
# - rotors is a tuple of nr encrypt or nr decrypt rotors
# for do_decrypt == 0 or do_decrypt == 1 respectively.
# - postions is a list of nr "rotor positions".
#
# The rotors represent the static aspect of the rotor machine which
# is initially computed from key and fixed during en/decryption.
# A rotor is a random permutation of range(size) extended
# by an "increment value" in range(size).
#
# The followng statements hold for a tuple of encrypt rotors E and
# and the corresponding tuple of decrypt rotors D.
#
# D[i][E[i][j]] == j for i in range(nr) for j in range(size)
#
# E[i][D[i][j]] == j for i in range(nr) for j in range(size)
#
# This means that the corresponding rotors E[i] and D[i] are
# inverse permutations.
# The increments are equal for the corresponding encrypt and
# decrypt rotors and have an odd value:
#
# D[i][size] == E[i][size] and E[i][size] == 1 mod 2 and
# 0 < E[i][size] < size for i in range(nr)
#
# The position vector represents the dynamic aspect.
# It changes after each en/decrypted character (the rotors
# are "advanced"). The initial position vector is also computed
# from the key
#
nr = self.n_rotors
rotors = self.rotors
positions = self.positions[do_decrypt]
if positions is None:
if rotors:
positions = list(rotors[3])
else:
# Generate identity permutation for 8-bit bytes plus an
# (unused) increment value
self.size = size = 256
id_rotor = range(size+1)
# Generate nr "random" initial positions and "random"
# en/decrypt rotors from id_rotor.
#
rand = random_func(self.key)
E = []
D = []
positions = []
for i in xrange(nr):
i = size
positions.append(rand(i))
erotor = id_rotor[:]
drotor = id_rotor[:]
drotor[i] = erotor[i] = 1 + 2*rand(i/2) # increment
while i > 1:
r = rand(i)
i -= 1
er = erotor[r]
erotor[r] = erotor[i]
erotor[i] = er
drotor[er] = i
drotor[erotor[0]] = 0
E.append(tuple(erotor))
D.append(tuple(drotor))
self.rotors = rotors = (
tuple(E), tuple(D), size, tuple(positions))
self.positions[do_decrypt] = positions
return rotors[2], nr, rotors[do_decrypt], positions
def random_func(key):
# Generate a random number generator that is "seeded" from key.
# This algorithm is copied from Python2.3 randommodule.c.
#
mask = 0xffff
x=995
y=576
z=767
for c in map(ord, key):
x = (((x<<3 | x>>13) + c) & mask)
y = (((y<<3 | y>>13) ^ c) & mask)
z = (((z<<3 | z>>13) - c) & mask)
# Emulate (unintended?) cast to short
maxpos = mask >> 1
mask += 1
if x > maxpos: x -= mask
if y > maxpos: y -= mask
if z > maxpos: z -= mask
y |= 1 # avoid very bad seed, why not for x and z too?
# Oh, dear, for compatibility, we must evaluate the first seed transition
# the hard way, later it becomes much simpler
x = 171 * (x % 177) - 2 * (x/177)
y = 172 * (y % 176) - 35 * (y/176)
z = 170 * (z % 178) - 63 * (z/178)
if x < 0: x += 30269
if y < 0: y += 30307
if z < 0: z += 30323
# At least all values are > 0 by now but may be greater than expected ..
def rand(n, seed=[(x, y, z)]):
# Return a random number 0 <= r < n
#
x, y, z = seed[0]
seed[0] = ((171*x) % 30269, (172*y) % 30307, (170*z) % 30323)
return int((x/30269.0 + y/30307.0 + z/30323.0) * n) % n
# Original code was like this:
# from math import floor
# val = x/30269.0 + y/30307.0 + z/30323.0
# val = val - floor(val)
# if val >= 1.0:
# val = 0.0
# n = int(val*n) % n
return rand
|
_base_ = [
'../_base_/datasets/s3dis_seg-3d-13class.py',
'../_base_/models/pointnet2_msg.py',
'../_base_/schedules/seg_cosine_50e.py', '../_base_/default_runtime.py'
]
# data settings
data = dict(samples_per_gpu=16)
evaluation = dict(interval=2)
# model settings
model = dict(
backbone=dict(in_channels=9), # [xyz, rgb, normalized_xyz]
decode_head=dict(
num_classes=13, ignore_index=13,
loss_decode=dict(class_weight=None)), # S3DIS doesn't use class_weight
test_cfg=dict(
num_points=4096,
block_size=1.0,
sample_rate=0.5,
use_normalized_coord=True,
batch_size=24))
# runtime settings
checkpoint_config = dict(interval=2)
# PointNet2-MSG needs longer training time than PointNet2-SSG
runner = dict(type='EpochBasedRunner', max_epochs=80)
|
string = str (input())
string_copy = string
new_string = string.replace(string[0],string[-1])
new_string = string_copy.replace(string_copy[-1],string_copy[0])
print(new_string)
|
#!/usr/bin/env python
"""
_WMCore_
Core libraries for Workload Management Packages
"""
__version__ = '1.5.5.pre5'
__all__ = []
|
"""
Draft Material.
Cannabis Data Science Meetup Group
Copyright (c) 2022 Cannlytics
Authors: Keegan Skeate <[email protected]>
Created: 1/11/2022
Updated: 1/19/2022
License: MIT License <https://opensource.org/licenses/MIT>
"""
# # Define lab datasets.
# lab_datasets = ['LabResults_0', 'LabResults_1', 'LabResults_2']
# # Specify lab result fields.
# lab_result_fields = {
# 'global_id' : 'string',
# 'mme_id' : 'category',
# 'intermediate_type' : 'category',
# 'status' : 'category',
# 'inventory_id' : 'string',
# 'cannabinoid_status' : 'category',
# 'cannabinoid_d9_thca_percent': 'float16',
# 'cannabinoid_d9_thca_mg_g' : 'float16',
# 'cannabinoid_d9_thc_percent' : 'float16',
# 'cannabinoid_d9_thc_mg_g' : 'float16',
# 'cannabinoid_d8_thc_percent' : 'float16',
# 'cannabinoid_d8_thc_mg_g' : 'float16',
# 'cannabinoid_cbd_percent' : 'float16',
# 'cannabinoid_cbd_mg_g' : 'float16',
# 'cannabinoid_cbda_percent' : 'float16',
# 'cannabinoid_cbda_mg_g' : 'float16',
# 'cannabinoid_cbdv_percent' : 'float16',
# 'cannabinoid_cbg_percent' : 'float16',
# 'cannabinoid_cbg_mg_g' : 'float16',
# 'solvent_status' : 'category',
# 'solvent_acetone_ppm' : 'float16',
# 'solvent_benzene_ppm' : 'float16',
# 'solvent_butanes_ppm' : 'float16',
# 'solvent_chloroform_ppm' : 'float16',
# 'solvent_cyclohexane_ppm' : 'float16',
# 'solvent_dichloromethane_ppm' : 'float16',
# 'solvent_ethyl_acetate_ppm' : 'float16',
# 'solvent_heptane_ppm' : 'float16',
# 'solvent_hexanes_ppm' : 'float16',
# 'solvent_isopropanol_ppm' : 'float16',
# 'solvent_methanol_ppm' : 'float16',
# 'solvent_pentanes_ppm' : 'float16',
# 'solvent_propane_ppm' : 'float16',
# 'solvent_toluene_ppm' : 'float16',
# 'solvent_xylene_ppm' : 'float16',
# #'foreign_matter' : 'bool',
# #'microbial_status' : 'category',
# #'microbial_bile_tolerant_cfu_g' : 'float16',
# #'microbial_pathogenic_e_coli_cfu_g' : 'float16',
# #'microbial_salmonella_cfu_g' : 'float16',
# #'moisture_content_percent' : 'float16',
# #'moisture_content_water_activity_rate' : 'float16',
# #'mycotoxin_status' : 'category',
# #'mycotoxin_aflatoxins_ppb' : 'float16',
# #'mycotoxin_ochratoxin_ppb' : 'float16',
# #'thc_percent' : 'float16',
# #'notes' : 'float32',
# # 'testing_status' : 'category',
# # 'type' : 'category',
# #'batch_id' : 'string',
# #'parent_lab_result_id' : 'string',
# #'og_parent_lab_result_id' : 'string',
# #'copied_from_lab_id' : 'string',
# #'external_id' : 'string',
# #'lab_user_id' : 'string',
# #'user_id' : 'string',
# #'cannabinoid_editor' : 'float32',
# #'microbial_editor' : 'string',
# #'mycotoxin_editor' : 'string',
# #'solvent_editor' : 'string',
# }
# lab_result_date_fields = ['created_at']
# lab_result_columns = list(lab_result_fields.keys()) + lab_result_date_fields
# # Read in the lab result data.
# shards = []
# for dataset in lab_datasets:
# lab_data = pd.read_csv(
# f'../.datasets/{dataset}.csv',
# sep='\t',
# encoding='utf-16',
# usecols=lab_result_columns,
# dtype=lab_result_fields,
# parse_dates=lab_result_date_fields,
# nrows=1000,
# )
# shards.append(lab_data)
# del lab_data
# gc.collect()
# # Aggregate lab data.
# lab_results = pd.concat(shards)
# del shards
# gc.collect()
# # Sort the data, removing null observations.
# lab_results.dropna(subset=['global_id'], inplace=True)
# lab_results.index = lab_results['global_id']
# lab_results = lab_results.sort_index()
# # Define a lab ID for each observation and remove attested lab results.
# lab_results['lab_id'] = lab_results['global_id'].map(lambda x: x[x.find('WAL'):x.find('.')])
# lab_results = lab_results.loc[lab_results.lab_id != '']
#------------------------------------------------------------------------------
# Combine with licensee data.
#------------------------------------------------------------------------------
# # Specify the licensee fields.
# licensee_fields = {
# 'global_id' : 'string',
# 'name': 'string',
# 'type': 'string',
# # 'code': 'string',
# # 'address1': 'string',
# # 'address2': 'string',
# # 'city': 'string',
# # 'state_code': 'string',
# # 'postal_code': 'string',
# # 'country_code': 'string',
# # 'phone': 'string',
# # 'external_id': 'string',
# # 'certificate_number': 'string',
# # 'is_live': 'bool',
# # 'suspended': 'bool',
# }
# licensee_date_fields = [
# 'created_at', # No records if issued before 2018-02-21.
# # 'updated_at',
# # 'deleted_at',
# # 'expired_at',
# ]
# licensee_columns = list(licensee_fields.keys()) + licensee_date_fields
# # # Read in the licensee data.
# licensees = pd.read_csv(
# '../.datasets/Licensees_0.csv',
# sep='\t',
# encoding='utf-16',
# usecols=licensee_columns,
# dtype=licensee_fields,
# parse_dates=licensee_date_fields,
# )
# # Combine the data sets.
# licensees.rename(columns={
# 'global_id': 'licensee_id',
# 'created_at': 'license_created_at',
# }, inplace=True)
# del licensees['created_at']
# data = pd.merge(
# left=lab_results,
# right=licensees,
# how='left',
# left_on='mme_id',
# right_on='licensee_id'
# )
#------------------------------------------------------------------------------
# Optional: Combine with inventory data.
#------------------------------------------------------------------------------
# # Specify the inventories fields.
# inventory_fields = {
# 'global_id' : 'string',
# 'strain_id': 'string',
# 'inventory_type_id': 'string',
# # 'mme_id': 'string',
# # 'user_id': 'string',
# # 'external_id': 'string',
# # 'area_id': 'string',
# # 'batch_id': 'string',
# # 'lab_result_id': 'string',
# # 'lab_retest_id': 'string',
# # 'is_initial_inventory': 'bool',
# # 'created_by_mme_id': 'string',
# # 'qty': 'float16',
# # 'uom': 'string',
# # 'additives': 'string',
# # 'serving_num': 'float16',
# # 'sent_for_testing': 'bool',
# # 'medically_compliant': 'string',
# # 'legacy_id': 'string',
# # 'lab_results_attested': 'int',
# # 'global_original_id': 'string',
# }
# inventory_date_fields = [
# # 'created_at', # No records if issued before 2018-02-21.
# # 'updated_at',
# # 'deleted_at',
# # 'inventory_created_at',
# # 'inventory_packaged_at',
# # 'lab_results_date',
# ]
# inventory_columns = list(inventory_fields.keys()) + inventory_date_fields
# # # Read in the licensee data.
# inventories = pd.read_csv(
# '../.datasets/Inventories_0.csv',
# sep='\t',
# encoding='utf-16',
# nrows=1000,
# usecols=inventory_columns,
# dtype=inventory_fields,
# parse_dates=inventory_date_fields,
# )
# print(inventories)
# TODO: Match with inventories (by inventory_id -> global_id) data to get:
# TODO: 1. Read in a chunk of inventories data.
# fp = open('../.datasets/Inventories_0.csv')
# row_count = 0
# pos = {0: 0}
# line = fp.readline()
# while line:
# row_count += 1
# pos[row_count] = fp.tell()
# line = fp.readline()
# fp.close()
# print('Lines:')
# chunksize = row_count // 30
# wanted_plts = [1,5,10,15,20,25,30]
# for i in wanted_plts:
# fp.seek(pos[i*chunksize]) # this will bring you to the first line of the desired chunk
# obj = pd.read_csv(
# fp,
# chunksize=chunksize,
# sep='\t',
# encoding='utf-16',
# usecols=licensee_columns,
# dtype=licensee_column_types,
# parse_dates=licensee_date_columns,
# # names=[!!<column names you have>!!]
# ) # read your chunk lazily
# # df = obj.get_chunk() # convert to DataFrame object
# print(df.head())
# # plt.plot(df["Variable"]) # do something
# fp.close() # Don't forget to close the file when finished.
# TODO: 2. Process the chunk:
# Iterate over lab results, finding matching inventory.
# for index, row in lab_results.iterrows():
# inventory_id = row['inventory_id]
# result_inventory = inventories.loc[inventories['global_id'] == inventory_id]
# Identify global_strain_id, global_inventory_type_id
# labResults[0]['strain_name']?
# Identify additives?
# Add up qty, packed_qty, cost, value, uom?
# Set the new variables in the lab_result observation.
# TODO: Save all of the aggregated data!
# lab_results.to_csv('./data/enhanced_lab_results.csv')
# Use global_batch_id to get strain_name?
# Optional: Get inventory type ID e.g WAxxx.TYxxx to get used_butane
# - name, description, ingredients, allergens, contains
# - net_weight, packed_qty, cost, value, uom
# - weight_per_unit_in_grams
# Get global_strain_id -> Match with strain data global_id to get:
# - name
#------------------------------------------------------------------------------
# SCRAP: Parsing inventories.
#------------------------------------------------------------------------------
# Assign values to lab results.
# for index, row in inventories.iterrows():
# s = lab_results.loc[lab_results.global_for_inventory_id == row.global_id]
# if len(s):
# lab_results.loc[row.global_id , 'inventory_type_id'] = row.qty
# lab_results.loc[row.global_id , 'qty'] = row.qty
# lab_results.loc[row.global_id , 'uom'] = row.qty
# print('Matched', s[0].global_for_inventory_id, 'to', row.global_id)
# break
# SCRAP: Parsing inventory types.
# # Define inventory type fields.
# inventory_type_rows = 57_016_229
# inventory_type_fields = {
# 'global_id': 'string',
# 'name': 'string',
# }
# # Read inventory type names in chunks.
# chunk_size = 1_000_000
# read_rows = 0
# skiprows = None
# inventory_names = []
# while read_rows < inventory_type_rows:
# if read_rows >= 5_000_000:
# break
# if read_rows:
# skiprows = [i for i in range(1, read_rows)]
# # Read in inventory types chunk.
# inventory_types = pd.read_csv(
# '../.datasets/InventoryTypes_0.csv',
# sep='\t',
# encoding='utf-16',
# usecols=list(inventory_type_fields.keys()),
# dtype=inventory_type_fields,
# index_col='global_id',
# skiprows=skiprows,
# nrows=chunk_size,
# )
# inventory_types.rename(columns={'name': 'inventory_name'}, inplace=True)
# # Keep the necessary fields.
# inventory_names.append(inventory_types)
# del inventory_types
# gc.collect()
# read_rows += chunk_size
# print('Read:', read_rows)
# # Create a small file of inventory type names.
# inventory_type_names = pd.concat(inventory_names)
# inventory_type_names.to_csv('../.datasets/inventory_type_names.csv')
# SCRAP: Get file size.
# def get_blocks(files, size=65536):
# """Get a block of a file by the given size."""
# while True:
# block = files.read(size)
# if not block: break
# yield block
# def get_number_of_rows(file_name, encoding='utf-16', errors='ignore'):
# """
# Read the number of lines in a large file.
# Credit: glglgl, SU3 <https://stackoverflow.com/a/9631635/5021266>
# License: CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0/>
# """
# with open(file_name, 'r', encoding=encoding, errors=errors) as f:
# count = sum(bl.count('\n') for bl in get_blocks(f))
# print('Number of rows:', count)
# return count
# SCRAP: Reading in chunks of data.
# class ChunkReader:
# """
# Credit: Valentino <https://stackoverflow.com/a/56408765>
# License: CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0/>
# """
# def __init__(self, filename, chunksize, n):
# self.fo = open(filename)
# self.chs = chunksize
# self.skiplines = self.chs * n
# self.header = next(self.fo)
# def getchunk(self):
# ll = list(islice(self.fo, self.chs))
# if len(ll) == 0:
# raise StopIteration
# dd = list(islice(self.fo, self.skiplines))
# return self.header + ''.join(ll)
# def __iter__(self):
# return self
# def __next__(self):
# return io.StringIO(self.getchunk())
# def close(self):
# self.fo.close()
# def __del__(self):
# self.fo.close()
# import pandas as pd
# chunksize = 1000
# file = '../.datasets/Licensees_0.csv'
# # Specify the licensee fields
# licensee_column_types = {
# 'global_id' : 'string',
# 'name': 'string',
# 'type': 'string',
# # 'code': 'string',
# # 'address1': 'string',
# # 'address2': 'string',
# # 'city': 'string',
# # 'state_code': 'string',
# # 'postal_code': 'string',
# # 'country_code': 'string',
# # 'phone': 'string',
# # 'external_id': 'string',
# # 'certificate_number': 'string',
# # 'is_live': 'bool',
# # 'suspended': 'bool',
# }
# # Specify the date columns.
# licensee_date_columns = [
# 'created_at', # No records if issued before 2018-02-21.
# # 'updated_at',
# # 'deleted_at',
# # 'expired_at',
# ]
# # Specify all of the columns.
# licensee_columns = list(licensee_column_types.keys()) + licensee_date_columns
# reader = ChunkReader(file, chunksize, 1)
# for dfst in reader:
# df = pd.read_csv(
# dfst,
# sep='\t',
# encoding='utf-16',
# usecols=licensee_columns,
# dtype=licensee_column_types,
# parse_dates=licensee_date_columns,
# )
# print(df.head()) #here I print to stdout, you can plot
# reader.close()
# SCRAP: Untried but useful looking way to read chunks of data.
# import pandas
# from functools import reduce
# def get_counts(chunk):
# voters_street = chunk[
# "Residential Address Street Name "]
# return voters_street.value_counts()
# def add(previous_result, new_result):
# return previous_result.add(new_result, fill_value=0)
# # MapReduce structure:
# chunks = pandas.read_csv("voters.csv", chunksize=1000)
# processed_chunks = map(get_counts, chunks)
# result = reduce(add, processed_chunks)
# result.sort_values(ascending=False, inplace=True)
# print(result)
# # Open enhanced lab results.
# enhanced_lab_results = pd.read_csv(
# '../.datasets/enhanced_lab_results.csv',
# # index_col='global_id',
# dtype={
# 'global_id' : 'string',
# 'global_for_inventory_id': 'string',
# 'lab_id': 'string',
# 'inventory_type_id': 'string',
# 'strain_id': 'string',
# }
# )
# Combine lab results merged with licensee data with enhanced lab results.
# lab_results = pd.merge(
# left=lab_results,
# right=enhanced_lab_results,
# how='left',
# left_on='global_id',
# right_on='global_id',
# )
# Read in the enhanced lab results data.
# enhanced_lab_results = pd.read_csv(
# '../.datasets/lab_results_with_strain_names.csv',
# # index_col='global_id',
# dtype={
# 'global_id' : 'string',
# 'global_for_inventory_id': 'string',
# 'lab_id': 'string',
# 'inventory_type_id': 'string',
# 'strain_id': 'string',
# }
# )
|
class SetupForm(QtWidgets.QWidget):
global model
model = SetupInformation()
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setObjectName("setupDialog")
# self.resize(1754, 3000)
self.model = model |
"""
COLOURS
"""
C_TEAL = 0, 128, 128
C_RED = 255, 0, 0
C_PINK = 255, 100, 100
C_GREEN = 0, 255, 0
C_BLUE = 0, 0, 255
C_WHITE = 255, 255, 255
C_BLACK = 0, 0, 0
C_GOLD = 255, 195, 0
"""
Questions and Answers
"""
QNA_PATH = 'QnA.txt'
with open(QNA_PATH) as f:
data = f.read().split('\n')
getting_question = True
QUESTIONS_AND_ANSWERS = []
current_set = {}
for line in data:
if line.startswith('#'):
if 'q' in current_set:
QUESTIONS_AND_ANSWERS.append(current_set.copy())
current_set['q'] = line.strip()[1:]
current_set['ans'] = []
else:
current_set['ans'].append(line)
if 'q' in current_set:
QUESTIONS_AND_ANSWERS.append(current_set.copy())
"""
FONTS
"""
# Welcome Screen
CONFIG_WELCOME_TEXT = {
'position': (400, 100), #Center coordinates
'font': 'comicsans',
'fontSize': 60,
'text': "Welcome to RC4 Feud!!",
'colour': C_GREEN,
}
CONFIG_START_BUTTON = {
'position': (250, 500, 300, 50), # (topleft coordinates) x, y, width, height
'inactiveColour': C_BLUE,
'hoverColour': C_RED,
'textColour': C_WHITE,
'radius': 20,
}
# Instruction Screen
CONFIG_INSTRUCTION_TITLE = {
'position': (400, 100), # Center coordinates
'font': 'jokerman',
'fontSize': 60,
'text': "INSTRUCTIONS",
'colour': C_PINK,
}
CONFIG_NEXT_BUTTON = {
'position': (250, 500, 300, 50), # (topleft coordinates) x, y, width, height
'inactiveColour': C_BLUE,
'hoverColour': C_RED,
'textColour': C_WHITE,
'radius': 20,
'text': 'Start',
}
INSTRUCTIONS = [
"1. This game will last for 2 minutes",
"2. You can guess the most popular answer as many times as you want",
"3. Guessing a more popular answer will earn you more points!",
"4. The points will be collated and awarded at the end of the game",
]
CONFIG_INSTRUCTIONS_TEXT = {
'firstTextPosition': (100, 150), # Center coordinates
'spaceBetweenLines': 50,
'font': 'arial',
'fontSize': 20,
'colour': C_WHITE,
}
# Game Screen
CONFIG_TIMER = {
'position': (400, 70), # Center coordinates
'font': 'calibri',
'fontSize': 100,
'text': "INSTRUCTIONS",
'colour': C_PINK,
}
CONFIG_QUESTION_TEXT = {
'position': (400, 450), # Center coordinates
'font': 'comicsans',
'fontSize': 50,
'colour': C_WHITE,
}
CONFIG_ANSWER_TEXT = {
'font': 'comicsans',
'fontSize': 40,
'colour': C_PINK,
}
CONFIG_INPUT_BOX = {
'position': (250, 500, 300, 50), # (topleft coordinates) x, y, width, height
'radius': 10,
'font': 'calibri',
'fontSize': 30,
'textColour': C_BLACK,
'borderColour': C_BLUE,
'borderThickness': 5,
}
# End Screen
CONFIG_END_TITLE = {
'position': (400, 200), # Center coordinates
'font': 'jokerman',
'fontSize': 60,
'colour': C_BLUE,
'text': 'Thanks for playing!!'
}
CONFIG_FINAL_SCORE = {
'position': (400, 300), # Center coordinates
'font': 'arialbold',
'fontSize': 50,
'colour': C_RED,
}
CONFIG_FINAL_SCORE_NUM = {
'position': (400, 370), # Center coordinates
'font': 'calibri',
'fontSize': 100,
'colour': C_WHITE,
}
|
"""
Copyright (C) 2017 Espressive Inc
"""
|
def request(flow):
real_github_token = 'REPLACE_ME!'
auth_header = flow.request.headers.get('Authorization')
if auth_header:
flow.request.headers['Authorization'] = auth_header.replace('__GITHUB_TOKEN_PLACEHOLDER__', real_github_token)
def response(flow):
recording_proxy = 'http://host.docker.internal:8080'
link_header = flow.response.headers.get('Link')
if link_header:
flow.response.headers['Link'] = link_header.replace('https://api.github.com', recording_proxy)
flow.response.content = flow.response.content.replace(b'https://api.github.com', recording_proxy.encode('ascii'))
|
class TokenMeta:
"""This class holds some meta data about a token from the text held by a Doc object.
This allows to create a Token object when needed.
"""
def __init__(self, text: str, space_after: bool):
"""Initializes a TokenMeta object
Args:
text (str): The token's text.
space_after (bool): Whether the token is followed by a single white
space (True) or not (False).
"""
self.text = text
self.space_after = space_after
# A dictionary to hold custom attributes
self.attributes: Dict[str, List[str]] = dict()
|
TimesTable = int(input("Please Choose A Times Table To Be Quizzed On;\n1)One Times Tables\n2)Two Times Tables\n3)Three Times Tables\n4)Four Times Tables\n5)Five Times Tables\n6)Six Times Tables\n7)Seven Times Tables\n8)Eight Times Tables\n9)Nine Times Tables\n10)Ten Times Tables\n11)Eleven Times Tables\n12)Twelve Times Tables\nPlease Choose One To Start: "))
No1 = 1
ans = 0
for x in range (12):
ans = No1 * TimesTable
print("\n",No1,"x",TimesTable,"=",ans)
No1 = No1 + 1
|
with open('text.txt', 'r', encoding='utf-8') as n:
line = n.readlines()
for index, value in enumerate(line, 1):
num = len(value.split())
print(f'Строка - {index}, число слов - {num}') |
nums = (input("")).split()
n = int(nums[0])
m = int(nums[1])
l= int(nums[2])
list1 = []
for i in range(n):
request = (input("")).split()
request[1] = float(request[1])
request[2] = int(request[2])
request[3] = int(request[3])
request.append(i)
list1.append(request)
list1.sort()
list1 = sorted(list1, key=lambda a_entry: a_entry[1])
taken = []
for i in range(m+1):
taken.append(False)
if(l==1):
for i in range(n):
if(list1[i][2]==1):
if(list1[i][3]==-1):
list1[i][2]=0
continue
if(list1[i][3]>m):
list1[i][3]=-1
elif(list1[i][3]!=0):
taken[list1[i][3]]=True
index = 1
for i in range(n):
if(list1[i][2]==0):
if(index>m):
list1[i][3]=-1
continue
if(list1[i][3]!=0):
check =True
while(taken[index]):
index+=1
if(index>m):
check =False
break
if(check):
taken[index]=True
list1[i][3]=index
index+=1
else:
list1[i][3] = -1
else:
index = 1
for i in range(n):
if(list1[i][3]==-1):
list1[i][2] = 0
if(index>m):
list1[i][3]=-1
elif(list1[i][3]!=0):
list1[i][3]=index
index+=1
# print(list1)
for i in range(n):
print(list1[i][0]+" " + str(list1[i][1])+" " + str(list1[i][2])+" " + str(list1[i][3]))
# lst1 = sorted(lst, key=lambda a_entry: a_entry[1])
# print(lst1)
|
"""
Settings,
As for the database, look for ../sql_orm/database.py
"""
#DEBUG/TEST MODE: This allows HTTP connection instead of HTTPS
TEST_MODE = True
API_PORT = 8000
# These are used only if the TEST_MODE is disabled
SSL_CERT_LOCATION = "path"
SSL_KEY_LOCATION = "path"
SSL_CA_LOCATION = "path"
# JWT access settings: Secret key is randomly generated on the first instance and saved to the database (see main)
# The algorithm HS256 should not be changed!! Token expiration should be the same on every server
ALGORITHM = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES = 30
# How often the server checks for expired ssh authkeys
CLEANING_LADY_INTERVAL_SECONDS = 60
# SSH For this particular server! Please refer to what you can actually do: If you are using sish, please use the
# version on github.com/santomet as it is currently the one that supports blocking different ports than the ones allowed
PORT_LIST = list(range(9000, 9101))
SSH_AUTH_KEYS_FILE_PATH = "/opt/INSTALL/sish/deploy/pubkeys/authorized_keys"
SSH_PORT = "2222"
SSH_SERVER = "" # If kept empty, agents will use the same IP/DOMAIN that they use to connect the API
SSH_SERVER_PUBLIC_FINGERPRINT = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIADBJiJyOZq7Goad/J4IQZaCx70cUjVcMSoIWyzBlKtc"
SSH_SERVER_USERNAME = "" # A classic SSH server needs this, SISH does not |
capitals = ["Amsterdam", "Andorra la Vella", "Athens", "Berlin", "Bratislava", "Brussels", "Dublin", "Helsinki",
"Lisbon", "Ljubljana", "Luxembourg", "Madrid", "Monaco", "Nicosia", "Paris", "Riga", "Rome", "San Marino",
"Tallinn", "Valletta", "Vatican City", "Vienna", "Vilnius"]
# len_cities = len(capitals)
# print("length of capital arrays = ",len_cities)
countries = ["Netherlands", "Andorra", "Greece", "Germany", "Slovakia", "Belgium", "Ireland", "Finland", "Portugal",
"Slovenia", "Luxembourg", "Spain", "Monaco", "Cyprus", "France", "Latvia", "Italy", "San Marino",
"Estonia", "Malta", "Vatican City", "Austria", "Lithuania"]
# print(capitals.index("Berlin"))
print("Rules: All countries and capitals have to be capitalized!\n"
"If no correct answers apply enter 'none'\n")
capitals_input = input("Name a capital city of a eurozone country: ")
if capitals_input in capitals:
print("Well done!")
countries_input = input(f"Which country is {capitals_input} the capital of? ")
if countries_input in countries:
if capitals.index(capitals_input) == countries.index(countries_input):
print("That's correct")
neighbors = {
"Netherlands": ["Germany", "Belgium"],
"Andorra": ["Spain", "France"],
"Greece": ["none"],
"Germany": ["France", "Austria", "Netherlands", "Belgium", "Luxembourg"],
"Slovakia": ["Austria"],
"Belgium": ["Netherlands", "Luxembourg", "Germany", "France"],
"Ireland": ["none"],
"Finland": ["none"],
"Portugal": ["Spain"],
"Slovenia": ["Austria", "Italy"],
"Luxembourg": ["Belgium", "Germany", "France"],
"Spain": ["Portugal", "Andorra", "France"],
"Monaco": ["France"],
"Cyprus": ["none"],
"France": ["Germany", "Spain", "Andorra", "Italy", "Luxembourg", "Monaco", "Belgium"],
"Latvia": ["Estonia", "Lithuania"],
"Italy": ["San Marino", "Vatican City", "France", "Slovenia", "Austria"],
"San Marino": ["Italy"],
"Estonia": ["Latvia"],
"Malta": ["none"],
"Vatican City": ["Italy"],
"Austria": ["Italy", "Slovenia", "Slovakia", "Germany"],
"Lithuania": ["Latvia"],
}
neighbor_input = input(f"Can you name any of {countries_input}'s neighboring countries that also use the "
f"Euro? (excluding maritime borders) ")
if neighbor_input in (neighbors[countries_input]):
print("That is correct!")
capitals_input_2 = input(f"Do you also know {neighbor_input}'s capital? ")
if capitals_input_2 in capitals:
if capitals.index(capitals_input_2) == countries.index(neighbor_input):
print("Well done!")
else:
print("That's not the capital.")
else:
print("That's not a neighboring country!")
else:
print("Wrong country!")
else:
print("Country is not on the list!")
elif capitals_input == str("no"):
print("haiyaaa, why not?")
else:
print("Wrong!")
|
CONFIG = {
'http': {
'port': 3000
},
'authentication': {
'salt_rounds': 12,
'secret': '!!! CHANGE ME !!!',
'issuer': 'example.com',
'token_expiry': '24h',
'admin_primary_email': 'admin@localhost',
'admin_default_password': 'admin'
},
'authorization': {
'default_roles': ['user:read', 'user:write', 'public:read'],
'approved_roles': ['posts:write', 'comment:write']
}
}
|
#!/usr/bin/env python
# encoding: utf-8
"""
unique_path_ii.py
Created by Shengwei on 2014-07-28.
"""
# https://oj.leetcode.com/problems/unique-paths-ii/
# tags: medium, matrix, path, dp
"""
Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths would there be?
An obstacle and empty space is marked as 1 and 0 respectively in the grid.
For example,
There is one obstacle in the middle of a 3x3 grid as illustrated below.
[
[0,0,0],
[0,1,0],
[0,0,0]
]
The total number of unique paths is 2.
Note: m and n will be at most 100.
"""
# Improvoment: only need O(min(m,n)) space
class Solution:
# @param obstacleGrid, a list of lists of integers
# @return an integer
def uniquePathsWithObstacles(self, obstacleGrid):
m, n = len(obstacleGrid), len(obstacleGrid[0])
matrix = [[0] * n for _ in range(m - 1)]
last_row = [0] * n
for index in range(-1, -n - 1, -1):
if obstacleGrid[-1][index]:
break
last_row[index] = 1
matrix.append(last_row)
for i in range(-2, -m - 1, -1):
for j in range(-1, -n - 1, -1):
if obstacleGrid[i][j]:
continue
down = right = 0
if i + 1 < 0:
down = matrix[i + 1][j]
if j + 1 < 0:
right = matrix[i][j + 1]
matrix[i][j] = down + right
return matrix[0][0]
|
class FilePath:
regex = '[0-9]{4}'
def to_python(self, value):
return int(value)
|
# Time: O(n)
# Space: O(1)
class Solution(object):
def sumZero(self, n):
"""
:type n: int
:rtype: List[int]
"""
return [i for i in range(-(n//2), n//2+1) if not (i == 0 and n%2 == 0)]
|
test = {'name': 'q7',
'points': 8,
'suites': [{'cases': [{'code': '>>> t = Tree (1 , [ Tree (2) , Tree (1 , [ '
'Tree (2 , [ Tree (3 , [ Tree (0)])])])])\n'
'\n'
'>>> longest_seq( t) # 1 -> 2 -> 3\n'
'3\n'
'\n'
'>>> t = Tree (1)\n'
'\n'
'>>> longest_seq( t)\n'
'1\n'}],
'scored': True,
'setup': 'from q7 import *',
'type': 'doctest'}]} |
#Desafio 51 com while
print('\033[1;32m{:=^20}'.format('PA'))
v = int(input('VALOR BASE DA PROGRESSÃO: '))
r = int(input('VALOR DA RAZÃO DA PROGRESSÃO: '))
s = v
decimo = v + (10 - 1) * r
while v != decimo + r:
print('{}'.format(v), end = ' -> ')
v += r
print('END') |
x = [input() for x in range(10)]
m = 0
m_index = 0
for i in range(0,10,2):
if int(x[i]) > m:
m = int(x[i])
m_index = i
print(f"a maioe nota foi de {x[m_index+1]} com {x[m_index]} pontos") |
""" Auteur = Frédéric Castel
Date : Avril 2020
Projet : MOOC Python 3 - France Université Numérique
Objectif:
Écrire une fonction signature qui reçoit un paramètre identite. Ce paramètre est un couple (tuple de deux composantes)
dont la première composante représente un nom et la seconde un prénom.
Cette fonction doit retourner la chaîne de caractères formée du prénom suivi du nom, séparés par une espace.
Exemples:
signature(('de Saint-Exupéry', 'Antoine')) doit retourner : 'Antoine de Saint-Exupéry'
Consignes:
Dans cet exercice, il vous est demandé d’écrire seulement la fonction signature. Le code que vous soumettez à UpyLaB doit donc comporter
uniquement la définition de cette fonction, et ne fait en particulier aucun appel à input ou à print.
Vous pouvez supposer que l’argument passé à la fonction est valide (couple de deux chaînes de caractères).
"""
def signature(identite):
res = identite[-1] + " " + identite[0]
return res
print(signature(('Hoarau', 'Sébastien')))
|
"""
There are two sorted arrays nums1 and nums2 of size m and n respectively.
Find the median of the two sorted arrays.
The overall run time complexity should be O(log (m+n)).
You may assume nums1 and nums2 cannot be both empty.
Example 1:
nums1 = [1, 3]
nums2 = [2]
The median is 2.0
Example 2:
nums1 = [1, 2]
nums2 = [3, 4]
The median is (2 + 3)/2 = 2.5
"""
#Difficulty: Hard
#2085 / 2085 test cases passed.
#Runtime: 84 ms
#Memory Usage: 14.1 MB
#Runtime: 84 ms, faster than 97.56% of Python3 online submissions for Median of Two Sorted Arrays.
#Memory Usage: 14.1 MB, less than 5.71% of Python3 online submissions for Median of Two Sorted Arrays.
class Solution:
#def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
def findMedianSortedArrays(nums1, nums2):
n = sorted(nums1+nums2)
return (n[(len(n)//2)-1]+n[len(n)//2])/2 if len(n)%2 == 0 else n[len(n)//2]
#Tests
nums1 = [1, 2]
nums2 = [3, 4]
print(Solution.findMedianSortedArrays(nums1, nums2),'2,5')
|
class Commands:
def __init__(self, arguments_commandline: list):
commands_allowed = ['compile', 'clean']
if len(arguments_commandline) > 1:
command = arguments_commandline[1]
if not command in commands_allowed:
raise Exception("You give an invalid command")
self.arguments_commandline = arguments_commandline
def is_command_given(self):
return len(self.arguments_commandline) > 1
def get_command_given(self):
return self.arguments_commandline[1]
|
## Definición de la clase Nota
class Nota():
def __init__(self, cedula, nombre, nota):
self.cedula = cedula
self.nombre = nombre
self.nota = nota
## Métodos get y set correspondientes
def get_nota(self):
return self.nota
def set_nota(self, nota):
self.nota = nota
def get_cedula(self):
return self.cedula
def set_cedula(self, cedula):
self.cedula = cedula
def get_nombre(self):
return self.nombre
def set_nombre(self, nombre):
self.nombre = nombre
def __repr__(self):
return self.cedula+" "+self.nombre+" "+self.nota
## Definición de la clase Grupo
class Grupo():
def __init__(self, nombre, salon, notas):
self.nombre = nombre
self.salon = salon
self.notas = notas
def __repr__ (self):
return self.nombre +"\n"+ self.salon +"\n"+ str(self.notas)
## Función de clase que crea un grupo y carga las notas desde un archivo
def cargar(nombre_archivo, nombre_grupo, salon):
archivo = open(nombre_archivo)
lista_notas = []
for linea in archivo:
datos = linea.strip().split(",")
nota = Nota(datos[0], datos[1], datos[2])
lista_notas.append(nota)
archivo.close()
grupo = Grupo(nombre_grupo, salon, lista_notas)
return grupo
## Función de clase que dada una lista de objetos Nota, graba un archivo con los nombres y nota de los alumnos que aprobaron.
def grabar(notas):
archivo = open("C:\\Temp\\ResultadosP1.txt", "w") ##CREAR EL ARCHIVO PARA QUE FUNCIONE
for obj in notas:
if int(obj.get_nota()) >= 61:
archivo.write(obj.get_nombre()+","+obj.get_nota()+"\n")
archivo.close()
grupo1 = Grupo.cargar("C:\\Temp\\notas.txt", "grupo 1", "s1")
print(grupo1)
for nota in grupo1.notas:
print(nota)
Grupo.grabar(grupo1.notas)
|
"""
Base information for using R in BuildPacks.
Keeping this in r.py would lead to cyclic imports.
"""
# Via https://rstudio.com/products/rstudio/download-server/debian-ubuntu/
RSTUDIO_URL = "https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.2.5001-amd64.deb"
# This is MD5, because that is what RStudio download page provides!
RSTUDIO_CHECKSUM = "d33881b9ab786c09556c410e7dc477de"
# Via https://www.rstudio.com/products/shiny/download-server/
SHINY_URL = "https://download3.rstudio.org/ubuntu-14.04/x86_64/shiny-server-1.5.12.933-amd64.deb"
SHINY_CHECKSUM = "9aeef6613e7f58f21c97a4600921340e"
# Version of MRAN to pull devtools from.
DEVTOOLS_VERSION = "2018-02-01"
# IRKernel version - specified as a tag in the IRKernel repository
IRKERNEL_VERSION = "1.0.2"
def rstudio_base_scripts():
"""Base steps to install RStudio and shiny-server."""
return [
(
"root",
# Install RStudio!
r"""
curl --silent --location --fail {rstudio_url} > /tmp/rstudio.deb && \
echo '{rstudio_checksum} /tmp/rstudio.deb' | md5sum -c - && \
apt-get update && \
apt install -y /tmp/rstudio.deb && \
rm /tmp/rstudio.deb && \
apt-get -qq purge && \
apt-get -qq clean && \
rm -rf /var/lib/apt/lists/*
""".format(
rstudio_url=RSTUDIO_URL, rstudio_checksum=RSTUDIO_CHECKSUM
),
),
(
"root",
# Install Shiny Server!
r"""
curl --silent --location --fail {url} > {deb} && \
echo '{checksum} {deb}' | md5sum -c - && \
dpkg -i {deb} && \
rm {deb}
""".format(
url=SHINY_URL, checksum=SHINY_CHECKSUM, deb="/tmp/shiny.deb"
),
),
(
"${NB_USER}",
# Install nbrsessionproxy
r"""
pip install --no-cache-dir jupyter-server-proxy==1.3.2 && \
pip install --no-cache-dir https://github.com/jupyterhub/jupyter-rsession-proxy/archive/d5efed5455870556fc414f30871d0feca675a4b4.zip && \
jupyter serverextension enable jupyter_server_proxy --sys-prefix && \
jupyter nbextension install --py jupyter_server_proxy --sys-prefix && \
jupyter nbextension enable --py jupyter_server_proxy --sys-prefix
""",
),
(
# Not all of these locations are configurable; so we make sure
# they exist and have the correct permissions
"root",
r"""
install -o ${NB_USER} -g ${NB_USER} -d /var/log/shiny-server && \
install -o ${NB_USER} -g ${NB_USER} -d /var/lib/shiny-server && \
install -o ${NB_USER} -g ${NB_USER} /dev/null /var/log/shiny-server.log && \
install -o ${NB_USER} -g ${NB_USER} /dev/null /var/run/shiny-server.pid
""",
),
]
|
def _map_int(*args):
"""Convert each element to an int"""
return list(map(_int, _flatten(args)))
|
class MyClass(object):
"""This is a test class."""
# Python has no real concept of private elements.
"""Default class initializer"""
# Every method, included in the class definition passes the object in question as its first parameter.
# The word 'self' is used for this parameter (usage of self is actually by convention).
def __init__(self, prop1 = None):
self.prop1 = prop1
def getProp1(self):
return self.prop1
def setProp1(self, value):
self.prop1 = value
@property
def prop2(self):
"""A profoundly important string."""
return self._prop2
@prop2.setter
def prop2(self, value):
self._prop2 = value
def myFunc(self, param1):
"""This is a test function."""
print(param1)
class MyDerivedClass(MyClass):
def extraMethod():
print('Child Class!')
instance1 = MyClass()
instance1.myFunc('Message')
print(instance1.getProp1())
instance1.prop2 = "String!"
instance2 = MyDerivedClass("First Value")
print(instance2.getProp1())
instance2.setProp1('New Value')
print(instance2.getProp1())
# Python uses the C3 linearization algorithm to determine the order in which to resolve class attributes,
# including methods. This is known as the Method Resolution Order (MRO).
# As as a result, it supports multiple inheritance. |
class ResourceVersionStatus(Enum,IComparable,IFormattable,IConvertible):
"""
An enum indicating whether a resource is current or out of date.
enum ResourceVersionStatus,values: Current (0),OutOfDate (1),Unknown (2)
"""
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __format__(self,*args):
""" __format__(formattable: IFormattable,format: str) -> str """
pass
def __ge__(self,*args):
pass
def __gt__(self,*args):
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self,*args):
pass
def __lt__(self,*args):
pass
def __ne__(self,*args):
pass
def __reduce_ex__(self,*args):
pass
def __str__(self,*args):
pass
Current=None
OutOfDate=None
Unknown=None
value__=None
|
size(200, 400)
path = BezierPath()
path.polygon((80, 28), (50, 146), (146, 152), (172, 78))
with savedState():
clipPath(path)
scale(200/512)
image("../images/drawbot.png", (0, 0))
translate(0, 200)
with savedState():
scale(200/512)
image("../images/drawbot.png", (0, 0))
|
with open("input.txt", "r") as input_file:
lines = input_file.readlines()
reports = [int(line, 2) for line in lines]
counts = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for report in reports:
i = 0
num_of_bits = len(counts)
while i < num_of_bits:
counts[num_of_bits-1-i] += report >> i & 1
i += 1
gamma_string = ""
epsilon_string = ""
for count in counts:
if count > len(lines) / 2:
gamma_string += "1"
epsilon_string += "0"
else:
gamma_string += "0"
epsilon_string += "1"
gamma = int(gamma_string, 2)
epsilon = int(epsilon_string, 2)
power = gamma * epsilon
print(gamma, bin(epsilon), power)
|
'''
Determine whether an integer is a palindrome. Do this without extra space.
Could negative integers be palindromes? (ie, -1)
If you are thinking of converting the integer to string, note the restriction of using extra space.
You could also try reversing an integer. However, if you have solved the problem "Reverse Integer", you know that the reversed integer might overflow. How would you handle such case?
There is a more generic way of solving this problem.
'''
class Solution(object):
def isPalindrome(self, x):
"""
:type x: int
:rtype: bool
"""
if x < 0:
return False
div = 1
while x / div >= 10:
div *= 10
while x > 0:
l = x // div
r = x % 10
if l != r:
return False
x %= div
x //= 10
div /= 100
return True
if __name__ == "__main__":
assert Solution().isPalindrome(123) == False
assert Solution().isPalindrome(12321) == True
assert Solution().isPalindrome(-121) == False
|
class Template:
model_owner = "model_owner"
detail_view = "detail_view"
detail_view_u = "detail_view_u"
detail_view_d = "detail_view_d"
detail_view_ud = "detail_view_ud"
all_objects_view = "all_objects_view"
filter_objects_view = "filter_objects_view"
user_register_view = "user_register_view"
user_profile_view = "user_profile_view"
user_profile_detail_view = "user_profile_detail_view" |
#Write a function called num_factors. num_factors should
#have one parameter, an integer. num_factors should count
#how many factors the number has and return that count as
#an integer
#
#A number is a factor of another number if it divides
#evenly into that number. For example, 3 is a factor of 6,
#but 4 is not. As such, all factors will be less than the
#number itself.
#
#Do not count 1 or the number itself in your factor count.
#For example, 6 should have 2 factors: 2 and 3. Do not
#count 1 and 6. You may assume the number will be less than
#1000.
#Add your code here!
def num_factors( num ):
count = 0
for i in range(2,num):
if num % i == 0:
count += 1
return count
#Below are some lines of code that will test your function.
#You can change the value of the variable(s) to test your
#function with different inputs.
#
#If your function works correctly, this will originally
#print: 0, 2, 0, 6, 6, each on their own line.
print(num_factors(5))
print(num_factors(6))
print(num_factors(97))
print(num_factors(105))
print(num_factors(999))
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def apply_fn_to_list_items_in_dict(dictionary, fn, **kwargs):
"""
Given a dictionary with items that are lists, applies the given function to each
item in each list and return an updated version of the dictionary.
:param dictionary: the dictionary to update.
:param fn: the function to apply.
:param **kwargs: variable keyworded arguments to run fn with
:returns: an updated version of the dictionary.
"""
updated_dictionary = {}
for key, items in dictionary.items():
updated_items = []
for item in items:
updated_item = fn(item, **kwargs)
updated_items.append(updated_item)
updated_dictionary[key] = updated_items
return updated_dictionary |
#
# Created on Sat Apr 25 2020
#
# Title: Leetcode - Jump Game
#
# Author: Vatsal Mistry
# Web: mistryvatsal.github.io
#
# Approach will be to traverse array in reverse, maintain last_optimum_pos
# and check whether last_optimum_pos is at the 0 index
class Solution:
def canJump(self, nums):
N = len(nums)
last_optimum_pos = N-1
for i in range(N-1, -1, -1):
if (i + nums[i]) >= last_optimum_pos:
last_optimum_pos = i
return (last_optimum_pos == 0) |
while True:
n = int(input())
if n == 0:
break
ans = 0
for i in range(n):
flag = True
s = input()
for j in range(len(s)):
if s[j] == ' ' and ans <= j:
flag = False
ans = j
break
if flag and ans < len(s):
ans = len(s)
print(ans+1)
|
"""
Calculating the factors of an integer
- a number that evenly divides a larger number
"""
#
# def is_factor(a, b):
# if b % a == 0:
# return True
# else:
# return False
#
#
# print(is_factor(2, 1))
"""
Find the factors of an integer
"""
#
#
# def factors(n):
#
# for i in range(1, n +1):
# if n % i == 0:
# print(i)
#
# factors(6)
# """
# Generate a multiplication table
# """
#
#
# def multi_table(n):
# for i in range(11):
# result = n * i;
# print(f"{n} x {i} = {result}")
#
#
# num1 = input("Enter base number: ")
#
# if not num1.isnumeric():
# print("invalid integer")
# else:
# num1 = int(num1)
# multi_table(num1)
# print(f"{0.12345:.3f}")
# 1 + 2 + 3 + 4 + 5 = 15
# def summation(num):
# total = 0
#
# for i in range(1, num + 1):
# total = total + i
#
# return total
# sort vs sorted vs reversed
# sort - sorts the list (mutates the list)
# sorted - returns a sorted list of the specified iterable object
# reversed - returns a reversed iterator object
# def descending_order(num):
# return int("".join(reversed(str(num))))
# # convert string to jaden case
# def toJadenCase(string):
# return " ".join(word.capitalize() for word in string.split())
def find_next_square(sq):
root = math.sqrt(sq)
return (root + 1) ** 2 if root.is_integer() else -1
|
# Shopping Options
# https://aonecode.com/amazon-online-assessment-shopping-options
def getNumberOfOptions(priceOfJeans, priceOfShoes, priceOfSkirts, priceOfTops, dollars):
if not priceOfJeans or not priceOfShoes or not priceOfSkirts or not priceOfTops:
return 0
js = []
for i in range(len(priceOfJeans)):
for j in range(len(priceOfShoes)):
js.append(priceOfJeans[i] + priceOfShoes[j])
st = []
for i in range(len(priceOfSkirts)):
for j in range(len(priceOfTops)):
st.append(priceOfSkirts[i] + priceOfTops[j])
js.sort()
st.sort()
res = 0
left, right = 0, len(st) - 1
while left < len(js) and right >= 0:
if js[left] + st[right] <= dollars:
res += right - 0 + 1
left += 1
else:
# js[left] + st[right] > dollars
right -= 1
return res
|
"""
core functionality
"""
def another_func(a, b):
"""
just a test
Parameters
----------
a : int
an input
b : float
another input
See also
--------
{{ cookiecutter.project_slug }}.{{ cookiecutter.project_slug }}.a_function
"""
pass
|
n=int(input('digite um número para saber o seu dobro,triplo e a sua raiz quadrada:'))
do=(n*2)
tri=(n+3)
ra=(n**(1/2))
print('Seu numero foi {} \n o dobro é {} \n o triplo é {} \n e a raiz é {}'.format(n, do, tri, ra)) |
_base_ = [
'_base_/datasets/cxr14_bs16.py',
'_base_/models/resnet50_cxr14.py',
'_base_/schedules/cxr14_bs16_ep20.py',
'_base_/default_runtime.py'
] |
#encoding:utf-8
# Write here subreddit name. Like this one for /r/BigAnimeTiddies.
subreddit = 'BigAnimeTiddies'
# This is for your public telegram channel.
t_channel = '@r_BigAnimeTiddies'
def send_post(submission, r2t):
return r2t.send_simple(submission)
|
def rest():
i01.setHeadSpeed(1.0,1.0)
i01.setHandSpeed("right", 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
i01.setArmSpeed("right", 1.0, 1.0, 1.0, 1.0)
#atach
i01.head.neck.attach()
i01.head.rothead.attach()
i01.rightHand.attach()
i01.rightArm.shoulder.attach()
i01.rightArm.omoplate.attach()
i01.rightArm.bicep.attach()
leftneckServo.attach(right, 13)
rightneckServo.attach(right, 12)
sleep(0.5)
#r.arm
i01.moveArm("right",0,90,30,10)
#head
i01.head.neck.moveTo(75)
i01.head.rothead.moveTo(88)
#r.hand
i01.moveHand("right",2,2,2,2,2,88)
#roll neck
delta = 20
neckMoveTo(restPos,delta)
sleep(7)
leftneckServo.detach()
rightneckServo.detach()
i01.detach()
|
"""
Implementation of a binary Min Heap, represented by an array.
"""
class MinHeap():
def __init__(self):
self.array = []
self.root = None
self.size = 0
def parent(heap, i):
"""
Returns the index of the parent of a given node.
"""
if i == 0:
return 0
return heap.array[(i-1)//2]
def left(heap, i):
"""
Returns the left child of a given node.
"""
return heap.array[2*i + 1]
def right(heap, i):
"""
Returns the right child of a given node.
"""
return heap.array[2*i + 2]
def return_smallest(heap):
"""
Returns the smallest value from a correct MinHeap.
"""
return heap.root
def heapify(heap):
#TODO
pass
def insert(heap):
#TODO
pass |
#!/usr/bin/python3
for i in range(-10,-100,-30):
print(i)
print(i) |
def test_index(client):
r = client.get("/")
assert r.status_code == 200
def test_paper_page(client):
r = client.get("/paper/1812.35598")
assert r.status_code == 200 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.