content
stringlengths 7
1.05M
| fixed_cases
stringlengths 1
1.28M
|
---|---|
def func(*args):
print(args)
print(*args)
a = [1, 2, 3]
# here "a" is passed as tuple of list: ([1, 2, 3],)
func(a)
# print(args) -> ([1, 2, 3],)
# print(*args) -> [1, 2, 3]
# here "a" is passed as tuple of integers: (1, 2, 3)
func(*a)
# print(args) -> (1, 2, 3)
# print(*args) -> 1 2 3
| def func(*args):
print(args)
print(*args)
a = [1, 2, 3]
func(a)
func(*a) |
def main():
while True:
n,m = map(int, input().split())
if n==0 and m==0:
break
D = [9] * n
H = [0] * m
for d in range(n):
D[d] = int(input())
for k in range(m):
H[k] = int(input())
D.sort() # sorting is an important
H.sort() # pre-processing step
gold = 0
d = 0
k = 0 # both arrays are sorted
while d < n and k < m: # while not done yet
while k < m and D[d] > H[k]:
k += 1 # find required knight k
if k == m:
break # loowater is doomed :S
gold += H[k] # pay this amount of gold
d += 1 # next dragon
k += 1 # next knight
if d == n:
print("{}".format(gold)) # all dragons are chopped
else:
print("Loowater is doomed!")
main()
| def main():
while True:
(n, m) = map(int, input().split())
if n == 0 and m == 0:
break
d = [9] * n
h = [0] * m
for d in range(n):
D[d] = int(input())
for k in range(m):
H[k] = int(input())
D.sort()
H.sort()
gold = 0
d = 0
k = 0
while d < n and k < m:
while k < m and D[d] > H[k]:
k += 1
if k == m:
break
gold += H[k]
d += 1
k += 1
if d == n:
print('{}'.format(gold))
else:
print('Loowater is doomed!')
main() |
# Default Configurations
DEFAULT_PYTHON_PATH = '/usr/bin/python'
DEFAULT_STD_OUT_LOG_LOC = '/usr/local/bin/log/env_var_manager.log'
DEFAULT_STSD_ERR_LOG_LOC = '/usr/local/bin/log/env_var_manager.log'
DEFAULT_START_INTERVAL = 120
| default_python_path = '/usr/bin/python'
default_std_out_log_loc = '/usr/local/bin/log/env_var_manager.log'
default_stsd_err_log_loc = '/usr/local/bin/log/env_var_manager.log'
default_start_interval = 120 |
n=int(input())
students={}
for k in range(0,n):
name = input()
grade=float(input())
if not name in students:
students[name]=[grade]
else:
students[name].append(grade)
for j in students:
gradesCount=len(students[j]); gradesSum=0
for k in range(0,len(students[j])):
gradesSum+=students[j][k]
students[j]=gradesSum/gradesCount
if students[j]<4.50:
students[j]="Doesn't pass"
for j in students:
if students[j]=="Doesn't pass":
continue
else:
print(f"{j} -> {students[j]:.2f}")
| n = int(input())
students = {}
for k in range(0, n):
name = input()
grade = float(input())
if not name in students:
students[name] = [grade]
else:
students[name].append(grade)
for j in students:
grades_count = len(students[j])
grades_sum = 0
for k in range(0, len(students[j])):
grades_sum += students[j][k]
students[j] = gradesSum / gradesCount
if students[j] < 4.5:
students[j] = "Doesn't pass"
for j in students:
if students[j] == "Doesn't pass":
continue
else:
print(f'{j} -> {students[j]:.2f}') |
def problem_2():
"By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms."
sequence = [1]
total, sequence_next = 0, 0
# While the next term in the Fibonacci sequence is under 4000000...
while(sequence_next < 4000000):
# Calculate the next term in the sequence and append it to the list
sequence_next = sequence[len(sequence) - 1] + \
sequence[len(sequence) - 2]
sequence.append(sequence_next)
# If the entry is even, add it to the sum of even numbered terms
if(sequence_next % 2 == 0):
total += sequence_next
return total
if __name__ == "__main__":
answer = problem_2()
print(answer)
| def problem_2():
"""By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms."""
sequence = [1]
(total, sequence_next) = (0, 0)
while sequence_next < 4000000:
sequence_next = sequence[len(sequence) - 1] + sequence[len(sequence) - 2]
sequence.append(sequence_next)
if sequence_next % 2 == 0:
total += sequence_next
return total
if __name__ == '__main__':
answer = problem_2()
print(answer) |
#
# PySNMP MIB module HUAWEI-VPLS-TNL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-VPLS-TNL-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:49:40 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")
ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint")
hwDatacomm, = mibBuilder.importSymbols("HUAWEI-MIB", "hwDatacomm")
InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
ModuleIdentity, MibIdentifier, Counter32, Counter64, IpAddress, Integer32, NotificationType, Unsigned32, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, ObjectIdentity, TimeTicks, Bits, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "MibIdentifier", "Counter32", "Counter64", "IpAddress", "Integer32", "NotificationType", "Unsigned32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "ObjectIdentity", "TimeTicks", "Bits", "Gauge32")
TextualConvention, RowStatus, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString", "TruthValue")
hwL2VpnVplsTnlExt = ModuleIdentity((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6))
if mibBuilder.loadTexts: hwL2VpnVplsTnlExt.setLastUpdated('200812151925Z')
if mibBuilder.loadTexts: hwL2VpnVplsTnlExt.setOrganization('Huawei Technologies Co., Ltd.')
if mibBuilder.loadTexts: hwL2VpnVplsTnlExt.setContactInfo('R&D BeiJing, Huawei Technologies co.,Ltd. Huawei Bld.,NO.3 Xinxi Rd., Shang-Di Information Industry Base, Hai-Dian District Beijing P.R. China Zip:100085 Http://www.huawei.com E-mail:[email protected]')
if mibBuilder.loadTexts: hwL2VpnVplsTnlExt.setDescription('This MIB defines all the objects that containing VPLS tunnel information.')
hwL2Vpn = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119))
hwVplsTunnelMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1))
hwVplsTunnelTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1), )
if mibBuilder.loadTexts: hwVplsTunnelTable.setStatus('current')
if mibBuilder.loadTexts: hwVplsTunnelTable.setDescription('Information about VPLS PW Tunnel. This object is used to get VPLS PW tunnel table.')
hwVplsTunnelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1), ).setIndexNames((0, "HUAWEI-VPLS-TNL-MIB", "hwVplsVsiName"), (0, "HUAWEI-VPLS-TNL-MIB", "hwVplsNexthopPeer"), (0, "HUAWEI-VPLS-TNL-MIB", "hwVplsSiteOrPwId"), (0, "HUAWEI-VPLS-TNL-MIB", "hwVplsPeerTnlId"))
if mibBuilder.loadTexts: hwVplsTunnelEntry.setStatus('current')
if mibBuilder.loadTexts: hwVplsTunnelEntry.setDescription('It is used to get detailed tunnel information.')
hwVplsVsiName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 31)))
if mibBuilder.loadTexts: hwVplsVsiName.setStatus('current')
if mibBuilder.loadTexts: hwVplsVsiName.setDescription('The name of this VPLS instance.')
hwVplsNexthopPeer = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 2), IpAddress())
if mibBuilder.loadTexts: hwVplsNexthopPeer.setStatus('current')
if mibBuilder.loadTexts: hwVplsNexthopPeer.setDescription('The ip address of the peer PE.')
hwVplsSiteOrPwId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 3), Unsigned32())
if mibBuilder.loadTexts: hwVplsSiteOrPwId.setStatus('current')
if mibBuilder.loadTexts: hwVplsSiteOrPwId.setDescription('Remote Site ID for BGP Mode, or PW id for LDP Mode')
hwVplsPeerTnlId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 4), Unsigned32())
if mibBuilder.loadTexts: hwVplsPeerTnlId.setStatus('current')
if mibBuilder.loadTexts: hwVplsPeerTnlId.setDescription('The Tunnel ID.')
hwVplsTnlName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 5), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsTnlName.setStatus('current')
if mibBuilder.loadTexts: hwVplsTnlName.setDescription('The name of this Tunnel.')
hwVplsTnlType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("lsp", 1), ("crlsp", 2), ("other", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsTnlType.setStatus('current')
if mibBuilder.loadTexts: hwVplsTnlType.setDescription('The type of this Tunnel. e.g. LSP/GRE/CR-LSP...')
hwVplsTnlSrcAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 7), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsTnlSrcAddress.setStatus('current')
if mibBuilder.loadTexts: hwVplsTnlSrcAddress.setDescription('The source ip address of this tunnel.')
hwVplsTnlDestAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 8), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsTnlDestAddress.setStatus('current')
if mibBuilder.loadTexts: hwVplsTnlDestAddress.setDescription('The destination ip address of this tunnel.')
hwVplsLspIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsLspIndex.setStatus('current')
if mibBuilder.loadTexts: hwVplsLspIndex.setDescription('The index of lsp.')
hwVplsLspOutIf = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 10), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsLspOutIf.setStatus('current')
if mibBuilder.loadTexts: hwVplsLspOutIf.setDescription('The out-interface of lsp.')
hwVplsLspOutLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsLspOutLabel.setStatus('current')
if mibBuilder.loadTexts: hwVplsLspOutLabel.setDescription('The out-label of lsp.')
hwVplsLspNextHop = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 12), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsLspNextHop.setStatus('current')
if mibBuilder.loadTexts: hwVplsLspNextHop.setDescription('The next-hop of lsp.')
hwVplsLspFec = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 13), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsLspFec.setStatus('current')
if mibBuilder.loadTexts: hwVplsLspFec.setDescription('The Fec of lsp.')
hwVplsLspFecPfxLen = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsLspFecPfxLen.setStatus('current')
if mibBuilder.loadTexts: hwVplsLspFecPfxLen.setDescription('The length of mask for hwVplsLspFec.')
hwVplsLspIsBackup = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 15), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsLspIsBackup.setStatus('current')
if mibBuilder.loadTexts: hwVplsLspIsBackup.setDescription('Indicate whether the lsp is main.')
hwVplsIsBalance = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 16), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsIsBalance.setStatus('current')
if mibBuilder.loadTexts: hwVplsIsBalance.setDescription('Property of Balance. Rerurn True if Tunnel-Policy is configed.')
hwVplsLspTunnelId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 17), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsLspTunnelId.setStatus('current')
if mibBuilder.loadTexts: hwVplsLspTunnelId.setDescription('This object indicates the tunnel ID of the tunnel interface.')
hwVplsLspSignType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20))).clone(namedValues=NamedValues(("ldp", 1), ("crLdp", 2), ("rsvp", 3), ("bgp", 4), ("l3vpn", 5), ("static", 6), ("crStatic", 7), ("bgpIpv6", 8), ("staticHa", 9), ("l2vpnIpv6", 10), ("maxSignal", 20)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwVplsLspSignType.setStatus('current')
if mibBuilder.loadTexts: hwVplsLspSignType.setDescription('This object indicates the signaling protocol of the tunnel.')
hwVplsTnlRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 50), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwVplsTnlRowStatus.setStatus('current')
if mibBuilder.loadTexts: hwVplsTnlRowStatus.setDescription('The operating state of the row.')
hwVplsTunnelMIBTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 2))
hwVplsTunnelMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 3))
hwVplsTunnelMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 3, 1))
hwVplsTunnelMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 3, 1, 1)).setObjects(("HUAWEI-VPLS-TNL-MIB", "hwVplsTunnelGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwVplsTunnelMIBCompliance = hwVplsTunnelMIBCompliance.setStatus('current')
if mibBuilder.loadTexts: hwVplsTunnelMIBCompliance.setDescription('The compliance statement for systems supporting the HUAWEI-VPLS-TNL-MIB.')
hwVplsTunnelMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 3, 2))
hwVplsTunnelGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 3, 2, 1)).setObjects(("HUAWEI-VPLS-TNL-MIB", "hwVplsTnlName"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsTnlType"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsTnlSrcAddress"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsTnlDestAddress"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsLspOutIf"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsLspOutLabel"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsLspNextHop"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsLspFec"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsLspFecPfxLen"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsLspIsBackup"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsIsBalance"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsLspTunnelId"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsLspSignType"), ("HUAWEI-VPLS-TNL-MIB", "hwVplsTnlRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwVplsTunnelGroup = hwVplsTunnelGroup.setStatus('current')
if mibBuilder.loadTexts: hwVplsTunnelGroup.setDescription('The VPLS tunnel group.')
mibBuilder.exportSymbols("HUAWEI-VPLS-TNL-MIB", hwVplsSiteOrPwId=hwVplsSiteOrPwId, hwVplsTunnelMIBConformance=hwVplsTunnelMIBConformance, hwVplsIsBalance=hwVplsIsBalance, PYSNMP_MODULE_ID=hwL2VpnVplsTnlExt, hwVplsTunnelMIBCompliances=hwVplsTunnelMIBCompliances, hwVplsTunnelMIBObjects=hwVplsTunnelMIBObjects, hwVplsTunnelGroup=hwVplsTunnelGroup, hwVplsTunnelMIBTraps=hwVplsTunnelMIBTraps, hwVplsTnlRowStatus=hwVplsTnlRowStatus, hwVplsLspSignType=hwVplsLspSignType, hwVplsTunnelMIBCompliance=hwVplsTunnelMIBCompliance, hwVplsLspFec=hwVplsLspFec, hwVplsLspTunnelId=hwVplsLspTunnelId, hwVplsLspIndex=hwVplsLspIndex, hwVplsTunnelEntry=hwVplsTunnelEntry, hwVplsTunnelMIBGroups=hwVplsTunnelMIBGroups, hwVplsTnlName=hwVplsTnlName, hwVplsLspOutIf=hwVplsLspOutIf, hwVplsLspFecPfxLen=hwVplsLspFecPfxLen, hwL2Vpn=hwL2Vpn, hwVplsTnlType=hwVplsTnlType, hwVplsTunnelTable=hwVplsTunnelTable, hwVplsLspNextHop=hwVplsLspNextHop, hwVplsTnlSrcAddress=hwVplsTnlSrcAddress, hwVplsTnlDestAddress=hwVplsTnlDestAddress, hwVplsPeerTnlId=hwVplsPeerTnlId, hwL2VpnVplsTnlExt=hwL2VpnVplsTnlExt, hwVplsLspOutLabel=hwVplsLspOutLabel, hwVplsLspIsBackup=hwVplsLspIsBackup, hwVplsNexthopPeer=hwVplsNexthopPeer, hwVplsVsiName=hwVplsVsiName)
| (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, constraints_union, value_size_constraint, single_value_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueSizeConstraint', 'SingleValueConstraint', 'ValueRangeConstraint')
(hw_datacomm,) = mibBuilder.importSymbols('HUAWEI-MIB', 'hwDatacomm')
(interface_index,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex')
(object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup')
(module_identity, mib_identifier, counter32, counter64, ip_address, integer32, notification_type, unsigned32, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, object_identity, time_ticks, bits, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'MibIdentifier', 'Counter32', 'Counter64', 'IpAddress', 'Integer32', 'NotificationType', 'Unsigned32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'ObjectIdentity', 'TimeTicks', 'Bits', 'Gauge32')
(textual_convention, row_status, display_string, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'RowStatus', 'DisplayString', 'TruthValue')
hw_l2_vpn_vpls_tnl_ext = module_identity((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6))
if mibBuilder.loadTexts:
hwL2VpnVplsTnlExt.setLastUpdated('200812151925Z')
if mibBuilder.loadTexts:
hwL2VpnVplsTnlExt.setOrganization('Huawei Technologies Co., Ltd.')
if mibBuilder.loadTexts:
hwL2VpnVplsTnlExt.setContactInfo('R&D BeiJing, Huawei Technologies co.,Ltd. Huawei Bld.,NO.3 Xinxi Rd., Shang-Di Information Industry Base, Hai-Dian District Beijing P.R. China Zip:100085 Http://www.huawei.com E-mail:[email protected]')
if mibBuilder.loadTexts:
hwL2VpnVplsTnlExt.setDescription('This MIB defines all the objects that containing VPLS tunnel information.')
hw_l2_vpn = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119))
hw_vpls_tunnel_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1))
hw_vpls_tunnel_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1))
if mibBuilder.loadTexts:
hwVplsTunnelTable.setStatus('current')
if mibBuilder.loadTexts:
hwVplsTunnelTable.setDescription('Information about VPLS PW Tunnel. This object is used to get VPLS PW tunnel table.')
hw_vpls_tunnel_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1)).setIndexNames((0, 'HUAWEI-VPLS-TNL-MIB', 'hwVplsVsiName'), (0, 'HUAWEI-VPLS-TNL-MIB', 'hwVplsNexthopPeer'), (0, 'HUAWEI-VPLS-TNL-MIB', 'hwVplsSiteOrPwId'), (0, 'HUAWEI-VPLS-TNL-MIB', 'hwVplsPeerTnlId'))
if mibBuilder.loadTexts:
hwVplsTunnelEntry.setStatus('current')
if mibBuilder.loadTexts:
hwVplsTunnelEntry.setDescription('It is used to get detailed tunnel information.')
hw_vpls_vsi_name = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(1, 31)))
if mibBuilder.loadTexts:
hwVplsVsiName.setStatus('current')
if mibBuilder.loadTexts:
hwVplsVsiName.setDescription('The name of this VPLS instance.')
hw_vpls_nexthop_peer = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 2), ip_address())
if mibBuilder.loadTexts:
hwVplsNexthopPeer.setStatus('current')
if mibBuilder.loadTexts:
hwVplsNexthopPeer.setDescription('The ip address of the peer PE.')
hw_vpls_site_or_pw_id = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 3), unsigned32())
if mibBuilder.loadTexts:
hwVplsSiteOrPwId.setStatus('current')
if mibBuilder.loadTexts:
hwVplsSiteOrPwId.setDescription('Remote Site ID for BGP Mode, or PW id for LDP Mode')
hw_vpls_peer_tnl_id = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 4), unsigned32())
if mibBuilder.loadTexts:
hwVplsPeerTnlId.setStatus('current')
if mibBuilder.loadTexts:
hwVplsPeerTnlId.setDescription('The Tunnel ID.')
hw_vpls_tnl_name = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 5), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsTnlName.setStatus('current')
if mibBuilder.loadTexts:
hwVplsTnlName.setDescription('The name of this Tunnel.')
hw_vpls_tnl_type = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('lsp', 1), ('crlsp', 2), ('other', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsTnlType.setStatus('current')
if mibBuilder.loadTexts:
hwVplsTnlType.setDescription('The type of this Tunnel. e.g. LSP/GRE/CR-LSP...')
hw_vpls_tnl_src_address = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 7), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsTnlSrcAddress.setStatus('current')
if mibBuilder.loadTexts:
hwVplsTnlSrcAddress.setDescription('The source ip address of this tunnel.')
hw_vpls_tnl_dest_address = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 8), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsTnlDestAddress.setStatus('current')
if mibBuilder.loadTexts:
hwVplsTnlDestAddress.setDescription('The destination ip address of this tunnel.')
hw_vpls_lsp_index = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsLspIndex.setStatus('current')
if mibBuilder.loadTexts:
hwVplsLspIndex.setDescription('The index of lsp.')
hw_vpls_lsp_out_if = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 10), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsLspOutIf.setStatus('current')
if mibBuilder.loadTexts:
hwVplsLspOutIf.setDescription('The out-interface of lsp.')
hw_vpls_lsp_out_label = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsLspOutLabel.setStatus('current')
if mibBuilder.loadTexts:
hwVplsLspOutLabel.setDescription('The out-label of lsp.')
hw_vpls_lsp_next_hop = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 12), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsLspNextHop.setStatus('current')
if mibBuilder.loadTexts:
hwVplsLspNextHop.setDescription('The next-hop of lsp.')
hw_vpls_lsp_fec = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 13), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsLspFec.setStatus('current')
if mibBuilder.loadTexts:
hwVplsLspFec.setDescription('The Fec of lsp.')
hw_vpls_lsp_fec_pfx_len = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 14), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsLspFecPfxLen.setStatus('current')
if mibBuilder.loadTexts:
hwVplsLspFecPfxLen.setDescription('The length of mask for hwVplsLspFec.')
hw_vpls_lsp_is_backup = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 15), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsLspIsBackup.setStatus('current')
if mibBuilder.loadTexts:
hwVplsLspIsBackup.setDescription('Indicate whether the lsp is main.')
hw_vpls_is_balance = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 16), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsIsBalance.setStatus('current')
if mibBuilder.loadTexts:
hwVplsIsBalance.setDescription('Property of Balance. Rerurn True if Tunnel-Policy is configed.')
hw_vpls_lsp_tunnel_id = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 17), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsLspTunnelId.setStatus('current')
if mibBuilder.loadTexts:
hwVplsLspTunnelId.setDescription('This object indicates the tunnel ID of the tunnel interface.')
hw_vpls_lsp_sign_type = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20))).clone(namedValues=named_values(('ldp', 1), ('crLdp', 2), ('rsvp', 3), ('bgp', 4), ('l3vpn', 5), ('static', 6), ('crStatic', 7), ('bgpIpv6', 8), ('staticHa', 9), ('l2vpnIpv6', 10), ('maxSignal', 20)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwVplsLspSignType.setStatus('current')
if mibBuilder.loadTexts:
hwVplsLspSignType.setDescription('This object indicates the signaling protocol of the tunnel.')
hw_vpls_tnl_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 1, 1, 1, 50), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
hwVplsTnlRowStatus.setStatus('current')
if mibBuilder.loadTexts:
hwVplsTnlRowStatus.setDescription('The operating state of the row.')
hw_vpls_tunnel_mib_traps = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 2))
hw_vpls_tunnel_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 3))
hw_vpls_tunnel_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 3, 1))
hw_vpls_tunnel_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 3, 1, 1)).setObjects(('HUAWEI-VPLS-TNL-MIB', 'hwVplsTunnelGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hw_vpls_tunnel_mib_compliance = hwVplsTunnelMIBCompliance.setStatus('current')
if mibBuilder.loadTexts:
hwVplsTunnelMIBCompliance.setDescription('The compliance statement for systems supporting the HUAWEI-VPLS-TNL-MIB.')
hw_vpls_tunnel_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 3, 2))
hw_vpls_tunnel_group = object_group((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 6, 3, 2, 1)).setObjects(('HUAWEI-VPLS-TNL-MIB', 'hwVplsTnlName'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsTnlType'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsTnlSrcAddress'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsTnlDestAddress'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsLspOutIf'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsLspOutLabel'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsLspNextHop'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsLspFec'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsLspFecPfxLen'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsLspIsBackup'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsIsBalance'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsLspTunnelId'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsLspSignType'), ('HUAWEI-VPLS-TNL-MIB', 'hwVplsTnlRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hw_vpls_tunnel_group = hwVplsTunnelGroup.setStatus('current')
if mibBuilder.loadTexts:
hwVplsTunnelGroup.setDescription('The VPLS tunnel group.')
mibBuilder.exportSymbols('HUAWEI-VPLS-TNL-MIB', hwVplsSiteOrPwId=hwVplsSiteOrPwId, hwVplsTunnelMIBConformance=hwVplsTunnelMIBConformance, hwVplsIsBalance=hwVplsIsBalance, PYSNMP_MODULE_ID=hwL2VpnVplsTnlExt, hwVplsTunnelMIBCompliances=hwVplsTunnelMIBCompliances, hwVplsTunnelMIBObjects=hwVplsTunnelMIBObjects, hwVplsTunnelGroup=hwVplsTunnelGroup, hwVplsTunnelMIBTraps=hwVplsTunnelMIBTraps, hwVplsTnlRowStatus=hwVplsTnlRowStatus, hwVplsLspSignType=hwVplsLspSignType, hwVplsTunnelMIBCompliance=hwVplsTunnelMIBCompliance, hwVplsLspFec=hwVplsLspFec, hwVplsLspTunnelId=hwVplsLspTunnelId, hwVplsLspIndex=hwVplsLspIndex, hwVplsTunnelEntry=hwVplsTunnelEntry, hwVplsTunnelMIBGroups=hwVplsTunnelMIBGroups, hwVplsTnlName=hwVplsTnlName, hwVplsLspOutIf=hwVplsLspOutIf, hwVplsLspFecPfxLen=hwVplsLspFecPfxLen, hwL2Vpn=hwL2Vpn, hwVplsTnlType=hwVplsTnlType, hwVplsTunnelTable=hwVplsTunnelTable, hwVplsLspNextHop=hwVplsLspNextHop, hwVplsTnlSrcAddress=hwVplsTnlSrcAddress, hwVplsTnlDestAddress=hwVplsTnlDestAddress, hwVplsPeerTnlId=hwVplsPeerTnlId, hwL2VpnVplsTnlExt=hwL2VpnVplsTnlExt, hwVplsLspOutLabel=hwVplsLspOutLabel, hwVplsLspIsBackup=hwVplsLspIsBackup, hwVplsNexthopPeer=hwVplsNexthopPeer, hwVplsVsiName=hwVplsVsiName) |
print('a sequence from 0 to 2')
for i in range(3):
print(i)
print('----------------------')
print('a sequence from 2 to 4')
for i in range(2, 5):
print(i)
print('----------------------')
print('a sequence from 2 to 8 with a step of 2')
for i in range(2, 9, 2):
print(i)
'''
Output:
a sequence from 0 to 2
0
1
2
----------------------
a sequence from 2 to 4
2
3
4
----------------------
a sequence from 2 to 8 with a step of 2
2
4
6
8
''' | print('a sequence from 0 to 2')
for i in range(3):
print(i)
print('----------------------')
print('a sequence from 2 to 4')
for i in range(2, 5):
print(i)
print('----------------------')
print('a sequence from 2 to 8 with a step of 2')
for i in range(2, 9, 2):
print(i)
'\nOutput:\na sequence from 0 to 2\n0\n1\n2\n----------------------\na sequence from 2 to 4\n2\n3\n4\n----------------------\na sequence from 2 to 8 with a step of 2\n2\n4\n6\n8\n' |
class MockResponse:
def __init__(self, status_code, data):
self.status_code = status_code
self.data = data
def json(self):
return self.data
class AuthenticationMock:
def get_token(self):
pass
def get_headers(self):
return {"Authorization": "Bearer token"}
def give_response(status_code, data):
return MockResponse(status_code, data)
GUIDS_MOCK = {
"resources": [
{
"entity": {
"name": "test1",
"space_guid": "space",
"state": "STARTED"
},
"metadata": {
"guid": "guid",
"updated_at": "2012-01-01T13:00:00Z"
}
},
{
"entity": {
"name": "test2",
"space_guid": "space",
"state": "STOPPED"
},
"metadata": {
"guid": "guid",
"updated_at": "2012-01-01T13:00:00Z"
}
}
]
} | class Mockresponse:
def __init__(self, status_code, data):
self.status_code = status_code
self.data = data
def json(self):
return self.data
class Authenticationmock:
def get_token(self):
pass
def get_headers(self):
return {'Authorization': 'Bearer token'}
def give_response(status_code, data):
return mock_response(status_code, data)
guids_mock = {'resources': [{'entity': {'name': 'test1', 'space_guid': 'space', 'state': 'STARTED'}, 'metadata': {'guid': 'guid', 'updated_at': '2012-01-01T13:00:00Z'}}, {'entity': {'name': 'test2', 'space_guid': 'space', 'state': 'STOPPED'}, 'metadata': {'guid': 'guid', 'updated_at': '2012-01-01T13:00:00Z'}}]} |
#Creating a Tuple
newtuple = 'a','b','c','d'
print(newtuple)
# Tuple with 1 element
tupple = 'a',
print(tupple)
newtuple1 = tuple('abcd')
print(newtuple1)
print("------------------")
#Accessing Tuples
newtuple = 'a','b','c','d'
print(newtuple[1])
print(newtuple[-1])
#Traversing a Tuple
for i in newtuple:
print(i)
print("------------------")
#Searching a tuple
print('b' in newtuple) | newtuple = ('a', 'b', 'c', 'd')
print(newtuple)
tupple = ('a',)
print(tupple)
newtuple1 = tuple('abcd')
print(newtuple1)
print('------------------')
newtuple = ('a', 'b', 'c', 'd')
print(newtuple[1])
print(newtuple[-1])
for i in newtuple:
print(i)
print('------------------')
print('b' in newtuple) |
my_favorite_things = {'food': ['burgers', 'pho', 'mangoes'], 'basketball': ['dribbling', 'passing', 'shooting']}
# A list uses square brackets while a dictionary uses curly braces.
my_favorite_things['movies'] = ['Avengers', 'Star Wars']
# my_favorite_things of movies is value
# A square bracket after a variable allows you to indicate which key you're talking about.
print(my_favorite_things['food'])
# We are giving the computer the value of the key food in the variable my_favorite_things.
# We have to be very SPECIFIC in our language on python so the program can understand us.
appliances = ['lamp', 'toaster', 'microwave']
# lists a dictionary were numbers are the keys
print(appliances[1])
appliances[1] = 'blender'
# Use line 12 format to reassign the value the index or position in a list.
print(appliances)
my_favorite_things['movies'].append('Harry Potter')
print(my_favorite_things['movies'])
def plus_5(x):
return x + 5
p = plus_5(3)
print(p)
def max(x, y):
if x < y:
return y
else:
return x
v = max(3, 11)
print(v)
| my_favorite_things = {'food': ['burgers', 'pho', 'mangoes'], 'basketball': ['dribbling', 'passing', 'shooting']}
my_favorite_things['movies'] = ['Avengers', 'Star Wars']
print(my_favorite_things['food'])
appliances = ['lamp', 'toaster', 'microwave']
print(appliances[1])
appliances[1] = 'blender'
print(appliances)
my_favorite_things['movies'].append('Harry Potter')
print(my_favorite_things['movies'])
def plus_5(x):
return x + 5
p = plus_5(3)
print(p)
def max(x, y):
if x < y:
return y
else:
return x
v = max(3, 11)
print(v) |
def get_words_indexes(words_indexes_dictionary, review):
words = review.split(' ')
words_indexes = set()
for word in words:
if word in words_indexes_dictionary:
word_index = words_indexes_dictionary[word]
words_indexes.add(word_index)
return words_indexes | def get_words_indexes(words_indexes_dictionary, review):
words = review.split(' ')
words_indexes = set()
for word in words:
if word in words_indexes_dictionary:
word_index = words_indexes_dictionary[word]
words_indexes.add(word_index)
return words_indexes |
bool_expected_methods = [
'__abs__',
'__add__',
'__and__',
'__bool__',
'__ceil__',
'__class__',
'__delattr__',
'__dir__',
'__divmod__',
'__doc__',
'__eq__',
'__float__',
'__floor__',
'__floordiv__',
'__format__',
'__ge__',
'__getattribute__',
'__getnewargs__',
'__gt__',
'__hash__',
'__index__',
'__init__',
'__init_subclass__',
'__int__',
'__invert__',
'__le__',
'__lshift__',
'__lt__',
'__mod__',
'__mul__',
'__ne__',
'__neg__',
'__new__',
'__or__',
'__pos__',
'__pow__',
'__radd__',
'__rand__',
'__rdivmod__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rfloordiv__',
'__rlshift__',
'__rmod__',
'__rmul__',
'__ror__',
'__round__',
'__rpow__',
'__rrshift__',
'__rshift__',
'__rsub__',
'__rtruediv__',
'__rxor__',
'__setattr__',
'__sizeof__',
'__str__',
'__sub__',
'__subclasshook__',
'__truediv__',
'__trunc__',
'__xor__',
'bit_length',
'conjugate',
'denominator',
'from_bytes',
'imag',
'numerator',
'real',
'to_bytes',
]
bytearray_expected_methods = [
'__add__',
'__alloc__',
'__class__',
'__contains__',
'__delattr__',
'__delitem__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__gt__',
'__hash__',
'__iadd__',
'__imul__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mod__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rmod__',
'__rmul__',
'__setattr__',
'__setitem__',
'__sizeof__',
'__str__',
'__subclasshook__',
'append',
'capitalize',
'center',
'clear',
'copy',
'count',
'decode',
'endswith',
'expandtabs',
'extend',
'find',
'fromhex',
'hex',
'index',
'insert',
'isalnum',
'isalpha',
'isascii',
'isdigit',
'islower',
'isspace',
'istitle',
'isupper',
'join',
'ljust',
'lower',
'lstrip',
'maketrans',
'partition',
'pop',
'remove',
'replace',
'reverse',
'rfind',
'rindex',
'rjust',
'rpartition',
'rsplit',
'rstrip',
'split',
'splitlines',
'startswith',
'strip',
'swapcase',
'title',
'translate',
'upper',
'zfill',
]
bytes_expected_methods = [
'__add__',
'__class__',
'__contains__',
'__delattr__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__getnewargs__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mod__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rmod__',
'__rmul__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'capitalize',
'center',
'count',
'decode',
'endswith',
'expandtabs',
'find',
'fromhex',
'hex',
'index',
'isalnum',
'isalpha',
'isascii',
'isdigit',
'islower',
'isspace',
'istitle',
'isupper',
'join',
'ljust',
'lower',
'lstrip',
'maketrans',
'partition',
'replace',
'rfind',
'rindex',
'rjust',
'rpartition',
'rsplit',
'rstrip',
'split',
'splitlines',
'startswith',
'strip',
'swapcase',
'title',
'translate',
'upper',
'zfill',
]
complex_expected_methods = [
'__abs__',
'__add__',
'__bool__',
'__class__',
'__delattr__',
'__dir__',
'__divmod__',
'__doc__',
'__eq__',
'__float__',
'__floordiv__',
'__format__',
'__ge__',
'__getattribute__',
'__getnewargs__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__int__',
'__le__',
'__lt__',
'__mod__',
'__mul__',
'__ne__',
'__neg__',
'__new__',
'__pos__',
'__pow__',
'__radd__',
'__rdivmod__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rfloordiv__',
'__rmod__',
'__rmul__',
'__rpow__',
'__rsub__',
'__rtruediv__',
'__setattr__',
'__sizeof__',
'__str__',
'__sub__',
'__subclasshook__',
'__truediv__',
'conjugate',
'imag',
'real',
]
dict_expected_methods = [
'__class__',
'__contains__',
'__delattr__',
'__delitem__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__setattr__',
'__setitem__',
'__sizeof__',
'__str__',
'__subclasshook__',
'clear',
'copy',
'fromkeys',
'get',
'items',
'keys',
'pop',
'popitem',
'setdefault',
'update',
'values',
]
float_expected_methods = [
'__abs__',
'__add__',
'__bool__',
'__class__',
'__delattr__',
'__dir__',
'__divmod__',
'__doc__',
'__eq__',
'__float__',
'__floordiv__',
'__format__',
'__ge__',
'__getattribute__',
'__getformat__',
'__getnewargs__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__int__',
'__le__',
'__lt__',
'__mod__',
'__mul__',
'__ne__',
'__neg__',
'__new__',
'__pos__',
'__pow__',
'__radd__',
'__rdivmod__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rfloordiv__',
'__rmod__',
'__rmul__',
'__round__',
'__rpow__',
'__rsub__',
'__rtruediv__',
'__set_format__',
'__setattr__',
'__sizeof__',
'__str__',
'__sub__',
'__subclasshook__',
'__truediv__',
'__trunc__',
'as_integer_ratio',
'conjugate',
'fromhex',
'hex',
'imag',
'is_integer',
'real',
]
frozenset_expected_methods = [
'__and__',
'__class__',
'__contains__',
'__delattr__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__ne__',
'__new__',
'__or__',
'__rand__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__ror__',
'__rsub__',
'__rxor__',
'__setattr__',
'__sizeof__',
'__str__',
'__sub__',
'__subclasshook__',
'__xor__',
'copy',
'difference',
'intersection',
'isdisjoint',
'issubset',
'issuperset',
'symmetric_difference',
'union',
]
int_expected_methods = [
'__abs__',
'__add__',
'__and__',
'__bool__',
'__ceil__',
'__class__',
'__delattr__',
'__dir__',
'__divmod__',
'__doc__',
'__eq__',
'__float__',
'__floor__',
'__floordiv__',
'__format__',
'__ge__',
'__getattribute__',
'__getnewargs__',
'__gt__',
'__hash__',
'__index__',
'__init__',
'__init_subclass__',
'__int__',
'__invert__',
'__le__',
'__lshift__',
'__lt__',
'__mod__',
'__mul__',
'__ne__',
'__neg__',
'__new__',
'__or__',
'__pos__',
'__pow__',
'__radd__',
'__rand__',
'__rdivmod__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rfloordiv__',
'__rlshift__',
'__rmod__',
'__rmul__',
'__ror__',
'__round__',
'__rpow__',
'__rrshift__',
'__rshift__',
'__rsub__',
'__rtruediv__',
'__rxor__',
'__setattr__',
'__sizeof__',
'__str__',
'__sub__',
'__subclasshook__',
'__truediv__',
'__trunc__',
'__xor__',
'bit_length',
'conjugate',
'denominator',
'from_bytes',
'imag',
'numerator',
'real',
'to_bytes',
]
iter_expected_methods = [
'__class__',
'__delattr__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__length_hint__',
'__lt__',
'__ne__',
'__new__',
'__next__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__setattr__',
'__setstate__',
'__sizeof__',
'__str__',
'__subclasshook__',
]
list_expected_methods = [
'__add__',
'__class__',
'__contains__',
'__delattr__',
'__delitem__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__gt__',
'__hash__',
'__iadd__',
'__imul__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__reversed__',
'__rmul__',
'__setattr__',
'__setitem__',
'__sizeof__',
'__str__',
'__subclasshook__',
'append',
'clear',
'copy',
'count',
'extend',
'index',
'insert',
'pop',
'remove',
'reverse',
'sort',
]
memoryview_expected_methods = [
'__class__',
'__delattr__',
'__delitem__',
'__dir__',
'__doc__',
'__enter__',
'__eq__',
'__exit__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__le__',
'__len__',
'__lt__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__setattr__',
'__setitem__',
'__sizeof__',
'__str__',
'__subclasshook__',
'c_contiguous',
'cast',
'contiguous',
'f_contiguous',
'format',
'hex',
'itemsize',
'nbytes',
'ndim',
'obj',
'readonly',
'release',
'shape',
'strides',
'suboffsets',
'tobytes',
'tolist',
]
range_expected_methods = [
'__bool__',
'__class__',
'__contains__',
'__delattr__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__reversed__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'count',
'index',
'start',
'step',
'stop',
]
set_expected_methods = [
'__and__',
'__class__',
'__contains__',
'__delattr__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__gt__',
'__hash__',
'__iand__',
'__init__',
'__init_subclass__',
'__ior__',
'__isub__',
'__iter__',
'__ixor__',
'__le__',
'__len__',
'__lt__',
'__ne__',
'__new__',
'__or__',
'__rand__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__ror__',
'__rsub__',
'__rxor__',
'__setattr__',
'__sizeof__',
'__str__',
'__sub__',
'__subclasshook__',
'__xor__',
'add',
'clear',
'copy',
'difference',
'difference_update',
'discard',
'intersection',
'intersection_update',
'isdisjoint',
'issubset',
'issuperset',
'pop',
'remove',
'symmetric_difference',
'symmetric_difference_update',
'union',
'update',
]
string_expected_methods = [
'__add__',
'__class__',
'__contains__',
'__delattr__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__getnewargs__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mod__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rmod__',
'__rmul__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'capitalize',
'casefold',
'center',
'count',
'encode',
'endswith',
'expandtabs',
'find',
'format',
'format_map',
'index',
'isalnum',
'isalpha',
'isascii',
'isdecimal',
'isdigit',
'isidentifier',
'islower',
'isnumeric',
'isprintable',
'isspace',
'istitle',
'isupper',
'join',
'ljust',
'lower',
'lstrip',
'maketrans',
'partition',
'replace',
'rfind',
'rindex',
'rjust',
'rpartition',
'rsplit',
'rstrip',
'split',
'splitlines',
'startswith',
'strip',
'swapcase',
'title',
'translate',
'upper',
'zfill'
]
tuple_expected_methods = [
'__add__',
'__class__',
'__contains__',
'__delattr__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__getnewargs__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rmul__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'count',
'index',
]
object_expected_methods = [
'__repr__',
'__hash__',
'__str__',
'__getattribute__',
'__setattr__',
'__delattr__',
'__lt__',
'__le__',
'__eq__',
'__ne__',
'__gt__',
'__ge__',
'__init__',
'__new__',
'__reduce_ex__',
'__reduce__',
'__subclasshook__',
'__init_subclass__',
'__format__',
'__sizeof__',
'__dir__',
'__class__',
'__doc__'
]
not_implemented = []
for method in bool_expected_methods:
try:
if not hasattr(bool, method):
not_implemented.append(("bool", method))
except NameError:
not_implemented.append(("bool", method))
for method in bytearray_expected_methods:
try:
if not hasattr(bytearray(), method):
not_implemented.append(("bytearray", method))
except NameError:
not_implemented.append(("bytearray", method))
for method in bytes_expected_methods:
try:
if not hasattr(bytes, method):
not_implemented.append(("bytes", method))
except NameError:
not_implemented.append(("bytes", method))
for method in complex_expected_methods:
try:
if not hasattr(complex, method):
not_implemented.append(("complex", method))
except NameError:
not_implemented.append(("complex", method))
for method in dict_expected_methods:
try:
if not hasattr(dict, method):
not_implemented.append(("dict", method))
except NameError:
not_implemented.append(("dict", method))
for method in float_expected_methods:
try:
if not hasattr(float, method):
not_implemented.append(("float", method))
except NameError:
not_implemented.append(("float", method))
for method in frozenset_expected_methods:
# TODO: uncomment this when frozenset is implemented
# try:
# if not hasattr(frozenset, method):
# not_implemented.append(("frozenset", method))
# except NameError:
not_implemented.append(("frozenset", method))
for method in int_expected_methods:
try:
if not hasattr(int, method):
not_implemented.append(("int", method))
except NameError:
not_implemented.append(("int", method))
for method in iter_expected_methods:
try:
if not hasattr(iter([]), method):
not_implemented.append(("iter", method))
except NameError:
not_implemented.append(("iter", method))
for method in list_expected_methods:
try:
if not hasattr(list, method):
not_implemented.append(("list", method))
except NameError:
not_implemented.append(("list", method))
for method in memoryview_expected_methods:
# TODO: uncomment this when memoryview is implemented
# try:
# if not hasattr(memoryview, method):
# not_implemented.append(("memoryview", method))
# except NameError:
not_implemented.append(("memoryview", method))
for method in range_expected_methods:
try:
if not hasattr(range, method):
not_implemented.append(("range", method))
except NameError:
not_implemented.append(("range", method))
for method in set_expected_methods:
try:
if not hasattr(set, method):
not_implemented.append(("set", method))
except NameError:
not_implemented.append(("set", method))
for method in string_expected_methods:
try:
if not hasattr(str, method):
not_implemented.append(("string", method))
except NameError:
not_implemented.append(("string", method))
for method in tuple_expected_methods:
try:
if not hasattr(tuple, method):
not_implemented.append(("tuple", method))
except NameError:
not_implemented.append(("tuple", method))
for method in object_expected_methods:
try:
if not hasattr(bool, method):
not_implemented.append(("object", method))
except NameError:
not_implemented.append(("object", method))
for r in not_implemented:
print(r[0], ".", r[1])
else:
print("Not much \\o/")
| bool_expected_methods = ['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floor__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getnewargs__', '__gt__', '__hash__', '__index__', '__init__', '__init_subclass__', '__int__', '__invert__', '__le__', '__lshift__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'numerator', 'real', 'to_bytes']
bytearray_expected_methods = ['__add__', '__alloc__', '__class__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'capitalize', 'center', 'clear', 'copy', 'count', 'decode', 'endswith', 'expandtabs', 'extend', 'find', 'fromhex', 'hex', 'index', 'insert', 'isalnum', 'isalpha', 'isascii', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'pop', 'remove', 'replace', 'reverse', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
bytes_expected_methods = ['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'capitalize', 'center', 'count', 'decode', 'endswith', 'expandtabs', 'find', 'fromhex', 'hex', 'index', 'isalnum', 'isalpha', 'isascii', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
complex_expected_methods = ['__abs__', '__add__', '__bool__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__int__', '__le__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__pos__', '__pow__', '__radd__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rmod__', '__rmul__', '__rpow__', '__rsub__', '__rtruediv__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', 'conjugate', 'imag', 'real']
dict_expected_methods = ['__class__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values']
float_expected_methods = ['__abs__', '__add__', '__bool__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getformat__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__int__', '__le__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__pos__', '__pow__', '__radd__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rmod__', '__rmul__', '__round__', '__rpow__', '__rsub__', '__rtruediv__', '__set_format__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', 'as_integer_ratio', 'conjugate', 'fromhex', 'hex', 'imag', 'is_integer', 'real']
frozenset_expected_methods = ['__and__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__or__', '__rand__', '__reduce__', '__reduce_ex__', '__repr__', '__ror__', '__rsub__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__xor__', 'copy', 'difference', 'intersection', 'isdisjoint', 'issubset', 'issuperset', 'symmetric_difference', 'union']
int_expected_methods = ['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floor__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getnewargs__', '__gt__', '__hash__', '__index__', '__init__', '__init_subclass__', '__int__', '__invert__', '__le__', '__lshift__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'numerator', 'real', 'to_bytes']
iter_expected_methods = ['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__length_hint__', '__lt__', '__ne__', '__new__', '__next__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__']
list_expected_methods = ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']
memoryview_expected_methods = ['__class__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__enter__', '__eq__', '__exit__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'c_contiguous', 'cast', 'contiguous', 'f_contiguous', 'format', 'hex', 'itemsize', 'nbytes', 'ndim', 'obj', 'readonly', 'release', 'shape', 'strides', 'suboffsets', 'tobytes', 'tolist']
range_expected_methods = ['__bool__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'count', 'index', 'start', 'step', 'stop']
set_expected_methods = ['__and__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__iand__', '__init__', '__init_subclass__', '__ior__', '__isub__', '__iter__', '__ixor__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__or__', '__rand__', '__reduce__', '__reduce_ex__', '__repr__', '__ror__', '__rsub__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__xor__', 'add', 'clear', 'copy', 'difference', 'difference_update', 'discard', 'intersection', 'intersection_update', 'isdisjoint', 'issubset', 'issuperset', 'pop', 'remove', 'symmetric_difference', 'symmetric_difference_update', 'union', 'update']
string_expected_methods = ['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
tuple_expected_methods = ['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'count', 'index']
object_expected_methods = ['__repr__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__init__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__', '__doc__']
not_implemented = []
for method in bool_expected_methods:
try:
if not hasattr(bool, method):
not_implemented.append(('bool', method))
except NameError:
not_implemented.append(('bool', method))
for method in bytearray_expected_methods:
try:
if not hasattr(bytearray(), method):
not_implemented.append(('bytearray', method))
except NameError:
not_implemented.append(('bytearray', method))
for method in bytes_expected_methods:
try:
if not hasattr(bytes, method):
not_implemented.append(('bytes', method))
except NameError:
not_implemented.append(('bytes', method))
for method in complex_expected_methods:
try:
if not hasattr(complex, method):
not_implemented.append(('complex', method))
except NameError:
not_implemented.append(('complex', method))
for method in dict_expected_methods:
try:
if not hasattr(dict, method):
not_implemented.append(('dict', method))
except NameError:
not_implemented.append(('dict', method))
for method in float_expected_methods:
try:
if not hasattr(float, method):
not_implemented.append(('float', method))
except NameError:
not_implemented.append(('float', method))
for method in frozenset_expected_methods:
not_implemented.append(('frozenset', method))
for method in int_expected_methods:
try:
if not hasattr(int, method):
not_implemented.append(('int', method))
except NameError:
not_implemented.append(('int', method))
for method in iter_expected_methods:
try:
if not hasattr(iter([]), method):
not_implemented.append(('iter', method))
except NameError:
not_implemented.append(('iter', method))
for method in list_expected_methods:
try:
if not hasattr(list, method):
not_implemented.append(('list', method))
except NameError:
not_implemented.append(('list', method))
for method in memoryview_expected_methods:
not_implemented.append(('memoryview', method))
for method in range_expected_methods:
try:
if not hasattr(range, method):
not_implemented.append(('range', method))
except NameError:
not_implemented.append(('range', method))
for method in set_expected_methods:
try:
if not hasattr(set, method):
not_implemented.append(('set', method))
except NameError:
not_implemented.append(('set', method))
for method in string_expected_methods:
try:
if not hasattr(str, method):
not_implemented.append(('string', method))
except NameError:
not_implemented.append(('string', method))
for method in tuple_expected_methods:
try:
if not hasattr(tuple, method):
not_implemented.append(('tuple', method))
except NameError:
not_implemented.append(('tuple', method))
for method in object_expected_methods:
try:
if not hasattr(bool, method):
not_implemented.append(('object', method))
except NameError:
not_implemented.append(('object', method))
for r in not_implemented:
print(r[0], '.', r[1])
else:
print('Not much \\o/') |
#the program calculates the average of numbers whose input is in the form of a string
def average():
numbers = str(input("Enter a string of numbers: "))
numbers = numbers.split()
numbers2 = []
total = 0
for number in numbers:
number = int(number)
total += number
numbers2.append(number)
avg = total // len(numbers2)
print(avg)
average()
| def average():
numbers = str(input('Enter a string of numbers: '))
numbers = numbers.split()
numbers2 = []
total = 0
for number in numbers:
number = int(number)
total += number
numbers2.append(number)
avg = total // len(numbers2)
print(avg)
average() |
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
num_dict = {}
for i, num in enumerate(nums):
n = target - num
if n not in num_dict:
num_dict[num] = i
else:
return [num_dict[n], i]
| class Solution:
def two_sum(self, nums: List[int], target: int) -> List[int]:
num_dict = {}
for (i, num) in enumerate(nums):
n = target - num
if n not in num_dict:
num_dict[num] = i
else:
return [num_dict[n], i] |
def pick_arr(arr, b):
nums = arr[:b]
idxsum = sum(nums)
maxsum = idxsum
for i in range(b):
remove = nums.pop()
add = arr.pop()
idxsum = idxsum - remove + add
maxsum = max(maxsum, idxsum)
return maxsum
print(pick_arr([5,-2,3,1,2], 3))
| def pick_arr(arr, b):
nums = arr[:b]
idxsum = sum(nums)
maxsum = idxsum
for i in range(b):
remove = nums.pop()
add = arr.pop()
idxsum = idxsum - remove + add
maxsum = max(maxsum, idxsum)
return maxsum
print(pick_arr([5, -2, 3, 1, 2], 3)) |
#!/usr/bin/env python
# encoding: utf-8
class HashInterface(object):
@staticmethod
def hash(*arg):
pass
| class Hashinterface(object):
@staticmethod
def hash(*arg):
pass |
class Solution:
def solve(self, nums):
ans = [-1]*len(nums)
unmatched = []
for i in range(len(nums)):
while unmatched and unmatched[0][0] < nums[i]:
ans[heappop(unmatched)[1]] = nums[i]
heappush(unmatched, [nums[i], i])
for i in range(len(nums)):
while unmatched and unmatched[0][0] < nums[i]:
ans[heappop(unmatched)[1]] = nums[i]
return ans
| class Solution:
def solve(self, nums):
ans = [-1] * len(nums)
unmatched = []
for i in range(len(nums)):
while unmatched and unmatched[0][0] < nums[i]:
ans[heappop(unmatched)[1]] = nums[i]
heappush(unmatched, [nums[i], i])
for i in range(len(nums)):
while unmatched and unmatched[0][0] < nums[i]:
ans[heappop(unmatched)[1]] = nums[i]
return ans |
'''
Created on Aug 30, 2012
@author: philipkershaw
'''
| """
Created on Aug 30, 2012
@author: philipkershaw
""" |
SETTINGS = {
'gee': {
'service_account': None,
'privatekey_file': None,
}
}
| settings = {'gee': {'service_account': None, 'privatekey_file': None}} |
# Fried Chicken Damage Skin
success = sm.addDamageSkin(2435960)
if success:
sm.chat("The Fried Chicken Damage Skin has been added to your account's damage skin collection.")
# sm.consumeItem(2435960)
| success = sm.addDamageSkin(2435960)
if success:
sm.chat("The Fried Chicken Damage Skin has been added to your account's damage skin collection.") |
# -*- coding: utf-8 -*-
BADREQUEST = 400
UNAUTHORIZED = 401
FORBIDDEN = 403
GONE = 410
TOOMANYREQUESTS = 412
class DnsdbException(Exception):
def __init__(self, message, errcode=500, detail=None, msg_ch=u''):
self.message = message
self.errcode = errcode
self.detail = detail
self.msg_ch = msg_ch
super(DnsdbException, self).__init__()
def __str__(self):
return self.message
def json(self):
return dict(code=self.errcode, why=self.message)
class Unauthorized(DnsdbException):
def __init__(self, message='Unauthorized', errcode=UNAUTHORIZED, detail=None, msg_ch=u''):
super(Unauthorized, self).__init__(message, errcode, detail, msg_ch)
class Forbidden(DnsdbException):
def __init__(self, message='Forbidden', errcode=FORBIDDEN, detail=None, msg_ch=u''):
super(Forbidden, self).__init__(message, errcode, detail, msg_ch)
class OperationLogErr(DnsdbException):
def __init__(self, message, errcode=500, detail=None, msg_ch=u''):
super(OperationLogErr, self).__init__(message, errcode, detail, msg_ch)
class BadParam(DnsdbException):
def __init__(self, message='Bad params', errcode=BADREQUEST, detail=None, msg_ch=u''):
super(BadParam, self).__init__(message, errcode, detail, msg_ch)
class UpdaterErr(DnsdbException):
pass
class ConfigErr(UpdaterErr):
def __init__(self, message):
super(ConfigErr, self).__init__(message=message, errcode=501)
| badrequest = 400
unauthorized = 401
forbidden = 403
gone = 410
toomanyrequests = 412
class Dnsdbexception(Exception):
def __init__(self, message, errcode=500, detail=None, msg_ch=u''):
self.message = message
self.errcode = errcode
self.detail = detail
self.msg_ch = msg_ch
super(DnsdbException, self).__init__()
def __str__(self):
return self.message
def json(self):
return dict(code=self.errcode, why=self.message)
class Unauthorized(DnsdbException):
def __init__(self, message='Unauthorized', errcode=UNAUTHORIZED, detail=None, msg_ch=u''):
super(Unauthorized, self).__init__(message, errcode, detail, msg_ch)
class Forbidden(DnsdbException):
def __init__(self, message='Forbidden', errcode=FORBIDDEN, detail=None, msg_ch=u''):
super(Forbidden, self).__init__(message, errcode, detail, msg_ch)
class Operationlogerr(DnsdbException):
def __init__(self, message, errcode=500, detail=None, msg_ch=u''):
super(OperationLogErr, self).__init__(message, errcode, detail, msg_ch)
class Badparam(DnsdbException):
def __init__(self, message='Bad params', errcode=BADREQUEST, detail=None, msg_ch=u''):
super(BadParam, self).__init__(message, errcode, detail, msg_ch)
class Updatererr(DnsdbException):
pass
class Configerr(UpdaterErr):
def __init__(self, message):
super(ConfigErr, self).__init__(message=message, errcode=501) |
#create class
class Event:
#create class variables
def __init__(self , eventId , eventType , themeColor , location):
self.eventId = eventId
self.eventType = eventType
self.themeColor = themeColor
self.location = location
#define class functions
def displayEventDetails(self):
print()
print("Event Type = " + self.eventType)
print("Theme Color = " + self.themeColor)
print("Location = " + self.location)
def setEventLocation(self):
self.location = input("Input new location of event " + str(self.eventId) + " : ") | class Event:
def __init__(self, eventId, eventType, themeColor, location):
self.eventId = eventId
self.eventType = eventType
self.themeColor = themeColor
self.location = location
def display_event_details(self):
print()
print('Event Type = ' + self.eventType)
print('Theme Color = ' + self.themeColor)
print('Location = ' + self.location)
def set_event_location(self):
self.location = input('Input new location of event ' + str(self.eventId) + ' : ') |
class Piece:
def __init__(self, row, col):
self.clicked = False
self.numAround = -1
self.flagged = False
self.row, self.col = row, col
def setNeighbors(self, neighbors):
self.neighbors = neighbors
def getNumFlaggedAround(self):
num = 0
for n in self.neighbors:
num += 1 if n.flagged else 0
return num
def getNumUnclickedAround(self):
num = 0
for n in self.neighbors:
num += 0 if n.clicked else 1
return num
def hasClickedNeighbor(self):
for n in self.neighbors:
if n.clicked:
return True
return False | class Piece:
def __init__(self, row, col):
self.clicked = False
self.numAround = -1
self.flagged = False
(self.row, self.col) = (row, col)
def set_neighbors(self, neighbors):
self.neighbors = neighbors
def get_num_flagged_around(self):
num = 0
for n in self.neighbors:
num += 1 if n.flagged else 0
return num
def get_num_unclicked_around(self):
num = 0
for n in self.neighbors:
num += 0 if n.clicked else 1
return num
def has_clicked_neighbor(self):
for n in self.neighbors:
if n.clicked:
return True
return False |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@AUTHOR:Joselyn Zhao
@CONTACT:[email protected]
@HOME_PAGE:joselynzhao.top
@SOFTWERE:PyCharm
@FILE:del.py
@TIME:2020/4/29 19:57
@DES:
'''
dict = {'shuxue':99,'yuwen':99,'yingyu':99}
print('shuxue:',dict['shuxue'])
print('yuwen:',dict['yuwen'])
print('yingyu:',dict['yingyu'])
dict['wuli'] = 100
dict['huaxue'] = 89
print(dict)
del dict['yingyu']
print(dict) | """
@AUTHOR:Joselyn Zhao
@CONTACT:[email protected]
@HOME_PAGE:joselynzhao.top
@SOFTWERE:PyCharm
@FILE:del.py
@TIME:2020/4/29 19:57
@DES:
"""
dict = {'shuxue': 99, 'yuwen': 99, 'yingyu': 99}
print('shuxue:', dict['shuxue'])
print('yuwen:', dict['yuwen'])
print('yingyu:', dict['yingyu'])
dict['wuli'] = 100
dict['huaxue'] = 89
print(dict)
del dict['yingyu']
print(dict) |
# Input is square matrix A whose rows are sorted lists.
# Returns a list B by merging all rows into a single list.
#
# Goal: O(n^2 log n)
# Actually O(n^2 log(n^2)) but since log(n^2) == 2log(n) and constant factors can be ignored => O(2log(n)) can be relaxed to O(log(n))
def mergesort(Sublists):
sublists_count=len(Sublists)
if (sublists_count is 0): return Sublists
elif(sublists_count is 1): return Sublists[0]
k=sublists_count//2
first_half=mergesort(Sublists[:k])
second_half=mergesort(Sublists[k:])
return merge(first_half,second_half) # This merge operation takes O(n) time
def merge(list1,list2):
if list2 is []: return list1
Result=[]
list1_ptr=0
list2_ptr=0
while (list1_ptr<len(list1) and list2_ptr<len(list2)):
if (list1[list1_ptr]<=list2[list2_ptr]):
Result.append(list1[list1_ptr])
list1_ptr+=1
elif(list1[list1_ptr]>list2[list2_ptr]):
Result.append(list2[list2_ptr])
list2_ptr+=1
while (list1_ptr<len(list1)):
Result.append(list1[list1_ptr])
list1_ptr+=1
while (list2_ptr<len(list2)):
Result.append(list2[list2_ptr])
list2_ptr+=1
return Result
if __name__ == "__main__":
A=[[1,2,8],
[2,3,9],
[3,4,4]]
print(mergesort(A)) | def mergesort(Sublists):
sublists_count = len(Sublists)
if sublists_count is 0:
return Sublists
elif sublists_count is 1:
return Sublists[0]
k = sublists_count // 2
first_half = mergesort(Sublists[:k])
second_half = mergesort(Sublists[k:])
return merge(first_half, second_half)
def merge(list1, list2):
if list2 is []:
return list1
result = []
list1_ptr = 0
list2_ptr = 0
while list1_ptr < len(list1) and list2_ptr < len(list2):
if list1[list1_ptr] <= list2[list2_ptr]:
Result.append(list1[list1_ptr])
list1_ptr += 1
elif list1[list1_ptr] > list2[list2_ptr]:
Result.append(list2[list2_ptr])
list2_ptr += 1
while list1_ptr < len(list1):
Result.append(list1[list1_ptr])
list1_ptr += 1
while list2_ptr < len(list2):
Result.append(list2[list2_ptr])
list2_ptr += 1
return Result
if __name__ == '__main__':
a = [[1, 2, 8], [2, 3, 9], [3, 4, 4]]
print(mergesort(A)) |
def non_contiguous_motif(str1, dna_list):
index = -1
num = 0
for i in str1:
for j in dna_list:
index+= 1
if i == j:
num = index
return num
| def non_contiguous_motif(str1, dna_list):
index = -1
num = 0
for i in str1:
for j in dna_list:
index += 1
if i == j:
num = index
return num |
#!/usr/bin/env python
NAME = 'Microsoft ISA Server'
def is_waf(self):
detected = False
r = self.invalid_host()
if r is None:
return
if r.reason in self.isaservermatch:
detected = True
return detected
| name = 'Microsoft ISA Server'
def is_waf(self):
detected = False
r = self.invalid_host()
if r is None:
return
if r.reason in self.isaservermatch:
detected = True
return detected |
#
# PySNMP MIB module Unisphere-Data-L2F-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Unisphere-Data-L2F-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:24:37 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint")
InterfaceIndex, InterfaceIndexOrZero = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex", "InterfaceIndexOrZero")
NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup")
IpAddress, ModuleIdentity, ObjectIdentity, NotificationType, Bits, Integer32, iso, Counter32, Unsigned32, TimeTicks, MibIdentifier, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "ModuleIdentity", "ObjectIdentity", "NotificationType", "Bits", "Integer32", "iso", "Counter32", "Unsigned32", "TimeTicks", "MibIdentifier", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32")
TruthValue, TextualConvention, DisplayString, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "TextualConvention", "DisplayString", "RowStatus")
usDataMibs, = mibBuilder.importSymbols("Unisphere-Data-MIBs", "usDataMibs")
UsdEnable, = mibBuilder.importSymbols("Unisphere-Data-TC", "UsdEnable")
usdL2fMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53))
usdL2fMIB.setRevisions(('2001-09-25 13:54', '2001-09-19 18:07',))
if mibBuilder.loadTexts: usdL2fMIB.setLastUpdated('200109251354Z')
if mibBuilder.loadTexts: usdL2fMIB.setOrganization('Unisphere Networks, Inc.')
class UsdL2fTunnelId(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 65535)
class UsdL2fSessionId(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 65535)
class UsdL2fAdminState(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2))
namedValues = NamedValues(("enabled", 0), ("disabled", 1), ("drain", 2))
class UsdL2fTransport(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1))
namedValues = NamedValues(("other", 0), ("udpIp", 1))
usdL2fTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 0))
usdL2fObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1))
usdL2fTrapControl = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 2))
usdL2fConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3))
usdL2fSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1))
usdL2fDestination = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2))
usdL2fTunnel = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3))
usdL2fSession = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4))
usdL2fTransport = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5))
usdL2fSystemConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 1))
usdL2fSystemStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2))
usdL2fSysConfigAdminState = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 1, 1), UsdL2fAdminState()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: usdL2fSysConfigAdminState.setStatus('current')
usdL2fSysConfigDestructTimeout = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3600))).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: usdL2fSysConfigDestructTimeout.setStatus('current')
usdL2fSysConfigIpChecksumEnable = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 1, 3), UsdEnable()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: usdL2fSysConfigIpChecksumEnable.setStatus('current')
usdL2fSysConfigReceiveDataSequencingIgnore = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 1, 4), UsdEnable()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: usdL2fSysConfigReceiveDataSequencingIgnore.setStatus('current')
usdL2fSysStatusProtocolVersion = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 256))).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusProtocolVersion.setStatus('current')
usdL2fSysStatusVendorName = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusVendorName.setStatus('current')
usdL2fSysStatusFirmwareRev = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusFirmwareRev.setStatus('current')
usdL2fSysStatusTotalDestinations = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusTotalDestinations.setStatus('current')
usdL2fSysStatusFailedDestinations = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusFailedDestinations.setStatus('current')
usdL2fSysStatusActiveDestinations = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 6), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusActiveDestinations.setStatus('current')
usdL2fSysStatusTotalTunnels = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusTotalTunnels.setStatus('current')
usdL2fSysStatusFailedTunnels = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusFailedTunnels.setStatus('current')
usdL2fSysStatusFailedTunnelAuthens = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusFailedTunnelAuthens.setStatus('current')
usdL2fSysStatusActiveTunnels = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 10), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusActiveTunnels.setStatus('current')
usdL2fSysStatusTotalSessions = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusTotalSessions.setStatus('current')
usdL2fSysStatusFailedSessions = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusFailedSessions.setStatus('current')
usdL2fSysStatusActiveSessions = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 13), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSysStatusActiveSessions.setStatus('current')
usdL2fDestConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1))
usdL2fDestStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2))
usdL2fDestStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3))
usdL2fDestConfigTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1, 2), )
if mibBuilder.loadTexts: usdL2fDestConfigTable.setStatus('current')
usdL2fDestConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1, 2, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fDestConfigIfIndex"))
if mibBuilder.loadTexts: usdL2fDestConfigEntry.setStatus('current')
usdL2fDestConfigIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1, 2, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fDestConfigIfIndex.setStatus('current')
usdL2fDestConfigRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1, 2, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdL2fDestConfigRowStatus.setStatus('current')
usdL2fDestConfigAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1, 2, 1, 3), UsdL2fAdminState().clone('enabled')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdL2fDestConfigAdminState.setStatus('current')
usdL2fDestStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1), )
if mibBuilder.loadTexts: usdL2fDestStatusTable.setStatus('current')
usdL2fDestStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fDestStatusIfIndex"))
if mibBuilder.loadTexts: usdL2fDestStatusEntry.setStatus('current')
usdL2fDestStatusIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fDestStatusIfIndex.setStatus('current')
usdL2fDestStatusTransport = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 2), UsdL2fTransport()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatusTransport.setStatus('current')
usdL2fDestStatusEffectiveAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 3), UsdL2fAdminState()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatusEffectiveAdminState.setStatus('current')
usdL2fDestStatusTotalTunnels = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatusTotalTunnels.setStatus('current')
usdL2fDestStatusFailedTunnels = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatusFailedTunnels.setStatus('current')
usdL2fDestStatusFailedTunnelAuthens = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatusFailedTunnelAuthens.setStatus('current')
usdL2fDestStatusActiveTunnels = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 7), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatusActiveTunnels.setStatus('current')
usdL2fDestStatusTotalSessions = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatusTotalSessions.setStatus('current')
usdL2fDestStatusFailedSessions = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatusFailedSessions.setStatus('current')
usdL2fDestStatusActiveSessions = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 10), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatusActiveSessions.setStatus('current')
usdL2fDestStatTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1), )
if mibBuilder.loadTexts: usdL2fDestStatTable.setStatus('current')
usdL2fDestStatEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fDestStatIfIndex"))
if mibBuilder.loadTexts: usdL2fDestStatEntry.setStatus('current')
usdL2fDestStatIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fDestStatIfIndex.setStatus('current')
usdL2fDestStatCtlRecvOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatCtlRecvOctets.setStatus('current')
usdL2fDestStatCtlRecvPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatCtlRecvPackets.setStatus('current')
usdL2fDestStatCtlRecvErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatCtlRecvErrors.setStatus('current')
usdL2fDestStatCtlRecvDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatCtlRecvDiscards.setStatus('current')
usdL2fDestStatCtlSendOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatCtlSendOctets.setStatus('current')
usdL2fDestStatCtlSendPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatCtlSendPackets.setStatus('current')
usdL2fDestStatCtlSendErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatCtlSendErrors.setStatus('current')
usdL2fDestStatCtlSendDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatCtlSendDiscards.setStatus('current')
usdL2fDestStatPayRecvOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatPayRecvOctets.setStatus('current')
usdL2fDestStatPayRecvPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatPayRecvPackets.setStatus('current')
usdL2fDestStatPayRecvErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatPayRecvErrors.setStatus('current')
usdL2fDestStatPayRecvDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatPayRecvDiscards.setStatus('current')
usdL2fDestStatPaySendOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatPaySendOctets.setStatus('current')
usdL2fDestStatPaySendPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 15), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatPaySendPackets.setStatus('current')
usdL2fDestStatPaySendErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatPaySendErrors.setStatus('current')
usdL2fDestStatPaySendDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fDestStatPaySendDiscards.setStatus('current')
usdL2fTunnelConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1))
usdL2fTunnelStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2))
usdL2fTunnelStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3))
usdL2fTunnelMap = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4))
usdL2fTunnelConfigTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1, 2), )
if mibBuilder.loadTexts: usdL2fTunnelConfigTable.setStatus('current')
usdL2fTunnelConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1, 2, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fTunnelConfigIfIndex"))
if mibBuilder.loadTexts: usdL2fTunnelConfigEntry.setStatus('current')
usdL2fTunnelConfigIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1, 2, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fTunnelConfigIfIndex.setStatus('current')
usdL2fTunnelConfigRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1, 2, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdL2fTunnelConfigRowStatus.setStatus('current')
usdL2fTunnelConfigAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1, 2, 1, 3), UsdL2fAdminState().clone('enabled')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdL2fTunnelConfigAdminState.setStatus('current')
usdL2fTunnelStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1), )
if mibBuilder.loadTexts: usdL2fTunnelStatusTable.setStatus('current')
usdL2fTunnelStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusIfIndex"))
if mibBuilder.loadTexts: usdL2fTunnelStatusEntry.setStatus('current')
usdL2fTunnelStatusIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fTunnelStatusIfIndex.setStatus('current')
usdL2fTunnelStatusTransport = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 2), UsdL2fTransport()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusTransport.setStatus('current')
usdL2fTunnelStatusLocalTunnelId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 3), UsdL2fTunnelId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusLocalTunnelId.setStatus('current')
usdL2fTunnelStatusRemoteTunnelId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 4), UsdL2fTunnelId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusRemoteTunnelId.setStatus('current')
usdL2fTunnelStatusEffectiveAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 5), UsdL2fAdminState()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusEffectiveAdminState.setStatus('current')
usdL2fTunnelStatusState = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("idle", 0), ("connecting", 1), ("established", 2), ("disconnecting", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusState.setStatus('current')
usdL2fTunnelStatusInitiated = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("local", 1), ("remote", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusInitiated.setStatus('current')
usdL2fTunnelStatusRemoteHostName = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 8), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusRemoteHostName.setStatus('current')
usdL2fTunnelStatusTotalSessions = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusTotalSessions.setStatus('current')
usdL2fTunnelStatusFailedSessions = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusFailedSessions.setStatus('current')
usdL2fTunnelStatusActiveSessions = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 11), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusActiveSessions.setStatus('current')
usdL2fTunnelStatusLastErrorCode = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusLastErrorCode.setStatus('current')
usdL2fTunnelStatusLastErrorMessage = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 13), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusLastErrorMessage.setStatus('current')
usdL2fTunnelStatusCumEstabTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 14), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatusCumEstabTime.setStatus('current')
usdL2fTunnelStatTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1), )
if mibBuilder.loadTexts: usdL2fTunnelStatTable.setStatus('current')
usdL2fTunnelStatEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fTunnelStatIfIndex"))
if mibBuilder.loadTexts: usdL2fTunnelStatEntry.setStatus('current')
usdL2fTunnelStatIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fTunnelStatIfIndex.setStatus('current')
usdL2fTunnelStatCtlRecvOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatCtlRecvOctets.setStatus('current')
usdL2fTunnelStatCtlRecvPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatCtlRecvPackets.setStatus('current')
usdL2fTunnelStatCtlRecvErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatCtlRecvErrors.setStatus('current')
usdL2fTunnelStatCtlRecvDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatCtlRecvDiscards.setStatus('current')
usdL2fTunnelStatCtlSendOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatCtlSendOctets.setStatus('current')
usdL2fTunnelStatCtlSendPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatCtlSendPackets.setStatus('current')
usdL2fTunnelStatCtlSendErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatCtlSendErrors.setStatus('current')
usdL2fTunnelStatCtlSendDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatCtlSendDiscards.setStatus('current')
usdL2fTunnelStatPayRecvOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatPayRecvOctets.setStatus('current')
usdL2fTunnelStatPayRecvPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatPayRecvPackets.setStatus('current')
usdL2fTunnelStatPayRecvErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatPayRecvErrors.setStatus('current')
usdL2fTunnelStatPayRecvDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatPayRecvDiscards.setStatus('current')
usdL2fTunnelStatPaySendOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatPaySendOctets.setStatus('current')
usdL2fTunnelStatPaySendPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 15), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatPaySendPackets.setStatus('current')
usdL2fTunnelStatPaySendErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatPaySendErrors.setStatus('current')
usdL2fTunnelStatPaySendDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatPaySendDiscards.setStatus('current')
usdL2fTunnelStatCtlRecvOutOfSequence = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 18), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fTunnelStatCtlRecvOutOfSequence.setStatus('current')
usdL2fMapTifSidToSifTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 1), )
if mibBuilder.loadTexts: usdL2fMapTifSidToSifTable.setStatus('current')
usdL2fMapTifSidToSifEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 1, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fMapTifSidToSifTunnelIfIndex"), (0, "Unisphere-Data-L2F-MIB", "usdL2fMapTifSidToSifLocalSessionId"))
if mibBuilder.loadTexts: usdL2fMapTifSidToSifEntry.setStatus('current')
usdL2fMapTifSidToSifTunnelIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fMapTifSidToSifTunnelIfIndex.setStatus('current')
usdL2fMapTifSidToSifLocalSessionId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 1, 1, 2), UsdL2fSessionId())
if mibBuilder.loadTexts: usdL2fMapTifSidToSifLocalSessionId.setStatus('current')
usdL2fMapTifSidToSifSessionIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 1, 1, 3), InterfaceIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fMapTifSidToSifSessionIfIndex.setStatus('current')
usdL2fMapTidToTifTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 2), )
if mibBuilder.loadTexts: usdL2fMapTidToTifTable.setStatus('current')
usdL2fMapTidToTifEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 2, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fMapTidToTifLocalTunnelId"))
if mibBuilder.loadTexts: usdL2fMapTidToTifEntry.setStatus('current')
usdL2fMapTidToTifLocalTunnelId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 2, 1, 1), UsdL2fTunnelId())
if mibBuilder.loadTexts: usdL2fMapTidToTifLocalTunnelId.setStatus('current')
usdL2fMapTidToTifIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 2, 1, 2), InterfaceIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fMapTidToTifIfIndex.setStatus('current')
usdL2fSessionConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1))
usdL2fSessionStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2))
usdL2fSessionStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3))
usdL2fSessionConfigTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1, 2), )
if mibBuilder.loadTexts: usdL2fSessionConfigTable.setStatus('current')
usdL2fSessionConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1, 2, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fSessionConfigIfIndex"))
if mibBuilder.loadTexts: usdL2fSessionConfigEntry.setStatus('current')
usdL2fSessionConfigIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1, 2, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fSessionConfigIfIndex.setStatus('current')
usdL2fSessionConfigRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1, 2, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdL2fSessionConfigRowStatus.setStatus('current')
usdL2fSessionConfigAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1, 2, 1, 3), UsdL2fAdminState().clone('enabled')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdL2fSessionConfigAdminState.setStatus('current')
usdL2fSessionStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1), )
if mibBuilder.loadTexts: usdL2fSessionStatusTable.setStatus('current')
usdL2fSessionStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fSessionStatusIfIndex"))
if mibBuilder.loadTexts: usdL2fSessionStatusEntry.setStatus('current')
usdL2fSessionStatusIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fSessionStatusIfIndex.setStatus('current')
usdL2fSessionStatusLocalSessionId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 2), UsdL2fSessionId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusLocalSessionId.setStatus('current')
usdL2fSessionStatusRemoteSessionId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 3), UsdL2fSessionId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusRemoteSessionId.setStatus('current')
usdL2fSessionStatusUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusUserName.setStatus('current')
usdL2fSessionStatusEffectiveAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 5), UsdL2fAdminState()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusEffectiveAdminState.setStatus('current')
usdL2fSessionStatusState = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("idle", 0), ("connecting", 1), ("established", 2), ("disconnecting", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusState.setStatus('current')
usdL2fSessionStatusCallType = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 0), ("lacIncoming", 1), ("lnsIncoming", 2), ("lacOutgoing", 3), ("lnsOutgoing", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusCallType.setStatus('current')
usdL2fSessionStatusTxConnectSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusTxConnectSpeed.setStatus('current')
usdL2fSessionStatusRxConnectSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusRxConnectSpeed.setStatus('current')
usdL2fSessionStatusProxyLcp = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 10), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusProxyLcp.setStatus('current')
usdL2fSessionStatusAuthMethod = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("pppChap", 1), ("pppPap", 2), ("pppMsChap", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusAuthMethod.setStatus('current')
usdL2fSessionStatusSequencingState = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("remote", 1), ("local", 2), ("both", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusSequencingState.setStatus('current')
usdL2fSessionStatusLacTunneledIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 13), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusLacTunneledIfIndex.setStatus('current')
usdL2fSessionStatusCumEstabTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 14), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatusCumEstabTime.setStatus('current')
usdL2fSessionStatTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1), )
if mibBuilder.loadTexts: usdL2fSessionStatTable.setStatus('current')
usdL2fSessionStatEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fSessionStatIfIndex"))
if mibBuilder.loadTexts: usdL2fSessionStatEntry.setStatus('current')
usdL2fSessionStatIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fSessionStatIfIndex.setStatus('current')
usdL2fSessionStatPayRecvOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatPayRecvOctets.setStatus('current')
usdL2fSessionStatPayRecvPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatPayRecvPackets.setStatus('current')
usdL2fSessionStatPayRecvErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatPayRecvErrors.setStatus('current')
usdL2fSessionStatPayRecvDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatPayRecvDiscards.setStatus('current')
usdL2fSessionStatPaySendOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatPaySendOctets.setStatus('current')
usdL2fSessionStatPaySendPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatPaySendPackets.setStatus('current')
usdL2fSessionStatPaySendErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatPaySendErrors.setStatus('current')
usdL2fSessionStatPaySendDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatPaySendDiscards.setStatus('current')
usdL2fSessionStatRecvOutOfSequence = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatRecvOutOfSequence.setStatus('current')
usdL2fSessionStatResequencingTimeouts = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatResequencingTimeouts.setStatus('current')
usdL2fSessionStatPayLostPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 12), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fSessionStatPayLostPackets.setStatus('current')
usdL2fTransportUdpIp = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1))
usdL2fUdpIpDestination = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1))
usdL2fUdpIpTunnel = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2))
usdL2fUdpIpDestTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1), )
if mibBuilder.loadTexts: usdL2fUdpIpDestTable.setStatus('current')
usdL2fUdpIpDestEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fUdpIpDestIfIndex"))
if mibBuilder.loadTexts: usdL2fUdpIpDestEntry.setStatus('current')
usdL2fUdpIpDestIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fUdpIpDestIfIndex.setStatus('current')
usdL2fUdpIpDestRouterIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fUdpIpDestRouterIndex.setStatus('current')
usdL2fUdpIpDestLocalAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1, 1, 3), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fUdpIpDestLocalAddress.setStatus('current')
usdL2fUdpIpDestRemoteAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1, 1, 4), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fUdpIpDestRemoteAddress.setStatus('current')
usdL2fUdpIpTunnelTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1), )
if mibBuilder.loadTexts: usdL2fUdpIpTunnelTable.setStatus('current')
usdL2fUdpIpTunnelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1), ).setIndexNames((0, "Unisphere-Data-L2F-MIB", "usdL2fUdpIpTunnelIfIndex"))
if mibBuilder.loadTexts: usdL2fUdpIpTunnelEntry.setStatus('current')
usdL2fUdpIpTunnelIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdL2fUdpIpTunnelIfIndex.setStatus('current')
usdL2fUdpIpTunnelRouterIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fUdpIpTunnelRouterIndex.setStatus('current')
usdL2fUdpIpTunnelLocalAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 3), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fUdpIpTunnelLocalAddress.setStatus('current')
usdL2fUdpIpTunnelLocalPort = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fUdpIpTunnelLocalPort.setStatus('current')
usdL2fUdpIpTunnelRemoteAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 5), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fUdpIpTunnelRemoteAddress.setStatus('current')
usdL2fUdpIpTunnelRemotePort = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdL2fUdpIpTunnelRemotePort.setStatus('current')
usdL2fGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1))
usdL2fCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 2))
usdL2fCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 2, 1)).setObjects(("Unisphere-Data-L2F-MIB", "usdL2fConfigGroup"), ("Unisphere-Data-L2F-MIB", "usdL2fStatusGroup"), ("Unisphere-Data-L2F-MIB", "usdL2fStatGroup"), ("Unisphere-Data-L2F-MIB", "usdL2fMapGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdL2fCompliance = usdL2fCompliance.setStatus('current')
usdL2fConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1, 1)).setObjects(("Unisphere-Data-L2F-MIB", "usdL2fSysConfigAdminState"), ("Unisphere-Data-L2F-MIB", "usdL2fSysConfigDestructTimeout"), ("Unisphere-Data-L2F-MIB", "usdL2fSysConfigIpChecksumEnable"), ("Unisphere-Data-L2F-MIB", "usdL2fSysConfigReceiveDataSequencingIgnore"), ("Unisphere-Data-L2F-MIB", "usdL2fDestConfigRowStatus"), ("Unisphere-Data-L2F-MIB", "usdL2fDestConfigAdminState"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelConfigRowStatus"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelConfigAdminState"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionConfigRowStatus"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionConfigAdminState"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdL2fConfigGroup = usdL2fConfigGroup.setStatus('current')
usdL2fStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1, 2)).setObjects(("Unisphere-Data-L2F-MIB", "usdL2fSysStatusProtocolVersion"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusVendorName"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusFirmwareRev"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusTotalDestinations"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusFailedDestinations"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusActiveDestinations"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusTotalTunnels"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusFailedTunnels"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusFailedTunnelAuthens"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusActiveTunnels"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusTotalSessions"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusFailedSessions"), ("Unisphere-Data-L2F-MIB", "usdL2fSysStatusActiveSessions"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatusTransport"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatusEffectiveAdminState"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatusTotalTunnels"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatusFailedTunnels"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatusFailedTunnelAuthens"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatusActiveTunnels"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatusTotalSessions"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatusFailedSessions"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatusActiveSessions"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusTransport"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusLocalTunnelId"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusRemoteTunnelId"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusEffectiveAdminState"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusState"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusInitiated"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusRemoteHostName"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusTotalSessions"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusFailedSessions"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusActiveSessions"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusLastErrorCode"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusLastErrorMessage"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatusCumEstabTime"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusLocalSessionId"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusRemoteSessionId"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusUserName"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusEffectiveAdminState"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusState"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusCallType"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusTxConnectSpeed"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusRxConnectSpeed"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusProxyLcp"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusAuthMethod"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusSequencingState"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusLacTunneledIfIndex"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatusCumEstabTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdL2fStatusGroup = usdL2fStatusGroup.setStatus('current')
usdL2fStatGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1, 3)).setObjects(("Unisphere-Data-L2F-MIB", "usdL2fDestStatCtlRecvOctets"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatCtlRecvPackets"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatCtlRecvErrors"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatCtlRecvDiscards"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatCtlSendOctets"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatCtlSendPackets"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatCtlSendErrors"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatCtlSendDiscards"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatPayRecvOctets"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatPayRecvPackets"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatPayRecvErrors"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatPayRecvDiscards"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatPaySendOctets"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatPaySendPackets"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatPaySendErrors"), ("Unisphere-Data-L2F-MIB", "usdL2fDestStatPaySendDiscards"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatCtlRecvOctets"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatCtlRecvPackets"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatCtlRecvErrors"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatCtlRecvDiscards"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatCtlSendOctets"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatCtlSendPackets"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatCtlSendErrors"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatCtlSendDiscards"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatPayRecvOctets"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatPayRecvPackets"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatPayRecvErrors"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatPayRecvDiscards"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatPaySendOctets"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatPaySendPackets"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatPaySendErrors"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatPaySendDiscards"), ("Unisphere-Data-L2F-MIB", "usdL2fTunnelStatCtlRecvOutOfSequence"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatPayRecvOctets"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatPayRecvPackets"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatPayRecvErrors"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatPayRecvDiscards"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatPaySendOctets"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatPaySendPackets"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatPaySendErrors"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatPaySendDiscards"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatRecvOutOfSequence"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatResequencingTimeouts"), ("Unisphere-Data-L2F-MIB", "usdL2fSessionStatPayLostPackets"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdL2fStatGroup = usdL2fStatGroup.setStatus('current')
usdL2fMapGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1, 4)).setObjects(("Unisphere-Data-L2F-MIB", "usdL2fMapTifSidToSifSessionIfIndex"), ("Unisphere-Data-L2F-MIB", "usdL2fMapTidToTifIfIndex"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdL2fMapGroup = usdL2fMapGroup.setStatus('current')
usdL2fUdpIpGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1, 5)).setObjects(("Unisphere-Data-L2F-MIB", "usdL2fUdpIpDestRouterIndex"), ("Unisphere-Data-L2F-MIB", "usdL2fUdpIpDestLocalAddress"), ("Unisphere-Data-L2F-MIB", "usdL2fUdpIpDestRemoteAddress"), ("Unisphere-Data-L2F-MIB", "usdL2fUdpIpTunnelRouterIndex"), ("Unisphere-Data-L2F-MIB", "usdL2fUdpIpTunnelLocalAddress"), ("Unisphere-Data-L2F-MIB", "usdL2fUdpIpTunnelLocalPort"), ("Unisphere-Data-L2F-MIB", "usdL2fUdpIpTunnelRemoteAddress"), ("Unisphere-Data-L2F-MIB", "usdL2fUdpIpTunnelRemotePort"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdL2fUdpIpGroup = usdL2fUdpIpGroup.setStatus('current')
mibBuilder.exportSymbols("Unisphere-Data-L2F-MIB", usdL2fUdpIpTunnelEntry=usdL2fUdpIpTunnelEntry, usdL2fTraps=usdL2fTraps, usdL2fTunnelConfigEntry=usdL2fTunnelConfigEntry, usdL2fSessionStatusUserName=usdL2fSessionStatusUserName, usdL2fDestStatPaySendErrors=usdL2fDestStatPaySendErrors, usdL2fDestConfigIfIndex=usdL2fDestConfigIfIndex, usdL2fTunnelStatCtlSendPackets=usdL2fTunnelStatCtlSendPackets, usdL2fTunnelStatusCumEstabTime=usdL2fTunnelStatusCumEstabTime, usdL2fDestStatusTable=usdL2fDestStatusTable, usdL2fDestStatusFailedTunnelAuthens=usdL2fDestStatusFailedTunnelAuthens, usdL2fTunnelStatusTable=usdL2fTunnelStatusTable, usdL2fSessionStatistics=usdL2fSessionStatistics, usdL2fSysStatusFailedTunnels=usdL2fSysStatusFailedTunnels, usdL2fSystemStatus=usdL2fSystemStatus, usdL2fDestStatusActiveSessions=usdL2fDestStatusActiveSessions, usdL2fTunnelStatCtlRecvDiscards=usdL2fTunnelStatCtlRecvDiscards, usdL2fSysStatusActiveDestinations=usdL2fSysStatusActiveDestinations, usdL2fUdpIpTunnel=usdL2fUdpIpTunnel, usdL2fDestStatusEntry=usdL2fDestStatusEntry, usdL2fDestStatCtlRecvOctets=usdL2fDestStatCtlRecvOctets, usdL2fDestStatus=usdL2fDestStatus, usdL2fTrapControl=usdL2fTrapControl, usdL2fObjects=usdL2fObjects, usdL2fDestStatCtlRecvErrors=usdL2fDestStatCtlRecvErrors, usdL2fTunnelStatusTransport=usdL2fTunnelStatusTransport, usdL2fTransport=usdL2fTransport, usdL2fDestStatPayRecvDiscards=usdL2fDestStatPayRecvDiscards, usdL2fTunnelStatusEffectiveAdminState=usdL2fTunnelStatusEffectiveAdminState, usdL2fDestStatusIfIndex=usdL2fDestStatusIfIndex, usdL2fUdpIpDestEntry=usdL2fUdpIpDestEntry, usdL2fTunnelConfigTable=usdL2fTunnelConfigTable, usdL2fSessionStatPaySendDiscards=usdL2fSessionStatPaySendDiscards, usdL2fStatGroup=usdL2fStatGroup, usdL2fMapTidToTifLocalTunnelId=usdL2fMapTidToTifLocalTunnelId, usdL2fDestConfigEntry=usdL2fDestConfigEntry, usdL2fSessionStatusTable=usdL2fSessionStatusTable, usdL2fTunnelStatPaySendErrors=usdL2fTunnelStatPaySendErrors, usdL2fSysStatusFirmwareRev=usdL2fSysStatusFirmwareRev, usdL2fMapTidToTifTable=usdL2fMapTidToTifTable, usdL2fDestStatPayRecvPackets=usdL2fDestStatPayRecvPackets, usdL2fUdpIpDestRemoteAddress=usdL2fUdpIpDestRemoteAddress, usdL2fSession=usdL2fSession, usdL2fSysStatusProtocolVersion=usdL2fSysStatusProtocolVersion, usdL2fSysStatusVendorName=usdL2fSysStatusVendorName, usdL2fSessionConfigEntry=usdL2fSessionConfigEntry, usdL2fSessionStatPayRecvErrors=usdL2fSessionStatPayRecvErrors, usdL2fTunnelStatPayRecvPackets=usdL2fTunnelStatPayRecvPackets, usdL2fSessionConfigRowStatus=usdL2fSessionConfigRowStatus, usdL2fMapTifSidToSifTable=usdL2fMapTifSidToSifTable, usdL2fUdpIpDestIfIndex=usdL2fUdpIpDestIfIndex, usdL2fStatusGroup=usdL2fStatusGroup, usdL2fMapTifSidToSifEntry=usdL2fMapTifSidToSifEntry, usdL2fSysStatusTotalDestinations=usdL2fSysStatusTotalDestinations, usdL2fDestStatusFailedSessions=usdL2fDestStatusFailedSessions, usdL2fDestStatCtlSendOctets=usdL2fDestStatCtlSendOctets, usdL2fTunnelStatus=usdL2fTunnelStatus, usdL2fUdpIpTunnelLocalAddress=usdL2fUdpIpTunnelLocalAddress, usdL2fTunnelStatusLastErrorCode=usdL2fTunnelStatusLastErrorCode, usdL2fUdpIpDestLocalAddress=usdL2fUdpIpDestLocalAddress, usdL2fDestConfigAdminState=usdL2fDestConfigAdminState, usdL2fTunnelConfigRowStatus=usdL2fTunnelConfigRowStatus, usdL2fTunnelStatusFailedSessions=usdL2fTunnelStatusFailedSessions, usdL2fTunnelStatusActiveSessions=usdL2fTunnelStatusActiveSessions, usdL2fSessionStatusEntry=usdL2fSessionStatusEntry, usdL2fMapTidToTifEntry=usdL2fMapTidToTifEntry, usdL2fSessionConfigAdminState=usdL2fSessionConfigAdminState, usdL2fDestStatTable=usdL2fDestStatTable, usdL2fTunnelStatusTotalSessions=usdL2fTunnelStatusTotalSessions, usdL2fTunnelStatCtlSendOctets=usdL2fTunnelStatCtlSendOctets, usdL2fTunnelStatTable=usdL2fTunnelStatTable, usdL2fMapTifSidToSifLocalSessionId=usdL2fMapTifSidToSifLocalSessionId, usdL2fSessionStatPaySendOctets=usdL2fSessionStatPaySendOctets, usdL2fSystem=usdL2fSystem, usdL2fSessionStatIfIndex=usdL2fSessionStatIfIndex, usdL2fSessionConfig=usdL2fSessionConfig, usdL2fDestStatPaySendOctets=usdL2fDestStatPaySendOctets, usdL2fSessionStatResequencingTimeouts=usdL2fSessionStatResequencingTimeouts, usdL2fCompliance=usdL2fCompliance, usdL2fSessionStatusCallType=usdL2fSessionStatusCallType, usdL2fSessionStatPayRecvPackets=usdL2fSessionStatPayRecvPackets, usdL2fTunnelStatPaySendDiscards=usdL2fTunnelStatPaySendDiscards, usdL2fTunnelMap=usdL2fTunnelMap, usdL2fConformance=usdL2fConformance, usdL2fSysStatusTotalTunnels=usdL2fSysStatusTotalTunnels, usdL2fDestStatCtlRecvPackets=usdL2fDestStatCtlRecvPackets, usdL2fTunnelStatCtlRecvErrors=usdL2fTunnelStatCtlRecvErrors, usdL2fTunnelStatCtlSendErrors=usdL2fTunnelStatCtlSendErrors, usdL2fSessionStatusRxConnectSpeed=usdL2fSessionStatusRxConnectSpeed, usdL2fSystemConfig=usdL2fSystemConfig, usdL2fSessionStatusTxConnectSpeed=usdL2fSessionStatusTxConnectSpeed, usdL2fSessionStatusSequencingState=usdL2fSessionStatusSequencingState, usdL2fDestStatEntry=usdL2fDestStatEntry, usdL2fUdpIpGroup=usdL2fUdpIpGroup, usdL2fTunnelStatPaySendPackets=usdL2fTunnelStatPaySendPackets, usdL2fTunnelStatusEntry=usdL2fTunnelStatusEntry, usdL2fSessionStatusRemoteSessionId=usdL2fSessionStatusRemoteSessionId, usdL2fDestConfigTable=usdL2fDestConfigTable, usdL2fDestStatPayRecvErrors=usdL2fDestStatPayRecvErrors, usdL2fSysStatusFailedDestinations=usdL2fSysStatusFailedDestinations, usdL2fDestStatIfIndex=usdL2fDestStatIfIndex, UsdL2fTunnelId=UsdL2fTunnelId, usdL2fDestStatCtlRecvDiscards=usdL2fDestStatCtlRecvDiscards, usdL2fTunnelStatusIfIndex=usdL2fTunnelStatusIfIndex, usdL2fSessionStatusProxyLcp=usdL2fSessionStatusProxyLcp, usdL2fSessionStatusState=usdL2fSessionStatusState, usdL2fSessionStatusCumEstabTime=usdL2fSessionStatusCumEstabTime, usdL2fUdpIpDestRouterIndex=usdL2fUdpIpDestRouterIndex, UsdL2fSessionId=UsdL2fSessionId, usdL2fMIB=usdL2fMIB, usdL2fUdpIpDestTable=usdL2fUdpIpDestTable, usdL2fDestStatusTotalTunnels=usdL2fDestStatusTotalTunnels, usdL2fSessionStatus=usdL2fSessionStatus, usdL2fDestStatCtlSendErrors=usdL2fDestStatCtlSendErrors, usdL2fSessionStatusLacTunneledIfIndex=usdL2fSessionStatusLacTunneledIfIndex, usdL2fMapTifSidToSifSessionIfIndex=usdL2fMapTifSidToSifSessionIfIndex, usdL2fDestStatCtlSendPackets=usdL2fDestStatCtlSendPackets, usdL2fDestStatPaySendPackets=usdL2fDestStatPaySendPackets, usdL2fSessionStatPayRecvDiscards=usdL2fSessionStatPayRecvDiscards, usdL2fTunnel=usdL2fTunnel, usdL2fUdpIpTunnelRemoteAddress=usdL2fUdpIpTunnelRemoteAddress, usdL2fGroups=usdL2fGroups, usdL2fCompliances=usdL2fCompliances, usdL2fDestConfig=usdL2fDestConfig, UsdL2fTransport=UsdL2fTransport, usdL2fTunnelStatPayRecvDiscards=usdL2fTunnelStatPayRecvDiscards, usdL2fTransportUdpIp=usdL2fTransportUdpIp, usdL2fTunnelStatCtlRecvOutOfSequence=usdL2fTunnelStatCtlRecvOutOfSequence, UsdL2fAdminState=UsdL2fAdminState, usdL2fTunnelStatPayRecvErrors=usdL2fTunnelStatPayRecvErrors, usdL2fTunnelStatusRemoteTunnelId=usdL2fTunnelStatusRemoteTunnelId, usdL2fTunnelStatistics=usdL2fTunnelStatistics, PYSNMP_MODULE_ID=usdL2fMIB, usdL2fSessionStatusLocalSessionId=usdL2fSessionStatusLocalSessionId, usdL2fTunnelStatusLastErrorMessage=usdL2fTunnelStatusLastErrorMessage, usdL2fTunnelStatPaySendOctets=usdL2fTunnelStatPaySendOctets, usdL2fMapTifSidToSifTunnelIfIndex=usdL2fMapTifSidToSifTunnelIfIndex, usdL2fDestConfigRowStatus=usdL2fDestConfigRowStatus, usdL2fDestination=usdL2fDestination, usdL2fTunnelStatusRemoteHostName=usdL2fTunnelStatusRemoteHostName, usdL2fSysConfigDestructTimeout=usdL2fSysConfigDestructTimeout, usdL2fSessionStatRecvOutOfSequence=usdL2fSessionStatRecvOutOfSequence, usdL2fSysConfigAdminState=usdL2fSysConfigAdminState, usdL2fDestStatusEffectiveAdminState=usdL2fDestStatusEffectiveAdminState, usdL2fTunnelStatusState=usdL2fTunnelStatusState, usdL2fTunnelStatIfIndex=usdL2fTunnelStatIfIndex, usdL2fDestStatusTransport=usdL2fDestStatusTransport, usdL2fTunnelConfig=usdL2fTunnelConfig, usdL2fDestStatPaySendDiscards=usdL2fDestStatPaySendDiscards, usdL2fDestStatusActiveTunnels=usdL2fDestStatusActiveTunnels, usdL2fSysStatusFailedTunnelAuthens=usdL2fSysStatusFailedTunnelAuthens, usdL2fDestStatusTotalSessions=usdL2fDestStatusTotalSessions, usdL2fDestStatCtlSendDiscards=usdL2fDestStatCtlSendDiscards, usdL2fSessionConfigTable=usdL2fSessionConfigTable, usdL2fSessionStatPaySendErrors=usdL2fSessionStatPaySendErrors, usdL2fSessionStatPayLostPackets=usdL2fSessionStatPayLostPackets, usdL2fSysStatusFailedSessions=usdL2fSysStatusFailedSessions, usdL2fSessionStatPaySendPackets=usdL2fSessionStatPaySendPackets, usdL2fTunnelStatCtlRecvPackets=usdL2fTunnelStatCtlRecvPackets, usdL2fDestStatistics=usdL2fDestStatistics, usdL2fTunnelStatPayRecvOctets=usdL2fTunnelStatPayRecvOctets, usdL2fSysStatusActiveTunnels=usdL2fSysStatusActiveTunnels, usdL2fSessionStatusIfIndex=usdL2fSessionStatusIfIndex, usdL2fUdpIpTunnelRouterIndex=usdL2fUdpIpTunnelRouterIndex, usdL2fSysStatusActiveSessions=usdL2fSysStatusActiveSessions, usdL2fUdpIpTunnelRemotePort=usdL2fUdpIpTunnelRemotePort, usdL2fDestStatusFailedTunnels=usdL2fDestStatusFailedTunnels, usdL2fUdpIpTunnelLocalPort=usdL2fUdpIpTunnelLocalPort, usdL2fUdpIpDestination=usdL2fUdpIpDestination, usdL2fConfigGroup=usdL2fConfigGroup, usdL2fTunnelStatEntry=usdL2fTunnelStatEntry, usdL2fSessionConfigIfIndex=usdL2fSessionConfigIfIndex, usdL2fMapTidToTifIfIndex=usdL2fMapTidToTifIfIndex, usdL2fTunnelConfigIfIndex=usdL2fTunnelConfigIfIndex, usdL2fTunnelStatusLocalTunnelId=usdL2fTunnelStatusLocalTunnelId, usdL2fDestStatPayRecvOctets=usdL2fDestStatPayRecvOctets, usdL2fTunnelStatCtlSendDiscards=usdL2fTunnelStatCtlSendDiscards, usdL2fSysConfigReceiveDataSequencingIgnore=usdL2fSysConfigReceiveDataSequencingIgnore, usdL2fSessionStatusEffectiveAdminState=usdL2fSessionStatusEffectiveAdminState, usdL2fUdpIpTunnelTable=usdL2fUdpIpTunnelTable, usdL2fSessionStatTable=usdL2fSessionStatTable, usdL2fSessionStatPayRecvOctets=usdL2fSessionStatPayRecvOctets, usdL2fSysStatusTotalSessions=usdL2fSysStatusTotalSessions, usdL2fUdpIpTunnelIfIndex=usdL2fUdpIpTunnelIfIndex, usdL2fTunnelStatCtlRecvOctets=usdL2fTunnelStatCtlRecvOctets, usdL2fSessionStatusAuthMethod=usdL2fSessionStatusAuthMethod, usdL2fSessionStatEntry=usdL2fSessionStatEntry, usdL2fMapGroup=usdL2fMapGroup, usdL2fTunnelConfigAdminState=usdL2fTunnelConfigAdminState, usdL2fTunnelStatusInitiated=usdL2fTunnelStatusInitiated, usdL2fSysConfigIpChecksumEnable=usdL2fSysConfigIpChecksumEnable)
| (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, value_range_constraint, value_size_constraint, constraints_intersection, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint')
(interface_index, interface_index_or_zero) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex', 'InterfaceIndexOrZero')
(notification_group, module_compliance, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance', 'ObjectGroup')
(ip_address, module_identity, object_identity, notification_type, bits, integer32, iso, counter32, unsigned32, time_ticks, mib_identifier, counter64, mib_scalar, mib_table, mib_table_row, mib_table_column, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'IpAddress', 'ModuleIdentity', 'ObjectIdentity', 'NotificationType', 'Bits', 'Integer32', 'iso', 'Counter32', 'Unsigned32', 'TimeTicks', 'MibIdentifier', 'Counter64', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Gauge32')
(truth_value, textual_convention, display_string, row_status) = mibBuilder.importSymbols('SNMPv2-TC', 'TruthValue', 'TextualConvention', 'DisplayString', 'RowStatus')
(us_data_mibs,) = mibBuilder.importSymbols('Unisphere-Data-MIBs', 'usDataMibs')
(usd_enable,) = mibBuilder.importSymbols('Unisphere-Data-TC', 'UsdEnable')
usd_l2f_mib = module_identity((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53))
usdL2fMIB.setRevisions(('2001-09-25 13:54', '2001-09-19 18:07'))
if mibBuilder.loadTexts:
usdL2fMIB.setLastUpdated('200109251354Z')
if mibBuilder.loadTexts:
usdL2fMIB.setOrganization('Unisphere Networks, Inc.')
class Usdl2Ftunnelid(TextualConvention, Integer32):
status = 'current'
subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 65535)
class Usdl2Fsessionid(TextualConvention, Integer32):
status = 'current'
subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 65535)
class Usdl2Fadminstate(TextualConvention, Integer32):
status = 'current'
subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1, 2))
named_values = named_values(('enabled', 0), ('disabled', 1), ('drain', 2))
class Usdl2Ftransport(TextualConvention, Integer32):
status = 'current'
subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1))
named_values = named_values(('other', 0), ('udpIp', 1))
usd_l2f_traps = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 0))
usd_l2f_objects = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1))
usd_l2f_trap_control = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 2))
usd_l2f_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3))
usd_l2f_system = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1))
usd_l2f_destination = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2))
usd_l2f_tunnel = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3))
usd_l2f_session = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4))
usd_l2f_transport = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5))
usd_l2f_system_config = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 1))
usd_l2f_system_status = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2))
usd_l2f_sys_config_admin_state = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 1, 1), usd_l2f_admin_state()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
usdL2fSysConfigAdminState.setStatus('current')
usd_l2f_sys_config_destruct_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 3600))).setUnits('seconds').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
usdL2fSysConfigDestructTimeout.setStatus('current')
usd_l2f_sys_config_ip_checksum_enable = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 1, 3), usd_enable()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
usdL2fSysConfigIpChecksumEnable.setStatus('current')
usd_l2f_sys_config_receive_data_sequencing_ignore = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 1, 4), usd_enable()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
usdL2fSysConfigReceiveDataSequencingIgnore.setStatus('current')
usd_l2f_sys_status_protocol_version = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 1), octet_string().subtype(subtypeSpec=value_size_constraint(2, 256))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusProtocolVersion.setStatus('current')
usd_l2f_sys_status_vendor_name = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusVendorName.setStatus('current')
usd_l2f_sys_status_firmware_rev = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusFirmwareRev.setStatus('current')
usd_l2f_sys_status_total_destinations = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusTotalDestinations.setStatus('current')
usd_l2f_sys_status_failed_destinations = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusFailedDestinations.setStatus('current')
usd_l2f_sys_status_active_destinations = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 6), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusActiveDestinations.setStatus('current')
usd_l2f_sys_status_total_tunnels = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 7), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusTotalTunnels.setStatus('current')
usd_l2f_sys_status_failed_tunnels = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 8), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusFailedTunnels.setStatus('current')
usd_l2f_sys_status_failed_tunnel_authens = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusFailedTunnelAuthens.setStatus('current')
usd_l2f_sys_status_active_tunnels = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 10), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusActiveTunnels.setStatus('current')
usd_l2f_sys_status_total_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 11), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusTotalSessions.setStatus('current')
usd_l2f_sys_status_failed_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 12), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusFailedSessions.setStatus('current')
usd_l2f_sys_status_active_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 1, 2, 13), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSysStatusActiveSessions.setStatus('current')
usd_l2f_dest_config = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1))
usd_l2f_dest_status = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2))
usd_l2f_dest_statistics = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3))
usd_l2f_dest_config_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1, 2))
if mibBuilder.loadTexts:
usdL2fDestConfigTable.setStatus('current')
usd_l2f_dest_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1, 2, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fDestConfigIfIndex'))
if mibBuilder.loadTexts:
usdL2fDestConfigEntry.setStatus('current')
usd_l2f_dest_config_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1, 2, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fDestConfigIfIndex.setStatus('current')
usd_l2f_dest_config_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1, 2, 1, 2), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
usdL2fDestConfigRowStatus.setStatus('current')
usd_l2f_dest_config_admin_state = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 1, 2, 1, 3), usd_l2f_admin_state().clone('enabled')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
usdL2fDestConfigAdminState.setStatus('current')
usd_l2f_dest_status_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1))
if mibBuilder.loadTexts:
usdL2fDestStatusTable.setStatus('current')
usd_l2f_dest_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fDestStatusIfIndex'))
if mibBuilder.loadTexts:
usdL2fDestStatusEntry.setStatus('current')
usd_l2f_dest_status_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fDestStatusIfIndex.setStatus('current')
usd_l2f_dest_status_transport = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 2), usd_l2f_transport()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatusTransport.setStatus('current')
usd_l2f_dest_status_effective_admin_state = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 3), usd_l2f_admin_state()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatusEffectiveAdminState.setStatus('current')
usd_l2f_dest_status_total_tunnels = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatusTotalTunnels.setStatus('current')
usd_l2f_dest_status_failed_tunnels = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatusFailedTunnels.setStatus('current')
usd_l2f_dest_status_failed_tunnel_authens = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 6), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatusFailedTunnelAuthens.setStatus('current')
usd_l2f_dest_status_active_tunnels = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 7), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatusActiveTunnels.setStatus('current')
usd_l2f_dest_status_total_sessions = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 8), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatusTotalSessions.setStatus('current')
usd_l2f_dest_status_failed_sessions = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatusFailedSessions.setStatus('current')
usd_l2f_dest_status_active_sessions = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 2, 1, 1, 10), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatusActiveSessions.setStatus('current')
usd_l2f_dest_stat_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1))
if mibBuilder.loadTexts:
usdL2fDestStatTable.setStatus('current')
usd_l2f_dest_stat_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fDestStatIfIndex'))
if mibBuilder.loadTexts:
usdL2fDestStatEntry.setStatus('current')
usd_l2f_dest_stat_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fDestStatIfIndex.setStatus('current')
usd_l2f_dest_stat_ctl_recv_octets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatCtlRecvOctets.setStatus('current')
usd_l2f_dest_stat_ctl_recv_packets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatCtlRecvPackets.setStatus('current')
usd_l2f_dest_stat_ctl_recv_errors = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatCtlRecvErrors.setStatus('current')
usd_l2f_dest_stat_ctl_recv_discards = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatCtlRecvDiscards.setStatus('current')
usd_l2f_dest_stat_ctl_send_octets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 6), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatCtlSendOctets.setStatus('current')
usd_l2f_dest_stat_ctl_send_packets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 7), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatCtlSendPackets.setStatus('current')
usd_l2f_dest_stat_ctl_send_errors = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 8), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatCtlSendErrors.setStatus('current')
usd_l2f_dest_stat_ctl_send_discards = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatCtlSendDiscards.setStatus('current')
usd_l2f_dest_stat_pay_recv_octets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 10), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatPayRecvOctets.setStatus('current')
usd_l2f_dest_stat_pay_recv_packets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 11), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatPayRecvPackets.setStatus('current')
usd_l2f_dest_stat_pay_recv_errors = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 12), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatPayRecvErrors.setStatus('current')
usd_l2f_dest_stat_pay_recv_discards = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 13), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatPayRecvDiscards.setStatus('current')
usd_l2f_dest_stat_pay_send_octets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 14), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatPaySendOctets.setStatus('current')
usd_l2f_dest_stat_pay_send_packets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 15), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatPaySendPackets.setStatus('current')
usd_l2f_dest_stat_pay_send_errors = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 16), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatPaySendErrors.setStatus('current')
usd_l2f_dest_stat_pay_send_discards = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 2, 3, 1, 1, 17), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fDestStatPaySendDiscards.setStatus('current')
usd_l2f_tunnel_config = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1))
usd_l2f_tunnel_status = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2))
usd_l2f_tunnel_statistics = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3))
usd_l2f_tunnel_map = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4))
usd_l2f_tunnel_config_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1, 2))
if mibBuilder.loadTexts:
usdL2fTunnelConfigTable.setStatus('current')
usd_l2f_tunnel_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1, 2, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fTunnelConfigIfIndex'))
if mibBuilder.loadTexts:
usdL2fTunnelConfigEntry.setStatus('current')
usd_l2f_tunnel_config_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1, 2, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fTunnelConfigIfIndex.setStatus('current')
usd_l2f_tunnel_config_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1, 2, 1, 2), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
usdL2fTunnelConfigRowStatus.setStatus('current')
usd_l2f_tunnel_config_admin_state = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 1, 2, 1, 3), usd_l2f_admin_state().clone('enabled')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
usdL2fTunnelConfigAdminState.setStatus('current')
usd_l2f_tunnel_status_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1))
if mibBuilder.loadTexts:
usdL2fTunnelStatusTable.setStatus('current')
usd_l2f_tunnel_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusIfIndex'))
if mibBuilder.loadTexts:
usdL2fTunnelStatusEntry.setStatus('current')
usd_l2f_tunnel_status_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fTunnelStatusIfIndex.setStatus('current')
usd_l2f_tunnel_status_transport = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 2), usd_l2f_transport()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusTransport.setStatus('current')
usd_l2f_tunnel_status_local_tunnel_id = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 3), usd_l2f_tunnel_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusLocalTunnelId.setStatus('current')
usd_l2f_tunnel_status_remote_tunnel_id = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 4), usd_l2f_tunnel_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusRemoteTunnelId.setStatus('current')
usd_l2f_tunnel_status_effective_admin_state = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 5), usd_l2f_admin_state()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusEffectiveAdminState.setStatus('current')
usd_l2f_tunnel_status_state = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('idle', 0), ('connecting', 1), ('established', 2), ('disconnecting', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusState.setStatus('current')
usd_l2f_tunnel_status_initiated = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('none', 0), ('local', 1), ('remote', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusInitiated.setStatus('current')
usd_l2f_tunnel_status_remote_host_name = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 8), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusRemoteHostName.setStatus('current')
usd_l2f_tunnel_status_total_sessions = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusTotalSessions.setStatus('current')
usd_l2f_tunnel_status_failed_sessions = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 10), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusFailedSessions.setStatus('current')
usd_l2f_tunnel_status_active_sessions = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 11), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusActiveSessions.setStatus('current')
usd_l2f_tunnel_status_last_error_code = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusLastErrorCode.setStatus('current')
usd_l2f_tunnel_status_last_error_message = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 13), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusLastErrorMessage.setStatus('current')
usd_l2f_tunnel_status_cum_estab_time = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 2, 1, 1, 14), unsigned32()).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatusCumEstabTime.setStatus('current')
usd_l2f_tunnel_stat_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1))
if mibBuilder.loadTexts:
usdL2fTunnelStatTable.setStatus('current')
usd_l2f_tunnel_stat_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatIfIndex'))
if mibBuilder.loadTexts:
usdL2fTunnelStatEntry.setStatus('current')
usd_l2f_tunnel_stat_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fTunnelStatIfIndex.setStatus('current')
usd_l2f_tunnel_stat_ctl_recv_octets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatCtlRecvOctets.setStatus('current')
usd_l2f_tunnel_stat_ctl_recv_packets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatCtlRecvPackets.setStatus('current')
usd_l2f_tunnel_stat_ctl_recv_errors = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatCtlRecvErrors.setStatus('current')
usd_l2f_tunnel_stat_ctl_recv_discards = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatCtlRecvDiscards.setStatus('current')
usd_l2f_tunnel_stat_ctl_send_octets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 6), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatCtlSendOctets.setStatus('current')
usd_l2f_tunnel_stat_ctl_send_packets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 7), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatCtlSendPackets.setStatus('current')
usd_l2f_tunnel_stat_ctl_send_errors = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 8), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatCtlSendErrors.setStatus('current')
usd_l2f_tunnel_stat_ctl_send_discards = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatCtlSendDiscards.setStatus('current')
usd_l2f_tunnel_stat_pay_recv_octets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 10), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatPayRecvOctets.setStatus('current')
usd_l2f_tunnel_stat_pay_recv_packets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 11), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatPayRecvPackets.setStatus('current')
usd_l2f_tunnel_stat_pay_recv_errors = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 12), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatPayRecvErrors.setStatus('current')
usd_l2f_tunnel_stat_pay_recv_discards = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 13), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatPayRecvDiscards.setStatus('current')
usd_l2f_tunnel_stat_pay_send_octets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 14), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatPaySendOctets.setStatus('current')
usd_l2f_tunnel_stat_pay_send_packets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 15), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatPaySendPackets.setStatus('current')
usd_l2f_tunnel_stat_pay_send_errors = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 16), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatPaySendErrors.setStatus('current')
usd_l2f_tunnel_stat_pay_send_discards = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 17), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatPaySendDiscards.setStatus('current')
usd_l2f_tunnel_stat_ctl_recv_out_of_sequence = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 3, 1, 1, 18), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fTunnelStatCtlRecvOutOfSequence.setStatus('current')
usd_l2f_map_tif_sid_to_sif_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 1))
if mibBuilder.loadTexts:
usdL2fMapTifSidToSifTable.setStatus('current')
usd_l2f_map_tif_sid_to_sif_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 1, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fMapTifSidToSifTunnelIfIndex'), (0, 'Unisphere-Data-L2F-MIB', 'usdL2fMapTifSidToSifLocalSessionId'))
if mibBuilder.loadTexts:
usdL2fMapTifSidToSifEntry.setStatus('current')
usd_l2f_map_tif_sid_to_sif_tunnel_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 1, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fMapTifSidToSifTunnelIfIndex.setStatus('current')
usd_l2f_map_tif_sid_to_sif_local_session_id = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 1, 1, 2), usd_l2f_session_id())
if mibBuilder.loadTexts:
usdL2fMapTifSidToSifLocalSessionId.setStatus('current')
usd_l2f_map_tif_sid_to_sif_session_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 1, 1, 3), interface_index()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fMapTifSidToSifSessionIfIndex.setStatus('current')
usd_l2f_map_tid_to_tif_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 2))
if mibBuilder.loadTexts:
usdL2fMapTidToTifTable.setStatus('current')
usd_l2f_map_tid_to_tif_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 2, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fMapTidToTifLocalTunnelId'))
if mibBuilder.loadTexts:
usdL2fMapTidToTifEntry.setStatus('current')
usd_l2f_map_tid_to_tif_local_tunnel_id = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 2, 1, 1), usd_l2f_tunnel_id())
if mibBuilder.loadTexts:
usdL2fMapTidToTifLocalTunnelId.setStatus('current')
usd_l2f_map_tid_to_tif_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 3, 4, 2, 1, 2), interface_index()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fMapTidToTifIfIndex.setStatus('current')
usd_l2f_session_config = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1))
usd_l2f_session_status = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2))
usd_l2f_session_statistics = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3))
usd_l2f_session_config_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1, 2))
if mibBuilder.loadTexts:
usdL2fSessionConfigTable.setStatus('current')
usd_l2f_session_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1, 2, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fSessionConfigIfIndex'))
if mibBuilder.loadTexts:
usdL2fSessionConfigEntry.setStatus('current')
usd_l2f_session_config_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1, 2, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fSessionConfigIfIndex.setStatus('current')
usd_l2f_session_config_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1, 2, 1, 2), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
usdL2fSessionConfigRowStatus.setStatus('current')
usd_l2f_session_config_admin_state = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 1, 2, 1, 3), usd_l2f_admin_state().clone('enabled')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
usdL2fSessionConfigAdminState.setStatus('current')
usd_l2f_session_status_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1))
if mibBuilder.loadTexts:
usdL2fSessionStatusTable.setStatus('current')
usd_l2f_session_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusIfIndex'))
if mibBuilder.loadTexts:
usdL2fSessionStatusEntry.setStatus('current')
usd_l2f_session_status_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fSessionStatusIfIndex.setStatus('current')
usd_l2f_session_status_local_session_id = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 2), usd_l2f_session_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusLocalSessionId.setStatus('current')
usd_l2f_session_status_remote_session_id = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 3), usd_l2f_session_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusRemoteSessionId.setStatus('current')
usd_l2f_session_status_user_name = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 4), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusUserName.setStatus('current')
usd_l2f_session_status_effective_admin_state = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 5), usd_l2f_admin_state()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusEffectiveAdminState.setStatus('current')
usd_l2f_session_status_state = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('idle', 0), ('connecting', 1), ('established', 2), ('disconnecting', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusState.setStatus('current')
usd_l2f_session_status_call_type = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4))).clone(namedValues=named_values(('none', 0), ('lacIncoming', 1), ('lnsIncoming', 2), ('lacOutgoing', 3), ('lnsOutgoing', 4)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusCallType.setStatus('current')
usd_l2f_session_status_tx_connect_speed = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 8), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusTxConnectSpeed.setStatus('current')
usd_l2f_session_status_rx_connect_speed = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusRxConnectSpeed.setStatus('current')
usd_l2f_session_status_proxy_lcp = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 10), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusProxyLcp.setStatus('current')
usd_l2f_session_status_auth_method = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('none', 0), ('pppChap', 1), ('pppPap', 2), ('pppMsChap', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusAuthMethod.setStatus('current')
usd_l2f_session_status_sequencing_state = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('none', 0), ('remote', 1), ('local', 2), ('both', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusSequencingState.setStatus('current')
usd_l2f_session_status_lac_tunneled_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 13), interface_index_or_zero()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusLacTunneledIfIndex.setStatus('current')
usd_l2f_session_status_cum_estab_time = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 2, 1, 1, 14), unsigned32()).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatusCumEstabTime.setStatus('current')
usd_l2f_session_stat_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1))
if mibBuilder.loadTexts:
usdL2fSessionStatTable.setStatus('current')
usd_l2f_session_stat_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fSessionStatIfIndex'))
if mibBuilder.loadTexts:
usdL2fSessionStatEntry.setStatus('current')
usd_l2f_session_stat_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fSessionStatIfIndex.setStatus('current')
usd_l2f_session_stat_pay_recv_octets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatPayRecvOctets.setStatus('current')
usd_l2f_session_stat_pay_recv_packets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatPayRecvPackets.setStatus('current')
usd_l2f_session_stat_pay_recv_errors = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatPayRecvErrors.setStatus('current')
usd_l2f_session_stat_pay_recv_discards = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatPayRecvDiscards.setStatus('current')
usd_l2f_session_stat_pay_send_octets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 6), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatPaySendOctets.setStatus('current')
usd_l2f_session_stat_pay_send_packets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 7), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatPaySendPackets.setStatus('current')
usd_l2f_session_stat_pay_send_errors = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 8), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatPaySendErrors.setStatus('current')
usd_l2f_session_stat_pay_send_discards = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatPaySendDiscards.setStatus('current')
usd_l2f_session_stat_recv_out_of_sequence = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 10), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatRecvOutOfSequence.setStatus('current')
usd_l2f_session_stat_resequencing_timeouts = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 11), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatResequencingTimeouts.setStatus('current')
usd_l2f_session_stat_pay_lost_packets = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 4, 3, 1, 1, 12), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fSessionStatPayLostPackets.setStatus('current')
usd_l2f_transport_udp_ip = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1))
usd_l2f_udp_ip_destination = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1))
usd_l2f_udp_ip_tunnel = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2))
usd_l2f_udp_ip_dest_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1))
if mibBuilder.loadTexts:
usdL2fUdpIpDestTable.setStatus('current')
usd_l2f_udp_ip_dest_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fUdpIpDestIfIndex'))
if mibBuilder.loadTexts:
usdL2fUdpIpDestEntry.setStatus('current')
usd_l2f_udp_ip_dest_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fUdpIpDestIfIndex.setStatus('current')
usd_l2f_udp_ip_dest_router_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1, 1, 2), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fUdpIpDestRouterIndex.setStatus('current')
usd_l2f_udp_ip_dest_local_address = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1, 1, 3), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fUdpIpDestLocalAddress.setStatus('current')
usd_l2f_udp_ip_dest_remote_address = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 1, 1, 1, 4), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fUdpIpDestRemoteAddress.setStatus('current')
usd_l2f_udp_ip_tunnel_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1))
if mibBuilder.loadTexts:
usdL2fUdpIpTunnelTable.setStatus('current')
usd_l2f_udp_ip_tunnel_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1)).setIndexNames((0, 'Unisphere-Data-L2F-MIB', 'usdL2fUdpIpTunnelIfIndex'))
if mibBuilder.loadTexts:
usdL2fUdpIpTunnelEntry.setStatus('current')
usd_l2f_udp_ip_tunnel_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 1), interface_index())
if mibBuilder.loadTexts:
usdL2fUdpIpTunnelIfIndex.setStatus('current')
usd_l2f_udp_ip_tunnel_router_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 2), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fUdpIpTunnelRouterIndex.setStatus('current')
usd_l2f_udp_ip_tunnel_local_address = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 3), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fUdpIpTunnelLocalAddress.setStatus('current')
usd_l2f_udp_ip_tunnel_local_port = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fUdpIpTunnelLocalPort.setStatus('current')
usd_l2f_udp_ip_tunnel_remote_address = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 5), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fUdpIpTunnelRemoteAddress.setStatus('current')
usd_l2f_udp_ip_tunnel_remote_port = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 1, 5, 1, 2, 1, 1, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
usdL2fUdpIpTunnelRemotePort.setStatus('current')
usd_l2f_groups = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1))
usd_l2f_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 2))
usd_l2f_compliance = module_compliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 2, 1)).setObjects(('Unisphere-Data-L2F-MIB', 'usdL2fConfigGroup'), ('Unisphere-Data-L2F-MIB', 'usdL2fStatusGroup'), ('Unisphere-Data-L2F-MIB', 'usdL2fStatGroup'), ('Unisphere-Data-L2F-MIB', 'usdL2fMapGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usd_l2f_compliance = usdL2fCompliance.setStatus('current')
usd_l2f_config_group = object_group((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1, 1)).setObjects(('Unisphere-Data-L2F-MIB', 'usdL2fSysConfigAdminState'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysConfigDestructTimeout'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysConfigIpChecksumEnable'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysConfigReceiveDataSequencingIgnore'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestConfigRowStatus'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestConfigAdminState'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelConfigRowStatus'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelConfigAdminState'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionConfigRowStatus'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionConfigAdminState'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usd_l2f_config_group = usdL2fConfigGroup.setStatus('current')
usd_l2f_status_group = object_group((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1, 2)).setObjects(('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusProtocolVersion'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusVendorName'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusFirmwareRev'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusTotalDestinations'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusFailedDestinations'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusActiveDestinations'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusTotalTunnels'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusFailedTunnels'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusFailedTunnelAuthens'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusActiveTunnels'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusTotalSessions'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusFailedSessions'), ('Unisphere-Data-L2F-MIB', 'usdL2fSysStatusActiveSessions'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatusTransport'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatusEffectiveAdminState'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatusTotalTunnels'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatusFailedTunnels'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatusFailedTunnelAuthens'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatusActiveTunnels'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatusTotalSessions'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatusFailedSessions'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatusActiveSessions'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusTransport'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusLocalTunnelId'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusRemoteTunnelId'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusEffectiveAdminState'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusState'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusInitiated'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusRemoteHostName'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusTotalSessions'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusFailedSessions'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusActiveSessions'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusLastErrorCode'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusLastErrorMessage'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatusCumEstabTime'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusLocalSessionId'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusRemoteSessionId'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusUserName'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusEffectiveAdminState'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusState'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusCallType'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusTxConnectSpeed'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusRxConnectSpeed'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusProxyLcp'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusAuthMethod'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusSequencingState'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusLacTunneledIfIndex'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatusCumEstabTime'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usd_l2f_status_group = usdL2fStatusGroup.setStatus('current')
usd_l2f_stat_group = object_group((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1, 3)).setObjects(('Unisphere-Data-L2F-MIB', 'usdL2fDestStatCtlRecvOctets'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatCtlRecvPackets'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatCtlRecvErrors'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatCtlRecvDiscards'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatCtlSendOctets'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatCtlSendPackets'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatCtlSendErrors'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatCtlSendDiscards'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatPayRecvOctets'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatPayRecvPackets'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatPayRecvErrors'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatPayRecvDiscards'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatPaySendOctets'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatPaySendPackets'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatPaySendErrors'), ('Unisphere-Data-L2F-MIB', 'usdL2fDestStatPaySendDiscards'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatCtlRecvOctets'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatCtlRecvPackets'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatCtlRecvErrors'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatCtlRecvDiscards'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatCtlSendOctets'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatCtlSendPackets'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatCtlSendErrors'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatCtlSendDiscards'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatPayRecvOctets'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatPayRecvPackets'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatPayRecvErrors'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatPayRecvDiscards'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatPaySendOctets'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatPaySendPackets'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatPaySendErrors'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatPaySendDiscards'), ('Unisphere-Data-L2F-MIB', 'usdL2fTunnelStatCtlRecvOutOfSequence'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatPayRecvOctets'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatPayRecvPackets'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatPayRecvErrors'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatPayRecvDiscards'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatPaySendOctets'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatPaySendPackets'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatPaySendErrors'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatPaySendDiscards'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatRecvOutOfSequence'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatResequencingTimeouts'), ('Unisphere-Data-L2F-MIB', 'usdL2fSessionStatPayLostPackets'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usd_l2f_stat_group = usdL2fStatGroup.setStatus('current')
usd_l2f_map_group = object_group((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1, 4)).setObjects(('Unisphere-Data-L2F-MIB', 'usdL2fMapTifSidToSifSessionIfIndex'), ('Unisphere-Data-L2F-MIB', 'usdL2fMapTidToTifIfIndex'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usd_l2f_map_group = usdL2fMapGroup.setStatus('current')
usd_l2f_udp_ip_group = object_group((1, 3, 6, 1, 4, 1, 4874, 2, 2, 53, 3, 1, 5)).setObjects(('Unisphere-Data-L2F-MIB', 'usdL2fUdpIpDestRouterIndex'), ('Unisphere-Data-L2F-MIB', 'usdL2fUdpIpDestLocalAddress'), ('Unisphere-Data-L2F-MIB', 'usdL2fUdpIpDestRemoteAddress'), ('Unisphere-Data-L2F-MIB', 'usdL2fUdpIpTunnelRouterIndex'), ('Unisphere-Data-L2F-MIB', 'usdL2fUdpIpTunnelLocalAddress'), ('Unisphere-Data-L2F-MIB', 'usdL2fUdpIpTunnelLocalPort'), ('Unisphere-Data-L2F-MIB', 'usdL2fUdpIpTunnelRemoteAddress'), ('Unisphere-Data-L2F-MIB', 'usdL2fUdpIpTunnelRemotePort'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usd_l2f_udp_ip_group = usdL2fUdpIpGroup.setStatus('current')
mibBuilder.exportSymbols('Unisphere-Data-L2F-MIB', usdL2fUdpIpTunnelEntry=usdL2fUdpIpTunnelEntry, usdL2fTraps=usdL2fTraps, usdL2fTunnelConfigEntry=usdL2fTunnelConfigEntry, usdL2fSessionStatusUserName=usdL2fSessionStatusUserName, usdL2fDestStatPaySendErrors=usdL2fDestStatPaySendErrors, usdL2fDestConfigIfIndex=usdL2fDestConfigIfIndex, usdL2fTunnelStatCtlSendPackets=usdL2fTunnelStatCtlSendPackets, usdL2fTunnelStatusCumEstabTime=usdL2fTunnelStatusCumEstabTime, usdL2fDestStatusTable=usdL2fDestStatusTable, usdL2fDestStatusFailedTunnelAuthens=usdL2fDestStatusFailedTunnelAuthens, usdL2fTunnelStatusTable=usdL2fTunnelStatusTable, usdL2fSessionStatistics=usdL2fSessionStatistics, usdL2fSysStatusFailedTunnels=usdL2fSysStatusFailedTunnels, usdL2fSystemStatus=usdL2fSystemStatus, usdL2fDestStatusActiveSessions=usdL2fDestStatusActiveSessions, usdL2fTunnelStatCtlRecvDiscards=usdL2fTunnelStatCtlRecvDiscards, usdL2fSysStatusActiveDestinations=usdL2fSysStatusActiveDestinations, usdL2fUdpIpTunnel=usdL2fUdpIpTunnel, usdL2fDestStatusEntry=usdL2fDestStatusEntry, usdL2fDestStatCtlRecvOctets=usdL2fDestStatCtlRecvOctets, usdL2fDestStatus=usdL2fDestStatus, usdL2fTrapControl=usdL2fTrapControl, usdL2fObjects=usdL2fObjects, usdL2fDestStatCtlRecvErrors=usdL2fDestStatCtlRecvErrors, usdL2fTunnelStatusTransport=usdL2fTunnelStatusTransport, usdL2fTransport=usdL2fTransport, usdL2fDestStatPayRecvDiscards=usdL2fDestStatPayRecvDiscards, usdL2fTunnelStatusEffectiveAdminState=usdL2fTunnelStatusEffectiveAdminState, usdL2fDestStatusIfIndex=usdL2fDestStatusIfIndex, usdL2fUdpIpDestEntry=usdL2fUdpIpDestEntry, usdL2fTunnelConfigTable=usdL2fTunnelConfigTable, usdL2fSessionStatPaySendDiscards=usdL2fSessionStatPaySendDiscards, usdL2fStatGroup=usdL2fStatGroup, usdL2fMapTidToTifLocalTunnelId=usdL2fMapTidToTifLocalTunnelId, usdL2fDestConfigEntry=usdL2fDestConfigEntry, usdL2fSessionStatusTable=usdL2fSessionStatusTable, usdL2fTunnelStatPaySendErrors=usdL2fTunnelStatPaySendErrors, usdL2fSysStatusFirmwareRev=usdL2fSysStatusFirmwareRev, usdL2fMapTidToTifTable=usdL2fMapTidToTifTable, usdL2fDestStatPayRecvPackets=usdL2fDestStatPayRecvPackets, usdL2fUdpIpDestRemoteAddress=usdL2fUdpIpDestRemoteAddress, usdL2fSession=usdL2fSession, usdL2fSysStatusProtocolVersion=usdL2fSysStatusProtocolVersion, usdL2fSysStatusVendorName=usdL2fSysStatusVendorName, usdL2fSessionConfigEntry=usdL2fSessionConfigEntry, usdL2fSessionStatPayRecvErrors=usdL2fSessionStatPayRecvErrors, usdL2fTunnelStatPayRecvPackets=usdL2fTunnelStatPayRecvPackets, usdL2fSessionConfigRowStatus=usdL2fSessionConfigRowStatus, usdL2fMapTifSidToSifTable=usdL2fMapTifSidToSifTable, usdL2fUdpIpDestIfIndex=usdL2fUdpIpDestIfIndex, usdL2fStatusGroup=usdL2fStatusGroup, usdL2fMapTifSidToSifEntry=usdL2fMapTifSidToSifEntry, usdL2fSysStatusTotalDestinations=usdL2fSysStatusTotalDestinations, usdL2fDestStatusFailedSessions=usdL2fDestStatusFailedSessions, usdL2fDestStatCtlSendOctets=usdL2fDestStatCtlSendOctets, usdL2fTunnelStatus=usdL2fTunnelStatus, usdL2fUdpIpTunnelLocalAddress=usdL2fUdpIpTunnelLocalAddress, usdL2fTunnelStatusLastErrorCode=usdL2fTunnelStatusLastErrorCode, usdL2fUdpIpDestLocalAddress=usdL2fUdpIpDestLocalAddress, usdL2fDestConfigAdminState=usdL2fDestConfigAdminState, usdL2fTunnelConfigRowStatus=usdL2fTunnelConfigRowStatus, usdL2fTunnelStatusFailedSessions=usdL2fTunnelStatusFailedSessions, usdL2fTunnelStatusActiveSessions=usdL2fTunnelStatusActiveSessions, usdL2fSessionStatusEntry=usdL2fSessionStatusEntry, usdL2fMapTidToTifEntry=usdL2fMapTidToTifEntry, usdL2fSessionConfigAdminState=usdL2fSessionConfigAdminState, usdL2fDestStatTable=usdL2fDestStatTable, usdL2fTunnelStatusTotalSessions=usdL2fTunnelStatusTotalSessions, usdL2fTunnelStatCtlSendOctets=usdL2fTunnelStatCtlSendOctets, usdL2fTunnelStatTable=usdL2fTunnelStatTable, usdL2fMapTifSidToSifLocalSessionId=usdL2fMapTifSidToSifLocalSessionId, usdL2fSessionStatPaySendOctets=usdL2fSessionStatPaySendOctets, usdL2fSystem=usdL2fSystem, usdL2fSessionStatIfIndex=usdL2fSessionStatIfIndex, usdL2fSessionConfig=usdL2fSessionConfig, usdL2fDestStatPaySendOctets=usdL2fDestStatPaySendOctets, usdL2fSessionStatResequencingTimeouts=usdL2fSessionStatResequencingTimeouts, usdL2fCompliance=usdL2fCompliance, usdL2fSessionStatusCallType=usdL2fSessionStatusCallType, usdL2fSessionStatPayRecvPackets=usdL2fSessionStatPayRecvPackets, usdL2fTunnelStatPaySendDiscards=usdL2fTunnelStatPaySendDiscards, usdL2fTunnelMap=usdL2fTunnelMap, usdL2fConformance=usdL2fConformance, usdL2fSysStatusTotalTunnels=usdL2fSysStatusTotalTunnels, usdL2fDestStatCtlRecvPackets=usdL2fDestStatCtlRecvPackets, usdL2fTunnelStatCtlRecvErrors=usdL2fTunnelStatCtlRecvErrors, usdL2fTunnelStatCtlSendErrors=usdL2fTunnelStatCtlSendErrors, usdL2fSessionStatusRxConnectSpeed=usdL2fSessionStatusRxConnectSpeed, usdL2fSystemConfig=usdL2fSystemConfig, usdL2fSessionStatusTxConnectSpeed=usdL2fSessionStatusTxConnectSpeed, usdL2fSessionStatusSequencingState=usdL2fSessionStatusSequencingState, usdL2fDestStatEntry=usdL2fDestStatEntry, usdL2fUdpIpGroup=usdL2fUdpIpGroup, usdL2fTunnelStatPaySendPackets=usdL2fTunnelStatPaySendPackets, usdL2fTunnelStatusEntry=usdL2fTunnelStatusEntry, usdL2fSessionStatusRemoteSessionId=usdL2fSessionStatusRemoteSessionId, usdL2fDestConfigTable=usdL2fDestConfigTable, usdL2fDestStatPayRecvErrors=usdL2fDestStatPayRecvErrors, usdL2fSysStatusFailedDestinations=usdL2fSysStatusFailedDestinations, usdL2fDestStatIfIndex=usdL2fDestStatIfIndex, UsdL2fTunnelId=UsdL2fTunnelId, usdL2fDestStatCtlRecvDiscards=usdL2fDestStatCtlRecvDiscards, usdL2fTunnelStatusIfIndex=usdL2fTunnelStatusIfIndex, usdL2fSessionStatusProxyLcp=usdL2fSessionStatusProxyLcp, usdL2fSessionStatusState=usdL2fSessionStatusState, usdL2fSessionStatusCumEstabTime=usdL2fSessionStatusCumEstabTime, usdL2fUdpIpDestRouterIndex=usdL2fUdpIpDestRouterIndex, UsdL2fSessionId=UsdL2fSessionId, usdL2fMIB=usdL2fMIB, usdL2fUdpIpDestTable=usdL2fUdpIpDestTable, usdL2fDestStatusTotalTunnels=usdL2fDestStatusTotalTunnels, usdL2fSessionStatus=usdL2fSessionStatus, usdL2fDestStatCtlSendErrors=usdL2fDestStatCtlSendErrors, usdL2fSessionStatusLacTunneledIfIndex=usdL2fSessionStatusLacTunneledIfIndex, usdL2fMapTifSidToSifSessionIfIndex=usdL2fMapTifSidToSifSessionIfIndex, usdL2fDestStatCtlSendPackets=usdL2fDestStatCtlSendPackets, usdL2fDestStatPaySendPackets=usdL2fDestStatPaySendPackets, usdL2fSessionStatPayRecvDiscards=usdL2fSessionStatPayRecvDiscards, usdL2fTunnel=usdL2fTunnel, usdL2fUdpIpTunnelRemoteAddress=usdL2fUdpIpTunnelRemoteAddress, usdL2fGroups=usdL2fGroups, usdL2fCompliances=usdL2fCompliances, usdL2fDestConfig=usdL2fDestConfig, UsdL2fTransport=UsdL2fTransport, usdL2fTunnelStatPayRecvDiscards=usdL2fTunnelStatPayRecvDiscards, usdL2fTransportUdpIp=usdL2fTransportUdpIp, usdL2fTunnelStatCtlRecvOutOfSequence=usdL2fTunnelStatCtlRecvOutOfSequence, UsdL2fAdminState=UsdL2fAdminState, usdL2fTunnelStatPayRecvErrors=usdL2fTunnelStatPayRecvErrors, usdL2fTunnelStatusRemoteTunnelId=usdL2fTunnelStatusRemoteTunnelId, usdL2fTunnelStatistics=usdL2fTunnelStatistics, PYSNMP_MODULE_ID=usdL2fMIB, usdL2fSessionStatusLocalSessionId=usdL2fSessionStatusLocalSessionId, usdL2fTunnelStatusLastErrorMessage=usdL2fTunnelStatusLastErrorMessage, usdL2fTunnelStatPaySendOctets=usdL2fTunnelStatPaySendOctets, usdL2fMapTifSidToSifTunnelIfIndex=usdL2fMapTifSidToSifTunnelIfIndex, usdL2fDestConfigRowStatus=usdL2fDestConfigRowStatus, usdL2fDestination=usdL2fDestination, usdL2fTunnelStatusRemoteHostName=usdL2fTunnelStatusRemoteHostName, usdL2fSysConfigDestructTimeout=usdL2fSysConfigDestructTimeout, usdL2fSessionStatRecvOutOfSequence=usdL2fSessionStatRecvOutOfSequence, usdL2fSysConfigAdminState=usdL2fSysConfigAdminState, usdL2fDestStatusEffectiveAdminState=usdL2fDestStatusEffectiveAdminState, usdL2fTunnelStatusState=usdL2fTunnelStatusState, usdL2fTunnelStatIfIndex=usdL2fTunnelStatIfIndex, usdL2fDestStatusTransport=usdL2fDestStatusTransport, usdL2fTunnelConfig=usdL2fTunnelConfig, usdL2fDestStatPaySendDiscards=usdL2fDestStatPaySendDiscards, usdL2fDestStatusActiveTunnels=usdL2fDestStatusActiveTunnels, usdL2fSysStatusFailedTunnelAuthens=usdL2fSysStatusFailedTunnelAuthens, usdL2fDestStatusTotalSessions=usdL2fDestStatusTotalSessions, usdL2fDestStatCtlSendDiscards=usdL2fDestStatCtlSendDiscards, usdL2fSessionConfigTable=usdL2fSessionConfigTable, usdL2fSessionStatPaySendErrors=usdL2fSessionStatPaySendErrors, usdL2fSessionStatPayLostPackets=usdL2fSessionStatPayLostPackets, usdL2fSysStatusFailedSessions=usdL2fSysStatusFailedSessions, usdL2fSessionStatPaySendPackets=usdL2fSessionStatPaySendPackets, usdL2fTunnelStatCtlRecvPackets=usdL2fTunnelStatCtlRecvPackets, usdL2fDestStatistics=usdL2fDestStatistics, usdL2fTunnelStatPayRecvOctets=usdL2fTunnelStatPayRecvOctets, usdL2fSysStatusActiveTunnels=usdL2fSysStatusActiveTunnels, usdL2fSessionStatusIfIndex=usdL2fSessionStatusIfIndex, usdL2fUdpIpTunnelRouterIndex=usdL2fUdpIpTunnelRouterIndex, usdL2fSysStatusActiveSessions=usdL2fSysStatusActiveSessions, usdL2fUdpIpTunnelRemotePort=usdL2fUdpIpTunnelRemotePort, usdL2fDestStatusFailedTunnels=usdL2fDestStatusFailedTunnels, usdL2fUdpIpTunnelLocalPort=usdL2fUdpIpTunnelLocalPort, usdL2fUdpIpDestination=usdL2fUdpIpDestination, usdL2fConfigGroup=usdL2fConfigGroup, usdL2fTunnelStatEntry=usdL2fTunnelStatEntry, usdL2fSessionConfigIfIndex=usdL2fSessionConfigIfIndex, usdL2fMapTidToTifIfIndex=usdL2fMapTidToTifIfIndex, usdL2fTunnelConfigIfIndex=usdL2fTunnelConfigIfIndex, usdL2fTunnelStatusLocalTunnelId=usdL2fTunnelStatusLocalTunnelId, usdL2fDestStatPayRecvOctets=usdL2fDestStatPayRecvOctets, usdL2fTunnelStatCtlSendDiscards=usdL2fTunnelStatCtlSendDiscards, usdL2fSysConfigReceiveDataSequencingIgnore=usdL2fSysConfigReceiveDataSequencingIgnore, usdL2fSessionStatusEffectiveAdminState=usdL2fSessionStatusEffectiveAdminState, usdL2fUdpIpTunnelTable=usdL2fUdpIpTunnelTable, usdL2fSessionStatTable=usdL2fSessionStatTable, usdL2fSessionStatPayRecvOctets=usdL2fSessionStatPayRecvOctets, usdL2fSysStatusTotalSessions=usdL2fSysStatusTotalSessions, usdL2fUdpIpTunnelIfIndex=usdL2fUdpIpTunnelIfIndex, usdL2fTunnelStatCtlRecvOctets=usdL2fTunnelStatCtlRecvOctets, usdL2fSessionStatusAuthMethod=usdL2fSessionStatusAuthMethod, usdL2fSessionStatEntry=usdL2fSessionStatEntry, usdL2fMapGroup=usdL2fMapGroup, usdL2fTunnelConfigAdminState=usdL2fTunnelConfigAdminState, usdL2fTunnelStatusInitiated=usdL2fTunnelStatusInitiated, usdL2fSysConfigIpChecksumEnable=usdL2fSysConfigIpChecksumEnable) |
enu = 3
zenn = 0
for ai in range(enu, -1, -1):
zenn += ai*ai*ai
print(zenn)
| enu = 3
zenn = 0
for ai in range(enu, -1, -1):
zenn += ai * ai * ai
print(zenn) |
deck = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', 'King', 'Ace']
value = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
deck_values = dict(zip(deck, value))
hand = [input() for _ in range(6)]
hand_values = [deck_values.get(card) for card in hand]
print(sum(hand_values) / 6)
| deck = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', 'King', 'Ace']
value = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
deck_values = dict(zip(deck, value))
hand = [input() for _ in range(6)]
hand_values = [deck_values.get(card) for card in hand]
print(sum(hand_values) / 6) |
# -*- coding: utf-8 -*-
class RedirectError(Exception):
def __init__(self, response):
self.response = response
class NotLoggedInError(Exception):
pass
class SessionNotFreshError(Exception):
pass | class Redirecterror(Exception):
def __init__(self, response):
self.response = response
class Notloggedinerror(Exception):
pass
class Sessionnotfresherror(Exception):
pass |
class Cell(object):
def __init__(self):
self.neighbours = [None for _ in range(8)]
self.current_state = False
self.next_state = False
self.fixed = False
def count_neighbours(self) -> int:
count = 0
for n in self.neighbours:
if n.current_state:
count += 1
return count
def ready_change(self):
if self.fixed:
self.next_state = True
else:
count = self.count_neighbours()
if self.current_state:
self.next_state = count in [2, 3]
else:
self.next_state = count == 3
def switch(self):
self.current_state = self.next_state
def __str__(self):
return '#' if self.current_state else '.'
class Life(object):
def __init__(self, initial_grid):
self.grid = [[Cell() for _ in range(100)] for _ in range(100)]
self.setup_grid(initial_grid)
def setup_grid(self, initial_grid, fixed_corners=False):
for row, line in enumerate(self.grid):
for col, cell in enumerate(line):
if fixed_corners and (col == 0 or col == 99) and (row == 0 or row == 99):
cell.current_state = True
cell.fixed = True
cell.neighbours = []
else:
cell.current_state = initial_grid[row][col] == '#'
cell.neighbours = [self.grid[r][c] for r, c in self.neighbours(row, col)]
def neighbours(self, row, col):
for n_r, n_c in [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]:
pos = row + n_r, col + n_c
if 0 <= pos[0] < 100 and 0 <= pos[1] < 100:
yield pos
def on_lamps(self):
return sum(1 for line in self.grid for cell in line if cell.current_state)
def generation(self):
for line in self.grid:
for cell in line:
cell.ready_change()
for line in self.grid:
for cell in line:
cell.switch()
def print_grid(self):
for line in self.grid:
for cell in line:
print(cell, end='')
print()
if __name__ == '__main__':
with open('input') as f:
initial_grid = f.read().splitlines(keepends=False)
life = Life(initial_grid)
for _ in range(100):
life.generation()
life.print_grid()
print(f'Part 1: {life.on_lamps()}')
# Part 1: 814
life.setup_grid(initial_grid, fixed_corners=True)
for _ in range(100):
life.generation()
life.print_grid()
print(f'Part 2: {life.on_lamps()}')
# Part 2: 924
| class Cell(object):
def __init__(self):
self.neighbours = [None for _ in range(8)]
self.current_state = False
self.next_state = False
self.fixed = False
def count_neighbours(self) -> int:
count = 0
for n in self.neighbours:
if n.current_state:
count += 1
return count
def ready_change(self):
if self.fixed:
self.next_state = True
else:
count = self.count_neighbours()
if self.current_state:
self.next_state = count in [2, 3]
else:
self.next_state = count == 3
def switch(self):
self.current_state = self.next_state
def __str__(self):
return '#' if self.current_state else '.'
class Life(object):
def __init__(self, initial_grid):
self.grid = [[cell() for _ in range(100)] for _ in range(100)]
self.setup_grid(initial_grid)
def setup_grid(self, initial_grid, fixed_corners=False):
for (row, line) in enumerate(self.grid):
for (col, cell) in enumerate(line):
if fixed_corners and (col == 0 or col == 99) and (row == 0 or row == 99):
cell.current_state = True
cell.fixed = True
cell.neighbours = []
else:
cell.current_state = initial_grid[row][col] == '#'
cell.neighbours = [self.grid[r][c] for (r, c) in self.neighbours(row, col)]
def neighbours(self, row, col):
for (n_r, n_c) in [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]:
pos = (row + n_r, col + n_c)
if 0 <= pos[0] < 100 and 0 <= pos[1] < 100:
yield pos
def on_lamps(self):
return sum((1 for line in self.grid for cell in line if cell.current_state))
def generation(self):
for line in self.grid:
for cell in line:
cell.ready_change()
for line in self.grid:
for cell in line:
cell.switch()
def print_grid(self):
for line in self.grid:
for cell in line:
print(cell, end='')
print()
if __name__ == '__main__':
with open('input') as f:
initial_grid = f.read().splitlines(keepends=False)
life = life(initial_grid)
for _ in range(100):
life.generation()
life.print_grid()
print(f'Part 1: {life.on_lamps()}')
life.setup_grid(initial_grid, fixed_corners=True)
for _ in range(100):
life.generation()
life.print_grid()
print(f'Part 2: {life.on_lamps()}') |
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: aghast_generated
class DimensionOrder(object):
c_order = 0
fortran_order = 1
| class Dimensionorder(object):
c_order = 0
fortran_order = 1 |
def specialPolynomial(x, n):
s = 1
k = 0
while s <= n:
k += 1
s += x**k
return k-1
if __name__ == '__main__':
input0 = [2, 10, 1, 3]
input1 = [5, 111111110, 100, 140]
expectedOutput = [1, 7, 99, 4]
assert len(input0) == len(expectedOutput), '# input0 = {}, # expectedOutput = {}'.format(len(input0), len(expectedOutput))
assert len(input1) == len(expectedOutput), '# input1 = {}, # expectedOutput = {}'.format(len(input1), len(expectedOutput))
for i, expected in enumerate(expectedOutput):
actual = specialPolynomial(input0[i], input1[i])
assert actual == expected, 'specialPolynomial({}, {}) returned {}, but expected {}'.format(input0[i], input1[i], actual, expected)
print('PASSES {} out of {} tests'.format(len(expectedOutput), len(expectedOutput))) | def special_polynomial(x, n):
s = 1
k = 0
while s <= n:
k += 1
s += x ** k
return k - 1
if __name__ == '__main__':
input0 = [2, 10, 1, 3]
input1 = [5, 111111110, 100, 140]
expected_output = [1, 7, 99, 4]
assert len(input0) == len(expectedOutput), '# input0 = {}, # expectedOutput = {}'.format(len(input0), len(expectedOutput))
assert len(input1) == len(expectedOutput), '# input1 = {}, # expectedOutput = {}'.format(len(input1), len(expectedOutput))
for (i, expected) in enumerate(expectedOutput):
actual = special_polynomial(input0[i], input1[i])
assert actual == expected, 'specialPolynomial({}, {}) returned {}, but expected {}'.format(input0[i], input1[i], actual, expected)
print('PASSES {} out of {} tests'.format(len(expectedOutput), len(expectedOutput))) |
__all__ = [
"deployment_pb2",
"repository_pb2",
"status_pb2",
"yatai_service_pb2_grpc",
"yatai_service_pb2",
]
| __all__ = ['deployment_pb2', 'repository_pb2', 'status_pb2', 'yatai_service_pb2_grpc', 'yatai_service_pb2'] |
def solve():
N = int(input())
V = list(map(int, input().split()))
V1 = sorted(V[::2])
V2 = sorted(V[1::2])
flag = -1
for i in range(1, N):
i_ = i // 2
# if i&1: print('Check {} {}'.format(V1[i_], V2[i_]))
# if i&1==0: print('Check {} {}'.format(V2[i_-1], V1[i_]))
if i&1 and V1[i_] > V2[i_] or i&1==0 and V2[i_-1] > V1[i_]: # odd
flag = i - 1
break
print('OK') if flag == -1 else print(flag)
if __name__ == '__main__':
T = int(input())
for t in range(T):
print('Case #{}: '.format(t+1), end='')
solve() | def solve():
n = int(input())
v = list(map(int, input().split()))
v1 = sorted(V[::2])
v2 = sorted(V[1::2])
flag = -1
for i in range(1, N):
i_ = i // 2
if i & 1 and V1[i_] > V2[i_] or (i & 1 == 0 and V2[i_ - 1] > V1[i_]):
flag = i - 1
break
print('OK') if flag == -1 else print(flag)
if __name__ == '__main__':
t = int(input())
for t in range(T):
print('Case #{}: '.format(t + 1), end='')
solve() |
def target(x0, sink):
print(f'input: {x0}')
while True:
task = yield
x0 = task(x0)
sink.send(x0)
def sink():
try:
while True:
x = yield
except GeneratorExit:
print(f'final output: {x}')
| def target(x0, sink):
print(f'input: {x0}')
while True:
task = (yield)
x0 = task(x0)
sink.send(x0)
def sink():
try:
while True:
x = (yield)
except GeneratorExit:
print(f'final output: {x}') |
def data_cart(request):
total_cart=0
total_items=0
if request.user.is_authenticated and request.session.__contains__('cart'):
for key, value in request.session['cart'].items():
if not key == "is_modify" and not key == 'id_update':
total_cart = total_cart + float(value['price'])*value['quantity']
total_items+=1
return {
'total_cart': total_cart,
'total_items': total_items,
}
| def data_cart(request):
total_cart = 0
total_items = 0
if request.user.is_authenticated and request.session.__contains__('cart'):
for (key, value) in request.session['cart'].items():
if not key == 'is_modify' and (not key == 'id_update'):
total_cart = total_cart + float(value['price']) * value['quantity']
total_items += 1
return {'total_cart': total_cart, 'total_items': total_items} |
# int: Minimum number of n-grams occurence to be retained
# All Ngrams that occur less than n times are removed
# default value: 0
ngram_min_to_be_retained = 0
# real: Minimum ratio n-grams to skip
# (will be chosen among the ones that occur rarely)
# expressed as a ratio of the cumulated histogram
# default value: 0
ngram_min_rejected_ratio = 0
# NB: the n-gram skipping will go on until:
# ( minimal_ngram_count < ngram_min_to_be_retained ) OR ( rejected_ratio <= ngram_min_rejected_ratio)
# int: the 'n' of 'n'-gram
# default value: 2
gram_size = 3
# File containing the textual data to convert
# Image in file_name*.img
# Image in file_name*.txt
# Output will be :
# file_name*.onehot
# file_name*.ngram
# file_name*.info
files_path = '/u/lisa/db/babyAI/textual_v2'
file_name_train_amat = 'BABYAI_gray_4obj_64x64.train.img'
file_name_valid_amat = 'BABYAI_gray_4obj_64x64.valid.img'
file_name_test_amat = 'BABYAI_gray_4obj_64x64.test.img'
image_size = 32*32
# Use empty string if no dataset
file_name_train_img = 'BABYAI_gray_4obj_64x64.train.img'
file_name_valid_img = 'BABYAI_gray_4obj_64x64.valid.img'
file_name_test_img = 'BABYAI_gray_4obj_64x64.test.img'
file_name_train_txt = 'BABYAI_gray_4obj_64x64.color-size-location-shape.train.txt'
file_name_valid_txt = 'BABYAI_gray_4obj_64x64.color-size-location-shape.valid.txt'
file_name_test_txt = 'BABYAI_gray_4obj_64x64.color-size-location-shape.test.txt'
file_name_train_out = 'BABYAI_gray_4obj_64x64.color-size-location-shape.train'
file_name_valid_out = 'BABYAI_gray_4obj_64x64.color-size-location-shape.valid'
file_name_test_out = 'BABYAI_gray_4obj_64x64.color-size-location-shape.test'
# None or a file '*.info'
file_info = None # 'BABYAI_gray_4obj_64x64.color-size-location-shape.train.info'
| ngram_min_to_be_retained = 0
ngram_min_rejected_ratio = 0
gram_size = 3
files_path = '/u/lisa/db/babyAI/textual_v2'
file_name_train_amat = 'BABYAI_gray_4obj_64x64.train.img'
file_name_valid_amat = 'BABYAI_gray_4obj_64x64.valid.img'
file_name_test_amat = 'BABYAI_gray_4obj_64x64.test.img'
image_size = 32 * 32
file_name_train_img = 'BABYAI_gray_4obj_64x64.train.img'
file_name_valid_img = 'BABYAI_gray_4obj_64x64.valid.img'
file_name_test_img = 'BABYAI_gray_4obj_64x64.test.img'
file_name_train_txt = 'BABYAI_gray_4obj_64x64.color-size-location-shape.train.txt'
file_name_valid_txt = 'BABYAI_gray_4obj_64x64.color-size-location-shape.valid.txt'
file_name_test_txt = 'BABYAI_gray_4obj_64x64.color-size-location-shape.test.txt'
file_name_train_out = 'BABYAI_gray_4obj_64x64.color-size-location-shape.train'
file_name_valid_out = 'BABYAI_gray_4obj_64x64.color-size-location-shape.valid'
file_name_test_out = 'BABYAI_gray_4obj_64x64.color-size-location-shape.test'
file_info = None |
customcb = {'_smps_flo': ["#000000",
"#000002",
"#000004",
"#000007",
"#000009",
"#00000b",
"#00000d",
"#000010",
"#000012",
"#000014",
"#000016",
"#000019",
"#00001b",
"#00001d",
"#00001f",
"#000021",
"#000024",
"#000026",
"#000028",
"#00002a",
"#00002d",
"#00002f",
"#000031",
"#000033",
"#000036",
"#000038",
"#00003a",
"#00003c",
"#00003e",
"#000041",
"#000043",
"#000045",
"#000047",
"#00004a",
"#00004c",
"#00004e",
"#000050",
"#000053",
"#000055",
"#000057",
"#000059",
"#00005b",
"#00005e",
"#000060",
"#000062",
"#000064",
"#000067",
"#000069",
"#00006b",
"#00006d",
"#000070",
"#000072", # "#000074",
"#000076",
"#000078",
"#00007b", # "#00007d",
"#00007f",
"#000081", # "#000084",
"#000086",
"#000088", # "#00008a",
"#00008d",
"#00018e", # "#00038c",
"#00068b",
"#000989", # "#000b88",
"#000e87",
"#001185",
"#001384", # "#001682",
"#001881",
"#001b7f",
"#001e7e",
"#00207d",
"#00237b",
"#00267a",
"#002878",
"#002b77",
"#002e75",
"#003074",
"#003372",
"#003671",
"#003870",
"#003b6e",
"#003d6d",
"#00406b",
"#00436a",
"#004568",
"#004867",
"#004b65",
"#004d64",
"#005063",
"#005361",
"#005560",
"#00585e",
"#005b5d",
"#005d5b",
"#00605a",
"#006258",
"#006557",
"#006856",
"#006a54",
"#006d53", # dark azul
"#007051",
"#007151", # input
"#007150", # input
"#007250",
"#00754e", # azul
"#00764E",
"#00774E",
"#00784d",
"#007a4b",
"#007d4a", # azul green
"#007f49",
"#008247",
"#008546",
"#008744", # donker groen blauwig
"#008a43",
"#008B42",
"#008B41",
"#008C41",
"#008d41",
"#008d41",
"#008f40",
"#00923e",
"#00953d",
"#00963D",
"#00973c",
"#009a3a",
"#009d39",
"#009e38",
"#009f38",
"#009f37",
"#00a236", # 61 licht groen
"#009F35", # 62
"#00a434", # 64
"#00A534", # 64
"#00a634", # 64
"#00A633", # 65
"#00a733", # 65
"#00a434", # 64
"#00A534", # 64
"#00A634", # 64
"#00a733", # 65
"#00A635", # 65
"#02a732",
"#05a431",
"#08a230",
"#0c9f2f",
"#0f9d2f",
"#129a2e",
"#16972d",
"#19952c",
"#1c922c",
"#208f2b",
"#238d2a",
"#268a29",
"#2a8728",
"#2d8528",
"#308227", # donkergroen
"#337f26",
"#377d25",
"#3a7a24",
"#3d7824",
"#417523",
"#447222",
"#477021",
"#4b6d21",
"#4e6a20", # bruingroen
"#51681f",
"#55651e",
"#58621d",
"#5b601d",
"#5f5d1c",
"#625b1b",
"#65581a",
"#695519",
"#6c5319",
"#6f5018",
"#734d17",
"#764b16",
"#794815",
"#7d4515",
"#804314", # bruin
"#834013",
"#873d12",
"#8a3b12",
"#8d3811",
"#903610",
"#94330f",
"#97300e",
"#9a2e0e",
"#9e2b0d",
"#a1280c",
"#a4260b",
"#a8230a",
"#ab200a",
"#ae1e09",
"#b21b08",
"#b51807",
"#b81607",
"#bc1306",
"#bf1105",
"#c20e04",
"#c60b03",
"#c90903",
"#cc0602",
"#d00301",
"#d30100",# donker rood
"#d40200",
"#d40300",
"#d40400",
"#d40500",
"#d40600",
"#d40700",
"#d40800",
"#d40900", # fel rood
"#d40c00",
"#d41000",
"#D41100",
"#D41200",
"#d41300", #
"#D41400",
"#D41500",
"#d41600",
"#d41a00",
"#d41d00",
"#d42000", #
"#d42400",
"#d42700",
"#d42a00", # begin oranje
"#d42b00",
"#d42c00",
"#d42d00",
"#d42e00",
"#D43100",
"#D43200",
"#D43300",
"#d43400",
"#d43500",
"#D43600",
"#D43700",
"#d43800", # 16 donker oranje
"#d43b00", # 18
"#D43C00",
"#D43D00",
"#d43e00", # 18
"#D44200", # hh
"#d44200", # 20
"#d44300",
"#d44400",
"#d44500",
"#d44800",
"#d44c00",
"#d44f00",
"#d45200",
"#d45600",
"#d45900",
"#d45c00",
"#d45f00",
"#d46300",
"#d46600",
"#d46900",
"#d46d00",
"#d47000",
"#d47300",
"#d47700", # wat lichter oranje
"#d47a00",
"#D47B00",
"#D47C00",
"#d47d00",
"#d48100",
"#D48200",
"#D48300",
"#d48400",
"#d48700",
"#d48b00",
"#d48e00",
"#d49100",
"#d49500",
"#d49800",
"#d49b00",
"#d49f00",
"#d4a200",
"#d4a500",
"#d4a900",
"#d4ac00",
"#d4af00", # donker geel
"#d4b300",
"#d4b600",
"#d4b900",
"#d4bc00",
"#d4c000",
"#d4c300",
"#d4c600",
"#d4ca00",
"#d4cd00",
"#d4d000",
"#d4d400",
"#D7D700",
"#DADA00",
"#DCDC00",
"#DFDF00",
"#E1E100",
"#E4E400",
"#E6E600",
"#E9E900",
"#ECEC00",
"#F1F100",
"#F6F200",
"#F6F300",
"#F6F400",
"#F6F600",
"#F6F700",
"#F8F800",
"#FBFB00",
"#FDFD00",
"#FDFE00",
"#FFFD00",
"#FDFF00",
"#FFFF00",
],
'_smps_flo_w' : ["#FFFFFF",
"#000002",
"#000004",
"#000007",
"#000009",
"#00000b",
"#00000d",
"#000010",
"#000012",
"#000014",
"#000016",
"#000019",
"#00001b",
"#00001d",
"#00001f",
"#000021",
"#000024",
"#000026",
"#000028",
"#00002a",
"#00002d",
"#00002f",
"#000031",
"#000033",
"#000036",
"#000038",
"#00003a",
"#00003c",
"#00003e",
"#000041",
"#000043",
"#000045",
"#000047",
"#00004a",
"#00004c",
"#00004e",
"#000050",
"#000053",
"#000055",
"#000057",
"#000059",
"#00005b",
"#00005e",
"#000060",
"#000062",
"#000064",
"#000067",
"#000069",
"#00006b",
"#00006d",
"#000070",
"#000072", # "#000074",
"#000076",
"#000078",
"#00007b", # "#00007d",
"#00007f",
"#000081", # "#000084",
"#000086",
"#000088", # "#00008a",
"#00008d",
"#00018e", # "#00038c",
"#00068b",
"#000989", # "#000b88",
"#000e87",
"#001185",
"#001384", # "#001682",
"#001881",
"#001b7f",
"#001e7e",
"#00207d",
"#00237b",
"#00267a",
"#002878",
"#002b77",
"#002e75",
"#003074",
"#003372",
"#003671",
"#003870",
"#003b6e",
"#003d6d",
"#00406b",
"#00436a",
"#004568",
"#004867",
"#004b65",
"#004d64",
"#005063",
"#005361",
"#005560",
"#00585e",
"#005b5d",
"#005d5b",
"#00605a",
"#006258",
"#006557",
"#006856",
"#006a54",
"#006d53", # dark azul
"#007051",
"#007151", # input
"#007150", # input
"#007250",
"#00754e", # azul
"#00764E",
"#00774E",
"#00784d",
"#007a4b",
"#007d4a", # azul green
"#007f49",
"#008247",
"#008546",
"#008744", # donker groen blauwig
"#008a43",
"#008B42",
"#008B41",
"#008C41",
"#008d41",
"#008d41",
"#008f40",
"#00923e",
"#00953d",
"#00963D",
"#00973c",
"#009a3a",
"#009d39",
"#009e38",
"#009f38",
"#009f37",
"#00a236", # 61 licht groen
"#009F35", # 62
"#00a434", # 64
"#00A534", # 64
"#00a634", # 64
"#00A633", # 65
"#00a733", # 65
"#00a434", # 64
"#00A534", # 64
"#00A634", # 64
"#00a733", # 65
"#00A635", # 65
"#02a732",
"#05a431",
"#08a230",
"#0c9f2f",
"#0f9d2f",
"#129a2e",
"#16972d",
"#19952c",
"#1c922c",
"#208f2b",
"#238d2a",
"#268a29",
"#2a8728",
"#2d8528",
"#308227", # donkergroen
"#337f26",
"#377d25",
"#3a7a24",
"#3d7824",
"#417523",
"#447222",
"#477021",
"#4b6d21",
"#4e6a20", # bruingroen
"#51681f",
"#55651e",
"#58621d",
"#5b601d",
"#5f5d1c",
"#625b1b",
"#65581a",
"#695519",
"#6c5319",
"#6f5018",
"#734d17",
"#764b16",
"#794815",
"#7d4515",
"#804314", # bruin
"#834013",
"#873d12",
"#8a3b12",
"#8d3811",
"#903610",
"#94330f",
"#97300e",
"#9a2e0e",
"#9e2b0d",
"#a1280c",
"#a4260b",
"#a8230a",
"#ab200a",
"#ae1e09",
"#b21b08",
"#b51807",
"#b81607",
"#bc1306",
"#bf1105",
"#c20e04",
"#c60b03",
"#c90903",
"#cc0602",
"#d00301",
"#d30100",# donker rood
"#d40200",
"#d40300",
"#d40400",
"#d40500",
"#d40600",
"#d40700",
"#d40800",
"#d40900", # fel rood
"#d40c00",
"#d41000",
"#D41100",
"#D41200",
"#d41300", #
"#D41400",
"#D41500",
"#d41600",
"#d41a00",
"#d41d00",
"#d42000", #
"#d42400",
"#d42700",
"#d42a00", # begin oranje
"#d42b00",
"#d42c00",
"#d42d00",
"#d42e00",
"#D43100",
"#D43200",
"#D43300",
"#d43400",
"#d43500",
"#D43600",
"#D43700",
"#d43800", # 16 donker oranje
"#d43b00", # 18
"#D43C00",
"#D43D00",
"#d43e00", # 18
"#D44200", # hh
"#d44200", # 20
"#d44300",
"#d44400",
"#d44500",
"#d44800",
"#d44c00",
"#d44f00",
"#d45200",
"#d45600",
"#d45900",
"#d45c00",
"#d45f00",
"#d46300",
"#d46600",
"#d46900",
"#d46d00",
"#d47000",
"#d47300",
"#d47700", # wat lichter oranje
"#d47a00",
"#D47B00",
"#D47C00",
"#d47d00",
"#d48100",
"#D48200",
"#D48300",
"#d48400",
"#d48700",
"#d48b00",
"#d48e00",
"#d49100",
"#d49500",
"#d49800",
"#d49b00",
"#d49f00",
"#d4a200",
"#d4a500",
"#d4a900",
"#d4ac00",
"#d4af00", # donker geel
"#d4b300",
"#d4b600",
"#d4b900",
"#d4bc00",
"#d4c000",
"#d4c300",
"#d4c600",
"#d4ca00",
"#d4cd00",
"#d4d000",
"#d4d400",
"#D7D700",
"#DADA00",
"#DCDC00",
"#DFDF00",
"#E1E100",
"#E4E400",
"#E6E600",
"#E9E900",
"#ECEC00",
"#F1F100",
"#F6F200",
"#F6F300",
"#F6F400",
"#F6F600",
"#F6F700",
"#F8F800",
"#FBFB00",
"#FDFD00",
"#FDFE00",
"#FFFD00",
"#FDFF00",
"#FFFF00",
]}
| customcb = {'_smps_flo': ['#000000', '#000002', '#000004', '#000007', '#000009', '#00000b', '#00000d', '#000010', '#000012', '#000014', '#000016', '#000019', '#00001b', '#00001d', '#00001f', '#000021', '#000024', '#000026', '#000028', '#00002a', '#00002d', '#00002f', '#000031', '#000033', '#000036', '#000038', '#00003a', '#00003c', '#00003e', '#000041', '#000043', '#000045', '#000047', '#00004a', '#00004c', '#00004e', '#000050', '#000053', '#000055', '#000057', '#000059', '#00005b', '#00005e', '#000060', '#000062', '#000064', '#000067', '#000069', '#00006b', '#00006d', '#000070', '#000072', '#000076', '#000078', '#00007b', '#00007f', '#000081', '#000086', '#000088', '#00008d', '#00018e', '#00068b', '#000989', '#000e87', '#001185', '#001384', '#001881', '#001b7f', '#001e7e', '#00207d', '#00237b', '#00267a', '#002878', '#002b77', '#002e75', '#003074', '#003372', '#003671', '#003870', '#003b6e', '#003d6d', '#00406b', '#00436a', '#004568', '#004867', '#004b65', '#004d64', '#005063', '#005361', '#005560', '#00585e', '#005b5d', '#005d5b', '#00605a', '#006258', '#006557', '#006856', '#006a54', '#006d53', '#007051', '#007151', '#007150', '#007250', '#00754e', '#00764E', '#00774E', '#00784d', '#007a4b', '#007d4a', '#007f49', '#008247', '#008546', '#008744', '#008a43', '#008B42', '#008B41', '#008C41', '#008d41', '#008d41', '#008f40', '#00923e', '#00953d', '#00963D', '#00973c', '#009a3a', '#009d39', '#009e38', '#009f38', '#009f37', '#00a236', '#009F35', '#00a434', '#00A534', '#00a634', '#00A633', '#00a733', '#00a434', '#00A534', '#00A634', '#00a733', '#00A635', '#02a732', '#05a431', '#08a230', '#0c9f2f', '#0f9d2f', '#129a2e', '#16972d', '#19952c', '#1c922c', '#208f2b', '#238d2a', '#268a29', '#2a8728', '#2d8528', '#308227', '#337f26', '#377d25', '#3a7a24', '#3d7824', '#417523', '#447222', '#477021', '#4b6d21', '#4e6a20', '#51681f', '#55651e', '#58621d', '#5b601d', '#5f5d1c', '#625b1b', '#65581a', '#695519', '#6c5319', '#6f5018', '#734d17', '#764b16', '#794815', '#7d4515', '#804314', '#834013', '#873d12', '#8a3b12', '#8d3811', '#903610', '#94330f', '#97300e', '#9a2e0e', '#9e2b0d', '#a1280c', '#a4260b', '#a8230a', '#ab200a', '#ae1e09', '#b21b08', '#b51807', '#b81607', '#bc1306', '#bf1105', '#c20e04', '#c60b03', '#c90903', '#cc0602', '#d00301', '#d30100', '#d40200', '#d40300', '#d40400', '#d40500', '#d40600', '#d40700', '#d40800', '#d40900', '#d40c00', '#d41000', '#D41100', '#D41200', '#d41300', '#D41400', '#D41500', '#d41600', '#d41a00', '#d41d00', '#d42000', '#d42400', '#d42700', '#d42a00', '#d42b00', '#d42c00', '#d42d00', '#d42e00', '#D43100', '#D43200', '#D43300', '#d43400', '#d43500', '#D43600', '#D43700', '#d43800', '#d43b00', '#D43C00', '#D43D00', '#d43e00', '#D44200', '#d44200', '#d44300', '#d44400', '#d44500', '#d44800', '#d44c00', '#d44f00', '#d45200', '#d45600', '#d45900', '#d45c00', '#d45f00', '#d46300', '#d46600', '#d46900', '#d46d00', '#d47000', '#d47300', '#d47700', '#d47a00', '#D47B00', '#D47C00', '#d47d00', '#d48100', '#D48200', '#D48300', '#d48400', '#d48700', '#d48b00', '#d48e00', '#d49100', '#d49500', '#d49800', '#d49b00', '#d49f00', '#d4a200', '#d4a500', '#d4a900', '#d4ac00', '#d4af00', '#d4b300', '#d4b600', '#d4b900', '#d4bc00', '#d4c000', '#d4c300', '#d4c600', '#d4ca00', '#d4cd00', '#d4d000', '#d4d400', '#D7D700', '#DADA00', '#DCDC00', '#DFDF00', '#E1E100', '#E4E400', '#E6E600', '#E9E900', '#ECEC00', '#F1F100', '#F6F200', '#F6F300', '#F6F400', '#F6F600', '#F6F700', '#F8F800', '#FBFB00', '#FDFD00', '#FDFE00', '#FFFD00', '#FDFF00', '#FFFF00'], '_smps_flo_w': ['#FFFFFF', '#000002', '#000004', '#000007', '#000009', '#00000b', '#00000d', '#000010', '#000012', '#000014', '#000016', '#000019', '#00001b', '#00001d', '#00001f', '#000021', '#000024', '#000026', '#000028', '#00002a', '#00002d', '#00002f', '#000031', '#000033', '#000036', '#000038', '#00003a', '#00003c', '#00003e', '#000041', '#000043', '#000045', '#000047', '#00004a', '#00004c', '#00004e', '#000050', '#000053', '#000055', '#000057', '#000059', '#00005b', '#00005e', '#000060', '#000062', '#000064', '#000067', '#000069', '#00006b', '#00006d', '#000070', '#000072', '#000076', '#000078', '#00007b', '#00007f', '#000081', '#000086', '#000088', '#00008d', '#00018e', '#00068b', '#000989', '#000e87', '#001185', '#001384', '#001881', '#001b7f', '#001e7e', '#00207d', '#00237b', '#00267a', '#002878', '#002b77', '#002e75', '#003074', '#003372', '#003671', '#003870', '#003b6e', '#003d6d', '#00406b', '#00436a', '#004568', '#004867', '#004b65', '#004d64', '#005063', '#005361', '#005560', '#00585e', '#005b5d', '#005d5b', '#00605a', '#006258', '#006557', '#006856', '#006a54', '#006d53', '#007051', '#007151', '#007150', '#007250', '#00754e', '#00764E', '#00774E', '#00784d', '#007a4b', '#007d4a', '#007f49', '#008247', '#008546', '#008744', '#008a43', '#008B42', '#008B41', '#008C41', '#008d41', '#008d41', '#008f40', '#00923e', '#00953d', '#00963D', '#00973c', '#009a3a', '#009d39', '#009e38', '#009f38', '#009f37', '#00a236', '#009F35', '#00a434', '#00A534', '#00a634', '#00A633', '#00a733', '#00a434', '#00A534', '#00A634', '#00a733', '#00A635', '#02a732', '#05a431', '#08a230', '#0c9f2f', '#0f9d2f', '#129a2e', '#16972d', '#19952c', '#1c922c', '#208f2b', '#238d2a', '#268a29', '#2a8728', '#2d8528', '#308227', '#337f26', '#377d25', '#3a7a24', '#3d7824', '#417523', '#447222', '#477021', '#4b6d21', '#4e6a20', '#51681f', '#55651e', '#58621d', '#5b601d', '#5f5d1c', '#625b1b', '#65581a', '#695519', '#6c5319', '#6f5018', '#734d17', '#764b16', '#794815', '#7d4515', '#804314', '#834013', '#873d12', '#8a3b12', '#8d3811', '#903610', '#94330f', '#97300e', '#9a2e0e', '#9e2b0d', '#a1280c', '#a4260b', '#a8230a', '#ab200a', '#ae1e09', '#b21b08', '#b51807', '#b81607', '#bc1306', '#bf1105', '#c20e04', '#c60b03', '#c90903', '#cc0602', '#d00301', '#d30100', '#d40200', '#d40300', '#d40400', '#d40500', '#d40600', '#d40700', '#d40800', '#d40900', '#d40c00', '#d41000', '#D41100', '#D41200', '#d41300', '#D41400', '#D41500', '#d41600', '#d41a00', '#d41d00', '#d42000', '#d42400', '#d42700', '#d42a00', '#d42b00', '#d42c00', '#d42d00', '#d42e00', '#D43100', '#D43200', '#D43300', '#d43400', '#d43500', '#D43600', '#D43700', '#d43800', '#d43b00', '#D43C00', '#D43D00', '#d43e00', '#D44200', '#d44200', '#d44300', '#d44400', '#d44500', '#d44800', '#d44c00', '#d44f00', '#d45200', '#d45600', '#d45900', '#d45c00', '#d45f00', '#d46300', '#d46600', '#d46900', '#d46d00', '#d47000', '#d47300', '#d47700', '#d47a00', '#D47B00', '#D47C00', '#d47d00', '#d48100', '#D48200', '#D48300', '#d48400', '#d48700', '#d48b00', '#d48e00', '#d49100', '#d49500', '#d49800', '#d49b00', '#d49f00', '#d4a200', '#d4a500', '#d4a900', '#d4ac00', '#d4af00', '#d4b300', '#d4b600', '#d4b900', '#d4bc00', '#d4c000', '#d4c300', '#d4c600', '#d4ca00', '#d4cd00', '#d4d000', '#d4d400', '#D7D700', '#DADA00', '#DCDC00', '#DFDF00', '#E1E100', '#E4E400', '#E6E600', '#E9E900', '#ECEC00', '#F1F100', '#F6F200', '#F6F300', '#F6F400', '#F6F600', '#F6F700', '#F8F800', '#FBFB00', '#FDFD00', '#FDFE00', '#FFFD00', '#FDFF00', '#FFFF00']} |
class ModelSingleton(object):
# https://stackoverflow.com/a/6798042
_instances = {}
def __new__(class_, *args, **kwargs):
if class_ not in class_._instances:
class_._instances[class_] = super(ModelSingleton, class_).__new__(class_, *args, **kwargs)
return class_._instances[class_]
class SharedModel(ModelSingleton):
shared_model = None
mapper = None # mappers realID <-> innerID updates with new data such as models
| class Modelsingleton(object):
_instances = {}
def __new__(class_, *args, **kwargs):
if class_ not in class_._instances:
class_._instances[class_] = super(ModelSingleton, class_).__new__(class_, *args, **kwargs)
return class_._instances[class_]
class Sharedmodel(ModelSingleton):
shared_model = None
mapper = None |
tabuleiro_easy_1 = [
[4, 0, 1, 8, 3, 9, 5, 2, 0],
[3, 0, 9, 2, 7, 5, 1, 4, 6],
[5, 2, 7, 6, 0, 1, 9, 8, 0],
[0, 5, 8, 1, 0, 7, 3, 9, 4],
[0, 7, 3, 9, 8, 4, 2, 5, 0],
[9, 1, 4, 5, 2, 3, 6, 7, 8],
[7, 4, 0, 3, 0, 6, 8, 1, 2],
[8, 0, 6, 4, 1, 2, 7, 3, 5],
[1, 3, 2, 7, 5, 8, 4, 0, 9],
]
tabuleiro_easy_2 = [
[0, 6, 1, 8, 0, 0, 0, 0, 7],
[0, 8, 9, 2, 0, 5, 0, 4, 0],
[0, 0, 0, 0, 4, 0, 9, 0, 3],
[2, 0, 0, 1, 6, 0, 3, 0, 0],
[6, 7, 0, 0, 0, 0, 0, 5, 1],
[0, 0, 4, 0, 2, 3, 0, 0, 8],
[7, 0, 5, 0, 9, 0, 0, 0, 0],
[0, 9, 0, 4, 0, 2, 7, 3, 0],
[1, 0, 0, 0, 0, 8, 4, 6, 0],
]
tabuleiro_med = [
[0, 5, 0, 3, 6, 0, 0, 0, 0],
[2, 8, 0, 7, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 8, 0, 9, 0],
[6, 0, 0, 0, 0, 0, 0, 8, 3],
[0, 0, 4, 0, 0, 0, 2, 0, 0],
[8, 9, 0, 0, 0, 0, 0, 0, 6],
[0, 7, 0, 5, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 0, 3, 9],
[0, 0, 0, 0, 4, 3, 0, 6, 0],
]
tabuleiro_hard = [
[0, 7, 0, 0, 0, 0, 0, 9, 0],
[0, 0, 0, 0, 5, 0, 4, 0, 2],
[0, 0, 0, 0, 0, 0, 0, 3, 0],
[6, 0, 0, 0, 1, 3, 2, 0, 0],
[0, 0, 9, 0, 8, 0, 0, 0, 0],
[0, 3, 1, 0, 0, 6, 0, 0, 0],
[4, 6, 0, 0, 0, 0, 0, 0, 1],
[0, 0, 8, 0, 0, 4, 6, 0, 0],
[0, 0, 0, 0, 3, 5, 0, 0, 0],
]
| tabuleiro_easy_1 = [[4, 0, 1, 8, 3, 9, 5, 2, 0], [3, 0, 9, 2, 7, 5, 1, 4, 6], [5, 2, 7, 6, 0, 1, 9, 8, 0], [0, 5, 8, 1, 0, 7, 3, 9, 4], [0, 7, 3, 9, 8, 4, 2, 5, 0], [9, 1, 4, 5, 2, 3, 6, 7, 8], [7, 4, 0, 3, 0, 6, 8, 1, 2], [8, 0, 6, 4, 1, 2, 7, 3, 5], [1, 3, 2, 7, 5, 8, 4, 0, 9]]
tabuleiro_easy_2 = [[0, 6, 1, 8, 0, 0, 0, 0, 7], [0, 8, 9, 2, 0, 5, 0, 4, 0], [0, 0, 0, 0, 4, 0, 9, 0, 3], [2, 0, 0, 1, 6, 0, 3, 0, 0], [6, 7, 0, 0, 0, 0, 0, 5, 1], [0, 0, 4, 0, 2, 3, 0, 0, 8], [7, 0, 5, 0, 9, 0, 0, 0, 0], [0, 9, 0, 4, 0, 2, 7, 3, 0], [1, 0, 0, 0, 0, 8, 4, 6, 0]]
tabuleiro_med = [[0, 5, 0, 3, 6, 0, 0, 0, 0], [2, 8, 0, 7, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 8, 0, 9, 0], [6, 0, 0, 0, 0, 0, 0, 8, 3], [0, 0, 4, 0, 0, 0, 2, 0, 0], [8, 9, 0, 0, 0, 0, 0, 0, 6], [0, 7, 0, 5, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 3, 9], [0, 0, 0, 0, 4, 3, 0, 6, 0]]
tabuleiro_hard = [[0, 7, 0, 0, 0, 0, 0, 9, 0], [0, 0, 0, 0, 5, 0, 4, 0, 2], [0, 0, 0, 0, 0, 0, 0, 3, 0], [6, 0, 0, 0, 1, 3, 2, 0, 0], [0, 0, 9, 0, 8, 0, 0, 0, 0], [0, 3, 1, 0, 0, 6, 0, 0, 0], [4, 6, 0, 0, 0, 0, 0, 0, 1], [0, 0, 8, 0, 0, 4, 6, 0, 0], [0, 0, 0, 0, 3, 5, 0, 0, 0]] |
class Config(object):
def __init__(self, vocab_size, max_length):
self.vocab_size = vocab_size
self.embedding_size = 300
self.hidden_size = 200
self.filters = [3, 4, 5]
self.num_filters = 256
self.num_classes = 10
self.max_length = max_length
self.num_epochs = 20
self.lr = 0.001
self.dropout = 0.5
self.attention = True | class Config(object):
def __init__(self, vocab_size, max_length):
self.vocab_size = vocab_size
self.embedding_size = 300
self.hidden_size = 200
self.filters = [3, 4, 5]
self.num_filters = 256
self.num_classes = 10
self.max_length = max_length
self.num_epochs = 20
self.lr = 0.001
self.dropout = 0.5
self.attention = True |
#Mayor de edad
mayor=int(input("edad: "))
if(mayor >=18):
print("es mator de edad")
else:
print("es menor de edad")
| mayor = int(input('edad: '))
if mayor >= 18:
print('es mator de edad')
else:
print('es menor de edad') |
def getBASIC():
list = []
n = input()
while True:
line = n
if n.endswith('END'):
list.append(line)
return list
else:
list.append(line)
newN = input()
n = newN
| def get_basic():
list = []
n = input()
while True:
line = n
if n.endswith('END'):
list.append(line)
return list
else:
list.append(line)
new_n = input()
n = newN |
type_of_flowers = input()
count = int(input())
budget = int(input())
prices = {
"Roses": 5.00,
"Dahlias": 3.80,
"Tulips": 2.80,
"Narcissus": 3.00,
"Gladiolus": 2.50
}
price = count * prices[type_of_flowers]
if type_of_flowers == "Roses" and count > 80:
price -= 0.10 * price
elif type_of_flowers == "Dahlias" and count > 90:
price -= 0.15 * price
elif type_of_flowers == "Tulips" and count > 80:
price -= 0.15 * price
elif type_of_flowers == "Narcissus" and count < 120:
price += 0.15 * price
elif type_of_flowers == "Gladiolus" and count < 80:
price += 0.20 * price
money_left = budget - price
money_needed = price - budget
if money_left >= 0:
print(f"Hey, you have a great garden with {count} {type_of_flowers} and {money_left:.2f} leva left.")
else:
print(f"Not enough money, you need {money_needed:.2f} leva more.")
| type_of_flowers = input()
count = int(input())
budget = int(input())
prices = {'Roses': 5.0, 'Dahlias': 3.8, 'Tulips': 2.8, 'Narcissus': 3.0, 'Gladiolus': 2.5}
price = count * prices[type_of_flowers]
if type_of_flowers == 'Roses' and count > 80:
price -= 0.1 * price
elif type_of_flowers == 'Dahlias' and count > 90:
price -= 0.15 * price
elif type_of_flowers == 'Tulips' and count > 80:
price -= 0.15 * price
elif type_of_flowers == 'Narcissus' and count < 120:
price += 0.15 * price
elif type_of_flowers == 'Gladiolus' and count < 80:
price += 0.2 * price
money_left = budget - price
money_needed = price - budget
if money_left >= 0:
print(f'Hey, you have a great garden with {count} {type_of_flowers} and {money_left:.2f} leva left.')
else:
print(f'Not enough money, you need {money_needed:.2f} leva more.') |
#170
# Time: O(n)
# Space: O(n)
# Design and implement a TwoSum class. It should support the following operations: add and find.
#
# add - Add the number to an internal data structure.
# find - Find if there exists any pair of numbers which sum is equal to the value.
#
# For example,
# add(1); add(3); add(5);
# find(4) -> true
# find(7) -> false
class twoSumIII():
def __init__(self):
self.num_count={}
def add(self,val):
if val in self.num_count:
self.num_count[val]+=1
else:
self.num_count[val]=1
def find(self,target):
for num in self.num_count:
if target-num in self.num_count and (target-num!=num or self.num_count[target-num]>1):
return True
return False
| class Twosumiii:
def __init__(self):
self.num_count = {}
def add(self, val):
if val in self.num_count:
self.num_count[val] += 1
else:
self.num_count[val] = 1
def find(self, target):
for num in self.num_count:
if target - num in self.num_count and (target - num != num or self.num_count[target - num] > 1):
return True
return False |
def flatten(d: dict, new_d, path=''):
for key, value in d.items():
if not isinstance(value, dict):
new_d[path + key] = value
else:
path += f'{key}.'
return flatten(d[key], new_d, path=path)
return new_d
if __name__ == "__main__":
d = {"foo": 42,
"bar": "qwe",
"buz": {
"one": 1,
"two": 2,
"nested": {
"deep": "blue",
"deeper": {
"song": "my heart",
}
}
}
}
print(flatten(d, {}))
| def flatten(d: dict, new_d, path=''):
for (key, value) in d.items():
if not isinstance(value, dict):
new_d[path + key] = value
else:
path += f'{key}.'
return flatten(d[key], new_d, path=path)
return new_d
if __name__ == '__main__':
d = {'foo': 42, 'bar': 'qwe', 'buz': {'one': 1, 'two': 2, 'nested': {'deep': 'blue', 'deeper': {'song': 'my heart'}}}}
print(flatten(d, {})) |
class BotovodException(Exception):
pass
class AgentException(BotovodException):
pass
class AgentNotExistException(BotovodException):
def __init__(self, name: str):
super().__init__(f"Botovod have not '{name}' agent")
self.name = name
class HandlerNotPassed(BotovodException):
def __init__(self):
super().__init__("Handler not passed")
| class Botovodexception(Exception):
pass
class Agentexception(BotovodException):
pass
class Agentnotexistexception(BotovodException):
def __init__(self, name: str):
super().__init__(f"Botovod have not '{name}' agent")
self.name = name
class Handlernotpassed(BotovodException):
def __init__(self):
super().__init__('Handler not passed') |
class Solution:
def carPooling(self, trips: List[List[int]], capacity: int) -> bool:
tripOccupancy = [0] * 1002
for trip in trips:
tripOccupancy[trip[1]] += trip[0]
tripOccupancy[trip[2]] -= trip[0]
occupancy = 0
for occupancyDelta in tripOccupancy:
occupancy += occupancyDelta
if occupancy > capacity:
return False
return True | class Solution:
def car_pooling(self, trips: List[List[int]], capacity: int) -> bool:
trip_occupancy = [0] * 1002
for trip in trips:
tripOccupancy[trip[1]] += trip[0]
tripOccupancy[trip[2]] -= trip[0]
occupancy = 0
for occupancy_delta in tripOccupancy:
occupancy += occupancyDelta
if occupancy > capacity:
return False
return True |
class Result:
def __init__(self, value=None, error=None):
self._value = value
self._error = error
def is_ok(self) -> bool:
return self._error is None
def is_error(self) -> bool:
return self._error is not None
@property
def value(self):
return self._value
@property
def error(self):
return self._error
@staticmethod
def make_value(value, state):
return value, state
@staticmethod
def make_error(error, state):
return Result(value=None, error=error), state
| class Result:
def __init__(self, value=None, error=None):
self._value = value
self._error = error
def is_ok(self) -> bool:
return self._error is None
def is_error(self) -> bool:
return self._error is not None
@property
def value(self):
return self._value
@property
def error(self):
return self._error
@staticmethod
def make_value(value, state):
return (value, state)
@staticmethod
def make_error(error, state):
return (result(value=None, error=error), state) |
cv_results = cross_validate(
model, X, y, cv=cv,
return_estimator=True, return_train_score=True,
n_jobs=-1,
)
cv_results = pd.DataFrame(cv_results)
| cv_results = cross_validate(model, X, y, cv=cv, return_estimator=True, return_train_score=True, n_jobs=-1)
cv_results = pd.DataFrame(cv_results) |
class Usercredentials:
'''
class to generate new instances of usercredentials
'''
user_credential_list = [] #empty list for user creddential
def __init__(self,site_name,password):
'''
method to define properties of the object
'''
self.site_name = site_name
self.password = password
def save_credentials(self):
'''
method to save a credential into the user credential list
'''
Usercredentials.user_credential_list.append(self)
def delete_credentials(self):
'''
method to delete saved credential
'''
Usercredentials.user_credential_list.remove(self)
@classmethod
def display_credentials(cls):
return cls.user_credential_list | class Usercredentials:
"""
class to generate new instances of usercredentials
"""
user_credential_list = []
def __init__(self, site_name, password):
"""
method to define properties of the object
"""
self.site_name = site_name
self.password = password
def save_credentials(self):
"""
method to save a credential into the user credential list
"""
Usercredentials.user_credential_list.append(self)
def delete_credentials(self):
"""
method to delete saved credential
"""
Usercredentials.user_credential_list.remove(self)
@classmethod
def display_credentials(cls):
return cls.user_credential_list |
def GetParent(node, parent):
if node == parent[node]:
return node
parent[node] = GetParent(parent[node], parent)
return parent[node]
def union(u, v, parent, rank):
u = GetParent(u, parent)
v = GetParent(v, parent)
if rank[u] < rank[v]:
parent[u] = v
elif rank[u] > rank[v]:
parent[v] = u
else:
parent[v] = u
rank[u] += 1
# union
def Kruskal(n, m):
edges = []
for _ in range(m):
x, y, w = map(int, input().split())
edges.append(x, y, w)
edges = sorted(edges, key=lambda x: x[2])
parent = [0]*n
rank = [0]*n
for i in range(n):
parent[i] = i
cost = 0
mst = []
for x, y, w in edges:
if(GetParent(x, parent) != GetParent(y, parent)):
cost += w
mst.append([x, y])
union(x, y, parent, rank)
for i, j in mst:
print(i, '-', j)
return cost
| def get_parent(node, parent):
if node == parent[node]:
return node
parent[node] = get_parent(parent[node], parent)
return parent[node]
def union(u, v, parent, rank):
u = get_parent(u, parent)
v = get_parent(v, parent)
if rank[u] < rank[v]:
parent[u] = v
elif rank[u] > rank[v]:
parent[v] = u
else:
parent[v] = u
rank[u] += 1
def kruskal(n, m):
edges = []
for _ in range(m):
(x, y, w) = map(int, input().split())
edges.append(x, y, w)
edges = sorted(edges, key=lambda x: x[2])
parent = [0] * n
rank = [0] * n
for i in range(n):
parent[i] = i
cost = 0
mst = []
for (x, y, w) in edges:
if get_parent(x, parent) != get_parent(y, parent):
cost += w
mst.append([x, y])
union(x, y, parent, rank)
for (i, j) in mst:
print(i, '-', j)
return cost |
#!/usr/bin/env python3
n, *h = map(int, open(0).read().split())
dp = [0] * n
dp[0] = 0
a = abs
for i in range(1, n):
dp[i] = min(dp[i], dp[i-1] + a(h[i] - h[i-1]))
dp[i+1] = min(dp[i+1], dp[i-1] + a(h[i] - h[i-2]))
print(dp[n-1])
| (n, *h) = map(int, open(0).read().split())
dp = [0] * n
dp[0] = 0
a = abs
for i in range(1, n):
dp[i] = min(dp[i], dp[i - 1] + a(h[i] - h[i - 1]))
dp[i + 1] = min(dp[i + 1], dp[i - 1] + a(h[i] - h[i - 2]))
print(dp[n - 1]) |
# User input
minutes = float(input("Enter the time in minutes: "))
# Program operation
hours = minutes/60
# Computer output
print("The time in hours is: " + str(hours))
| minutes = float(input('Enter the time in minutes: '))
hours = minutes / 60
print('The time in hours is: ' + str(hours)) |
x = 12
y = 3
print(x > y) # True
x = "12"
y = "3"
print(x > y) # ! False / Why it's false ?
print(x < y) # ! True
# x = 12
# y = "3"
# print(x > y)
x2 = "45"
y2 = "321"
print(x2 > y2) # True
x2 = "45"
y2 = "621"
X2_Length = len(x2)
Y2_Length = len(y2)
print(X2_Length < Y2_Length) # True
print( ord('4') ) # 52
print( ord('5') ) # 53
print( ord('6') ) # 54
print( ord('2') ) # 50
print( ord('1') ) # 49
| x = 12
y = 3
print(x > y)
x = '12'
y = '3'
print(x > y)
print(x < y)
x2 = '45'
y2 = '321'
print(x2 > y2)
x2 = '45'
y2 = '621'
x2__length = len(x2)
y2__length = len(y2)
print(X2_Length < Y2_Length)
print(ord('4'))
print(ord('5'))
print(ord('6'))
print(ord('2'))
print(ord('1')) |
'''
For 35 points, answer the following questions.
Create a new folder named file_io and create a new Python file in the
folder. Run this 4 line program. Then look in the folder.
1) What did the program do?
'''
f = open('workfile.txt', 'w')
f.write('Bazarr 10 points\n')
f.write('Iko 3 points')
f.close()
'''Run this short program.
2) What did the program do?
'''
f = open('workfile.txt', 'r')
line = f.readline()
while line:
print(line)
line = f.readline()
f.close()
'''Run this short program.
3) What did the program do?
'''
f = open('value.txt', 'w')
f.write('14')
f.close()
'''Run this short program.
4) What did the program do?
'''
f = open('value.txt', 'r')
line = f.readline()
f.close()
x = int(line)
print(x*2)
'''Run this short program. Make sure to look at the value.txt file
before and after running this program.
5) What did the program do?
'''
f = open('value.txt', 'r')
line = f.readline()
f.close()
x = int(line)
x = x*2
f = open('value.txt', 'w')
f.write(str(x))
f.close()
| """
For 35 points, answer the following questions.
Create a new folder named file_io and create a new Python file in the
folder. Run this 4 line program. Then look in the folder.
1) What did the program do?
"""
f = open('workfile.txt', 'w')
f.write('Bazarr 10 points\n')
f.write('Iko 3 points')
f.close()
'Run this short program.\n2) What did the program do?\n'
f = open('workfile.txt', 'r')
line = f.readline()
while line:
print(line)
line = f.readline()
f.close()
'Run this short program.\n3) What did the program do?\n'
f = open('value.txt', 'w')
f.write('14')
f.close()
'Run this short program.\n4) What did the program do?\n'
f = open('value.txt', 'r')
line = f.readline()
f.close()
x = int(line)
print(x * 2)
'Run this short program. Make sure to look at the value.txt file \nbefore and after running this program.\n5) What did the program do?\n'
f = open('value.txt', 'r')
line = f.readline()
f.close()
x = int(line)
x = x * 2
f = open('value.txt', 'w')
f.write(str(x))
f.close() |
# -*- coding: utf-8 -*-
def main():
n = int(input())
a = [int(input()) for _ in range(n)][::-1]
ans = 0
for i in range(n):
p, q = divmod(a[i], 2)
ans += p
if q == 1:
if (i + 1 <= n - 1) and (a[i + 1] >= 1):
ans += 1
a[i + 1] -= 1
print(ans)
if __name__ == '__main__':
main()
| def main():
n = int(input())
a = [int(input()) for _ in range(n)][::-1]
ans = 0
for i in range(n):
(p, q) = divmod(a[i], 2)
ans += p
if q == 1:
if i + 1 <= n - 1 and a[i + 1] >= 1:
ans += 1
a[i + 1] -= 1
print(ans)
if __name__ == '__main__':
main() |
'''
escreva num arquivo texto.txt o conteudo de uma lista de uma vez
'''
arquivo = open('texto.txt', 'a')
frases = list()
frases.append('TreinaWeb \n')
frases.append('Python \n')
frases.append('Arquivos \n')
frases.append('Django \n')
arquivo.writelines(frases) | """
escreva num arquivo texto.txt o conteudo de uma lista de uma vez
"""
arquivo = open('texto.txt', 'a')
frases = list()
frases.append('TreinaWeb \n')
frases.append('Python \n')
frases.append('Arquivos \n')
frases.append('Django \n')
arquivo.writelines(frases) |
'''Exceptions for my orm'''
class ObjectNotInitializedError(Exception):
pass
class ObjectNotFoundError(Exception):
pass
| """Exceptions for my orm"""
class Objectnotinitializederror(Exception):
pass
class Objectnotfounderror(Exception):
pass |
def download_file(my_socket):
print("[+] Downloading file")
filename = my_socket.receive_data()
my_socket.receive_file(filename)
| def download_file(my_socket):
print('[+] Downloading file')
filename = my_socket.receive_data()
my_socket.receive_file(filename) |
#
# @lc app=leetcode id=223 lang=python3
#
# [223] Rectangle Area
#
# @lc code=start
class Solution:
def computeArea(self, A: int, B: int, C: int, D: int, E: int, F: int, G: int, H: int) -> int:
overlap = max(min(C, G) - max(A, E), 0) * max(min(D, H) - max(B, F), 0)
total = (A - C) * (B - D) + (E - G) * (F - H)
return total - overlap
# @lc code=end
# Accepted
# 3082/3082 cases passed(56 ms)
# Your runtime beats 81.4 % of python3 submissions
# Your memory usage beats 100 % of python3 submissions(12.8 MB)
| class Solution:
def compute_area(self, A: int, B: int, C: int, D: int, E: int, F: int, G: int, H: int) -> int:
overlap = max(min(C, G) - max(A, E), 0) * max(min(D, H) - max(B, F), 0)
total = (A - C) * (B - D) + (E - G) * (F - H)
return total - overlap |
gameList = [
'Riverraid-v0',
'SpaceInvaders-v0',
'StarGunner-v0',
'Pitfall-v0',
'Centipede-v0'
]
| game_list = ['Riverraid-v0', 'SpaceInvaders-v0', 'StarGunner-v0', 'Pitfall-v0', 'Centipede-v0'] |
class Solution:
def boxDelivering(self, boxes: List[List[int]], portsCount: int, maxBoxes: int, maxWeight: int) -> int:
n = len(boxes)
# dp[i] := min trips to deliver boxes[0..i) and return to the storage
dp = [0] * (n + 1)
trips = 2
weight = 0
l = 0
for r in range(n):
weight += boxes[r][1]
# current box is different from previous one, need to make one more trip
if r > 0 and boxes[r][0] != boxes[r - 1][0]:
trips += 1
# loading boxes[l] in the previous turn is always no bad than loading it in this turn
while r - l + 1 > maxBoxes or weight > maxWeight or (l < r and dp[l + 1] == dp[l]):
weight -= boxes[l][1]
if boxes[l][0] != boxes[l + 1][0]:
trips -= 1
l += 1
# min trips to deliver boxes[0..r]
# = min trips to deliver boxes[0..l) + trips to deliver boxes[l..r]
dp[r + 1] = dp[l] + trips
return dp[n]
| class Solution:
def box_delivering(self, boxes: List[List[int]], portsCount: int, maxBoxes: int, maxWeight: int) -> int:
n = len(boxes)
dp = [0] * (n + 1)
trips = 2
weight = 0
l = 0
for r in range(n):
weight += boxes[r][1]
if r > 0 and boxes[r][0] != boxes[r - 1][0]:
trips += 1
while r - l + 1 > maxBoxes or weight > maxWeight or (l < r and dp[l + 1] == dp[l]):
weight -= boxes[l][1]
if boxes[l][0] != boxes[l + 1][0]:
trips -= 1
l += 1
dp[r + 1] = dp[l] + trips
return dp[n] |
# https://leetcode.com/explore/featured/card/fun-with-arrays/521/introduction/3238/
class Solution:
def findMaxConsecutiveOnes(self, nums):
left = 0
prev = 0
while left < len(nums):
counter = 0
if nums[left] == 1:
right = left
while right < len(nums):
if nums[right] == 1:
counter += 1
right += 1
else:
break
right += 1
left = right
else:
left += 1
if counter > prev:
prev = counter
return prev
if __name__ == "__main__":
assert Solution().findMaxConsecutiveOnes([0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]) == 6
assert Solution().findMaxConsecutiveOnes([0, 1]) == 1
| class Solution:
def find_max_consecutive_ones(self, nums):
left = 0
prev = 0
while left < len(nums):
counter = 0
if nums[left] == 1:
right = left
while right < len(nums):
if nums[right] == 1:
counter += 1
right += 1
else:
break
right += 1
left = right
else:
left += 1
if counter > prev:
prev = counter
return prev
if __name__ == '__main__':
assert solution().findMaxConsecutiveOnes([0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]) == 6
assert solution().findMaxConsecutiveOnes([0, 1]) == 1 |
#
# PySNMP MIB module Nortel-Magellan-Passport-FrameRelayNniTraceMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-FrameRelayNniTraceMIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:17: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)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint")
frNni, frNniIndex = mibBuilder.importSymbols("Nortel-Magellan-Passport-FrameRelayNniMIB", "frNni", "frNniIndex")
Unsigned32, DisplayString, RowPointer, StorageType, RowStatus = mibBuilder.importSymbols("Nortel-Magellan-Passport-StandardTextualConventionsMIB", "Unsigned32", "DisplayString", "RowPointer", "StorageType", "RowStatus")
NonReplicated, AsciiString = mibBuilder.importSymbols("Nortel-Magellan-Passport-TextualConventionsMIB", "NonReplicated", "AsciiString")
passportMIBs, = mibBuilder.importSymbols("Nortel-Magellan-Passport-UsefulDefinitionsMIB", "passportMIBs")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Unsigned32, TimeTicks, Counter32, Counter64, Bits, ObjectIdentity, Gauge32, Integer32, ModuleIdentity, IpAddress, MibIdentifier, NotificationType, iso, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "TimeTicks", "Counter32", "Counter64", "Bits", "ObjectIdentity", "Gauge32", "Integer32", "ModuleIdentity", "IpAddress", "MibIdentifier", "NotificationType", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
frameRelayNniTraceMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106))
frNniTrace = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7))
frNniTraceRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1), )
if mibBuilder.loadTexts: frNniTraceRowStatusTable.setStatus('mandatory')
frNniTraceRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayNniMIB", "frNniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceIndex"))
if mibBuilder.loadTexts: frNniTraceRowStatusEntry.setStatus('mandatory')
frNniTraceRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceRowStatus.setStatus('mandatory')
frNniTraceComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceComponentName.setStatus('mandatory')
frNniTraceStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceStorageType.setStatus('mandatory')
frNniTraceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frNniTraceIndex.setStatus('mandatory')
frNniTraceOperationalTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10), )
if mibBuilder.loadTexts: frNniTraceOperationalTable.setStatus('mandatory')
frNniTraceOperationalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayNniMIB", "frNniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceIndex"))
if mibBuilder.loadTexts: frNniTraceOperationalEntry.setStatus('mandatory')
frNniTraceReceiverName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 2), AsciiString().subtype(subtypeSpec=ValueSizeConstraint(0, 8))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceReceiverName.setStatus('mandatory')
frNniTraceDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 9999)).clone(60)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceDuration.setStatus('mandatory')
frNniTraceQueueLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100)).clone(20)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceQueueLimit.setStatus('mandatory')
frNniTraceSession = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 5), RowPointer()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceSession.setStatus('mandatory')
frNniTraceFilter = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2))
frNniTraceFilterRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1), )
if mibBuilder.loadTexts: frNniTraceFilterRowStatusTable.setStatus('mandatory')
frNniTraceFilterRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayNniMIB", "frNniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceFilterIndex"))
if mibBuilder.loadTexts: frNniTraceFilterRowStatusEntry.setStatus('mandatory')
frNniTraceFilterRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceFilterRowStatus.setStatus('mandatory')
frNniTraceFilterComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceFilterComponentName.setStatus('mandatory')
frNniTraceFilterStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceFilterStorageType.setStatus('mandatory')
frNniTraceFilterIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frNniTraceFilterIndex.setStatus('mandatory')
frNniTraceFilterOperationalTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10), )
if mibBuilder.loadTexts: frNniTraceFilterOperationalTable.setStatus('mandatory')
frNniTraceFilterOperationalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayNniMIB", "frNniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceFilterIndex"))
if mibBuilder.loadTexts: frNniTraceFilterOperationalEntry.setStatus('mandatory')
frNniTraceFilterTraceType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1).clone(hexValue="e0")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceFilterTraceType.setStatus('mandatory')
frNniTraceFilterTracedDlci = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 1007))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceFilterTracedDlci.setStatus('mandatory')
frNniTraceFilterDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1).clone(hexValue="c0")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceFilterDirection.setStatus('mandatory')
frNniTraceFilterTracedLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2000)).clone(2000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceFilterTracedLength.setStatus('mandatory')
frameRelayNniTraceGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1))
frameRelayNniTraceGroupBD = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4))
frameRelayNniTraceGroupBD01 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4, 2))
frameRelayNniTraceGroupBD01A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4, 2, 2))
frameRelayNniTraceCapabilities = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3))
frameRelayNniTraceCapabilitiesBD = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4))
frameRelayNniTraceCapabilitiesBD01 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4, 2))
frameRelayNniTraceCapabilitiesBD01A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4, 2, 2))
mibBuilder.exportSymbols("Nortel-Magellan-Passport-FrameRelayNniTraceMIB", frNniTraceFilterDirection=frNniTraceFilterDirection, frNniTraceReceiverName=frNniTraceReceiverName, frNniTraceFilterStorageType=frNniTraceFilterStorageType, frNniTraceRowStatusTable=frNniTraceRowStatusTable, frameRelayNniTraceCapabilities=frameRelayNniTraceCapabilities, frNniTraceIndex=frNniTraceIndex, frNniTraceRowStatusEntry=frNniTraceRowStatusEntry, frNniTraceFilterOperationalEntry=frNniTraceFilterOperationalEntry, frNniTraceFilterRowStatusTable=frNniTraceFilterRowStatusTable, frNniTraceFilterTraceType=frNniTraceFilterTraceType, frNniTraceFilterIndex=frNniTraceFilterIndex, frameRelayNniTraceCapabilitiesBD=frameRelayNniTraceCapabilitiesBD, frameRelayNniTraceCapabilitiesBD01A=frameRelayNniTraceCapabilitiesBD01A, frNniTraceFilterRowStatus=frNniTraceFilterRowStatus, frameRelayNniTraceGroup=frameRelayNniTraceGroup, frNniTrace=frNniTrace, frNniTraceComponentName=frNniTraceComponentName, frameRelayNniTraceCapabilitiesBD01=frameRelayNniTraceCapabilitiesBD01, frNniTraceFilterRowStatusEntry=frNniTraceFilterRowStatusEntry, frameRelayNniTraceGroupBD01A=frameRelayNniTraceGroupBD01A, frNniTraceSession=frNniTraceSession, frameRelayNniTraceMIB=frameRelayNniTraceMIB, frNniTraceQueueLimit=frNniTraceQueueLimit, frNniTraceFilterOperationalTable=frNniTraceFilterOperationalTable, frNniTraceOperationalEntry=frNniTraceOperationalEntry, frameRelayNniTraceGroupBD=frameRelayNniTraceGroupBD, frNniTraceFilterTracedLength=frNniTraceFilterTracedLength, frNniTraceOperationalTable=frNniTraceOperationalTable, frameRelayNniTraceGroupBD01=frameRelayNniTraceGroupBD01, frNniTraceFilterComponentName=frNniTraceFilterComponentName, frNniTraceDuration=frNniTraceDuration, frNniTraceStorageType=frNniTraceStorageType, frNniTraceRowStatus=frNniTraceRowStatus, frNniTraceFilter=frNniTraceFilter, frNniTraceFilterTracedDlci=frNniTraceFilterTracedDlci)
| (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, single_value_constraint, constraints_intersection, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueSizeConstraint')
(fr_nni, fr_nni_index) = mibBuilder.importSymbols('Nortel-Magellan-Passport-FrameRelayNniMIB', 'frNni', 'frNniIndex')
(unsigned32, display_string, row_pointer, storage_type, row_status) = mibBuilder.importSymbols('Nortel-Magellan-Passport-StandardTextualConventionsMIB', 'Unsigned32', 'DisplayString', 'RowPointer', 'StorageType', 'RowStatus')
(non_replicated, ascii_string) = mibBuilder.importSymbols('Nortel-Magellan-Passport-TextualConventionsMIB', 'NonReplicated', 'AsciiString')
(passport_mi_bs,) = mibBuilder.importSymbols('Nortel-Magellan-Passport-UsefulDefinitionsMIB', 'passportMIBs')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(unsigned32, time_ticks, counter32, counter64, bits, object_identity, gauge32, integer32, module_identity, ip_address, mib_identifier, notification_type, iso, mib_scalar, mib_table, mib_table_row, mib_table_column) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'TimeTicks', 'Counter32', 'Counter64', 'Bits', 'ObjectIdentity', 'Gauge32', 'Integer32', 'ModuleIdentity', 'IpAddress', 'MibIdentifier', 'NotificationType', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
frame_relay_nni_trace_mib = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106))
fr_nni_trace = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7))
fr_nni_trace_row_status_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1))
if mibBuilder.loadTexts:
frNniTraceRowStatusTable.setStatus('mandatory')
fr_nni_trace_row_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayNniMIB', 'frNniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceIndex'))
if mibBuilder.loadTexts:
frNniTraceRowStatusEntry.setStatus('mandatory')
fr_nni_trace_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 1), row_status()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceRowStatus.setStatus('mandatory')
fr_nni_trace_component_name = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceComponentName.setStatus('mandatory')
fr_nni_trace_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 4), storage_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceStorageType.setStatus('mandatory')
fr_nni_trace_index = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 10), non_replicated())
if mibBuilder.loadTexts:
frNniTraceIndex.setStatus('mandatory')
fr_nni_trace_operational_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10))
if mibBuilder.loadTexts:
frNniTraceOperationalTable.setStatus('mandatory')
fr_nni_trace_operational_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayNniMIB', 'frNniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceIndex'))
if mibBuilder.loadTexts:
frNniTraceOperationalEntry.setStatus('mandatory')
fr_nni_trace_receiver_name = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 2), ascii_string().subtype(subtypeSpec=value_size_constraint(0, 8))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceReceiverName.setStatus('mandatory')
fr_nni_trace_duration = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 9999)).clone(60)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceDuration.setStatus('mandatory')
fr_nni_trace_queue_limit = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 100)).clone(20)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceQueueLimit.setStatus('mandatory')
fr_nni_trace_session = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 5), row_pointer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceSession.setStatus('mandatory')
fr_nni_trace_filter = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2))
fr_nni_trace_filter_row_status_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1))
if mibBuilder.loadTexts:
frNniTraceFilterRowStatusTable.setStatus('mandatory')
fr_nni_trace_filter_row_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayNniMIB', 'frNniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceFilterIndex'))
if mibBuilder.loadTexts:
frNniTraceFilterRowStatusEntry.setStatus('mandatory')
fr_nni_trace_filter_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 1), row_status()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceFilterRowStatus.setStatus('mandatory')
fr_nni_trace_filter_component_name = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceFilterComponentName.setStatus('mandatory')
fr_nni_trace_filter_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 4), storage_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceFilterStorageType.setStatus('mandatory')
fr_nni_trace_filter_index = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 10), non_replicated())
if mibBuilder.loadTexts:
frNniTraceFilterIndex.setStatus('mandatory')
fr_nni_trace_filter_operational_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10))
if mibBuilder.loadTexts:
frNniTraceFilterOperationalTable.setStatus('mandatory')
fr_nni_trace_filter_operational_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayNniMIB', 'frNniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceFilterIndex'))
if mibBuilder.loadTexts:
frNniTraceFilterOperationalEntry.setStatus('mandatory')
fr_nni_trace_filter_trace_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1).clone(hexValue='e0')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceFilterTraceType.setStatus('mandatory')
fr_nni_trace_filter_traced_dlci = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 1007))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceFilterTracedDlci.setStatus('mandatory')
fr_nni_trace_filter_direction = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1).clone(hexValue='c0')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceFilterDirection.setStatus('mandatory')
fr_nni_trace_filter_traced_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 2000)).clone(2000)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceFilterTracedLength.setStatus('mandatory')
frame_relay_nni_trace_group = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1))
frame_relay_nni_trace_group_bd = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4))
frame_relay_nni_trace_group_bd01 = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4, 2))
frame_relay_nni_trace_group_bd01_a = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4, 2, 2))
frame_relay_nni_trace_capabilities = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3))
frame_relay_nni_trace_capabilities_bd = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4))
frame_relay_nni_trace_capabilities_bd01 = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4, 2))
frame_relay_nni_trace_capabilities_bd01_a = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4, 2, 2))
mibBuilder.exportSymbols('Nortel-Magellan-Passport-FrameRelayNniTraceMIB', frNniTraceFilterDirection=frNniTraceFilterDirection, frNniTraceReceiverName=frNniTraceReceiverName, frNniTraceFilterStorageType=frNniTraceFilterStorageType, frNniTraceRowStatusTable=frNniTraceRowStatusTable, frameRelayNniTraceCapabilities=frameRelayNniTraceCapabilities, frNniTraceIndex=frNniTraceIndex, frNniTraceRowStatusEntry=frNniTraceRowStatusEntry, frNniTraceFilterOperationalEntry=frNniTraceFilterOperationalEntry, frNniTraceFilterRowStatusTable=frNniTraceFilterRowStatusTable, frNniTraceFilterTraceType=frNniTraceFilterTraceType, frNniTraceFilterIndex=frNniTraceFilterIndex, frameRelayNniTraceCapabilitiesBD=frameRelayNniTraceCapabilitiesBD, frameRelayNniTraceCapabilitiesBD01A=frameRelayNniTraceCapabilitiesBD01A, frNniTraceFilterRowStatus=frNniTraceFilterRowStatus, frameRelayNniTraceGroup=frameRelayNniTraceGroup, frNniTrace=frNniTrace, frNniTraceComponentName=frNniTraceComponentName, frameRelayNniTraceCapabilitiesBD01=frameRelayNniTraceCapabilitiesBD01, frNniTraceFilterRowStatusEntry=frNniTraceFilterRowStatusEntry, frameRelayNniTraceGroupBD01A=frameRelayNniTraceGroupBD01A, frNniTraceSession=frNniTraceSession, frameRelayNniTraceMIB=frameRelayNniTraceMIB, frNniTraceQueueLimit=frNniTraceQueueLimit, frNniTraceFilterOperationalTable=frNniTraceFilterOperationalTable, frNniTraceOperationalEntry=frNniTraceOperationalEntry, frameRelayNniTraceGroupBD=frameRelayNniTraceGroupBD, frNniTraceFilterTracedLength=frNniTraceFilterTracedLength, frNniTraceOperationalTable=frNniTraceOperationalTable, frameRelayNniTraceGroupBD01=frameRelayNniTraceGroupBD01, frNniTraceFilterComponentName=frNniTraceFilterComponentName, frNniTraceDuration=frNniTraceDuration, frNniTraceStorageType=frNniTraceStorageType, frNniTraceRowStatus=frNniTraceRowStatus, frNniTraceFilter=frNniTraceFilter, frNniTraceFilterTracedDlci=frNniTraceFilterTracedDlci) |
RSS_PERF_NAME = "rss"
FLT_PERF_NAME = "flt"
CPU_CLOCK_PERF_NAME = "cpu_clock"
TSK_CLOCK_PERF_NAME = "task_clock"
SIZE_PERF_NAME = "file_size"
EXEC_OVER_HEAD_KEY = 'exec'
MEM_USE_OVER_HEAD_KEY = 'mem'
FILE_SIZE_OVER_HEAD_KEY = 'size'
| rss_perf_name = 'rss'
flt_perf_name = 'flt'
cpu_clock_perf_name = 'cpu_clock'
tsk_clock_perf_name = 'task_clock'
size_perf_name = 'file_size'
exec_over_head_key = 'exec'
mem_use_over_head_key = 'mem'
file_size_over_head_key = 'size' |
LINE_LEN = 25
while True:
try:
n = int(input())
if n == 0:
break
surface = []
max_len = 0
for i in range(n):
line = str(input())
line = line.strip()
l_space = line.find(' ')
if l_space == -1:
max_len = LINE_LEN
else:
r_space = line.rfind(' ')
cur_len = l_space + LINE_LEN - r_space - 1
if cur_len > max_len:
max_len = cur_len
surface.append(cur_len)
res = sum(map(lambda x: max_len - x, surface))
print(res)
except(EOFError):
break
| line_len = 25
while True:
try:
n = int(input())
if n == 0:
break
surface = []
max_len = 0
for i in range(n):
line = str(input())
line = line.strip()
l_space = line.find(' ')
if l_space == -1:
max_len = LINE_LEN
else:
r_space = line.rfind(' ')
cur_len = l_space + LINE_LEN - r_space - 1
if cur_len > max_len:
max_len = cur_len
surface.append(cur_len)
res = sum(map(lambda x: max_len - x, surface))
print(res)
except EOFError:
break |
class Solution:
def findMin(self, nums: List[int]) -> int:
# solution 1
# return min(nums)
# solution 2
left = 0
right = len(nums)-1
while left < right:
mid = int((left + right)/2)
if nums[mid] < nums[right]:
right = mid
elif nums[mid] == nums[right]:
right = right - 1
else:
left = mid+1
return nums[left]
| class Solution:
def find_min(self, nums: List[int]) -> int:
left = 0
right = len(nums) - 1
while left < right:
mid = int((left + right) / 2)
if nums[mid] < nums[right]:
right = mid
elif nums[mid] == nums[right]:
right = right - 1
else:
left = mid + 1
return nums[left] |
def cyclicQ(ll):
da_node = ll
sentient = ll
poop = ll
poop = poop.next.next
ll = ll.next
while poop != ll and poop is not None and poop.next is not None:
poop = poop.next.next
ll = ll.next
if poop is None or poop.next is None:
return None
node_in_cycle = ll
while ll.next != node_in_cycle:
ll = ll.next
da_node = da_node.next
da_node = da_node.next
while sentient != da_node:
sentient = sentient.next
da_node = da_node.next
return da_node
| def cyclic_q(ll):
da_node = ll
sentient = ll
poop = ll
poop = poop.next.next
ll = ll.next
while poop != ll and poop is not None and (poop.next is not None):
poop = poop.next.next
ll = ll.next
if poop is None or poop.next is None:
return None
node_in_cycle = ll
while ll.next != node_in_cycle:
ll = ll.next
da_node = da_node.next
da_node = da_node.next
while sentient != da_node:
sentient = sentient.next
da_node = da_node.next
return da_node |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
class Trace:
'''An object that can cause a trace entry'''
def trace(self) -> str:
'''Return a representation of the entry for tracing
This is used by things like the standalone ISS with -v
'''
raise NotImplementedError()
class TracePC(Trace):
def __init__(self, pc: int):
self.pc = pc
def trace(self) -> str:
return "pc = {:#x}".format(self.pc)
| class Trace:
"""An object that can cause a trace entry"""
def trace(self) -> str:
"""Return a representation of the entry for tracing
This is used by things like the standalone ISS with -v
"""
raise not_implemented_error()
class Tracepc(Trace):
def __init__(self, pc: int):
self.pc = pc
def trace(self) -> str:
return 'pc = {:#x}'.format(self.pc) |
WAGTAILSEARCH_BACKENDS = {
"default": {"BACKEND": "wagtail.contrib.postgres_search.backend"}
}
| wagtailsearch_backends = {'default': {'BACKEND': 'wagtail.contrib.postgres_search.backend'}} |
# https://www.codingame.com/training/easy/1d-spreadsheet
def add_dependency(cell, arg_cell, in_deps, out_deps):
if cell not in out_deps: out_deps[cell] = set()
out_deps[cell].add(arg_cell)
if arg_cell not in in_deps: in_deps[arg_cell] = set()
in_deps[arg_cell].add(cell)
def remove_dependency(cell, in_deps, out_deps):
rc = []
if cell not in in_deps: return rc
for o in in_deps[cell]:
if cell in out_deps[o]:
out_deps[o].remove(cell)
if not out_deps[o]:
rc.append(o)
return rc
def evaluate_dependencies(cells, in_deps, out_deps, cell_operations):
ready_cells = set()
evaluated_cells = set()
for cell in out_deps:
if not out_deps[cell]:
ready_cells.add(cell)
while ready_cells:
cell = ready_cells.pop()
evaluated_cells.add(cell)
perform_operation(cell=cell, **cell_operations[cell], cells=cells)
rc = remove_dependency(cell, in_deps, out_deps)
ready_cells.update([o for o in rc if o not in evaluated_cells])
for cell in cells:
print(cell)
def get_arg_val(arg, cells):
if '$' in arg:
return cells[int(arg[1:])]
elif '_' in arg:
return 0
else:
return int(arg)
def perform_operation(cell, operation, arg1, arg2, cells):
val1 = get_arg_val(arg1, cells)
val2 = get_arg_val(arg2, cells)
if operation == 'VALUE':
cells[cell] = val1
elif operation == 'ADD':
cells[cell] = val1 + val2
elif operation == 'SUB':
cells[cell] = val1 - val2
else:
cells[cell] = val1 * val2
def solution():
num_cells = int(input())
in_deps = {}
out_deps = {}
cells = [0] * num_cells
cell_operations = [{} for _ in range(num_cells)]
for cell in range(num_cells):
operation, arg1, arg2 = input().split()
cell_operations[cell] = {
'operation': operation,
'arg1': arg1,
'arg2': arg2
}
if cell not in out_deps: out_deps[cell] = set()
if '$' in arg1: add_dependency(cell, int(arg1[1:]), in_deps, out_deps)
if '$' in arg2: add_dependency(cell, int(arg2[1:]), in_deps, out_deps)
evaluate_dependencies(cells, in_deps, out_deps, cell_operations)
solution()
| def add_dependency(cell, arg_cell, in_deps, out_deps):
if cell not in out_deps:
out_deps[cell] = set()
out_deps[cell].add(arg_cell)
if arg_cell not in in_deps:
in_deps[arg_cell] = set()
in_deps[arg_cell].add(cell)
def remove_dependency(cell, in_deps, out_deps):
rc = []
if cell not in in_deps:
return rc
for o in in_deps[cell]:
if cell in out_deps[o]:
out_deps[o].remove(cell)
if not out_deps[o]:
rc.append(o)
return rc
def evaluate_dependencies(cells, in_deps, out_deps, cell_operations):
ready_cells = set()
evaluated_cells = set()
for cell in out_deps:
if not out_deps[cell]:
ready_cells.add(cell)
while ready_cells:
cell = ready_cells.pop()
evaluated_cells.add(cell)
perform_operation(cell=cell, **cell_operations[cell], cells=cells)
rc = remove_dependency(cell, in_deps, out_deps)
ready_cells.update([o for o in rc if o not in evaluated_cells])
for cell in cells:
print(cell)
def get_arg_val(arg, cells):
if '$' in arg:
return cells[int(arg[1:])]
elif '_' in arg:
return 0
else:
return int(arg)
def perform_operation(cell, operation, arg1, arg2, cells):
val1 = get_arg_val(arg1, cells)
val2 = get_arg_val(arg2, cells)
if operation == 'VALUE':
cells[cell] = val1
elif operation == 'ADD':
cells[cell] = val1 + val2
elif operation == 'SUB':
cells[cell] = val1 - val2
else:
cells[cell] = val1 * val2
def solution():
num_cells = int(input())
in_deps = {}
out_deps = {}
cells = [0] * num_cells
cell_operations = [{} for _ in range(num_cells)]
for cell in range(num_cells):
(operation, arg1, arg2) = input().split()
cell_operations[cell] = {'operation': operation, 'arg1': arg1, 'arg2': arg2}
if cell not in out_deps:
out_deps[cell] = set()
if '$' in arg1:
add_dependency(cell, int(arg1[1:]), in_deps, out_deps)
if '$' in arg2:
add_dependency(cell, int(arg2[1:]), in_deps, out_deps)
evaluate_dependencies(cells, in_deps, out_deps, cell_operations)
solution() |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Word:
def __init__(self, id, name, image, category=None):
self.id = id
self.name = name
self.image = image
self.category = category
| class Word:
def __init__(self, id, name, image, category=None):
self.id = id
self.name = name
self.image = image
self.category = category |
def optimal_order(predecessors_map, weight_map):
vertices = frozenset(predecessors_map.keys())
# print(vertices)
memo_map = {frozenset(): (0, [])}
# print(memo_map)
return optimal_order_helper(predecessors_map, weight_map, vertices, memo_map)
def optimal_order_helper(predecessors_map, weight_map, vertices, memo_map):
if vertices in memo_map:
return memo_map[vertices]
possibilities = []
# koop through my verticies (number reducing by 1 each time)
for v in vertices:
# use DFS to get to either x or v which are the 2 smallest numbers
if any(u in vertices for u in predecessors_map[v]):
continue
sub_obj, sub_order = optimal_order_helper(predecessors_map, weight_map, vertices - frozenset({v}), memo_map)
# x + x*y + x*y*z = x*(1 + y*(1 + z))
possibilities.append((weight_map[v] * (1.0 + sub_obj), [v] + sub_order))
print(possibilities)
best = min(possibilities)
memo_map[vertices] = best
# print(memo_map)
return best
print(optimal_order({'u': [], 'v': ['u'], 'w': [], 'x': ['w']}, {'u': 1.2, 'v': 0.5, 'w': 1.1, 'x': 1.001})) | def optimal_order(predecessors_map, weight_map):
vertices = frozenset(predecessors_map.keys())
memo_map = {frozenset(): (0, [])}
return optimal_order_helper(predecessors_map, weight_map, vertices, memo_map)
def optimal_order_helper(predecessors_map, weight_map, vertices, memo_map):
if vertices in memo_map:
return memo_map[vertices]
possibilities = []
for v in vertices:
if any((u in vertices for u in predecessors_map[v])):
continue
(sub_obj, sub_order) = optimal_order_helper(predecessors_map, weight_map, vertices - frozenset({v}), memo_map)
possibilities.append((weight_map[v] * (1.0 + sub_obj), [v] + sub_order))
print(possibilities)
best = min(possibilities)
memo_map[vertices] = best
return best
print(optimal_order({'u': [], 'v': ['u'], 'w': [], 'x': ['w']}, {'u': 1.2, 'v': 0.5, 'w': 1.1, 'x': 1.001})) |
# Program to implement First Come First Served CPU scheduling algorithm
print("First Come First Served scheduling Algorithm")
print("============================================\n")
headers = ['Processes','Arrival Time','Burst Time','Waiting Time'
,'Turn-Around Time','Completion Time']
# Dictionary to store the output
out = dict()
# Get number of processes from User
N = int(input("Number of processes : "))
a, b = 0, 0
# Get Arrival time and Burst time of N processes
for i in range(0,N):
k = f"P{i+1}"
a = int(input(f"Enter Arrival time of process{i+1} :: "))
b = int(input(f"Enter Burst time of process{i+1} :: "))
out[k] = [a,b]
# storing processes in order of increasing arrival time
out = sorted(out.items(),key=lambda i:i[1][0])
# storing Completion times
for i in range(0,N):
if i == 0:
out[i][1].append(out[i][1][0]+out[i][1][1])
else:
out[i][1].append(out[i-1][1][2]+out[i][1][1])
# storing turn-around times
for i in range(0,N):
out[i][1].append(out[i][1][2]-out[i][1][0])
# storing waiting time
for i in range(0,N):
out[i][1].append(out[i][1][3]-out[i][1][1])
# storing avg waiting time and avg turn around time
avgWaitTime = 0
avgTATime = 0
for i in range(0,N):
avgWaitTime += out[i][1][4]
avgTATime += out[i][1][3]
avgWaitTime /= N
avgTATime /= N
print(f"\n{headers[0]:^15}{headers[1]:^15}{headers[2]:^15}{headers[3]:^15}{headers[4]:^20}{headers[5]:^20}")
for a in out:
print(f"{a[0]:^15}{a[1][0]:^15}{a[1][1]:^15}{a[1][4]:^15}{a[1][3]:^20}{a[1][2]:^20}")
print(f"\nAverage Waiting Time : {avgWaitTime:.2f}\nAverage Turn-Around Time : {avgTATime:.2f}") | print('First Come First Served scheduling Algorithm')
print('============================================\n')
headers = ['Processes', 'Arrival Time', 'Burst Time', 'Waiting Time', 'Turn-Around Time', 'Completion Time']
out = dict()
n = int(input('Number of processes : '))
(a, b) = (0, 0)
for i in range(0, N):
k = f'P{i + 1}'
a = int(input(f'Enter Arrival time of process{i + 1} :: '))
b = int(input(f'Enter Burst time of process{i + 1} :: '))
out[k] = [a, b]
out = sorted(out.items(), key=lambda i: i[1][0])
for i in range(0, N):
if i == 0:
out[i][1].append(out[i][1][0] + out[i][1][1])
else:
out[i][1].append(out[i - 1][1][2] + out[i][1][1])
for i in range(0, N):
out[i][1].append(out[i][1][2] - out[i][1][0])
for i in range(0, N):
out[i][1].append(out[i][1][3] - out[i][1][1])
avg_wait_time = 0
avg_ta_time = 0
for i in range(0, N):
avg_wait_time += out[i][1][4]
avg_ta_time += out[i][1][3]
avg_wait_time /= N
avg_ta_time /= N
print(f'\n{headers[0]:^15}{headers[1]:^15}{headers[2]:^15}{headers[3]:^15}{headers[4]:^20}{headers[5]:^20}')
for a in out:
print(f'{a[0]:^15}{a[1][0]:^15}{a[1][1]:^15}{a[1][4]:^15}{a[1][3]:^20}{a[1][2]:^20}')
print(f'\nAverage Waiting Time : {avgWaitTime:.2f}\nAverage Turn-Around Time : {avgTATime:.2f}') |
# -*- coding: utf-8 -*-
__author__ = 'Sinval Vieira Mendes Neto'
__email__ = '[email protected]'
__version__ = '0.1.0'
| __author__ = 'Sinval Vieira Mendes Neto'
__email__ = '[email protected]'
__version__ = '0.1.0' |
# Tuples in python
def swap(m, n, k):
temp = m
m = n
n = k
k = temp
return m, n, k
def main():
a = (1, "iPhone 12 Pro Max", 1.8, 1)
print(a)
print(a[1])
print(a.index(1.8))
print(a.count(1))
b = a + (999, 888)
print(b)
m = 1
n = 2
k = 3
m, n, k = swap(m, n, k)
print(m, n, k)
if __name__ == "__main__":
main() | def swap(m, n, k):
temp = m
m = n
n = k
k = temp
return (m, n, k)
def main():
a = (1, 'iPhone 12 Pro Max', 1.8, 1)
print(a)
print(a[1])
print(a.index(1.8))
print(a.count(1))
b = a + (999, 888)
print(b)
m = 1
n = 2
k = 3
(m, n, k) = swap(m, n, k)
print(m, n, k)
if __name__ == '__main__':
main() |
# O programa le um valor em metros e o exibe convertido em centimetros e milimetros
metros = float(input('Entre com a distancia em metros: '))
centimetros = metros * 100
milimetros = metros * 1000
kilometros = metros / 1000.0
print('{} metros e {:.0f} centimetros'.format(metros, centimetros))
print('{} metros e {} milimetros'.format(metros, milimetros))
print('{} metros e {} kilometros'.format(metros, kilometros)) | metros = float(input('Entre com a distancia em metros: '))
centimetros = metros * 100
milimetros = metros * 1000
kilometros = metros / 1000.0
print('{} metros e {:.0f} centimetros'.format(metros, centimetros))
print('{} metros e {} milimetros'.format(metros, milimetros))
print('{} metros e {} kilometros'.format(metros, kilometros)) |
train_datagen = ImageDataGenerator(rescale=1./255) # rescaling on the fly
# Updated to do image augmentation
train_datagen = ImageDataGenerator(
rescale = 1./255, # recaling
rotation_range = 40, # randomly rotate b/w 0 and 40 degrees
width_shift_range = 0.2, # shifting the images
height_shift_range = 0.2, # Randomly shift b/w 0 to 20 %
shear_range = 0.2, # It will shear the image by specified amounts upto the specified portion of the image
zoom_range = 0.2, # Zoom the image by 20% of random amounts of the image
horizontal_flip = True, # Flip the image/ Mirror image at random
fill_mode = 'nearest' # Fills the pixels that might have been lost in the operations
)
| train_datagen = image_data_generator(rescale=1.0 / 255)
train_datagen = image_data_generator(rescale=1.0 / 255, rotation_range=40, width_shift_range=0.2, height_shift_range=0.2, shear_range=0.2, zoom_range=0.2, horizontal_flip=True, fill_mode='nearest') |
#!/usr/bin/env python
##
# Print a heading.
#
# @var string text
# @return string
##
def heading(text):
return '-----> ' + text;
##
# Print a single line.
#
# @var string text
# @return string
##
def line(text):
return ' ' + text;
##
# Print a single new line.
#
# @return string
##
def nl():
return line('');
| def heading(text):
return '-----> ' + text
def line(text):
return ' ' + text
def nl():
return line('') |
print('Laboratory work 1.1 measurements of the R-load.')
measurements = []
measurements_count = int(input('Enter number of measurements : '))
for cur_measurement_number in range(1, measurements_count+1):
print(f'Enter value for measurement {cur_measurement_number} -> ', end='')
measurement = float(input())
measurements.append(measurement)
print('Results of the measurements: ')
for index, cur_measurement_number in enumerate(measurements):
print (f'({index}): {cur_measurement_number} Ohms')
| print('Laboratory work 1.1 measurements of the R-load.')
measurements = []
measurements_count = int(input('Enter number of measurements : '))
for cur_measurement_number in range(1, measurements_count + 1):
print(f'Enter value for measurement {cur_measurement_number} -> ', end='')
measurement = float(input())
measurements.append(measurement)
print('Results of the measurements: ')
for (index, cur_measurement_number) in enumerate(measurements):
print(f'({index}): {cur_measurement_number} Ohms') |
#tests: depend_extra
depend_extra=('pelle',)
def synthesis():
pass
| depend_extra = ('pelle',)
def synthesis():
pass |
def _capnp_toolchain_gen_impl(ctx):
ctx.template(
"toolchain/BUILD.bazel",
ctx.attr._build_tpl,
substitutions = {
"{capnp_tool}": str(ctx.attr.capnp_tool),
},
)
capnp_toolchain_gen = repository_rule(
implementation = _capnp_toolchain_gen_impl,
attrs = {
"capnp_tool": attr.label(
allow_single_file = True,
cfg = "host",
executable = True,
),
"_build_tpl": attr.label(
default = "@rules_capnproto//capnp/internal:BUILD.toolchain.tpl",
),
},
doc = "Creates the Capnp toolchain that will be used by all capnp_library targets",
)
| def _capnp_toolchain_gen_impl(ctx):
ctx.template('toolchain/BUILD.bazel', ctx.attr._build_tpl, substitutions={'{capnp_tool}': str(ctx.attr.capnp_tool)})
capnp_toolchain_gen = repository_rule(implementation=_capnp_toolchain_gen_impl, attrs={'capnp_tool': attr.label(allow_single_file=True, cfg='host', executable=True), '_build_tpl': attr.label(default='@rules_capnproto//capnp/internal:BUILD.toolchain.tpl')}, doc='Creates the Capnp toolchain that will be used by all capnp_library targets') |
expected_output = {
'steering_entries': {
'sgt': {
2057: {
'entry_last_refresh': '10:32:00',
'entry_state': 'COMPLETE',
'peer_name': 'Unknown-2057',
'peer_sgt': '2057-01',
'policy_rbacl_src_list': {
'entry_status': 'UNKNOWN',
'installed_elements': '0x00000C80',
'installed_peer_policy': {
'peer_policy': '0x7F3ADDAFEA08',
'policy_flag': '0x00400001'
},
'installed_sgt_policy': {
'peer_policy': '0x7F3ADDAFF308',
'policy_flag': '0x41400001'
},
'policy_expires_in': '0:23:59:55',
'policy_refreshes_in': '0:23:59:55',
'received_elements': '0x00000C80',
'received_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
},
'retry_timer': 'not running',
'sgt_policy_last_refresh': '10:32:00 UTC '
'Fri Oct 15 '
'2021',
'sgt_policy_refresh_time_secs': 86400,
'staled_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
}
},
'requested_elements': '0x00001401'
},
3053: {
'entry_last_refresh': '10:30:42',
'entry_state': 'COMPLETE',
'peer_name': 'Unknown-3053',
'peer_sgt': '3053-01',
'policy_rbacl_src_list': {
'entry_status': 'UNKNOWN',
'installed_elements': '0x00000C80',
'installed_peer_policy': {
'peer_policy': '0x7F3ADDAFEC08',
'policy_flag': '0x00400001'
},
'installed_sgt_policy': {
'peer_policy': '0x7F3ADDAFF1B8',
'policy_flag': '0x41400001'
},
'policy_expires_in': '0:23:58:37',
'policy_refreshes_in': '0:23:58:37',
'received_elements': '0x00000C80',
'received_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
},
'retry_timer': 'not running',
'sgt_policy_last_refresh': '10:30:42 UTC '
'Fri Oct 15 '
'2021',
'sgt_policy_refresh_time_secs': 86400,
'staled_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
}
},
'requested_elements': '0x00001401'
},
65521: {
'entry_last_refresh': '00:00:00',
'entry_state': 'FAILURE',
'peer_name': 'Unknown-65521',
'peer_sgt': '65521',
'policy_rbacl_src_list': {
'entry_status': 'UNKNOWN',
'installed_elements': '0x00000000',
'installed_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
},
'received_elements': '0x00000000',
'received_peer_policy': {
'peer_policy': '0x7F3ADDAFEB08',
'policy_flag': '0x00000005'
},
'refresh_timer': 'not running',
'retry_timer': 'running',
'staled_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
}
},
'requested_elements': '0x00000081'
}
}
}
}
| expected_output = {'steering_entries': {'sgt': {2057: {'entry_last_refresh': '10:32:00', 'entry_state': 'COMPLETE', 'peer_name': 'Unknown-2057', 'peer_sgt': '2057-01', 'policy_rbacl_src_list': {'entry_status': 'UNKNOWN', 'installed_elements': '0x00000C80', 'installed_peer_policy': {'peer_policy': '0x7F3ADDAFEA08', 'policy_flag': '0x00400001'}, 'installed_sgt_policy': {'peer_policy': '0x7F3ADDAFF308', 'policy_flag': '0x41400001'}, 'policy_expires_in': '0:23:59:55', 'policy_refreshes_in': '0:23:59:55', 'received_elements': '0x00000C80', 'received_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}, 'retry_timer': 'not running', 'sgt_policy_last_refresh': '10:32:00 UTC Fri Oct 15 2021', 'sgt_policy_refresh_time_secs': 86400, 'staled_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}}, 'requested_elements': '0x00001401'}, 3053: {'entry_last_refresh': '10:30:42', 'entry_state': 'COMPLETE', 'peer_name': 'Unknown-3053', 'peer_sgt': '3053-01', 'policy_rbacl_src_list': {'entry_status': 'UNKNOWN', 'installed_elements': '0x00000C80', 'installed_peer_policy': {'peer_policy': '0x7F3ADDAFEC08', 'policy_flag': '0x00400001'}, 'installed_sgt_policy': {'peer_policy': '0x7F3ADDAFF1B8', 'policy_flag': '0x41400001'}, 'policy_expires_in': '0:23:58:37', 'policy_refreshes_in': '0:23:58:37', 'received_elements': '0x00000C80', 'received_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}, 'retry_timer': 'not running', 'sgt_policy_last_refresh': '10:30:42 UTC Fri Oct 15 2021', 'sgt_policy_refresh_time_secs': 86400, 'staled_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}}, 'requested_elements': '0x00001401'}, 65521: {'entry_last_refresh': '00:00:00', 'entry_state': 'FAILURE', 'peer_name': 'Unknown-65521', 'peer_sgt': '65521', 'policy_rbacl_src_list': {'entry_status': 'UNKNOWN', 'installed_elements': '0x00000000', 'installed_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}, 'received_elements': '0x00000000', 'received_peer_policy': {'peer_policy': '0x7F3ADDAFEB08', 'policy_flag': '0x00000005'}, 'refresh_timer': 'not running', 'retry_timer': 'running', 'staled_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}}, 'requested_elements': '0x00000081'}}}} |
__author__ = 'Stormpath, Inc.'
__copyright__ = 'Copyright 2012-2014 Stormpath, Inc.'
__version_info__ = ('1', '3', '1')
__version__ = '.'.join(__version_info__)
__short_version__ = '.'.join(__version_info__)
| __author__ = 'Stormpath, Inc.'
__copyright__ = 'Copyright 2012-2014 Stormpath, Inc.'
__version_info__ = ('1', '3', '1')
__version__ = '.'.join(__version_info__)
__short_version__ = '.'.join(__version_info__) |
J
# welcoming the user
name = input("What is your name? ")
print("Hello, " + name, "It is time to play hangman!")
print("Start guessing...")
# here we set the secret
word = "secret"
# creates a variable with an empty value
guesses = ''
# determine the number of turns
turns = 10
while turns > 0:
failed = 0
for char in word:
if char in guesses:
print(char)
else:
print("_")
failed += 1
if failed == 0:
print("You won!")
break
guess = input("guess a character:")
guesses += guess
if guess not in word:
turns -= 1
print("Wrong")
print("You have", + turns, 'more guesses')
if turns == 0:
print("You lose")
| J
name = input('What is your name? ')
print('Hello, ' + name, 'It is time to play hangman!')
print('Start guessing...')
word = 'secret'
guesses = ''
turns = 10
while turns > 0:
failed = 0
for char in word:
if char in guesses:
print(char)
else:
print('_')
failed += 1
if failed == 0:
print('You won!')
break
guess = input('guess a character:')
guesses += guess
if guess not in word:
turns -= 1
print('Wrong')
print('You have', +turns, 'more guesses')
if turns == 0:
print('You lose') |
conductores = {
'azambrano': ('Andres Zambrano', 5.6, ('Hyundai', 'Elantra')),
'jojeda': ('Juan Ojeda', 1.1, ('Hyundai', 'Accent')),
# ...
}
def agrega_conductor(conductores, nuevo_conductor):
username, nombre, puntaje, (marca, modelo) = nuevo_conductor
if username in conductores:
return False
conductores[username] = (nombre, puntaje, (marca, modelo))
return True
def elimina_conductor(conductores, username):
if username not in conductores:
return False
del conductores[username]
return True
def ranking(conductores):
r = []
for c in conductores:
r.append((conductores[c][1], conductores[c][0]))
r.sort()
r.reverse()
final = []
for puntaje, nombre in r:
final.append((nombre, puntaje))
return final
| conductores = {'azambrano': ('Andres Zambrano', 5.6, ('Hyundai', 'Elantra')), 'jojeda': ('Juan Ojeda', 1.1, ('Hyundai', 'Accent'))}
def agrega_conductor(conductores, nuevo_conductor):
(username, nombre, puntaje, (marca, modelo)) = nuevo_conductor
if username in conductores:
return False
conductores[username] = (nombre, puntaje, (marca, modelo))
return True
def elimina_conductor(conductores, username):
if username not in conductores:
return False
del conductores[username]
return True
def ranking(conductores):
r = []
for c in conductores:
r.append((conductores[c][1], conductores[c][0]))
r.sort()
r.reverse()
final = []
for (puntaje, nombre) in r:
final.append((nombre, puntaje))
return final |
#calculator
def add(n1,n2):
return n1 +n2
def substract(n1,n2):
return n1-n2
def multiply(n1,n2):
return n1 * n2
def devide(n1,n2):
return n1/n2
operator = {
"+": add,
"-": substract,
"*": multiply,
"/": devide,
}
num1 = float(input("Enter number: "))
op_simbol = input("enter + - * / ")
num2 = float(input("Enter number: "))
calc_func = operator[op_simbol]
ans = calc_func(num1,num2)
print(ans)
###########
studen_score = {
"Harry": 10,
"alex" :51,
"bibo": 91,
}
studen_grades = {}
for student in studen_score.keys():
score = studen_score[student]
if score > 90:
studen_grades[student] = "outstanding"
elif score > 50:
studen_grades[student] = "good"
elif score < 15:
studen_grades[student] = "poor"
#print(studen_grades)
travel_log = [
{"spain": {"city": ["malorka","tenerife","lanzarote"]}},
{"bulgaria": {"city": ["sf", "pld"]}}
]
def add_city(country,city):
newdict = {}
newdict[country] = {f"city: {city}"}
travel_log.append(newdict)
add_city("france", ["nice","monte"])
print(travel_log)
####################
name = ""
bid = ""
others = True
bidders = {}
while others is True:
name = input("Name? ")
bid = int(input("Bid? "))
others_bid = input("anyone else? Y or N ").lower()
if others_bid == "n":
others = False
bidders[name] = bid
print(bidders)
biggest = max(bidders.values())
for k,v in bidders.items():
if v == biggest:
name = k
winner = {}
winner[name] = biggest
print("winner is ", winner) | def add(n1, n2):
return n1 + n2
def substract(n1, n2):
return n1 - n2
def multiply(n1, n2):
return n1 * n2
def devide(n1, n2):
return n1 / n2
operator = {'+': add, '-': substract, '*': multiply, '/': devide}
num1 = float(input('Enter number: '))
op_simbol = input('enter + - * / ')
num2 = float(input('Enter number: '))
calc_func = operator[op_simbol]
ans = calc_func(num1, num2)
print(ans)
studen_score = {'Harry': 10, 'alex': 51, 'bibo': 91}
studen_grades = {}
for student in studen_score.keys():
score = studen_score[student]
if score > 90:
studen_grades[student] = 'outstanding'
elif score > 50:
studen_grades[student] = 'good'
elif score < 15:
studen_grades[student] = 'poor'
travel_log = [{'spain': {'city': ['malorka', 'tenerife', 'lanzarote']}}, {'bulgaria': {'city': ['sf', 'pld']}}]
def add_city(country, city):
newdict = {}
newdict[country] = {f'city: {city}'}
travel_log.append(newdict)
add_city('france', ['nice', 'monte'])
print(travel_log)
name = ''
bid = ''
others = True
bidders = {}
while others is True:
name = input('Name? ')
bid = int(input('Bid? '))
others_bid = input('anyone else? Y or N ').lower()
if others_bid == 'n':
others = False
bidders[name] = bid
print(bidders)
biggest = max(bidders.values())
for (k, v) in bidders.items():
if v == biggest:
name = k
winner = {}
winner[name] = biggest
print('winner is ', winner) |
# https://www.codechef.com/problems/SUMPOS
for T in range(int(input())):
l=sorted(list(map(int,input().split())))
print("NO") if(l[2]!=l[1]+l[0]) else print("YES") | for t in range(int(input())):
l = sorted(list(map(int, input().split())))
print('NO') if l[2] != l[1] + l[0] else print('YES') |
class LoggerTemplate():
def __init__(self, *args, **kwargs):
raise NotImplementedError
def update_loss(self, phase, value, step):
raise NotImplementedError
def update_metric(self, phase, metric, value, step):
raise NotImplementedError
| class Loggertemplate:
def __init__(self, *args, **kwargs):
raise NotImplementedError
def update_loss(self, phase, value, step):
raise NotImplementedError
def update_metric(self, phase, metric, value, step):
raise NotImplementedError |
var={"car":"volvo", "fruit":"apple"}
print(var["fruit"])
for f in var:
print("key: " + f + " value: " + var[f])
print()
print()
var1={"donut":["chocolate","glazed","sprinkled"]}
print(var1["donut"][0])
print("My favorite donut flavors are:", end= " ")
for f in var1["donut"]:
print(f, end=" ")
print()
print()
#Using the examples above write code to print one value of each JSON structure and a loop to print all values below.
var={"vegetable":"carrot", "fruit":"apple","animal":"cat","day":"Friday"}
print(var["vegetable"])
for f in var:
print("key: " + f + " value: " + var[f])
print()
print()
var1={"animal":["dog","cat","fish","tiger","camel"]}
print(var1["animal"][0])
print("My favorite animals are:", end= " ")
for f in var1["animal"]:
print(f, end=" ")
print()
print()
myvar={"dessert":"ice cream", "exercise":"push ups","eyes":"blue","gender":"male"}
print(myvar["exercise"])
for f in myvar:
print("key: " + f + " value: " + myvar[f])
print()
print()
myvar1={"dessert":["cake","candy","ice cream","pudding","cookies"]}
print(myvar1["dessert"][0])
print("My favorite desserts are:", end= " ")
for f in myvar1["dessert"]:
print(f, end=" ")
| var = {'car': 'volvo', 'fruit': 'apple'}
print(var['fruit'])
for f in var:
print('key: ' + f + ' value: ' + var[f])
print()
print()
var1 = {'donut': ['chocolate', 'glazed', 'sprinkled']}
print(var1['donut'][0])
print('My favorite donut flavors are:', end=' ')
for f in var1['donut']:
print(f, end=' ')
print()
print()
var = {'vegetable': 'carrot', 'fruit': 'apple', 'animal': 'cat', 'day': 'Friday'}
print(var['vegetable'])
for f in var:
print('key: ' + f + ' value: ' + var[f])
print()
print()
var1 = {'animal': ['dog', 'cat', 'fish', 'tiger', 'camel']}
print(var1['animal'][0])
print('My favorite animals are:', end=' ')
for f in var1['animal']:
print(f, end=' ')
print()
print()
myvar = {'dessert': 'ice cream', 'exercise': 'push ups', 'eyes': 'blue', 'gender': 'male'}
print(myvar['exercise'])
for f in myvar:
print('key: ' + f + ' value: ' + myvar[f])
print()
print()
myvar1 = {'dessert': ['cake', 'candy', 'ice cream', 'pudding', 'cookies']}
print(myvar1['dessert'][0])
print('My favorite desserts are:', end=' ')
for f in myvar1['dessert']:
print(f, end=' ') |
#Challenge 4: Take a binary tree and reverse it
#I decided to create two classes. One to hold the node, and one to act as the Binary Tree.
#Node class
#Only contains the information for the node. Val is the value of the node, left is the left most value, and right is the right value
class Node:
def __init__(self, val):
self.left = None
self.right = None
self.val = val
#BinaryTree class
class BinaryTree:
#Initialize the tree with a blank root
def __init__(self):
self.root = None
def getRoot(self):
return self.root
#Recursively add node objects
def add(self,val):
if self.root is None:
self.root = Node(val)
else:
self._add(val, self.root)
def _add(self, val, node):
if val < node.val:
if node.left is not None:
self._add(val, node.left)
else:
node.left = Node(val)
else:
if node.right is not None:
self._add(val, node.right)
else:
node.right = Node(val)
#Recursively print each node in the tree
def printTree(self):
if self.root is not None:
self._printTree(self.root)
def _printTree(self, node):
if node is not None:
self._printTree(node.left)
print(node.val)
self._printTree(node.right)
#returns a nested list of each level and the nodes in it
def getTree(self):
currLevel = [self.root]
tree = list()
while currLevel:
lowerLevel = list()
currNodes = list()
for node in currLevel:
currNodes.append(node.val)
if node.left:
lowerLevel.append(node.left)
if node.right:
lowerLevel.append(node.right)
tree.append(currNodes)
#print(currNodes)
currLevel = lowerLevel
return tree
if __name__ == '__main__':
#create sample tree from example
tree = BinaryTree()
tree.add(4)
tree.add(2)
tree.add(7)
tree.add(1)
tree.add(3)
tree.add(6)
tree.add(9)
#getTree returns the tree formatted in nested lists
formattedTree = tree.getTree()
#reverse the levels
for level in formattedTree:
level.reverse()
print(level) | class Node:
def __init__(self, val):
self.left = None
self.right = None
self.val = val
class Binarytree:
def __init__(self):
self.root = None
def get_root(self):
return self.root
def add(self, val):
if self.root is None:
self.root = node(val)
else:
self._add(val, self.root)
def _add(self, val, node):
if val < node.val:
if node.left is not None:
self._add(val, node.left)
else:
node.left = node(val)
elif node.right is not None:
self._add(val, node.right)
else:
node.right = node(val)
def print_tree(self):
if self.root is not None:
self._printTree(self.root)
def _print_tree(self, node):
if node is not None:
self._printTree(node.left)
print(node.val)
self._printTree(node.right)
def get_tree(self):
curr_level = [self.root]
tree = list()
while currLevel:
lower_level = list()
curr_nodes = list()
for node in currLevel:
currNodes.append(node.val)
if node.left:
lowerLevel.append(node.left)
if node.right:
lowerLevel.append(node.right)
tree.append(currNodes)
curr_level = lowerLevel
return tree
if __name__ == '__main__':
tree = binary_tree()
tree.add(4)
tree.add(2)
tree.add(7)
tree.add(1)
tree.add(3)
tree.add(6)
tree.add(9)
formatted_tree = tree.getTree()
for level in formattedTree:
level.reverse()
print(level) |
DAOLIPROXY_VENDOR = "OpenStack Foundation"
DAOLIPROXY_PRODUCT = "DaoliProxy"
DAOLIPROXY_PACKAGE = None # OS distro package version suffix
loaded = False
class VersionInfo(object):
release = "1.el7.centos"
version = "2015.1.21"
def version_string(self):
return self.version
def release_string(self):
return self.release
version_info = VersionInfo()
version_string = version_info.version_string
def vendor_string():
return DAOLIPROXY_VENDOR
def product_string():
return DAOLIPROXY_PRODUCT
def package_string():
return DAOLIPROXY_PACKAGE
def version_string_with_package():
if package_string() is None:
return version_info.version_string()
else:
return "%s-%s" % (version_info.version_string(), package_string())
| daoliproxy_vendor = 'OpenStack Foundation'
daoliproxy_product = 'DaoliProxy'
daoliproxy_package = None
loaded = False
class Versioninfo(object):
release = '1.el7.centos'
version = '2015.1.21'
def version_string(self):
return self.version
def release_string(self):
return self.release
version_info = version_info()
version_string = version_info.version_string
def vendor_string():
return DAOLIPROXY_VENDOR
def product_string():
return DAOLIPROXY_PRODUCT
def package_string():
return DAOLIPROXY_PACKAGE
def version_string_with_package():
if package_string() is None:
return version_info.version_string()
else:
return '%s-%s' % (version_info.version_string(), package_string()) |
# Space: O(n)
# Time: O(n)
class Solution:
def findUnsortedSubarray(self, nums):
length = len(nums)
if length <= 1: return 0
stack = []
left, right = length - 1, 0
for i in range(length):
while stack and nums[stack[-1]] > nums[i]:
left = min(left, stack.pop())
stack.append(i)
if left == length - 1: return 0
stack = []
for j in range(length - 1, -1, -1):
while stack and nums[stack[-1]] < nums[j]:
right = max(right, stack.pop())
stack.append(j)
return right - left + 1
| class Solution:
def find_unsorted_subarray(self, nums):
length = len(nums)
if length <= 1:
return 0
stack = []
(left, right) = (length - 1, 0)
for i in range(length):
while stack and nums[stack[-1]] > nums[i]:
left = min(left, stack.pop())
stack.append(i)
if left == length - 1:
return 0
stack = []
for j in range(length - 1, -1, -1):
while stack and nums[stack[-1]] < nums[j]:
right = max(right, stack.pop())
stack.append(j)
return right - left + 1 |
# encoding: utf-8
# module Autodesk.AutoCAD.DatabaseServices
# from D:\Python\ironpython-stubs\release\stubs\Autodesk\AutoCAD\DatabaseServices\__init__.py
# by generator 1.145
# no doc
# no imports
# no functions
# no classes
# variables with complex values
__path__ = [
'D:\\Python\\ironpython-stubs\\release\\stubs\\Autodesk\\AutoCAD\\DatabaseServices',
] | __path__ = ['D:\\Python\\ironpython-stubs\\release\\stubs\\Autodesk\\AutoCAD\\DatabaseServices'] |
# Basic - Print all integers from 0 to 150.
y = 0
while y <= 150:
print(y)
y = y + 1
# Multiples of Five - Print all the multiples of 5 from 5 to 1,000
x = 5
while x < 1001:
print(x)
x = x + 5
# Counting, the Dojo Way - Print integers 1 to 100. If divisible by 5, print "Coding" instead. If divisible by 10, print "Coding Dojo".
j = 0
txt = "Coding"
while j < 101:
if j % 10 == 0:
print(txt + "Dojo")
elif j % 5 == 0:
print(txt)
else:
print(j)
j += 1
# Whoa. That Sucker's Huge - Add odd integers from 0 to 500,000, and print the final sum.
z = 0
sum = 0
while z < 500000:
if z % 2 != 0:
sum = sum + z
# Countdown by Fours - Print positive numbers starting at 2018, counting down by fours.
count = 2018
while count > 0:
if count % 2 == 0:
print(count)
# Flexible Counter - Set three variables: lowNum, highNum, mult. Starting at lowNum and going through highNum, print only the integers that are a multiple of mult. For example, if lowNum=2, highNum=9, and mult=3, the loop should print 3, 6, 9 (on successive lines)
lowNum = 1
highNum = 99
mult = 3
validNum = 0
while lowNum < highNum:
if lowNum/mult == validNum:
print(lowNum)
lowNum + 1
| y = 0
while y <= 150:
print(y)
y = y + 1
x = 5
while x < 1001:
print(x)
x = x + 5
j = 0
txt = 'Coding'
while j < 101:
if j % 10 == 0:
print(txt + 'Dojo')
elif j % 5 == 0:
print(txt)
else:
print(j)
j += 1
z = 0
sum = 0
while z < 500000:
if z % 2 != 0:
sum = sum + z
count = 2018
while count > 0:
if count % 2 == 0:
print(count)
low_num = 1
high_num = 99
mult = 3
valid_num = 0
while lowNum < highNum:
if lowNum / mult == validNum:
print(lowNum)
lowNum + 1 |
##write a function that takes a nested list as an argument
##and returns a normal list
##show that the result is equal to flattened_list
nested_list = ['a', [2, 3], [4, 'b', [0, -2, ['c', 'e', '0f']]]]
flattened_list = ['a', 2, 3, 4, 'b', 0, -2, 'c', 'e', '0f']
def flat_list(nest_list):
flat = list()
for elem in nest_list:
if type(elem) is list: # we check if elem is a list
flat += flat_list(elem) # recursive function!
# this is a function that calls
# itself in a loop, until a case is
# simple enough to be processed
# directly!
else:
# if elem is not a list, we append it to 'flat'
flat.append(elem)
return flat
res = flat_list(nested_list)
print(res==flattened_list)
| nested_list = ['a', [2, 3], [4, 'b', [0, -2, ['c', 'e', '0f']]]]
flattened_list = ['a', 2, 3, 4, 'b', 0, -2, 'c', 'e', '0f']
def flat_list(nest_list):
flat = list()
for elem in nest_list:
if type(elem) is list:
flat += flat_list(elem)
else:
flat.append(elem)
return flat
res = flat_list(nested_list)
print(res == flattened_list) |
''' Program to count each character's frequency
Example:
Input: banana
Output: a3b1n2
'''
def frequency(input1):
l = list(input1)
x= list(set(l))
x.sort()
result=""
for i in range(0,len(x)):
count=0
for j in range(0,len(l)):
if x[i]==l[j]:
count +=1
result += x[i]+str(count)
print(result)
s = input()
frequency(s)
| """ Program to count each character's frequency
Example:
Input: banana
Output: a3b1n2
"""
def frequency(input1):
l = list(input1)
x = list(set(l))
x.sort()
result = ''
for i in range(0, len(x)):
count = 0
for j in range(0, len(l)):
if x[i] == l[j]:
count += 1
result += x[i] + str(count)
print(result)
s = input()
frequency(s) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.