content
stringlengths 7
1.05M
|
---|
include("common.py")
damnScission = [
ruleGMLString("""rule [
ruleID "DAMN Scission"
left [
edge [ source 0 target 10 label "=" ]
edge [ source 10 target 13 label "-" ]
edge [ source 13 target 14 label "-" ]
edge [ source 13 target 15 label "-" ]
]
context [
# DAMN
node [ id 0 label "C" ]
edge [ source 0 target 1 label "-" ]
node [ id 1 label "C" ]
edge [ source 1 target 2 label "#" ]
node [ id 2 label "N" ]
edge [ source 0 target 3 label "-" ]
node [ id 3 label "N" ]
edge [ source 3 target 4 label "-" ]
node [ id 4 label "H" ]
edge [ source 3 target 5 label "-" ]
node [ id 5 label "H" ]
node [ id 10 label "C" ]
edge [ source 10 target 11 label "-" ]
node [ id 11 label "C" ]
edge [ source 11 target 12 label "#" ]
node [ id 12 label "N" ]
node [ id 13 label "N" ]
node [ id 14 label "H" ]
node [ id 15 label "H" ]
]
right [
edge [ source 10 target 13 label "#" ]
edge [ source 0 target 14 label "-" ]
edge [ source 0 target 15 label "-" ]
]
]"""),
]
|
# Doris Zdravkovic, March, 2019
# Solution to problem 5.
# python primes.py
# Input of a positive integer
n = int(input("Please enter a positive integer: "))
# Prime number is always greater than 1
# Reference: https://docs.python.org/3/tutorial/controlflow.html
# If entered number is greater than 1, for every number in range of 2 to entered number
# If entered number divided by any number gives remainder of 0, print "This is not a prime number"
if n > 1:
for x in range(2, n):
if (n % x) == 0:
print("This is not a prime number.")
# Stop the loop
break
# In other cases print "n is a prime number"
else:
print (n, "is a prime number.")
# If the entered number is equal or less than 1 then it is not a prime number
else:
print(n, 'is a prime number')
|
#!/usr/bin/python
'''
This file is part of SNC
Copyright (c) 2014-2021, Richard Barnett
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'''
# variables used in JSON sensor records
TIMESTAMP = 'timestamp' # seconds since epoch
ACCEL_DATA = 'accel' # accelerometer x, y, z data in gs
LIGHT_DATA = 'light' # light data in lux
TEMPERATURE_DATA = 'temperature' # temperature data in degrees C
PRESSURE_DATA = 'pressure' # pressure in Pa
HUMIDITY_DATA = 'humidity' # humidity in %RH
AIRQUALITY_DATA = 'airquality' # air quality index
|
'''Crie um programa que leia o nome de uma cidade diga se
ela começa ou não com o nome “SANTO'''
#Minha resolução
entendi = input('''Aqui vamos encontrar a palavra "santos" em qualquer posição dentro da variavel.
Aperte qualquer botão para continuar: ''')
cidade = str(input('Qual o nome da sua cidade: ')).strip()
santo = cidade.upper()
print ('CAUCAIA' in santo)
#Resolção do curso
entendi = input('''Nessa resolução a leitura é feita apenas de 0 á 5.
Aperte qualquer botão para continuar: ''')
cid = str(input('Em qual cidade você nasceu ? ')).strip()
print(cid[0:5].upper() == 'SANTO')
|
#Shape of small l:
def for_l():
"""printing small 'l' using for loop"""
for row in range(6):
for col in range(3):
if col==1 or row==0 and col!=2 or row==5 and col!=0:
print("*",end=" ")
else:
print(" ",end=" ")
print()
def while_l():
"""printing small 'l' using while loop"""
i=0
while i<6:
j=0
while j<3:
if j==1 or i==0 and j!=2 or i==5 and j!=0:
print("*",end=" ")
else:
print(" ",end=" ")
j+=1
print()
i+=1
|
'''
Este ejercicio es para modelar empleados de una fábrica de isótopos
'''
class Person(object):
def __init__(self, name, age, employee, _id):
self.name = name,
self.age = age,
self._id = _id,
self.employee = employee
def employ_status(self):
if self.employee:
return print(f"El empleado {self.name} se encuentra activo")
else:
return print(f"El empleado {self.name} ya no encuentra activo")
maria = Person("Maria","30", True, 10101011)
maria.employ_status
|
def get_menu_choice():
def print_menu(): # Your menu design here
print(" _ _ _____ _____ _ _ ")
print("| \ | | ___|_ _| / \ _ __| |_ ")
print("| \| | |_ | | / _ \ | '__| __|")
print("| |\ | _| | | / ___ \| | | |_ ")
print("|_| \_|_| |_| /_/ \_\_| \__|")
print(30 * "-", "MENU", 30 * "-")
print("1. Configure contract parameters ")
print("2. Whitelist wallets ")
print("3. Get listed wallets ")
print("4. Start token pre-sale ")
print("5. Listen contract events ")
print("6. Exit ")
print(73 * "-")
loop = True
int_choice = -1
while loop: # While loop which will keep going until loop = False
print_menu() # Displays menu
choice = input("Enter your choice [1-6]: ")
if choice == '1':
int_choice = 1
loop = False
elif choice == '2':
choice = ''
while len(choice) == 0:
choice = input("Enter custom folder name(s). It may be a list of folder's names (example: c:,d:\docs): ")
int_choice = 2
loop = False
elif choice == '3':
choice = ''
while len(choice) == 0:
choice = input("Enter a single filename of a file with custom folders list: ")
int_choice = 3
loop = False
elif choice == '4':
choice = ''
while len(choice) == 0:
choice = input("Enter a single filename of a conf file: ")
int_choice = 4
loop = False
elif choice == '6':
int_choice = -1
print("Exiting..")
loop = False # This will make the while loop to end
else:
# Any inputs other than values 1-4 we print an error message
input("Wrong menu selection. Enter any key to try again..")
return [int_choice, choice]
|
conversion = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}
roman_letter_order = dict((letter, ind) for ind, letter in enumerate('IVXLCDM'))
minimal_num_of_letter_needed_for_each_digit = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 2,
'5': 1, '6': 2, '7': 3, '8': 4, '9': 2}
def check_order(long_form):
for ind1, char1 in enumerate(long_form[:-1]):
char2 = long_form[ind1 + 1]
if roman_letter_order[char1] < roman_letter_order[char2]:
if char1 + char2 not in ('IV', 'IX', 'XL', 'XC', 'CD', 'CM'):
return False
return True
def parse(long_form):
__sum__ = 0
for ind1, char1 in enumerate(long_form[:-1]):
char2 = long_form[ind1 + 1]
if roman_letter_order[char1] >= roman_letter_order[char2]:
__sum__ += conversion[char1]
else:
if char1 + char2 in ('IV', 'IX', 'XL', 'XC', 'CD', 'CM'):
__sum__ -= conversion[char1]
__sum__ += conversion[long_form[-1]]
return __sum__
def get_long_form_lst():
lst = []
with open('p089_roman.txt') as f:
for row in f.readlines():
lst.append(row.strip())
return lst
long_form_lst = get_long_form_lst()
total_length_saved = 0
patterns_to_replace_0 = ['VIIII', 'LXXXX', 'DCCCC']
patterns_to_replace_1 = ['IIII', 'XXXX', 'CCCC']
for long_form in long_form_lst:
if check_order(long_form) is True:
short_form_length = 0
parsed = str(parse(long_form))
for ind, digit in enumerate(reversed(parsed)):
if ind == 3: # no short form for the digit of M
short_form_length += int(digit)
#print(int(digit))
else:
short_form_length += minimal_num_of_letter_needed_for_each_digit[digit]
#print(minimal_num_of_letter_needed_for_each_digit[digit])
length_saved = len(long_form) - short_form_length
total_length_saved += length_saved
length_saved_2 = 0
for pattern0, pattern1 in zip(patterns_to_replace_0, patterns_to_replace_1):
if pattern0 in long_form:
length_saved_2 += 3
elif pattern1 in long_form:
length_saved_2 += 2
if length_saved != length_saved_2:
print(long_form, parse(long_form), length_saved, length_saved_2)
else:
print(long_form)
print(total_length_saved)
|
# Write a for loop using range() to print out multiples of 5 up to 30 inclusive
for mult in range(5, 31, 5): # prints out multiples of 5 up to 30 inclusive
print(mult)
|
"""Module for request errors"""
REQUEST_ERROR_DICT = {
'invalid_request': 'Invalid request object',
'not_found': '{} not found',
'invalid_credentials': 'Invalid username or password',
'already_exists': '{0} or {1} already exists',
'exists': '{0} already exists',
'invalid_provided_date': 'Invalid date range please, {}.',
'invalid_date_range': '{0} cannot be greater than {1}',
'invalid_date_of_issue': 'Date of issue must be provided',
'invalid_date_of_expiry': 'Date of expiry must be provided',
'invalid_birthday': 'Birthday cannot be greater than today'
}
|
#
# PySNMP MIB module CISCO-SWITCH-HARDWARE-CAPACITY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-SWITCH-HARDWARE-CAPACITY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:13:27 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection")
Percent, = mibBuilder.importSymbols("CISCO-QOS-PIB-MIB", "Percent")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
CiscoInterfaceIndexList, = mibBuilder.importSymbols("CISCO-TC", "CiscoInterfaceIndexList")
entPhysicalIndex, = mibBuilder.importSymbols("ENTITY-MIB", "entPhysicalIndex")
CounterBasedGauge64, = mibBuilder.importSymbols("HCNUM-TC", "CounterBasedGauge64")
InterfaceIndexOrZero, ifIndex = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero", "ifIndex")
InetAddressType, = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup")
NotificationType, TimeTicks, IpAddress, ObjectIdentity, MibIdentifier, ModuleIdentity, Counter32, Integer32, Gauge32, Unsigned32, Counter64, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "TimeTicks", "IpAddress", "ObjectIdentity", "MibIdentifier", "ModuleIdentity", "Counter32", "Integer32", "Gauge32", "Unsigned32", "Counter64", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits")
DisplayString, TextualConvention, DateAndTime = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "DateAndTime")
ciscoSwitchHardwareCapacityMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 663))
ciscoSwitchHardwareCapacityMIB.setRevisions(('2014-09-16 00:00', '2014-01-24 00:00', '2013-05-08 00:00', '2010-11-22 00:00', '2008-07-02 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoSwitchHardwareCapacityMIB.setRevisionsDescriptions(('Added the following enumerations for object cshcProtocolFibTcamProtocol - allProtocols(14) Updated the description of cshcProtocolFibTcamTotal and cshcProtocolFibTcamLogicalTotal.', 'Added following OBJECT-GROUP - cshcProtocolFibTcamWidthTypeGroup Added the following enumerations for object cshcProtocolFibTcamProtocol - mplsVpn(11) - fcMpls(12) - ipv6LocalLink(13) Added new compliance - ciscoSwitchHardwareCapacityMIBCompliance3', 'Added following OBJECT-GROUP - cshcNetflowFlowResourceUsageGroup - cshcMacUsageExtGroup - cshcProtocolFibTcamUsageExtGroup - cshcAdjacencyResourceUsageGroup - cshcQosResourceUsageGroup - cshcModTopDropIfIndexListGroup - cshcMetResourceUsageGroup Added the following enumerations for object cshcProtocolFibTcamProtocol - l2VpnPeer(7) - l2VpnIpv4Multicast(8) - l2VpnIpv6Multicast(9) Added new compliance - ciscoSwitchHardwareCapacityMIBCompliance2', 'Add the following new enumerations to cshcCPURateLimiterNetworkLayer: layer2Input(3) and layer2Output(4). Add cshcFibTcamUsageExtGroup.', 'Initial revision of this MIB module.',))
if mibBuilder.loadTexts: ciscoSwitchHardwareCapacityMIB.setLastUpdated('201409160000Z')
if mibBuilder.loadTexts: ciscoSwitchHardwareCapacityMIB.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts: ciscoSwitchHardwareCapacityMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: [email protected]')
if mibBuilder.loadTexts: ciscoSwitchHardwareCapacityMIB.setDescription('This MIB module defines the managed objects for hardware capacity of Cisco switching devices. The hardware capacity information covers the following but not limited to features: forwarding, rate-limiter ... The following terms are used throughout the MIB: CAM: Content Addressable Memory. TCAM: Ternary Content Addressable Memory. FIB: Forwarding Information Base. VPN: Virtual Private Network. QoS: Quality of Service. CPU rate-limiter: Mechanism to rate-limit or restrict undesired traffic to the CPU. MPLS: Multiprotocol Label Switching.')
ciscoSwitchHardwareCapacityMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 0))
ciscoSwitchHardwareCapacityMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 1))
ciscoSwitchHardwareCapacityMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 2))
cshcForwarding = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1))
cshcInterface = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2))
cshcCPURateLimiterResources = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 3))
cshcIcamResources = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 4))
cshcNetflowFlowMaskResources = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 5))
cshcNetflowResourceUsage = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 6))
cshcQosResourceUsage = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 7))
class CshcInternalChannelType(TextualConvention, Integer32):
description = 'An enumerated value indicating the type of an internal channel. eobc - ethernet out-of-band channel. ibc - in-band channel.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("eobc", 1), ("ibc", 2))
cshcL2Forwarding = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1))
cshcMacUsageTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 1), )
if mibBuilder.loadTexts: cshcMacUsageTable.setStatus('current')
if mibBuilder.loadTexts: cshcMacUsageTable.setDescription('This table contains MAC table capacity for each switching engine, as specified by entPhysicalIndex in ENTITY-MIB, capable of providing this information.')
cshcMacUsageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 1, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"))
if mibBuilder.loadTexts: cshcMacUsageEntry.setStatus('current')
if mibBuilder.loadTexts: cshcMacUsageEntry.setDescription('Each row contains management information for MAC table hardware capacity on a switching engine.')
cshcMacCollisions = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 1, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcMacCollisions.setStatus('current')
if mibBuilder.loadTexts: cshcMacCollisions.setDescription('This object indicates the number of Ethernet frames whose source MAC address the switching engine failed to learn while constructing its MAC table.')
cshcMacUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 1, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcMacUsed.setStatus('current')
if mibBuilder.loadTexts: cshcMacUsed.setDescription('This object indicates the number of MAC table entries that are currently in use for this switching engine.')
cshcMacTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 1, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcMacTotal.setStatus('current')
if mibBuilder.loadTexts: cshcMacTotal.setDescription('This object indicates the total number of MAC table entries available for this switching engine.')
cshcMacMcast = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 1, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcMacMcast.setStatus('current')
if mibBuilder.loadTexts: cshcMacMcast.setDescription('This object indicates the total number of multicast MAC table entries on this switching engine.')
cshcMacUcast = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 1, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcMacUcast.setStatus('current')
if mibBuilder.loadTexts: cshcMacUcast.setDescription('This object indicates the total number of unicast MAC table entries on this switching engine.')
cshcMacLines = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 1, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcMacLines.setStatus('current')
if mibBuilder.loadTexts: cshcMacLines.setDescription('This object indicates the total number of MAC table lines on this switching engine. The MAC table is organized as multiple MAC entries per line.')
cshcMacLinesFull = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 1, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcMacLinesFull.setStatus('current')
if mibBuilder.loadTexts: cshcMacLinesFull.setDescription('This object indicates the total number of MAC table lines full on this switching engine. A line full means all the MAC entries on the line are occupied.')
cshcVpnCamUsageTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 2), )
if mibBuilder.loadTexts: cshcVpnCamUsageTable.setStatus('current')
if mibBuilder.loadTexts: cshcVpnCamUsageTable.setDescription('This table contains VPN CAM capacity for each entity, as specified by entPhysicalIndex in ENTITY-MIB, capable of providing this information.')
cshcVpnCamUsageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 2, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"))
if mibBuilder.loadTexts: cshcVpnCamUsageEntry.setStatus('current')
if mibBuilder.loadTexts: cshcVpnCamUsageEntry.setDescription('Each row contains management information for VPN CAM hardware capacity on an entity.')
cshcVpnCamUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 2, 1, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcVpnCamUsed.setStatus('current')
if mibBuilder.loadTexts: cshcVpnCamUsed.setDescription('This object indicates the number of VPN CAM entries that are currently in use.')
cshcVpnCamTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 1, 2, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcVpnCamTotal.setStatus('current')
if mibBuilder.loadTexts: cshcVpnCamTotal.setDescription('This object indicates the total number of VPN CAM entries.')
cshcL3Forwarding = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2))
cshcFibTcamUsageTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 1), )
if mibBuilder.loadTexts: cshcFibTcamUsageTable.setStatus('current')
if mibBuilder.loadTexts: cshcFibTcamUsageTable.setDescription('This table contains FIB TCAM capacity for each entity, as specified by entPhysicalIndex in ENTITY-MIB, capable of providing this information.')
cshcFibTcamUsageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 1, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"))
if mibBuilder.loadTexts: cshcFibTcamUsageEntry.setStatus('current')
if mibBuilder.loadTexts: cshcFibTcamUsageEntry.setDescription('Each row contains management information for FIB TCAM hardware capacity on an entity.')
cshc72bitsFibTcamUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 1, 1, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshc72bitsFibTcamUsed.setStatus('current')
if mibBuilder.loadTexts: cshc72bitsFibTcamUsed.setDescription('This object indicates the number of 72 bits FIB TCAM entries that are currently in use.')
cshc72bitsFibTcamTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 1, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshc72bitsFibTcamTotal.setStatus('current')
if mibBuilder.loadTexts: cshc72bitsFibTcamTotal.setDescription('This object indicates the total number of 72 bits FIB TCAM entries available.')
cshc144bitsFibTcamUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 1, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshc144bitsFibTcamUsed.setStatus('current')
if mibBuilder.loadTexts: cshc144bitsFibTcamUsed.setDescription('This object indicates the number of 144 bits FIB TCAM entries that are currently in use.')
cshc144bitsFibTcamTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 1, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshc144bitsFibTcamTotal.setStatus('current')
if mibBuilder.loadTexts: cshc144bitsFibTcamTotal.setDescription('This object indicates the total number of 144 bits FIB TCAM entries available.')
cshc288bitsFibTcamUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 1, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshc288bitsFibTcamUsed.setStatus('current')
if mibBuilder.loadTexts: cshc288bitsFibTcamUsed.setDescription('This object indicates the number of 288 bits FIB TCAM entries that are currently in use.')
cshc288bitsFibTcamTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 1, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshc288bitsFibTcamTotal.setStatus('current')
if mibBuilder.loadTexts: cshc288bitsFibTcamTotal.setDescription('This object indicates the total number of 288 bits FIB TCAM entries available.')
cshcProtocolFibTcamUsageTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 2), )
if mibBuilder.loadTexts: cshcProtocolFibTcamUsageTable.setStatus('current')
if mibBuilder.loadTexts: cshcProtocolFibTcamUsageTable.setDescription('This table contains FIB TCAM usage per specified Layer 3 protocol on an entity capable of providing this information.')
cshcProtocolFibTcamUsageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 2, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"), (0, "CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamProtocol"))
if mibBuilder.loadTexts: cshcProtocolFibTcamUsageEntry.setStatus('current')
if mibBuilder.loadTexts: cshcProtocolFibTcamUsageEntry.setDescription('Each row contains management information for FIB TCAM usage for the specific Layer 3 protocol on an entity as specified by the entPhysicalIndex in ENTITY-MIB.')
cshcProtocolFibTcamProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14))).clone(namedValues=NamedValues(("ipv4", 1), ("mpls", 2), ("eom", 3), ("ipv6", 4), ("ipv4Multicast", 5), ("ipv6Multicast", 6), ("l2VpnPeer", 7), ("l2VpnIpv4Multicast", 8), ("l2VpnIpv6Multicast", 9), ("fcoe", 10), ("mplsVpn", 11), ("fcMpls", 12), ("ipv6LocalLink", 13), ("allProtocols", 14))))
if mibBuilder.loadTexts: cshcProtocolFibTcamProtocol.setStatus('current')
if mibBuilder.loadTexts: cshcProtocolFibTcamProtocol.setDescription("This object indicates the Layer 3 protocol utilizing FIB TCAM resource. 'ipv4' - indicates Internet Protocol version 4. 'mpls' - indicates Multiprotocol Label Switching. 'eom' - indicates Ethernet over MPLS. 'ipv6' - indicates Internet Protocol version 6. 'ipv4Multicast' - indicates Internet Protocol version 4 for multicast traffic. 'ipv6Multicast' - indicates Internet Protocol version 6 for multicast traffic. 'l2VpnPeer' - indicates Layer 2 VPN Peer traffic. 'l2VpnIpv4Multicast' - indicates Internet Protocol version 4 for multicast traffic on Layer 2 VPN. 'l2VpnIpv6Multicast' - indicates Internet Protocol version 6 for multicast traffic on Layer 2 VPN. 'fcoe' - indicates Fibre Channel over Ethernet. 'mplsVpn' - indicates MPLS Layer 3 VPN aggregate labels. 'fcMpls' - indicates Fibre Channel over MPLS tunnels. 'ipv6LocalLink' - indicates Internet Protocol version 6 Local Link. 'allProtocols' - indicates all protocols within the entPhysicalIndex.")
cshcProtocolFibTcamUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 2, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcProtocolFibTcamUsed.setStatus('current')
if mibBuilder.loadTexts: cshcProtocolFibTcamUsed.setDescription('This object indicates the number of FIB TCAM entries that are currently in use for the protocol denoted by cshcProtocolFibTcamProtocol.')
cshcProtocolFibTcamTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 2, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcProtocolFibTcamTotal.setStatus('current')
if mibBuilder.loadTexts: cshcProtocolFibTcamTotal.setDescription('This object indicates the total number of FIB TCAM entries are currently allocated for the protocol denoted by cshcProtocolFibTcamProtocol. A value of zero indicates that the total number of FIB TCAM for the protocol denoted by cshcProtocolFibTcamProtocol is not available.')
cshcProtocolFibTcamLogicalUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 2, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcProtocolFibTcamLogicalUsed.setStatus('current')
if mibBuilder.loadTexts: cshcProtocolFibTcamLogicalUsed.setDescription('This object indicates the number of logical FIB TCAM entries that are currently in use for the protocol denoted by cshcProtocolFibTcamProtocol.')
cshcProtocolFibTcamLogicalTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 2, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcProtocolFibTcamLogicalTotal.setStatus('current')
if mibBuilder.loadTexts: cshcProtocolFibTcamLogicalTotal.setDescription('This object indicates the total number of logical FIB TCAM entries that are currently allocated for the protocol denoted by cshcProtocolFibTcamProtocol. A value of zero indicates that the total number of logical FIB TCAM for the protocol denoted by cshcProtocolFibTcamProtocol is not available.')
cshcProtocolFibTcamWidthType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("singleWidth", 1), ("doubleWidth", 2), ("quadWidth", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcProtocolFibTcamWidthType.setStatus('current')
if mibBuilder.loadTexts: cshcProtocolFibTcamWidthType.setDescription("This object indicates the entry width type for the protocol denoted by cshcProtocolFibTcamProtocol. 'singleWidth' - indicates each logical entry is using one physical entry. 'doubleWidth' - indicates each logical entry is using two physical entries. 'quadWidth' - indicates each logical entry is using four physical entries.")
cshcAdjacencyUsageTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 3), )
if mibBuilder.loadTexts: cshcAdjacencyUsageTable.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyUsageTable.setDescription('This table contains adjacency capacity for each entity capable of providing this information.')
cshcAdjacencyUsageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 3, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"))
if mibBuilder.loadTexts: cshcAdjacencyUsageEntry.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyUsageEntry.setDescription('Each row contains management information for adjacency hardware capacity on an entity, as specified by entPhysicalIndex in ENTITY-MIB.')
cshcAdjacencyUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 3, 1, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcAdjacencyUsed.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyUsed.setDescription('This object indicates the number of adjacency entries that are currently in use.')
cshcAdjacencyTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 3, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcAdjacencyTotal.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyTotal.setDescription('This object indicates the total number of adjacency entries available.')
cshcForwardingLoadTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 4), )
if mibBuilder.loadTexts: cshcForwardingLoadTable.setStatus('current')
if mibBuilder.loadTexts: cshcForwardingLoadTable.setDescription('This table contains Layer 3 forwarding load information for each switching engine capable of providing this information.')
cshcForwardingLoadEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 4, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"))
if mibBuilder.loadTexts: cshcForwardingLoadEntry.setStatus('current')
if mibBuilder.loadTexts: cshcForwardingLoadEntry.setDescription('Each row contains management information of Layer 3 forwarding load on a switching engine, as specified by entPhysicalIndex in ENTITY-MIB.')
cshcForwardingLoadPktRate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 4, 1, 1), CounterBasedGauge64()).setUnits('pps').setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcForwardingLoadPktRate.setStatus('current')
if mibBuilder.loadTexts: cshcForwardingLoadPktRate.setDescription('This object indicates the forwarding rate of Layer 3 packets.')
cshcForwardingLoadPktPeakRate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 4, 1, 2), CounterBasedGauge64()).setUnits('pps').setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcForwardingLoadPktPeakRate.setStatus('current')
if mibBuilder.loadTexts: cshcForwardingLoadPktPeakRate.setDescription('This object indicates the peak forwarding rate of Layer 3 packets.')
cshcForwardingLoadPktPeakTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 4, 1, 3), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcForwardingLoadPktPeakTime.setStatus('current')
if mibBuilder.loadTexts: cshcForwardingLoadPktPeakTime.setDescription('This object describes the time when the peak forwarding rate of Layer 3 packets denoted by cshcForwardingLoadPktPeakRate occurs. This object will contain 0-1-1,00:00:00.0 if the peak time information is not available.')
cshcAdjacencyResourceUsageTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 5), )
if mibBuilder.loadTexts: cshcAdjacencyResourceUsageTable.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyResourceUsageTable.setDescription('This table contains adjacency capacity per resource type and its usage for each entity capable of providing this information.')
cshcAdjacencyResourceUsageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 5, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"), (0, "CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyResourceIndex"))
if mibBuilder.loadTexts: cshcAdjacencyResourceUsageEntry.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyResourceUsageEntry.setDescription('Each row contains the management information for a particular adjacency resource and switch engine, as specified by entPhysicalIndex in ENTITY-MIB.')
cshcAdjacencyResourceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 5, 1, 1), Unsigned32())
if mibBuilder.loadTexts: cshcAdjacencyResourceIndex.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyResourceIndex.setDescription('This object indicates a unique value that identifies an adjacency resource.')
cshcAdjacencyResourceDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 5, 1, 2), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcAdjacencyResourceDescr.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyResourceDescr.setDescription('This object indicates a description of the adjacency resource.')
cshcAdjacencyResourceUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 5, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcAdjacencyResourceUsed.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyResourceUsed.setDescription('This object indicates the number of adjacency entries that are currently in use.')
cshcAdjacencyResourceTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 5, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcAdjacencyResourceTotal.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyResourceTotal.setDescription('This object indicates the total number of adjacency entries available.')
cshcMetResourceUsageTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 6), )
if mibBuilder.loadTexts: cshcMetResourceUsageTable.setStatus('current')
if mibBuilder.loadTexts: cshcMetResourceUsageTable.setDescription('This table contains information regarding Multicast Expansion Table (MET) resource usage and utilization for a switching engine capable of providing this information.')
cshcMetResourceUsageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 6, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"), (0, "CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMetResourceIndex"))
if mibBuilder.loadTexts: cshcMetResourceUsageEntry.setStatus('current')
if mibBuilder.loadTexts: cshcMetResourceUsageEntry.setDescription('Each row contains information of the usage and utilization for a particular MET resource and switching engine, as specified by entPhysicalIndex in ENTITY-MIB.')
cshcMetResourceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 6, 1, 1), Unsigned32())
if mibBuilder.loadTexts: cshcMetResourceIndex.setStatus('current')
if mibBuilder.loadTexts: cshcMetResourceIndex.setDescription('An arbitrary positive integer value that uniquely identifies a Met resource.')
cshcMetResourceDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 6, 1, 2), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcMetResourceDescr.setStatus('current')
if mibBuilder.loadTexts: cshcMetResourceDescr.setDescription('This object indicates a description of the MET resource.')
cshcMetResourceUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 6, 1, 3), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcMetResourceUsed.setStatus('current')
if mibBuilder.loadTexts: cshcMetResourceUsed.setDescription('This object indicates the number of MET entries used by this MET resource.')
cshcMetResourceTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 6, 1, 4), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcMetResourceTotal.setStatus('current')
if mibBuilder.loadTexts: cshcMetResourceTotal.setDescription('This object indicates the total number of MET entries available for this MET resource.')
cshcMetResourceMcastGrp = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 1, 2, 6, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcMetResourceMcastGrp.setStatus('current')
if mibBuilder.loadTexts: cshcMetResourceMcastGrp.setDescription('This object indicates the number of the multicast group for this MET resource. A value of -1 indicates that this object is not applicable on this MET feature.')
cshcModuleInterfaceDropsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 1), )
if mibBuilder.loadTexts: cshcModuleInterfaceDropsTable.setStatus('current')
if mibBuilder.loadTexts: cshcModuleInterfaceDropsTable.setDescription('This table contains interface drops information on each module capable of providing this information.')
cshcModuleInterfaceDropsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 1, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"))
if mibBuilder.loadTexts: cshcModuleInterfaceDropsEntry.setStatus('current')
if mibBuilder.loadTexts: cshcModuleInterfaceDropsEntry.setDescription('Each row contains management information for dropped traffic on a specific module, identified by the entPhysicalIndex in ENTITY-MIB, and capable of providing this information.')
cshcModTxTotalDroppedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 1, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcModTxTotalDroppedPackets.setStatus('current')
if mibBuilder.loadTexts: cshcModTxTotalDroppedPackets.setDescription('This object indicates the total dropped outbound packets on all physical interfaces of this module.')
cshcModRxTotalDroppedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcModRxTotalDroppedPackets.setStatus('current')
if mibBuilder.loadTexts: cshcModRxTotalDroppedPackets.setDescription('This object indicates the total dropped inbound packets on all physical interfaces of this module.')
cshcModTxTopDropPort = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 1, 1, 3), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcModTxTopDropPort.setStatus('current')
if mibBuilder.loadTexts: cshcModTxTopDropPort.setDescription('This object indicates the ifIndex value of the interface that has the largest number of total dropped outbound packets among all the physical interfaces on this module. If there were no dropped outbound packets on any physical interfaces of this module, this object has the value 0. If there are multiple physical interfaces of this module having the same largest number of total dropped outbound packets, the ifIndex of the first such interfaces will be assigned to this object.')
cshcModRxTopDropPort = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 1, 1, 4), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcModRxTopDropPort.setStatus('current')
if mibBuilder.loadTexts: cshcModRxTopDropPort.setDescription('This object indicates the ifIndex value of the interface that has the largest number of total dropped inbound packets among all the physical interfaces of this module. If there were no dropped inbound packets on any physical interfaces of this module, this object has the value 0. If there are multiple physical interfaces of this module having the same largest number of total dropped inbound packets, the ifIndex of the first such interfaces will be assigned to this object.')
cshcModTxTopDropIfIndexList = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 1, 1, 5), CiscoInterfaceIndexList()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcModTxTopDropIfIndexList.setStatus('current')
if mibBuilder.loadTexts: cshcModTxTopDropIfIndexList.setDescription('This object indicates the ifIndex values of the list of interfaces that have the largest number of total dropped outbound packets among all the physical interfaces of this module.')
cshcModRxTopDropIfIndexList = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 1, 1, 6), CiscoInterfaceIndexList()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcModRxTopDropIfIndexList.setStatus('current')
if mibBuilder.loadTexts: cshcModRxTopDropIfIndexList.setDescription('This object indicates the ifIndex values of the list of interfaces that have the largest number of total dropped inbound packets among all the physical interfaces of this module.')
cshcInterfaceBufferTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 2), )
if mibBuilder.loadTexts: cshcInterfaceBufferTable.setStatus('current')
if mibBuilder.loadTexts: cshcInterfaceBufferTable.setDescription('This table contains buffer capacity information for each physical interface capable of providing this information.')
cshcInterfaceBufferEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: cshcInterfaceBufferEntry.setStatus('current')
if mibBuilder.loadTexts: cshcInterfaceBufferEntry.setDescription('Each row contains buffer capacity information for a specific physical interface capable of providing this information.')
cshcInterfaceTransmitBufferSize = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 2, 1, 1), Unsigned32()).setUnits('bytes').setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcInterfaceTransmitBufferSize.setStatus('current')
if mibBuilder.loadTexts: cshcInterfaceTransmitBufferSize.setDescription('The aggregate buffer size of all the transmit queues on this interface.')
cshcInterfaceReceiveBufferSize = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 2, 1, 2), Unsigned32()).setUnits('bytes').setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcInterfaceReceiveBufferSize.setStatus('current')
if mibBuilder.loadTexts: cshcInterfaceReceiveBufferSize.setDescription('The aggregate buffer size of all the receive queues on this interface.')
cshcInternalChannelTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 3), )
if mibBuilder.loadTexts: cshcInternalChannelTable.setStatus('current')
if mibBuilder.loadTexts: cshcInternalChannelTable.setDescription('This table contains information for each internal channel interface on each physical entity, such as a module, capable of providing this information.')
cshcInternalChannelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 3, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"), (0, "CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIntlChnlType"))
if mibBuilder.loadTexts: cshcInternalChannelEntry.setStatus('current')
if mibBuilder.loadTexts: cshcInternalChannelEntry.setDescription('Each row contains management information for an internal channel interface of a specific type on a specific physical entity, such as a module, identified by the entPhysicalIndex in ENTITY-MIB, and capable of providing this information.')
cshcIntlChnlType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 3, 1, 1), CshcInternalChannelType())
if mibBuilder.loadTexts: cshcIntlChnlType.setStatus('current')
if mibBuilder.loadTexts: cshcIntlChnlType.setDescription('The type of this internal channel.')
cshcIntlChnlRxPacketRate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 3, 1, 2), CounterBasedGauge64()).setUnits('packets per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcIntlChnlRxPacketRate.setStatus('current')
if mibBuilder.loadTexts: cshcIntlChnlRxPacketRate.setDescription('Five minute exponentially-decayed moving average of inbound packet rate for this channel.')
cshcIntlChnlRxTotalPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 3, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcIntlChnlRxTotalPackets.setStatus('current')
if mibBuilder.loadTexts: cshcIntlChnlRxTotalPackets.setDescription('The total number of the inbound packets accounted for this channel.')
cshcIntlChnlRxDroppedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 3, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcIntlChnlRxDroppedPackets.setStatus('current')
if mibBuilder.loadTexts: cshcIntlChnlRxDroppedPackets.setDescription('The number of dropped inbound packets for this channel.')
cshcIntlChnlTxPacketRate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 3, 1, 5), CounterBasedGauge64()).setUnits('packets per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcIntlChnlTxPacketRate.setStatus('current')
if mibBuilder.loadTexts: cshcIntlChnlTxPacketRate.setDescription('Five minute exponentially-decayed moving average of outbound packet rate for this channel.')
cshcIntlChnlTxTotalPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 3, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcIntlChnlTxTotalPackets.setStatus('current')
if mibBuilder.loadTexts: cshcIntlChnlTxTotalPackets.setDescription('The total number of the outbound packets accounted for this channel.')
cshcIntlChnlTxDroppedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 2, 3, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcIntlChnlTxDroppedPackets.setStatus('current')
if mibBuilder.loadTexts: cshcIntlChnlTxDroppedPackets.setDescription('The number of dropped outbound packets for this channel.')
cshcCPURateLimiterResourcesTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 3, 1), )
if mibBuilder.loadTexts: cshcCPURateLimiterResourcesTable.setStatus('current')
if mibBuilder.loadTexts: cshcCPURateLimiterResourcesTable.setDescription('This table contains information regarding CPU rate limiters resources.')
cshcCPURateLimiterResourcesEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 3, 1, 1), ).setIndexNames((0, "CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcCPURateLimiterNetworkLayer"))
if mibBuilder.loadTexts: cshcCPURateLimiterResourcesEntry.setStatus('current')
if mibBuilder.loadTexts: cshcCPURateLimiterResourcesEntry.setDescription('Each row contains management information of CPU rate limiter resources for a managed network layer.')
cshcCPURateLimiterNetworkLayer = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("layer2", 1), ("layer3", 2), ("layer2Input", 3), ("layer2Output", 4))))
if mibBuilder.loadTexts: cshcCPURateLimiterNetworkLayer.setStatus('current')
if mibBuilder.loadTexts: cshcCPURateLimiterNetworkLayer.setDescription("This object indicates the network layer for which the CPU rate limiters are applied. 'layer2' - Layer 2. 'layer3' - Layer 3. 'layer2Input' - Ingress Layer 2. Applicable for devices which support CPU rate limiters on the Ingress Layer 2 traffic. 'layer2Output' - Egress Layer 2. Applicable for devices which support CPU rate limiters on the Egress Layer 2 traffic.")
cshcCPURateLimiterTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 3, 1, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcCPURateLimiterTotal.setStatus('current')
if mibBuilder.loadTexts: cshcCPURateLimiterTotal.setDescription('This object indicates the total number of CPU rate limiters avaiable.')
cshcCPURateLimiterUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 3, 1, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcCPURateLimiterUsed.setStatus('current')
if mibBuilder.loadTexts: cshcCPURateLimiterUsed.setDescription('This object indicates the number of CPU rate limiters that is currently in use.')
cshcCPURateLimiterReserved = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 3, 1, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcCPURateLimiterReserved.setStatus('current')
if mibBuilder.loadTexts: cshcCPURateLimiterReserved.setDescription('This object indicates the number of CPU rate limiters which is reserved by the switching device.')
cshcIcamUtilizationTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 4, 1), )
if mibBuilder.loadTexts: cshcIcamUtilizationTable.setStatus('current')
if mibBuilder.loadTexts: cshcIcamUtilizationTable.setDescription('This table contains information regarding ICAM (Internal Content Addressable Memory) Resource usage and utilization for a switching engine capable of providing this information.')
cshcIcamUtilizationEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 4, 1, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"))
if mibBuilder.loadTexts: cshcIcamUtilizationEntry.setStatus('current')
if mibBuilder.loadTexts: cshcIcamUtilizationEntry.setDescription('Each row contains management information of ICAM usage and utilization for a switching engine, as specified as specified by entPhysicalIndex in ENTITY-MIB.')
cshcIcamCreated = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 4, 1, 1, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcIcamCreated.setStatus('current')
if mibBuilder.loadTexts: cshcIcamCreated.setDescription('This object indicates the total number of ICAM entries created.')
cshcIcamFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 4, 1, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcIcamFailed.setStatus('current')
if mibBuilder.loadTexts: cshcIcamFailed.setDescription('This object indicates the number of ICAM entries which failed to be created.')
cshcIcamUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 4, 1, 1, 3), Percent()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcIcamUtilization.setStatus('current')
if mibBuilder.loadTexts: cshcIcamUtilization.setDescription('This object indicates the ICAM utlization in percentage in this switching engine.')
cshcNetflowFlowMaskTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 5, 1), )
if mibBuilder.loadTexts: cshcNetflowFlowMaskTable.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowFlowMaskTable.setDescription('This table contains information regarding Netflow flow mask features supported.')
cshcNetflowFlowMaskEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 5, 1, 1), ).setIndexNames((0, "CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowFlowMaskAddrType"), (0, "CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowFlowMaskIndex"))
if mibBuilder.loadTexts: cshcNetflowFlowMaskEntry.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowFlowMaskEntry.setDescription('Each row contains supported feature information of a Netflow flow mask supported by the device.')
cshcNetflowFlowMaskAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 5, 1, 1, 1), InetAddressType())
if mibBuilder.loadTexts: cshcNetflowFlowMaskAddrType.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowFlowMaskAddrType.setDescription('This object indicates Internet address type for this flow mask.')
cshcNetflowFlowMaskIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 5, 1, 1, 2), Unsigned32())
if mibBuilder.loadTexts: cshcNetflowFlowMaskIndex.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowFlowMaskIndex.setDescription('This object indicates the unique flow mask number for a specific Internet address type.')
cshcNetflowFlowMaskType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 5, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37))).clone(namedValues=NamedValues(("null", 1), ("srcOnly", 2), ("destOnly", 3), ("srcDest", 4), ("interfaceSrcDest", 5), ("fullFlow", 6), ("interfaceFullFlow", 7), ("interfaceFullFlowOrFullFlow", 8), ("atleastInterfaceSrcDest", 9), ("atleastFullFlow", 10), ("atleastInterfaceFullFlow", 11), ("atleastSrc", 12), ("atleastDst", 13), ("atleastSrcDst", 14), ("shortest", 15), ("lessThanFullFlow", 16), ("exceptFullFlow", 17), ("exceptInterfaceFullFlow", 18), ("interfaceDest", 19), ("atleastInterfaceDest", 20), ("interfaceSrc", 21), ("atleastInterfaceSrc", 22), ("srcOnlyCR", 23), ("dstOnlyCR", 24), ("fullFlowCR", 25), ("interfaceFullFlowCR", 26), ("max", 27), ("conflict", 28), ("err", 29), ("unused", 30), ("fullFlow1", 31), ("fullFlow2", 32), ("fullFlow3", 33), ("vlanFullFlow1", 34), ("vlanFullFlow2", 35), ("vlanFullFlow3", 36), ("reserved", 37)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcNetflowFlowMaskType.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowFlowMaskType.setDescription('This object indicates the type of flow mask.')
cshcNetflowFlowMaskFeature = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 5, 1, 1, 4), Bits().clone(namedValues=NamedValues(("null", 0), ("ipAcgIngress", 1), ("ipAcgEgress", 2), ("natIngress", 3), ("natEngress", 4), ("natInside", 5), ("pbr", 6), ("cryptoIngress", 7), ("cryptoEgress", 8), ("qos", 9), ("idsIngress", 10), ("tcpIntrcptEgress", 11), ("guardian", 12), ("ipv6AcgIngress", 13), ("ipv6AcgEgress", 14), ("mcastAcgIngress", 15), ("mcastAcgEgress", 16), ("mcastStub", 17), ("mcastUrd", 18), ("ipDsIngress", 19), ("ipDsEgress", 20), ("ipVaclIngress", 21), ("ipVaclEgress", 22), ("macVaclIngress", 23), ("macVaclEgress", 24), ("inspIngress", 25), ("inspEgress", 26), ("authProxy", 27), ("rpf", 28), ("wccpIngress", 29), ("wccpEgress", 30), ("inspDummyIngress", 31), ("inspDummyEgress", 32), ("nbarIngress", 33), ("nbarEgress", 34), ("ipv6Rpf", 35), ("ipv6GlobalDefault", 36), ("dai", 37), ("ipPaclIngress", 38), ("macPaclIngress", 39), ("mplsIcmpBridge", 40), ("ipSlb", 41), ("ipv4Default", 42), ("ipv6Default", 43), ("mplsDefault", 44), ("erSpanTermination", 45), ("ipv6Mcast", 46), ("ipDsL3Ingress", 47), ("ipDsL3Egress", 48), ("cryptoRedirectIngress", 49), ("otherDefault", 50), ("ipRecir", 51), ("iPAdmissionL3Eou", 52), ("iPAdmissionL2Eou", 53), ("iPAdmissionL2EouArp", 54), ("ipAdmissionL2Http", 55), ("ipAdmissionL2HttpArp", 56), ("ipv4L3IntfNde", 57), ("ipv4L2IntfNde", 58), ("ipSguardIngress", 59), ("pvtHostsIngress", 60), ("vrfNatIngress", 61), ("tcpAdjustMssIngress", 62), ("tcpAdjustMssEgress", 63), ("eomIw", 64), ("eomIw2", 65), ("ipv4VrfNdeEgress", 66), ("l1Egress", 67), ("l1Ingress", 68), ("l1GlobalEgress", 69), ("l1GlobalIngress", 70), ("ipDot1xAcl", 71), ("ipDot1xAclArp", 72), ("dot1ad", 73), ("ipSpanPcap", 74), ("ipv6CryptoRedirectIngress", 75), ("svcAcclrtIngress", 76), ("ipv6SvcAcclrtIngress", 77), ("nfAggregation", 78), ("nfSampling", 79), ("ipv6Guardian", 80), ("ipv6Qos", 81), ("none", 82)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcNetflowFlowMaskFeature.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowFlowMaskFeature.setDescription('This object indicates the features supported by this flow mask.')
cshcNetflowResourceUsageTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 6, 1), )
if mibBuilder.loadTexts: cshcNetflowResourceUsageTable.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowResourceUsageTable.setDescription('This table contains information regarding Netflow resource usage and utilization for a switching engine capable of providing this information.')
cshcNetflowResourceUsageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 6, 1, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"), (0, "CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowResourceUsageIndex"))
if mibBuilder.loadTexts: cshcNetflowResourceUsageEntry.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowResourceUsageEntry.setDescription('Each row contains information of the usage and utilization for a particular Netflow resource and switching engine, as specified by entPhysicalIndex in ENTITY-MIB.')
cshcNetflowResourceUsageIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 6, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))
if mibBuilder.loadTexts: cshcNetflowResourceUsageIndex.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowResourceUsageIndex.setDescription('An arbitrary positive integer value that uniquely identifies a Netflow resource.')
cshcNetflowResourceUsageDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 6, 1, 1, 2), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcNetflowResourceUsageDescr.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowResourceUsageDescr.setDescription('This object indicates a description of the Netflow resource.')
cshcNetflowResourceUsageUtil = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 6, 1, 1, 3), Percent()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcNetflowResourceUsageUtil.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowResourceUsageUtil.setDescription('This object indicates the Netflow resource usage in percentage value.')
cshcNetflowResourceUsageUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 6, 1, 1, 4), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcNetflowResourceUsageUsed.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowResourceUsageUsed.setDescription('This object indicates the number of Netflow entries used by this Netflow resource.')
cshcNetflowResourceUsageFree = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 6, 1, 1, 5), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcNetflowResourceUsageFree.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowResourceUsageFree.setDescription('This object indicates the number of Netflow entries available for this Netflow resource.')
cshcNetflowResourceUsageFail = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 6, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 2147483647), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcNetflowResourceUsageFail.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowResourceUsageFail.setDescription('This object indicates the number of Netflow entries which were failed to be created for this Netflow resource. A value of -1 indicates that this resource does not maintain this counter.')
cshcQosResourceUsageTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 7, 1), )
if mibBuilder.loadTexts: cshcQosResourceUsageTable.setStatus('current')
if mibBuilder.loadTexts: cshcQosResourceUsageTable.setDescription('This table contains QoS capacity per resource type and its usage for each entity capable of providing this information.')
cshcQosResourceUsageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 7, 1, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"), (0, "CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcQosResourceType"))
if mibBuilder.loadTexts: cshcQosResourceUsageEntry.setStatus('current')
if mibBuilder.loadTexts: cshcQosResourceUsageEntry.setDescription('Each row contains management information for QoS capacity and its usage on an entity, as specified by entPhysicalIndex in ENTITY-MIB.')
cshcQosResourceType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 7, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("aggregatePolicers", 1), ("distributedPolicers", 2), ("policerProfiles", 3))))
if mibBuilder.loadTexts: cshcQosResourceType.setStatus('current')
if mibBuilder.loadTexts: cshcQosResourceType.setDescription('This object indicates the QoS resource type.')
cshcQosResourceUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 7, 1, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcQosResourceUsed.setStatus('current')
if mibBuilder.loadTexts: cshcQosResourceUsed.setDescription('This object indicates the number of QoS entries that are currently in use.')
cshcQosResourceTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 663, 1, 7, 1, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cshcQosResourceTotal.setStatus('current')
if mibBuilder.loadTexts: cshcQosResourceTotal.setDescription('This object indicates the total number of QoS entries available.')
ciscoSwitchHardwareCapacityMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 1))
ciscoSwitchHardwareCapacityMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2))
ciscoSwitchHardwareCapacityMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 1, 1)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcVpnCamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcFibTcamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcForwardingLoadGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModuleInterfaceDropsGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcInterfaceBufferGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcInternalChannelGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcCPURateLimiterResourcesGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIcamResourcesGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowFlowMaskResourceGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoSwitchHardwareCapacityMIBCompliance = ciscoSwitchHardwareCapacityMIBCompliance.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoSwitchHardwareCapacityMIBCompliance.setDescription('The compliance statement for CISCO-SWITCH-HARDWARE-CAPACITY-MIB. This statement is deprecated and superseded by ciscoSwitchHardwareCapacityMIBCompliance1.')
ciscoSwitchHardwareCapacityMIBCompliance1 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 1, 2)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcVpnCamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcFibTcamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcForwardingLoadGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModuleInterfaceDropsGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcInterfaceBufferGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcInternalChannelGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcCPURateLimiterResourcesGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIcamResourcesGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowFlowMaskResourceGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcFibTcamUsageExtGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoSwitchHardwareCapacityMIBCompliance1 = ciscoSwitchHardwareCapacityMIBCompliance1.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoSwitchHardwareCapacityMIBCompliance1.setDescription('The compliance statement for CISCO-SWITCH-HARDWARE-CAPACITY-MIB. This statement is deprecated and superseded by ciscoSwitchHardwareCapacityMIBCompliance2.')
ciscoSwitchHardwareCapacityMIBCompliance2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 1, 3)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcVpnCamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcFibTcamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcForwardingLoadGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModuleInterfaceDropsGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcInterfaceBufferGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcInternalChannelGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcCPURateLimiterResourcesGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIcamResourcesGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowFlowMaskResourceGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcFibTcamUsageExtGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowFlowResourceUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacUsageExtGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamUsageExtGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyResourceUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcQosResourceUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModTopDropIfIndexListGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMetResourceUsageGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoSwitchHardwareCapacityMIBCompliance2 = ciscoSwitchHardwareCapacityMIBCompliance2.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoSwitchHardwareCapacityMIBCompliance2.setDescription('The compliance statement for CISCO-SWITCH-HARDWARE-CAPACITY-MIB')
ciscoSwitchHardwareCapacityMIBCompliance3 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 1, 4)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcVpnCamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcFibTcamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcForwardingLoadGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModuleInterfaceDropsGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcInterfaceBufferGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcInternalChannelGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcCPURateLimiterResourcesGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIcamResourcesGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowFlowMaskResourceGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcFibTcamUsageExtGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowFlowResourceUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacUsageExtGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamUsageExtGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyResourceUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcQosResourceUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModTopDropIfIndexListGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMetResourceUsageGroup"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamWidthTypeGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoSwitchHardwareCapacityMIBCompliance3 = ciscoSwitchHardwareCapacityMIBCompliance3.setStatus('current')
if mibBuilder.loadTexts: ciscoSwitchHardwareCapacityMIBCompliance3.setDescription('The compliance statement for CISCO-SWITCH-HARDWARE-CAPACITY-MIB')
cshcMacUsageGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 1)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacCollisions"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacTotal"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcMacUsageGroup = cshcMacUsageGroup.setStatus('current')
if mibBuilder.loadTexts: cshcMacUsageGroup.setDescription('A collection of objects which provides Layer 2 forwarding hardware capacity information in the device.')
cshcVpnCamUsageGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 2)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcVpnCamUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcVpnCamTotal"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcVpnCamUsageGroup = cshcVpnCamUsageGroup.setStatus('current')
if mibBuilder.loadTexts: cshcVpnCamUsageGroup.setDescription('A collection of objects which provides VPN CAM hardware capacity information in the device.')
cshcFibTcamUsageGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 3)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshc72bitsFibTcamUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshc72bitsFibTcamTotal"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshc144bitsFibTcamUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshc144bitsFibTcamTotal"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcFibTcamUsageGroup = cshcFibTcamUsageGroup.setStatus('current')
if mibBuilder.loadTexts: cshcFibTcamUsageGroup.setDescription('A collection of objects which provides FIB TCAM hardware capacity information in the device.')
cshcProtocolFibTcamUsageGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 4)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamTotal"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcProtocolFibTcamUsageGroup = cshcProtocolFibTcamUsageGroup.setStatus('current')
if mibBuilder.loadTexts: cshcProtocolFibTcamUsageGroup.setDescription('A collection of objects which provides FIB TCAM hardware capacity information in conjunction with Layer 3 protocol in the device.')
cshcAdjacencyUsageGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 5)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyTotal"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcAdjacencyUsageGroup = cshcAdjacencyUsageGroup.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyUsageGroup.setDescription('A collection of objects which provides adjacency hardware capacity information in the device.')
cshcForwardingLoadGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 6)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcForwardingLoadPktRate"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcForwardingLoadPktPeakRate"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcForwardingLoadPktPeakTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcForwardingLoadGroup = cshcForwardingLoadGroup.setStatus('current')
if mibBuilder.loadTexts: cshcForwardingLoadGroup.setDescription('A collection of objects which provides forwarding load information in the device.')
cshcModuleInterfaceDropsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 7)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModTxTotalDroppedPackets"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModRxTotalDroppedPackets"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModTxTopDropPort"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModRxTopDropPort"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcModuleInterfaceDropsGroup = cshcModuleInterfaceDropsGroup.setStatus('current')
if mibBuilder.loadTexts: cshcModuleInterfaceDropsGroup.setDescription('A collection of objects which provides linecard drop traffic information on the device.')
cshcInterfaceBufferGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 8)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcInterfaceTransmitBufferSize"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcInterfaceReceiveBufferSize"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcInterfaceBufferGroup = cshcInterfaceBufferGroup.setStatus('current')
if mibBuilder.loadTexts: cshcInterfaceBufferGroup.setDescription('A collection of objects which provides interface buffer information on the device.')
cshcInternalChannelGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 9)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIntlChnlRxPacketRate"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIntlChnlRxTotalPackets"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIntlChnlRxDroppedPackets"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIntlChnlTxPacketRate"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIntlChnlTxTotalPackets"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIntlChnlTxDroppedPackets"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcInternalChannelGroup = cshcInternalChannelGroup.setStatus('current')
if mibBuilder.loadTexts: cshcInternalChannelGroup.setDescription('A collection of objects which provides internal channel information on the device.')
cshcCPURateLimiterResourcesGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 10)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcCPURateLimiterTotal"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcCPURateLimiterUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcCPURateLimiterReserved"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcCPURateLimiterResourcesGroup = cshcCPURateLimiterResourcesGroup.setStatus('current')
if mibBuilder.loadTexts: cshcCPURateLimiterResourcesGroup.setDescription('A collection of objects which provides CPU rate limiter resource in the device.')
cshcIcamResourcesGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 11)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIcamCreated"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIcamFailed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcIcamUtilization"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcIcamResourcesGroup = cshcIcamResourcesGroup.setStatus('current')
if mibBuilder.loadTexts: cshcIcamResourcesGroup.setDescription('A collection of objects which provides ICAM resources information in the device.')
cshcNetflowFlowMaskResourceGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 12)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowFlowMaskType"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowFlowMaskFeature"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcNetflowFlowMaskResourceGroup = cshcNetflowFlowMaskResourceGroup.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowFlowMaskResourceGroup.setDescription('A collection of objects which provides Netflow FlowMask information in the device.')
cshcFibTcamUsageExtGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 13)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshc288bitsFibTcamUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshc288bitsFibTcamTotal"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcFibTcamUsageExtGroup = cshcFibTcamUsageExtGroup.setStatus('current')
if mibBuilder.loadTexts: cshcFibTcamUsageExtGroup.setDescription('A collection of objects which provides additional FIB TCAM hardware capacity information in the device.')
cshcNetflowFlowResourceUsageGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 14)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowResourceUsageDescr"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowResourceUsageUtil"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowResourceUsageUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowResourceUsageFree"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcNetflowResourceUsageFail"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcNetflowFlowResourceUsageGroup = cshcNetflowFlowResourceUsageGroup.setStatus('current')
if mibBuilder.loadTexts: cshcNetflowFlowResourceUsageGroup.setDescription('A collection of objects which provides Netflow resource usage information in the device.')
cshcMacUsageExtGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 15)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacMcast"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacUcast"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacLines"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMacLinesFull"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcMacUsageExtGroup = cshcMacUsageExtGroup.setStatus('current')
if mibBuilder.loadTexts: cshcMacUsageExtGroup.setDescription('A collection of objects which provides additional Layer 2 forwarding hardware capacity information in the device.')
cshcProtocolFibTcamUsageExtGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 16)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamLogicalUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamLogicalTotal"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcProtocolFibTcamUsageExtGroup = cshcProtocolFibTcamUsageExtGroup.setStatus('current')
if mibBuilder.loadTexts: cshcProtocolFibTcamUsageExtGroup.setDescription('A collection of objects which provides additional FIB TCAM hardware capacity information in conjunction with Layer 3 protocol in the device.')
cshcAdjacencyResourceUsageGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 17)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyResourceDescr"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyResourceUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcAdjacencyResourceTotal"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcAdjacencyResourceUsageGroup = cshcAdjacencyResourceUsageGroup.setStatus('current')
if mibBuilder.loadTexts: cshcAdjacencyResourceUsageGroup.setDescription('A collection of objects which provides adjacency hardware capacity information per resource in the device.')
cshcQosResourceUsageGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 18)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcQosResourceUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcQosResourceTotal"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcQosResourceUsageGroup = cshcQosResourceUsageGroup.setStatus('current')
if mibBuilder.loadTexts: cshcQosResourceUsageGroup.setDescription('A collection of objects which provides QoS hardware capacity information per resource in the device.')
cshcModTopDropIfIndexListGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 19)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModTxTopDropIfIndexList"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcModRxTopDropIfIndexList"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcModTopDropIfIndexListGroup = cshcModTopDropIfIndexListGroup.setStatus('current')
if mibBuilder.loadTexts: cshcModTopDropIfIndexListGroup.setDescription('A collection of objects which provides information on multiple interfaces with largest number of drop traffic on a module.')
cshcMetResourceUsageGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 20)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMetResourceDescr"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMetResourceUsed"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMetResourceTotal"), ("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcMetResourceMcastGrp"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcMetResourceUsageGroup = cshcMetResourceUsageGroup.setStatus('current')
if mibBuilder.loadTexts: cshcMetResourceUsageGroup.setDescription('A collection of objects which provides MET hardware capacity information per resource in the device.')
cshcProtocolFibTcamWidthTypeGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 663, 2, 2, 21)).setObjects(("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", "cshcProtocolFibTcamWidthType"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cshcProtocolFibTcamWidthTypeGroup = cshcProtocolFibTcamWidthTypeGroup.setStatus('current')
if mibBuilder.loadTexts: cshcProtocolFibTcamWidthTypeGroup.setDescription('A collection of objects which provides FIB TCAM entry width information in conjunction with Layer 3 protocol in the device.')
mibBuilder.exportSymbols("CISCO-SWITCH-HARDWARE-CAPACITY-MIB", cshcAdjacencyTotal=cshcAdjacencyTotal, cshcNetflowResourceUsageFail=cshcNetflowResourceUsageFail, cshcForwardingLoadEntry=cshcForwardingLoadEntry, cshcProtocolFibTcamWidthType=cshcProtocolFibTcamWidthType, cshcInterfaceTransmitBufferSize=cshcInterfaceTransmitBufferSize, cshcIcamCreated=cshcIcamCreated, cshcForwarding=cshcForwarding, cshcNetflowFlowMaskEntry=cshcNetflowFlowMaskEntry, cshcNetflowResourceUsageEntry=cshcNetflowResourceUsageEntry, cshcAdjacencyUsageGroup=cshcAdjacencyUsageGroup, cshcAdjacencyResourceIndex=cshcAdjacencyResourceIndex, cshcInterfaceBufferEntry=cshcInterfaceBufferEntry, cshcCPURateLimiterResourcesGroup=cshcCPURateLimiterResourcesGroup, cshcIcamUtilization=cshcIcamUtilization, cshcForwardingLoadPktRate=cshcForwardingLoadPktRate, cshcNetflowFlowMaskResourceGroup=cshcNetflowFlowMaskResourceGroup, cshcIntlChnlTxTotalPackets=cshcIntlChnlTxTotalPackets, ciscoSwitchHardwareCapacityMIBCompliance3=ciscoSwitchHardwareCapacityMIBCompliance3, cshcCPURateLimiterTotal=cshcCPURateLimiterTotal, cshcNetflowFlowMaskResources=cshcNetflowFlowMaskResources, cshcVpnCamUsed=cshcVpnCamUsed, ciscoSwitchHardwareCapacityMIBObjects=ciscoSwitchHardwareCapacityMIBObjects, cshcMetResourceDescr=cshcMetResourceDescr, cshcQosResourceUsed=cshcQosResourceUsed, ciscoSwitchHardwareCapacityMIBCompliance2=ciscoSwitchHardwareCapacityMIBCompliance2, cshcInterfaceBufferGroup=cshcInterfaceBufferGroup, PYSNMP_MODULE_ID=ciscoSwitchHardwareCapacityMIB, cshcMetResourceMcastGrp=cshcMetResourceMcastGrp, cshc288bitsFibTcamTotal=cshc288bitsFibTcamTotal, cshcModuleInterfaceDropsEntry=cshcModuleInterfaceDropsEntry, cshcInterface=cshcInterface, cshcAdjacencyUsageEntry=cshcAdjacencyUsageEntry, cshcInterfaceBufferTable=cshcInterfaceBufferTable, cshcL3Forwarding=cshcL3Forwarding, cshcNetflowFlowResourceUsageGroup=cshcNetflowFlowResourceUsageGroup, cshcProtocolFibTcamTotal=cshcProtocolFibTcamTotal, cshcProtocolFibTcamUsageTable=cshcProtocolFibTcamUsageTable, cshcModTxTotalDroppedPackets=cshcModTxTotalDroppedPackets, cshcMetResourceIndex=cshcMetResourceIndex, cshcFibTcamUsageGroup=cshcFibTcamUsageGroup, cshcAdjacencyResourceUsageTable=cshcAdjacencyResourceUsageTable, ciscoSwitchHardwareCapacityMIBGroups=ciscoSwitchHardwareCapacityMIBGroups, cshcNetflowFlowMaskAddrType=cshcNetflowFlowMaskAddrType, cshcMacUsageTable=cshcMacUsageTable, cshcInternalChannelEntry=cshcInternalChannelEntry, cshc144bitsFibTcamTotal=cshc144bitsFibTcamTotal, cshc72bitsFibTcamTotal=cshc72bitsFibTcamTotal, cshcModTxTopDropIfIndexList=cshcModTxTopDropIfIndexList, cshcMetResourceUsed=cshcMetResourceUsed, ciscoSwitchHardwareCapacityMIBNotifs=ciscoSwitchHardwareCapacityMIBNotifs, cshcAdjacencyUsageTable=cshcAdjacencyUsageTable, cshcIntlChnlRxPacketRate=cshcIntlChnlRxPacketRate, cshcAdjacencyUsed=cshcAdjacencyUsed, cshcAdjacencyResourceUsageEntry=cshcAdjacencyResourceUsageEntry, cshcVpnCamUsageEntry=cshcVpnCamUsageEntry, cshcForwardingLoadTable=cshcForwardingLoadTable, cshcQosResourceUsage=cshcQosResourceUsage, cshcProtocolFibTcamUsageEntry=cshcProtocolFibTcamUsageEntry, cshcForwardingLoadPktPeakRate=cshcForwardingLoadPktPeakRate, cshcCPURateLimiterResourcesTable=cshcCPURateLimiterResourcesTable, cshcCPURateLimiterNetworkLayer=cshcCPURateLimiterNetworkLayer, cshcModTopDropIfIndexListGroup=cshcModTopDropIfIndexListGroup, cshcVpnCamTotal=cshcVpnCamTotal, cshcMetResourceUsageEntry=cshcMetResourceUsageEntry, cshcAdjacencyResourceUsageGroup=cshcAdjacencyResourceUsageGroup, cshcCPURateLimiterResourcesEntry=cshcCPURateLimiterResourcesEntry, CshcInternalChannelType=CshcInternalChannelType, cshcAdjacencyResourceUsed=cshcAdjacencyResourceUsed, cshcForwardingLoadGroup=cshcForwardingLoadGroup, cshcIntlChnlTxPacketRate=cshcIntlChnlTxPacketRate, cshc72bitsFibTcamUsed=cshc72bitsFibTcamUsed, cshcModTxTopDropPort=cshcModTxTopDropPort, cshcModRxTopDropPort=cshcModRxTopDropPort, cshcForwardingLoadPktPeakTime=cshcForwardingLoadPktPeakTime, cshcMacUsageEntry=cshcMacUsageEntry, ciscoSwitchHardwareCapacityMIBConformance=ciscoSwitchHardwareCapacityMIBConformance, cshcQosResourceTotal=cshcQosResourceTotal, cshcNetflowResourceUsageUtil=cshcNetflowResourceUsageUtil, cshcFibTcamUsageExtGroup=cshcFibTcamUsageExtGroup, cshcIcamUtilizationEntry=cshcIcamUtilizationEntry, cshcVpnCamUsageTable=cshcVpnCamUsageTable, cshcMacUcast=cshcMacUcast, cshcMacUsageGroup=cshcMacUsageGroup, cshcIntlChnlType=cshcIntlChnlType, cshcIcamResources=cshcIcamResources, cshcMacLines=cshcMacLines, cshcMacCollisions=cshcMacCollisions, cshc288bitsFibTcamUsed=cshc288bitsFibTcamUsed, cshcIntlChnlRxDroppedPackets=cshcIntlChnlRxDroppedPackets, cshcProtocolFibTcamUsageGroup=cshcProtocolFibTcamUsageGroup, cshcAdjacencyResourceDescr=cshcAdjacencyResourceDescr, cshcModRxTopDropIfIndexList=cshcModRxTopDropIfIndexList, cshcNetflowFlowMaskTable=cshcNetflowFlowMaskTable, cshcNetflowResourceUsageUsed=cshcNetflowResourceUsageUsed, cshcNetflowFlowMaskIndex=cshcNetflowFlowMaskIndex, cshcProtocolFibTcamUsed=cshcProtocolFibTcamUsed, cshcProtocolFibTcamWidthTypeGroup=cshcProtocolFibTcamWidthTypeGroup, cshcMacUsageExtGroup=cshcMacUsageExtGroup, cshcInterfaceReceiveBufferSize=cshcInterfaceReceiveBufferSize, cshcNetflowResourceUsageIndex=cshcNetflowResourceUsageIndex, cshcQosResourceUsageTable=cshcQosResourceUsageTable, cshcQosResourceUsageEntry=cshcQosResourceUsageEntry, cshcIntlChnlRxTotalPackets=cshcIntlChnlRxTotalPackets, ciscoSwitchHardwareCapacityMIBCompliance1=ciscoSwitchHardwareCapacityMIBCompliance1, ciscoSwitchHardwareCapacityMIBCompliance=ciscoSwitchHardwareCapacityMIBCompliance, cshcInternalChannelGroup=cshcInternalChannelGroup, cshcModuleInterfaceDropsTable=cshcModuleInterfaceDropsTable, cshcVpnCamUsageGroup=cshcVpnCamUsageGroup, cshcFibTcamUsageTable=cshcFibTcamUsageTable, cshcL2Forwarding=cshcL2Forwarding, cshcFibTcamUsageEntry=cshcFibTcamUsageEntry, cshcMacMcast=cshcMacMcast, cshcIcamResourcesGroup=cshcIcamResourcesGroup, cshcModuleInterfaceDropsGroup=cshcModuleInterfaceDropsGroup, cshcCPURateLimiterUsed=cshcCPURateLimiterUsed, cshcProtocolFibTcamProtocol=cshcProtocolFibTcamProtocol, cshcMetResourceUsageGroup=cshcMetResourceUsageGroup, cshcIcamFailed=cshcIcamFailed, ciscoSwitchHardwareCapacityMIB=ciscoSwitchHardwareCapacityMIB, cshcNetflowResourceUsage=cshcNetflowResourceUsage, cshcMacTotal=cshcMacTotal, cshcCPURateLimiterReserved=cshcCPURateLimiterReserved, cshcQosResourceUsageGroup=cshcQosResourceUsageGroup, cshcMetResourceTotal=cshcMetResourceTotal, cshcMacUsed=cshcMacUsed, cshcInternalChannelTable=cshcInternalChannelTable, cshcNetflowResourceUsageTable=cshcNetflowResourceUsageTable, cshcQosResourceType=cshcQosResourceType, ciscoSwitchHardwareCapacityMIBCompliances=ciscoSwitchHardwareCapacityMIBCompliances, cshcNetflowResourceUsageFree=cshcNetflowResourceUsageFree, cshc144bitsFibTcamUsed=cshc144bitsFibTcamUsed, cshcNetflowResourceUsageDescr=cshcNetflowResourceUsageDescr, cshcModRxTotalDroppedPackets=cshcModRxTotalDroppedPackets, cshcAdjacencyResourceTotal=cshcAdjacencyResourceTotal, cshcProtocolFibTcamLogicalUsed=cshcProtocolFibTcamLogicalUsed, cshcIntlChnlTxDroppedPackets=cshcIntlChnlTxDroppedPackets, cshcIcamUtilizationTable=cshcIcamUtilizationTable, cshcCPURateLimiterResources=cshcCPURateLimiterResources, cshcNetflowFlowMaskFeature=cshcNetflowFlowMaskFeature, cshcProtocolFibTcamUsageExtGroup=cshcProtocolFibTcamUsageExtGroup, cshcMacLinesFull=cshcMacLinesFull, cshcProtocolFibTcamLogicalTotal=cshcProtocolFibTcamLogicalTotal, cshcMetResourceUsageTable=cshcMetResourceUsageTable, cshcNetflowFlowMaskType=cshcNetflowFlowMaskType)
|
class Solution(object):
def constructRectangle(self, area):
"""
:type area: int
:rtype: List[int]
"""
L = int(math.sqrt(area))
while True:
W = area // L
if W * L == area:
return [W, L]
L -= 1
|
#/usr/bin/env python3
GET_PHOTOS_PATTERN = "https://www.flickr.com/services/rest?method=flickr.people.getPhotos&api_key={}&user_id={}&format=json&page={}&per_page={}"
FIND_USER_BY_NAME_METHOD = "https://www.flickr.com/services/rest?method=flickr.people.findbyusername&api_key={}&username={}&format={}"
GET_PHOTO_COMMENTS = "https://www.flickr.com/services/rest?method=flickr.photos.comments.getList&api_key={}&photo_id={}&format=json"
GET_PHOTO_SIZE_PATTERN = "https://www.flickr.com/services/rest?method=flickr.photos.getSizes&api_key={}&photo_id={}&format=json"
GET_PHOTO_DESCRIPTION = "https://www.flickr.com/services/rest?method=flickr.photos.getInfo&api_key={}&photo_id={}&format=json"
PHOTO_DATA_KEYS = ['id', 'owner', 'secret', 'server', 'farm', 'title', 'ispublic', 'isfriend', 'isfamily']
USER_DATA_PATTERN = r'{"user":{"id":".*","nsid":".*","username":{"_content":".*"}},"stat":"ok"}'
PHOTO_SIZE_URL_PATTERN = r"https://live.staticflickr.com/\d*/.*.jpg"
ALPHANUMERIC = "0123456789abcdefghijklmnopqrstuvwxyz"
CAPITAL_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ALPHABET = "abcdefghijklmnopqrstuvwxyz"
USER_KEYS = ['id', 'nsid', 'username']
LOCALE_FORMAT = r"^[a-z]*-[A-Z]{2}"
USER_NOT_FOUND = "User not found"
ISO3166_1_FORMAT = r"[A-Z]{2}"
ALPHABET_REGEX = r"[a-zA-Z]*"
ISO639_FORMAT = r"^[a-z]*"
DESCRITION = "description"
USERNAME_KEY = "_content"
USERNAME = "username"
COMMENTS = "comments"
CONTENT = "_content"
COMMENT = "comment"
MESSAGE = 'message'
PHOTOS = "photos"
HEIGHT = "height"
SOURCE = "source"
TITLE = "title"
PAGES = "pages"
PHOTO = "photo"
LABEL = "label"
TOTAL = "total"
WIDTH = "width"
SIZES = "sizes"
JSON = "json"
NSID = "nsid"
SIZE = "size"
USER = "user"
STAT = "stat"
FAIL = "fail"
GET = "GET"
ID = "id"
CONSUMER_KEY = "consumer_key"
CONSUMER_SECRET = "consumer_secret"
FLICKR_KEYS = "flickr_keys"
LOCALE = "locale"
|
# 打印输出从文件读取的所有行额字符串
f = open('hello.txt') # 打开(文本+读取模式)
while True:
line = f.readline()
if not line: # 没有读取到内容(达到了结尾)
break
print(line, end='')
f.close() # 关闭
|
class Font(object):
# no doc
@staticmethod
def AvailableFontFaceNames():
""" AvailableFontFaceNames() -> Array[str] """
pass
Bold = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Bold(self: Font) -> bool
"""
FaceName = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: FaceName(self: Font) -> str
"""
Italic = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Italic(self: Font) -> bool
"""
|
def sayhi():
print("hello")
def chat():
print("This is a calculator")
def exit():
print("Thank you")
def mul(n1,n2):
return n1*n2
def add(n1,n2):
return n1+n2
def sub(n1,n2):
return n1-n2
def div(n1,n2):
return n1/n2
sayhi()
chat()
i = int(input("Enter a number:- "))
j = int(input("Enter another number:- "))
print("Addition :-")
print(add(i,j))
print("Substraction :-")
print(sub(i,j))
print("Multiplication :-")
print(mul(i,j))
print("Division :-")
print(div(i,j))
exit()
|
'''
m18 - maiores de 18
h - homens
m20 - mulheres menos de 20
'''
m18 = h = m20 = 0
while True:
print('-'*25)
print('CADSTRE UMA PESSOA')
print('-'*25)
idade = int(input('Idade: '))
if idade > 18:
m18 += 1
while True:
sexo = str(input('Sexo: [M/F] ')).upper()
if sexo in 'MF':
break
if sexo == 'M':
h += 1
if sexo == 'F' and idade < 20:
m20 += 1
while True:
print('-'*25)
variavel = str(input('Quer continuar [S/N]: ')).upper()
if variavel in 'SN':
break
if variavel == 'N':
break
print('===== FIM DO PROGRAMA =====')
print(f'Total de pessoas com mais de 18 anos: {m18}')
print(f'Ao todo temos {h} homens cadastrados')
print(f'E temos {m20} mulheres com menos com menos de 20 anos')
|
bootstrap_url="http://agent-resources.cloudkick.com/"
s3_bucket="s3://agent-resources.cloudkick.com"
pubkey="etc/agent-linux.public.key"
branding_name="cloudkick-agent"
|
def binary_search(arr, num):
lo, hi = 0, len(arr)-1
while lo <= hi:
mid = (lo+hi)//2
if num < arr[mid]:
hi = mid-1
elif num > arr[mid]:
lo = mid+1
elif num == arr[mid]:
print(num, 'found in array.')
break
if lo > hi:
print(num, 'is not present in the array!')
if __name__ == '__main__':
arr = [2, 6, 8, 9, 10, 11, 13]
binary_search(arr, 12)
|
"""Configuration for HomeAssistant connection"""
# pylint: disable=too-few-public-methods
class HomeAssistantConfig:
"""Data structure for holding Home-Assistant server configuration."""
def __init__(self, url, token):
self.url = url
self.token = token
|
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(borenet): This module belongs in the recipe engine. Remove it from this
# repo once it has been moved.
DEPS = [
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/python',
'recipe_engine/raw_io',
'recipe_engine/step',
]
|
command = '/home/billerot/Git/alexa-flask/venv/bin/gunicorn'
pythonpath = '/home/billerot/Git/alexa-flask'
workers = 3
user = 'billerot'
bind = '0.0.0.0:8088'
logconfig = "/home/billerot/Git/alexa-flask/conf/logging.conf"
capture_output = True
timeout = 90
|
# def minsteps1(n):
# memo = [0] * (n + 1)
# def loop(n):
# if n > 1:
# if memo[n] != 0:
# return memo[n]
# else:
# memo[n] = 1 + loop(n - 1)
# if n % 2 == 0:
# memo[n] = min(memo[n], 1 + loop(n // 2))
# if n % 3 == 0:
# memo[n] = min(memo[n], 1 + loop(n // 3))
# return memo[n]
# else:
# return 0
# return loop(n)
def minsteps(n):
memo = [0] * (n + 1)
for i in range(1, n+1):
memo[i] = 1 + memo[i-1]
if i % 2 == 0:
memo[i] = min(memo[i], memo[i // 2]+1)
if i % 3 == 0:
memo[i] = min(memo[i], memo[i // 3]+1)
return memo[n]-1
print(minsteps(10)) # 3
print(minsteps(317)) # 10
print(minsteps(514)) # 8
|
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Codec:
def serialize(self, root):
ans = ""
queue = [root]
while queue:
node = queue.pop(0)
if node:
ans += str(node.val) + ","
queue.append(node.left)
queue.append(node.right)
else:
ans += "#,"
return ans[:-1]
def deserialize(self, data: str):
if data == "#":
return None
data = data.split(",")
if not data:
return None
root = TreeNode(data[0])
nodes = [root]
i = 1
while i < len(data) - 1:
node = nodes.pop(0)
lv = data[i]
rv = data[i + 1]
node.left = l
node.right = r
i += 2
if lv != "#":
l = TreeNode(lv)
nodes.append(l)
if rv != "#":
r = TreeNode(rv)
nodes.append(r)
return root
c1 = Codec()
data = [1, 2, 3, None, None, 6, 7, None, None, 12, 13]
str_data = ",".join(map(lambda x: str(x) if x is not None else "#", data))
root = c1.deserialize(str_data)
print(c1.serialize(root))
|
def f(x):
return x, x + 1
for a in b, c:
f(a)
|
class Proxy:
def __init__(self, obj):
self._obj = obj
# Delegate attribute lookup to internal obj
def __getattr__(self, name):
return getattr(self._obj, name)
# Delegate attribute assignment
def __setattr__(self, name, value):
if name.startswith('_'):
super().__setattr__(name, value) # Call original __setattr__
else:
setattr(self._obj, name, value)
if __name__ == '__main__':
class A:
def __init__(self, x):
self.x = x
def spam(self):
print('A.spam')
a = A(42)
p = Proxy(a)
print(p.x)
print(p.spam())
p.x = 37
print('Should be 37:', p.x)
print('Should be 37:', a.x)
|
rolls = [6, 5, 3, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
soma = 0
# for r in rolls:
# soma += r
# for twice in range(0, 3):
# soma +=rolls[twice]
# if soma == 10:
# rolls[2] *= 2
# print(rolls)
# # print(twice)
# print(rolls)
# print(rolls[0])
# row = [i for i in rolls]
# print(rolls)
for iterator in range(0, len(rolls)):
soma += rolls[iterator]
if soma == 10:
change = rolls[iterator+1]*2
rolls[iterator+1] = change
print(rolls)
|
def dfs(node,parent):
currsize=1
for child in tree[node]:
if child!=parent:
currsize+=dfs(child,node)
subsize[node]=currsize
return currsize
n=int(input())
tree=[[]for i in range(n)]
for i in range(n-1):
a,b=map(int,input().split())
a,b=a-1,b-1
tree[a].append(b)
tree[b].append(a)
subsize=[0 for i in range(n)]
dfs(0,-1)
print(subsize)
|
''' Contains Hades gamedata '''
# Based on data in Weaponsets.lua
HeroMeleeWeapons = {
"SwordWeapon": "Stygian Blade",
"SpearWeapon": "Eternal Spear",
"ShieldWeapon": "Shield of Chaos",
"BowWeapon": "Heart-Seeking Bow",
"FistWeapon": "Twin Fists of Malphon",
"GunWeapon": "Adamant Rail",
}
# Based on data from TraitData.lua
AspectTraits = {
"SwordCriticalParryTrait": "Nemesis",
"SwordConsecrationTrait": "Arthur",
"ShieldRushBonusProjectileTrait": "Chaos",
"ShieldLoadAmmoTrait": "Beowulf",
# "ShieldBounceEmpowerTrait": "",
"ShieldTwoShieldTrait": "Zeus",
"SpearSpinTravel": "Guan Yu",
"GunGrenadeSelfEmpowerTrait": "Eris",
"FistVacuumTrait": "Talos",
"FistBaseUpgradeTrait": "Zagreus",
"FistWeaveTrait": "Demeter",
"FistDetonateTrait": "Gilgamesh",
"SwordBaseUpgradeTrait": "Zagreus",
"BowBaseUpgradeTrait": "Zagreus",
"SpearBaseUpgradeTrait": "Zagreus",
"ShieldBaseUpgradeTrait": "Zagreus",
"GunBaseUpgradeTrait": "Zagreus",
"DislodgeAmmoTrait": "Poseidon",
# "SwordAmmoWaveTrait": "",
"GunManualReloadTrait": "Hestia",
"GunLoadedGrenadeTrait": "Lucifer",
"BowMarkHomingTrait": "Chiron",
"BowLoadAmmoTrait": "Hera",
# "BowStoredChargeTrait": "",
"BowBondTrait": "Rama",
# "BowBeamTrait": "",
"SpearWeaveTrait": "Hades",
"SpearTeleportTrait": "Achilles",
}
|
class Property(object):
def __init__(self, **kwargs):
self.background = "#FFFFFF"
self.candle_hl = dict()
self.up_candle = dict()
self.down_candle = dict()
self.long_trade_line = dict()
self.short_trade_line = dict()
self.long_trade_tri = dict()
self.short_trade_tri = dict()
self.trade_close_tri = dict()
self.default_colors = [
'#fa8072',
'#9932cc',
'#800080',
'#ff4500',
'#4b0082',
'#483d8b',
'#191970',
'#a52a2a',
'#dc143c',
'#8b0000',
'#c71585',
'#ff0000',
'#008b8b',
'#2f4f4f',
'#2e8b57',
'#6b8e23',
'#556b2f',
'#ff8c00',
'#a0522d',
'#4682b4',
'#696969',
'#f08080',
]
for key, value in kwargs.items():
setattr(self, key, value)
# BigFishProperty -----------------------------------------------------
BF_LONG = "#208C13"
BF_SHORT = "#D32C25"
BF_CLOSE = "#F9D749"
BF_KLINE = "#4DB3C7"
BF_BG = "#FFFFFF"
BigFishProperty = Property(
background=BF_BG,
candle_hl=dict(
color=BF_KLINE
),
up_candle=dict(
fill_color=BF_BG,
line_color=BF_KLINE
),
down_candle = dict(
fill_color=BF_KLINE,
line_color=BF_KLINE
),
long_trade_line=dict(
color=BF_LONG
),
short_trade_line=dict(
color=BF_SHORT
),
long_trade_tri=dict(
line_color="black",
fill_color=BF_LONG
),
short_trade_tri=dict(
line_color="black",
fill_color=BF_SHORT
),
trade_close_tri=dict(
line_color="black",
fill_color=BF_CLOSE
)
)
# BigFishProperty -----------------------------------------------------
# MT4Property ---------------------------------------------------------
MT4_LONG = "blue"
MT4_SHORT = "red"
MT4_CLOSE = "gold"
MT4_KLINE = "#00FF00"
MT4_BG = "#000000"
MT4Property = Property(
background=MT4_BG,
candle_hl=dict(
color=MT4_KLINE
),
up_candle=dict(
fill_color=MT4_BG,
line_color=MT4_KLINE
),
down_candle = dict(
fill_color=MT4_KLINE,
line_color=MT4_KLINE
),
long_trade_line=dict(
color=MT4_LONG
),
short_trade_line=dict(
color=MT4_SHORT
),
long_trade_tri=dict(
line_color="#FFFFFF",
fill_color=MT4_LONG
),
short_trade_tri=dict(
line_color="#FFFFFF",
fill_color=MT4_SHORT
),
trade_close_tri=dict(
line_color="#FFFFFF",
fill_color=MT4_CLOSE
)
)
# MT4Property ---------------------------------------------------------
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
**Project Name:** MakeHuman
**Product Home Page:** http://www.makehumancommunity.org/
**Github Code Home Page:** https://github.com/makehumancommunity/
**Authors:** Thanasis Papoutsidakis
**Copyright(c):** MakeHuman Team 2001-2019
**Licensing:** AGPL3
This file is part of MakeHuman Community (www.makehumancommunity.org).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Abstract
--------
Tools and interfaces for managing caches.
A cache is a container associated with a method.
When the method is called, the result is stored in the
cache, and on subsequent calls of the method the stored
result is returned, so that no recomputation is needed.
The result of the method will be recalculated once the
cache is explicitly invalidated (emptied) and the method
gets called again.
To use the caching mechanisms in your code, simply use
the Cache decorator in front of the method you want to cache.
Example:
@Cache
def method(self):
...
To invalidate a cached result, you can assign Cache Empty to
your method's cache: self.method.cache = Cache.Empty
You can also use Cache.invalidate to inalidate caches,
like so: Cache.invalidate(self, "method1", "method2")
Or use Cache.invalidateAll to clear all caches of an object:
Cache.invalidateAll(self)
If your object happens to have a method that somehow processes
all of its caches, and returns a similar object with the same
methods but with all the computation done, decorate it as
Cache.Compiler. When next time a method is called, the computed
object's methods will be called instead of returning the method's
cache, if the object is newer than the cache.
"""
class Cache(object):
"""
Method decorator class.
Used on methods whose result will be cached.
"""
# A unique ever-increasing id for each cache update.
# Can be used for comparing the age of caches.
_C_CacheUID = 0
# Represents an empty cache.
Empty = object()
@staticmethod
def getNewCacheUID():
"""
Get a new unique ID for the Cache that is
about to be constructed or updated.
"""
r = _C_CacheUID
_C_CacheUID += 1
return r
class Manager(object):
"""
Interface hidden in objects utilized by caches
that enables the use of operations on all the
cached objects of the parent.
"""
# Name of the hidden member of the managed object
# that holds the Cache Manager.
CMMemberName = "_CM_Cache_Manager_"
@staticmethod
def of(object):
"""
Return the Cache Manager of the object.
Instantiates a new one if it doesn't have one.
"""
Manager(object)
return getattr(object, Manager.CMMemberName)
def __init__(self, parent):
"""
Cache Manager constructor.
:param parent: The object whose caches will be managed.
"""
if hasattr(parent, Manager.CMMemberName) and \
isinstance(getattr(parent, Manager.CMMemberName), Manager):
return
setattr(parent, Manager.CMMemberName, self)
self.caches = set()
self.compiler = None
class Compiler(Cache):
"""
A Cache Compiler is a special form of cache,
which when invoked creates a "Compiled Cache".
A Compiled Cache is a cache that is stored in the
parent's Cache Manager, and essentialy replaces
the parent. So, the method that will be decorated
with the Compiler has to return an object with the
same type as the parent, or at least one that supports
the same methods of the parent that are decorated as
Cache. After that, whenever a cached method is called,
the result is taken from the compiled cache (except if
the method's cache is newer).
This is useful for objects that cache many parameters,
but also have a greater method that creates a 'baked'
replica of themselves. After the 'baking', the parameters
can simply be taken from the cached replica.
"""
@staticmethod
def of(object):
"""
Return the Cache Compiler of the object.
"""
return Cache.Manager.of(parent).compiler
def __call__(self, parent, *args, **kwargs):
Cache.Manager.of(parent).compiler = self
if self.cache is Cache.Empty:
self.calculate(parent, *args, **kwargs)
return self.cache
def __init__(self, method):
"""
Cache constructor.
Cache is a decorator class, so the constructor is
essentialy applied to a method to be cached.
"""
self.method = method
self.cache = Cache.Empty
self.cacheUID = Cache.getNewCacheUID()
def __call__(self, parent, *args, **kwargs):
Cache.Manager.of(parent).caches.add(self)
# If a compiled cache exists and is newer,
# prefer to get the value from it instead.
compiler = Cache.Compiler.of(parent)
if compiler and \
compiler.cacheUID > self.cacheUID and \
compiler.cache is not Cache.Empty:
return getattr(compiler.cache, self.method)(parent, *args, **kwargs)
if self.cache is Cache.Empty:
self.calculate(parent, *args, **kwargs)
return self.cache
def calculate(self, *args, **kwargs):
self.cache = self.method(*args, **kwargs)
self.cacheUID = Cache.getNewCacheUID()
@staticmethod
def invalidate(object, *args):
"""
Invalidate the caches of the object
defined in the arguments.
"""
for arg in args:
if hasattr(object, arg) and \
isinstance(getattr(object, arg), Cache):
getattr(object, arg).cache = Cache.Empty
@staticmethod
def invalidateAll(object):
"""
Invalidate all caches of the given object.
"""
Cache.invalidate(object, *Cache.Manager.of(object).caches)
|
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'chromium',
'isolate',
'recipe_engine/properties',
]
def RunSteps(api):
api.chromium.set_config('chromium')
api.isolate.compare_build_artifacts('first_dir', 'second_dir')
def GenTests(api):
yield (
api.test('basic') +
api.properties(
buildername='test_buildername',
buildnumber=123)
)
yield (
api.test('failure') +
api.properties(
buildername='test_buildername',
buildnumber=123) +
api.step_data('compare_build_artifacts', retcode=1)
)
|
p1 = int(input('Primeiro termo: '))
p = p1
r = int(input('Razão: '))
while p1 < (p + r*10):
print(p1, '->', end=' ')
p1 += r
print('Fim')
|
'''
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
'''
# Write your code here
def arr():
return []
def bfs(g,a,b,n):
vis=[]
q=[a]
parent={}
while(len(q)>0):
t = q.pop(0)
vis.append(t)
n+=1
for i in g.get(t,[]):
if i not in vis:
parent[i]=t
if i==b:
return n+1,parent
q.append(i)
return -1,{}
n,m,t,c = map(int,input().split())
g = {}
for _ in range(m):
a,b = map(int,input().split())
if g.get(a)==None:
g[a]=[]
if g.get(b)==None:
g[b]=[]
g[a].append(b)
g[b].append(a)
c,p=bfs(g,1,n,0)
print(c)
pp=[n]
s=n
while(p.get(s)!=None):
pp.append(p.get(s))
s=p.get(s)
pp.reverse()
print(" ".join(map(str,pp)))
|
class Solution:
def convert(self, s: str, numRows: int) -> str:
if numRows == 1: return s
rows = [''] * min(numRows, len(s))
cur_row = 0
goind_down = False
for c in s:
rows[cur_row] += c
if cur_row == 0 or cur_row == numRows - 1:
goind_down = not goind_down
cur_row += 1 if goind_down else -1
result = ''
for row in rows:
result += row
return result
|
class LowPassFilter(object):
def __init__(self, lpf_constants):
self.tau = lpf_constants[0]
self.ts = lpf_constants[1]
self.a = 1. / (self.tau / self.ts + 1.)
self.b = self.tau / self.ts / (self.tau / self.ts + 1.);
self.last_val = 0.
self.ready = False
def get(self):
return self.last_val
def filt(self, val):
if self.ready:
val = self.a * val + self.b * self.last_val
else:
self.ready = True
self.last_val = val
return val
|
class Solution(object):
def XXX(self, s):
"""
用消除法解这道题目
:type s: str
:rtype: int
"""
d = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000, 'IV': 4, 'IX': 9, 'XL': 40, 'XC': 90,
'CD': 400, 'CM': 900}
sum = 0
while len(s) > 0:
ss = s[0:2]
if ss in d:
sum += d.get(ss)
s = s[2:]
else:
sum += d.get(s[0:1])
s = s[1:]
return sum
|
'''
Problem Statement : Write a function that returns the boolean True if the given number is zero, the string "positive" if the number is greater than zero or the string "negative" if it's smaller than zero.
Problem Link : https://edabit.com/challenge/2TdPmSpLpa8NWh6m9
'''
def equilibrium(x):
return not x or ('negative', 'positive')[x > 0]
|
"""https://leetcode.com/problems/rectangle-area/
https://www.youtube.com/watch?v=zGv3hOORxh0&list=WL&index=6
You're given 2 overlapping rectangles on a plane (2 rectilinear rectangles in a 2D plane.)
For each rectangle, you're given its bottom-left and top-right points
How would you find the area of their overlap? (total area covered by the two rectangles.)
"""
class Solution:
def computeArea(
self,
ax1: int,
ay1: int,
ax2: int,
ay2: int,
bx1: int,
by1: int,
bx2: int,
by2: int,
) -> int:
bottom_left_1 = [ax1, ay1]
top_right_1 = [ax2, ay2]
bottom_right_1 = [ax2, ay1]
top_left_1 = [ax1, ay2]
bottom_left_2 = [bx1, by1]
top_right_2 = [bx2, by2]
bottom_right_2 = [bx2, by1]
top_left_2 = [bx1, by2]
width = 0
height = 0
left_3 = max([bottom_left_1[0], bottom_left_2[0]])
right_3 = min([bottom_right_1[0], bottom_right_2[0]])
if right_3 > left_3:
width = abs(right_3 - left_3)
top_3 = min([top_left_1[1], top_left_2[1]])
bottom_3 = max([bottom_left_1[1], bottom_left_2[1]])
if top_3 > bottom_3:
height = abs(bottom_3 - top_3)
area_1 = abs(bottom_right_1[0] - bottom_left_1[0]) * abs(
top_left_1[1] - bottom_left_1[1]
)
area_2 = abs(bottom_right_2[0] - bottom_left_2[0]) * abs(
top_left_2[1] - bottom_left_2[1]
)
print(area_1, area_2, width, height)
return (area_1 + area_2) - (width * height)
|
"""
Resource optimization functions.
"""
#from scipy.optimize import linprog
def allocate(reservations, total=1.0):
"""
Allocate resources among slices with specified and unspecified reservations.
Returns a new list of values with the following properties:
- Every value is >= the corresponding input value.
- The result sums to `total`.
Examples:
allocate([0.25, None, None]) -> [0.5, 0.25, 0.25]
allocate([0.4, None, None]) -> [0.6, 0.2, 0.2]
allocate([0.2, 0.2, 0.2]) -> [0.33, 0.33, 0.33]
allocate([None, None, None]) -> [0.33, 0.33, 0.33]
allocate([0.5, 0.5, 0.5]) -> ERROR
"""
n = len(reservations)
if n <= 0:
return []
remaining = total
for r in reservations:
if r is not None:
remaining -= r
result = list(reservations)
# Divide the remaining resources among all slices.
if remaining > 0:
share = float(remaining) / n
for i in range(n):
if result[i] is None:
result[i] = share
else:
result[i] += share
elif remaining < 0:
raise Exception("Resource allocation is infeasible (total {} > {})".format(
sum(result), total))
return result
#
# The optimize function requires scipy. It might be useful later.
#
#def optimize(reservations, ub=1):
# n = len(reservations)
#
# # In case some reservations are unspecified (None), calculate the remaining
# # share and divide it evenly among the unspecified buckets.
# #
# # Example:
# # [0.2, None, None] -> [0.2, 0.4, 0.4]
# floor = allocate(reservations, ub)
# print(floor)
#
# # Coefficients for the objective function. We want to maximize the sum, but
# # linprog does minimization, hence the negative.
# c = [-1] * n
#
# # Constraints (A_ub * x <= b_ub).
# A_ub = []
# b_ub = []
#
# for i in range(n):
# # Competition constraint (sum of all others <= ub-reservation[i]).
# # If all others (j != i) use up their allocated resource, there must
# # be enough left over for reservation[i].
# row = [0] * n
# for j in range(n):
# # Sum of limit[j] for j != i
# if j != i:
# row[j] = 1
#
# # ...is <= ub-reservations[i].
# A_ub.append(row)
# b_ub.append(ub-floor[i])
#
# # Set the upper and lower bounds:
# # (reservations[i] or fair share) <= x[i] <= ub
# bounds = [(floor[i], ub) for i in range(n)]
#
# result = linprog(c, A_ub=A_ub, b_ub=b_ub, bounds=bounds)
# return result
|
class Solution:
def findShortestSubArray(self, nums):
first, count, res, degree = {}, {}, 0, 0
for i, num in enumerate(nums):
first.setdefault(num, i)
count[num] = count.get(num, 0) + 1
if count[num] > degree:
degree = count[num]
res = i - first[num] + 1
elif count[num] == degree:
res = min(res, i - first[num] + 1)
return res
s = Solution()
print(s.findShortestSubArray([]))
print(s.findShortestSubArray([1]))
print(s.findShortestSubArray([1, 2, 2, 3, 1]))
print(s.findShortestSubArray([1, 2, 2, 3, 1, 4, 2]))
|
class StitchSubclusterSelectorBase(object):
""" Subclasses of this class are used to make choice which subclusters
will be stitched next based on criteria. """
def __init__(self, *args, **kwargs):
pass
def select(self, dst, src, stitched, is_intra=False):
raise NotImplementedError
class MaxCommonNodeSelector(StitchSubclusterSelectorBase):
"""
Return subclusters that have maximum common node count.
"""
def __init__(self, cn_count_treshold=0):
self.cn_count_treshold = cn_count_treshold
def select(self, dst, src, stitched, is_intra=False):
cn_count_max = 0
dstSubIndex = None
srcSubIndex = None
for src_index, src_sc in enumerate(src):
for dst_index, dst_sc in enumerate(dst):
# same subcluster
if is_intra and src_index==dst_index:
continue
# already stitched
if (dst_index, src_index) in stitched:
continue
# src_sc is subset of dst_sc mark src_sc stitched with dst
if set(src_sc.keys())<=set(dst_sc.keys()):
stitched[(dst_index, src_index)] = ()
continue
commonNodes = [node for node in list(dst_sc.keys())
if node in list(src_sc.keys())]
cn_count = len(commonNodes)
if cn_count>cn_count_max and cn_count>=self.cn_count_treshold:
cn_count_max = cn_count
dstSubIndex = dst_index
srcSubIndex = src_index
# in intraStitch make sure that dstSub is larger one
if is_intra and cn_count_max!=0 and \
len(src[srcSubIndex])>len(dst[dstSubIndex]):
return (srcSubIndex, dstSubIndex) # swapped src and dst indexes
return (dstSubIndex, srcSubIndex)
|
DISCORD_API_BASE_URL = "https://discord.com/api"
DISCORD_AUTHORIZATION_BASE_URL = DISCORD_API_BASE_URL + "/oauth2/authorize"
DISCORD_TOKEN_URL = DISCORD_API_BASE_URL + "/oauth2/token"
DISCORD_OAUTH_ALL_SCOPES = [
"bot", "connections", "email", "identify", "guilds", "guilds.join",
"gdm.join", "messages.read", "rpc", "rpc.api", "rpc.notifications.read", "webhook.incoming",
]
DISCORD_OAUTH_DEFAULT_SCOPES = [
"identify", "email", "guilds", "guilds.join"
]
DISCORD_PASSTHROUGH_SCOPES = [
"bot", "webhook.incoming",
]
DISCORD_IMAGE_BASE_URL = "https://cdn.discordapp.com/"
DISCORD_EMBED_BASE_BASE_URL = "https://cdn.discordapp.com/"
DISCORD_IMAGE_FORMAT = "png"
DISCORD_ANIMATED_IMAGE_FORMAT = "gif"
DISCORD_USER_AVATAR_BASE_URL = DISCORD_IMAGE_BASE_URL + "avatars/{user_id}/{avatar_hash}.{format}"
DISCORD_DEFAULT_USER_AVATAR_BASE_URL = DISCORD_EMBED_BASE_BASE_URL + "embed/avatars/{modulo5}.png"
DISCORD_GUILD_ICON_BASE_URL = DISCORD_IMAGE_BASE_URL + "icons/{guild_id}/{icon_hash}.png"
DISCORD_USERS_CACHE_DEFAULT_MAX_LIMIT = 100
|
CSRF_ENABLED = True
SECRET_KEY = 'blabla'
DOCUMENTDB_HOST = 'https://mongo-olx.documents.azure.com:443/'
DOCUMENTDB_KEY = 'hJJaII1eaMs2wUHNqvjDkzRF3wOz24x8x/J7+Zfw2D91KM/LTjNXcVg8WgMV2JiaNGuTnsnInSmO8jrqDRGw/g=='
DOCUMENTDB_DATABASE = 'olxDB'
DOCUMENTDB_COLLECTION = 'rentals'
DOCUMENTDB_DOCUMENT = 'rent-doc'
|
class Solution:
def numMovesStones(self, a: int, b: int, c: int) -> List[int]:
temp = [a,b,c]
temp.sort()
d1, d2 = temp[1] - temp[0], temp[2] - temp[1]
if d1 == 1 and d2 == 1:
return [0, 0]
elif d1 == 1 or d2 == 1:
return [1, max(d1, d2)-1]
elif d1 == 2 and d2 == 2:
return [1, 2]
elif d1 == 2 or d2 == 2:
return [1, d1+d2-2]
else:
return [2, d1+d2-2]
|
class EmptyLayerError(Exception):
"""
Represent empty layers accessing.
"""
def __init__(self, message="Unable to access empty layers."):
super(EmptyLayerError, self).__init__(message)
|
class Solution:
def longestCommonPrefix(self, strs) -> str:
if(not strs or len(strs) == 0):
return ''
res = strs[0]
for i in range(len(strs)):
fi = 0
se = 0
while(fi < len(res) and se < len(strs[i]) and res[fi] == strs[i][se]):
fi += 1
se += 1
if(fi < se):
res = res[0: fi]
else:
res = strs[i][0:se]
return res
# https://www.runoob.com/python/python-func-zip.html
# zip函数使用方法
# 对于 ["dog","race","car"] 数组,调用zip方法后如下
# [('d', 'r', 'c'), ('o', 'a'), ('g', 'c', 'r'), ('e')]
#
def longestCommonPrefix_(self, strs):
"""
:type strs: List[str]; rtype: str
"""
sz, ret = zip(*strs), ""
# looping corrected based on @StefanPochmann's comment below
for c in sz:
if len(set(c)) > 1: break
ret += c[0]
return ret
|
class GST_Company():
def __init__(self, gstno, rate,pos,st):
self.GSTNO = gstno
self.RATE = rate
self.POS=pos
self.ST=st
self.__taxable = 0.00
self.__cgst = 0.00
self.__sgst = 0.00
self.__igst = 0.00
self.__cess = 0
self.__total = 0.00
def updata_invoice(self, taxable, cgst, sgst, igst,cess):
self.__taxable += taxable
self.__cgst += cgst
self.__sgst += sgst
self.__igst += igst
self.__cess+= cess
self.__total += (taxable + cgst + sgst + igst + cess)
def generate_output(self):
return [
self.GSTNO, self.POS,self.ST,self.__taxable, self.RATE, self.__igst, self.__cgst, self.__sgst,self.__cess,
self.__total
]
def test(self):
return self.__taxable
@classmethod
def from_dict(cls,df_dict):
return cls(df_dict['GSTNO'],df_dict['RATE'],df_dict['POS'],df_dict['ST'])
|
"""Results gathered from tests.
Copyright (c) 2019 Red Hat Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
class Results():
"""Class representing results gathered from tests."""
def __init__(self):
"""Prepare empty result structure."""
self.tests = []
|
parameters = {
# Add entry for each state variable to check; number is tolerance
"alpha": 0.0,
"b": 0.0,
"d1c": 0.0,
"d1t": 0.0,
"d2": 0.0,
"fb1": 0.0,
"fb2": 0.0,
"fb3": 0.0,
"nstatev": 0,
"phi0_12": 0.0,
}
|
class Stack:
def __init__(self):
self.queue = []
def enqueue(self, element):
self.queue
# [3,2,1]
def dequeue(self):
queue_helper = []
while len(self.queue) != 1:
x = self.queue.pop()
queue_helper.append(x)
temp = self.queue.pop()
while queue_helper:
x = queue_helper.pop()
self.queue.append(x)
return temp
stack = Stack()
stack.enqueue(1)
stack.enqueue(2)
stack.enqueue(3)
print(stack.dequeue())
|
class SRTError(Exception):
def __init__(self, msg):
self.msg = msg
def __str__(self):
return self.msg
class SRTLoginError(SRTError):
def __init__(self, msg="Login failed, please check ID/PW"):
super().__init__(msg)
class SRTResponseError(SRTError):
def __init__(self, msg):
super().__init__(msg)
class SRTDuplicateError(SRTResponseError):
def __init__(self, msg):
super().__init__(msg)
class SRTNotLoggedInError(SRTError):
def __init__(self):
super().__init__("Not logged in")
|
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
#
version_info = (0, 15, 0)
__version__ = '%s.%s.%s' % (version_info[0], version_info[1], version_info[2])
EXTENSION_VERSION = '^0.15.0'
|
"""File Handling."""
# my_file = open('data.txt', 'r')
"""
with open('data.txt', 'r') as data:
print(f'File name: {data.name}')
# for text_line in data.readlines():
# print(text_line, end='')
for line in data:
print(line, end='')
"""
"""
lines = ["This is line 1", "This is line 2", "This is line 3", "This is line 4"]
with open('data.txt', 'w') as data:
for line in lines:
data.write(line)
data.write('\n')
"""
lines = ["This is line 5", "This is line 6", "This is line 3", "This is line 7"]
with open('data.txt', 'r') as data:
data_as_list = data.readlines()
data_as_list.insert(1, "This is between line 1 and 2\n")
with open('data.txt', 'w') as data:
data_as_str = "".join(data_as_list)
data.write(data_as_str)
with open('data.txt', 'a') as data:
for line in lines:
data.write(line)
data.write('\n')
"""
Text file's modes:
w - Write
r - Read
a - Append
r+ - Read Write
x - Creation Mode
Binary file's modes:
wb - Write
rb - Read
ab - Append
rb+ - Read Write
"""
|
depositoI = int(input("Insira o valor do depósito inicial: "))
juros = int(input("Qual a taxa de juros? (ex 2.11%): "))
montanteAtual = depositoI
for x in range(25):
print("No mês: " + str(x) + ", o total acumulado é de: " + str("%.2f" % montanteAtual) + ". E o lucro com juros: " + str("%.2f" % (montanteAtual - depositoI)))
montanteAtual += montanteAtual * (juros / 100)
|
#!/usr/bin/env python
log_dir = os.environ['LOG_DIR']
admin_server_listen_address = os.environ['ADMIN_SERVER_LISTEN_ADDRESS']
admin_server_listen_port = os.environ['ADMIN_SERVER_LISTEN_PORT']
admin_username = os.environ['ADMIN_USERNAME']
admin_password = os.environ['ADMIN_PASSWORD']
managed_server_name = os.environ['MANAGED_SERVER_NAME']
######################################################################
def set_server_access_log_config(_log_dir, _server_name):
cd('/Servers/' + _server_name + '/WebServer/' + _server_name + '/WebServerLog/' + _server_name)
cmo.setLoggingEnabled(True)
cmo.setFileName(_log_dir + '/' + _server_name + '/' +
'access.' + _server_name + '.%%yyyy%%%%MM%%%%dd%%_%%HH%%%%mm%%%%ss%%.log')
# cmo.setFileName('/dev/null')
cmo.setRotationType('byTime')
cmo.setRotationTime('00:00')
cmo.setFileTimeSpan(24)
cmo.setNumberOfFilesLimited(True)
cmo.setFileCount(30)
cmo.setRotateLogOnStartup(False)
cmo.setLogFileFormat('common')
# cmo.setLogFileFormat('extended')
cmo.setELFFields('date time cs-method cs-uri sc-status')
cmo.setBufferSizeKB(0)
cmo.setLogTimeInGMT(False)
######################################################################
admin_server_url = 't3://' + admin_server_listen_address + ':' + admin_server_listen_port
connect(admin_username, admin_password, admin_server_url)
edit()
startEdit()
domain_version = cmo.getDomainVersion()
set_server_access_log_config(log_dir, managed_server_name)
save()
activate()
exit()
|
test = {
'name': 'scheme-def',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> (def f(x y) (+ x y))
f
scm> (f 2 3)
5
scm> (f 10 20)
30
""",
'hidden': False,
'locked': False
},
{
'code': r"""
scm> (def factorial(x) (if (zero? x) 1 (* x (factorial (- x 1)))))
factorial
scm> (factorial 4)
24
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': r"""
scm> (load-all ".")
""",
'teardown': '',
'type': 'scheme'
}
]
}
|
# -*- coding: utf-8 -*-
def env_comment(env,comment=''):
if env.get('fwuser_info') and not env['fwuser_info'].get('lock'):
env['fwuser_info']['comment'] = comment
env['fwuser_info']['lock'] = True
|
balance = 320000
annualInterestRate = 0.2
monthlyInterestRate = (annualInterestRate) / 12
epsilon = 0.01
lowerBound = balance / 12
upperBound = (balance * (1 + monthlyInterestRate)**12) / 12
ans = (upperBound + lowerBound)/2.0
newBalance = balance
while abs(0 - newBalance) >= epsilon:
newBalance = balance
for i in range(0, 12):
newBalance = round(((newBalance - ans) * (1 + monthlyInterestRate)), 2)
if newBalance >= 0:
lowerBound = ans
else:
upperBound = ans
ans = (upperBound + lowerBound)/2.0
print("Lowest Payment: " + str(round(ans, 2)))
|
# DO NOT LOAD THIS FILE. Targets from this file should be considered private
# and not used outside of the @envoy//bazel package.
load(":envoy_select.bzl", "envoy_select_google_grpc", "envoy_select_hot_restart")
# Compute the final copts based on various options.
def envoy_copts(repository, test = False):
posix_options = [
"-Wall",
"-Wextra",
"-Werror",
"-Wnon-virtual-dtor",
"-Woverloaded-virtual",
"-Wold-style-cast",
"-Wvla",
"-std=c++14",
]
# Windows options for cleanest service compilation;
# General MSVC C++ options
# Streamline windows.h behavior for Win8+ API (for ntohll, see;
# https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx )
# Minimize Win32 API, dropping GUI-oriented features
msvc_options = [
"-WX",
"-Zc:__cplusplus",
"-std:c++14",
"-DWIN32",
"-D_WIN32_WINNT=0x0602",
"-DNTDDI_VERSION=0x06020000",
"-DWIN32_LEAN_AND_MEAN",
"-DNOUSER",
"-DNOMCX",
"-DNOIME",
]
return select({
repository + "//bazel:windows_x86_64": msvc_options,
"//conditions:default": posix_options,
}) + select({
# Bazel adds an implicit -DNDEBUG for opt.
repository + "//bazel:opt_build": [] if test else ["-ggdb3"],
repository + "//bazel:fastbuild_build": [],
repository + "//bazel:dbg_build": ["-ggdb3"],
repository + "//bazel:windows_opt_build": [],
repository + "//bazel:windows_fastbuild_build": [],
repository + "//bazel:windows_dbg_build": [],
}) + select({
repository + "//bazel:clang_build": ["-fno-limit-debug-info", "-Wgnu-conditional-omitted-operand"],
repository + "//bazel:gcc_build": ["-Wno-maybe-uninitialized"],
"//conditions:default": [],
}) + select({
repository + "//bazel:disable_tcmalloc": ["-DABSL_MALLOC_HOOK_MMAP_DISABLE"],
"//conditions:default": ["-DTCMALLOC"],
}) + select({
repository + "//bazel:debug_tcmalloc": ["-DENVOY_MEMORY_DEBUG_ENABLED=1"],
"//conditions:default": [],
}) + select({
repository + "//bazel:disable_signal_trace": [],
"//conditions:default": ["-DENVOY_HANDLE_SIGNALS"],
}) + select({
repository + "//bazel:disable_object_dump_on_signal_trace": [],
"//conditions:default": ["-DENVOY_OBJECT_TRACE_ON_DUMP"],
}) + select({
repository + "//bazel:disable_deprecated_features": ["-DENVOY_DISABLE_DEPRECATED_FEATURES"],
"//conditions:default": [],
}) + select({
repository + "//bazel:enable_log_debug_assert_in_release": ["-DENVOY_LOG_DEBUG_ASSERT_IN_RELEASE"],
"//conditions:default": [],
}) + select({
# APPLE_USE_RFC_3542 is needed to support IPV6_PKTINFO in MAC OS.
repository + "//bazel:apple": ["-D__APPLE_USE_RFC_3542"],
"//conditions:default": [],
}) + envoy_select_hot_restart(["-DENVOY_HOT_RESTART"], repository) + \
_envoy_select_perf_annotation(["-DENVOY_PERF_ANNOTATION"]) + \
envoy_select_google_grpc(["-DENVOY_GOOGLE_GRPC"], repository) + \
_envoy_select_path_normalization_by_default(["-DENVOY_NORMALIZE_PATH_BY_DEFAULT"], repository)
# References to Envoy external dependencies should be wrapped with this function.
def envoy_external_dep_path(dep):
return "//external:%s" % dep
def envoy_linkstatic():
return select({
"@envoy//bazel:dynamic_link_tests": 0,
"//conditions:default": 1,
})
def envoy_select_force_libcpp(if_libcpp, default = None):
return select({
"@envoy//bazel:force_libcpp": if_libcpp,
"@envoy//bazel:apple": [],
"@envoy//bazel:windows_x86_64": [],
"//conditions:default": default or [],
})
def envoy_stdlib_deps():
return select({
"@envoy//bazel:asan_build": ["@envoy//bazel:dynamic_stdlib"],
"@envoy//bazel:tsan_build": ["@envoy//bazel:dynamic_stdlib"],
"//conditions:default": ["@envoy//bazel:static_stdlib"],
})
# Dependencies on tcmalloc_and_profiler should be wrapped with this function.
def tcmalloc_external_dep(repository):
return select({
repository + "//bazel:disable_tcmalloc": None,
"//conditions:default": envoy_external_dep_path("gperftools"),
})
# Select the given values if default path normalization is on in the current build.
def _envoy_select_path_normalization_by_default(xs, repository = ""):
return select({
repository + "//bazel:enable_path_normalization_by_default": xs,
"//conditions:default": [],
})
def _envoy_select_perf_annotation(xs):
return select({
"@envoy//bazel:enable_perf_annotation": xs,
"//conditions:default": [],
})
|
class lazy_property(object):
"""
meant to be used for lazy evaluation of an object attribute.
property should represent non-mutable data, as it replaces itself.
From: http://stackoverflow.com/a/6849299
"""
def __init__(self, fget):
self.fget = fget
self.func_name = fget.__name__
def __get__(self, obj, cls):
if obj is None:
return None
value = self.fget(obj)
setattr(obj,self.func_name,value)
return value
|
#!/usr/bin/env python
# encoding: utf-8
def run(whatweb, pluginname):
whatweb.recog_from_header(pluginname, "django")
|
class AverageMeter:
"""
Class to be an average meter for any average metric like loss, accuracy, etc..
"""
def __init__(self):
self.value = 0
self.avg = 0
self.sum = 0
self.count = 0
self.reset()
def reset(self):
self.value = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=1):
self.value = val
self.sum += val * n
self.count += n
self.avg = self.sum / self.count
@property
def val(self):
return self.avg
|
class Solution:
def checkString(self, s: str) -> bool:
a_indices = [i for i, x in enumerate(s) if x=='a']
try:
if a_indices[-1] > s.index('b'):
return False
except:
pass
return True
|
"""
99 / 99 test cases passed.
Runtime: 32 ms
Memory Usage: 14.8 MB
"""
class Solution:
def toGoatLatin(self, sentence: str) -> str:
vowel = ['a', 'e', 'i', 'o', 'u']
ans = []
for i, word in enumerate(sentence.split()):
if word[0].lower() in vowel:
ans.append(word + 'ma' + 'a' * (i + 1))
else:
ans.append(word[1:] + word[0] + 'ma' + 'a' * (i + 1))
return ' '.join(ans)
|
# -*- coding: utf-8 -*-
"""
Histogram Entities.
@author Hao Song ([email protected])
"""
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#Author:Winston.Wang
print('--------------------继承----------------------')
#定义一个Aniaml类
class Animal(object):
def run(self):
print('Animal 动物类')
#定义Dog类继承自Animal
class Dog(Animal):
def run(self):
print('Dog run.....')
#定义Cat类
class Cat(Animal):
def run(self):
print('Cat run......')
def runAnimal(animal):
animal.run();
if __name__=='__main__':
#使用多态
runAnimal(Dog())
dog = Dog()
# True
print(isinstance(dog,Animal))
#False,animal不是一种狗
print(isinstance(Animal(),Dog))
|
class Solution(object):
def rotate(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: None Do not return anything, modify matrix in-place instead.
"""
# Transpose
for i in range(len(matrix)):
for j in range(i+1,len(matrix)):
matrix[j][i],matrix[i][j] = matrix[i][j],matrix[j][i]
# Flip
for i in range(len(matrix)):
matrix[i].reverse()
|
# [Job Adv] (Lv.30) Way of the Bandit
darkMarble = 4031013
job = "Night Lord"
sm.setSpeakerID(1052001)
if sm.hasItem(darkMarble, 30):
sm.sendNext("I am impressed, you surpassed the test. Only few are talented enough.\r\n"
"You have proven yourself to be worthy, I shall mold your body into a #b"+ job +"#k.")
else:
sm.sendSayOkay("You have not retrieved the #t"+ darkMarble+"#s yet, I will be waiting.")
sm.dispose()
sm.consumeItem(darkMarble, 30)
sm.completeQuestNoRewards(parentID)
sm.jobAdvance(420) # Bandit
sm.sendNext("You are now a #b"+ job +"#k.")
sm.dispose()
|
# -*- coding: utf-8 -*-
"""
db_normalizer.csv_handler
-----------------------------
Folder for the CSV toolbox.
:authors: Bouillon Pierre, Cesari Alexandre.
:licence: MIT, see LICENSE for more details.
"""
|
INDEX_HEADER_SIZE = 16
INDEX_RECORD_SIZE = 41
META_HEADER_SIZE = 32
kMinMetadataRead = 1024
kChunkSize = 256 * 1024
kMaxElementsSize = 64 * 1024
kAlignSize = 4096
|
#!/usr/bin python
dec1 = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
enc1 = "EICTDGYIYZKTHNSIRFXYCPFUEOCKRNEICTDGYIYZKTHNSIRFXYCPFUEOCKRNEI"
dec2 = "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
enc2 = "FJDUEHZJZALUIOTJSGYZDQGVFPDLSOFJDUEHZJZALUIOTJSG"
with open("krypton7", 'r') as handle:
flag = handle.read()
#key1 = "".join([chr(ord(dec1[i]) ^ ord(enc1[i])) for i in range(len(dec1))])
key1 = [ord(dec1[i]) - ord(enc1[i]) % 26 for i in range(len(dec1))]
#decrypted = "".join([chr(ord(flag[i]) ^ ord(key[i])) for i in range(len(flag))])
decrypted = "".join([chr(((ord(flag[i]) - ord('A') + key1[i]) % 26) + ord('A')) for i in range(len(flag))])
print(decrypted)
|
# -*- coding: utf-8 -*-
class IRI:
MAINNET_COORDINATOR = ''
|
MAX_FACTOR = 20 # avoid weirdness with python's arbitary integer precision
MAX_WAIT = 60 * 60 # 1 hour
class Backoff():
def __init__(self, initial=None, base=2, exp=2, max=MAX_WAIT, attempts=None):
self._attempts = attempts
self._initial = initial
self._start = base
self._max = max
self._exp = exp
self._counter = 0
def reset(self):
self._counter = 0
def peek(self):
exp = self._counter - 1
if self._counter == 1 and self._initial is not None:
return self._initial
elif self._initial is not None:
exp -= 1
exp = min(exp, MAX_FACTOR)
computed = self._start * pow(self._exp, exp)
if self._max:
computed = min(self._max, computed)
return computed
def backoff(self, error):
if self._attempts and self._counter >= self._attempts:
raise error
self._counter += 1
return self.peek()
|
def main():
decimal = str(input())
number = float(decimal)
last = int(decimal[-1])
if last == 7:
number += 0.02
elif last % 2 == 1:
number -= 0.09
elif last > 7:
number -= 4
elif last < 4:
number += 6.78
print(f"{number:.2f}")
if __name__ == "__main__":
main()
|
#
# オセロ(リバーシ) 6x6
#
N = 6 # 大きさ
EMPTY = 0 # 空
BLACK = 1 # 黒
WHITE = 2 # 白
STONE = ['□', '●', '○'] #石の文字
#
# board = [0] * (N*N)
#
def xy(p): # 1次元から2次元へ
return p % N, p // N
def p(x, y): # 2次元から1次元へ
return x + y * N
# リバーシの初期画面を生成する
def init_board():
board = [EMPTY] * (N*N)
c = N//2
board[p(c, c)] = BLACK
board[p(c-1, c-1)] = BLACK
board[p(c, c-1)] = WHITE
board[p(c-1, c)] = WHITE
return board
# リバーシの画面を表示する
def show_board(board):
counts = [0, 0, 0]
for y in range(N):
for x in range(N):
stone = board[p(x, y)]
counts[stone] += 1
print(STONE[stone], end='')
print()
print()
for pair in zip(STONE, counts):
print(pair, end=' ')
print()
# (x,y) が盤面上か判定する
def on_borad(x, y):
return 0 <= x < N and 0 <= y < N
# (x,y)から(dx,dy)方向をみて反転できるか調べる
def try_reverse(board, x, y, dx, dy, color):
if not on_borad(x, y) or board[p(x, y)] == EMPTY:
return False
if board[p(x, y)] == color:
return True
if try_reverse(board, x+dx, y+dy, dx, dy, color):
board[p(x, y)] = color
return True
return False
# 相手(反対)の色を返す
def opposite(color):
if color == BLACK:
return WHITE
return BLACK
# (x,y) が相手(反対)の色かどうか判定
def is_oposite(board, x, y, color):
return on_borad(x, y) and board[p(x, y)] == opposite(color)
DIR = [
(-1, -1), (0, -1), (1, -1),
(-1, 0), (1, 0),
(-1, 1), (0, 1), (1, 1),
]
def put_and_reverse(board, position, color):
if board[position] != EMPTY:
return False
board[position] = color
x, y = xy(position)
turned = False
for dx, dy in DIR:
nx = x + dx
ny = y + dy
if is_oposite(board, nx, ny, color):
if try_reverse(board, nx, ny, dx, dy, color):
turned = True
if not turned:
board[position] = EMPTY
return turned
# プレイが継続できるか?
# つまり、まだ石を置けるところが残っているか調べる?
def can_play(board, color):
board = board[:] # コピーしてボードを変更しないようにする
for position in range(0, N*N):
if put_and_reverse(board, position, color):
return True
return False
def game(player1, player2):
board = init_board()
show_board(board)
on_gaming = True # ゲームが続行できるか?
while on_gaming:
on_gaming = False # いったん、ゲーム終了にする
if can_play(board, BLACK):
# player1 に黒を置かせる
position = player1(board[:], BLACK)
show_board(board)
# 黒が正しく置けたら、ゲーム続行
on_gaming = put_and_reverse(board, position, BLACK)
if can_play(board, WHITE):
# player1 に白を置かせる
position = player2(board[:], WHITE)
show_board(board)
# 白が置けたらゲーム続行
on_gaming = put_and_reverse(board, position, WHITE)
show_board(board) # 最後の結果を表示!
# AI 用のインターフェース
##寒色優先(青、水色、白、ピンク、赤)
YUSEN2=[0,5,30,35,2,3,17,23,12,18,32,33,9,16,8,15,22,14,21,13,20,27,19,26,4,11,1,29,6,34,24,31,10,7,28,25]
def my_AI2(board, color): #おチビちゃんAI
for i in range(N*N):
position =YUSEN2[i]
if put_and_reverse(board, position, color):
return position
return 0
#YUSEN=[0,5,30,35,2,3,12,17,18,23,32,33,8,9,13,14,15,16,19,20,21,22,26,27,1,4,6,11,24,29,31,34,7,10,25,28]
#def my_AI(board, color): #おチビちゃんAI
#for i in range(N*N):
#position =YUSEN[i]
#if put_and_reverse(board, position, color):
#return position
#return 0
#STONE = ['🟩', '⚫', '⚪']
#board = init_board()
#show_board(board)
#def user(board, color):
#for _ in range(10):
#position = int(input(STONE[color]+'をどこに置きますか?'))
# おけるかどうか確認する
#if put_and_reverse(board[:], position, color):
#return position ## おく位置を決めて返す
#print('そこには置けません!')
#return 0 #
#import random
#def random_AI(board, color):
#for _ in range(100):
#position = random.randint(0, N*N-1)
#if put_and_reverse(board[:], position, color):
#return position ## おく位置を決めて返す
#return 0
#game(my_AI2,random_AI)
|
print("Hi, I'm a module!")
raise Exception(
"This module-level exception should also not occur during freeze"
)
|
GENCONF_DIR = 'genconf'
CONFIG_PATH = GENCONF_DIR + '/config.yaml'
SSH_KEY_PATH = GENCONF_DIR + '/ssh_key'
IP_DETECT_PATH = GENCONF_DIR + '/ip-detect'
CLUSTER_PACKAGES_PATH = GENCONF_DIR + '/cluster_packages.json'
SERVE_DIR = GENCONF_DIR + '/serve'
STATE_DIR = GENCONF_DIR + '/state'
BOOTSTRAP_DIR = SERVE_DIR + '/bootstrap'
PACKAGE_LIST_DIR = SERVE_DIR + '/package_lists'
ARTIFACT_DIR = 'artifacts'
CHECK_RUNNER_CMD = '/opt/mesosphere/bin/dcos-diagnostics check'
|
class Solution:
def isStrobogrammatic(self, num: str) -> bool:
rotated = ['0', '1', 'x', 'x', 'x',
'x', '9', 'x', '8', '6']
l = 0
r = len(num) - 1
while l <= r:
if num[l] != rotated[ord(num[r]) - ord('0')]:
return False
l += 1
r -= 1
return True
|
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 1 16:43:37 2022
@author: LENOVO
"""
list = []
n = 1 #valores del 1 al 100
while n <= 100: #bucle de numeros de 1 al 100
c = 1 # div
x = 0 #contador div
while c <= n:
if n % c == 0:
x = x + 1
c = c + 1
if x == 2:
list.append(n)
n = n + 1 # incrmeneto valor
print(" los numeros primos del 1 al 100 son :",list)
|
# -*- coding: utf-8 -*-
"""
Copyright (c) 2016, René Tanczos <[email protected]> (Twitter @gravmatt)
The MIT License (MIT)
Class to create dynamic objects.
Project on github https://github.com/gravmatt/py-dynamic
"""
__author__ = 'Rene Tanczos'
__version__ = '0.1'
__license__ = 'MIT'
class Dynamic:
def __init__(self, strict=True):
self.__dict__['__strict'] = strict
self.me = 'rene'
def __getattr__(self, name):
if(name in self.__dict__):
return self.__dict__[name]
else:
if(self.__dict__['__strict']):
raise AttributeError('Property \'%s\' not found' % name)
else:
return None
def __setattr__(self, name, value):
self.__dict__[name] = value
def __delattr__(self, name):
if(name in self.__dict__):
del self.__dict__[name]
else:
if(self.__dict__['__strict']):
raise AttributeError('Property \'%s\' not found' % name)
|
"""
برای درست کردن مدل ها در جنگو داریم
1=داخل هر app فایل models.py را باز میکنیم
models.py
2= و یک کلاس را بسازیم که از کلاس
models.Model ارث بری میکند
class topic(model,Model):
topic_name=models.CharFeild( max_length = 264 , unique = True )
3= معمولن همه ی کلاس ها به شکل استرینگ نوع پرینتشان را تعیین میکنیم
def __str__(self):
return self.topic_name
یا str(self.topic_name) اگر عدد بود
4= بعد از اینکه مدل ها رو ساختیم
python manage.py migrate
اولین بار چندتا ok ok میده
5= بعدا python manage.py makemigrations esme_appi_ke_kar_mikonim
تا migration ها رو بسازه
6= و در نهایت دوباره
python manage.py migrate
7= حالا مدل ها ساخته شدند و به دیتا بیس لینک شدند احتمالا
و حالا میتوانیم با shell وار د آنها شویم و آنها را پر کنیم
"""
# SHELL IN PYTHON WOW LIKE IT
"""
SHELL IN PYTHON WOW LIKE IT
# بعد از ساختن مدل ها برای بازی کردن با آنها باید از شل استفاده کنیم
1= python manage.py shell
شل اینتراکتیو پایتون رو برامون باز میکنه
2= from esm_app_ma.models import folan_model
3= print( folan_class_model.objects.all() )
برای دیدن تمام اینستس ها ی ساخته شده از اون کلاس
این فقط برای کلاس های جنگو هست نه برای کلاس های دیگه
چون درواقع یه کوعری به دیتا بیس هست
و در جوابش هم میاد
<QuerySet [<Topic: social_network>]>
4= t = Topic(topic_name='social_ network')
برای اینکه یک اینستنس ساخته بشه با یک شکل اصلی
دقت کنیم که برای تایپ کلاس نباید از
t = Topic('social_network')
استفاده کنیم چون اولین اتریبیوت در کلاس های ارث برده شده
برای ما نیست پس باید تعریف کنیم که کدام کلاس اتریب را نام بردیم
t = Topic(topic_name='social_ network')
"""
# now the admin panel
"""
and now THE ADMIN PANNEL
برای اینکه هردفعه از شل استفاده نکنیم از ادمین خود سایت برای جنگو استفاده
میکنیم
برای اینکار باید همه ی مدل ها رو توی فایل ائمین اپ
رجیستر کنیم
1 = داخل فایل ادمین آن اپلیکیشن میشویم
2 = مدل ها را ایپورت میکنیم
from my_app.models import model_hayi , ke_sakhtim
3 = آنها را رجیستر میکنیم
admin.site.register(avali)
admin.site.register(dovomi)
دونه به دونه باید رجیستر بشن
نه توی یه خط
5 = برای اینکه هر کسی نتونه بره از این دیتا استفاده کنه
یک ادمین میسازیم
حد اقل باید یدونه بسازیم تا بعدا بریم از توی خود ادمین بعدا
کاربرهای مختلفی بسازیم
6 = python manage.py createsuperuser
و بعد موارد خواسته شده را پر میکنیم همشو
7 = بعد از پر کردن همه ی موارد مینویسه که
Superuser created successfully.
8 = حالا برای استفاده از ادمین باید به پیج ادمین بریم
باید runserver کنیم
"""
# ==================================================================
"""
استفاده از faker
با اینکه استفاده از ادمین پنل خیلی راحت تر از شل بود
اما برای دیتا های خیلی زیاد بهتره از اسکریپت استفاده کنیم تادیتا
در سایت خود دیتا پاپیولیت کنیم
پس لایبری faker را نصب میکنیم
1 = pip install Faker
داکیومنت خود فیکر را میشه دید تا نحوه ی استفاده شو دید
"""
# =================================================================
"""
MODELS TEMPLATES VIEWS
چطوری مشه که همه ی چیز های دیتا بیس رو نشون داد
با وصل کردن مدل ها به ویو ها و وصل کردن همشون به تمپلیت ها
1 = اول مدل ها رو در ویو ها ایمپورت میکنیم
from folan_app.models import yeki,dota,seta
2= سپس همه ی آبجکت ها رو لیست یا توپل یا چیز باحال میکنیم
LIZT = sevomi.objects.order_by('date'# یا هر پارامتری شاید)
my_context = { 'inset_list' : LIZT }
3= بعدن در آن تمپلیت حلقه مینویسیم
{% if insert_list %}
<table>
<thead>
<th>yek</th><th>du</th>
</thead>
<tbody>
{% for acc in inser_list %}
<tr>
<td>
{{ insert_list.date }}
</td>
<td>
{{ insert_list.name }}
</td>
</tr>
{% endfor %}
</tbody>
{% else %}
<p>NO THING TO SHOW</P>
</table>
{% endif %}
"""
|
# coding: utf-8
COLORS = {
'green': '\033[22;32m',
'boldblue': '\033[01;34m',
'purple': '\033[22;35m',
'red': '\033[22;31m',
'boldred': '\033[01;31m',
'normal': '\033[0;0m'
}
class Logger:
def __init__(self):
self.verbose = False
@staticmethod
def _print_msg(msg: str, color: str=None):
if color is None or color not in COLORS:
print(msg)
else:
print('{colorcode}{msg}\033[0;0m'.format(colorcode=COLORS[color], msg=msg))
def debug(self, msg: str):
if self.verbose:
msg = '[DD] {}'.format(msg)
self._print_msg(msg, 'normal')
def info(self, msg: str):
msg = '[II] {}'.format(msg)
self._print_msg(msg, 'green')
def warning(self, msg: str):
msg = '[WW] {}'.format(msg)
self._print_msg(msg, 'red')
def error(self, msg: str, exitcode: int=255):
msg = '[EE] {}'.format(msg)
self._print_msg(msg, 'boldred')
exit(exitcode)
@staticmethod
def ask(msg: str):
msg = '[??] {}'.format(msg)
question = '{colorcode}{msg} : \033[0;0m'.format(colorcode=COLORS['boldblue'], msg=msg)
answer = input(question)
return answer.strip()
def ask_yesno(self, msg: str, default: str=None):
valid_answers = {
'y': True, 'yes': True,
'n': False, 'no': False
}
if (default is None) or (default.lower() not in valid_answers):
default = ''
else:
default = default.lower()
question = '{} (y/n)'.replace(default, default.upper()).format(msg)
answer = self.ask(question).lower()
if answer == '':
answer = default
while answer not in valid_answers:
answer = self.ask(question).lower()
return valid_answers[answer]
logger = Logger()
|
#
# PySNMP MIB module INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:44:05 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
iso, IpAddress, Unsigned32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32, ObjectIdentity, MibIdentifier, Gauge32, Integer32, NotificationType, ModuleIdentity, enterprises, TimeTicks, Bits, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "IpAddress", "Unsigned32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32", "ObjectIdentity", "MibIdentifier", "Gauge32", "Integer32", "NotificationType", "ModuleIdentity", "enterprises", "TimeTicks", "Bits", "Counter64")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
class DmiInteger(Integer32):
pass
class DmiDisplaystring(DisplayString):
pass
class DmiDateX(OctetString):
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(28, 28)
fixedLength = 28
class DmiComponentIndex(Integer32):
pass
intel = MibIdentifier((1, 3, 6, 1, 4, 1, 343))
products = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2))
server_products = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 6)).setLabel("server-products")
dmtfGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 6, 7))
tNameTable = MibTable((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 5), )
if mibBuilder.loadTexts: tNameTable.setStatus('mandatory')
eNameTable = MibTableRow((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 5, 1), ).setIndexNames((0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "DmiComponentIndex"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a2MifId"))
if mibBuilder.loadTexts: eNameTable.setStatus('mandatory')
a2MifId = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 5, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 99))).clone(namedValues=NamedValues(("vUnknown", 0), ("vBaseboard", 1), ("vAdaptecScsi", 2), ("vMylexRaid", 3), ("vNic", 4), ("vUps", 5), ("vSymbiosSdms", 6), ("vAmiRaid", 7), ("vMylexGamRaid", 8), ("vAdaptecCioScsi", 9), ("vSymbiosScsi", 10), ("vIntelNic", 11), ("vTestmif", 99)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2MifId.setStatus('mandatory')
a2ComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 5, 1, 2), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2ComponentName.setStatus('mandatory')
tActionsTable = MibTable((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6), )
if mibBuilder.loadTexts: tActionsTable.setStatus('mandatory')
eActionsTable = MibTableRow((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1), ).setIndexNames((0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "DmiComponentIndex"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a4RelatedMif"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a4Group"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a4Instance"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a4Attribute"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a4Value"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a4Severity"))
if mibBuilder.loadTexts: eActionsTable.setStatus('mandatory')
a4RelatedMif = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 99))).clone(namedValues=NamedValues(("vUnknown", 0), ("vBaseboard", 1), ("vAdaptecScsi", 2), ("vMylexRaid", 3), ("vNic", 4), ("vUps", 5), ("vSymbiosSdms", 6), ("vAmiRaid", 7), ("vMylexGamRaid", 8), ("vAdaptecCioScsi", 9), ("vSymbiosScsi", 10), ("vIntelNic", 11), ("vTestmif", 99)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4RelatedMif.setStatus('mandatory')
a4Group = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 2), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4Group.setStatus('mandatory')
a4Instance = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 3), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4Instance.setStatus('mandatory')
a4Attribute = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 4), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4Attribute.setStatus('mandatory')
a4Value = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 5), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4Value.setStatus('mandatory')
a4Severity = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 6), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4Severity.setStatus('mandatory')
a4BeepSpeaker = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 7), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a4BeepSpeaker.setStatus('mandatory')
a4DisplayAlertMessageOnConsole = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 8), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a4DisplayAlertMessageOnConsole.setStatus('mandatory')
a4LogToDisk = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 9), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a4LogToDisk.setStatus('mandatory')
a4WriteToLcd = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 10), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a4WriteToLcd.setStatus('mandatory')
a4ShutdownTheOs = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 11), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a4ShutdownTheOs.setStatus('mandatory')
a4ShutdownAndPowerOffTheSystem = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 12), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a4ShutdownAndPowerOffTheSystem.setStatus('mandatory')
a4ShutdownAndResetTheSystem = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 13), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a4ShutdownAndResetTheSystem.setStatus('mandatory')
a4ImmediatePowerOff = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 14), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a4ImmediatePowerOff.setStatus('mandatory')
a4ImmediateReset = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 15), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a4ImmediateReset.setStatus('mandatory')
a4BroadcastMessageOnNetwork = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 16), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a4BroadcastMessageOnNetwork.setStatus('mandatory')
a4AmsAlertName = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 17), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4AmsAlertName.setStatus('mandatory')
a4Enabled = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 6, 1, 30), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a4Enabled.setStatus('mandatory')
tActionsTableForStandardIndications = MibTable((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7), )
if mibBuilder.loadTexts: tActionsTableForStandardIndications.setStatus('mandatory')
eActionsTableForStandardIndications = MibTableRow((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1), ).setIndexNames((0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "DmiComponentIndex"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a10RelatedMif"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a10EventGenerationGroup"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a10EventType"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a10Instance"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a10Reserved"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a10Severity"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a10EventSystem"), (0, "INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", "a10EventSub-system"))
if mibBuilder.loadTexts: eActionsTableForStandardIndications.setStatus('mandatory')
a10RelatedMif = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 99))).clone(namedValues=NamedValues(("vUnknown", 0), ("vBaseboard", 1), ("vAdaptecScsi", 2), ("vMylexRaid", 3), ("vNic", 4), ("vUps", 5), ("vSymbiosSdms", 6), ("vAmiRaid", 7), ("vMylexGamRaid", 8), ("vAdaptecCioScsi", 9), ("vSymbiosScsi", 10), ("vIntelNic", 11), ("vTestmif", 99)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: a10RelatedMif.setStatus('mandatory')
a10EventGenerationGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 2), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a10EventGenerationGroup.setStatus('mandatory')
a10EventType = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 3), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a10EventType.setStatus('mandatory')
a10Instance = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 4), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a10Instance.setStatus('mandatory')
a10Reserved = MibScalar((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 5), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a10Reserved.setStatus('mandatory')
a10Severity = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 6), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a10Severity.setStatus('mandatory')
a10BeepSpeaker = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 7), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10BeepSpeaker.setStatus('mandatory')
a10DisplayAlertMessageOnConsole = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 8), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10DisplayAlertMessageOnConsole.setStatus('mandatory')
a10LogToDisk = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 9), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10LogToDisk.setStatus('mandatory')
a10WriteToLcd = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 10), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10WriteToLcd.setStatus('mandatory')
a10ShutdownTheOs = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 11), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10ShutdownTheOs.setStatus('mandatory')
a10ShutdownAndPowerOffTheSystem = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 12), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10ShutdownAndPowerOffTheSystem.setStatus('mandatory')
a10ShutdownAndResetTheSystem = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 13), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10ShutdownAndResetTheSystem.setStatus('mandatory')
a10ImmediatePowerOff = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 14), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10ImmediatePowerOff.setStatus('mandatory')
a10ImmediateReset = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 15), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10ImmediateReset.setStatus('mandatory')
a10BroadcastMessageOnNetwork = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 16), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10BroadcastMessageOnNetwork.setStatus('mandatory')
a10AmsAlertName = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 17), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a10AmsAlertName.setStatus('mandatory')
a10ImmediateNmi = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 18), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10ImmediateNmi.setStatus('mandatory')
a10Page = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 19), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10Page.setStatus('mandatory')
a10Email = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 20), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10Email.setStatus('mandatory')
a10Enabled = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 30), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a10Enabled.setStatus('mandatory')
a10EventSystem = MibTableColumn((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 31), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a10EventSystem.setStatus('mandatory')
a10EventSub_system = MibScalar((1, 3, 6, 1, 4, 1, 343, 2, 6, 7, 7, 1, 32), DmiInteger()).setLabel("a10EventSub-system").setMaxAccess("readonly")
if mibBuilder.loadTexts: a10EventSub_system.setStatus('mandatory')
mibBuilder.exportSymbols("INTELLANDESKSERVERMANAGER-LOCALRESPONSEAMAPPER-MIB", products=products, a10DisplayAlertMessageOnConsole=a10DisplayAlertMessageOnConsole, a10ShutdownTheOs=a10ShutdownTheOs, DmiInteger=DmiInteger, a10BeepSpeaker=a10BeepSpeaker, eActionsTableForStandardIndications=eActionsTableForStandardIndications, tActionsTable=tActionsTable, a4Group=a4Group, intel=intel, a10ShutdownAndResetTheSystem=a10ShutdownAndResetTheSystem, dmtfGroups=dmtfGroups, DmiDisplaystring=DmiDisplaystring, server_products=server_products, tNameTable=tNameTable, a4ImmediatePowerOff=a4ImmediatePowerOff, a4BroadcastMessageOnNetwork=a4BroadcastMessageOnNetwork, a10BroadcastMessageOnNetwork=a10BroadcastMessageOnNetwork, a10WriteToLcd=a10WriteToLcd, a4ImmediateReset=a4ImmediateReset, a10AmsAlertName=a10AmsAlertName, a10Severity=a10Severity, a4Attribute=a4Attribute, a4DisplayAlertMessageOnConsole=a4DisplayAlertMessageOnConsole, a4AmsAlertName=a4AmsAlertName, a10EventGenerationGroup=a10EventGenerationGroup, a10Reserved=a10Reserved, a10ImmediateNmi=a10ImmediateNmi, a4Severity=a4Severity, a4LogToDisk=a4LogToDisk, a4Value=a4Value, a4RelatedMif=a4RelatedMif, a4ShutdownTheOs=a4ShutdownTheOs, a4ShutdownAndResetTheSystem=a4ShutdownAndResetTheSystem, a4Instance=a4Instance, a10RelatedMif=a10RelatedMif, a10Email=a10Email, tActionsTableForStandardIndications=tActionsTableForStandardIndications, a10ImmediateReset=a10ImmediateReset, DmiComponentIndex=DmiComponentIndex, a2ComponentName=a2ComponentName, a10LogToDisk=a10LogToDisk, a10Enabled=a10Enabled, a10EventType=a10EventType, a10Instance=a10Instance, a10EventSystem=a10EventSystem, a2MifId=a2MifId, eActionsTable=eActionsTable, a4WriteToLcd=a4WriteToLcd, a10EventSub_system=a10EventSub_system, a4Enabled=a4Enabled, a10ImmediatePowerOff=a10ImmediatePowerOff, a4ShutdownAndPowerOffTheSystem=a4ShutdownAndPowerOffTheSystem, eNameTable=eNameTable, a10Page=a10Page, a4BeepSpeaker=a4BeepSpeaker, DmiDateX=DmiDateX, a10ShutdownAndPowerOffTheSystem=a10ShutdownAndPowerOffTheSystem)
|
class Solution:
def repeatedNTimes(self, A: List[int]) -> int:
counter = 0
N = len(A) / 2
for a in A:
a_count = A.count(a)
if a_count == N:
return a
counter += a_count
if counter == N:
return A[0]
else:
A.remove(a)
|
class BitConverter(object):
""" Converts base data types to an array of bytes,and an array of bytes to base data types. """
@staticmethod
def DoubleToInt64Bits(value):
"""
DoubleToInt64Bits(value: float) -> Int64
Converts the specified double-precision floating point number to a 64-bit signed integer.
value: The number to convert.
Returns: A 64-bit signed integer whose value is equivalent to value.
"""
pass
@staticmethod
def GetBytes(value):
"""
GetBytes(value: UInt32) -> Array[Byte]
Returns the specified 32-bit unsigned integer value as an array of bytes.
value: The number to convert.
Returns: An array of bytes with length 4.
GetBytes(value: UInt16) -> Array[Byte]
Returns the specified 16-bit unsigned integer value as an array of bytes.
value: The number to convert.
Returns: An array of bytes with length 2.
GetBytes(value: UInt64) -> Array[Byte]
Returns the specified 64-bit unsigned integer value as an array of bytes.
value: The number to convert.
Returns: An array of bytes with length 8.
GetBytes(value: float) -> Array[Byte]
Returns the specified double-precision floating point value as an array of bytes.
value: The number to convert.
Returns: An array of bytes with length 8.
GetBytes(value: Single) -> Array[Byte]
Returns the specified single-precision floating point value as an array of bytes.
value: The number to convert.
Returns: An array of bytes with length 4.
GetBytes(value: Char) -> Array[Byte]
Returns the specified Unicode character value as an array of bytes.
value: A character to convert.
Returns: An array of bytes with length 2.
GetBytes(value: bool) -> Array[Byte]
Returns the specified Boolean value as an array of bytes.
value: A Boolean value.
Returns: An array of bytes with length 1.
GetBytes(value: Int16) -> Array[Byte]
Returns the specified 16-bit signed integer value as an array of bytes.
value: The number to convert.
Returns: An array of bytes with length 2.
GetBytes(value: Int64) -> Array[Byte]
Returns the specified 64-bit signed integer value as an array of bytes.
value: The number to convert.
Returns: An array of bytes with length 8.
GetBytes(value: int) -> Array[Byte]
Returns the specified 32-bit signed integer value as an array of bytes.
value: The number to convert.
Returns: An array of bytes with length 4.
"""
pass
@staticmethod
def Int64BitsToDouble(value):
"""
Int64BitsToDouble(value: Int64) -> float
Converts the specified 64-bit signed integer to a double-precision floating point number.
value: The number to convert.
Returns: A double-precision floating point number whose value is equivalent to value.
"""
pass
@staticmethod
def ToBoolean(value, startIndex):
"""
ToBoolean(value: Array[Byte],startIndex: int) -> bool
Returns a Boolean value converted from one byte at a specified position in a byte array.
value: An array of bytes.
startIndex: The starting position within value.
Returns: true if the byte at startIndex in value is nonzero; otherwise,false.
"""
pass
@staticmethod
def ToChar(value, startIndex):
"""
ToChar(value: Array[Byte],startIndex: int) -> Char
Returns a Unicode character converted from two bytes at a specified position in a byte array.
value: An array.
startIndex: The starting position within value.
Returns: A character formed by two bytes beginning at startIndex.
"""
pass
@staticmethod
def ToDouble(value, startIndex):
"""
ToDouble(value: Array[Byte],startIndex: int) -> float
Returns a double-precision floating point number converted from eight bytes at a specified
position in a byte array.
value: An array of bytes.
startIndex: The starting position within value.
Returns: A double precision floating point number formed by eight bytes beginning at startIndex.
"""
pass
@staticmethod
def ToInt16(value, startIndex):
"""
ToInt16(value: Array[Byte],startIndex: int) -> Int16
Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array.
value: An array of bytes.
startIndex: The starting position within value.
Returns: A 16-bit signed integer formed by two bytes beginning at startIndex.
"""
pass
@staticmethod
def ToInt32(value, startIndex):
"""
ToInt32(value: Array[Byte],startIndex: int) -> int
Returns a 32-bit signed integer converted from four bytes at a specified position in a byte
array.
value: An array of bytes.
startIndex: The starting position within value.
Returns: A 32-bit signed integer formed by four bytes beginning at startIndex.
"""
pass
@staticmethod
def ToInt64(value, startIndex):
"""
ToInt64(value: Array[Byte],startIndex: int) -> Int64
Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte
array.
value: An array of bytes.
startIndex: The starting position within value.
Returns: A 64-bit signed integer formed by eight bytes beginning at startIndex.
"""
pass
@staticmethod
def ToSingle(value, startIndex):
"""
ToSingle(value: Array[Byte],startIndex: int) -> Single
Returns a single-precision floating point number converted from four bytes at a specified
position in a byte array.
value: An array of bytes.
startIndex: The starting position within value.
Returns: A single-precision floating point number formed by four bytes beginning at startIndex.
"""
pass
@staticmethod
def ToString(value=None, startIndex=None, length=None):
"""
ToString(value: Array[Byte],startIndex: int) -> str
Converts the numeric value of each element of a specified subarray of bytes to its equivalent
hexadecimal string representation.
value: An array of bytes.
startIndex: The starting position within value.
Returns: A string of hexadecimal pairs separated by hyphens,where each pair represents the corresponding
element in a subarray of value; for example,"7F-2C-4A-00".
ToString(value: Array[Byte]) -> str
Converts the numeric value of each element of a specified array of bytes to its equivalent
hexadecimal string representation.
value: An array of bytes.
Returns: A string of hexadecimal pairs separated by hyphens,where each pair represents the corresponding
element in value; for example,"7F-2C-4A-00".
ToString(value: Array[Byte],startIndex: int,length: int) -> str
Converts the numeric value of each element of a specified subarray of bytes to its equivalent
hexadecimal string representation.
value: An array of bytes.
startIndex: The starting position within value.
length: The number of array elements in value to convert.
Returns: A string of hexadecimal pairs separated by hyphens,where each pair represents the corresponding
element in a subarray of value; for example,"7F-2C-4A-00".
"""
pass
@staticmethod
def ToUInt16(value, startIndex):
"""
ToUInt16(value: Array[Byte],startIndex: int) -> UInt16
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte
array.
value: The array of bytes.
startIndex: The starting position within value.
Returns: A 16-bit unsigned integer formed by two bytes beginning at startIndex.
"""
pass
@staticmethod
def ToUInt32(value, startIndex):
"""
ToUInt32(value: Array[Byte],startIndex: int) -> UInt32
Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte
array.
value: An array of bytes.
startIndex: The starting position within value.
Returns: A 32-bit unsigned integer formed by four bytes beginning at startIndex.
"""
pass
@staticmethod
def ToUInt64(value, startIndex):
"""
ToUInt64(value: Array[Byte],startIndex: int) -> UInt64
Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte
array.
value: An array of bytes.
startIndex: The starting position within value.
Returns: A 64-bit unsigned integer formed by the eight bytes beginning at startIndex.
"""
pass
IsLittleEndian = True
__all__ = [
"DoubleToInt64Bits",
"GetBytes",
"Int64BitsToDouble",
"IsLittleEndian",
"ToBoolean",
"ToChar",
"ToDouble",
"ToInt16",
"ToInt32",
"ToInt64",
"ToSingle",
"ToString",
"ToUInt16",
"ToUInt32",
"ToUInt64",
]
|
def extraerVector(matrizPesos, i, dimVect):
vectTemp = []
for j in range(dimVect - 1):
vectTemp.append(matrizPesos[i][j])
return vectTemp
|
async def handler(event):
# flush history data
await event.kv.flush()
# string: bit 0
v = await event.kv.setbit('string', 0, 1)
if v != 0:
return {'status': 503, 'body': 'test1 fail!'}
# string: bit 1
v = await event.kv.setbit('string', 0, 1)
if v != 1:
return {'status': 503, 'body': 'test2 fail!'}
await event.kv.setbit('string', 7, 1)
await event.kv.setbit('string', 16, 1)
await event.kv.setbit('string', 23, 1)
# string: bit 100000010000000010000001
v = await event.kv.getbit('string', 16)
if v != 1:
return {'status': 503, 'body': 'test3 fail!'}
# byte: [1, 1]
# bit: [8, 15]
v = await event.kv.bitcount('string', 1, 1)
if v != 0:
return {'status': 503, 'body': 'test4 fail!'}
# byte: [2, 2]
# bit: [16, 23]
v = await event.kv.bitcount('string', 2, 2)
if v != 2:
return {'status': 503, 'body': 'test5 fail!'}
# byte: [0, 2]
# bit: [0, 23]
v = await event.kv.bitcount('string', 0, 2)
if v != 4:
return {'status': 503, 'body': 'test6 fail!'}
return {'status': 200, 'body': b'well done!'}
|
'''
Copyright 2013 CyberPoint International, LLC.
All rights reserved. Use and disclosure prohibited
except as permitted in writing by CyberPoint.
libpgm exception handler
Charlie Cabot
Sept 27 2013
'''
class libpgmError(Exception):
pass
class bntextError(libpgmError):
pass
|
def bold(func):
def wrapper():
return "<b>" + func() + "</b>"
return wrapper
def italic(func):
def wrapper():
return "<i>" + func() + "</i>"
return wrapper
# 装饰器函数是自底向上的顺序
@bold
@italic
def formatted_text():
return '格式化文本!'
print(formatted_text())
|
# In mathematics, the Euclidean algorithm, or Euclid's algorithm, is an efficient method
# for computing the greatest common divisor (GCD) of two integers (numbers), the largest number
# that divides them both without a remainder.
def gcd_by_subtracting(m, n):
"""
Computes the greatest common divisor of two numbers by continuously subtracting the smaller
number from the bigger one till they became equal.
:param int m: First number.
:param int n: Second number.
:returns: GCD as a number.
"""
while m != n:
if m > n:
m -= n
else:
n -= m
return m
assert gcd_by_subtracting(112, 12345678) == 2
def gcd_recursive_by_divrem(m, n):
"""
Computes the greatest common divisor of two numbers by recursively getting remainder from
division.
:param int m: First number.
:param int n: Second number.
:returns: GCD as a number.
"""
if n == 0:
return m
return gcd_recursive_by_divrem(n, m % n)
assert gcd_by_subtracting(112, 12345678) == 2
def gcd_looping_with_divrem(m, n):
"""
Computes the greatest common divisor of two numbers by getting remainder from division in a
loop.
:param int m: First number.
:param int n: Second number.
:returns: GCD as a number.
"""
while n != 0:
m, n = n, m % n
return m
assert gcd_by_subtracting(112, 12345678) == 2
|
class CachedLoader(object):
items = {}
@classmethod
def load_compose_definition(cls, loader: callable):
return cls.cached('compose', loader)
@classmethod
def cached(cls, name: str, loader: callable):
if name not in cls.items:
cls.items[name] = loader()
return cls.items[name]
@classmethod
def clear(cls):
cls.items = {}
|
print("Welcome to Byeonghoon's Age Calculator. This program provide your or someone's age at the specific date you are enquiring.")
current_day = int(input("Please input the DAY you want to enquire (DD):\n"))
while current_day < 1 or current_day > 31:
print("!", current_day, "is not existing date. Please check your date again.")
current_day = int(input("Please input again for the DAY you want to enquire:\n"))
print(f"Date: {current_day}. Confirmed.")
current_month = int(input("Please input the MONTH you want to enquire (MM):\n"))
while current_month < 1 or current_month > 12:
print("!", current_month, "is not existing month. Please check your month again.")
current_month = int(
input("Please input again for the MONTH you want to enquire (MM):\n")
)
while ((current_day == 31) and (current_month in (2, 4, 6, 9, 11))) or (
(current_day == 30) and (current_month == 2)
):
print(
"! The date "
f"{current_day} in the month {current_month} is not exist. Please try again."
)
current_day = int(input("Please input the DAY you want to enquire (DD):\n"))
while current_day < 1 or current_day > 31:
print("!", current_day, "is not existing date. Please check your date again.")
current_day = int(
input("Please input again for the DAY you want to enquire (DD):\n")
)
print(f"Date: {current_day}. Confirmed.")
current_month = int(input("Please input the MONTH you want to enquire (MM):\n"))
while (current_month < 1) or (current_month > 12):
print(
f"! {current_month} is not existing month. Please check your month again."
)
current_month = int(
input("Please input again for the MONTH you want to enquire (MM):\n")
)
print(f"Date: {current_day}\nMonth: {current_month}. Confirmed.")
current_year = int(input("Please input the YEAR you want to enquire: \n"))
while current_year < 0 or current_year > 9999:
print("! Please input valid year. (from 0 ~ 9999)!")
current_year = int(input("Please input the YEAR you want to enquire: \n"))
while (
(current_day == 29)
and (current_month == 2)
and (
((current_year % 4) == (1 or 2 or 3))
or ((current_year % 4) and (current_year % 100) == 0)
or (((current_year % 4) and (current_year % 100) and (current_year % 400)) > 0)
)
):
print(f"! {current_year} does not have 29th day in February.")
current_year = int(input("Please input the YEAR you want to enquire again: \n"))
print(f"Year: {current_year}. Confirmed.")
print(f"Enquiring Date is: {current_day}. {current_month}. {current_year}.")
birth_day = int(input("Please input your or someone's birth DAY (DD):\n"))
while birth_day < 1 or birth_day > 31:
print(
"!",
birth_day,
"is not existing date. Please check your or someone's date again.",
)
birth_day = int(input("Please input your or someone's birth DAY again:\n"))
print(f"Date of birth: {birth_day}. Confirmed.")
birth_month = int(input("Please input your or someone's birth MONTH (MM):\n"))
while birth_month < 1 or birth_month > 12:
print(
"!",
birth_month,
"is not existing month. Please check your or someone's month again.",
)
birth_month = int(input("Please input your or someone's birth MONTH again (MM):\n"))
while ((birth_day == 31) and (birth_month in (2, 4, 6, 9, 11))) or (
(birth_day == 30) and (birth_month == 2)
):
print(
"! The date "
f"{birth_day} in the month {birth_month} is not exist. Please try again."
)
birth_day = int(input("Please input your or someone's birth DAY (DD):\n"))
while birth_day < 1 or birth_day > 31:
print(
"!",
birth_day,
"is not existing date. Please check your or someone's date again.",
)
birth_day = int(input("Please input your or someone's birth DAY again (DD):\n"))
print(f"Date: {birth_day}. Confirmed.")
birth_month = int(input("Please input your or someone's birth MONTH (MM)\n"))
while (birth_month < 1) or (birth_month > 12):
print(
f"! {birth_month} is not existing month. Please check your or someone's month again."
)
birth_month = int(
input("Please input your or someone's birth MONTH again (MM)\n")
)
print(f"Date: {birth_day}\nMonth: {birth_month}. Confirmed.")
birth_year = int(input("Please input your or someone's birth YEAR: \n"))
while birth_year < 0 or birth_year > 9999:
print("! Please input valid year. (from 0 ~ 9999")
birth_year = int(input("Please input your or someone's birth YEAR agian:\n"))
while (
(birth_day == 29)
and (birth_month == 2)
and (
((birth_year % 4) == (1 or 2 or 3))
or ((birth_year % 4) and (birth_year % 100) == 0)
or (((birth_year % 4) and (birth_year % 100) and (birth_year % 400)) > 0)
)
):
print(f"! {birth_year} does not have 29th day in February.")
birth_year = int(input("Please input your or someone's birth YEAR again: \n"))
print(f"Year: {birth_year}. Confirmed.")
print(f"Birth Date is: {birth_day}. {birth_month}. {birth_year}.")
result = (
int(current_year)
- int(birth_year)
- 1
+ int(
(
current_month > birth_month
or ((current_month >= birth_month) and (current_day >= birth_day))
)
and current_year >= birth_year
)
)
if result < 0:
print("Sorry, we can not provide the age before you or someone born")
else:
print("Your or someone's age at the day you enquired was:", result, "years old")
if (
(birth_year == current_year)
and (birth_month == current_month)
and (birth_day == current_day)
):
print("It is the day you or someone borned !")
|
class AuthSession(object):
def __init__(self, session):
self._session = session
def __enter__(self):
return self._session
def __exit__(self, *args):
self._session.close()
|
"""
Problem 7:
What is the 10 001st prime number?
"""
def is_prime(n):
for i in range(2, n // 2 + 1):
if n % i == 0:
return False
return True
class Prime:
def __init__(self):
self.curr = 1
def __next__(self):
new_next = self.curr + 1
while not is_prime(new_next):
new_next += 1
self.curr = new_next
return self.curr
def __iter__(self):
return self
pos = 0
for i in Prime():
pos += 1
if pos == 10001:
print('answer:', i)
break
|
# Given the array candies and the integer extraCandies, where candies[i] represents the number of candies that the
# ith kid has.
#
# For each kid check if there is a way to distribute extraCandies among the kids such that he or she can have the
# greatest number of candies among them. Notice that multiple kids can have the greatest number of candies.
#
# Input: candies = [2,3,5,1,3], extraCandies = 3
# Output: [true,true,true,false,true]
#
# 2 <= candies.length <= 100
# 1 <= candies[i] <= 100
# 1 <= extraCandies <= 50
#
# Source: https://leetcode.com/problems/kids-with-the-greatest-number-of-candies
class Solution:
def kidsWithCandies(self, candies, extraCandies):
highest = max(candies)
output_list = []
for i in candies:
total = i + extraCandies
if total >= highest:
output_list.append(True)
else:
output_list.append(False)
return output_list
s = Solution()
candies = [4, 2, 1, 1, 2]
output = s.kidsWithCandies(candies, 1)
print(f"{candies}\n{output}")
|
_base_ = './cascade_rcnn_s50_fpn_syncbn-backbone+head_mstrain-range_1x_coco.py'
model = dict(
backbone=dict(
stem_channels=128,
depth=101,
init_cfg=dict(type='Pretrained',
checkpoint='open-mmlab://resnest101')))
|
description = 'setup for the poller'
group = 'special'
sysconfig = dict(cache = 'mephisto17.office.frm2')
devices = dict(
Poller = device('nicos.services.poller.Poller',
alwayspoll = ['tube_environ', 'pressure'],
blacklist = ['tas']
),
)
|
# Asking Question
print ("How old are you?"),
age = input()
print ("How tall are you?")
height = input()
print ("How much do you weigh?")
weight = input()
print ("So You are %r years old, %r tall and %r heavy."%(age, height , weight)
)
|
__copyright__ = 'Copyright (C) 2019, Nokia'
class TestPythonpath2(object):
ROBOT_LIBRARY_SCOPE = "GLOBAL"
def __init__(self):
self.name = 'iina'
self.age = 10
def get_name2(self):
return self.name
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.