content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
"""Exceptions for NSDU-specific errors. """ class NSDUError(Exception): """NSDU general error. """ class ConfigError(NSDUError): """NSDU general config error. """ class LoaderNotFound(NSDUError): """Loader source file not found. """ class LoaderError(NSDUError): """Error of loader plugins. """ def __init__(self, suppress_nsdu_error=True): self.suppress_nsdu_error = suppress_nsdu_error super().__init__() class LoaderConfigError(LoaderError): """Loader's config error. """ class DispatchApiError(NSDUError): """Dispatch API error. """ class UnknownDispatchError(DispatchApiError): """This dispatch does not exist. """ class NotOwnerDispatchError(DispatchApiError): """You do not own this dispatch. """ class NationLoginError(DispatchApiError): """Failed to log in to nation. """ class DispatchConfigError(NSDUError): """Dispatch config error. """ class NonexistentCategoryError(DispatchConfigError): """Category or subcategory doesn't exist. """ def __init__(self, category_type, category_value): self.category_type = category_type self.category_value = category_value super().__init__() class DispatchRenderingError(NSDUError): """Dispatch rendering error. """ class BBParsingError(DispatchRenderingError): """BBCode parsing errors. """ class TemplateRenderingError(DispatchRenderingError): """Jinja template rendering errors. """
"""Exceptions for NSDU-specific errors. """ class Nsduerror(Exception): """NSDU general error. """ class Configerror(NSDUError): """NSDU general config error. """ class Loadernotfound(NSDUError): """Loader source file not found. """ class Loadererror(NSDUError): """Error of loader plugins. """ def __init__(self, suppress_nsdu_error=True): self.suppress_nsdu_error = suppress_nsdu_error super().__init__() class Loaderconfigerror(LoaderError): """Loader's config error. """ class Dispatchapierror(NSDUError): """Dispatch API error. """ class Unknowndispatcherror(DispatchApiError): """This dispatch does not exist. """ class Notownerdispatcherror(DispatchApiError): """You do not own this dispatch. """ class Nationloginerror(DispatchApiError): """Failed to log in to nation. """ class Dispatchconfigerror(NSDUError): """Dispatch config error. """ class Nonexistentcategoryerror(DispatchConfigError): """Category or subcategory doesn't exist. """ def __init__(self, category_type, category_value): self.category_type = category_type self.category_value = category_value super().__init__() class Dispatchrenderingerror(NSDUError): """Dispatch rendering error. """ class Bbparsingerror(DispatchRenderingError): """BBCode parsing errors. """ class Templaterenderingerror(DispatchRenderingError): """Jinja template rendering errors. """
# PNG ADDRESS PNG = "0x60781C2586D68229fde47564546784ab3fACA982" # PGL PNG/AVAX LP_PNG_AVAX = "0xd7538cABBf8605BdE1f4901B47B8D42c61DE0367" # FACTORY ADDRESS FACTORY = '0xefa94DE7a4656D787667C749f7E1223D71E9FD88' # STAKING CONTRACTS # EARN AVAX STAKING_AVAX = "0xD49B406A7A29D64e081164F6C3353C599A2EeAE9" # EARN OOE STAKING_OOE = "0xf0eFf017644680B9878429137ccb2c041b4Fb701" # EARN APEIN STAKING_APEIN = "0xfe1d712363f2B1971818DBA935eEC13Ddea474cc"
png = '0x60781C2586D68229fde47564546784ab3fACA982' lp_png_avax = '0xd7538cABBf8605BdE1f4901B47B8D42c61DE0367' factory = '0xefa94DE7a4656D787667C749f7E1223D71E9FD88' staking_avax = '0xD49B406A7A29D64e081164F6C3353C599A2EeAE9' staking_ooe = '0xf0eFf017644680B9878429137ccb2c041b4Fb701' staking_apein = '0xfe1d712363f2B1971818DBA935eEC13Ddea474cc'
#!/usr/bin/env python3 serial_number = 7511 grid_size = 300 power_levels = {} fuel_cells = {} def power_level(cell): return ( ((((cell[0] + 10) * cell[1] + serial_number) * (cell[0] + 10)) % 1000) // 100 ) - 5 def power_of_cell(cell): power = 0 for xx in range(3): for yy in range(3): power += power_levels[(cell[0] - xx, cell[1] - yy)] return power for x in range(1, grid_size + 1): for y in range(1, grid_size + 1): level = power_level((x, y)) power_levels[(x, y)] = level if x >= 3 and y >= 3: fuel_cells[(x, y)] = power_of_cell((x, y)) max_fuel_cell = max(fuel_cells, key=fuel_cells.get) print( "The fuel cell of size 3 with maximum power is:", (max_fuel_cell[0] - 2, max_fuel_cell[1] - 2), )
serial_number = 7511 grid_size = 300 power_levels = {} fuel_cells = {} def power_level(cell): return ((cell[0] + 10) * cell[1] + serial_number) * (cell[0] + 10) % 1000 // 100 - 5 def power_of_cell(cell): power = 0 for xx in range(3): for yy in range(3): power += power_levels[cell[0] - xx, cell[1] - yy] return power for x in range(1, grid_size + 1): for y in range(1, grid_size + 1): level = power_level((x, y)) power_levels[x, y] = level if x >= 3 and y >= 3: fuel_cells[x, y] = power_of_cell((x, y)) max_fuel_cell = max(fuel_cells, key=fuel_cells.get) print('The fuel cell of size 3 with maximum power is:', (max_fuel_cell[0] - 2, max_fuel_cell[1] - 2))
# Literally the same problem as 2020 Day 13, part 2. Here is a better constructed version of that solution. # Originally, I just brute forced every configuration until I found the right one (i.e a different approach to what I did before)... # but that ended up being only one line of code less than this, whilst this approach is far more scalable, and instantaneous for the given input. def main(curr_config, disc_positions): time = 0; i = 0; cf = 1 target_config = [p-i if 0 < p-i < p else (p+i)%p for i,p in enumerate(disc_positions)] while i < len(disc_positions): if curr_config[i] == target_config[i]: cf = cf * disc_positions[i] # cf = cumulative frequency of aligned discs so far i.e we get disc 1 in the correct position, then 1,2, then 1,2,3... i += 1 else: curr_config = [pos+cf if pos+cf < mx else (pos+cf)%mx for pos,mx in list(zip(curr_config,disc_positions))] time += cf return time-1 # account for 1 second drop time for the capsule to reach the first disc print(main([11,0,11,0,2,17],[13,5,17,3,7,19])) print(main([11,0,11,0,2,17,0],[13,5,17,3,7,19,11]))
def main(curr_config, disc_positions): time = 0 i = 0 cf = 1 target_config = [p - i if 0 < p - i < p else (p + i) % p for (i, p) in enumerate(disc_positions)] while i < len(disc_positions): if curr_config[i] == target_config[i]: cf = cf * disc_positions[i] i += 1 else: curr_config = [pos + cf if pos + cf < mx else (pos + cf) % mx for (pos, mx) in list(zip(curr_config, disc_positions))] time += cf return time - 1 print(main([11, 0, 11, 0, 2, 17], [13, 5, 17, 3, 7, 19])) print(main([11, 0, 11, 0, 2, 17, 0], [13, 5, 17, 3, 7, 19, 11]))
class ServiceInterface(object): def __init__(self, **kargs): pass def update(self, **kargs): raise Exception("Not implemented for this class") def load(self, **kargs): raise Exception("Not implemented for this class") def check(self, domain=None, **kargs): raise Exception("Not implemented for this class")
class Serviceinterface(object): def __init__(self, **kargs): pass def update(self, **kargs): raise exception('Not implemented for this class') def load(self, **kargs): raise exception('Not implemented for this class') def check(self, domain=None, **kargs): raise exception('Not implemented for this class')
# Django settings for cbc_website project. DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = 'django_esv_tests.db' INSTALLED_APPS = [ 'esv', 'core', ] TEMPLATE_LOADERS = ( 'django.template.loaders.app_directories.load_template_source', )
database_engine = 'sqlite3' database_name = 'django_esv_tests.db' installed_apps = ['esv', 'core'] template_loaders = ('django.template.loaders.app_directories.load_template_source',)
def fibonnacijeva_stevila(n): stevila = [1,1] i = 2 while len(str(stevila[-1])) < n: stevila.append(stevila[-1] + stevila[-2]) i += 1 return i print(fibonnacijeva_stevila(1000))
def fibonnacijeva_stevila(n): stevila = [1, 1] i = 2 while len(str(stevila[-1])) < n: stevila.append(stevila[-1] + stevila[-2]) i += 1 return i print(fibonnacijeva_stevila(1000))
class SwaggerParser: def __init__(self, spec: dict): self.spec = spec @property def operations(self) -> dict: _operations = {} for uri, resources in self.spec['paths'].items(): for method, resource in resources.items(): op = SwaggerOperation(method, uri, resource) _operations.update({op.id: op}) return _operations class SwaggerOperation: def __init__(self, method: str, uri: str, resource_dict: dict): self.method = method self.uri = uri self.resource_dict = resource_dict def get_params(self, type: str): return [param['name'] for param in self.resource_dict['parameters'] if param['in'] == type] @property def id(self) -> str: return self.resource_dict.get('operationId') @property def query_params(self) -> list: return self.get_params(type='query') @property def path_params(self) -> list: return self.get_params(type='path') @property def headers(self) -> list: return self.get_params(type='header') @property def body(self) -> [str, None]: try: return self.get_params(type='body')[0] except IndexError: return None
class Swaggerparser: def __init__(self, spec: dict): self.spec = spec @property def operations(self) -> dict: _operations = {} for (uri, resources) in self.spec['paths'].items(): for (method, resource) in resources.items(): op = swagger_operation(method, uri, resource) _operations.update({op.id: op}) return _operations class Swaggeroperation: def __init__(self, method: str, uri: str, resource_dict: dict): self.method = method self.uri = uri self.resource_dict = resource_dict def get_params(self, type: str): return [param['name'] for param in self.resource_dict['parameters'] if param['in'] == type] @property def id(self) -> str: return self.resource_dict.get('operationId') @property def query_params(self) -> list: return self.get_params(type='query') @property def path_params(self) -> list: return self.get_params(type='path') @property def headers(self) -> list: return self.get_params(type='header') @property def body(self) -> [str, None]: try: return self.get_params(type='body')[0] except IndexError: return None
# # PySNMP MIB module CPQPOWER-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CPQPOWER-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:27:50 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint") compaq, = mibBuilder.importSymbols("CPQHOST-MIB", "compaq") ifIndex, ifDescr = mibBuilder.importSymbols("IF-MIB", "ifIndex", "ifDescr") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") sysLocation, sysDescr, sysName, sysContact = mibBuilder.importSymbols("SNMPv2-MIB", "sysLocation", "sysDescr", "sysName", "sysContact") NotificationType, Bits, Integer32, ModuleIdentity, iso, Counter64, Counter32, NotificationType, ObjectIdentity, Unsigned32, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, MibIdentifier, Gauge32, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Bits", "Integer32", "ModuleIdentity", "iso", "Counter64", "Counter32", "NotificationType", "ObjectIdentity", "Unsigned32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "MibIdentifier", "Gauge32", "IpAddress") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") cpqPower = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165)) powerDevice = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 1)) trapInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 1, 1)) managementModuleIdent = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 1, 2)) pdu = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 2)) pduIdent = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 2, 1)) pduInput = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 2, 2)) pduOutput = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 2, 3)) ups = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3)) upsIdent = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 1)) upsBattery = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 2)) upsInput = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 3)) upsOutput = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 4)) upsBypass = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 5)) upsEnvironment = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 6)) upsTest = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 7)) upsControl = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 8)) upsConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 9)) upsRecep = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 10)) upsTopology = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 11)) pdr = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 4)) pdrIdent = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 4, 1)) pdrPanel = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 4, 2)) pdrBreaker = MibIdentifier((1, 3, 6, 1, 4, 1, 232, 165, 4, 3)) trapCode = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trapCode.setStatus('mandatory') if mibBuilder.loadTexts: trapCode.setDescription("A number identifying the event for the trap that was sent. Mapped unique trap code per unique event to be used by ISEE's decoder ring.") trapDescription = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: trapDescription.setStatus('mandatory') if mibBuilder.loadTexts: trapDescription.setDescription('A string identifying the event for that last trap that was sent.') trapDeviceMgmtUrl = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: trapDeviceMgmtUrl.setStatus('mandatory') if mibBuilder.loadTexts: trapDeviceMgmtUrl.setDescription('A string contains the URL for the management software.') trapDeviceDetails = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: trapDeviceDetails.setStatus('mandatory') if mibBuilder.loadTexts: trapDeviceDetails.setDescription('A string details information about the device, including model, serial number, part number, etc....') trapDeviceName = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: trapDeviceName.setStatus('mandatory') if mibBuilder.loadTexts: trapDeviceName.setDescription('A string contains the name of the device.') trapCritical = NotificationType((1, 3, 6, 1, 4, 1, 232, 165) + (0,1)).setObjects(("SNMPv2-MIB", "sysName"), ("CPQPOWER-MIB", "trapCode"), ("CPQPOWER-MIB", "trapDescription"), ("CPQPOWER-MIB", "trapDeviceName"), ("CPQPOWER-MIB", "trapDeviceDetails"), ("CPQPOWER-MIB", "trapDeviceMgmtUrl")) if mibBuilder.loadTexts: trapCritical.setDescription('A critical alarm has occurred. Action: Check the Trap Details for more information.') trapWarning = NotificationType((1, 3, 6, 1, 4, 1, 232, 165) + (0,2)).setObjects(("SNMPv2-MIB", "sysName"), ("CPQPOWER-MIB", "trapCode"), ("CPQPOWER-MIB", "trapDescription"), ("CPQPOWER-MIB", "trapDeviceName"), ("CPQPOWER-MIB", "trapDeviceDetails"), ("CPQPOWER-MIB", "trapDeviceMgmtUrl")) if mibBuilder.loadTexts: trapWarning.setDescription('A warning alarm has occurred. Action: Check the Trap Details for more information.') trapInformation = NotificationType((1, 3, 6, 1, 4, 1, 232, 165) + (0,3)).setObjects(("SNMPv2-MIB", "sysName"), ("CPQPOWER-MIB", "trapCode"), ("CPQPOWER-MIB", "trapDescription"), ("CPQPOWER-MIB", "trapDeviceName"), ("CPQPOWER-MIB", "trapDeviceDetails"), ("CPQPOWER-MIB", "trapDeviceMgmtUrl")) if mibBuilder.loadTexts: trapInformation.setDescription('An informational alarm has occurred. Action: Check the Trap Details for more information.') trapCleared = NotificationType((1, 3, 6, 1, 4, 1, 232, 165) + (0,4)).setObjects(("SNMPv2-MIB", "sysName"), ("CPQPOWER-MIB", "trapCode"), ("CPQPOWER-MIB", "trapDescription"), ("CPQPOWER-MIB", "trapDeviceName"), ("CPQPOWER-MIB", "trapDeviceDetails"), ("CPQPOWER-MIB", "trapDeviceMgmtUrl")) if mibBuilder.loadTexts: trapCleared.setDescription('An alarm has cleared. Action: Check the Trap Details for more information.') trapTest = NotificationType((1, 3, 6, 1, 4, 1, 232, 165) + (0,5)).setObjects(("SNMPv2-MIB", "sysName"), ("CPQPOWER-MIB", "trapCode"), ("CPQPOWER-MIB", "trapDescription"), ("CPQPOWER-MIB", "trapDeviceName"), ("CPQPOWER-MIB", "trapDeviceDetails"), ("CPQPOWER-MIB", "trapDeviceMgmtUrl")) if mibBuilder.loadTexts: trapTest.setDescription('Test trap sent to a trap receiver to check proper reception of traps') deviceTrapInitialization = NotificationType((1, 3, 6, 1, 4, 1, 232, 165) + (0,6)).setObjects(("SNMPv2-MIB", "sysName"), ("CPQPOWER-MIB", "deviceIdentName")) if mibBuilder.loadTexts: deviceTrapInitialization.setDescription('This trap is sent each time a power device is initialized.') deviceManufacturer = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceManufacturer.setStatus('mandatory') if mibBuilder.loadTexts: deviceManufacturer.setDescription('The device manufacturer.') deviceModel = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceModel.setStatus('mandatory') if mibBuilder.loadTexts: deviceModel.setDescription('The device model.') deviceFirmwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceFirmwareVersion.setStatus('mandatory') if mibBuilder.loadTexts: deviceFirmwareVersion.setDescription('The device firmware version(s).') deviceHardwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceHardwareVersion.setStatus('mandatory') if mibBuilder.loadTexts: deviceHardwareVersion.setDescription('The device hardware version.') deviceIdentName = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 5), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: deviceIdentName.setStatus('mandatory') if mibBuilder.loadTexts: deviceIdentName.setDescription('A string identifying the device.') devicePartNumber = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: devicePartNumber.setStatus('mandatory') if mibBuilder.loadTexts: devicePartNumber.setDescription('The device part number.') deviceSerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceSerialNumber.setStatus('mandatory') if mibBuilder.loadTexts: deviceSerialNumber.setDescription('The device serial number.') deviceMACAddress = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceMACAddress.setStatus('mandatory') if mibBuilder.loadTexts: deviceMACAddress.setDescription('The device MAC address.') numOfPdu = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: numOfPdu.setStatus('mandatory') if mibBuilder.loadTexts: numOfPdu.setDescription('The number of PDUs.') pduIdentTable = MibTable((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2), ) if mibBuilder.loadTexts: pduIdentTable.setStatus('mandatory') if mibBuilder.loadTexts: pduIdentTable.setDescription('The Aggregate Object with number of entries equal to NumOfPdu and including the PduIdent group.') pduIdentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1), ).setIndexNames((0, "CPQPOWER-MIB", "pduIdentIndex")) if mibBuilder.loadTexts: pduIdentEntry.setStatus('mandatory') if mibBuilder.loadTexts: pduIdentEntry.setDescription('The ident table entry containing the name, model, manufacturer, firmware version, part number, etc.') pduIdentIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pduIdentIndex.setStatus('mandatory') if mibBuilder.loadTexts: pduIdentIndex.setDescription('Index for the PduIdentEntry table.') pduName = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pduName.setStatus('mandatory') if mibBuilder.loadTexts: pduName.setDescription('The string identify the device.') pduModel = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: pduModel.setStatus('mandatory') if mibBuilder.loadTexts: pduModel.setDescription('The Device Model.') pduManufacturer = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: pduManufacturer.setStatus('mandatory') if mibBuilder.loadTexts: pduManufacturer.setDescription('The Device Manufacturer Name (e.g. Hewlett-Packard).') pduFirmwareVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: pduFirmwareVersion.setStatus('mandatory') if mibBuilder.loadTexts: pduFirmwareVersion.setDescription('The firmware revision level of the device.') pduPartNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: pduPartNumber.setStatus('mandatory') if mibBuilder.loadTexts: pduPartNumber.setDescription('The device part number.') pduSerialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: pduSerialNumber.setStatus('mandatory') if mibBuilder.loadTexts: pduSerialNumber.setDescription('The deice serial number.') pduStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("ok", 2), ("degraded", 3), ("failed", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pduStatus.setStatus('mandatory') if mibBuilder.loadTexts: pduStatus.setDescription('The overall status of the device. A value of OK(2) indicates the device is operating normally. A value of degraded(3) indicates the device is operating with warning indicators. A value of failed(4) indicates the device is operating with critical indicators.') pduControllable = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("yes", 1), ("no", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pduControllable.setStatus('mandatory') if mibBuilder.loadTexts: pduControllable.setDescription('This object indicates whether or not the device is controllable.') pduInputTable = MibTable((1, 3, 6, 1, 4, 1, 232, 165, 2, 2, 1), ) if mibBuilder.loadTexts: pduInputTable.setStatus('mandatory') if mibBuilder.loadTexts: pduInputTable.setDescription('The Aggregate Object with number of entries equal to NumOfPdu and including the PduInput group.') pduInputEntry = MibTableRow((1, 3, 6, 1, 4, 1, 232, 165, 2, 2, 1, 1), ).setIndexNames((0, "CPQPOWER-MIB", "pduInputIndex")) if mibBuilder.loadTexts: pduInputEntry.setStatus('mandatory') if mibBuilder.loadTexts: pduInputEntry.setDescription('The input table entry containing the voltage and current for the PDU') pduInputIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pduInputIndex.setStatus('mandatory') if mibBuilder.loadTexts: pduInputIndex.setDescription('Index for the PduInputEntry table.') inputVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: inputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: inputVoltage.setDescription('The measured input voltage from the PDU meters in volts.') inputCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: inputCurrent.setStatus('mandatory') if mibBuilder.loadTexts: inputCurrent.setDescription('The measured input current from the PDU meters in amps.') pduOutputTable = MibTable((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1), ) if mibBuilder.loadTexts: pduOutputTable.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputTable.setDescription('The Aggregate Object with number of entries equal to NumOfPdu and including the PduInput group.') pduOutputEntry = MibTableRow((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1), ).setIndexNames((0, "CPQPOWER-MIB", "pduOutputIndex")) if mibBuilder.loadTexts: pduOutputEntry.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputEntry.setDescription('The input table entry containing the name, heat load, current load, power load, firmware, etc.') pduOutputIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pduOutputIndex.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputIndex.setDescription('Index for the PduOutputEntry table.') pduOutputLoad = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200))).setMaxAccess("readonly") if mibBuilder.loadTexts: pduOutputLoad.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputLoad.setDescription('The device output load in percent of rated capacity. A value of -1 will be returned if the heat load is unable to be measured.') pduOutputHeat = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pduOutputHeat.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputHeat.setDescription('The total heat load measured on the PDU in BTUs. A value of -1 will be returned if the heat load is unable to be measured.') pduOutputPower = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pduOutputPower.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputPower.setDescription('The total power load measured on the PDU in watts. A value of -1 will be returned if the power load is unable to be measured.') pduOutputNumBreakers = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pduOutputNumBreakers.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputNumBreakers.setDescription('The number of breakers for the device. This variable indicates the number of rows in the breakers table.') pduOutputBreakerTable = MibTable((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2), ) if mibBuilder.loadTexts: pduOutputBreakerTable.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputBreakerTable.setDescription('List of breaker table entries. The number of entries is given by pduOutputNumBreakers .') pduOutputBreakerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1), ).setIndexNames((0, "CPQPOWER-MIB", "pduOutputIndex"), (0, "CPQPOWER-MIB", "breakerIndex")) if mibBuilder.loadTexts: pduOutputBreakerEntry.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputBreakerEntry.setDescription('An entry containing information applicable to an breaker.') breakerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: breakerIndex.setStatus('mandatory') if mibBuilder.loadTexts: breakerIndex.setDescription('The breaker identifier.') breakerVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: breakerVoltage.setStatus('mandatory') if mibBuilder.loadTexts: breakerVoltage.setDescription('The breaker voltage in volts.') breakerCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: breakerCurrent.setStatus('mandatory') if mibBuilder.loadTexts: breakerCurrent.setDescription('The breaker current draw in Amps.') breakerPercentLoad = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: breakerPercentLoad.setStatus('mandatory') if mibBuilder.loadTexts: breakerPercentLoad.setDescription('The breaker load in percent.') breakerStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("normal", 1), ("overloadWarning", 2), ("overloadCritical", 3), ("voltageRangeWarning", 4), ("voltageRangeCritical", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: breakerStatus.setStatus('mandatory') if mibBuilder.loadTexts: breakerStatus.setDescription('This object indicates the status of the breaker. A value of normal(1) indicates the breaker is operating normally. A value of overloadWarning(2) indicates the breaker has an overload warning. A value of overloadCritical(3) indicates the breaker is overloaded. A value of voltageRangeWarning(4) indicates the breaker voltage is out of tolerance by 10-20%. A value of voltageRangeCritical(5) indicates the breaker voltage is out of tolerance by more than 20%. Note: Overload status has priority over voltage tolerance status.') upsIdentManufacturer = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsIdentManufacturer.setStatus('mandatory') if mibBuilder.loadTexts: upsIdentManufacturer.setDescription('The UPS Manufacturer Name (e.g. Hewlett-Packard).') upsIdentModel = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsIdentModel.setStatus('mandatory') if mibBuilder.loadTexts: upsIdentModel.setDescription('The UPS Model;Part number;Serial number (e.g. HP R5500 XR;204451-B21;B00123456W).') upsIdentSoftwareVersions = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsIdentSoftwareVersions.setStatus('mandatory') if mibBuilder.loadTexts: upsIdentSoftwareVersions.setDescription('The firmware revision level(s) of the UPS microcontroller(s).') upsIdentOemCode = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsIdentOemCode.setStatus('mandatory') if mibBuilder.loadTexts: upsIdentOemCode.setDescription('A binary code indicating vendor. This should be a ?0x0c? for HP') upsBatTimeRemaining = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsBatTimeRemaining.setStatus('mandatory') if mibBuilder.loadTexts: upsBatTimeRemaining.setDescription('Battery run time in seconds before UPS turns off due to low battery.') upsBatVoltage = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 2, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsBatVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsBatVoltage.setDescription('Battery voltage as reported by the UPS meters.') upsBatCurrent = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 2, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-2147483648, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsBatCurrent.setStatus('mandatory') if mibBuilder.loadTexts: upsBatCurrent.setDescription('Battery Current as reported by the UPS metering. Current is positive when discharging, negative when recharging the battery.') upsBatCapacity = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 2, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsBatCapacity.setStatus('mandatory') if mibBuilder.loadTexts: upsBatCapacity.setDescription('Battery percent charge.') upsBatteryAbmStatus = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 2, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("batteryCharging", 1), ("batteryDischarging", 2), ("batteryFloating", 3), ("batteryResting", 4), ("unknown", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsBatteryAbmStatus.setStatus('mandatory') if mibBuilder.loadTexts: upsBatteryAbmStatus.setDescription('Gives the status of the Advanced Battery Management; batteryFloating(3) status means that the charger is temporarily charging the battery to its float voltage; batteryResting(4) is the state when the battery is fully charged and none of the other actions (charging/discharging/floating) is being done.') upsInputFrequency = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsInputFrequency.setStatus('mandatory') if mibBuilder.loadTexts: upsInputFrequency.setDescription('The utility line frequency in tenths of Hz.') upsInputLineBads = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: upsInputLineBads.setStatus('mandatory') if mibBuilder.loadTexts: upsInputLineBads.setDescription('The number of times the Input was out of tolerance in voltage or frequency.') upsInputNumPhases = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsInputNumPhases.setStatus('mandatory') if mibBuilder.loadTexts: upsInputNumPhases.setDescription('') upsInputTable = MibTable((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4), ) if mibBuilder.loadTexts: upsInputTable.setStatus('mandatory') if mibBuilder.loadTexts: upsInputTable.setDescription('The Aggregate Object with number of entries equal to NumPhases and including the UpsInput group.') upsInputEntry = MibTableRow((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4, 1), ).setIndexNames((0, "CPQPOWER-MIB", "upsInputPhase")) if mibBuilder.loadTexts: upsInputEntry.setStatus('mandatory') if mibBuilder.loadTexts: upsInputEntry.setDescription('The input table entry containing the current, voltage, etc.') upsInputPhase = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsInputPhase.setStatus('mandatory') if mibBuilder.loadTexts: upsInputPhase.setDescription('The number of the phase. Serves as index for input table.') upsInputVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsInputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsInputVoltage.setDescription('The measured input voltage from the UPS meters in volts.') upsInputCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsInputCurrent.setStatus('mandatory') if mibBuilder.loadTexts: upsInputCurrent.setDescription('The measured input current from the UPS meters in amps.') upsInputWatts = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsInputWatts.setStatus('mandatory') if mibBuilder.loadTexts: upsInputWatts.setDescription('The measured input real power in watts.') upsInputSource = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("other", 1), ("none", 2), ("primaryUtility", 3), ("bypassFeed", 4), ("secondaryUtility", 5), ("generator", 6), ("flywheel", 7), ("fuelcell", 8)))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsInputSource.setStatus('mandatory') if mibBuilder.loadTexts: upsInputSource.setDescription('The present external source of input power. The enumeration none(2) indicates that there is no external source of power, for example, the UPS is On Battery (an internal source). The bypassFeed(4) can only be used when the Bypass source is known to be a separate utility feed than the primaryUtility(3).') upsOutputLoad = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsOutputLoad.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputLoad.setDescription('The UPS output load in percent of rated capacity.') upsOutputFrequency = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsOutputFrequency.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputFrequency.setDescription('The measured UPS output frequency in tenths of Hz.') upsOutputNumPhases = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsOutputNumPhases.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputNumPhases.setDescription('The number of metered output phases, serves as the table index.') upsOutputTable = MibTable((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4), ) if mibBuilder.loadTexts: upsOutputTable.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputTable.setDescription('The Aggregate Object with number of entries equal to NumPhases and including the UpsOutput group.') upsOutputEntry = MibTableRow((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4, 1), ).setIndexNames((0, "CPQPOWER-MIB", "upsOutputPhase")) if mibBuilder.loadTexts: upsOutputEntry.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputEntry.setDescription('Output Table Entry containing voltage, current, etc.') upsOutputPhase = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsOutputPhase.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputPhase.setDescription('The number {1..3} of the output phase.') upsOutputVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsOutputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputVoltage.setDescription('The measured output voltage from the UPS metering in volts.') upsOutputCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsOutputCurrent.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputCurrent.setDescription('The measured UPS output current in amps.') upsOutputWatts = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsOutputWatts.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputWatts.setDescription('The measured real output power in watts.') upsOutputSource = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("other", 1), ("none", 2), ("normal", 3), ("bypass", 4), ("battery", 5), ("booster", 6), ("reducer", 7), ("parallelCapacity", 8), ("parallelRedundant", 9), ("highEfficiencyMode", 10)))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsOutputSource.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputSource.setDescription('The present source of output power. The enumeration none(2) indicates that there is no source of output power (and therefore no output power), for example, the system has opened the output breaker.') upsBypassFrequency = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsBypassFrequency.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassFrequency.setDescription('The bypass frequency in tenths of Hz.') upsBypassNumPhases = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsBypassNumPhases.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassNumPhases.setDescription('The number of lines in the UPS bypass table.') upsBypassTable = MibTable((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 3), ) if mibBuilder.loadTexts: upsBypassTable.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassTable.setDescription('') upsBypassEntry = MibTableRow((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 3, 1), ).setIndexNames((0, "CPQPOWER-MIB", "upsBypassPhase")) if mibBuilder.loadTexts: upsBypassEntry.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassEntry.setDescription('Entry in the UpsBypassTable.') upsBypassPhase = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsBypassPhase.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassPhase.setDescription('The Bypass Phase, index for the table.') upsBypassVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsBypassVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassVoltage.setDescription('The measured UPS bypass voltage in volts.') upsEnvAmbientTemp = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-100, 200))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsEnvAmbientTemp.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvAmbientTemp.setDescription('The reading of the ambient temperature in the vicinity of the UPS or SNMP agent.') upsEnvAmbientLowerLimit = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-100, 200))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsEnvAmbientLowerLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvAmbientLowerLimit.setDescription('The Lower Limit of the ambient temperature; if UpsEnvAmbientTemp falls below this value, the UpsAmbientTempBad alarm will occur.') upsEnvAmbientUpperLimit = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-100, 200))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsEnvAmbientUpperLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvAmbientUpperLimit.setDescription('The Upper Limit of the ambient temperature; if UpsEnvAmbientTemp rises above this value, the UpsAmbientTempBad alarm will occur. This value should be greater than UpsEnvAmbientLowerLimit.') upsEnvAmbientHumidity = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsEnvAmbientHumidity.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvAmbientHumidity.setDescription('The reading of the ambient humidity in the vicinity of the UPS or SNMP agent.') upsEnvRemoteTemp = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-100, 200))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsEnvRemoteTemp.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteTemp.setDescription('The reading of a remote temperature sensor connected to the UPS or SNMP agent.') upsEnvRemoteHumidity = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsEnvRemoteHumidity.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteHumidity.setDescription('The reading of a remote humidity sensor connected to the UPS or SNMP agent.') upsEnvNumContacts = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsEnvNumContacts.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvNumContacts.setDescription('The number of Contacts in the UpsContactsTable. This object indicates the number of rows in the UpsContactsTable.') upsContactsTable = MibTable((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8), ) if mibBuilder.loadTexts: upsContactsTable.setStatus('mandatory') if mibBuilder.loadTexts: upsContactsTable.setDescription('A list of Contact Sensing table entries. The number of entries is given by the value of UpsEnvNumContacts.') upsContactsTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8, 1), ).setIndexNames((0, "CPQPOWER-MIB", "upsContactIndex")) if mibBuilder.loadTexts: upsContactsTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: upsContactsTableEntry.setDescription('An entry containing information applicable to a particular Contact input.') upsContactIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsContactIndex.setStatus('mandatory') if mibBuilder.loadTexts: upsContactIndex.setDescription('The Contact identifier; identical to the Contact Number.') upsContactType = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("normallyOpen", 1), ("normallyClosed", 2), ("anyChange", 3), ("notUsed", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsContactType.setStatus('mandatory') if mibBuilder.loadTexts: upsContactType.setDescription("The normal state for this contact. The 'other' state is the Active state for generating the UpstdContactActiveNotice trap. If anyChange(3) is selected, then this trap is sent any time the contact changes to either Open or Closed. No traps are sent if the Contact is set to notUsed(4). In many cases, the configuration for Contacts may be done by other means, so this object may be read-only.") upsContactState = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("open", 1), ("closed", 2), ("openWithNotice", 3), ("closedWithNotice", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsContactState.setStatus('mandatory') if mibBuilder.loadTexts: upsContactState.setDescription('The current state of the Contact input; the value is based on the open/closed input state and the setting for UpsContactType. When entering the openWithNotice(3) and closedWithNotice(4) states, no entries added to the UpsAlarmTable, but the UpstdContactActiveNotice trap is sent.') upsContactDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsContactDescr.setStatus('mandatory') if mibBuilder.loadTexts: upsContactDescr.setDescription('A label identifying the Contact. This object should be set by the administrator.') upsEnvRemoteTempLowerLimit = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-100, 200))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsEnvRemoteTempLowerLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteTempLowerLimit.setDescription('The Lower Limit of the remote temperature; if UpsEnvRemoteTemp falls below this value, the UpsRemoteTempBad alarm will occur.') upsEnvRemoteTempUpperLimit = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-100, 200))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsEnvRemoteTempUpperLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteTempUpperLimit.setDescription('The Upper Limit of the remote temperature; if UpsEnvRemoteTemp rises above this value, the UpsRemoteTempBad alarm will occur. This value should be greater than UpsEnvRemoteTempLowerLimit.') upsEnvRemoteHumidityLowerLimit = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsEnvRemoteHumidityLowerLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteHumidityLowerLimit.setDescription('The Lower Limit of the remote humidity reading; if UpsEnvRemoteHumidity falls below this value, the UpsRemoteHumidityBad alarm will occur.') upsEnvRemoteHumidityUpperLimit = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsEnvRemoteHumidityUpperLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteHumidityUpperLimit.setDescription('The Upper Limit of the remote humidity reading; if UpsEnvRemoteHumidity rises above this value, the UpsRemoteHumidityBad alarm will occur. This value should be greater than UpsEnvRemoteHumidityLowerLimit.') upsTestBattery = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 7, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("startTest", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsTestBattery.setStatus('mandatory') if mibBuilder.loadTexts: upsTestBattery.setDescription('Setting this variable to startTest initiates the battery test. All other set values are invalid.') upsTestBatteryStatus = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 7, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("unknown", 1), ("passed", 2), ("failed", 3), ("inProgress", 4), ("notSupported", 5), ("inhibited", 6), ("scheduled", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsTestBatteryStatus.setStatus('mandatory') if mibBuilder.loadTexts: upsTestBatteryStatus.setDescription('Reading this enumerated value gives an indication of the UPS Battery test status.') upsTestTrap = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 7, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("startTestTrap", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsTestTrap.setStatus('mandatory') if mibBuilder.loadTexts: upsTestTrap.setDescription('Setting this variable to startTestTrap initiates a TrapTest is sent out from HPMM. All other set values are invalid.') upsControlOutputOffDelay = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsControlOutputOffDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsControlOutputOffDelay.setDescription('Setting this value to other than zero will cause the UPS output to turn off after the number of seconds. Setting it to 0 will cause an attempt to abort a pending shutdown.') upsControlOutputOnDelay = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsControlOutputOnDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsControlOutputOnDelay.setDescription('Setting this value to other than zero will cause the UPS output to turn on after the number of seconds. Setting it to 0 will cause an attempt to abort a pending startup.') upsControlOutputOffTrapDelay = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsControlOutputOffTrapDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsControlOutputOffTrapDelay.setDescription('When UpsControlOutputOffDelay reaches this value, a trap will be sent.') upsControlOutputOnTrapDelay = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsControlOutputOnTrapDelay.setStatus('deprecated') if mibBuilder.loadTexts: upsControlOutputOnTrapDelay.setDescription('When UpsControlOutputOnDelay reaches this value, a UpsOutputOff trap will be sent.') upsControlToBypassDelay = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsControlToBypassDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsControlToBypassDelay.setDescription('Setting this value to other than zero will cause the UPS output to go to Bypass after the number of seconds. If the Bypass is unavailable, this may cause the UPS to not supply power to the load. Setting it to 0 will cause an attempt to abort a pending shutdown.') upsLoadShedSecsWithRestart = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsLoadShedSecsWithRestart.setStatus('mandatory') if mibBuilder.loadTexts: upsLoadShedSecsWithRestart.setDescription("Setting this value will cause the UPS output to turn off after the set number of seconds, then restart (after a UPS-defined 'down time') when the utility is again available. Unlike UpsControlOutputOffDelay, which might or might not, this object always maps to the XCP 0x8A Load Dump & Restart command, so the desired shutdown and restart behavior is guaranteed to happen. Once set, this command cannot be aborted. This is the preferred Control object to use when performing an On Battery OS Shutdown.") upsConfigOutputVoltage = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsConfigOutputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigOutputVoltage.setDescription('The nominal UPS Output voltage per phase in volts.') upsConfigInputVoltage = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsConfigInputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigInputVoltage.setDescription('The nominal UPS Input voltage per phase in volts.') upsConfigOutputWatts = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsConfigOutputWatts.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigOutputWatts.setDescription('The nominal UPS available real power output in watts.') upsConfigOutputFreq = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsConfigOutputFreq.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigOutputFreq.setDescription('The nominal output frequency in tenths of Hz.') upsConfigDateAndTime = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 22))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsConfigDateAndTime.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigDateAndTime.setDescription('Date and time information for the UPS. Setting this variable will initiate a set UPS date and time to this value. Reading this variable will return the UPS time and date. This value is not referenced to sysUpTime. It is simply the clock value from the UPS real time clock. Format is as follows: MM/DD/YYYY:HH:MM:SS.') upsConfigLowOutputVoltageLimit = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsConfigLowOutputVoltageLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigLowOutputVoltageLimit.setDescription('The Lower limit for acceptable Output Voltage, per the UPS specifications.') upsConfigHighOutputVoltageLimit = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsConfigHighOutputVoltageLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigHighOutputVoltageLimit.setDescription('The Upper limit for acceptable Output Voltage, per the UPS specifications.') upsNumReceptacles = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsNumReceptacles.setStatus('mandatory') if mibBuilder.loadTexts: upsNumReceptacles.setDescription('The number of independently controllable Receptacles, as described in the UpsRecepTable.') upsRecepTable = MibTable((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2), ) if mibBuilder.loadTexts: upsRecepTable.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepTable.setDescription('The Aggregate Object with number of entries equal to NumReceptacles and including the UpsRecep group.') upsRecepEntry = MibTableRow((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1), ).setIndexNames((0, "CPQPOWER-MIB", "upsRecepIndex")) if mibBuilder.loadTexts: upsRecepEntry.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepEntry.setDescription('The Recep table entry, etc.') upsRecepIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsRecepIndex.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepIndex.setDescription('The number of the Receptacle. Serves as index for Receptacle table.') upsRecepStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("on", 1), ("off", 2), ("pendingOff", 3), ("pendingOn", 4), ("unknown", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsRecepStatus.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepStatus.setDescription('The Recep Status 1=On/Close, 2=Off/Open, 3=On w/Pending Off, 4=Off w/Pending ON, 5=Unknown.') upsRecepOffDelaySecs = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsRecepOffDelaySecs.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepOffDelaySecs.setDescription('The Delay until the Receptacle is turned Off. Setting this value to other than -1 will cause the UPS output to turn off after the number of seconds (0 is immediately). Setting it to -1 will cause an attempt to abort a pending shutdown. When this object is set while the UPS is On Battery, it is not necessary to set UpsRecepOnDelaySecs, since the outlet will turn back on automatically when power is available again.') upsRecepOnDelaySecs = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsRecepOnDelaySecs.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepOnDelaySecs.setDescription(' The Delay until the Receptacle is turned On. Setting this value to other than -1 will cause the UPS output to turn on after the number of seconds (0 is immediately). Setting it to -1 will cause an attempt to abort a pending restart.') upsRecepAutoOffDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 32767))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsRecepAutoOffDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepAutoOffDelay.setDescription('The delay after going On Battery until the Receptacle is automatically turned Off. A value of -1 means that this Output should never be turned Off automatically, but must be turned Off only by command. Values from 0 to 30 are valid, but probably innappropriate. The AutoOffDelay can be used to prioritize loads in the event of a prolonged power outage; less critical loads will turn off earlier to extend battery time for the more critical loads. If the utility power is restored before the AutoOff delay counts down to 0 on an outlet, that outlet will not turn Off.') upsRecepAutoOnDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 32767))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsRecepAutoOnDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepAutoOnDelay.setDescription('Seconds delay after the Outlet is signaled to turn On before the Output is Automatically turned ON. A value of -1 means that this Output should never be turned On automatically, but only when specifically commanded to do so. A value of 0 means that the Receptacle should come On immediately at power-up or for an On command.') upsRecepShedSecsWithRestart = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsRecepShedSecsWithRestart.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepShedSecsWithRestart.setDescription("Setting this value will cause the UPS output to turn off after the set number of seconds, then restart (after a UPS-defined 'down time') when the utility is again available. Unlike UpsRecepOffDelaySecs, which might or might not, this object always maps to the XCP 0x8A Load Dump & Restart command, so the desired shutdown and restart behavior is guaranteed to happen. Once set, this command cannot be aborted.") upsTopologyType = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 11, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 32767))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsTopologyType.setStatus('mandatory') if mibBuilder.loadTexts: upsTopologyType.setDescription("Value which denotes the type of UPS by its power topology. Values are the same as those described in the XCP Topology block's Overall Topology field.") upsTopoMachineCode = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 11, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 32767))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsTopoMachineCode.setStatus('mandatory') if mibBuilder.loadTexts: upsTopoMachineCode.setDescription("ID Value which denotes the Compaq/HP model of the UPS for software. Values are the same as those described in the XCP Configuration block's Machine Code field.") upsTopoUnitNumber = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 11, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: upsTopoUnitNumber.setStatus('mandatory') if mibBuilder.loadTexts: upsTopoUnitNumber.setDescription("Identifies which unit and what type of data is being reported. A value of 0 means that this MIB information comes from the top-level system view (eg, manifold module or system bypass cabinet reporting total system output). Standalone units also use a value of 0, since they are the 'full system' view. A value of 1 or higher indicates the number of the module in the system which is reporting only its own data in the HP MIB objects.") upsTopoPowerStrategy = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 11, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("highAlert", 1), ("standard", 2), ("enableHighEfficiency", 3), ("immediateHighEfficiency", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: upsTopoPowerStrategy.setStatus('mandatory') if mibBuilder.loadTexts: upsTopoPowerStrategy.setDescription('Value which denotes which Power Strategy is currently set for the UPS. The values are: highAlert(1) - The UPS shall optimize its operating state to maximize its power-protection levels. This mode will be held for at most 24 hours. standard(2) - Balanced, normal power protection strategy. UPS will not enter HE operating mode from this setting. enableHighEfficiency(3) - The UPS is enabled to enter HE operating mode to optimize its operating state to maximize its efficiency, when conditions change to permit it (as determined by the UPS). forceHighEfficiency(4) - If this value is permitted to be Set for this UPS, and if conditions permit, requires the UPS to enter High Efficiency mode now, without delay (for as long as utility conditions permit). After successfully set to forceHighEfficiency(4), UpsTopoPowerStrategy changes to value enableHighEfficiency(3). UpsOutputSource will indicate if the UPS status is actually operating in High Efficiency mode.') pdrName = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pdrName.setStatus('mandatory') if mibBuilder.loadTexts: pdrName.setDescription('The string identify the device.') pdrModel = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrModel.setStatus('mandatory') if mibBuilder.loadTexts: pdrModel.setDescription('The Device Model.') pdrManufacturer = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrManufacturer.setStatus('mandatory') if mibBuilder.loadTexts: pdrManufacturer.setDescription('The Device Manufacturer Name (e.g. Hewlett-Packard).') pdrFirmwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrFirmwareVersion.setStatus('mandatory') if mibBuilder.loadTexts: pdrFirmwareVersion.setDescription('The firmware revision level of the device.') pdrPartNumber = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPartNumber.setStatus('mandatory') if mibBuilder.loadTexts: pdrPartNumber.setDescription('The device part number.') pdrSerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrSerialNumber.setStatus('mandatory') if mibBuilder.loadTexts: pdrSerialNumber.setDescription("The PDR's serial number.") pdrVARating = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrVARating.setStatus('mandatory') if mibBuilder.loadTexts: pdrVARating.setDescription('The VA Rating of this PDR (all phases)') pdrNominalOutputVoltage = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrNominalOutputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: pdrNominalOutputVoltage.setDescription('The nominal Output Voltage may differ from the nominal Input Voltage if the PDR has an input transformer') pdrNumPhases = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrNumPhases.setStatus('mandatory') if mibBuilder.loadTexts: pdrNumPhases.setDescription('The number of phases for this PDR') pdrNumPanels = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrNumPanels.setStatus('mandatory') if mibBuilder.loadTexts: pdrNumPanels.setDescription('The number of panels or subfeeds in this PDR') pdrNumBreakers = MibScalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrNumBreakers.setStatus('mandatory') if mibBuilder.loadTexts: pdrNumBreakers.setDescription('The number of breakers in this PDR') pdrPanelTable = MibTable((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1), ) if mibBuilder.loadTexts: pdrPanelTable.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelTable.setDescription('Aggregate Object with number of entries equal to pdrNumPanels') pdrPanelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1), ).setIndexNames((0, "CPQPOWER-MIB", "pdrPanelIndex")) if mibBuilder.loadTexts: pdrPanelEntry.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelEntry.setDescription('The panel table entry containing all power parameters for each panel.') pdrPanelIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelIndex.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelIndex.setDescription('Index for the pdrPanelEntry table.') pdrPanelFrequency = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelFrequency.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelFrequency.setDescription('The present frequency reading for the panel voltage.') pdrPanelPower = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelPower.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelPower.setDescription('The present power of the panel.') pdrPanelRatedCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelRatedCurrent.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelRatedCurrent.setDescription('The present rated current of the panel.') pdrPanelMonthlyKWH = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelMonthlyKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelMonthlyKWH.setDescription('The accumulated KWH for this panel since the beginning of this calendar month or since the last reset.') pdrPanelYearlyKWH = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelYearlyKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelYearlyKWH.setDescription('The accumulated KWH for this panel since the beginning of this calendar year or since the last reset.') pdrPanelTotalKWH = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelTotalKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelTotalKWH.setDescription('The accumulated KWH for this panel since it was put into service or since the last reset.') pdrPanelVoltageA = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelVoltageA.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelVoltageA.setDescription('The measured panel output voltage.') pdrPanelVoltageB = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelVoltageB.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelVoltageB.setDescription('The measured panel output voltage.') pdrPanelVoltageC = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelVoltageC.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelVoltageC.setDescription('The measured panel output voltage.') pdrPanelCurrentA = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelCurrentA.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelCurrentA.setDescription('The measured panel output current.') pdrPanelCurrentB = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelCurrentB.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelCurrentB.setDescription('The measured panel output current.') pdrPanelCurrentC = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelCurrentC.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelCurrentC.setDescription('The measured panel output current.') pdrPanelLoadA = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelLoadA.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelLoadA.setDescription('The percentage of load is the ratio of each output current to the rated output current to the panel.') pdrPanelLoadB = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelLoadB.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelLoadB.setDescription('The percentage of load is the ratio of each output current to the rated output current to the panel.') pdrPanelLoadC = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrPanelLoadC.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelLoadC.setDescription('The percentage of load is the ratio of each output current to the rated output current to the panel.') pdrBreakerTable = MibTable((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1), ) if mibBuilder.loadTexts: pdrBreakerTable.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerTable.setDescription('List of breaker table entries. The number of entries is given by pdrNumBreakers for this panel.') pdrBreakerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1), ).setIndexNames((0, "CPQPOWER-MIB", "pdrPanelIndex"), (0, "CPQPOWER-MIB", "pdrBreakerIndex")) if mibBuilder.loadTexts: pdrBreakerEntry.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerEntry.setDescription('An entry containing information applicable to a particular output breaker of a particular panel.') pdrBreakerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerIndex.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerIndex.setDescription('The index of breakers. 42 breakers in each panel, arranged in odd and even columns') pdrBreakerPanel = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerPanel.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerPanel.setDescription('The index of panel that these breakers are installed on.') pdrBreakerNumPosition = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerNumPosition.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerNumPosition.setDescription('The position of this breaker in the panel, 1-phase breaker or n-m breaker for 2-phase or n-m-k breaker for 3-phase.') pdrBreakerNumPhases = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerNumPhases.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerNumPhases.setDescription('The number of phase for this particular breaker.') pdrBreakerNumSequence = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerNumSequence.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerNumSequence.setDescription('The sequence of this breaker. i.e. 1 for single phase 1,2 for 2-phase or 1,2,3 for 3-phase.') pdrBreakerRatedCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerRatedCurrent.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerRatedCurrent.setDescription('The rated current in Amps for this particular breaker.') pdrBreakerMonthlyKWH = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerMonthlyKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerMonthlyKWH.setDescription('The accumulated KWH for this breaker since the beginning of this calendar month or since the last reset.') pdrBreakerYearlyKWH = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerYearlyKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerYearlyKWH.setDescription('The accumulated KWH for this breaker since the beginning of this calendar year or since the last reset.') pdrBreakerTotalKWH = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerTotalKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerTotalKWH.setDescription('The accumulated KWH for this breaker since it was put into service or since the last reset.') pdrBreakerCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerCurrent.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerCurrent.setDescription('The measured output current for this breaker Current.') pdrBreakerCurrentPercent = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerCurrentPercent.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerCurrentPercent.setDescription('The ratio of output current over rated current for each breaker.') pdrBreakerPower = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerPower.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerPower.setDescription('The power for this breaker.') pdrBreakerPercentWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200))).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerPercentWarning.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerPercentWarning.setDescription('The percentage of Warning set for this breaker.') pdrBreakerPercentOverload = MibTableColumn((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pdrBreakerPercentOverload.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerPercentOverload.setDescription('The percentage of Overload set for this breaker.') mibBuilder.exportSymbols("CPQPOWER-MIB", upsEnvRemoteTempUpperLimit=upsEnvRemoteTempUpperLimit, upsRecepAutoOffDelay=upsRecepAutoOffDelay, pduOutputBreakerTable=pduOutputBreakerTable, upsEnvRemoteHumidityUpperLimit=upsEnvRemoteHumidityUpperLimit, upsOutputPhase=upsOutputPhase, pduIdentIndex=pduIdentIndex, upsBypassNumPhases=upsBypassNumPhases, upsTopology=upsTopology, upsTestBatteryStatus=upsTestBatteryStatus, deviceMACAddress=deviceMACAddress, pduControllable=pduControllable, upsOutputEntry=upsOutputEntry, upsBypassFrequency=upsBypassFrequency, trapWarning=trapWarning, pdrBreakerTotalKWH=pdrBreakerTotalKWH, upsRecepAutoOnDelay=upsRecepAutoOnDelay, deviceIdentName=deviceIdentName, upsInputVoltage=upsInputVoltage, pduOutputBreakerEntry=pduOutputBreakerEntry, pdrPanelCurrentA=pdrPanelCurrentA, upsInputSource=upsInputSource, upsControlOutputOffTrapDelay=upsControlOutputOffTrapDelay, upsOutputNumPhases=upsOutputNumPhases, upsEnvRemoteHumidity=upsEnvRemoteHumidity, trapInformation=trapInformation, pdrPanelRatedCurrent=pdrPanelRatedCurrent, deviceHardwareVersion=deviceHardwareVersion, upsRecep=upsRecep, pduOutputTable=pduOutputTable, pduOutputPower=pduOutputPower, powerDevice=powerDevice, pdrPanelYearlyKWH=pdrPanelYearlyKWH, pdrName=pdrName, upsTopoMachineCode=upsTopoMachineCode, upsRecepOffDelaySecs=upsRecepOffDelaySecs, trapInfo=trapInfo, breakerIndex=breakerIndex, upsContactIndex=upsContactIndex, upsOutputSource=upsOutputSource, upsBatteryAbmStatus=upsBatteryAbmStatus, upsBatCapacity=upsBatCapacity, pdrPanelVoltageB=pdrPanelVoltageB, upsOutput=upsOutput, upsTopoUnitNumber=upsTopoUnitNumber, pduOutputIndex=pduOutputIndex, pduInputIndex=pduInputIndex, upsBattery=upsBattery, trapDeviceDetails=trapDeviceDetails, upsRecepShedSecsWithRestart=upsRecepShedSecsWithRestart, upsBypassTable=upsBypassTable, upsControlToBypassDelay=upsControlToBypassDelay, pduIdent=pduIdent, upsRecepTable=upsRecepTable, pdrPanelPower=pdrPanelPower, pdrBreakerTable=pdrBreakerTable, trapCritical=trapCritical, upsEnvAmbientLowerLimit=upsEnvAmbientLowerLimit, pdrPanelCurrentC=pdrPanelCurrentC, upsIdentModel=upsIdentModel, upsContactState=upsContactState, pduInput=pduInput, pduPartNumber=pduPartNumber, upsContactDescr=upsContactDescr, deviceManufacturer=deviceManufacturer, upsInput=upsInput, breakerStatus=breakerStatus, pdrBreakerPercentOverload=pdrBreakerPercentOverload, upsEnvAmbientHumidity=upsEnvAmbientHumidity, upsBatCurrent=upsBatCurrent, trapDescription=trapDescription, deviceSerialNumber=deviceSerialNumber, pdrBreakerCurrentPercent=pdrBreakerCurrentPercent, upsContactsTableEntry=upsContactsTableEntry, trapCleared=trapCleared, upsInputEntry=upsInputEntry, upsControlOutputOffDelay=upsControlOutputOffDelay, breakerVoltage=breakerVoltage, upsBypassPhase=upsBypassPhase, upsInputPhase=upsInputPhase, pdrNominalOutputVoltage=pdrNominalOutputVoltage, upsBatVoltage=upsBatVoltage, pduName=pduName, pdrBreakerNumSequence=pdrBreakerNumSequence, upsInputNumPhases=upsInputNumPhases, upsConfigHighOutputVoltageLimit=upsConfigHighOutputVoltageLimit, upsControlOutputOnTrapDelay=upsControlOutputOnTrapDelay, upsConfigOutputWatts=upsConfigOutputWatts, pdrPanel=pdrPanel, upsBypassEntry=upsBypassEntry, upsEnvironment=upsEnvironment, pdrPanelTotalKWH=pdrPanelTotalKWH, pdrPanelEntry=pdrPanelEntry, upsConfigOutputVoltage=upsConfigOutputVoltage, pduIdentEntry=pduIdentEntry, pdrNumPanels=pdrNumPanels, pdrManufacturer=pdrManufacturer, pdrBreaker=pdrBreaker, upsEnvAmbientUpperLimit=upsEnvAmbientUpperLimit, pduIdentTable=pduIdentTable, numOfPdu=numOfPdu, pdrPanelLoadB=pdrPanelLoadB, deviceTrapInitialization=deviceTrapInitialization, ups=ups, upsBypassVoltage=upsBypassVoltage, inputVoltage=inputVoltage, pdrPanelLoadC=pdrPanelLoadC, upsControl=upsControl, pdrPartNumber=pdrPartNumber, pdrBreakerEntry=pdrBreakerEntry, trapTest=trapTest, breakerPercentLoad=breakerPercentLoad, upsOutputCurrent=upsOutputCurrent, pduManufacturer=pduManufacturer, pduInputTable=pduInputTable, pduOutputEntry=pduOutputEntry, pduOutputHeat=pduOutputHeat, pdrPanelCurrentB=pdrPanelCurrentB, upsBatTimeRemaining=upsBatTimeRemaining, upsConfigOutputFreq=upsConfigOutputFreq, pdrFirmwareVersion=pdrFirmwareVersion, pdrBreakerPanel=pdrBreakerPanel, pduOutput=pduOutput, upsConfigLowOutputVoltageLimit=upsConfigLowOutputVoltageLimit, pdrSerialNumber=pdrSerialNumber, managementModuleIdent=managementModuleIdent, pdrBreakerPercentWarning=pdrBreakerPercentWarning, upsRecepEntry=upsRecepEntry, pdrPanelMonthlyKWH=pdrPanelMonthlyKWH, pdrBreakerRatedCurrent=pdrBreakerRatedCurrent, upsControlOutputOnDelay=upsControlOutputOnDelay, upsTopoPowerStrategy=upsTopoPowerStrategy, deviceFirmwareVersion=deviceFirmwareVersion, pdrVARating=pdrVARating, upsOutputFrequency=upsOutputFrequency, pduInputEntry=pduInputEntry, upsConfigDateAndTime=upsConfigDateAndTime, pdrBreakerNumPosition=pdrBreakerNumPosition, upsEnvRemoteTempLowerLimit=upsEnvRemoteTempLowerLimit, upsInputLineBads=upsInputLineBads, pdrPanelTable=pdrPanelTable, pdrNumPhases=pdrNumPhases, upsInputFrequency=upsInputFrequency, upsRecepOnDelaySecs=upsRecepOnDelaySecs, pduModel=pduModel, upsEnvRemoteTemp=upsEnvRemoteTemp, cpqPower=cpqPower, upsBypass=upsBypass, upsContactsTable=upsContactsTable, pdrPanelVoltageC=pdrPanelVoltageC, pduOutputNumBreakers=pduOutputNumBreakers, trapCode=trapCode, pdrPanelFrequency=pdrPanelFrequency, deviceModel=deviceModel, pdrBreakerYearlyKWH=pdrBreakerYearlyKWH, pdrBreakerCurrent=pdrBreakerCurrent, upsNumReceptacles=upsNumReceptacles, upsOutputLoad=upsOutputLoad, upsRecepStatus=upsRecepStatus, pdrPanelLoadA=pdrPanelLoadA, trapDeviceMgmtUrl=trapDeviceMgmtUrl, upsInputTable=upsInputTable, upsInputCurrent=upsInputCurrent, upsConfigInputVoltage=upsConfigInputVoltage, upsOutputTable=upsOutputTable, upsRecepIndex=upsRecepIndex, pduFirmwareVersion=pduFirmwareVersion, pduStatus=pduStatus, upsEnvAmbientTemp=upsEnvAmbientTemp, upsEnvRemoteHumidityLowerLimit=upsEnvRemoteHumidityLowerLimit, breakerCurrent=breakerCurrent, pdrModel=pdrModel, devicePartNumber=devicePartNumber, upsTestBattery=upsTestBattery, pduSerialNumber=pduSerialNumber, upsTopologyType=upsTopologyType, pdrNumBreakers=pdrNumBreakers, upsConfig=upsConfig, pdr=pdr, upsLoadShedSecsWithRestart=upsLoadShedSecsWithRestart, trapDeviceName=trapDeviceName, pdrBreakerNumPhases=pdrBreakerNumPhases, upsIdent=upsIdent, pdrIdent=pdrIdent, upsIdentOemCode=upsIdentOemCode, upsContactType=upsContactType, upsTestTrap=upsTestTrap, pdrBreakerIndex=pdrBreakerIndex, pdrPanelIndex=pdrPanelIndex, pdrBreakerMonthlyKWH=pdrBreakerMonthlyKWH, pduOutputLoad=pduOutputLoad, upsIdentSoftwareVersions=upsIdentSoftwareVersions, upsOutputWatts=upsOutputWatts, pdrBreakerPower=pdrBreakerPower, upsIdentManufacturer=upsIdentManufacturer, upsOutputVoltage=upsOutputVoltage, upsEnvNumContacts=upsEnvNumContacts, upsTest=upsTest, pdrPanelVoltageA=pdrPanelVoltageA, inputCurrent=inputCurrent, pdu=pdu, upsInputWatts=upsInputWatts)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, constraints_union, value_range_constraint, single_value_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint', 'ValueSizeConstraint') (compaq,) = mibBuilder.importSymbols('CPQHOST-MIB', 'compaq') (if_index, if_descr) = mibBuilder.importSymbols('IF-MIB', 'ifIndex', 'ifDescr') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (sys_location, sys_descr, sys_name, sys_contact) = mibBuilder.importSymbols('SNMPv2-MIB', 'sysLocation', 'sysDescr', 'sysName', 'sysContact') (notification_type, bits, integer32, module_identity, iso, counter64, counter32, notification_type, object_identity, unsigned32, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, mib_identifier, gauge32, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'NotificationType', 'Bits', 'Integer32', 'ModuleIdentity', 'iso', 'Counter64', 'Counter32', 'NotificationType', 'ObjectIdentity', 'Unsigned32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'MibIdentifier', 'Gauge32', 'IpAddress') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') cpq_power = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165)) power_device = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 1)) trap_info = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 1, 1)) management_module_ident = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 1, 2)) pdu = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 2)) pdu_ident = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 2, 1)) pdu_input = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 2, 2)) pdu_output = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 2, 3)) ups = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3)) ups_ident = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 1)) ups_battery = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 2)) ups_input = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 3)) ups_output = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 4)) ups_bypass = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 5)) ups_environment = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 6)) ups_test = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 7)) ups_control = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 8)) ups_config = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 9)) ups_recep = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 10)) ups_topology = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 3, 11)) pdr = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 4)) pdr_ident = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 4, 1)) pdr_panel = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 4, 2)) pdr_breaker = mib_identifier((1, 3, 6, 1, 4, 1, 232, 165, 4, 3)) trap_code = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: trapCode.setStatus('mandatory') if mibBuilder.loadTexts: trapCode.setDescription("A number identifying the event for the trap that was sent. Mapped unique trap code per unique event to be used by ISEE's decoder ring.") trap_description = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: trapDescription.setStatus('mandatory') if mibBuilder.loadTexts: trapDescription.setDescription('A string identifying the event for that last trap that was sent.') trap_device_mgmt_url = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: trapDeviceMgmtUrl.setStatus('mandatory') if mibBuilder.loadTexts: trapDeviceMgmtUrl.setDescription('A string contains the URL for the management software.') trap_device_details = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: trapDeviceDetails.setStatus('mandatory') if mibBuilder.loadTexts: trapDeviceDetails.setDescription('A string details information about the device, including model, serial number, part number, etc....') trap_device_name = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: trapDeviceName.setStatus('mandatory') if mibBuilder.loadTexts: trapDeviceName.setDescription('A string contains the name of the device.') trap_critical = notification_type((1, 3, 6, 1, 4, 1, 232, 165) + (0, 1)).setObjects(('SNMPv2-MIB', 'sysName'), ('CPQPOWER-MIB', 'trapCode'), ('CPQPOWER-MIB', 'trapDescription'), ('CPQPOWER-MIB', 'trapDeviceName'), ('CPQPOWER-MIB', 'trapDeviceDetails'), ('CPQPOWER-MIB', 'trapDeviceMgmtUrl')) if mibBuilder.loadTexts: trapCritical.setDescription('A critical alarm has occurred. Action: Check the Trap Details for more information.') trap_warning = notification_type((1, 3, 6, 1, 4, 1, 232, 165) + (0, 2)).setObjects(('SNMPv2-MIB', 'sysName'), ('CPQPOWER-MIB', 'trapCode'), ('CPQPOWER-MIB', 'trapDescription'), ('CPQPOWER-MIB', 'trapDeviceName'), ('CPQPOWER-MIB', 'trapDeviceDetails'), ('CPQPOWER-MIB', 'trapDeviceMgmtUrl')) if mibBuilder.loadTexts: trapWarning.setDescription('A warning alarm has occurred. Action: Check the Trap Details for more information.') trap_information = notification_type((1, 3, 6, 1, 4, 1, 232, 165) + (0, 3)).setObjects(('SNMPv2-MIB', 'sysName'), ('CPQPOWER-MIB', 'trapCode'), ('CPQPOWER-MIB', 'trapDescription'), ('CPQPOWER-MIB', 'trapDeviceName'), ('CPQPOWER-MIB', 'trapDeviceDetails'), ('CPQPOWER-MIB', 'trapDeviceMgmtUrl')) if mibBuilder.loadTexts: trapInformation.setDescription('An informational alarm has occurred. Action: Check the Trap Details for more information.') trap_cleared = notification_type((1, 3, 6, 1, 4, 1, 232, 165) + (0, 4)).setObjects(('SNMPv2-MIB', 'sysName'), ('CPQPOWER-MIB', 'trapCode'), ('CPQPOWER-MIB', 'trapDescription'), ('CPQPOWER-MIB', 'trapDeviceName'), ('CPQPOWER-MIB', 'trapDeviceDetails'), ('CPQPOWER-MIB', 'trapDeviceMgmtUrl')) if mibBuilder.loadTexts: trapCleared.setDescription('An alarm has cleared. Action: Check the Trap Details for more information.') trap_test = notification_type((1, 3, 6, 1, 4, 1, 232, 165) + (0, 5)).setObjects(('SNMPv2-MIB', 'sysName'), ('CPQPOWER-MIB', 'trapCode'), ('CPQPOWER-MIB', 'trapDescription'), ('CPQPOWER-MIB', 'trapDeviceName'), ('CPQPOWER-MIB', 'trapDeviceDetails'), ('CPQPOWER-MIB', 'trapDeviceMgmtUrl')) if mibBuilder.loadTexts: trapTest.setDescription('Test trap sent to a trap receiver to check proper reception of traps') device_trap_initialization = notification_type((1, 3, 6, 1, 4, 1, 232, 165) + (0, 6)).setObjects(('SNMPv2-MIB', 'sysName'), ('CPQPOWER-MIB', 'deviceIdentName')) if mibBuilder.loadTexts: deviceTrapInitialization.setDescription('This trap is sent each time a power device is initialized.') device_manufacturer = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 1), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceManufacturer.setStatus('mandatory') if mibBuilder.loadTexts: deviceManufacturer.setDescription('The device manufacturer.') device_model = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceModel.setStatus('mandatory') if mibBuilder.loadTexts: deviceModel.setDescription('The device model.') device_firmware_version = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceFirmwareVersion.setStatus('mandatory') if mibBuilder.loadTexts: deviceFirmwareVersion.setDescription('The device firmware version(s).') device_hardware_version = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceHardwareVersion.setStatus('mandatory') if mibBuilder.loadTexts: deviceHardwareVersion.setDescription('The device hardware version.') device_ident_name = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 5), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: deviceIdentName.setStatus('mandatory') if mibBuilder.loadTexts: deviceIdentName.setDescription('A string identifying the device.') device_part_number = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 6), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: devicePartNumber.setStatus('mandatory') if mibBuilder.loadTexts: devicePartNumber.setDescription('The device part number.') device_serial_number = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 7), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceSerialNumber.setStatus('mandatory') if mibBuilder.loadTexts: deviceSerialNumber.setDescription('The device serial number.') device_mac_address = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 1, 2, 8), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceMACAddress.setStatus('mandatory') if mibBuilder.loadTexts: deviceMACAddress.setDescription('The device MAC address.') num_of_pdu = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: numOfPdu.setStatus('mandatory') if mibBuilder.loadTexts: numOfPdu.setDescription('The number of PDUs.') pdu_ident_table = mib_table((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2)) if mibBuilder.loadTexts: pduIdentTable.setStatus('mandatory') if mibBuilder.loadTexts: pduIdentTable.setDescription('The Aggregate Object with number of entries equal to NumOfPdu and including the PduIdent group.') pdu_ident_entry = mib_table_row((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1)).setIndexNames((0, 'CPQPOWER-MIB', 'pduIdentIndex')) if mibBuilder.loadTexts: pduIdentEntry.setStatus('mandatory') if mibBuilder.loadTexts: pduIdentEntry.setDescription('The ident table entry containing the name, model, manufacturer, firmware version, part number, etc.') pdu_ident_index = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pduIdentIndex.setStatus('mandatory') if mibBuilder.loadTexts: pduIdentIndex.setDescription('Index for the PduIdentEntry table.') pdu_name = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readwrite') if mibBuilder.loadTexts: pduName.setStatus('mandatory') if mibBuilder.loadTexts: pduName.setDescription('The string identify the device.') pdu_model = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: pduModel.setStatus('mandatory') if mibBuilder.loadTexts: pduModel.setDescription('The Device Model.') pdu_manufacturer = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: pduManufacturer.setStatus('mandatory') if mibBuilder.loadTexts: pduManufacturer.setDescription('The Device Manufacturer Name (e.g. Hewlett-Packard).') pdu_firmware_version = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: pduFirmwareVersion.setStatus('mandatory') if mibBuilder.loadTexts: pduFirmwareVersion.setDescription('The firmware revision level of the device.') pdu_part_number = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 6), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: pduPartNumber.setStatus('mandatory') if mibBuilder.loadTexts: pduPartNumber.setDescription('The device part number.') pdu_serial_number = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 7), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: pduSerialNumber.setStatus('mandatory') if mibBuilder.loadTexts: pduSerialNumber.setDescription('The deice serial number.') pdu_status = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('other', 1), ('ok', 2), ('degraded', 3), ('failed', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: pduStatus.setStatus('mandatory') if mibBuilder.loadTexts: pduStatus.setDescription('The overall status of the device. A value of OK(2) indicates the device is operating normally. A value of degraded(3) indicates the device is operating with warning indicators. A value of failed(4) indicates the device is operating with critical indicators.') pdu_controllable = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 1, 2, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('yes', 1), ('no', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: pduControllable.setStatus('mandatory') if mibBuilder.loadTexts: pduControllable.setDescription('This object indicates whether or not the device is controllable.') pdu_input_table = mib_table((1, 3, 6, 1, 4, 1, 232, 165, 2, 2, 1)) if mibBuilder.loadTexts: pduInputTable.setStatus('mandatory') if mibBuilder.loadTexts: pduInputTable.setDescription('The Aggregate Object with number of entries equal to NumOfPdu and including the PduInput group.') pdu_input_entry = mib_table_row((1, 3, 6, 1, 4, 1, 232, 165, 2, 2, 1, 1)).setIndexNames((0, 'CPQPOWER-MIB', 'pduInputIndex')) if mibBuilder.loadTexts: pduInputEntry.setStatus('mandatory') if mibBuilder.loadTexts: pduInputEntry.setDescription('The input table entry containing the voltage and current for the PDU') pdu_input_index = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 2, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pduInputIndex.setStatus('mandatory') if mibBuilder.loadTexts: pduInputIndex.setDescription('Index for the PduInputEntry table.') input_voltage = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 2, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: inputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: inputVoltage.setDescription('The measured input voltage from the PDU meters in volts.') input_current = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 2, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: inputCurrent.setStatus('mandatory') if mibBuilder.loadTexts: inputCurrent.setDescription('The measured input current from the PDU meters in amps.') pdu_output_table = mib_table((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1)) if mibBuilder.loadTexts: pduOutputTable.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputTable.setDescription('The Aggregate Object with number of entries equal to NumOfPdu and including the PduInput group.') pdu_output_entry = mib_table_row((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1)).setIndexNames((0, 'CPQPOWER-MIB', 'pduOutputIndex')) if mibBuilder.loadTexts: pduOutputEntry.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputEntry.setDescription('The input table entry containing the name, heat load, current load, power load, firmware, etc.') pdu_output_index = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pduOutputIndex.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputIndex.setDescription('Index for the PduOutputEntry table.') pdu_output_load = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 200))).setMaxAccess('readonly') if mibBuilder.loadTexts: pduOutputLoad.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputLoad.setDescription('The device output load in percent of rated capacity. A value of -1 will be returned if the heat load is unable to be measured.') pdu_output_heat = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pduOutputHeat.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputHeat.setDescription('The total heat load measured on the PDU in BTUs. A value of -1 will be returned if the heat load is unable to be measured.') pdu_output_power = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pduOutputPower.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputPower.setDescription('The total power load measured on the PDU in watts. A value of -1 will be returned if the power load is unable to be measured.') pdu_output_num_breakers = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 1, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pduOutputNumBreakers.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputNumBreakers.setDescription('The number of breakers for the device. This variable indicates the number of rows in the breakers table.') pdu_output_breaker_table = mib_table((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2)) if mibBuilder.loadTexts: pduOutputBreakerTable.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputBreakerTable.setDescription('List of breaker table entries. The number of entries is given by pduOutputNumBreakers .') pdu_output_breaker_entry = mib_table_row((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1)).setIndexNames((0, 'CPQPOWER-MIB', 'pduOutputIndex'), (0, 'CPQPOWER-MIB', 'breakerIndex')) if mibBuilder.loadTexts: pduOutputBreakerEntry.setStatus('mandatory') if mibBuilder.loadTexts: pduOutputBreakerEntry.setDescription('An entry containing information applicable to an breaker.') breaker_index = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: breakerIndex.setStatus('mandatory') if mibBuilder.loadTexts: breakerIndex.setDescription('The breaker identifier.') breaker_voltage = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: breakerVoltage.setStatus('mandatory') if mibBuilder.loadTexts: breakerVoltage.setDescription('The breaker voltage in volts.') breaker_current = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: breakerCurrent.setStatus('mandatory') if mibBuilder.loadTexts: breakerCurrent.setDescription('The breaker current draw in Amps.') breaker_percent_load = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: breakerPercentLoad.setStatus('mandatory') if mibBuilder.loadTexts: breakerPercentLoad.setDescription('The breaker load in percent.') breaker_status = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 2, 3, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('normal', 1), ('overloadWarning', 2), ('overloadCritical', 3), ('voltageRangeWarning', 4), ('voltageRangeCritical', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: breakerStatus.setStatus('mandatory') if mibBuilder.loadTexts: breakerStatus.setDescription('This object indicates the status of the breaker. A value of normal(1) indicates the breaker is operating normally. A value of overloadWarning(2) indicates the breaker has an overload warning. A value of overloadCritical(3) indicates the breaker is overloaded. A value of voltageRangeWarning(4) indicates the breaker voltage is out of tolerance by 10-20%. A value of voltageRangeCritical(5) indicates the breaker voltage is out of tolerance by more than 20%. Note: Overload status has priority over voltage tolerance status.') ups_ident_manufacturer = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(0, 31))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsIdentManufacturer.setStatus('mandatory') if mibBuilder.loadTexts: upsIdentManufacturer.setDescription('The UPS Manufacturer Name (e.g. Hewlett-Packard).') ups_ident_model = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsIdentModel.setStatus('mandatory') if mibBuilder.loadTexts: upsIdentModel.setDescription('The UPS Model;Part number;Serial number (e.g. HP R5500 XR;204451-B21;B00123456W).') ups_ident_software_versions = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsIdentSoftwareVersions.setStatus('mandatory') if mibBuilder.loadTexts: upsIdentSoftwareVersions.setDescription('The firmware revision level(s) of the UPS microcontroller(s).') ups_ident_oem_code = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsIdentOemCode.setStatus('mandatory') if mibBuilder.loadTexts: upsIdentOemCode.setDescription('A binary code indicating vendor. This should be a ?0x0c? for HP') ups_bat_time_remaining = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 2, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsBatTimeRemaining.setStatus('mandatory') if mibBuilder.loadTexts: upsBatTimeRemaining.setDescription('Battery run time in seconds before UPS turns off due to low battery.') ups_bat_voltage = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 2, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsBatVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsBatVoltage.setDescription('Battery voltage as reported by the UPS meters.') ups_bat_current = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 2, 3), integer32().subtype(subtypeSpec=value_range_constraint(-2147483648, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsBatCurrent.setStatus('mandatory') if mibBuilder.loadTexts: upsBatCurrent.setDescription('Battery Current as reported by the UPS metering. Current is positive when discharging, negative when recharging the battery.') ups_bat_capacity = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 2, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsBatCapacity.setStatus('mandatory') if mibBuilder.loadTexts: upsBatCapacity.setDescription('Battery percent charge.') ups_battery_abm_status = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 2, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('batteryCharging', 1), ('batteryDischarging', 2), ('batteryFloating', 3), ('batteryResting', 4), ('unknown', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsBatteryAbmStatus.setStatus('mandatory') if mibBuilder.loadTexts: upsBatteryAbmStatus.setDescription('Gives the status of the Advanced Battery Management; batteryFloating(3) status means that the charger is temporarily charging the battery to its float voltage; batteryResting(4) is the state when the battery is fully charged and none of the other actions (charging/discharging/floating) is being done.') ups_input_frequency = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsInputFrequency.setStatus('mandatory') if mibBuilder.loadTexts: upsInputFrequency.setDescription('The utility line frequency in tenths of Hz.') ups_input_line_bads = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: upsInputLineBads.setStatus('mandatory') if mibBuilder.loadTexts: upsInputLineBads.setDescription('The number of times the Input was out of tolerance in voltage or frequency.') ups_input_num_phases = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsInputNumPhases.setStatus('mandatory') if mibBuilder.loadTexts: upsInputNumPhases.setDescription('') ups_input_table = mib_table((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4)) if mibBuilder.loadTexts: upsInputTable.setStatus('mandatory') if mibBuilder.loadTexts: upsInputTable.setDescription('The Aggregate Object with number of entries equal to NumPhases and including the UpsInput group.') ups_input_entry = mib_table_row((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4, 1)).setIndexNames((0, 'CPQPOWER-MIB', 'upsInputPhase')) if mibBuilder.loadTexts: upsInputEntry.setStatus('mandatory') if mibBuilder.loadTexts: upsInputEntry.setDescription('The input table entry containing the current, voltage, etc.') ups_input_phase = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsInputPhase.setStatus('mandatory') if mibBuilder.loadTexts: upsInputPhase.setDescription('The number of the phase. Serves as index for input table.') ups_input_voltage = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsInputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsInputVoltage.setDescription('The measured input voltage from the UPS meters in volts.') ups_input_current = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsInputCurrent.setStatus('mandatory') if mibBuilder.loadTexts: upsInputCurrent.setDescription('The measured input current from the UPS meters in amps.') ups_input_watts = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 4, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsInputWatts.setStatus('mandatory') if mibBuilder.loadTexts: upsInputWatts.setDescription('The measured input real power in watts.') ups_input_source = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 3, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('other', 1), ('none', 2), ('primaryUtility', 3), ('bypassFeed', 4), ('secondaryUtility', 5), ('generator', 6), ('flywheel', 7), ('fuelcell', 8)))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsInputSource.setStatus('mandatory') if mibBuilder.loadTexts: upsInputSource.setDescription('The present external source of input power. The enumeration none(2) indicates that there is no external source of power, for example, the UPS is On Battery (an internal source). The bypassFeed(4) can only be used when the Bypass source is known to be a separate utility feed than the primaryUtility(3).') ups_output_load = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 200))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsOutputLoad.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputLoad.setDescription('The UPS output load in percent of rated capacity.') ups_output_frequency = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsOutputFrequency.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputFrequency.setDescription('The measured UPS output frequency in tenths of Hz.') ups_output_num_phases = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsOutputNumPhases.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputNumPhases.setDescription('The number of metered output phases, serves as the table index.') ups_output_table = mib_table((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4)) if mibBuilder.loadTexts: upsOutputTable.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputTable.setDescription('The Aggregate Object with number of entries equal to NumPhases and including the UpsOutput group.') ups_output_entry = mib_table_row((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4, 1)).setIndexNames((0, 'CPQPOWER-MIB', 'upsOutputPhase')) if mibBuilder.loadTexts: upsOutputEntry.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputEntry.setDescription('Output Table Entry containing voltage, current, etc.') ups_output_phase = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsOutputPhase.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputPhase.setDescription('The number {1..3} of the output phase.') ups_output_voltage = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsOutputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputVoltage.setDescription('The measured output voltage from the UPS metering in volts.') ups_output_current = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsOutputCurrent.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputCurrent.setDescription('The measured UPS output current in amps.') ups_output_watts = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 4, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsOutputWatts.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputWatts.setDescription('The measured real output power in watts.') ups_output_source = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 4, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=named_values(('other', 1), ('none', 2), ('normal', 3), ('bypass', 4), ('battery', 5), ('booster', 6), ('reducer', 7), ('parallelCapacity', 8), ('parallelRedundant', 9), ('highEfficiencyMode', 10)))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsOutputSource.setStatus('mandatory') if mibBuilder.loadTexts: upsOutputSource.setDescription('The present source of output power. The enumeration none(2) indicates that there is no source of output power (and therefore no output power), for example, the system has opened the output breaker.') ups_bypass_frequency = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsBypassFrequency.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassFrequency.setDescription('The bypass frequency in tenths of Hz.') ups_bypass_num_phases = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsBypassNumPhases.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassNumPhases.setDescription('The number of lines in the UPS bypass table.') ups_bypass_table = mib_table((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 3)) if mibBuilder.loadTexts: upsBypassTable.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassTable.setDescription('') ups_bypass_entry = mib_table_row((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 3, 1)).setIndexNames((0, 'CPQPOWER-MIB', 'upsBypassPhase')) if mibBuilder.loadTexts: upsBypassEntry.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassEntry.setDescription('Entry in the UpsBypassTable.') ups_bypass_phase = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsBypassPhase.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassPhase.setDescription('The Bypass Phase, index for the table.') ups_bypass_voltage = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 5, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsBypassVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsBypassVoltage.setDescription('The measured UPS bypass voltage in volts.') ups_env_ambient_temp = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 1), integer32().subtype(subtypeSpec=value_range_constraint(-100, 200))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsEnvAmbientTemp.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvAmbientTemp.setDescription('The reading of the ambient temperature in the vicinity of the UPS or SNMP agent.') ups_env_ambient_lower_limit = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 2), integer32().subtype(subtypeSpec=value_range_constraint(-100, 200))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsEnvAmbientLowerLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvAmbientLowerLimit.setDescription('The Lower Limit of the ambient temperature; if UpsEnvAmbientTemp falls below this value, the UpsAmbientTempBad alarm will occur.') ups_env_ambient_upper_limit = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 3), integer32().subtype(subtypeSpec=value_range_constraint(-100, 200))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsEnvAmbientUpperLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvAmbientUpperLimit.setDescription('The Upper Limit of the ambient temperature; if UpsEnvAmbientTemp rises above this value, the UpsAmbientTempBad alarm will occur. This value should be greater than UpsEnvAmbientLowerLimit.') ups_env_ambient_humidity = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsEnvAmbientHumidity.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvAmbientHumidity.setDescription('The reading of the ambient humidity in the vicinity of the UPS or SNMP agent.') ups_env_remote_temp = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 5), integer32().subtype(subtypeSpec=value_range_constraint(-100, 200))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsEnvRemoteTemp.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteTemp.setDescription('The reading of a remote temperature sensor connected to the UPS or SNMP agent.') ups_env_remote_humidity = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsEnvRemoteHumidity.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteHumidity.setDescription('The reading of a remote humidity sensor connected to the UPS or SNMP agent.') ups_env_num_contacts = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 7), integer32().subtype(subtypeSpec=value_range_constraint(1, 1024))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsEnvNumContacts.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvNumContacts.setDescription('The number of Contacts in the UpsContactsTable. This object indicates the number of rows in the UpsContactsTable.') ups_contacts_table = mib_table((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8)) if mibBuilder.loadTexts: upsContactsTable.setStatus('mandatory') if mibBuilder.loadTexts: upsContactsTable.setDescription('A list of Contact Sensing table entries. The number of entries is given by the value of UpsEnvNumContacts.') ups_contacts_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8, 1)).setIndexNames((0, 'CPQPOWER-MIB', 'upsContactIndex')) if mibBuilder.loadTexts: upsContactsTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: upsContactsTableEntry.setDescription('An entry containing information applicable to a particular Contact input.') ups_contact_index = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1024))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsContactIndex.setStatus('mandatory') if mibBuilder.loadTexts: upsContactIndex.setDescription('The Contact identifier; identical to the Contact Number.') ups_contact_type = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('normallyOpen', 1), ('normallyClosed', 2), ('anyChange', 3), ('notUsed', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsContactType.setStatus('mandatory') if mibBuilder.loadTexts: upsContactType.setDescription("The normal state for this contact. The 'other' state is the Active state for generating the UpstdContactActiveNotice trap. If anyChange(3) is selected, then this trap is sent any time the contact changes to either Open or Closed. No traps are sent if the Contact is set to notUsed(4). In many cases, the configuration for Contacts may be done by other means, so this object may be read-only.") ups_contact_state = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('open', 1), ('closed', 2), ('openWithNotice', 3), ('closedWithNotice', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsContactState.setStatus('mandatory') if mibBuilder.loadTexts: upsContactState.setDescription('The current state of the Contact input; the value is based on the open/closed input state and the setting for UpsContactType. When entering the openWithNotice(3) and closedWithNotice(4) states, no entries added to the UpsAlarmTable, but the UpstdContactActiveNotice trap is sent.') ups_contact_descr = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 8, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsContactDescr.setStatus('mandatory') if mibBuilder.loadTexts: upsContactDescr.setDescription('A label identifying the Contact. This object should be set by the administrator.') ups_env_remote_temp_lower_limit = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 9), integer32().subtype(subtypeSpec=value_range_constraint(-100, 200))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsEnvRemoteTempLowerLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteTempLowerLimit.setDescription('The Lower Limit of the remote temperature; if UpsEnvRemoteTemp falls below this value, the UpsRemoteTempBad alarm will occur.') ups_env_remote_temp_upper_limit = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 10), integer32().subtype(subtypeSpec=value_range_constraint(-100, 200))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsEnvRemoteTempUpperLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteTempUpperLimit.setDescription('The Upper Limit of the remote temperature; if UpsEnvRemoteTemp rises above this value, the UpsRemoteTempBad alarm will occur. This value should be greater than UpsEnvRemoteTempLowerLimit.') ups_env_remote_humidity_lower_limit = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsEnvRemoteHumidityLowerLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteHumidityLowerLimit.setDescription('The Lower Limit of the remote humidity reading; if UpsEnvRemoteHumidity falls below this value, the UpsRemoteHumidityBad alarm will occur.') ups_env_remote_humidity_upper_limit = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 6, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsEnvRemoteHumidityUpperLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsEnvRemoteHumidityUpperLimit.setDescription('The Upper Limit of the remote humidity reading; if UpsEnvRemoteHumidity rises above this value, the UpsRemoteHumidityBad alarm will occur. This value should be greater than UpsEnvRemoteHumidityLowerLimit.') ups_test_battery = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 7, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1))).clone(namedValues=named_values(('startTest', 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsTestBattery.setStatus('mandatory') if mibBuilder.loadTexts: upsTestBattery.setDescription('Setting this variable to startTest initiates the battery test. All other set values are invalid.') ups_test_battery_status = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 7, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('unknown', 1), ('passed', 2), ('failed', 3), ('inProgress', 4), ('notSupported', 5), ('inhibited', 6), ('scheduled', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsTestBatteryStatus.setStatus('mandatory') if mibBuilder.loadTexts: upsTestBatteryStatus.setDescription('Reading this enumerated value gives an indication of the UPS Battery test status.') ups_test_trap = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 7, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1))).clone(namedValues=named_values(('startTestTrap', 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsTestTrap.setStatus('mandatory') if mibBuilder.loadTexts: upsTestTrap.setDescription('Setting this variable to startTestTrap initiates a TrapTest is sent out from HPMM. All other set values are invalid.') ups_control_output_off_delay = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsControlOutputOffDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsControlOutputOffDelay.setDescription('Setting this value to other than zero will cause the UPS output to turn off after the number of seconds. Setting it to 0 will cause an attempt to abort a pending shutdown.') ups_control_output_on_delay = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsControlOutputOnDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsControlOutputOnDelay.setDescription('Setting this value to other than zero will cause the UPS output to turn on after the number of seconds. Setting it to 0 will cause an attempt to abort a pending startup.') ups_control_output_off_trap_delay = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsControlOutputOffTrapDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsControlOutputOffTrapDelay.setDescription('When UpsControlOutputOffDelay reaches this value, a trap will be sent.') ups_control_output_on_trap_delay = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsControlOutputOnTrapDelay.setStatus('deprecated') if mibBuilder.loadTexts: upsControlOutputOnTrapDelay.setDescription('When UpsControlOutputOnDelay reaches this value, a UpsOutputOff trap will be sent.') ups_control_to_bypass_delay = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsControlToBypassDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsControlToBypassDelay.setDescription('Setting this value to other than zero will cause the UPS output to go to Bypass after the number of seconds. If the Bypass is unavailable, this may cause the UPS to not supply power to the load. Setting it to 0 will cause an attempt to abort a pending shutdown.') ups_load_shed_secs_with_restart = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 8, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsLoadShedSecsWithRestart.setStatus('mandatory') if mibBuilder.loadTexts: upsLoadShedSecsWithRestart.setDescription("Setting this value will cause the UPS output to turn off after the set number of seconds, then restart (after a UPS-defined 'down time') when the utility is again available. Unlike UpsControlOutputOffDelay, which might or might not, this object always maps to the XCP 0x8A Load Dump & Restart command, so the desired shutdown and restart behavior is guaranteed to happen. Once set, this command cannot be aborted. This is the preferred Control object to use when performing an On Battery OS Shutdown.") ups_config_output_voltage = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsConfigOutputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigOutputVoltage.setDescription('The nominal UPS Output voltage per phase in volts.') ups_config_input_voltage = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsConfigInputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigInputVoltage.setDescription('The nominal UPS Input voltage per phase in volts.') ups_config_output_watts = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsConfigOutputWatts.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigOutputWatts.setDescription('The nominal UPS available real power output in watts.') ups_config_output_freq = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsConfigOutputFreq.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigOutputFreq.setDescription('The nominal output frequency in tenths of Hz.') ups_config_date_and_time = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 5), display_string().subtype(subtypeSpec=value_size_constraint(0, 22))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsConfigDateAndTime.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigDateAndTime.setDescription('Date and time information for the UPS. Setting this variable will initiate a set UPS date and time to this value. Reading this variable will return the UPS time and date. This value is not referenced to sysUpTime. It is simply the clock value from the UPS real time clock. Format is as follows: MM/DD/YYYY:HH:MM:SS.') ups_config_low_output_voltage_limit = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsConfigLowOutputVoltageLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigLowOutputVoltageLimit.setDescription('The Lower limit for acceptable Output Voltage, per the UPS specifications.') ups_config_high_output_voltage_limit = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 9, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsConfigHighOutputVoltageLimit.setStatus('mandatory') if mibBuilder.loadTexts: upsConfigHighOutputVoltageLimit.setDescription('The Upper limit for acceptable Output Voltage, per the UPS specifications.') ups_num_receptacles = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsNumReceptacles.setStatus('mandatory') if mibBuilder.loadTexts: upsNumReceptacles.setDescription('The number of independently controllable Receptacles, as described in the UpsRecepTable.') ups_recep_table = mib_table((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2)) if mibBuilder.loadTexts: upsRecepTable.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepTable.setDescription('The Aggregate Object with number of entries equal to NumReceptacles and including the UpsRecep group.') ups_recep_entry = mib_table_row((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1)).setIndexNames((0, 'CPQPOWER-MIB', 'upsRecepIndex')) if mibBuilder.loadTexts: upsRecepEntry.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepEntry.setDescription('The Recep table entry, etc.') ups_recep_index = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsRecepIndex.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepIndex.setDescription('The number of the Receptacle. Serves as index for Receptacle table.') ups_recep_status = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('on', 1), ('off', 2), ('pendingOff', 3), ('pendingOn', 4), ('unknown', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsRecepStatus.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepStatus.setDescription('The Recep Status 1=On/Close, 2=Off/Open, 3=On w/Pending Off, 4=Off w/Pending ON, 5=Unknown.') ups_recep_off_delay_secs = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(-1, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsRecepOffDelaySecs.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepOffDelaySecs.setDescription('The Delay until the Receptacle is turned Off. Setting this value to other than -1 will cause the UPS output to turn off after the number of seconds (0 is immediately). Setting it to -1 will cause an attempt to abort a pending shutdown. When this object is set while the UPS is On Battery, it is not necessary to set UpsRecepOnDelaySecs, since the outlet will turn back on automatically when power is available again.') ups_recep_on_delay_secs = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(-1, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsRecepOnDelaySecs.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepOnDelaySecs.setDescription(' The Delay until the Receptacle is turned On. Setting this value to other than -1 will cause the UPS output to turn on after the number of seconds (0 is immediately). Setting it to -1 will cause an attempt to abort a pending restart.') ups_recep_auto_off_delay = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(-1, 32767))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsRecepAutoOffDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepAutoOffDelay.setDescription('The delay after going On Battery until the Receptacle is automatically turned Off. A value of -1 means that this Output should never be turned Off automatically, but must be turned Off only by command. Values from 0 to 30 are valid, but probably innappropriate. The AutoOffDelay can be used to prioritize loads in the event of a prolonged power outage; less critical loads will turn off earlier to extend battery time for the more critical loads. If the utility power is restored before the AutoOff delay counts down to 0 on an outlet, that outlet will not turn Off.') ups_recep_auto_on_delay = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(-1, 32767))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsRecepAutoOnDelay.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepAutoOnDelay.setDescription('Seconds delay after the Outlet is signaled to turn On before the Output is Automatically turned ON. A value of -1 means that this Output should never be turned On automatically, but only when specifically commanded to do so. A value of 0 means that the Receptacle should come On immediately at power-up or for an On command.') ups_recep_shed_secs_with_restart = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 3, 10, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsRecepShedSecsWithRestart.setStatus('mandatory') if mibBuilder.loadTexts: upsRecepShedSecsWithRestart.setDescription("Setting this value will cause the UPS output to turn off after the set number of seconds, then restart (after a UPS-defined 'down time') when the utility is again available. Unlike UpsRecepOffDelaySecs, which might or might not, this object always maps to the XCP 0x8A Load Dump & Restart command, so the desired shutdown and restart behavior is guaranteed to happen. Once set, this command cannot be aborted.") ups_topology_type = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 11, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 32767))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsTopologyType.setStatus('mandatory') if mibBuilder.loadTexts: upsTopologyType.setDescription("Value which denotes the type of UPS by its power topology. Values are the same as those described in the XCP Topology block's Overall Topology field.") ups_topo_machine_code = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 11, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 32767))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsTopoMachineCode.setStatus('mandatory') if mibBuilder.loadTexts: upsTopoMachineCode.setDescription("ID Value which denotes the Compaq/HP model of the UPS for software. Values are the same as those described in the XCP Configuration block's Machine Code field.") ups_topo_unit_number = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 11, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: upsTopoUnitNumber.setStatus('mandatory') if mibBuilder.loadTexts: upsTopoUnitNumber.setDescription("Identifies which unit and what type of data is being reported. A value of 0 means that this MIB information comes from the top-level system view (eg, manifold module or system bypass cabinet reporting total system output). Standalone units also use a value of 0, since they are the 'full system' view. A value of 1 or higher indicates the number of the module in the system which is reporting only its own data in the HP MIB objects.") ups_topo_power_strategy = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 3, 11, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('highAlert', 1), ('standard', 2), ('enableHighEfficiency', 3), ('immediateHighEfficiency', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: upsTopoPowerStrategy.setStatus('mandatory') if mibBuilder.loadTexts: upsTopoPowerStrategy.setDescription('Value which denotes which Power Strategy is currently set for the UPS. The values are: highAlert(1) - The UPS shall optimize its operating state to maximize its power-protection levels. This mode will be held for at most 24 hours. standard(2) - Balanced, normal power protection strategy. UPS will not enter HE operating mode from this setting. enableHighEfficiency(3) - The UPS is enabled to enter HE operating mode to optimize its operating state to maximize its efficiency, when conditions change to permit it (as determined by the UPS). forceHighEfficiency(4) - If this value is permitted to be Set for this UPS, and if conditions permit, requires the UPS to enter High Efficiency mode now, without delay (for as long as utility conditions permit). After successfully set to forceHighEfficiency(4), UpsTopoPowerStrategy changes to value enableHighEfficiency(3). UpsOutputSource will indicate if the UPS status is actually operating in High Efficiency mode.') pdr_name = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readwrite') if mibBuilder.loadTexts: pdrName.setStatus('mandatory') if mibBuilder.loadTexts: pdrName.setDescription('The string identify the device.') pdr_model = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrModel.setStatus('mandatory') if mibBuilder.loadTexts: pdrModel.setDescription('The Device Model.') pdr_manufacturer = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrManufacturer.setStatus('mandatory') if mibBuilder.loadTexts: pdrManufacturer.setDescription('The Device Manufacturer Name (e.g. Hewlett-Packard).') pdr_firmware_version = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrFirmwareVersion.setStatus('mandatory') if mibBuilder.loadTexts: pdrFirmwareVersion.setDescription('The firmware revision level of the device.') pdr_part_number = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPartNumber.setStatus('mandatory') if mibBuilder.loadTexts: pdrPartNumber.setDescription('The device part number.') pdr_serial_number = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 6), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrSerialNumber.setStatus('mandatory') if mibBuilder.loadTexts: pdrSerialNumber.setDescription("The PDR's serial number.") pdr_va_rating = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrVARating.setStatus('mandatory') if mibBuilder.loadTexts: pdrVARating.setDescription('The VA Rating of this PDR (all phases)') pdr_nominal_output_voltage = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrNominalOutputVoltage.setStatus('mandatory') if mibBuilder.loadTexts: pdrNominalOutputVoltage.setDescription('The nominal Output Voltage may differ from the nominal Input Voltage if the PDR has an input transformer') pdr_num_phases = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(1, 3))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrNumPhases.setStatus('mandatory') if mibBuilder.loadTexts: pdrNumPhases.setDescription('The number of phases for this PDR') pdr_num_panels = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrNumPanels.setStatus('mandatory') if mibBuilder.loadTexts: pdrNumPanels.setDescription('The number of panels or subfeeds in this PDR') pdr_num_breakers = mib_scalar((1, 3, 6, 1, 4, 1, 232, 165, 4, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrNumBreakers.setStatus('mandatory') if mibBuilder.loadTexts: pdrNumBreakers.setDescription('The number of breakers in this PDR') pdr_panel_table = mib_table((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1)) if mibBuilder.loadTexts: pdrPanelTable.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelTable.setDescription('Aggregate Object with number of entries equal to pdrNumPanels') pdr_panel_entry = mib_table_row((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1)).setIndexNames((0, 'CPQPOWER-MIB', 'pdrPanelIndex')) if mibBuilder.loadTexts: pdrPanelEntry.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelEntry.setDescription('The panel table entry containing all power parameters for each panel.') pdr_panel_index = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelIndex.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelIndex.setDescription('Index for the pdrPanelEntry table.') pdr_panel_frequency = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelFrequency.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelFrequency.setDescription('The present frequency reading for the panel voltage.') pdr_panel_power = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelPower.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelPower.setDescription('The present power of the panel.') pdr_panel_rated_current = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelRatedCurrent.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelRatedCurrent.setDescription('The present rated current of the panel.') pdr_panel_monthly_kwh = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelMonthlyKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelMonthlyKWH.setDescription('The accumulated KWH for this panel since the beginning of this calendar month or since the last reset.') pdr_panel_yearly_kwh = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelYearlyKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelYearlyKWH.setDescription('The accumulated KWH for this panel since the beginning of this calendar year or since the last reset.') pdr_panel_total_kwh = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelTotalKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelTotalKWH.setDescription('The accumulated KWH for this panel since it was put into service or since the last reset.') pdr_panel_voltage_a = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelVoltageA.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelVoltageA.setDescription('The measured panel output voltage.') pdr_panel_voltage_b = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelVoltageB.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelVoltageB.setDescription('The measured panel output voltage.') pdr_panel_voltage_c = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelVoltageC.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelVoltageC.setDescription('The measured panel output voltage.') pdr_panel_current_a = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelCurrentA.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelCurrentA.setDescription('The measured panel output current.') pdr_panel_current_b = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelCurrentB.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelCurrentB.setDescription('The measured panel output current.') pdr_panel_current_c = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelCurrentC.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelCurrentC.setDescription('The measured panel output current.') pdr_panel_load_a = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(0, 200))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelLoadA.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelLoadA.setDescription('The percentage of load is the ratio of each output current to the rated output current to the panel.') pdr_panel_load_b = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 200))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelLoadB.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelLoadB.setDescription('The percentage of load is the ratio of each output current to the rated output current to the panel.') pdr_panel_load_c = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 2, 1, 1, 16), integer32().subtype(subtypeSpec=value_range_constraint(0, 200))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrPanelLoadC.setStatus('mandatory') if mibBuilder.loadTexts: pdrPanelLoadC.setDescription('The percentage of load is the ratio of each output current to the rated output current to the panel.') pdr_breaker_table = mib_table((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1)) if mibBuilder.loadTexts: pdrBreakerTable.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerTable.setDescription('List of breaker table entries. The number of entries is given by pdrNumBreakers for this panel.') pdr_breaker_entry = mib_table_row((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1)).setIndexNames((0, 'CPQPOWER-MIB', 'pdrPanelIndex'), (0, 'CPQPOWER-MIB', 'pdrBreakerIndex')) if mibBuilder.loadTexts: pdrBreakerEntry.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerEntry.setDescription('An entry containing information applicable to a particular output breaker of a particular panel.') pdr_breaker_index = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerIndex.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerIndex.setDescription('The index of breakers. 42 breakers in each panel, arranged in odd and even columns') pdr_breaker_panel = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerPanel.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerPanel.setDescription('The index of panel that these breakers are installed on.') pdr_breaker_num_position = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerNumPosition.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerNumPosition.setDescription('The position of this breaker in the panel, 1-phase breaker or n-m breaker for 2-phase or n-m-k breaker for 3-phase.') pdr_breaker_num_phases = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerNumPhases.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerNumPhases.setDescription('The number of phase for this particular breaker.') pdr_breaker_num_sequence = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerNumSequence.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerNumSequence.setDescription('The sequence of this breaker. i.e. 1 for single phase 1,2 for 2-phase or 1,2,3 for 3-phase.') pdr_breaker_rated_current = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerRatedCurrent.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerRatedCurrent.setDescription('The rated current in Amps for this particular breaker.') pdr_breaker_monthly_kwh = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerMonthlyKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerMonthlyKWH.setDescription('The accumulated KWH for this breaker since the beginning of this calendar month or since the last reset.') pdr_breaker_yearly_kwh = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerYearlyKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerYearlyKWH.setDescription('The accumulated KWH for this breaker since the beginning of this calendar year or since the last reset.') pdr_breaker_total_kwh = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerTotalKWH.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerTotalKWH.setDescription('The accumulated KWH for this breaker since it was put into service or since the last reset.') pdr_breaker_current = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerCurrent.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerCurrent.setDescription('The measured output current for this breaker Current.') pdr_breaker_current_percent = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 200))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerCurrentPercent.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerCurrentPercent.setDescription('The ratio of output current over rated current for each breaker.') pdr_breaker_power = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 12), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerPower.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerPower.setDescription('The power for this breaker.') pdr_breaker_percent_warning = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 200))).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerPercentWarning.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerPercentWarning.setDescription('The percentage of Warning set for this breaker.') pdr_breaker_percent_overload = mib_table_column((1, 3, 6, 1, 4, 1, 232, 165, 4, 3, 1, 1, 14), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: pdrBreakerPercentOverload.setStatus('mandatory') if mibBuilder.loadTexts: pdrBreakerPercentOverload.setDescription('The percentage of Overload set for this breaker.') mibBuilder.exportSymbols('CPQPOWER-MIB', upsEnvRemoteTempUpperLimit=upsEnvRemoteTempUpperLimit, upsRecepAutoOffDelay=upsRecepAutoOffDelay, pduOutputBreakerTable=pduOutputBreakerTable, upsEnvRemoteHumidityUpperLimit=upsEnvRemoteHumidityUpperLimit, upsOutputPhase=upsOutputPhase, pduIdentIndex=pduIdentIndex, upsBypassNumPhases=upsBypassNumPhases, upsTopology=upsTopology, upsTestBatteryStatus=upsTestBatteryStatus, deviceMACAddress=deviceMACAddress, pduControllable=pduControllable, upsOutputEntry=upsOutputEntry, upsBypassFrequency=upsBypassFrequency, trapWarning=trapWarning, pdrBreakerTotalKWH=pdrBreakerTotalKWH, upsRecepAutoOnDelay=upsRecepAutoOnDelay, deviceIdentName=deviceIdentName, upsInputVoltage=upsInputVoltage, pduOutputBreakerEntry=pduOutputBreakerEntry, pdrPanelCurrentA=pdrPanelCurrentA, upsInputSource=upsInputSource, upsControlOutputOffTrapDelay=upsControlOutputOffTrapDelay, upsOutputNumPhases=upsOutputNumPhases, upsEnvRemoteHumidity=upsEnvRemoteHumidity, trapInformation=trapInformation, pdrPanelRatedCurrent=pdrPanelRatedCurrent, deviceHardwareVersion=deviceHardwareVersion, upsRecep=upsRecep, pduOutputTable=pduOutputTable, pduOutputPower=pduOutputPower, powerDevice=powerDevice, pdrPanelYearlyKWH=pdrPanelYearlyKWH, pdrName=pdrName, upsTopoMachineCode=upsTopoMachineCode, upsRecepOffDelaySecs=upsRecepOffDelaySecs, trapInfo=trapInfo, breakerIndex=breakerIndex, upsContactIndex=upsContactIndex, upsOutputSource=upsOutputSource, upsBatteryAbmStatus=upsBatteryAbmStatus, upsBatCapacity=upsBatCapacity, pdrPanelVoltageB=pdrPanelVoltageB, upsOutput=upsOutput, upsTopoUnitNumber=upsTopoUnitNumber, pduOutputIndex=pduOutputIndex, pduInputIndex=pduInputIndex, upsBattery=upsBattery, trapDeviceDetails=trapDeviceDetails, upsRecepShedSecsWithRestart=upsRecepShedSecsWithRestart, upsBypassTable=upsBypassTable, upsControlToBypassDelay=upsControlToBypassDelay, pduIdent=pduIdent, upsRecepTable=upsRecepTable, pdrPanelPower=pdrPanelPower, pdrBreakerTable=pdrBreakerTable, trapCritical=trapCritical, upsEnvAmbientLowerLimit=upsEnvAmbientLowerLimit, pdrPanelCurrentC=pdrPanelCurrentC, upsIdentModel=upsIdentModel, upsContactState=upsContactState, pduInput=pduInput, pduPartNumber=pduPartNumber, upsContactDescr=upsContactDescr, deviceManufacturer=deviceManufacturer, upsInput=upsInput, breakerStatus=breakerStatus, pdrBreakerPercentOverload=pdrBreakerPercentOverload, upsEnvAmbientHumidity=upsEnvAmbientHumidity, upsBatCurrent=upsBatCurrent, trapDescription=trapDescription, deviceSerialNumber=deviceSerialNumber, pdrBreakerCurrentPercent=pdrBreakerCurrentPercent, upsContactsTableEntry=upsContactsTableEntry, trapCleared=trapCleared, upsInputEntry=upsInputEntry, upsControlOutputOffDelay=upsControlOutputOffDelay, breakerVoltage=breakerVoltage, upsBypassPhase=upsBypassPhase, upsInputPhase=upsInputPhase, pdrNominalOutputVoltage=pdrNominalOutputVoltage, upsBatVoltage=upsBatVoltage, pduName=pduName, pdrBreakerNumSequence=pdrBreakerNumSequence, upsInputNumPhases=upsInputNumPhases, upsConfigHighOutputVoltageLimit=upsConfigHighOutputVoltageLimit, upsControlOutputOnTrapDelay=upsControlOutputOnTrapDelay, upsConfigOutputWatts=upsConfigOutputWatts, pdrPanel=pdrPanel, upsBypassEntry=upsBypassEntry, upsEnvironment=upsEnvironment, pdrPanelTotalKWH=pdrPanelTotalKWH, pdrPanelEntry=pdrPanelEntry, upsConfigOutputVoltage=upsConfigOutputVoltage, pduIdentEntry=pduIdentEntry, pdrNumPanels=pdrNumPanels, pdrManufacturer=pdrManufacturer, pdrBreaker=pdrBreaker, upsEnvAmbientUpperLimit=upsEnvAmbientUpperLimit, pduIdentTable=pduIdentTable, numOfPdu=numOfPdu, pdrPanelLoadB=pdrPanelLoadB, deviceTrapInitialization=deviceTrapInitialization, ups=ups, upsBypassVoltage=upsBypassVoltage, inputVoltage=inputVoltage, pdrPanelLoadC=pdrPanelLoadC, upsControl=upsControl, pdrPartNumber=pdrPartNumber, pdrBreakerEntry=pdrBreakerEntry, trapTest=trapTest, breakerPercentLoad=breakerPercentLoad, upsOutputCurrent=upsOutputCurrent, pduManufacturer=pduManufacturer, pduInputTable=pduInputTable, pduOutputEntry=pduOutputEntry, pduOutputHeat=pduOutputHeat, pdrPanelCurrentB=pdrPanelCurrentB, upsBatTimeRemaining=upsBatTimeRemaining, upsConfigOutputFreq=upsConfigOutputFreq, pdrFirmwareVersion=pdrFirmwareVersion, pdrBreakerPanel=pdrBreakerPanel, pduOutput=pduOutput, upsConfigLowOutputVoltageLimit=upsConfigLowOutputVoltageLimit, pdrSerialNumber=pdrSerialNumber, managementModuleIdent=managementModuleIdent, pdrBreakerPercentWarning=pdrBreakerPercentWarning, upsRecepEntry=upsRecepEntry, pdrPanelMonthlyKWH=pdrPanelMonthlyKWH, pdrBreakerRatedCurrent=pdrBreakerRatedCurrent, upsControlOutputOnDelay=upsControlOutputOnDelay, upsTopoPowerStrategy=upsTopoPowerStrategy, deviceFirmwareVersion=deviceFirmwareVersion, pdrVARating=pdrVARating, upsOutputFrequency=upsOutputFrequency, pduInputEntry=pduInputEntry, upsConfigDateAndTime=upsConfigDateAndTime, pdrBreakerNumPosition=pdrBreakerNumPosition, upsEnvRemoteTempLowerLimit=upsEnvRemoteTempLowerLimit, upsInputLineBads=upsInputLineBads, pdrPanelTable=pdrPanelTable, pdrNumPhases=pdrNumPhases, upsInputFrequency=upsInputFrequency, upsRecepOnDelaySecs=upsRecepOnDelaySecs, pduModel=pduModel, upsEnvRemoteTemp=upsEnvRemoteTemp, cpqPower=cpqPower, upsBypass=upsBypass, upsContactsTable=upsContactsTable, pdrPanelVoltageC=pdrPanelVoltageC, pduOutputNumBreakers=pduOutputNumBreakers, trapCode=trapCode, pdrPanelFrequency=pdrPanelFrequency, deviceModel=deviceModel, pdrBreakerYearlyKWH=pdrBreakerYearlyKWH, pdrBreakerCurrent=pdrBreakerCurrent, upsNumReceptacles=upsNumReceptacles, upsOutputLoad=upsOutputLoad, upsRecepStatus=upsRecepStatus, pdrPanelLoadA=pdrPanelLoadA, trapDeviceMgmtUrl=trapDeviceMgmtUrl, upsInputTable=upsInputTable, upsInputCurrent=upsInputCurrent, upsConfigInputVoltage=upsConfigInputVoltage, upsOutputTable=upsOutputTable, upsRecepIndex=upsRecepIndex, pduFirmwareVersion=pduFirmwareVersion, pduStatus=pduStatus, upsEnvAmbientTemp=upsEnvAmbientTemp, upsEnvRemoteHumidityLowerLimit=upsEnvRemoteHumidityLowerLimit, breakerCurrent=breakerCurrent, pdrModel=pdrModel, devicePartNumber=devicePartNumber, upsTestBattery=upsTestBattery, pduSerialNumber=pduSerialNumber, upsTopologyType=upsTopologyType, pdrNumBreakers=pdrNumBreakers, upsConfig=upsConfig, pdr=pdr, upsLoadShedSecsWithRestart=upsLoadShedSecsWithRestart, trapDeviceName=trapDeviceName, pdrBreakerNumPhases=pdrBreakerNumPhases, upsIdent=upsIdent, pdrIdent=pdrIdent, upsIdentOemCode=upsIdentOemCode, upsContactType=upsContactType, upsTestTrap=upsTestTrap, pdrBreakerIndex=pdrBreakerIndex, pdrPanelIndex=pdrPanelIndex, pdrBreakerMonthlyKWH=pdrBreakerMonthlyKWH, pduOutputLoad=pduOutputLoad, upsIdentSoftwareVersions=upsIdentSoftwareVersions, upsOutputWatts=upsOutputWatts, pdrBreakerPower=pdrBreakerPower, upsIdentManufacturer=upsIdentManufacturer, upsOutputVoltage=upsOutputVoltage, upsEnvNumContacts=upsEnvNumContacts, upsTest=upsTest, pdrPanelVoltageA=pdrPanelVoltageA, inputCurrent=inputCurrent, pdu=pdu, upsInputWatts=upsInputWatts)
"""Arguments for pytest""" def pytest_addoption(parser) -> None: # type: ignore """arguments for pytest""" parser.addoption("--db_type", default="mysql") # mysql database connection options parser.addoption("--mysql_user", default="root") parser.addoption("--mysql_password", default="") parser.addoption("--mysql_host", default="127.0.0.1") parser.addoption("--mysql_port", default="3306") parser.addoption("--mysql_database", default="") # postgres database connection options parser.addoption("--pg_user", default="postgres") parser.addoption("--pg_password", default="") parser.addoption("--pg_host", default="127.0.0.1") parser.addoption("--pg_port", default="5432") parser.addoption("--pg_database", default="") def pytest_generate_tests(metafunc) -> None: # type: ignore """ This is called for every test. Only get/set command line arguments if the argument is specified in the list of test "fixturenames". """ if "db_type" in metafunc.fixturenames: metafunc.parametrize("db_type", [metafunc.config.option.db_type]) # mysql database connection options if "mysql_user" in metafunc.fixturenames: metafunc.parametrize("mysql_user", [metafunc.config.option.mysql_user]) if "mysql_password" in metafunc.fixturenames: metafunc.parametrize("mysql_password", [metafunc.config.option.mysql_password]) if "mysql_host" in metafunc.fixturenames: metafunc.parametrize("mysql_host", [metafunc.config.option.mysql_host]) if "mysql_port" in metafunc.fixturenames: metafunc.parametrize("mysql_port", [metafunc.config.option.mysql_port]) if "mysql_database" in metafunc.fixturenames: metafunc.parametrize("mysql_database", [metafunc.config.option.mysql_database]) # postgres database connection options if "pg_user" in metafunc.fixturenames: metafunc.parametrize("pg_user", [metafunc.config.option.pg_user]) if "pg_password" in metafunc.fixturenames: metafunc.parametrize("pg_password", [metafunc.config.option.pg_password]) if "pg_host" in metafunc.fixturenames: metafunc.parametrize("pg_host", [metafunc.config.option.pg_host]) if "pg_port" in metafunc.fixturenames: metafunc.parametrize("pg_port", [metafunc.config.option.pg_port]) if "pg_database" in metafunc.fixturenames: metafunc.parametrize("pg_database", [metafunc.config.option.pg_database])
"""Arguments for pytest""" def pytest_addoption(parser) -> None: """arguments for pytest""" parser.addoption('--db_type', default='mysql') parser.addoption('--mysql_user', default='root') parser.addoption('--mysql_password', default='') parser.addoption('--mysql_host', default='127.0.0.1') parser.addoption('--mysql_port', default='3306') parser.addoption('--mysql_database', default='') parser.addoption('--pg_user', default='postgres') parser.addoption('--pg_password', default='') parser.addoption('--pg_host', default='127.0.0.1') parser.addoption('--pg_port', default='5432') parser.addoption('--pg_database', default='') def pytest_generate_tests(metafunc) -> None: """ This is called for every test. Only get/set command line arguments if the argument is specified in the list of test "fixturenames". """ if 'db_type' in metafunc.fixturenames: metafunc.parametrize('db_type', [metafunc.config.option.db_type]) if 'mysql_user' in metafunc.fixturenames: metafunc.parametrize('mysql_user', [metafunc.config.option.mysql_user]) if 'mysql_password' in metafunc.fixturenames: metafunc.parametrize('mysql_password', [metafunc.config.option.mysql_password]) if 'mysql_host' in metafunc.fixturenames: metafunc.parametrize('mysql_host', [metafunc.config.option.mysql_host]) if 'mysql_port' in metafunc.fixturenames: metafunc.parametrize('mysql_port', [metafunc.config.option.mysql_port]) if 'mysql_database' in metafunc.fixturenames: metafunc.parametrize('mysql_database', [metafunc.config.option.mysql_database]) if 'pg_user' in metafunc.fixturenames: metafunc.parametrize('pg_user', [metafunc.config.option.pg_user]) if 'pg_password' in metafunc.fixturenames: metafunc.parametrize('pg_password', [metafunc.config.option.pg_password]) if 'pg_host' in metafunc.fixturenames: metafunc.parametrize('pg_host', [metafunc.config.option.pg_host]) if 'pg_port' in metafunc.fixturenames: metafunc.parametrize('pg_port', [metafunc.config.option.pg_port]) if 'pg_database' in metafunc.fixturenames: metafunc.parametrize('pg_database', [metafunc.config.option.pg_database])
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { # GN version: //components/mime_util/mime_util 'target_name': 'mime_util', 'type': 'static_library', 'dependencies': [ '../../base/base.gyp:base', '../../net/net.gyp:net', ], 'sources': [ 'mime_util.cc', 'mime_util.h', ], 'conditions': [ ['OS!="ios"', { # iOS doesn't use and must not depend on //media 'dependencies': [ '../../media/media.gyp:media', ], }], ], } ], }
{'targets': [{'target_name': 'mime_util', 'type': 'static_library', 'dependencies': ['../../base/base.gyp:base', '../../net/net.gyp:net'], 'sources': ['mime_util.cc', 'mime_util.h'], 'conditions': [['OS!="ios"', {'dependencies': ['../../media/media.gyp:media']}]]}]}
# TLE N = int(input()) sq = int(N ** 0.5) s = set() for a in range(2, sq + 1): x = a * a while x <= N: s.add(x) x *= a print(N - len(s))
n = int(input()) sq = int(N ** 0.5) s = set() for a in range(2, sq + 1): x = a * a while x <= N: s.add(x) x *= a print(N - len(s))
# user-defined function for sorting the list # it has List as parameter def selectionSort(List): #n is the length of the list n=len(List) #if list is empty if n==0: return(List) #if list is not empty for i in range(n-1): #we are finding minimum of the sublist from List[i] to end of the List minimum_sublist = min(List[i:]) #above line of code we found the minimun of sublist, now we are getting its index index_minimum = List.index(minimum_sublist) #swapping of List[i] with List[index_minimum] List[i], List[index_minimum] = List[index_minimum], List[i] #returning the sorted list return(List) listA = [6,4,2,1,5] print("Initial List:", listA) # Selection sort function is called with listA passed as argument, # the call returns the sortedlist and it is assigned back to listA listA = selectionSort(listA) print("Sorted List:", listA) ''' Output:- Initial List: [6, 4, 2, 1, 5] Sorted List: [1, 2, 4, 5, 6] '''
def selection_sort(List): n = len(List) if n == 0: return List for i in range(n - 1): minimum_sublist = min(List[i:]) index_minimum = List.index(minimum_sublist) (List[i], List[index_minimum]) = (List[index_minimum], List[i]) return List list_a = [6, 4, 2, 1, 5] print('Initial List:', listA) list_a = selection_sort(listA) print('Sorted List:', listA) '\nOutput:-\n\nInitial List: [6, 4, 2, 1, 5]\nSorted List: [1, 2, 4, 5, 6]\n'
class MyHashMap: def __init__(self): self.arr = [-1 for _ in range(10 ** 6)] def put(self, key: int, value: int): self.arr[key] = value def get(self, key): return self.arr[key] def remove(self, key): self.arr[key] = -1 # Your MyHashMap object will be instantiated and called as such: # obj = MyHashMap() # obj.put(key,value) # param_2 = obj.get(key) # obj.remove(key)
class Myhashmap: def __init__(self): self.arr = [-1 for _ in range(10 ** 6)] def put(self, key: int, value: int): self.arr[key] = value def get(self, key): return self.arr[key] def remove(self, key): self.arr[key] = -1
print("Hello world!") print("What is your name?") name = input() print("It is good to meet you,", name)
print('Hello world!') print('What is your name?') name = input() print('It is good to meet you,', name)
# This lab demonstrates how to creates lists in Python # The list will be used in ways that relate to real life scenarios # It will also aim to format, add and remove items from the list line_break = "\n" # declare a list that includes the names of users users = ['lamin', 'sally', 'bakay', 'satou', 'sainey'] # print all the names in the list print('These are all the items in the list of users %s' % users) print(line_break) # print a single name based on its index (e.g. 'lamin' = index 0, 'sally' = index 1) print('User at index 0 is ' + users[0].capitalize()) print('User at index 1 is ' + users[1].capitalize(), line_break) # print the last item in the list print('Last item in the list is ' + users[-1]) print('Second to last item in the list is ' + users[-2], line_break) # print users from index 2 to the end of the list print('Users at index 0 to the index 3 %s' % (users[:3])) print('Users at index 1 to end of the list are ', users[1:] ) # for a multiple names, this method will result in an err # example below will result in an error because list cannot be concatenated!! #print('Users at index 1 to end of the list are ' + users[1:3])
line_break = '\n' users = ['lamin', 'sally', 'bakay', 'satou', 'sainey'] print('These are all the items in the list of users %s' % users) print(line_break) print('User at index 0 is ' + users[0].capitalize()) print('User at index 1 is ' + users[1].capitalize(), line_break) print('Last item in the list is ' + users[-1]) print('Second to last item in the list is ' + users[-2], line_break) print('Users at index 0 to the index 3 %s' % users[:3]) print('Users at index 1 to end of the list are ', users[1:])
#!/usr/bin/env python3 def solution(a: list) -> int: """ >>> solution([1, 3]) 2 """ counter = [0] * (len(a) + 1) for x in a: counter[x-1] += 1 for x, count in enumerate(counter, 1): if not count: return x if __name__ == '__main__': for n in range(10): a_ = [i for i in range(1, n + 2)] for i in range(len(a_)): assert solution(a_[:i] + a_[i + 1:]) == i + 1
def solution(a: list) -> int: """ >>> solution([1, 3]) 2 """ counter = [0] * (len(a) + 1) for x in a: counter[x - 1] += 1 for (x, count) in enumerate(counter, 1): if not count: return x if __name__ == '__main__': for n in range(10): a_ = [i for i in range(1, n + 2)] for i in range(len(a_)): assert solution(a_[:i] + a_[i + 1:]) == i + 1
class BaseError(Exception): """Base Error""" class ArgumentError(BaseError): """Arguments error""" class ConfigError(BaseError): """raise config error"""
class Baseerror(Exception): """Base Error""" class Argumenterror(BaseError): """Arguments error""" class Configerror(BaseError): """raise config error"""
# https://leetcode.com/problems/implement-rand10-using-rand7/ # # algorithms # Medium (45.6%) # Total Accepted: 630 # Total Submissions: 1.4K # The rand7() API is already defined for you. # def rand7(): # @return a random integer in the range 1 to 7 class Solution(object): def rand10(self): """ :rtype: int """ i, j = rand7(), rand7() if i == 7 or (i == 6 and j > 5): return self.rand10() return (((i - 1) * 7 + j) % 10) + 1 class Solution(object): def rand10(self): """ :rtype: int """ num = (rand7() - 1) * 7 + rand7() if num > 40: return self.rand10() return num % 10 + 1
class Solution(object): def rand10(self): """ :rtype: int """ (i, j) = (rand7(), rand7()) if i == 7 or (i == 6 and j > 5): return self.rand10() return ((i - 1) * 7 + j) % 10 + 1 class Solution(object): def rand10(self): """ :rtype: int """ num = (rand7() - 1) * 7 + rand7() if num > 40: return self.rand10() return num % 10 + 1
class UserDataStorage: def __init__(self): self._users = {} def for_user(self, user_id: int): result = self._users.get(user_id) if result is None: user_data = {} self._users[user_id] = user_data return user_data return result
class Userdatastorage: def __init__(self): self._users = {} def for_user(self, user_id: int): result = self._users.get(user_id) if result is None: user_data = {} self._users[user_id] = user_data return user_data return result
# Host to initialise the application on HOST = "0.0.0.0" # set the webapp mode to debug on startup? DEBUG = False # port to deploy the webapp on PORT = 5000 # apply SSL to the site? SSL = True # Start the webapp with threading enabled? THREADED = False
host = '0.0.0.0' debug = False port = 5000 ssl = True threaded = False
class C: """ Namespace for constants. """ TEST_INT = 1 TEST_FLOAT = 1.0 TEST_FALSE = False TEST_TRUE = True TEST_STR = '1' TEST_BYTE = b'1' TEST_DICT = {1} TEST_CLASS = object() # PyStratum TST_ID_EGGS = 2 TST_ID_SPAM = 1 TST_TST_C00 = 11
class C: """ Namespace for constants. """ test_int = 1 test_float = 1.0 test_false = False test_true = True test_str = '1' test_byte = b'1' test_dict = {1} test_class = object() tst_id_eggs = 2 tst_id_spam = 1 tst_tst_c00 = 11
#Olivetti metricas #Get the font thisFont = Glyphs.font #Get the masters allMasters = thisFont.masters #Get The glyphs allGlyphs = thisFont.glyphs ascendentes = 780 capHeight = 700 xHeight = 510 descendentes = -220 #Loop in masters /// enumerate ayuda a iterar sobre el indice de las capas for index, master in enumerate(allMasters): master.xHeight = xHeight master.ascender = ascendentes master.capHeight = capHeight master.descender = descendentes #print(master.alignmentZones) print(f"xHeight: {master.xHeight} | Ascendentes: {master.ascender} | CapHeight: {master.capHeight} | Descendentes: {master.descender} | ")
this_font = Glyphs.font all_masters = thisFont.masters all_glyphs = thisFont.glyphs ascendentes = 780 cap_height = 700 x_height = 510 descendentes = -220 for (index, master) in enumerate(allMasters): master.xHeight = xHeight master.ascender = ascendentes master.capHeight = capHeight master.descender = descendentes print(f'xHeight: {master.xHeight} | Ascendentes: {master.ascender} | CapHeight: {master.capHeight} | Descendentes: {master.descender} | ')
""" File: boggle.py Name: Karnen Huang ---------------------------------------- This file helps user find word whose length is more than 4 and in dictionary by using 16 characters entered by user. """ # This is the file name of the dictionary txt file # we will be checking if a word exists by searching through it FILE = 'dictionary.txt' # global variable dic = [] # contains all the word found in the dictionary txt file def main(): """ This function helps user find word whose length is more than 4 and in dictionary by using 16 letters entered by user. """ read_dictionary() while True: ch_lst = [] for i in range(4): row = input(str(i+1) + ' row of letters: ').lower() if not correct_format(row): print('Illegal input') return ch = row.split() ch_lst.append(ch) word_lst = [] # contains all the word found in dic based on the letters entered by user num_lst = [0] # records the number of word has printed # Make every letter entered by user become starting point for x in range(len(ch_lst)): for y in range(len(ch_lst)): find_boggle('', ch_lst, x, y, [(x, y)], word_lst, num_lst) # start recursion print('There are', num_lst[0], 'words in total.') break def correct_format(row): """ :param row: str, the data entered by user :return: bool, if the format of the data is correct """ if row[1] is not ' ' or row[3] is not ' ' or row[5] is not ' ': return False else: return True def find_boggle(current_s, ch_lst, x, y, use_lst, word_lst, num_lst): """ :param current_s: str, contains the letters we choose and create a word :param ch_lst: lst, contains all the letters entered by user :param x: int, the position of the letter :param y: int, the position of the letter :param use_lst: lst, contains the position of letters contain in current_s :param word_lst: lst, contains all the word found in dic based on the letters entered by user :param num_lst: lst, records the number of word has printed :return: show all the word found in dic based on the letters entered by user in console """ # when length of current_s is more than 4, consider to print current_s if len(current_s) >= 4: if current_s in dic: if current_s not in word_lst: print('Found "'+current_s+'"') word_lst.append(current_s) num_lst[0] += 1 # find the letter next to the current position for i in range(-1, 2): for j in range(-1, 2): if 0 <= x + i < 4: if 0 <= y + j < 4: # Choose if (x+i, y+j) not in use_lst: current_s += ch_lst[x+i][y+j] use_lst.append((x+i, y+j)) # Explore if has_prefix(current_s): find_boggle(current_s, ch_lst, x+i, y+j, use_lst, word_lst, num_lst) # Un-choose current_s = current_s[:-1] use_lst.pop() def read_dictionary(): """ This function reads file "dictionary.txt" stored in FILE and appends words in each line into a Python list """ with open(FILE, 'r') as f: for line in f: line = line.strip() dic.append(line) def has_prefix(sub_s): """ :param sub_s: (str) A substring that is constructed by neighboring letters on a 4x4 square grid :return: (bool) If there is any words with prefix stored in sub_s """ for word in dic: if word.startswith(sub_s): return True if __name__ == '__main__': main()
""" File: boggle.py Name: Karnen Huang ---------------------------------------- This file helps user find word whose length is more than 4 and in dictionary by using 16 characters entered by user. """ file = 'dictionary.txt' dic = [] def main(): """ This function helps user find word whose length is more than 4 and in dictionary by using 16 letters entered by user. """ read_dictionary() while True: ch_lst = [] for i in range(4): row = input(str(i + 1) + ' row of letters: ').lower() if not correct_format(row): print('Illegal input') return ch = row.split() ch_lst.append(ch) word_lst = [] num_lst = [0] for x in range(len(ch_lst)): for y in range(len(ch_lst)): find_boggle('', ch_lst, x, y, [(x, y)], word_lst, num_lst) print('There are', num_lst[0], 'words in total.') break def correct_format(row): """ :param row: str, the data entered by user :return: bool, if the format of the data is correct """ if row[1] is not ' ' or row[3] is not ' ' or row[5] is not ' ': return False else: return True def find_boggle(current_s, ch_lst, x, y, use_lst, word_lst, num_lst): """ :param current_s: str, contains the letters we choose and create a word :param ch_lst: lst, contains all the letters entered by user :param x: int, the position of the letter :param y: int, the position of the letter :param use_lst: lst, contains the position of letters contain in current_s :param word_lst: lst, contains all the word found in dic based on the letters entered by user :param num_lst: lst, records the number of word has printed :return: show all the word found in dic based on the letters entered by user in console """ if len(current_s) >= 4: if current_s in dic: if current_s not in word_lst: print('Found "' + current_s + '"') word_lst.append(current_s) num_lst[0] += 1 for i in range(-1, 2): for j in range(-1, 2): if 0 <= x + i < 4: if 0 <= y + j < 4: if (x + i, y + j) not in use_lst: current_s += ch_lst[x + i][y + j] use_lst.append((x + i, y + j)) if has_prefix(current_s): find_boggle(current_s, ch_lst, x + i, y + j, use_lst, word_lst, num_lst) current_s = current_s[:-1] use_lst.pop() def read_dictionary(): """ This function reads file "dictionary.txt" stored in FILE and appends words in each line into a Python list """ with open(FILE, 'r') as f: for line in f: line = line.strip() dic.append(line) def has_prefix(sub_s): """ :param sub_s: (str) A substring that is constructed by neighboring letters on a 4x4 square grid :return: (bool) If there is any words with prefix stored in sub_s """ for word in dic: if word.startswith(sub_s): return True if __name__ == '__main__': main()
class BaseDeployAzureVMResourceModel(object): def __init__(self): self.vm_size = '' # type: str self.autoload = False # type: bool self.add_public_ip = False # type: bool self.inbound_ports = '' # type: str self.public_ip_type = '' # type: str self.app_name = '' # type: str self.username = '' # type: str self.password = '' # type: str self.extension_script_file = '' self.extension_script_configurations = '' self.extension_script_timeout = 0 # type: int self.disk_type = '' # type: str class DeployAzureVMResourceModel(BaseDeployAzureVMResourceModel): def __init__(self): super(DeployAzureVMResourceModel, self).__init__() self.image_publisher = '' # type: str self.image_offer = '' # type: str self.image_sku = '' # type: str self.image_version = '' # type: str class DeployAzureVMFromCustomImageResourceModel(BaseDeployAzureVMResourceModel): def __init__(self): super(DeployAzureVMFromCustomImageResourceModel, self).__init__() self.image_name = "" self.image_resource_group = ""
class Basedeployazurevmresourcemodel(object): def __init__(self): self.vm_size = '' self.autoload = False self.add_public_ip = False self.inbound_ports = '' self.public_ip_type = '' self.app_name = '' self.username = '' self.password = '' self.extension_script_file = '' self.extension_script_configurations = '' self.extension_script_timeout = 0 self.disk_type = '' class Deployazurevmresourcemodel(BaseDeployAzureVMResourceModel): def __init__(self): super(DeployAzureVMResourceModel, self).__init__() self.image_publisher = '' self.image_offer = '' self.image_sku = '' self.image_version = '' class Deployazurevmfromcustomimageresourcemodel(BaseDeployAzureVMResourceModel): def __init__(self): super(DeployAzureVMFromCustomImageResourceModel, self).__init__() self.image_name = '' self.image_resource_group = ''
""" author: Alice Francener problem: The Dark Elf url: https://www.urionlinejudge.com.br/judge/en/problems/view/1766 """ class Rena: def __init__(self, nome, peso, idade, altura): self.nome = nome self.peso = peso self.idade = idade self.altura = altura casos_teste = int(input()) for i in range(casos_teste): n_total, n_treno = map(int, input().split()) renas = [] for j in range(n_total): nome, peso, idade, altura = input().split() renas.append(Rena(nome, int(peso), int(idade), float(altura))) renas = sorted(renas, key=lambda rena: rena.nome) renas = sorted(renas, key=lambda rena: rena.altura) renas = sorted(renas, key=lambda rena: rena.idade) renas = sorted(renas, key=lambda rena: rena.peso, reverse=True) print('CENARIO {', i+1, '}', sep='') for j in range(n_treno): print('{} - {}'.format(j+1, renas[j].nome))
""" author: Alice Francener problem: The Dark Elf url: https://www.urionlinejudge.com.br/judge/en/problems/view/1766 """ class Rena: def __init__(self, nome, peso, idade, altura): self.nome = nome self.peso = peso self.idade = idade self.altura = altura casos_teste = int(input()) for i in range(casos_teste): (n_total, n_treno) = map(int, input().split()) renas = [] for j in range(n_total): (nome, peso, idade, altura) = input().split() renas.append(rena(nome, int(peso), int(idade), float(altura))) renas = sorted(renas, key=lambda rena: rena.nome) renas = sorted(renas, key=lambda rena: rena.altura) renas = sorted(renas, key=lambda rena: rena.idade) renas = sorted(renas, key=lambda rena: rena.peso, reverse=True) print('CENARIO {', i + 1, '}', sep='') for j in range(n_treno): print('{} - {}'.format(j + 1, renas[j].nome))
num_rows = 8 num_cols = 20 rows = 1 #create a number to start counting from for rows while rows <= num_rows: #start iterating through number of rows cols = 1 #create a number to start counting from for columns alpha = 'A' #starting point for alphabet while cols <= num_cols: #iterates through number of columns print('%s%s' % (rows, alpha), end=' ') cols +=1 #number of columns needs to increase alpha = chr(ord(alpha) + 1) #alphabet needs to increase rows += 1 #number of rows needs to increase print()
num_rows = 8 num_cols = 20 rows = 1 while rows <= num_rows: cols = 1 alpha = 'A' while cols <= num_cols: print('%s%s' % (rows, alpha), end=' ') cols += 1 alpha = chr(ord(alpha) + 1) rows += 1 print()
# Chapter03_04 # Python Tuple # Should know about difference with List # Cannot modify or remove # Declaring Tuple a = () b = (1,) c = (11, 12, 13, 14) d = (100, 1000, 'Ace', 'Base', 'Captine') e = (100, 1000, ('Ace', 'Base', 'Captine')) # Indexing print('>>>>>') print('d - ', d[1]) print('d - ', d[0] + d[1] + d[1]) print('d - ', d[-1]) print('e - ', e[-1][1]) print('e - ', list(e[-1][1])) # Cannot Modify # d[0] = 1500 # ERROR # Slicing print('>>>>>') print('d - ', d[0:3]) print('d - ', d[2:]) print('e - ', e[2][1:3]) # Calcuate Tuple print('>>>>>') print('c + d', c + d) print('c * 3', c * 3) # Tuple Function a = (5, 2, 3, 1, 4) print('a - ', a) print('a - ', a.index(3)) print('a - ', a.count(2)) # Packing & Unpacking # Packing t = ('foo', 'bar', 'baz', 'qux') print(t) print(t[0]) print(t[-1]) # Unpacking 1 (x1, x2, x3, x4) = t print(type(x1), type(x2), type(x3), type(x1)) print(x1, x2, x3, x4) # Packing & Unpacking 2 t2 = 1, 2, 3 t3 = 4, x1, x2, x3 = t2 x4, x5, x6 = 4, 5, 6 print(t2) print(t3) print(x1, x2, x3) print(x4, x5, x6)
a = () b = (1,) c = (11, 12, 13, 14) d = (100, 1000, 'Ace', 'Base', 'Captine') e = (100, 1000, ('Ace', 'Base', 'Captine')) print('>>>>>') print('d - ', d[1]) print('d - ', d[0] + d[1] + d[1]) print('d - ', d[-1]) print('e - ', e[-1][1]) print('e - ', list(e[-1][1])) print('>>>>>') print('d - ', d[0:3]) print('d - ', d[2:]) print('e - ', e[2][1:3]) print('>>>>>') print('c + d', c + d) print('c * 3', c * 3) a = (5, 2, 3, 1, 4) print('a - ', a) print('a - ', a.index(3)) print('a - ', a.count(2)) t = ('foo', 'bar', 'baz', 'qux') print(t) print(t[0]) print(t[-1]) (x1, x2, x3, x4) = t print(type(x1), type(x2), type(x3), type(x1)) print(x1, x2, x3, x4) t2 = (1, 2, 3) t3 = (4,) (x1, x2, x3) = t2 (x4, x5, x6) = (4, 5, 6) print(t2) print(t3) print(x1, x2, x3) print(x4, x5, x6)
def digitize(n: int) -> list: num = [] for el in str(n): num.append((int(el))) return list(reversed(num))
def digitize(n: int) -> list: num = [] for el in str(n): num.append(int(el)) return list(reversed(num))
class DwightException(Exception): pass class CommandFailed(DwightException): pass class UsageException(DwightException): pass class NotRootException(UsageException): pass class ConfigurationException(DwightException): pass class CannotLoadConfiguration(ConfigurationException): pass class InvalidConfiguration(ConfigurationException): pass class UnknownConfigurationOptions(ConfigurationException): pass class RuntimeDwightException(DwightException): pass class CannotMountPath(RuntimeDwightException): pass
class Dwightexception(Exception): pass class Commandfailed(DwightException): pass class Usageexception(DwightException): pass class Notrootexception(UsageException): pass class Configurationexception(DwightException): pass class Cannotloadconfiguration(ConfigurationException): pass class Invalidconfiguration(ConfigurationException): pass class Unknownconfigurationoptions(ConfigurationException): pass class Runtimedwightexception(DwightException): pass class Cannotmountpath(RuntimeDwightException): pass
__all__ = ['list_property'] class ListProperty(property): """Property that is really just a list index. This can turn a list into an object like a named tuple only a list is mutable. """ def __init__(self, index=None, default=ValueError("Invalid list_property value"), fget=None, fset=None, fdel=None, doc=None): """Property that is really just a list index Args: index (int): The list index position associated with this property default (object)[ValueError]: The default value or Exception when the index/value has not been set. fget (function)[None]: Getter function fset (function)[None]: Setter function fdel (function)[None]: Deleter function doc (str)[None]: Documentation Alt Args: fget (function)[None]: Getter function fset (function)[None]: Setter function fdel (function)[None]: Deleter function doc (str)[None]: Documentation index (int): The list index position associated with this property default (object)[ValueError]: The default value or Exception when the index/value has not been set. """ # Swap arguments if not isinstance(index, int): fget, index = index, None if callable(default): fset, default = default, None self.index = index self.default = default if fget is None: fget = self.get_value if fset is None: fset = self.set_value super().__init__(fget, fset, fdel, doc) def getter(self, fget): return type(self)(self.index, self.default, fget, self.fset, self.fdel, self.__doc__) def setter(self, fset): return type(self)(self.index, self.default, self.fget, fset, self.fdel, self.__doc__) def deleter(self, fdel): return type(self)(self.index, self.default, self.fget, self.fset, fdel, self.__doc__) def __call__(self, fget): return self.getter(fget) def get_value(self, obj): try: return obj[self.index] except Exception as err: if isinstance(self.default, Exception): raise self.default from err return self.default def set_value(self, obj, value): try: obj[self.index] = value return except IndexError: while len(obj) < self.index+1: obj.append(None) obj[self.index] = value def del_value(self, obj): try: obj.pop(self.index) except IndexError: pass list_property = ListProperty
__all__ = ['list_property'] class Listproperty(property): """Property that is really just a list index. This can turn a list into an object like a named tuple only a list is mutable. """ def __init__(self, index=None, default=value_error('Invalid list_property value'), fget=None, fset=None, fdel=None, doc=None): """Property that is really just a list index Args: index (int): The list index position associated with this property default (object)[ValueError]: The default value or Exception when the index/value has not been set. fget (function)[None]: Getter function fset (function)[None]: Setter function fdel (function)[None]: Deleter function doc (str)[None]: Documentation Alt Args: fget (function)[None]: Getter function fset (function)[None]: Setter function fdel (function)[None]: Deleter function doc (str)[None]: Documentation index (int): The list index position associated with this property default (object)[ValueError]: The default value or Exception when the index/value has not been set. """ if not isinstance(index, int): (fget, index) = (index, None) if callable(default): (fset, default) = (default, None) self.index = index self.default = default if fget is None: fget = self.get_value if fset is None: fset = self.set_value super().__init__(fget, fset, fdel, doc) def getter(self, fget): return type(self)(self.index, self.default, fget, self.fset, self.fdel, self.__doc__) def setter(self, fset): return type(self)(self.index, self.default, self.fget, fset, self.fdel, self.__doc__) def deleter(self, fdel): return type(self)(self.index, self.default, self.fget, self.fset, fdel, self.__doc__) def __call__(self, fget): return self.getter(fget) def get_value(self, obj): try: return obj[self.index] except Exception as err: if isinstance(self.default, Exception): raise self.default from err return self.default def set_value(self, obj, value): try: obj[self.index] = value return except IndexError: while len(obj) < self.index + 1: obj.append(None) obj[self.index] = value def del_value(self, obj): try: obj.pop(self.index) except IndexError: pass list_property = ListProperty
masses = {'H':'1.008', 'He':'4.003', 'Li':'6.941', 'Be':'9.012', 'B':'10.81', 'C':'12.01', 'N':'14.01', 'O':'16.00', 'F':'19.00', 'Ne':'20.18', 'Na':'22.99', 'Mg':'24.31', 'Al':'26.98', 'Si':'28.09', 'P':'30.97', 'S':'32.07', 'Cl':'35.45', 'Ar':'39.95', 'K':'39.10', 'Ca':'40.08', 'Sc':'44.96', 'Ti':'47.87', 'V':'50.94', 'Cr':'52.00', 'Mn':'54.94', 'Fe':'55.85', 'Co':'58.93', 'Ni':'58.69', 'Cu':'63.55', 'Zn':'65.38', 'Ga':'69.72', 'Ge':'72.64', 'As':'74.92', 'Se':'78.96', 'Br':'79.90', 'Kr':'83.80', 'Rb':'85.47', 'Sr':'87.61', 'Y':'88.91', 'Zr':'91.22', 'Nb':'92.91', 'Mo':'95.96', 'Tc':'0', 'Ru':'101.1', 'Rh':'102.9', 'Pd':'106.4', 'Ag':'107.9', 'Cd':'112.4', 'In':'114.8', 'Sn':'118.7', 'Sb':'121.8', 'Te':'127.6', 'I':'126.9', 'Xe':'131.3', 'Cs':'132.9', 'Ba':'137.3', 'La':'138.9', 'Ce':'140.1', 'Pr':'140.9', 'Nd':'144.2', 'Pm':'0', 'Sm':'150.4', 'Eu':'152.0', 'Gd':'157.3', 'Tb':'158.9', 'Dy':'162.5', 'Ho':'164.9', 'Er':'167.3', 'Tm':'168.9', 'Yb':'173.1', 'Lu':'175.0', 'Hf':'178.5', 'Ta':'180.9', 'W':'183.9', 'Re':'186.2', 'Os':'190.2', 'Ir':'192.2', 'Pt':'195.1', 'Au':'197.0', 'Hg':'200.6', 'Tl':'204.4', 'Pb':'207.2', 'Bi':'209.0', 'Po':'0', 'At':'0', 'Rn':'0', 'Fr':'0', 'Ra':'0', 'Ac':'0', 'Th':'232.0', 'Pa':'231.0', 'U':'238.0', 'Np':'0', 'Pu':'0', 'Am':'0', 'Cm':'0', 'Bk':'0', 'Cf':'0', 'Es':'0', 'Fm':'0', 'Md':'0', 'No':'0', 'Lr':'0', 'Rf':'0', 'Db':'0', 'Sg':'0', 'Bh':'0', 'Hs':'0', 'Mt':'0', 'Ds':'0', 'Rg':'0', 'Cn':'0', 'Uut':'0', 'Uuq':'0', 'Uup':'0', 'Uuh':'0', 'Uus':'0', 'Uuo':'0'}
masses = {'H': '1.008', 'He': '4.003', 'Li': '6.941', 'Be': '9.012', 'B': '10.81', 'C': '12.01', 'N': '14.01', 'O': '16.00', 'F': '19.00', 'Ne': '20.18', 'Na': '22.99', 'Mg': '24.31', 'Al': '26.98', 'Si': '28.09', 'P': '30.97', 'S': '32.07', 'Cl': '35.45', 'Ar': '39.95', 'K': '39.10', 'Ca': '40.08', 'Sc': '44.96', 'Ti': '47.87', 'V': '50.94', 'Cr': '52.00', 'Mn': '54.94', 'Fe': '55.85', 'Co': '58.93', 'Ni': '58.69', 'Cu': '63.55', 'Zn': '65.38', 'Ga': '69.72', 'Ge': '72.64', 'As': '74.92', 'Se': '78.96', 'Br': '79.90', 'Kr': '83.80', 'Rb': '85.47', 'Sr': '87.61', 'Y': '88.91', 'Zr': '91.22', 'Nb': '92.91', 'Mo': '95.96', 'Tc': '0', 'Ru': '101.1', 'Rh': '102.9', 'Pd': '106.4', 'Ag': '107.9', 'Cd': '112.4', 'In': '114.8', 'Sn': '118.7', 'Sb': '121.8', 'Te': '127.6', 'I': '126.9', 'Xe': '131.3', 'Cs': '132.9', 'Ba': '137.3', 'La': '138.9', 'Ce': '140.1', 'Pr': '140.9', 'Nd': '144.2', 'Pm': '0', 'Sm': '150.4', 'Eu': '152.0', 'Gd': '157.3', 'Tb': '158.9', 'Dy': '162.5', 'Ho': '164.9', 'Er': '167.3', 'Tm': '168.9', 'Yb': '173.1', 'Lu': '175.0', 'Hf': '178.5', 'Ta': '180.9', 'W': '183.9', 'Re': '186.2', 'Os': '190.2', 'Ir': '192.2', 'Pt': '195.1', 'Au': '197.0', 'Hg': '200.6', 'Tl': '204.4', 'Pb': '207.2', 'Bi': '209.0', 'Po': '0', 'At': '0', 'Rn': '0', 'Fr': '0', 'Ra': '0', 'Ac': '0', 'Th': '232.0', 'Pa': '231.0', 'U': '238.0', 'Np': '0', 'Pu': '0', 'Am': '0', 'Cm': '0', 'Bk': '0', 'Cf': '0', 'Es': '0', 'Fm': '0', 'Md': '0', 'No': '0', 'Lr': '0', 'Rf': '0', 'Db': '0', 'Sg': '0', 'Bh': '0', 'Hs': '0', 'Mt': '0', 'Ds': '0', 'Rg': '0', 'Cn': '0', 'Uut': '0', 'Uuq': '0', 'Uup': '0', 'Uuh': '0', 'Uus': '0', 'Uuo': '0'}
# Ternary Operator # condition_if_true if condition else condition_if_else is_friend = True can_message = "message allowed" if is_friend else "not allowed" print(can_message)
is_friend = True can_message = 'message allowed' if is_friend else 'not allowed' print(can_message)
""" because of the special porperty of the tree, the question basically is asking to find the smallest element in the subtree of root. So, we can recursively find left and right value that is not equal to the root's value, and then return the smaller one of them """ def findSecondMinimumValue(self, root): if not root: return -1 if not root.left and not root.right: return -1 left, right = root.left.val, root.right.val if left == root.val: left = self.findSecondMinimumValue(root.left) if right == root.val: right = self.findSecondMinimumValue(root.right) if left != -1 and right != -1: return min(left, right) if left == -1: return right if right == -1: return left
""" because of the special porperty of the tree, the question basically is asking to find the smallest element in the subtree of root. So, we can recursively find left and right value that is not equal to the root's value, and then return the smaller one of them """ def find_second_minimum_value(self, root): if not root: return -1 if not root.left and (not root.right): return -1 (left, right) = (root.left.val, root.right.val) if left == root.val: left = self.findSecondMinimumValue(root.left) if right == root.val: right = self.findSecondMinimumValue(root.right) if left != -1 and right != -1: return min(left, right) if left == -1: return right if right == -1: return left
names = ['Jack', 'John', 'Joe'] ages = [18, 19, 20] for name, age in zip(names, ages): print(name, age)
names = ['Jack', 'John', 'Joe'] ages = [18, 19, 20] for (name, age) in zip(names, ages): print(name, age)
#Here we package everything up into functions and set a loop so we can run it again and again. We also start using zodiacDescriptions2.txt so that descriptions of the signs are included. #Open the zodiac file def ZodiacSetup(): zodiacText = open('zodiacDescriptions2.txt') #for line in zodiacText: # print(line) #Load into a list zodiacList = [] for line in zodiacText: zodiacList.append(line) zodiacText.close() return zodiacList def ZodiacFigure(): #Ask user for input (year) try: birthYear=int(input('What year were you born: ')) #Take year and use as a conditional listIndex = (birthYear - 4) % 12 print(listIndex) #Return character print("You are a ", zodiacList[listIndex]) return birthYear except ValueError: print("You did not enter an integer") birthYear = "Stop" return birthYear #Repeat zodiacList = ZodiacSetup() birthYear=0 while type(birthYear) is int: birthYear = ZodiacFigure() #print(type(birthYear)) #Below is a description of the task """ While taking a class on the culture of China, you have learned about the Chinese zodiac in which people fall into 1 of 12 categories, depending on the year of their birth. The categories, numbered 0 to 11, correspond to the following animals: (0) monkey (1) rooster (2) dog (3) pig (4) rat (5) ox (6) tiger (7) rabbit (8) dragon (9) snake (10) horse (11) goat Those who believe in this zodiac think that the year of a person's birth influences both their personality and fortune in life. Your task is to build a program that will ask a user for their birth year and tell them their zodiac sign. If the user does not enter a number that can be interpreted as a year then an error message must be shown and the user given another chance. If the user types "quit" then the program halts. For extra credit: save each year that is input to a file and print a chart showing how many of each type or animal have been returned. To find your zodiac sign, divide the year of your birth by 12. The remainder then determines your sign. For example: The remainder when we divide 1985 by 12, is 5; therefore, a person born in 1985 is an ox according to the Chinese zodiac. """
def zodiac_setup(): zodiac_text = open('zodiacDescriptions2.txt') zodiac_list = [] for line in zodiacText: zodiacList.append(line) zodiacText.close() return zodiacList def zodiac_figure(): try: birth_year = int(input('What year were you born: ')) list_index = (birthYear - 4) % 12 print(listIndex) print('You are a ', zodiacList[listIndex]) return birthYear except ValueError: print('You did not enter an integer') birth_year = 'Stop' return birthYear zodiac_list = zodiac_setup() birth_year = 0 while type(birthYear) is int: birth_year = zodiac_figure() '\nWhile taking a class on the culture of China, you have learned about the Chinese zodiac in which people fall into 1 of 12 categories, depending on the year of their birth. The categories, numbered 0 to 11, correspond to the following animals:\n\n(0) monkey\n(1) rooster\n(2) dog\n(3) pig\n(4) rat\n(5) ox\n(6) tiger\n(7) rabbit\n(8) dragon\n(9) snake\n(10) horse\n(11) goat\n\nThose who believe in this zodiac think that the year of a person\'s birth influences both their personality and fortune in life.\n\nYour task is to build a program that will ask a user for their birth year and tell them their zodiac sign. If the user does not enter a number that can be interpreted as a year then an error message must be shown and the user given another chance. If the user types "quit" then the program halts.\n\nFor extra credit: save each year that is input to a file and print a chart showing how many of each type or animal have been returned.\n\nTo find your zodiac sign, divide the year of your birth by 12. The remainder then determines your sign. For example: The remainder when we divide 1985 by 12, is 5; therefore, a person born in 1985 is an ox according to the Chinese zodiac.\n'
jungle_template = { 0 : { "entity_type" : {"base": "room", "group": "jungle", "model": None, "sub_model": None}, "ship_id" : None, "name" : "Thinned Jungle", "description" : "The jungle here is thinner.", "region" : "Jungle", "zone" : "jungle", "elevation" : "", "effects" : "", "owner" : "", }, 1 : { "entity_type" : {"base": "room", "group": "jungle", "model": None, "sub_model": None}, "ship_id" : None, "name" : "Thick Jungle", "description" : "The jungle here is thick and difficult to navigate.", "region" : "Jungle", "zone" : "jungle", "elevation" : "", "effects" : "", "owner" : "", }, 2 : { "entity_type" : {"base": "room", "group": "jungle", "model": None, "sub_model": None}, "ship_id" : None, "name" : "Sparse Jungle", "description" : "The jungle here is quite open, providing for good visibility.", "region" : "Jungle", "zone" : "jungle", "elevation" : "", "effects" : "", "owner" : "", } }
jungle_template = {0: {'entity_type': {'base': 'room', 'group': 'jungle', 'model': None, 'sub_model': None}, 'ship_id': None, 'name': 'Thinned Jungle', 'description': 'The jungle here is thinner.', 'region': 'Jungle', 'zone': 'jungle', 'elevation': '', 'effects': '', 'owner': ''}, 1: {'entity_type': {'base': 'room', 'group': 'jungle', 'model': None, 'sub_model': None}, 'ship_id': None, 'name': 'Thick Jungle', 'description': 'The jungle here is thick and difficult to navigate.', 'region': 'Jungle', 'zone': 'jungle', 'elevation': '', 'effects': '', 'owner': ''}, 2: {'entity_type': {'base': 'room', 'group': 'jungle', 'model': None, 'sub_model': None}, 'ship_id': None, 'name': 'Sparse Jungle', 'description': 'The jungle here is quite open, providing for good visibility.', 'region': 'Jungle', 'zone': 'jungle', 'elevation': '', 'effects': '', 'owner': ''}}
class VenepaikkaPaymentError(Exception): """Base for payment specific exceptions""" class OrderStatusTransitionError(VenepaikkaPaymentError): """Attempting an Order from-to status transition that isn't allowed""" class ServiceUnavailableError(VenepaikkaPaymentError): """When payment service is unreachable, offline for maintenance etc""" class PayloadValidationError(VenepaikkaPaymentError): """When something is wrong or missing in the posted payment payload data""" class DuplicateOrderError(VenepaikkaPaymentError): """If order with the same ID has already been previously posted""" class UnknownReturnCodeError(VenepaikkaPaymentError): """If payment service returns a status code that is not recognized by the handler""" class ExpiredOrderError(VenepaikkaPaymentError): """If the Order is being paid after the due date""" class PaymentNotFoundError(VenepaikkaPaymentError): """When the payment cannot be found on Bambora's system""" class RefundPriceError(VenepaikkaPaymentError): """When the amount to be refunded (taken from Bambora) is different than the price of the order"""
class Venepaikkapaymenterror(Exception): """Base for payment specific exceptions""" class Orderstatustransitionerror(VenepaikkaPaymentError): """Attempting an Order from-to status transition that isn't allowed""" class Serviceunavailableerror(VenepaikkaPaymentError): """When payment service is unreachable, offline for maintenance etc""" class Payloadvalidationerror(VenepaikkaPaymentError): """When something is wrong or missing in the posted payment payload data""" class Duplicateordererror(VenepaikkaPaymentError): """If order with the same ID has already been previously posted""" class Unknownreturncodeerror(VenepaikkaPaymentError): """If payment service returns a status code that is not recognized by the handler""" class Expiredordererror(VenepaikkaPaymentError): """If the Order is being paid after the due date""" class Paymentnotfounderror(VenepaikkaPaymentError): """When the payment cannot be found on Bambora's system""" class Refundpriceerror(VenepaikkaPaymentError): """When the amount to be refunded (taken from Bambora) is different than the price of the order"""
def update_doc_with_invalid_hype_hint(doc: str): postfix = '(Note: parameter type can be wrong)' separator = ' ' if doc else '' return separator.join((doc, postfix))
def update_doc_with_invalid_hype_hint(doc: str): postfix = '(Note: parameter type can be wrong)' separator = ' ' if doc else '' return separator.join((doc, postfix))
def frame_is_montecarlo(frame): return ("MCInIcePrimary" in frame) or ("I3MCTree" in frame) def frame_is_noise(frame): try: frame["I3MCTree"][0].energy return False except: # noqa: E722 try: frame["MCInIcePrimary"].energy return False except: # noqa: E722 return True
def frame_is_montecarlo(frame): return 'MCInIcePrimary' in frame or 'I3MCTree' in frame def frame_is_noise(frame): try: frame['I3MCTree'][0].energy return False except: try: frame['MCInIcePrimary'].energy return False except: return True
try: score = float(input('enter score')) # A program that prompts a user to enter a score from 0 to 1 and prints the corresponding grade if 0 <= score < 0.6: print(score, 'F') elif 0.6 <= score < 0.7: print(score, 'D') elif 0.7 <= score < 0.8: print(score, 'C') elif 0.8 <= score < 0.9: print(score, 'B') elif 0.9 <= score <= 1: print(score, 'A') else: print('error, out of range') except: print("INVALID ENTRY")
try: score = float(input('enter score')) if 0 <= score < 0.6: print(score, 'F') elif 0.6 <= score < 0.7: print(score, 'D') elif 0.7 <= score < 0.8: print(score, 'C') elif 0.8 <= score < 0.9: print(score, 'B') elif 0.9 <= score <= 1: print(score, 'A') else: print('error, out of range') except: print('INVALID ENTRY')
""" The ska_tmc_cdm.messages.subarray_node package holds modules containing classes that represent arguments, requests, and responses for TMC SubArrayNode devices. """
""" The ska_tmc_cdm.messages.subarray_node package holds modules containing classes that represent arguments, requests, and responses for TMC SubArrayNode devices. """
class SlashException(Exception): @classmethod def throw(cls, *args, **kwargs): raise cls(*args, **kwargs) class NoActiveSession(SlashException): pass class CannotLoadTests(SlashException): pass class FixtureException(CannotLoadTests): pass class CyclicFixtureDependency(FixtureException): pass class UnresolvedFixtureStore(FixtureException): pass class UnknownFixtures(FixtureException): pass class InvalidFixtureScope(FixtureException): pass class TestFailed(AssertionError): """ This exception class distinguishes actual test failures (mostly assertion errors, but possibly other conditions as well) from regular asserts. This is important, since regular code that is tested can use asserts, and that should not be considered a test failure (but rather a code failure) """ pass class SkipTest(SlashException): """ This exception should be raised in order to interrupt the execution of the currently running test, marking it as skipped """ def __init__(self, reason="Test skipped"): super(SkipTest, self).__init__(reason) self.reason = reason
class Slashexception(Exception): @classmethod def throw(cls, *args, **kwargs): raise cls(*args, **kwargs) class Noactivesession(SlashException): pass class Cannotloadtests(SlashException): pass class Fixtureexception(CannotLoadTests): pass class Cyclicfixturedependency(FixtureException): pass class Unresolvedfixturestore(FixtureException): pass class Unknownfixtures(FixtureException): pass class Invalidfixturescope(FixtureException): pass class Testfailed(AssertionError): """ This exception class distinguishes actual test failures (mostly assertion errors, but possibly other conditions as well) from regular asserts. This is important, since regular code that is tested can use asserts, and that should not be considered a test failure (but rather a code failure) """ pass class Skiptest(SlashException): """ This exception should be raised in order to interrupt the execution of the currently running test, marking it as skipped """ def __init__(self, reason='Test skipped'): super(SkipTest, self).__init__(reason) self.reason = reason
class Carro: """Representacion basica de un carro""" def __init__(self, marca, modelo, anio): """Atributos del carro""" self.marca = marca self.modelo = modelo self.anio = anio self.kilometraje = 0 # Se define un atributo por defecto def descripcion(self): """Descripcion del carro segun sus atributos""" nombre_largo = self.marca + ' ' + self.modelo + ' ' + str(self.anio) return nombre_largo.title() def leer_kilometraje(self): """Imprimir le kilometraje del carro""" print("Esta carro tiene un kilometraje registrado de " + str(self.kilometraje) + " Km.") def actualizar_km(self, valor): """modificacion del kilometraje""" if valor >= self.kilometraje: self.kilometraje = valor else: print("No es permitido reducir el kilometraje del auto.") def llenar_tanque(self): """Permite lennar el tanuqe del vehiculo""" print("Su tanque ahora esta lleno.") class CarroElectrico(Carro): """Representacion de los vehiculos electricos""" def __init__(self, marca, modelo, anio): """Inicializa atributos de la clase padre""" """Tambien inicializa el tamanio de la bateria""" super().__init__(marca, modelo, anio) # Me permite referirme a los atributos y metodos del padre self.bateria = 70 def imprimir_bateria(self): """Describe el estado de la bateria""" print("Este vehiculo cuenta con una bateria de " + str(self.bateria) + " Kwh.") def llenar_tanque(): """Sobrecarga del metodo llenar tanque para carros electricos""" print("Los carros electricos no tiene tanque que llenar.")
class Carro: """Representacion basica de un carro""" def __init__(self, marca, modelo, anio): """Atributos del carro""" self.marca = marca self.modelo = modelo self.anio = anio self.kilometraje = 0 def descripcion(self): """Descripcion del carro segun sus atributos""" nombre_largo = self.marca + ' ' + self.modelo + ' ' + str(self.anio) return nombre_largo.title() def leer_kilometraje(self): """Imprimir le kilometraje del carro""" print('Esta carro tiene un kilometraje registrado de ' + str(self.kilometraje) + ' Km.') def actualizar_km(self, valor): """modificacion del kilometraje""" if valor >= self.kilometraje: self.kilometraje = valor else: print('No es permitido reducir el kilometraje del auto.') def llenar_tanque(self): """Permite lennar el tanuqe del vehiculo""" print('Su tanque ahora esta lleno.') class Carroelectrico(Carro): """Representacion de los vehiculos electricos""" def __init__(self, marca, modelo, anio): """Inicializa atributos de la clase padre""" 'Tambien inicializa el tamanio de la bateria' super().__init__(marca, modelo, anio) self.bateria = 70 def imprimir_bateria(self): """Describe el estado de la bateria""" print('Este vehiculo cuenta con una bateria de ' + str(self.bateria) + ' Kwh.') def llenar_tanque(): """Sobrecarga del metodo llenar tanque para carros electricos""" print('Los carros electricos no tiene tanque que llenar.')
def motif(dna, frag): ''' Function that looks for a defined DNA fragment in a DNA sequence and gives the position of the start of each instance of the fragment within the DNA sequence. Input params: dna = dna sequence frag = fragment to be searched for within the sequence Output params: repeats = a list of start positions of the fragment without commas as separators. ''' repeats = [] for i in range(len(dna)): if frag == dna[i: i+len(frag)]: repeats.append(i+1) repeats = ''.join(str(repeats).split(',')) return repeats dna = "GCCGCCCTAATGAATTTAATGAATAATGAACCTACGCCTAATGAAGTAATGAAGGCTGCATAATGAACGGCTTAATGAATAATGAAGTAGTAATGAACTGTGACTAATGAAACTAATAATGAACTGTTCATAATGAATAATGAATAATGAAAGCTCTTAATGAATAATGAATAATGAATCGTGCGGCTTCTAATGAATAATGAAGAACCGTAATGAATAATGAATCACTAATGAAGACATTAATGAATATGTAATGAATAATGAATAAGTTAATGAATTTCTAATGAAGTAGTATAATGAACGCATAATGAAGTAATGAAGATCTAATGAATAATGAAATAATGAAATCCGTAATGAAACGTAATGAATAATGAACTAATTAATGAATAATGAATCGTAATGAATTTAATGAATAATGAATCCTAATGAAAAGCTAATGAATAATGAATAATGAATAATGAATAATGAAATCTAATGAAGATAATGAAGCCCACTGTAATGAACATAATGAACGCATAATGAATGTAATGAATAATGAAGTAATGAAGCATAATGAATAATGAATAATGAAATCTTAATGAAATAATGAATAATGAAGGTTAATGAATAATGAATGACGGTTAATGAAATCTAATGAAGTTTAATGAAGTAATGAACGTTGATAATGAATAATGAAGTAATGAATAATGAAGTAATGAATAATGAAACAGTAATGAATAATGAACTAATGAAATTAATGAAATTAATGAATAATGAATTTAATGAATAATGAATAATGAATAATGAATAATGAAGGCGAGGTAGAGTTTAATGAAGTTAATGAAGCTAATGAAATAATGAACTCACTAATGAA" fragment = "TAATGAATA" print(motif(dna, fragment))
def motif(dna, frag): """ Function that looks for a defined DNA fragment in a DNA sequence and gives the position of the start of each instance of the fragment within the DNA sequence. Input params: dna = dna sequence frag = fragment to be searched for within the sequence Output params: repeats = a list of start positions of the fragment without commas as separators. """ repeats = [] for i in range(len(dna)): if frag == dna[i:i + len(frag)]: repeats.append(i + 1) repeats = ''.join(str(repeats).split(',')) return repeats dna = 'GCCGCCCTAATGAATTTAATGAATAATGAACCTACGCCTAATGAAGTAATGAAGGCTGCATAATGAACGGCTTAATGAATAATGAAGTAGTAATGAACTGTGACTAATGAAACTAATAATGAACTGTTCATAATGAATAATGAATAATGAAAGCTCTTAATGAATAATGAATAATGAATCGTGCGGCTTCTAATGAATAATGAAGAACCGTAATGAATAATGAATCACTAATGAAGACATTAATGAATATGTAATGAATAATGAATAAGTTAATGAATTTCTAATGAAGTAGTATAATGAACGCATAATGAAGTAATGAAGATCTAATGAATAATGAAATAATGAAATCCGTAATGAAACGTAATGAATAATGAACTAATTAATGAATAATGAATCGTAATGAATTTAATGAATAATGAATCCTAATGAAAAGCTAATGAATAATGAATAATGAATAATGAATAATGAAATCTAATGAAGATAATGAAGCCCACTGTAATGAACATAATGAACGCATAATGAATGTAATGAATAATGAAGTAATGAAGCATAATGAATAATGAATAATGAAATCTTAATGAAATAATGAATAATGAAGGTTAATGAATAATGAATGACGGTTAATGAAATCTAATGAAGTTTAATGAAGTAATGAACGTTGATAATGAATAATGAAGTAATGAATAATGAAGTAATGAATAATGAAACAGTAATGAATAATGAACTAATGAAATTAATGAAATTAATGAATAATGAATTTAATGAATAATGAATAATGAATAATGAATAATGAAGGCGAGGTAGAGTTTAATGAAGTTAATGAAGCTAATGAAATAATGAACTCACTAATGAA' fragment = 'TAATGAATA' print(motif(dna, fragment))
N = int(input()) s = set() for i in range(2, int(N ** 0.5) + 1): for j in range(2, N + 1): t = i ** j if t > N: break s.add(t) print(N - len(s))
n = int(input()) s = set() for i in range(2, int(N ** 0.5) + 1): for j in range(2, N + 1): t = i ** j if t > N: break s.add(t) print(N - len(s))
''' cardcountvalue.py Name: Wengel Gemu Collaborators: None Date: September 6th, 2019 Description: This program takes user input of a card value and prints the card counting number for that card. ''' # MIT card counting values: # # 2 - 6 should add one to the count, so their value is 1 # 7 - 9 have no effect on the count, so their value is 0 # A, 10, J, Q, and K should subtract one from the count, # so their value is -1 # this is a list containing all of the valid values for a card cards = ['A','2','3','4','5','6','7','8','9','10','J','Q','K'] card_value = input("Enter a card value: ") count = 0 if card_value in ['2','3','4','5','6']: count += 1 print("the card is " + str(count)) elif card_value in ['7','8','9']: count += 0 print("the card is " + str(count)) elif card_value in ['10','J','Q','K', 'A']: count -= 1 print("the card is " + str(count)) else: print("the card is invalid") # Write some code that takes a card as input (remember to # check it for validity) and outputs the MIT card counting # value of that card. Use multiple if/else statements # to determine the card counting value of the user's input.
""" cardcountvalue.py Name: Wengel Gemu Collaborators: None Date: September 6th, 2019 Description: This program takes user input of a card value and prints the card counting number for that card. """ cards = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'] card_value = input('Enter a card value: ') count = 0 if card_value in ['2', '3', '4', '5', '6']: count += 1 print('the card is ' + str(count)) elif card_value in ['7', '8', '9']: count += 0 print('the card is ' + str(count)) elif card_value in ['10', 'J', 'Q', 'K', 'A']: count -= 1 print('the card is ' + str(count)) else: print('the card is invalid')
class Solution: def mySqrt(self, x): high = x low = 1 if x == 0: return 0 # digit-by-digit calculation while high - low > 1: mid = (low + high)//2 #print("+++ ",mid) if mid**2 > x: high = mid else: low = mid return low
class Solution: def my_sqrt(self, x): high = x low = 1 if x == 0: return 0 while high - low > 1: mid = (low + high) // 2 if mid ** 2 > x: high = mid else: low = mid return low
class StringI(file): pass def StringIO(s=''): return StringI(s)
class Stringi(file): pass def string_io(s=''): return string_i(s)
def match(instruction, blanks): """ Procedure that returns the coordinates of the box that is best linked to the specific instruction Ideas: Check upper left coordinate, or lower right coordinate """ return closestK(instruction, blanks, k=1) def get_center(coords): return ((coords[0][0] + coords[1][0])/2, (coords[0][1] + coords[1][1])/2) def get_upper_left(coords): return coords[0] def get_lower_right(coords): return coords[1] def get_area(coords): """Returns area of blank space""" return (coords[1][0] - coords[0][0] + 1)*(coords[1][1] - coords[0][1] + 1) def euclidean(instruction, blank): """is waiting two tuples""" """we will add bias such that entries lower or to the right are favored""" bias = instruction[0]-blank[0] + instruction[1]-blank[1] return (instruction[0] - blank[0])**2 + (instruction[1] - blank[1])**2 + bias def manhattan(instruction, blank): """is waiting two tuples""" return abs(instruction[0] - blank[0]) + abs(instruction[1] - blank[1]) def closestK(instruction, blanks, k=3): blank_dist = [] for idx in range(len(blanks)): blank_dist.append((euclidean(instruction, get_center(blanks[idx])), idx)) blank_dist.sort() best_area = 0 best_idx = 0 for i in range(k): new_area = get_area(blanks[blank_dist[i][1]]) if new_area > best_area: best_area = new_area best_idx = blank_dist[i][1] return best_idx
def match(instruction, blanks): """ Procedure that returns the coordinates of the box that is best linked to the specific instruction Ideas: Check upper left coordinate, or lower right coordinate """ return closest_k(instruction, blanks, k=1) def get_center(coords): return ((coords[0][0] + coords[1][0]) / 2, (coords[0][1] + coords[1][1]) / 2) def get_upper_left(coords): return coords[0] def get_lower_right(coords): return coords[1] def get_area(coords): """Returns area of blank space""" return (coords[1][0] - coords[0][0] + 1) * (coords[1][1] - coords[0][1] + 1) def euclidean(instruction, blank): """is waiting two tuples""" 'we will add bias such that entries lower or to the right are favored' bias = instruction[0] - blank[0] + instruction[1] - blank[1] return (instruction[0] - blank[0]) ** 2 + (instruction[1] - blank[1]) ** 2 + bias def manhattan(instruction, blank): """is waiting two tuples""" return abs(instruction[0] - blank[0]) + abs(instruction[1] - blank[1]) def closest_k(instruction, blanks, k=3): blank_dist = [] for idx in range(len(blanks)): blank_dist.append((euclidean(instruction, get_center(blanks[idx])), idx)) blank_dist.sort() best_area = 0 best_idx = 0 for i in range(k): new_area = get_area(blanks[blank_dist[i][1]]) if new_area > best_area: best_area = new_area best_idx = blank_dist[i][1] return best_idx
# -*- coding: utf-8 -*- class NotReadyError(Exception): pass
class Notreadyerror(Exception): pass
# Portfolio Task 2 - Recursive Palindrome Checker def PalindromeChecker(String): # Removing empty spaces and converting string to lowercase str = String.replace(" ", "").lower() if len(str) < 2: return True if str[0] != str[-1]: return False return PalindromeChecker(str[1:-1]) # Testing # Test 1 - Was It A Rat I Saw Ans1 = PalindromeChecker("Was It A Rat I Saw") print("Is this a palindrome: Was it a Rat I Saw: " + str(Ans1)) # Test 2 - I do not like green eggs and ham. I do not like them, Sam-I-Am Ans2 = PalindromeChecker("I do not like green eggs and ham. I do not like them, Sam-I-Am") print("I do not like green eggs and ham I do not like them Sam-I-Am: " + str(Ans2)) # Test 3 - Racecar Ans3 = PalindromeChecker("Racecar") print("Is this a palindrome: Racecar: " + str(Ans3)) # Test 4 - George Ans4 = PalindromeChecker("George") print("Is this a palindrome: George: " + str(Ans4)) # Test 5 - Was it a car or a cat I saw Ans5 = PalindromeChecker("Was it a car or a cat I saw") print("Is this a palindrome: Was it a car or a cat I saw: " + str(Ans5))
def palindrome_checker(String): str = String.replace(' ', '').lower() if len(str) < 2: return True if str[0] != str[-1]: return False return palindrome_checker(str[1:-1]) ans1 = palindrome_checker('Was It A Rat I Saw') print('Is this a palindrome: Was it a Rat I Saw: ' + str(Ans1)) ans2 = palindrome_checker('I do not like green eggs and ham. I do not like them, Sam-I-Am') print('I do not like green eggs and ham I do not like them Sam-I-Am: ' + str(Ans2)) ans3 = palindrome_checker('Racecar') print('Is this a palindrome: Racecar: ' + str(Ans3)) ans4 = palindrome_checker('George') print('Is this a palindrome: George: ' + str(Ans4)) ans5 = palindrome_checker('Was it a car or a cat I saw') print('Is this a palindrome: Was it a car or a cat I saw: ' + str(Ans5))
def setup(): size(1000, 1000) stroke(0) background(255) def draw(): if (keyPressed): x = ord(key) - 32 line(x, 0, x, height) def draw(): pass # pass just tells Python mode to not do anything here, draw() keeps the program running def mousePressed(): fill(0, 102) rect(mouseX, mouseY, 330, 330) # works with no background in draw(), in draw!!!! moveX = moveY = dragX = dragY = -20 def draw(): global moveX, moveY, dragX, dragY #background(205) fill(0) ellipse(dragX, dragY, 33, 33) # Black circle fill(153) ellipse(moveX, moveY, 33, 33) # Gray circle def mouseMoved(): # Move gray circle global moveX, moveY moveX = mouseX moveY = mouseY def mouseDragged(): # Move black circle global dragX, dragY dragX = mouseX dragY = mouseY
def setup(): size(1000, 1000) stroke(0) background(255) def draw(): if keyPressed: x = ord(key) - 32 line(x, 0, x, height) def draw(): pass def mouse_pressed(): fill(0, 102) rect(mouseX, mouseY, 330, 330) move_x = move_y = drag_x = drag_y = -20 def draw(): global moveX, moveY, dragX, dragY fill(0) ellipse(dragX, dragY, 33, 33) fill(153) ellipse(moveX, moveY, 33, 33) def mouse_moved(): global moveX, moveY move_x = mouseX move_y = mouseY def mouse_dragged(): global dragX, dragY drag_x = mouseX drag_y = mouseY
#runas solve(2, 100) #pythran export solve(int, int) ''' How many distinct terms are in the sequence generated by ab for 2 <= a <= 100 and 2 <= b <= 100 ''' def solve(start, end): terms = {} count = 0 for a in xrange(start, end + 1): for b in xrange(start, end + 1): c = pow(long(a),b) if not terms.get(c, 0): terms[c] = 1 count = count + 1 return count
""" How many distinct terms are in the sequence generated by ab for 2 <= a <= 100 and 2 <= b <= 100 """ def solve(start, end): terms = {} count = 0 for a in xrange(start, end + 1): for b in xrange(start, end + 1): c = pow(long(a), b) if not terms.get(c, 0): terms[c] = 1 count = count + 1 return count
a, b, c = [int(input()) for i in range(3)] if a + b == c or b + c == a or a + c == b: print("HAPPY CROWD") else: print("UNHAPPY CROWD")
(a, b, c) = [int(input()) for i in range(3)] if a + b == c or b + c == a or a + c == b: print('HAPPY CROWD') else: print('UNHAPPY CROWD')
#!/usr/bin/env python # coding: utf-8 # In[ ]: url=input("Enter the website url: ") # The full website URL (e.g. https://www.example.com) campaign_source=input("Enter the Campaign Source: ") #The referrer: (e.g. google, newsletter,facebook,reddit) campaign_medium=input("Enter the campaign medium: ") #Marketing medium: (e.g. cpc, banner, email,dailypost) campaign_name=input("Enter campaign name: ") #Product, promo code, or slogan (e.g. spring_sale) campaign_term=input("Enter campaign content: ") #Identify the paid keywords campaign_content=input("Enter campaign term: ") #Use to differentiate ads generated_url=url """ Instructions: 1. Campaign_source is mandatory field, it helps you to track the source from where you are getting traffic 2. Campaign_medium is not mandatory but it is highly recommended to not to left it empty as it helps to predict the medium from where you are getting the traffic eg. it can be posts, newsletters, emails e.t.c 3. Remaining three fields "name,term,content" are not much important but again it completly depends upon your requirement, like if you want to filter the traffic as per name, term or content then you can fill up the values here """ if campaign_source: generated_url=generated_url+'?utm_source='+campaign_source if campaign_medium: generated_url=generated_url+'&utm_medium='+campaign_medium if campaign_name: generated_url=generated_url+'&utm_campaign='+campaign_name if campaign_term: generated_url=generated_url+'&utm_term='+campaign_term if campaign_content: generated_url=generated_url+'&utm_content='+campaign_content print("\n") print("Generated url is:""\n"+ generated_url) else: print("\n") print("Campaign Source cannot be empty!!") """ Information about parameters: 1. Use utm_source to identify a search engine, newsletter name, or other source. Example: google 2. Use utm_medium to identify a medium such as email or cost-per- click. Example: cpc 3. Used for keyword analysis. Use utm_campaign to identify a specific product promotion or strategic campaign. Example: utm_campaign=spring_sale 4. Used for paid search. Use utm_term to note the keywords for this ad. Example: running+shoes 5. Used for A/B testing and content-targeted ads. Use utm_content to differentiate ads or links that point to the same URL. Examples: logolink or textlink """ #Just copy the generated url and enjoy tracking.
url = input('Enter the website url: ') campaign_source = input('Enter the Campaign Source: ') campaign_medium = input('Enter the campaign medium: ') campaign_name = input('Enter campaign name: ') campaign_term = input('Enter campaign content: ') campaign_content = input('Enter campaign term: ') generated_url = url '\nInstructions:\n1. Campaign_source is mandatory field, it helps you to track the source from where you are getting traffic\n2. Campaign_medium is not mandatory but it is highly recommended to not to left it empty as it helps to predict the medium from where you are getting the traffic eg. it can be posts, newsletters, emails e.t.c\n3. Remaining three fields "name,term,content" are not much important but again it completly depends upon your requirement, like if you want to filter the traffic as per name, term or content then you can fill up the values here\n' if campaign_source: generated_url = generated_url + '?utm_source=' + campaign_source if campaign_medium: generated_url = generated_url + '&utm_medium=' + campaign_medium if campaign_name: generated_url = generated_url + '&utm_campaign=' + campaign_name if campaign_term: generated_url = generated_url + '&utm_term=' + campaign_term if campaign_content: generated_url = generated_url + '&utm_content=' + campaign_content print('\n') print('Generated url is:\n' + generated_url) else: print('\n') print('Campaign Source cannot be empty!!') '\nInformation about parameters:\n1. Use utm_source to identify a search engine, newsletter name, or other source.\nExample: google\n\n2. Use utm_medium to identify a medium such as email or cost-per- click.\nExample: cpc\n\n3. Used for keyword analysis. Use utm_campaign to identify a specific product promotion or strategic campaign.\nExample: utm_campaign=spring_sale\n\n4. Used for paid search. Use utm_term to note the keywords for this ad.\nExample: running+shoes\n\n5. Used for A/B testing and content-targeted ads. Use utm_content to differentiate ads or links that point to the same URL.\nExamples: logolink or textlink\n\n'
""" Time utilities for the manipulation of time. @author: John Berroa """ class Converter: """ Converts times from one measurement to another, and also parses or creates strings related to time """ @staticmethod def sec2min(secs): mins = secs // 60 return mins @staticmethod def min2hour(mins): hours = mins // 60 if hours == 0: return 0, mins else: mins = mins % 60 return hours, mins @staticmethod def hour2day(hours): days = hours // 24 if days == 0: return 0, hours else: hours = hours % 24 return days, hours @staticmethod def parse_DHM(time): days_rest = time.split('d') days = days_rest[0] hours_rest = days_rest[1].split('h') hours = hours_rest[0] mins_rest = hours_rest[1].split('m') mins = mins_rest[0] return int(days), int(hours), int(mins) @staticmethod def convert2string(hours, minutes): if minutes != 0: return "{} hours, {} minutes".format(hours, minutes) else: return "{} hours".format(hours, minutes) @staticmethod def convert2string_days(days, hours, minutes): if minutes != 0: return "{} days, {} hours, {} minutes".format(days, hours, minutes) else: return "{} days, {} hours".format(days, hours) @staticmethod def convert_int2day(number): if number == 0: return "Sunday" elif number == 1: return "Monday" elif number == 2: return "Tuesday" elif number == 3: return "Wednesday" elif number == 4: return "Thursday" elif number == 5: return "Friday" elif number == 6: return "Saturday" else: raise ValueError("Invalid integer input (0-6 allowed, input={})".format(number)) class TimeCalculator: """ Adds or subtracts time """ @staticmethod def add(hours1, minutes1, hours2, minutes2): total_hours = hours1 + hours2 total_minutes = minutes1 + minutes2 minute_hours, minutes = Converter.min2hour(total_minutes) hours = total_hours + minute_hours return hours, minutes @staticmethod def subtract(hours1, minutes1, hours2, minutes2): hours2 = hours2 + (minutes2 / 60) hours1 = hours1 + (minutes1 / 60) if hours1 < hours2: return None, None total_hours = hours1 - hours2 hours = int(total_hours) minutes = round((total_hours % 1) * 60) return hours, minutes
""" Time utilities for the manipulation of time. @author: John Berroa """ class Converter: """ Converts times from one measurement to another, and also parses or creates strings related to time """ @staticmethod def sec2min(secs): mins = secs // 60 return mins @staticmethod def min2hour(mins): hours = mins // 60 if hours == 0: return (0, mins) else: mins = mins % 60 return (hours, mins) @staticmethod def hour2day(hours): days = hours // 24 if days == 0: return (0, hours) else: hours = hours % 24 return (days, hours) @staticmethod def parse_dhm(time): days_rest = time.split('d') days = days_rest[0] hours_rest = days_rest[1].split('h') hours = hours_rest[0] mins_rest = hours_rest[1].split('m') mins = mins_rest[0] return (int(days), int(hours), int(mins)) @staticmethod def convert2string(hours, minutes): if minutes != 0: return '{} hours, {} minutes'.format(hours, minutes) else: return '{} hours'.format(hours, minutes) @staticmethod def convert2string_days(days, hours, minutes): if minutes != 0: return '{} days, {} hours, {} minutes'.format(days, hours, minutes) else: return '{} days, {} hours'.format(days, hours) @staticmethod def convert_int2day(number): if number == 0: return 'Sunday' elif number == 1: return 'Monday' elif number == 2: return 'Tuesday' elif number == 3: return 'Wednesday' elif number == 4: return 'Thursday' elif number == 5: return 'Friday' elif number == 6: return 'Saturday' else: raise value_error('Invalid integer input (0-6 allowed, input={})'.format(number)) class Timecalculator: """ Adds or subtracts time """ @staticmethod def add(hours1, minutes1, hours2, minutes2): total_hours = hours1 + hours2 total_minutes = minutes1 + minutes2 (minute_hours, minutes) = Converter.min2hour(total_minutes) hours = total_hours + minute_hours return (hours, minutes) @staticmethod def subtract(hours1, minutes1, hours2, minutes2): hours2 = hours2 + minutes2 / 60 hours1 = hours1 + minutes1 / 60 if hours1 < hours2: return (None, None) total_hours = hours1 - hours2 hours = int(total_hours) minutes = round(total_hours % 1 * 60) return (hours, minutes)
class Classification: # The leaf nodes of the decision tree def __init__(self, c=0, label="NONE", threshold=None): self.c = c self.label = label self.threshold = threshold def getClass(self): return self.c def getLabel(self): return self.label def setClass(self, c): self.c = c def setLabel(self, l): self.label = l def getThreshold(self): return self.threshold def setThreshold(self, t): self.threshold = t
class Classification: def __init__(self, c=0, label='NONE', threshold=None): self.c = c self.label = label self.threshold = threshold def get_class(self): return self.c def get_label(self): return self.label def set_class(self, c): self.c = c def set_label(self, l): self.label = l def get_threshold(self): return self.threshold def set_threshold(self, t): self.threshold = t
""" Module for visualizations of MPTs. """ def to_tikz(mpt): """ Generate tikz code for given MPT Parameters ---------- mpt : MPT MPT to be translated to tikz code_path : str specify where to save the tikz code """ def recursive_translation(node): """ Recursively turn list to str """ if node.leaf: return node.content pos = recursive_translation(node.pos) neg = recursive_translation(node.neg) return "[.{} {} {} ]".format(node.content, pos, neg) return r"\Tree " + recursive_translation(mpt.root) def cmd_draw(mpt): """ Draw the mpt to the command line Parameters ---------- mpt : MPT MPT to be drawn """ #word = mpt #subtree = transformations.nested_list(word) _dfs_print(mpt.root) def _dfs_print(node, depth=0): """ Prints a tree recursively via depth first search Parameters ---------- subtree : list tree as a nested list """ to_print = '\t' * depth if node.leaf: # leaf to_print += node.content print(to_print) return _dfs_print(node.pos, depth + 1) to_print += node.content # current node print(to_print) _dfs_print(node.neg, depth + 1)
""" Module for visualizations of MPTs. """ def to_tikz(mpt): """ Generate tikz code for given MPT Parameters ---------- mpt : MPT MPT to be translated to tikz code_path : str specify where to save the tikz code """ def recursive_translation(node): """ Recursively turn list to str """ if node.leaf: return node.content pos = recursive_translation(node.pos) neg = recursive_translation(node.neg) return '[.{} {} {} ]'.format(node.content, pos, neg) return '\\Tree ' + recursive_translation(mpt.root) def cmd_draw(mpt): """ Draw the mpt to the command line Parameters ---------- mpt : MPT MPT to be drawn """ _dfs_print(mpt.root) def _dfs_print(node, depth=0): """ Prints a tree recursively via depth first search Parameters ---------- subtree : list tree as a nested list """ to_print = '\t' * depth if node.leaf: to_print += node.content print(to_print) return _dfs_print(node.pos, depth + 1) to_print += node.content print(to_print) _dfs_print(node.neg, depth + 1)
# Copyright 2021 Google LLC # # Use of this source code is governed by an MIT-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/MIT. def parse_tvs(tvdir): p = tvdir / "external" / "polyval.txt" with p.open() as f: d = None k = None v = None for l in f: l = l.strip() if l == "": if d: d[k] = bytes.fromhex(v) yield d d = None k = None v = None elif "=" in l: if d is None: d = {} else: d[k] = bytes.fromhex(v) k, v = l.split("=", 2) k = k.strip() v = v.strip() else: v += l if d is not None: d[k] = bytes.fromhex(v) yield d
def parse_tvs(tvdir): p = tvdir / 'external' / 'polyval.txt' with p.open() as f: d = None k = None v = None for l in f: l = l.strip() if l == '': if d: d[k] = bytes.fromhex(v) yield d d = None k = None v = None elif '=' in l: if d is None: d = {} else: d[k] = bytes.fromhex(v) (k, v) = l.split('=', 2) k = k.strip() v = v.strip() else: v += l if d is not None: d[k] = bytes.fromhex(v) yield d
def is_git_url(url): if url.startswith('http'): return True elif url.startswith('https'): return True elif url.startswith('git'): return True elif url.startswith('ssh'): return True return False def is_not_git_url(url): return not is_git_url(url) class FilterModule(object): ''' custom jinja2 filters for working with collections ''' def filters(self): return { 'is_git_url': is_git_url, 'is_not_git_url': is_not_git_url }
def is_git_url(url): if url.startswith('http'): return True elif url.startswith('https'): return True elif url.startswith('git'): return True elif url.startswith('ssh'): return True return False def is_not_git_url(url): return not is_git_url(url) class Filtermodule(object): """ custom jinja2 filters for working with collections """ def filters(self): return {'is_git_url': is_git_url, 'is_not_git_url': is_not_git_url}
################################ Units ######################################### DESCR_VILLAGER = """Villagers have poor fighting skills but are able to build villages, windmills, bridges, towers and walls.""" DESCR_INFANTRY = """Infantry is composed of soldiers with basic fighting skills. Infantry can capture places by removing and planting flags.""" DESCR_WIZARD = """Small groups of wizard have a powerful fire power, both at close and distant range. They are able to extinguish fires.""" ################################ Buildings ##################################### DESCR_VILLAGE = """Villages can produce villagers and infantry. They can be taxed in order to constitute an income for your land. They can be burned.""" DESCR_WINDMILL = """Windmills produce a considerable amount of money. However, they are more expensive than villages to build. Also they cannot produce unit, and can be burned easily.""" DESCR_BRIDGE = """A bridge allows units to cross a river much more faster. However, it takes a long time to build.""" DESCR_ROAD = """Roads are the fastest terrain for units to walk on. They are cheap and fast to build""" descr_building = {"village":DESCR_VILLAGE, "windmill":DESCR_WINDMILL, "bridge":DESCR_BRIDGE, "road":DESCR_ROAD}
descr_villager = 'Villagers have poor fighting skills but\nare able to build villages, windmills,\nbridges, towers and walls.' descr_infantry = 'Infantry is composed of soldiers with\nbasic fighting skills. Infantry can\ncapture places by removing and\nplanting flags.' descr_wizard = 'Small groups of wizard have a powerful\nfire power, both at close and distant range.\nThey are able to extinguish fires.' descr_village = 'Villages can produce villagers and infantry.\nThey can be taxed in order to constitute\nan income for your land. They can be burned.' descr_windmill = 'Windmills produce a considerable amount\nof money. However, they are more expensive\nthan villages to build. Also they cannot\nproduce unit, and can be burned easily.' descr_bridge = 'A bridge allows units to cross a river much\nmore faster. However, it takes a long time\nto build.' descr_road = 'Roads are the fastest terrain for units\nto walk on. They are cheap and fast to build' descr_building = {'village': DESCR_VILLAGE, 'windmill': DESCR_WINDMILL, 'bridge': DESCR_BRIDGE, 'road': DESCR_ROAD}
# encoding: utf-8 # module cv2.ogl # from /home/davtoh/anaconda3/envs/rrtools/lib/python3.5/site-packages/cv2.cpython-35m-x86_64-linux-gnu.so # by generator 1.144 # no doc # no imports # Variables with simple values BUFFER_ARRAY_BUFFER = 34962 Buffer_ARRAY_BUFFER = 34962 Buffer_ELEMENT_ARRAY_BUFFER = 34963 BUFFER_ELEMENT_ARRAY_BUFFER = 34963 BUFFER_PIXEL_PACK_BUFFER = 35051 Buffer_PIXEL_PACK_BUFFER = 35051 BUFFER_PIXEL_UNPACK_BUFFER = 35052 Buffer_PIXEL_UNPACK_BUFFER = 35052 BUFFER_READ_ONLY = 35000 Buffer_READ_ONLY = 35000 Buffer_READ_WRITE = 35002 BUFFER_READ_WRITE = 35002 BUFFER_WRITE_ONLY = 35001 Buffer_WRITE_ONLY = 35001 LINES = 1 LINE_LOOP = 2 LINE_STRIP = 3 POINTS = 0 POLYGON = 9 QUADS = 7 QUAD_STRIP = 8 TEXTURE2D_DEPTH_COMPONENT = 6402 Texture2D_DEPTH_COMPONENT = 6402 Texture2D_NONE = 0 TEXTURE2D_NONE = 0 TEXTURE2D_RGB = 6407 Texture2D_RGB = 6407 Texture2D_RGBA = 6408 TEXTURE2D_RGBA = 6408 TRIANGLES = 4 TRIANGLE_FAN = 6 TRIANGLE_STRIP = 5 __loader__ = None __spec__ = None # no functions # no classes
buffer_array_buffer = 34962 buffer_array_buffer = 34962 buffer_element_array_buffer = 34963 buffer_element_array_buffer = 34963 buffer_pixel_pack_buffer = 35051 buffer_pixel_pack_buffer = 35051 buffer_pixel_unpack_buffer = 35052 buffer_pixel_unpack_buffer = 35052 buffer_read_only = 35000 buffer_read_only = 35000 buffer_read_write = 35002 buffer_read_write = 35002 buffer_write_only = 35001 buffer_write_only = 35001 lines = 1 line_loop = 2 line_strip = 3 points = 0 polygon = 9 quads = 7 quad_strip = 8 texture2_d_depth_component = 6402 texture2_d_depth_component = 6402 texture2_d_none = 0 texture2_d_none = 0 texture2_d_rgb = 6407 texture2_d_rgb = 6407 texture2_d_rgba = 6408 texture2_d_rgba = 6408 triangles = 4 triangle_fan = 6 triangle_strip = 5 __loader__ = None __spec__ = None
# 2. Data of XYZ company is stored in sorted list. Write a program for searching specific data from that list. # Hint: Use if/elif to deal with conditions. string = input("Enter list of items (comma seperated)>>> ") find_ele = input("Enter the elements which needs to find>>> ") list_eles = str(string).split(",") if find_ele in list_eles: print(f"{find_ele} is present in given list at position {list_eles.index(find_ele)+1}") else: print(f"{find_ele} is not present in given list")
string = input('Enter list of items (comma seperated)>>> ') find_ele = input('Enter the elements which needs to find>>> ') list_eles = str(string).split(',') if find_ele in list_eles: print(f'{find_ele} is present in given list at position {list_eles.index(find_ele) + 1}') else: print(f'{find_ele} is not present in given list')
class Iterator: def set_client_response(self, client_response: dict): self.client_response = client_response return self def count(self): return len(self.client_response['Environments'])
class Iterator: def set_client_response(self, client_response: dict): self.client_response = client_response return self def count(self): return len(self.client_response['Environments'])
class Solution: def canTransform(self, start: str, end: str) -> bool: n = len(start) L = R = 0 for i in range(n): s, e = start[i], end[i] if s == 'R': if L != 0: return False else: R += 1 if e == 'R': if R == 0 or L != 0: return False else: R -= 1 if e == 'L': if R != 0: return False else: L += 1 if s == 'L': if L == 0 or R != 0: return False else: L -= 1 return L == 0 and R == 0
class Solution: def can_transform(self, start: str, end: str) -> bool: n = len(start) l = r = 0 for i in range(n): (s, e) = (start[i], end[i]) if s == 'R': if L != 0: return False else: r += 1 if e == 'R': if R == 0 or L != 0: return False else: r -= 1 if e == 'L': if R != 0: return False else: l += 1 if s == 'L': if L == 0 or R != 0: return False else: l -= 1 return L == 0 and R == 0
values = [int(i) for i in open('input','r').readline().split(",")] data = [0,1,2,3,4,5,6,7,8,9] steps = 256 for i in range(10): data[i] = values.count(i) for i in range(steps): item = data.pop(0) data[6] += item data[8] = item data.append(0) print(sum(data))
values = [int(i) for i in open('input', 'r').readline().split(',')] data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] steps = 256 for i in range(10): data[i] = values.count(i) for i in range(steps): item = data.pop(0) data[6] += item data[8] = item data.append(0) print(sum(data))
# Null Object Sentinel class NullObject: def __repr__(self): return '< Null object >'
class Nullobject: def __repr__(self): return '< Null object >'
############################################################################ # Copyright (C) 2008 - 2015 Bosch Sensortec GmbH # # File : bmp180.h # # Date : 20150327 # # Revision : 2.2.2 # # Usage: Sensor Driver for BMP180 sensor # ############################################################################ #file bmp180.py # brief Header file for all define constants and function prototypes ############################################################################ ## I2C ADDRESS DEFINITION OF BMP180 ############################################################################ #BMP180 I2C Address# BMP180_ADDR = 0x77 ############################################################################ ## ERROR CODE DEFINITIONS ############################################################################ #E_BMP_NULL_PTR = ((s8)-127) #E_BMP_COMM_RES = ((s8)-1) #E_BMP_OUT_OF_RANGE = ((s8)-2) ############################################################################ ## CONSTANTS ############################################################################ #BMP180_RETURN_FUNCTION_TYPE s8 #BMP180_INIT_VALUE ((u8)0) #BMP180_INITIALIZE_OVERSAMP_SETTING_U8X ((u8)0) #BMP180_INITIALIZE_SW_OVERSAMP_U8X ((u8)0) #BMP180_INITIALIZE_NUMBER_OF_SAMPLES_U8X ((u8)1) #BMP180_GEN_READ_WRITE_DATA_LENGTH ((u8)1) #BMP180_TEMPERATURE_DATA_LENGTH ((u8)2) #BMP180_PRESSURE_DATA_LENGTH ((u8)3) #BMP180_SW_OVERSAMP_U8X ((u8)1) #BMP180_OVERSAMP_SETTING_U8X ((u8)3) #BMP180_2MS_DELAY_U8X (2) #BMP180_3MS_DELAY_U8X (3) #BMP180_AVERAGE_U8X (3) #BMP180_INVALID_DATA (0) #BMP180_CHECK_DIVISOR (0) #BMP180_DATA_MEASURE (3) #BMP180_CALCULATE_TRUE_PRESSURE (8) #BMP180_CALCULATE_TRUE_TEMPERATURE (8) #BMP180_SHIFT_BIT_POSITION_BY_01_BIT (1) #BMP180_SHIFT_BIT_POSITION_BY_02_BITS (2) #BMP180_SHIFT_BIT_POSITION_BY_04_BITS (4) #BMP180_SHIFT_BIT_POSITION_BY_06_BITS (6) #BMP180_SHIFT_BIT_POSITION_BY_08_BITS (8) #BMP180_SHIFT_BIT_POSITION_BY_11_BITS (11) #BMP180_SHIFT_BIT_POSITION_BY_12_BITS (12) #BMP180_SHIFT_BIT_POSITION_BY_13_BITS (13) #BMP180_SHIFT_BIT_POSITION_BY_15_BITS (15) #BMP180_SHIFT_BIT_POSITION_BY_16_BITS (16) ############################################################################ ## REGISTER ADDRESS DEFINITION ############################################################################ #register definitions # BMP180_START = (0xAA) BMP180_PROM_DATA__LEN = (22) BMP180_CHIP_ID_REG = (0xD0) BMP180_VERSION_REG = (0xD1) BMP180_CTRL_MEAS_REG = (0xF4) BMP180_ADC_OUT_MSB_REG = (0xF6) BMP180_ADC_OUT_LSB_REG = (0xF7) BMP180_SOFT_RESET_REG = (0xE0) BMP180_T_MEASURE = (0x2E) # temperature measurement # BMP180_P_MEASURE = (0x34) # pressure measurement# BMP180_TEMP_CONVERSION_TIME = (5) # TO be spec'd by GL or SB# BMP180_PARAM_MG = (3038) BMP180_PARAM_MH = (-7357) BMP180_PARAM_MI = (3791) ############################################################################ ## ARRAY SIZE DEFINITIONS ############################################################################ #BMP180_TEMPERATURE_DATA_BYTES (2) #BMP180_PRESSURE_DATA_BYTES (3) #BMP180_TEMPERATURE_LSB_DATA (1) #BMP180_TEMPERATURE_MSB_DATA (0) #BMP180_PRESSURE_MSB_DATA (0) #BMP180_PRESSURE_LSB_DATA (1) #BMP180_PRESSURE_XLSB_DATA (2) #BMP180_CALIB_DATA_SIZE (22) #BMP180_CALIB_PARAM_AC1_MSB (0) #BMP180_CALIB_PARAM_AC1_LSB (1) #BMP180_CALIB_PARAM_AC2_MSB (2) #BMP180_CALIB_PARAM_AC2_LSB (3) #BMP180_CALIB_PARAM_AC3_MSB (4) #BMP180_CALIB_PARAM_AC3_LSB (5) #BMP180_CALIB_PARAM_AC4_MSB (6) #BMP180_CALIB_PARAM_AC4_LSB (7) #BMP180_CALIB_PARAM_AC5_MSB (8) #BMP180_CALIB_PARAM_AC5_LSB (9) #BMP180_CALIB_PARAM_AC6_MSB (10) #BMP180_CALIB_PARAM_AC6_LSB (11) #BMP180_CALIB_PARAM_B1_MSB (12) #BMP180_CALIB_PARAM_B1_LSB (13) #BMP180_CALIB_PARAM_B2_MSB (14) #BMP180_CALIB_PARAM_B2_LSB (15) #BMP180_CALIB_PARAM_MB_MSB (16) #BMP180_CALIB_PARAM_MB_LSB (17) #BMP180_CALIB_PARAM_MC_MSB (18) #BMP180_CALIB_PARAM_MC_LSB (19) #BMP180_CALIB_PARAM_MD_MSB (20) #BMP180_CALIB_PARAM_MD_LSB (21) ############################################################################ ## BIT MASK, LENGTH AND POSITION FOR REGISTERS ############################################################################ ############################################################################ ## BIT MASK, LENGTH AND POSITION FOR CHIP ID REGISTERS ############################################################################ BMP180_CHIP_ID__POS = (0) BMP180_CHIP_ID__MSK = (0xFF) BMP180_CHIP_ID__LEN = (8) BMP180_CHIP_ID__REG = (BMP180_CHIP_ID_REG) ############################################################################ ## BIT MASK, LENGTH AND POSITION FOR ML VERSION ############################################################################ BMP180_ML_VERSION__POS = (0) BMP180_ML_VERSION__LEN = (4) BMP180_ML_VERSION__MSK = (0x0F) BMP180_ML_VERSION__REG = (BMP180_VERSION_REG) ############################################################################ ##name BIT MASK, LENGTH AND POSITION FOR AL VERSION ############################################################################ BMP180_AL_VERSION__POS = (4) BMP180_AL_VERSION__LEN = (4) BMP180_AL_VERSION__MSK = (0xF0) BMP180_AL_VERSION__REG = (BMP180_VERSION_REG) ############################################################################ ## FUNCTION FOR CALIBRATION ############################################################################ # # @brief this function used for read the calibration # parameter from the register # # Parameter | MSB | LSB | bit # ------------|---------|---------|----------- # AC1 | 0xAA | 0xAB | 0 to 7 # AC2 | 0xAC | 0xAD | 0 to 7 # AC3 | 0xAE | 0xAF | 0 to 7 # AC4 | 0xB0 | 0xB1 | 0 to 7 # AC5 | 0xB2 | 0xB3 | 0 to 7 # AC6 | 0xB4 | 0xB5 | 0 to 7 # B1 | 0xB6 | 0xB7 | 0 to 7 # B2 | 0xB8 | 0xB9 | 0 to 7 # MB | 0xBA | 0xBB | 0 to 7 # MC | 0xBC | 0xBD | 0 to 7 # MD | 0xBE | 0xBF | 0 to 7 # # # @return results of bus communication function # @retval 0 -> Success # @retval -1 -> Error #
bmp180_addr = 119 bmp180_start = 170 bmp180_prom_data__len = 22 bmp180_chip_id_reg = 208 bmp180_version_reg = 209 bmp180_ctrl_meas_reg = 244 bmp180_adc_out_msb_reg = 246 bmp180_adc_out_lsb_reg = 247 bmp180_soft_reset_reg = 224 bmp180_t_measure = 46 bmp180_p_measure = 52 bmp180_temp_conversion_time = 5 bmp180_param_mg = 3038 bmp180_param_mh = -7357 bmp180_param_mi = 3791 bmp180_chip_id__pos = 0 bmp180_chip_id__msk = 255 bmp180_chip_id__len = 8 bmp180_chip_id__reg = BMP180_CHIP_ID_REG bmp180_ml_version__pos = 0 bmp180_ml_version__len = 4 bmp180_ml_version__msk = 15 bmp180_ml_version__reg = BMP180_VERSION_REG bmp180_al_version__pos = 4 bmp180_al_version__len = 4 bmp180_al_version__msk = 240 bmp180_al_version__reg = BMP180_VERSION_REG
class Solution: def diagonalSort(self, mat: List[List[int]]) -> List[List[int]]: m, n = len(mat), len(mat[0]) q = [[] for i in range(m + n)] for i in range(m): for j in range(n): q[i - j + n].append(mat[i][j]) q = list(map(lambda x: sorted(x, reverse=True), q)) for i in range(m): for j in range(n): mat[i][j] = q[i - j + n].pop() return mat
class Solution: def diagonal_sort(self, mat: List[List[int]]) -> List[List[int]]: (m, n) = (len(mat), len(mat[0])) q = [[] for i in range(m + n)] for i in range(m): for j in range(n): q[i - j + n].append(mat[i][j]) q = list(map(lambda x: sorted(x, reverse=True), q)) for i in range(m): for j in range(n): mat[i][j] = q[i - j + n].pop() return mat
# # PySNMP MIB module ATTO-PRODUCTS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ATTO-PRODUCTS-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:31:53 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibIdentifier, TimeTicks, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, IpAddress, NotificationType, ObjectIdentity, Bits, Counter64, ModuleIdentity, Integer32, iso, enterprises, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "TimeTicks", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "IpAddress", "NotificationType", "ObjectIdentity", "Bits", "Counter64", "ModuleIdentity", "Integer32", "iso", "enterprises", "Unsigned32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") attoProductsMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 4547, 3, 2)) attoProductsMIB.setRevisions(('2013-04-19 13:45',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: attoProductsMIB.setRevisionsDescriptions(('Initial version of this module.',)) if mibBuilder.loadTexts: attoProductsMIB.setLastUpdated('201304191345Z') if mibBuilder.loadTexts: attoProductsMIB.setOrganization('ATTO Technology, Inc.') if mibBuilder.loadTexts: attoProductsMIB.setContactInfo('ATTO Technology 155 Crosspoint Parkway Amherst NY 14068 EMail: <support@attotech.com>') if mibBuilder.loadTexts: attoProductsMIB.setDescription('This modules defines object identifiers assigned to various hardware platforms, which are returned as values for sysObjectID.') attotech = MibIdentifier((1, 3, 6, 1, 4, 1, 4547)) attoProducts = MibIdentifier((1, 3, 6, 1, 4, 1, 4547, 1)) attoMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 4547, 2)) attoModules = MibIdentifier((1, 3, 6, 1, 4, 1, 4547, 3)) attoAgentCapability = MibIdentifier((1, 3, 6, 1, 4, 1, 4547, 4)) attoGenericDevice = MibIdentifier((1, 3, 6, 1, 4, 1, 4547, 1, 1)) attoHba = MibIdentifier((1, 3, 6, 1, 4, 1, 4547, 1, 3)) attoFB6500 = MibIdentifier((1, 3, 6, 1, 4, 1, 4547, 1, 4)) attoFB6500N = MibIdentifier((1, 3, 6, 1, 4, 1, 4547, 1, 5)) mibBuilder.exportSymbols("ATTO-PRODUCTS-MIB", attoFB6500=attoFB6500, attoModules=attoModules, attotech=attotech, attoMgmt=attoMgmt, attoProductsMIB=attoProductsMIB, attoFB6500N=attoFB6500N, attoHba=attoHba, attoGenericDevice=attoGenericDevice, attoProducts=attoProducts, attoAgentCapability=attoAgentCapability, PYSNMP_MODULE_ID=attoProductsMIB)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, single_value_constraint, value_size_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (mib_identifier, time_ticks, counter32, mib_scalar, mib_table, mib_table_row, mib_table_column, gauge32, ip_address, notification_type, object_identity, bits, counter64, module_identity, integer32, iso, enterprises, unsigned32) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibIdentifier', 'TimeTicks', 'Counter32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Gauge32', 'IpAddress', 'NotificationType', 'ObjectIdentity', 'Bits', 'Counter64', 'ModuleIdentity', 'Integer32', 'iso', 'enterprises', 'Unsigned32') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') atto_products_mib = module_identity((1, 3, 6, 1, 4, 1, 4547, 3, 2)) attoProductsMIB.setRevisions(('2013-04-19 13:45',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: attoProductsMIB.setRevisionsDescriptions(('Initial version of this module.',)) if mibBuilder.loadTexts: attoProductsMIB.setLastUpdated('201304191345Z') if mibBuilder.loadTexts: attoProductsMIB.setOrganization('ATTO Technology, Inc.') if mibBuilder.loadTexts: attoProductsMIB.setContactInfo('ATTO Technology 155 Crosspoint Parkway Amherst NY 14068 EMail: <support@attotech.com>') if mibBuilder.loadTexts: attoProductsMIB.setDescription('This modules defines object identifiers assigned to various hardware platforms, which are returned as values for sysObjectID.') attotech = mib_identifier((1, 3, 6, 1, 4, 1, 4547)) atto_products = mib_identifier((1, 3, 6, 1, 4, 1, 4547, 1)) atto_mgmt = mib_identifier((1, 3, 6, 1, 4, 1, 4547, 2)) atto_modules = mib_identifier((1, 3, 6, 1, 4, 1, 4547, 3)) atto_agent_capability = mib_identifier((1, 3, 6, 1, 4, 1, 4547, 4)) atto_generic_device = mib_identifier((1, 3, 6, 1, 4, 1, 4547, 1, 1)) atto_hba = mib_identifier((1, 3, 6, 1, 4, 1, 4547, 1, 3)) atto_fb6500 = mib_identifier((1, 3, 6, 1, 4, 1, 4547, 1, 4)) atto_fb6500_n = mib_identifier((1, 3, 6, 1, 4, 1, 4547, 1, 5)) mibBuilder.exportSymbols('ATTO-PRODUCTS-MIB', attoFB6500=attoFB6500, attoModules=attoModules, attotech=attotech, attoMgmt=attoMgmt, attoProductsMIB=attoProductsMIB, attoFB6500N=attoFB6500N, attoHba=attoHba, attoGenericDevice=attoGenericDevice, attoProducts=attoProducts, attoAgentCapability=attoAgentCapability, PYSNMP_MODULE_ID=attoProductsMIB)
def cCollateralBugHandler_fbPoisonRegister( oSelf, oProcess, oThread, sInstruction, duPoisonedRegisterValue_by_sbName, u0PointerSizedOriginalValue, sbRegisterName, uSizeInBits, ): uPoisonValue = oSelf.fuGetPoisonedValue( oProcess = oProcess, oWindowsAPIThread = oProcess.foGetWindowsAPIThreadForId(oThread.uId), sDestination = str(b"register %s" % sbRegisterName, "ascii", "strict"), sInstruction = sInstruction, i0CurrentValue = oThread.fu0GetRegister(sbRegisterName), uBits = uSizeInBits, u0PointerSizedOriginalValue = u0PointerSizedOriginalValue, ); # print "Faked read %d bits (0x%X) into %d bits %s" % (uSourceSize, uPoisonValue, uDestinationSizeInBits, sbRegisterName); duPoisonedRegisterValue_by_sbName[sbRegisterName] = uPoisonValue; return True;
def c_collateral_bug_handler_fb_poison_register(oSelf, oProcess, oThread, sInstruction, duPoisonedRegisterValue_by_sbName, u0PointerSizedOriginalValue, sbRegisterName, uSizeInBits): u_poison_value = oSelf.fuGetPoisonedValue(oProcess=oProcess, oWindowsAPIThread=oProcess.foGetWindowsAPIThreadForId(oThread.uId), sDestination=str(b'register %s' % sbRegisterName, 'ascii', 'strict'), sInstruction=sInstruction, i0CurrentValue=oThread.fu0GetRegister(sbRegisterName), uBits=uSizeInBits, u0PointerSizedOriginalValue=u0PointerSizedOriginalValue) duPoisonedRegisterValue_by_sbName[sbRegisterName] = uPoisonValue return True
''' Challenge Suppose the following input is supplied to the program: without,hello,bag,world Then, the output should be: bag,hello,without,world ''' items = [x for x in input('Enter words separated with comma: ').split(',')] items.sort() print(','.join(items))
""" Challenge Suppose the following input is supplied to the program: without,hello,bag,world Then, the output should be: bag,hello,without,world """ items = [x for x in input('Enter words separated with comma: ').split(',')] items.sort() print(','.join(items))
""" Space : O(n) Time : O(n) """ class Solution: def fib(self, n: int) -> int: mem = [0, 1] if n <= 1: return mem[n] for i in range(2, n+1): mem.append(mem[i-1] + mem[i-2]) return mem[-1]
""" Space : O(n) Time : O(n) """ class Solution: def fib(self, n: int) -> int: mem = [0, 1] if n <= 1: return mem[n] for i in range(2, n + 1): mem.append(mem[i - 1] + mem[i - 2]) return mem[-1]
def left_join(phrases): if(len(phrases) < 1 or len(phrases) > 41): return "Error" mytext = ','.join(phrases); mytext = mytext.replace("right", "left"); return mytext if __name__ == '__main__': #These "asserts" using only for self-checking and not necessary for auto-testing assert left_join(("left", "right", "left", "stop")) == "left,left,left,stop", "All to left" assert left_join(("bright aright", "ok")) == "bleft aleft,ok", "Bright Left" assert left_join(("brightness wright",)) == "bleftness wleft", "One phrase" assert left_join(("enough", "jokes")) == "enough,jokes", "Nothing to replace"
def left_join(phrases): if len(phrases) < 1 or len(phrases) > 41: return 'Error' mytext = ','.join(phrases) mytext = mytext.replace('right', 'left') return mytext if __name__ == '__main__': assert left_join(('left', 'right', 'left', 'stop')) == 'left,left,left,stop', 'All to left' assert left_join(('bright aright', 'ok')) == 'bleft aleft,ok', 'Bright Left' assert left_join(('brightness wright',)) == 'bleftness wleft', 'One phrase' assert left_join(('enough', 'jokes')) == 'enough,jokes', 'Nothing to replace'
class ONE(object): symbol = 'I' value = 1 class FIVE(object): symbol = 'V' value = 5 class TEN(object): symbol = 'X' value = 10 class FIFTY(object): symbol = 'L' value = 50 class HUNDRED(object): symbol = 'C' value = 100 class FOUR(object): symbol = ONE.symbol + FIVE.symbol value = FIVE.value - ONE.value class NINE(object): symbol = ONE.symbol + TEN.symbol value = TEN.value - ONE.value class FOURTY(object): symbol = TEN.symbol + FIFTY.symbol value = FIFTY.value - TEN.value interval = range(value, value + TEN.value) class NINETY(object): symbol = TEN. symbol + HUNDRED.symbol value = HUNDRED.value - TEN.value interval = range(value, value + TEN.value) class Roman(object): @staticmethod def translate(number): if number <= 3: return ONE.symbol * number base = Roman.base_roman_for(number) return base.symbol + Roman.translate(number - base.value) @staticmethod def is_special_value(number): return number in [FOUR.value, NINE.value] + FOURTY.interval + NINETY.interval @staticmethod def base_roman_for(number): if number in NINETY.interval: return NINETY if number in FOURTY.interval: return FOURTY if number == FOUR.value: return FOUR if number == NINE.value: return NINE if number >= HUNDRED.value: return HUNDRED if number >= FIFTY.value: return FIFTY if number >= TEN.value: return TEN if number >= FIVE.value: return FIVE
class One(object): symbol = 'I' value = 1 class Five(object): symbol = 'V' value = 5 class Ten(object): symbol = 'X' value = 10 class Fifty(object): symbol = 'L' value = 50 class Hundred(object): symbol = 'C' value = 100 class Four(object): symbol = ONE.symbol + FIVE.symbol value = FIVE.value - ONE.value class Nine(object): symbol = ONE.symbol + TEN.symbol value = TEN.value - ONE.value class Fourty(object): symbol = TEN.symbol + FIFTY.symbol value = FIFTY.value - TEN.value interval = range(value, value + TEN.value) class Ninety(object): symbol = TEN.symbol + HUNDRED.symbol value = HUNDRED.value - TEN.value interval = range(value, value + TEN.value) class Roman(object): @staticmethod def translate(number): if number <= 3: return ONE.symbol * number base = Roman.base_roman_for(number) return base.symbol + Roman.translate(number - base.value) @staticmethod def is_special_value(number): return number in [FOUR.value, NINE.value] + FOURTY.interval + NINETY.interval @staticmethod def base_roman_for(number): if number in NINETY.interval: return NINETY if number in FOURTY.interval: return FOURTY if number == FOUR.value: return FOUR if number == NINE.value: return NINE if number >= HUNDRED.value: return HUNDRED if number >= FIFTY.value: return FIFTY if number >= TEN.value: return TEN if number >= FIVE.value: return FIVE
# python3 def naive_fibonacci_partial_sum(m: int, n: int) -> int: total = 0 previous, current = 0, 1 for i in range(n + 1): if i >= m: total += previous previous, current = current, previous + current return total % 10 def fast_fibonacci_huge(n: int, m: int) -> int: pisano = list() pisano.append(0) pisano.append(1) previous, current, last = 0, 1, 2 for i in range(n - 1): previous, current = current, previous + current pisano.append(current % m) for step in range(last, len(pisano) // 2): if pisano[:step] == pisano[step:2 * step]: return pisano[n % step] last = step + 1 return current % m def fast_fibonacci_partial_sum(m: int, n: int) -> int: # sum(fm-1) = fm+1 - f1 # sum(fn) = fn+2 - f1 (see the previous solution) # partial sum(fm...fn) = sum(fn) - sum(fm-1) = fn+2 - fm+1 subset, full = fast_fibonacci_huge(m + 1, 10), fast_fibonacci_huge(n + 2, 10) return full - subset if full > subset else (10 - subset + full) % 10 if __name__ == '__main__': print(fast_fibonacci_partial_sum(*map(int, input().split())))
def naive_fibonacci_partial_sum(m: int, n: int) -> int: total = 0 (previous, current) = (0, 1) for i in range(n + 1): if i >= m: total += previous (previous, current) = (current, previous + current) return total % 10 def fast_fibonacci_huge(n: int, m: int) -> int: pisano = list() pisano.append(0) pisano.append(1) (previous, current, last) = (0, 1, 2) for i in range(n - 1): (previous, current) = (current, previous + current) pisano.append(current % m) for step in range(last, len(pisano) // 2): if pisano[:step] == pisano[step:2 * step]: return pisano[n % step] last = step + 1 return current % m def fast_fibonacci_partial_sum(m: int, n: int) -> int: (subset, full) = (fast_fibonacci_huge(m + 1, 10), fast_fibonacci_huge(n + 2, 10)) return full - subset if full > subset else (10 - subset + full) % 10 if __name__ == '__main__': print(fast_fibonacci_partial_sum(*map(int, input().split())))
class atom_type: """ Class that describes the atomtype representation in the GROMACS topology file Args: ---- line(str): A string which is the line in the GROMACS topology file that holds information about an atom """ def __init__(self,line): # name at.num mass charge ptype sigma epsilon if ";" in line: line = line.split(";")[0].rstrip() line = line.split() self.name = line[0] self.atnum = int(line[1]) self.mass = float(line[2]) self.charge = float(line[3]) self.ptype = line[4] self.sigma = float(line[5]) self.epsilon = float(line[6]) self.strff = "{0:>6}{1:>6d}{2:>9.3f}{3:>9.3f}{4:>6}{5:>12.5f}{6:>12.5f}\n".format(self.name,self.atnum,\ self.mass,self.charge,self.ptype,self.sigma,self.epsilon) def __str__(self): return "Atom type {} with mass {}.Sigma:{}, Epsilon:{}".format(self.name, self.mass, self.sigma,self.epsilon) def __repr__(self): return self.__str__() class atom: """ Class that describes how an atom is represented in the gromacs topology file. This only goes into the file for the molecular definition of a molecule Args: ---- line(str): The line from the GROMACS topology file that holds information about the atom """ def __init__(self,line): # nr type resnr residue atom cgnr charge mass # get rid of all the comments in the line that holds the atom information if ";" in line: line = line.split(";")[0].rstrip() line = line.split() self.nr = line[0] self.type = line[1] self.resnr = line[2] self.residue = line[3] self.atom = line[4] self.cgnr = int(line[5]) self.charge = float(line[6]) self.mass = float(line[7]) self.strmol = "{0:>6}{1:>6}{2:>6}{3:>7}{4:>7}{5:>6d}{6:>12.5f}{7:>12.5f}\n".format(self.nr,self.type,self.resnr,\ self.residue,self.atom,self.cgnr,self.charge,self.mass) def __eq__(self,other): if (self.type == other.type) & (self.mass == other.mass): return True else: return False def __str__(self): return "Atom of type {} with residue {} of mass {} and charge {}".format(self.type,\ self.residue,self.mass,self.charge) def __repr__(self): return self.__str__() class bond: """ Class that represents how a bond is reprenseted in the gromacs topology file """ def __init__(self,line,atominfo,mol_params=False): # ai aj funct c0 c1 c2 c3 if ";" in line: line = line.split(";")[0].rstrip() line = line.split() N = len(line) Nparams = N - 3 self.atom1 = atominfo[int(line[0])] self.atnum1 = int(line[0]) self.atom2 = atominfo[int(line[1])] self.atnum2 = int(line[1]) self.funct = int(line[2]) self.params = [] self.Nparams = Nparams self.mol_params = mol_params for i in range(3,N): self.params.append(line[i]) if self.funct == 1 or self.funct == 2: self.strff = "{0:>6}{1:>6}{2:>6}{3:>9.3f}{4:>12.3f}\n".format(self.atom1.type,\ self.atom2.type,\ self.funct,float(self.params[0]),float(self.params[1])) else: raise NotImplementedError("The given function {} is not implemented yet".format(self.funct)) if self.mol_params: if self.funct == 1 or self.funct == 2: self.strmol = "{0:>6}{1:>6}{2:>6}{3:>9.3f}{4:>12.3f}\t;{5:>4}{6:>4}\n".format(self.atnum1,\ self.atnum2,self.funct,\ float(self.params[0]),float(self.params[1]),\ self.atom1.type,self.atom2.type) else: raise NotImplementedError("The given function {} is not implemented yet".format(self.funct)) else: self.strmol = "{0:>6}{1:>6}\t;{2:>4}{3:>4}\n".format(self.atnum1,\ self.atnum2,self.atom1.type,self.atom2.type) def __eq__(self,other): if (self.atom1==other.atom1) and (self.atom2==other.atom2) and \ (self.funct == other.funct) and (self.params==other.params): return True elif (self.atom1==other.atom2) and (self.atom2==other.atom1) and \ (self.funct == other.funct) and (self.params==other.params): return True else: return False def __str__(self): return "Bond between {}-{} with funct {} and parameters {}".format(self.atom1.type,self.atom2.type,self.funct,self.params) def __repr__(self): return self.__str__() class angle: """ Class that representes an angle based on the representation of angles in GROMACS Args: ---- line(str): A str that represents a line in the topology file of GROMACS that represents an angle atominfo(dict): A dictionary that holds all the atoms in the molecule which is passed in as a dictionary """ def __init__(self,line,atominfo,mol_params=False): # ai aj ak funct c0 c1 c2 c3 # delete comments in a line if ";" in line: line = line.split(";")[0].rstrip() line = line.split() N = len(line) Nparams = N - 4 self.atom1 = atominfo[int(line[0])] self.atnum1 = int(line[0]) self.atom2 = atominfo[int(line[1])] self.atnum2 = int(line[1]) self.atom3 = atominfo[int(line[2])] self.atnum3 = int(line[2]) self.funct = int(line[3]) self.params = [] self.Nparams = Nparams self.mol_params = mol_params for i in range(4,N): self.params.append(line[i]) if self.funct == 1 or self.funct == 2: self.strff = "{0:>6}{1:>6}{2:>6}{3:>6}{4:>9.3f}{5:>12.3f}\n".format(self.atom1.type,\ self.atom2.type,self.atom3.type,\ self.funct,float(self.params[0]),float(self.params[1])) else: raise NotImplementedError("The given function {} is not implemented yet".format(self.funct)) # See if parameter needs to be written in molecule file if self.mol_params: if self.funct == 1 or self.funct == 2: self.strmol = "{0:>6}{1:>6}{2:>6}{3:>6}{4:>9.3f}{5:>12.3f}\t;{6:>4}{7:>4}{8:>4}\n".format(self.atnum1,\ self.atnum2,self.atnum3,\ self.funct,float(self.params[0]),float(self.params[1]),self.atom1.type,self.atom2.type,self.atom3.type) else: raise NotImplementedError("The given function {} is not implemented yet".format(self.funct)) else: self.strmol = "{0:>6}{1:>6}{2:>6}\t;{3:>4}{4:>4}{5:>4}\n".format(self.atnum1,\ self.atnum2,self.atnum3,self.atom1.type,self.atom2.type,self.atom3.type) def __eq__(self,other): if (self.atom1==other.atom1) and (self.atom2==other.atom2) and \ (self.atom3==other.atom3) and (self.funct == other.funct) and (self.params==other.params): return True elif (self.atom1==other.atom3) and (self.atom2==other.atom2) and \ (self.atom3==other.atom1) and (self.funct == other.funct) and (self.params==other.params): return True else: return False def __str__(self): return "Angle between {}-{}-{} with funct {} and params {}".format(self.atom1.type,self.atom2.type,\ self.atom3.type,self.funct, self.params) def __repr__(self): return self.__str__() class dihedral: """ Class that represents the dihedrals in GROMACS topology files """ def __init__(self,line,atominfo,mol_params=False): # ai aj ak al funct c0 c1 c2 c3 c4 c5 if ";" in line: line = line.split(";")[0].rstrip() line = line.split() N = len(line) self.atom1 = atominfo[int(line[0])] self.atnum1 = int(line[0]) self.atom2 = atominfo[int(line[1])] self.atnum2 = int(line[1]) self.atom3 = atominfo[int(line[2])] self.atnum3 = int(line[2]) self.atom4 = atominfo[int(line[3])] self.atnum4 = int(line[3]) self.funct = int(line[4]) self.params = [] self.mol_params = mol_params for i in range(5,N): self.params.append(line[i]) if self.funct == 1 or self.funct==4 or self.funct==9: # funct = 1 is section 4.2.13 of gromacs manual 5.1.4 which has parameters phis,kphi,multiplicity # funct = 4 is section 4.2.12 of gromacs manual 5.1.4 which has parameters phis,kphi and multiplicity self.strff = "{0:>6}{1:>6}{2:>6}{3:>6}{4:>6}{5:>9.3f}{6:>9.3f}{7:>9d}\n".format(self.atom1.type,\ self.atom2.type,self.atom3.type,self.atom4.type,\ self.funct,float(self.params[0]),float(self.params[1]),int(self.params[2])) elif self.funct == 3: # funct = 3 is RB dihedral in section 4.2.13 of gromacs manual 5.1.4 which has parameters C0, C1, C2, C3, C4, C5 self.strff = "{0:>6}{1:>6}{2:>6}{3:>6}{4:>6}{5:>9.3}{6:>9.3f}{6:>9.3f}{7:9.3f}{8:9.3f}{9:9.3f}\n".format(self.atom1.type,\ self.atom2.type,self.atom3.type,self.atom4.type,\ self.funct,float(self.params[0]),float(self.params[1]),float(self.params[2]),\ float(self.params[3]),float(self.params[4]),float(self.params[5])) else: raise NotImplementedError("The given function {} is not implemented yet".format(self.funct)) # If parameters are included in molecule if self.mol_params: if self.funct == 3: self.strmol = "{0:>6}{1:>6}{2:>6}{3:>6}{4:>6}{5:>12.6f}{6:>12.6f}{7:>12.6f}{8:12.6f}{9:12.6f}{10:12.6f}\t;{11:>4}{12:>4}{13:>4}{14:>4}\n".format(self.atnum1,\ self.atnum2,self.atnum3,self.atnum4,\ self.funct,float(self.params[0]),float(self.params[1]),float(self.params[2]),\ float(self.params[3]),float(self.params[4]),float(self.params[5]),self.atom1.type,self.atom2.type,self.atom3.type,self.atom4.type) elif self.funct == 1 or self.funct == 4 or self.funct == 9: self.strmol = "{0:>6}{1:>6}{2:>6}{3:>6}{4:>6}{5:>9.3f}{6:>9.3f}{7:>9d}\t;{8:>4}{9:>4}{10:>4}{11:>4}\n".format(self.atnum1,\ self.atnum2,self.atnum3,self.atnum4,\ self.funct,float(self.params[0]),float(self.params[1]),int(self.params[2]),self.atom1.type,self.atom2.type,\ self.atom3.type,self.atom4.type) else: raise NotImplementedError("The given function {} is not implemented yet".format(self.funct)) else: self.strmol = "{0:>6}{1:>6}{2:>6}{3:>6}\t;{4:>4}{5:>4}{6:>4}{7:>4}\n".format(self.atnum1,\ self.atnum2,self.atnum3,self.atnum4,self.atom1.type,self.atom2.type,self.atom3.type,\ self.atom4.type) def general_dihedral(self): if self.funct == 1 or self.funct==4 or self.funct==9: # funct = 1 is section 4.2.13 of gromacs manual 5.1.4 which has parameters phis,kphi,multiplicity # funct = 4 is section 4.2.12 of gromacs manual 5.1.4 which has parameters phis,kphi and multiplicity self.strff = "{0:>6}{1:>6}{2:>6}{3:>6}{4:>6}{5:>9.3f}{6:>9.3f}{7:>9d}\n".format("X",\ self.atom2.type,self.atom3.type,"X",\ self.funct,float(self.params[0]),float(self.params[1]),int(self.params[2])) def __eq__(self,other): # Only return true if all the atom numbers match (So it is the same dihedral) if (self.atnum1==other.atnum1) and (self.atnum2==other.atnum2) and \ (self.atnum3==other.atnum3) and (self.atnum4==other.atnum4): return True else: return False def append(self,other): """ Function that appends another dihedral to the current dihedral, most likely used scenario is when there is one dihedral that has multiple multiplicities Args: ---- other(dihedral): A dihedral object Return: ------ strmol, strff and params are extended by the other dihedral object """ # check if passed in is a list of dihedral objects if (self.strmol != other.strmol) and (self.strff != other.strff) and (self.params != other.params): self.strmol += other.strmol self.strff += other.strff self.params += other.params def compare(self,other): """ Function that returns True if all the atom types as well as all the parameters matches with each other """ if (self.atom1.type==other.atom1.type) and (self.atom2.type==other.atom2.type) and (self.atom3.type==other.atom3.type) and (self.atom4.type==self.atom4.type) and (self.funct==other.funct) and (self.params == other.params): return True elif (self.atom1.type==other.atom4.type) and (self.atom2.type==other.atom3.type) and (self.atom3.type==other.atom2.type) and (self.atom4.type==self.atom1.type) and (self.funct==other.funct) and (self.params == other.params): return True else: return False def __str__(self): return "Dihedral between {}-{}-{}-{} with funct {} with params {}".format(self.atom1.type,self.atom2.type,\ self.atom3.type,self.atom4.type,self.funct,self.params) def __repr__(self): return self.__str__()
class Atom_Type: """ Class that describes the atomtype representation in the GROMACS topology file Args: ---- line(str): A string which is the line in the GROMACS topology file that holds information about an atom """ def __init__(self, line): if ';' in line: line = line.split(';')[0].rstrip() line = line.split() self.name = line[0] self.atnum = int(line[1]) self.mass = float(line[2]) self.charge = float(line[3]) self.ptype = line[4] self.sigma = float(line[5]) self.epsilon = float(line[6]) self.strff = '{0:>6}{1:>6d}{2:>9.3f}{3:>9.3f}{4:>6}{5:>12.5f}{6:>12.5f}\n'.format(self.name, self.atnum, self.mass, self.charge, self.ptype, self.sigma, self.epsilon) def __str__(self): return 'Atom type {} with mass {}.Sigma:{}, Epsilon:{}'.format(self.name, self.mass, self.sigma, self.epsilon) def __repr__(self): return self.__str__() class Atom: """ Class that describes how an atom is represented in the gromacs topology file. This only goes into the file for the molecular definition of a molecule Args: ---- line(str): The line from the GROMACS topology file that holds information about the atom """ def __init__(self, line): if ';' in line: line = line.split(';')[0].rstrip() line = line.split() self.nr = line[0] self.type = line[1] self.resnr = line[2] self.residue = line[3] self.atom = line[4] self.cgnr = int(line[5]) self.charge = float(line[6]) self.mass = float(line[7]) self.strmol = '{0:>6}{1:>6}{2:>6}{3:>7}{4:>7}{5:>6d}{6:>12.5f}{7:>12.5f}\n'.format(self.nr, self.type, self.resnr, self.residue, self.atom, self.cgnr, self.charge, self.mass) def __eq__(self, other): if (self.type == other.type) & (self.mass == other.mass): return True else: return False def __str__(self): return 'Atom of type {} with residue {} of mass {} and charge {}'.format(self.type, self.residue, self.mass, self.charge) def __repr__(self): return self.__str__() class Bond: """ Class that represents how a bond is reprenseted in the gromacs topology file """ def __init__(self, line, atominfo, mol_params=False): if ';' in line: line = line.split(';')[0].rstrip() line = line.split() n = len(line) nparams = N - 3 self.atom1 = atominfo[int(line[0])] self.atnum1 = int(line[0]) self.atom2 = atominfo[int(line[1])] self.atnum2 = int(line[1]) self.funct = int(line[2]) self.params = [] self.Nparams = Nparams self.mol_params = mol_params for i in range(3, N): self.params.append(line[i]) if self.funct == 1 or self.funct == 2: self.strff = '{0:>6}{1:>6}{2:>6}{3:>9.3f}{4:>12.3f}\n'.format(self.atom1.type, self.atom2.type, self.funct, float(self.params[0]), float(self.params[1])) else: raise not_implemented_error('The given function {} is not implemented yet'.format(self.funct)) if self.mol_params: if self.funct == 1 or self.funct == 2: self.strmol = '{0:>6}{1:>6}{2:>6}{3:>9.3f}{4:>12.3f}\t;{5:>4}{6:>4}\n'.format(self.atnum1, self.atnum2, self.funct, float(self.params[0]), float(self.params[1]), self.atom1.type, self.atom2.type) else: raise not_implemented_error('The given function {} is not implemented yet'.format(self.funct)) else: self.strmol = '{0:>6}{1:>6}\t;{2:>4}{3:>4}\n'.format(self.atnum1, self.atnum2, self.atom1.type, self.atom2.type) def __eq__(self, other): if self.atom1 == other.atom1 and self.atom2 == other.atom2 and (self.funct == other.funct) and (self.params == other.params): return True elif self.atom1 == other.atom2 and self.atom2 == other.atom1 and (self.funct == other.funct) and (self.params == other.params): return True else: return False def __str__(self): return 'Bond between {}-{} with funct {} and parameters {}'.format(self.atom1.type, self.atom2.type, self.funct, self.params) def __repr__(self): return self.__str__() class Angle: """ Class that representes an angle based on the representation of angles in GROMACS Args: ---- line(str): A str that represents a line in the topology file of GROMACS that represents an angle atominfo(dict): A dictionary that holds all the atoms in the molecule which is passed in as a dictionary """ def __init__(self, line, atominfo, mol_params=False): if ';' in line: line = line.split(';')[0].rstrip() line = line.split() n = len(line) nparams = N - 4 self.atom1 = atominfo[int(line[0])] self.atnum1 = int(line[0]) self.atom2 = atominfo[int(line[1])] self.atnum2 = int(line[1]) self.atom3 = atominfo[int(line[2])] self.atnum3 = int(line[2]) self.funct = int(line[3]) self.params = [] self.Nparams = Nparams self.mol_params = mol_params for i in range(4, N): self.params.append(line[i]) if self.funct == 1 or self.funct == 2: self.strff = '{0:>6}{1:>6}{2:>6}{3:>6}{4:>9.3f}{5:>12.3f}\n'.format(self.atom1.type, self.atom2.type, self.atom3.type, self.funct, float(self.params[0]), float(self.params[1])) else: raise not_implemented_error('The given function {} is not implemented yet'.format(self.funct)) if self.mol_params: if self.funct == 1 or self.funct == 2: self.strmol = '{0:>6}{1:>6}{2:>6}{3:>6}{4:>9.3f}{5:>12.3f}\t;{6:>4}{7:>4}{8:>4}\n'.format(self.atnum1, self.atnum2, self.atnum3, self.funct, float(self.params[0]), float(self.params[1]), self.atom1.type, self.atom2.type, self.atom3.type) else: raise not_implemented_error('The given function {} is not implemented yet'.format(self.funct)) else: self.strmol = '{0:>6}{1:>6}{2:>6}\t;{3:>4}{4:>4}{5:>4}\n'.format(self.atnum1, self.atnum2, self.atnum3, self.atom1.type, self.atom2.type, self.atom3.type) def __eq__(self, other): if self.atom1 == other.atom1 and self.atom2 == other.atom2 and (self.atom3 == other.atom3) and (self.funct == other.funct) and (self.params == other.params): return True elif self.atom1 == other.atom3 and self.atom2 == other.atom2 and (self.atom3 == other.atom1) and (self.funct == other.funct) and (self.params == other.params): return True else: return False def __str__(self): return 'Angle between {}-{}-{} with funct {} and params {}'.format(self.atom1.type, self.atom2.type, self.atom3.type, self.funct, self.params) def __repr__(self): return self.__str__() class Dihedral: """ Class that represents the dihedrals in GROMACS topology files """ def __init__(self, line, atominfo, mol_params=False): if ';' in line: line = line.split(';')[0].rstrip() line = line.split() n = len(line) self.atom1 = atominfo[int(line[0])] self.atnum1 = int(line[0]) self.atom2 = atominfo[int(line[1])] self.atnum2 = int(line[1]) self.atom3 = atominfo[int(line[2])] self.atnum3 = int(line[2]) self.atom4 = atominfo[int(line[3])] self.atnum4 = int(line[3]) self.funct = int(line[4]) self.params = [] self.mol_params = mol_params for i in range(5, N): self.params.append(line[i]) if self.funct == 1 or self.funct == 4 or self.funct == 9: self.strff = '{0:>6}{1:>6}{2:>6}{3:>6}{4:>6}{5:>9.3f}{6:>9.3f}{7:>9d}\n'.format(self.atom1.type, self.atom2.type, self.atom3.type, self.atom4.type, self.funct, float(self.params[0]), float(self.params[1]), int(self.params[2])) elif self.funct == 3: self.strff = '{0:>6}{1:>6}{2:>6}{3:>6}{4:>6}{5:>9.3}{6:>9.3f}{6:>9.3f}{7:9.3f}{8:9.3f}{9:9.3f}\n'.format(self.atom1.type, self.atom2.type, self.atom3.type, self.atom4.type, self.funct, float(self.params[0]), float(self.params[1]), float(self.params[2]), float(self.params[3]), float(self.params[4]), float(self.params[5])) else: raise not_implemented_error('The given function {} is not implemented yet'.format(self.funct)) if self.mol_params: if self.funct == 3: self.strmol = '{0:>6}{1:>6}{2:>6}{3:>6}{4:>6}{5:>12.6f}{6:>12.6f}{7:>12.6f}{8:12.6f}{9:12.6f}{10:12.6f}\t;{11:>4}{12:>4}{13:>4}{14:>4}\n'.format(self.atnum1, self.atnum2, self.atnum3, self.atnum4, self.funct, float(self.params[0]), float(self.params[1]), float(self.params[2]), float(self.params[3]), float(self.params[4]), float(self.params[5]), self.atom1.type, self.atom2.type, self.atom3.type, self.atom4.type) elif self.funct == 1 or self.funct == 4 or self.funct == 9: self.strmol = '{0:>6}{1:>6}{2:>6}{3:>6}{4:>6}{5:>9.3f}{6:>9.3f}{7:>9d}\t;{8:>4}{9:>4}{10:>4}{11:>4}\n'.format(self.atnum1, self.atnum2, self.atnum3, self.atnum4, self.funct, float(self.params[0]), float(self.params[1]), int(self.params[2]), self.atom1.type, self.atom2.type, self.atom3.type, self.atom4.type) else: raise not_implemented_error('The given function {} is not implemented yet'.format(self.funct)) else: self.strmol = '{0:>6}{1:>6}{2:>6}{3:>6}\t;{4:>4}{5:>4}{6:>4}{7:>4}\n'.format(self.atnum1, self.atnum2, self.atnum3, self.atnum4, self.atom1.type, self.atom2.type, self.atom3.type, self.atom4.type) def general_dihedral(self): if self.funct == 1 or self.funct == 4 or self.funct == 9: self.strff = '{0:>6}{1:>6}{2:>6}{3:>6}{4:>6}{5:>9.3f}{6:>9.3f}{7:>9d}\n'.format('X', self.atom2.type, self.atom3.type, 'X', self.funct, float(self.params[0]), float(self.params[1]), int(self.params[2])) def __eq__(self, other): if self.atnum1 == other.atnum1 and self.atnum2 == other.atnum2 and (self.atnum3 == other.atnum3) and (self.atnum4 == other.atnum4): return True else: return False def append(self, other): """ Function that appends another dihedral to the current dihedral, most likely used scenario is when there is one dihedral that has multiple multiplicities Args: ---- other(dihedral): A dihedral object Return: ------ strmol, strff and params are extended by the other dihedral object """ if self.strmol != other.strmol and self.strff != other.strff and (self.params != other.params): self.strmol += other.strmol self.strff += other.strff self.params += other.params def compare(self, other): """ Function that returns True if all the atom types as well as all the parameters matches with each other """ if self.atom1.type == other.atom1.type and self.atom2.type == other.atom2.type and (self.atom3.type == other.atom3.type) and (self.atom4.type == self.atom4.type) and (self.funct == other.funct) and (self.params == other.params): return True elif self.atom1.type == other.atom4.type and self.atom2.type == other.atom3.type and (self.atom3.type == other.atom2.type) and (self.atom4.type == self.atom1.type) and (self.funct == other.funct) and (self.params == other.params): return True else: return False def __str__(self): return 'Dihedral between {}-{}-{}-{} with funct {} with params {}'.format(self.atom1.type, self.atom2.type, self.atom3.type, self.atom4.type, self.funct, self.params) def __repr__(self): return self.__str__()
def longest_palindrome(s: str) -> str: def expand(left: int, right: int) -> str: while left >= 0 and right < len(s) and s[left] == s[right]: left -= 1 right += 1 return s[left + 1:right] if len(s) < 2 or s == s[::-1]: return s result = '' for i in range(len(s)-1): result = max(result, expand(i, i+1), expand(i, i+2), key=len) return result def test_case(): case1 = 'babad' case2 = 'cbbd' result1 = longest_palindrome(case1) print(result1) result2 = longest_palindrome(case2) print(result2)
def longest_palindrome(s: str) -> str: def expand(left: int, right: int) -> str: while left >= 0 and right < len(s) and (s[left] == s[right]): left -= 1 right += 1 return s[left + 1:right] if len(s) < 2 or s == s[::-1]: return s result = '' for i in range(len(s) - 1): result = max(result, expand(i, i + 1), expand(i, i + 2), key=len) return result def test_case(): case1 = 'babad' case2 = 'cbbd' result1 = longest_palindrome(case1) print(result1) result2 = longest_palindrome(case2) print(result2)
#!/bin/python # Specified for different system partition = "engi" totres = 2616 # Do a batch for every 5 residues as 'residue I' # for 'residue J': loop it through the whole I+1 to the end of tetramer #for i in range(int(totres/5)): # beg = i*5 + 1 # end = (i+1)*5 # print(f"sbatch --export=batchid={i+1},batchbeg={beg},batchend={end} -p {partition} -J nx -t 12:00:00 run_batch_pl.sh") # Handle the remaining residues <= 5 #i += 1 #beg = i*5 + 1 #if beg < totres: # print(f"sbatch --export=batchid={i+1},batchbeg={beg},batchend={totres} -p {partition} -J nx -t 12:00:00 run_batch_pl.sh") # Print job submission codes with estimated time def calc_time(ires): """ argu:ires:i-th residue; return: hours, min needed for the job; """ base = 2.9 # unit:day itime = base*(1-ires/totres) hr = int(itime*24) # convert to hr:min:00 min = int((itime*24-hr)*60) return hr+2, min for i in range(totres): beg = i + 1 end = i + 1 hr, min = calc_time(i) print(f"sbatch --export=batchid={i+1},batchbeg={beg},batchend={end} -p {partition} -J nx -t {hr}:{min}:00 run_batch_pl.sh")
partition = 'engi' totres = 2616 def calc_time(ires): """ argu:ires:i-th residue; return: hours, min needed for the job; """ base = 2.9 itime = base * (1 - ires / totres) hr = int(itime * 24) min = int((itime * 24 - hr) * 60) return (hr + 2, min) for i in range(totres): beg = i + 1 end = i + 1 (hr, min) = calc_time(i) print(f'sbatch --export=batchid={i + 1},batchbeg={beg},batchend={end} -p {partition} -J nx -t {hr}:{min}:00 run_batch_pl.sh')
class Solution: def fourSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[List[int]] """ size = len(nums) if size < 4: return [] nums.sort() ret = [] nums_set = set() for i in range(size - 3): for j in range(i + 1, size - 2): k, l = j + 1, size - 1 while k < l: sum = nums[i] + nums[j] + nums[k] + nums[l] if sum > target: l -= 1 elif sum < target: k += 1 else: if [nums[i], nums[j], nums[k], nums[l]] not in ret: ret.append([nums[i], nums[j], nums[k], nums[l]]) k += 1 l -= 1 return ret
class Solution: def four_sum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[List[int]] """ size = len(nums) if size < 4: return [] nums.sort() ret = [] nums_set = set() for i in range(size - 3): for j in range(i + 1, size - 2): (k, l) = (j + 1, size - 1) while k < l: sum = nums[i] + nums[j] + nums[k] + nums[l] if sum > target: l -= 1 elif sum < target: k += 1 else: if [nums[i], nums[j], nums[k], nums[l]] not in ret: ret.append([nums[i], nums[j], nums[k], nums[l]]) k += 1 l -= 1 return ret
# # PySNMP MIB module ASCEND-MIBREDHM-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBREDHM-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:12: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) # configuration, = mibBuilder.importSymbols("ASCEND-MIB", "configuration") Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, ObjectIdentity, MibIdentifier, NotificationType, Integer32, TimeTicks, Gauge32, Counter64, Unsigned32, Counter32, iso, IpAddress, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "ObjectIdentity", "MibIdentifier", "NotificationType", "Integer32", "TimeTicks", "Gauge32", "Counter64", "Unsigned32", "Counter32", "iso", "IpAddress", "Bits") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") class DisplayString(OctetString): pass mibredHealthMonitoringProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 529, 23, 179)) mibredHealthMonitoringProfileTable = MibTable((1, 3, 6, 1, 4, 1, 529, 23, 179, 1), ) if mibBuilder.loadTexts: mibredHealthMonitoringProfileTable.setStatus('mandatory') mibredHealthMonitoringProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1), ).setIndexNames((0, "ASCEND-MIBREDHM-MIB", "redHealthMonitoringProfile-Index-o")) if mibBuilder.loadTexts: mibredHealthMonitoringProfileEntry.setStatus('mandatory') redHealthMonitoringProfile_Index_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 1), Integer32()).setLabel("redHealthMonitoringProfile-Index-o").setMaxAccess("readonly") if mibBuilder.loadTexts: redHealthMonitoringProfile_Index_o.setStatus('mandatory') redHealthMonitoringProfile_HmEnabled = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("redHealthMonitoringProfile-HmEnabled").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_HmEnabled.setStatus('mandatory') redHealthMonitoringProfile_MaxWarningPrimary = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 3), Integer32()).setLabel("redHealthMonitoringProfile-MaxWarningPrimary").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_MaxWarningPrimary.setStatus('mandatory') redHealthMonitoringProfile_MaxWarningSecondary = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 4), Integer32()).setLabel("redHealthMonitoringProfile-MaxWarningSecondary").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_MaxWarningSecondary.setStatus('mandatory') redHealthMonitoringProfile_MaxWarningPerMinutePrimary = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 5), Integer32()).setLabel("redHealthMonitoringProfile-MaxWarningPerMinutePrimary").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_MaxWarningPerMinutePrimary.setStatus('mandatory') redHealthMonitoringProfile_MaxWarningPerMinuteSecondary = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 6), Integer32()).setLabel("redHealthMonitoringProfile-MaxWarningPerMinuteSecondary").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_MaxWarningPerMinuteSecondary.setStatus('mandatory') redHealthMonitoringProfile_MemoryThresholdPrimary = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 7), Integer32()).setLabel("redHealthMonitoringProfile-MemoryThresholdPrimary").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryThresholdPrimary.setStatus('mandatory') redHealthMonitoringProfile_MemoryThresholdSecondary = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 8), Integer32()).setLabel("redHealthMonitoringProfile-MemoryThresholdSecondary").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryThresholdSecondary.setStatus('mandatory') redHealthMonitoringProfile_MemoryAlertThresholdPrimary = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 9), Integer32()).setLabel("redHealthMonitoringProfile-MemoryAlertThresholdPrimary").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryAlertThresholdPrimary.setStatus('mandatory') redHealthMonitoringProfile_MemoryAlertThresholdSecondary = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 10), Integer32()).setLabel("redHealthMonitoringProfile-MemoryAlertThresholdSecondary").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryAlertThresholdSecondary.setStatus('mandatory') redHealthMonitoringProfile_MemoryAlertTimeoutPrimary = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 11), Integer32()).setLabel("redHealthMonitoringProfile-MemoryAlertTimeoutPrimary").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryAlertTimeoutPrimary.setStatus('mandatory') redHealthMonitoringProfile_MemoryAlertTimeoutSecondary = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 12), Integer32()).setLabel("redHealthMonitoringProfile-MemoryAlertTimeoutSecondary").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryAlertTimeoutSecondary.setStatus('mandatory') redHealthMonitoringProfile_ResetStuckPrimaryTimeout = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 13), Integer32()).setLabel("redHealthMonitoringProfile-ResetStuckPrimaryTimeout").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_ResetStuckPrimaryTimeout.setStatus('mandatory') redHealthMonitoringProfile_Action_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noAction", 1), ("createProfile", 2), ("deleteProfile", 3)))).setLabel("redHealthMonitoringProfile-Action-o").setMaxAccess("readwrite") if mibBuilder.loadTexts: redHealthMonitoringProfile_Action_o.setStatus('mandatory') mibBuilder.exportSymbols("ASCEND-MIBREDHM-MIB", redHealthMonitoringProfile_MaxWarningPrimary=redHealthMonitoringProfile_MaxWarningPrimary, redHealthMonitoringProfile_MemoryAlertTimeoutPrimary=redHealthMonitoringProfile_MemoryAlertTimeoutPrimary, DisplayString=DisplayString, redHealthMonitoringProfile_MemoryAlertTimeoutSecondary=redHealthMonitoringProfile_MemoryAlertTimeoutSecondary, mibredHealthMonitoringProfile=mibredHealthMonitoringProfile, redHealthMonitoringProfile_MemoryAlertThresholdSecondary=redHealthMonitoringProfile_MemoryAlertThresholdSecondary, redHealthMonitoringProfile_MaxWarningPerMinutePrimary=redHealthMonitoringProfile_MaxWarningPerMinutePrimary, redHealthMonitoringProfile_MaxWarningPerMinuteSecondary=redHealthMonitoringProfile_MaxWarningPerMinuteSecondary, redHealthMonitoringProfile_MaxWarningSecondary=redHealthMonitoringProfile_MaxWarningSecondary, redHealthMonitoringProfile_MemoryThresholdSecondary=redHealthMonitoringProfile_MemoryThresholdSecondary, mibredHealthMonitoringProfileTable=mibredHealthMonitoringProfileTable, redHealthMonitoringProfile_HmEnabled=redHealthMonitoringProfile_HmEnabled, redHealthMonitoringProfile_MemoryAlertThresholdPrimary=redHealthMonitoringProfile_MemoryAlertThresholdPrimary, redHealthMonitoringProfile_Action_o=redHealthMonitoringProfile_Action_o, mibredHealthMonitoringProfileEntry=mibredHealthMonitoringProfileEntry, redHealthMonitoringProfile_Index_o=redHealthMonitoringProfile_Index_o, redHealthMonitoringProfile_ResetStuckPrimaryTimeout=redHealthMonitoringProfile_ResetStuckPrimaryTimeout, redHealthMonitoringProfile_MemoryThresholdPrimary=redHealthMonitoringProfile_MemoryThresholdPrimary)
(configuration,) = mibBuilder.importSymbols('ASCEND-MIB', 'configuration') (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, single_value_constraint, constraints_union, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'ConstraintsIntersection') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (mib_scalar, mib_table, mib_table_row, mib_table_column, module_identity, object_identity, mib_identifier, notification_type, integer32, time_ticks, gauge32, counter64, unsigned32, counter32, iso, ip_address, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ModuleIdentity', 'ObjectIdentity', 'MibIdentifier', 'NotificationType', 'Integer32', 'TimeTicks', 'Gauge32', 'Counter64', 'Unsigned32', 'Counter32', 'iso', 'IpAddress', 'Bits') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') class Displaystring(OctetString): pass mibred_health_monitoring_profile = mib_identifier((1, 3, 6, 1, 4, 1, 529, 23, 179)) mibred_health_monitoring_profile_table = mib_table((1, 3, 6, 1, 4, 1, 529, 23, 179, 1)) if mibBuilder.loadTexts: mibredHealthMonitoringProfileTable.setStatus('mandatory') mibred_health_monitoring_profile_entry = mib_table_row((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1)).setIndexNames((0, 'ASCEND-MIBREDHM-MIB', 'redHealthMonitoringProfile-Index-o')) if mibBuilder.loadTexts: mibredHealthMonitoringProfileEntry.setStatus('mandatory') red_health_monitoring_profile__index_o = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 1), integer32()).setLabel('redHealthMonitoringProfile-Index-o').setMaxAccess('readonly') if mibBuilder.loadTexts: redHealthMonitoringProfile_Index_o.setStatus('mandatory') red_health_monitoring_profile__hm_enabled = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setLabel('redHealthMonitoringProfile-HmEnabled').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_HmEnabled.setStatus('mandatory') red_health_monitoring_profile__max_warning_primary = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 3), integer32()).setLabel('redHealthMonitoringProfile-MaxWarningPrimary').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_MaxWarningPrimary.setStatus('mandatory') red_health_monitoring_profile__max_warning_secondary = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 4), integer32()).setLabel('redHealthMonitoringProfile-MaxWarningSecondary').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_MaxWarningSecondary.setStatus('mandatory') red_health_monitoring_profile__max_warning_per_minute_primary = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 5), integer32()).setLabel('redHealthMonitoringProfile-MaxWarningPerMinutePrimary').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_MaxWarningPerMinutePrimary.setStatus('mandatory') red_health_monitoring_profile__max_warning_per_minute_secondary = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 6), integer32()).setLabel('redHealthMonitoringProfile-MaxWarningPerMinuteSecondary').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_MaxWarningPerMinuteSecondary.setStatus('mandatory') red_health_monitoring_profile__memory_threshold_primary = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 7), integer32()).setLabel('redHealthMonitoringProfile-MemoryThresholdPrimary').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryThresholdPrimary.setStatus('mandatory') red_health_monitoring_profile__memory_threshold_secondary = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 8), integer32()).setLabel('redHealthMonitoringProfile-MemoryThresholdSecondary').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryThresholdSecondary.setStatus('mandatory') red_health_monitoring_profile__memory_alert_threshold_primary = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 9), integer32()).setLabel('redHealthMonitoringProfile-MemoryAlertThresholdPrimary').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryAlertThresholdPrimary.setStatus('mandatory') red_health_monitoring_profile__memory_alert_threshold_secondary = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 10), integer32()).setLabel('redHealthMonitoringProfile-MemoryAlertThresholdSecondary').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryAlertThresholdSecondary.setStatus('mandatory') red_health_monitoring_profile__memory_alert_timeout_primary = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 11), integer32()).setLabel('redHealthMonitoringProfile-MemoryAlertTimeoutPrimary').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryAlertTimeoutPrimary.setStatus('mandatory') red_health_monitoring_profile__memory_alert_timeout_secondary = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 12), integer32()).setLabel('redHealthMonitoringProfile-MemoryAlertTimeoutSecondary').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_MemoryAlertTimeoutSecondary.setStatus('mandatory') red_health_monitoring_profile__reset_stuck_primary_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 13), integer32()).setLabel('redHealthMonitoringProfile-ResetStuckPrimaryTimeout').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_ResetStuckPrimaryTimeout.setStatus('mandatory') red_health_monitoring_profile__action_o = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 179, 1, 1, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('noAction', 1), ('createProfile', 2), ('deleteProfile', 3)))).setLabel('redHealthMonitoringProfile-Action-o').setMaxAccess('readwrite') if mibBuilder.loadTexts: redHealthMonitoringProfile_Action_o.setStatus('mandatory') mibBuilder.exportSymbols('ASCEND-MIBREDHM-MIB', redHealthMonitoringProfile_MaxWarningPrimary=redHealthMonitoringProfile_MaxWarningPrimary, redHealthMonitoringProfile_MemoryAlertTimeoutPrimary=redHealthMonitoringProfile_MemoryAlertTimeoutPrimary, DisplayString=DisplayString, redHealthMonitoringProfile_MemoryAlertTimeoutSecondary=redHealthMonitoringProfile_MemoryAlertTimeoutSecondary, mibredHealthMonitoringProfile=mibredHealthMonitoringProfile, redHealthMonitoringProfile_MemoryAlertThresholdSecondary=redHealthMonitoringProfile_MemoryAlertThresholdSecondary, redHealthMonitoringProfile_MaxWarningPerMinutePrimary=redHealthMonitoringProfile_MaxWarningPerMinutePrimary, redHealthMonitoringProfile_MaxWarningPerMinuteSecondary=redHealthMonitoringProfile_MaxWarningPerMinuteSecondary, redHealthMonitoringProfile_MaxWarningSecondary=redHealthMonitoringProfile_MaxWarningSecondary, redHealthMonitoringProfile_MemoryThresholdSecondary=redHealthMonitoringProfile_MemoryThresholdSecondary, mibredHealthMonitoringProfileTable=mibredHealthMonitoringProfileTable, redHealthMonitoringProfile_HmEnabled=redHealthMonitoringProfile_HmEnabled, redHealthMonitoringProfile_MemoryAlertThresholdPrimary=redHealthMonitoringProfile_MemoryAlertThresholdPrimary, redHealthMonitoringProfile_Action_o=redHealthMonitoringProfile_Action_o, mibredHealthMonitoringProfileEntry=mibredHealthMonitoringProfileEntry, redHealthMonitoringProfile_Index_o=redHealthMonitoringProfile_Index_o, redHealthMonitoringProfile_ResetStuckPrimaryTimeout=redHealthMonitoringProfile_ResetStuckPrimaryTimeout, redHealthMonitoringProfile_MemoryThresholdPrimary=redHealthMonitoringProfile_MemoryThresholdPrimary)
"""Role testing files using testinfra.""" def test_service(host): """assert service enabled and started""" squid = host.service('squid') assert squid.is_enabled assert squid.is_running def test_port(host): """assert port is listening""" assert host.socket('tcp://0.0.0.0:3128').is_listening
"""Role testing files using testinfra.""" def test_service(host): """assert service enabled and started""" squid = host.service('squid') assert squid.is_enabled assert squid.is_running def test_port(host): """assert port is listening""" assert host.socket('tcp://0.0.0.0:3128').is_listening
def get_id_from_urn(urn): """ Return the ID of a given Linkedin URN. Example: urn:li:fs_miniProfile:<id> """ return urn.split(":")[3]
def get_id_from_urn(urn): """ Return the ID of a given Linkedin URN. Example: urn:li:fs_miniProfile:<id> """ return urn.split(':')[3]
work = True while(work): t = 2 t = t+1 work = False print(t)
work = True while work: t = 2 t = t + 1 work = False print(t)
class Solution(object): def countNumbersWithUniqueDigits(self, n): return self.fn(n) def fn(self,n): if n==0: return 1 if n==1: return 10 if n>10: return 0 f = 9 i = 1 while i<n and i<=10: f *= 10-i i+=1 return f+self.fn(n-1) s = Solution() # print(s.isMatch('aaabc', 'a*bc')) print('3',s.countNumbersWithUniqueDigits(0)) print('3',s.countNumbersWithUniqueDigits(1)) print('3',s.countNumbersWithUniqueDigits(2)) print('3',s.countNumbersWithUniqueDigits(3)) print('4',s.countNumbersWithUniqueDigits(4)) print('5',s.countNumbersWithUniqueDigits(5))
class Solution(object): def count_numbers_with_unique_digits(self, n): return self.fn(n) def fn(self, n): if n == 0: return 1 if n == 1: return 10 if n > 10: return 0 f = 9 i = 1 while i < n and i <= 10: f *= 10 - i i += 1 return f + self.fn(n - 1) s = solution() print('3', s.countNumbersWithUniqueDigits(0)) print('3', s.countNumbersWithUniqueDigits(1)) print('3', s.countNumbersWithUniqueDigits(2)) print('3', s.countNumbersWithUniqueDigits(3)) print('4', s.countNumbersWithUniqueDigits(4)) print('5', s.countNumbersWithUniqueDigits(5))
def file_to_id(outfile: str) -> str: fn = outfile.split('.')[0] assert(fn.startswith('blk')) return fn[3:] def id_int_to_outfile(fid_int: int, fid_len: int) -> str: fid_s = str(fid_int) prefix = (fid_len - len(fid_s)) * '0' return f'blk{prefix+fid_s}.out' def id_int_to_chunk_id(cid_int: int) -> str: cid_s = str(cid_int) return cid_s
def file_to_id(outfile: str) -> str: fn = outfile.split('.')[0] assert fn.startswith('blk') return fn[3:] def id_int_to_outfile(fid_int: int, fid_len: int) -> str: fid_s = str(fid_int) prefix = (fid_len - len(fid_s)) * '0' return f'blk{prefix + fid_s}.out' def id_int_to_chunk_id(cid_int: int) -> str: cid_s = str(cid_int) return cid_s
# problem statement: Given an array, find the total number of inversions of it. If (i < j) and (A[i] > A[j]), then pair (i, j) is called an inversion of an array A. We need to count all such pairs in the array. # Function to find inversion count of a given list def findInversionCount(A): inversionCount = 0 for i in range(len(A) - 1): for j in range(i + 1, len(A)): if A[i] > A[j]: inversionCount = inversionCount + 1 return inversionCount if __name__ == '__main__': A = [1, 9, 6, 4, 5] print("Inversion count is", findInversionCount(A))
def find_inversion_count(A): inversion_count = 0 for i in range(len(A) - 1): for j in range(i + 1, len(A)): if A[i] > A[j]: inversion_count = inversionCount + 1 return inversionCount if __name__ == '__main__': a = [1, 9, 6, 4, 5] print('Inversion count is', find_inversion_count(A))
# # PySNMP MIB module BLUECOAT-SG-PROXY-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BLUECOAT-SG-PROXY-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:22:43 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion") blueCoatMgmt, = mibBuilder.importSymbols("BLUECOAT-MIB", "blueCoatMgmt") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Bits, ModuleIdentity, TimeTicks, Unsigned32, ObjectIdentity, IpAddress, Integer32, Counter64, Gauge32, NotificationType, Counter32, iso = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Bits", "ModuleIdentity", "TimeTicks", "Unsigned32", "ObjectIdentity", "IpAddress", "Integer32", "Counter64", "Gauge32", "NotificationType", "Counter32", "iso") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") bluecoatSGProxyMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 3417, 2, 11)) bluecoatSGProxyMIB.setRevisions(('2011-11-01 03:00', '2007-11-05 03:00', '2007-08-28 03:00',)) if mibBuilder.loadTexts: bluecoatSGProxyMIB.setLastUpdated('201111010300Z') if mibBuilder.loadTexts: bluecoatSGProxyMIB.setOrganization('Blue Coat Systems, Inc.') sgProxyConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 1)) sgProxySystem = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2)) sgProxyHttp = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3)) sgProxyAdmin = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 1, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyAdmin.setStatus('current') sgProxySoftware = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxySoftware.setStatus('current') sgProxyVersion = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyVersion.setStatus('current') sgProxySerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxySerialNumber.setStatus('current') sgProxyCpu = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1)) sgProxyCache = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 2)) sgProxyMemory = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 3)) sgProxyCpuCoreTable = MibTable((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4), ) if mibBuilder.loadTexts: sgProxyCpuCoreTable.setStatus('current') sgProxyCpuUpTime = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 1), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuUpTime.setStatus('deprecated') sgProxyCpuBusyTime = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 2), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuBusyTime.setStatus('deprecated') sgProxyCpuIdleTime = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 3), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuIdleTime.setStatus('deprecated') sgProxyCpuUpTimeSinceLastAccess = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 4), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuUpTimeSinceLastAccess.setStatus('deprecated') sgProxyCpuBusyTimeSinceLastAccess = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 5), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuBusyTimeSinceLastAccess.setStatus('deprecated') sgProxyCpuIdleTimeSinceLastAccess = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 6), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuIdleTimeSinceLastAccess.setStatus('deprecated') sgProxyCpuBusyPerCent = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 7), Gauge32()).setUnits('Percentage').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuBusyPerCent.setStatus('deprecated') sgProxyCpuIdlePerCent = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 8), Gauge32()).setUnits('Percentage').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuIdlePerCent.setStatus('deprecated') sgProxyStorage = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 2, 1), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyStorage.setStatus('current') sgProxyNumObjects = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 2, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyNumObjects.setStatus('current') sgProxyMemAvailable = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 3, 1), Counter64()).setUnits('Bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyMemAvailable.setStatus('current') sgProxyMemCacheUsage = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 3, 2), Counter64()).setUnits('Bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyMemCacheUsage.setStatus('current') sgProxyMemSysUsage = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 3, 3), Counter64()).setUnits('Bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyMemSysUsage.setStatus('current') sgProxyMemoryPressure = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 3, 4), Gauge32()).setUnits('Percentage').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyMemoryPressure.setStatus('current') sgProxyCpuCoreTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1), ).setIndexNames((0, "BLUECOAT-SG-PROXY-MIB", "sgProxyCpuCoreIndex")) if mibBuilder.loadTexts: sgProxyCpuCoreTableEntry.setStatus('current') sgProxyCpuCoreIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))) if mibBuilder.loadTexts: sgProxyCpuCoreIndex.setStatus('current') sgProxyCpuCoreUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 2), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuCoreUpTime.setStatus('current') sgProxyCpuCoreBusyTime = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 3), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuCoreBusyTime.setStatus('current') sgProxyCpuCoreIdleTime = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 4), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuCoreIdleTime.setStatus('current') sgProxyCpuCoreUpTimeSinceLastAccess = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 5), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuCoreUpTimeSinceLastAccess.setStatus('current') sgProxyCpuCoreBusyTimeSinceLastAccess = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 6), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuCoreBusyTimeSinceLastAccess.setStatus('current') sgProxyCpuCoreIdleTimeSinceLastAccess = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 7), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuCoreIdleTimeSinceLastAccess.setStatus('current') sgProxyCpuCoreBusyPerCent = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 8), Gauge32()).setUnits('Percentage').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuCoreBusyPerCent.setStatus('current') sgProxyCpuCoreIdlePerCent = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 9), Gauge32()).setUnits('Percentage').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyCpuCoreIdlePerCent.setStatus('current') sgProxyHttpPerf = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1)) sgProxyHttpResponse = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2)) sgProxyHttpMedian = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3)) sgProxyHttpClient = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1)) sgProxyHttpServer = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 2)) sgProxyHttpConnections = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3)) sgProxyHttpClientRequests = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 1), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientRequests.setStatus('current') sgProxyHttpClientHits = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientHits.setStatus('current') sgProxyHttpClientPartialHits = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientPartialHits.setStatus('current') sgProxyHttpClientMisses = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientMisses.setStatus('current') sgProxyHttpClientErrors = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 5), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientErrors.setStatus('current') sgProxyHttpClientRequestRate = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 6), Gauge32()).setUnits('Requests Per Second').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientRequestRate.setStatus('current') sgProxyHttpClientHitRate = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 7), Gauge32()).setUnits('Percentage').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientHitRate.setStatus('current') sgProxyHttpClientByteHitRate = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 8), Gauge32()).setUnits('Percentage').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientByteHitRate.setStatus('current') sgProxyHttpClientInBytes = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 9), Counter64()).setUnits('Bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientInBytes.setStatus('current') sgProxyHttpClientOutBytes = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 10), Counter64()).setUnits('Bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientOutBytes.setStatus('current') sgProxyHttpServerRequests = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 2, 1), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpServerRequests.setStatus('current') sgProxyHttpServerErrors = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 2, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpServerErrors.setStatus('current') sgProxyHttpServerInBytes = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 2, 3), Counter64()).setUnits('Bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpServerInBytes.setStatus('current') sgProxyHttpServerOutBytes = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 2, 4), Counter64()).setUnits('Bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpServerOutBytes.setStatus('current') sgProxyHttpClientConnections = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 1), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientConnections.setStatus('current') sgProxyHttpClientConnectionsActive = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientConnectionsActive.setStatus('current') sgProxyHttpClientConnectionsIdle = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpClientConnectionsIdle.setStatus('current') sgProxyHttpServerConnections = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpServerConnections.setStatus('current') sgProxyHttpServerConnectionsActive = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 5), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpServerConnectionsActive.setStatus('current') sgProxyHttpServerConnectionsIdle = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 6), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpServerConnectionsIdle.setStatus('current') sgProxyHttpResponseTime = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1)) sgProxyHttpResponseFirstByte = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 2)) sgProxyHttpResponseByteRate = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 3)) sgProxyHttpResponseSize = MibIdentifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 4)) sgProxyHttpServiceTimeAll = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 1), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpServiceTimeAll.setStatus('current') sgProxyHttpServiceTimeHit = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 2), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpServiceTimeHit.setStatus('current') sgProxyHttpServiceTimePartialHit = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 3), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpServiceTimePartialHit.setStatus('current') sgProxyHttpServiceTimeMiss = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 4), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpServiceTimeMiss.setStatus('current') sgProxyHttpTotalFetchTimeAll = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 5), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpTotalFetchTimeAll.setStatus('current') sgProxyHttpTotalFetchTimeHit = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 6), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpTotalFetchTimeHit.setStatus('current') sgProxyHttpTotalFetchTimePartialHit = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 7), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpTotalFetchTimePartialHit.setStatus('current') sgProxyHttpTotalFetchTimeMiss = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 8), Counter64()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpTotalFetchTimeMiss.setStatus('current') sgProxyHttpFirstByteAll = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 2, 1), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpFirstByteAll.setStatus('current') sgProxyHttpFirstByteHit = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 2, 2), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpFirstByteHit.setStatus('current') sgProxyHttpFirstBytePartialHit = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 2, 3), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpFirstBytePartialHit.setStatus('current') sgProxyHttpFirstByteMiss = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 2, 4), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpFirstByteMiss.setStatus('current') sgProxyHttpByteRateAll = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 3, 1), Gauge32()).setUnits('Bytes Per Second').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpByteRateAll.setStatus('current') sgProxyHttpByteRateHit = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 3, 2), Gauge32()).setUnits('Bytes Per Second').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpByteRateHit.setStatus('current') sgProxyHttpByteRatePartialHit = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 3, 3), Gauge32()).setUnits('Bytes Per Second').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpByteRatePartialHit.setStatus('current') sgProxyHttpByteRateMiss = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 3, 4), Gauge32()).setUnits('Bytes Per Second').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpByteRateMiss.setStatus('current') sgProxyHttpResponseSizeAll = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 4, 1), Gauge32()).setUnits('Bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpResponseSizeAll.setStatus('current') sgProxyHttpResponseSizeHit = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 4, 2), Gauge32()).setUnits('Bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpResponseSizeHit.setStatus('current') sgProxyHttpResponseSizePartialHit = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 4, 3), Gauge32()).setUnits('Bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpResponseSizePartialHit.setStatus('current') sgProxyHttpResponseSizeMiss = MibScalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 4, 4), Gauge32()).setUnits('Bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpResponseSizeMiss.setStatus('current') sgProxyHttpMedianServiceTable = MibTable((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1), ) if mibBuilder.loadTexts: sgProxyHttpMedianServiceTable.setStatus('current') sgProxyHttpMedianServiceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1), ).setIndexNames((0, "BLUECOAT-SG-PROXY-MIB", "sgProxyHttpMedianServiceTime")) if mibBuilder.loadTexts: sgProxyHttpMedianServiceEntry.setStatus('current') sgProxyHttpMedianServiceTime = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 5, 60))).clone(namedValues=NamedValues(("one", 1), ("five", 5), ("sixty", 60)))).setUnits('Minutes') if mibBuilder.loadTexts: sgProxyHttpMedianServiceTime.setStatus('current') sgProxyHttpMedianServiceTimeAll = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 2), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpMedianServiceTimeAll.setStatus('current') sgProxyHttpMedianServiceTimeHit = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 3), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpMedianServiceTimeHit.setStatus('current') sgProxyHttpMedianServiceTimePartialHit = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 4), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpMedianServiceTimePartialHit.setStatus('current') sgProxyHttpMedianServiceTimeMiss = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 5), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyHttpMedianServiceTimeMiss.setStatus('current') sgProxyDnsMedianServiceTime = MibTableColumn((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 6), Gauge32()).setUnits('Milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: sgProxyDnsMedianServiceTime.setStatus('current') mibBuilder.exportSymbols("BLUECOAT-SG-PROXY-MIB", sgProxyHttpResponseSize=sgProxyHttpResponseSize, sgProxyHttpClientMisses=sgProxyHttpClientMisses, sgProxyHttpFirstByteHit=sgProxyHttpFirstByteHit, sgProxyHttpMedianServiceTime=sgProxyHttpMedianServiceTime, sgProxyCpuCoreBusyTime=sgProxyCpuCoreBusyTime, sgProxyHttpClientErrors=sgProxyHttpClientErrors, sgProxyDnsMedianServiceTime=sgProxyDnsMedianServiceTime, sgProxyHttpClientConnectionsActive=sgProxyHttpClientConnectionsActive, sgProxyHttpByteRateHit=sgProxyHttpByteRateHit, sgProxyHttpMedianServiceTimePartialHit=sgProxyHttpMedianServiceTimePartialHit, sgProxyCpuBusyPerCent=sgProxyCpuBusyPerCent, sgProxyHttpClient=sgProxyHttpClient, sgProxyHttpServiceTimeMiss=sgProxyHttpServiceTimeMiss, sgProxyHttpServiceTimePartialHit=sgProxyHttpServiceTimePartialHit, sgProxyHttpServiceTimeHit=sgProxyHttpServiceTimeHit, sgProxyCpuCoreBusyTimeSinceLastAccess=sgProxyCpuCoreBusyTimeSinceLastAccess, sgProxyCpuCoreTableEntry=sgProxyCpuCoreTableEntry, sgProxyHttpResponseTime=sgProxyHttpResponseTime, sgProxyHttpResponseFirstByte=sgProxyHttpResponseFirstByte, sgProxyHttpResponseSizePartialHit=sgProxyHttpResponseSizePartialHit, sgProxyHttpFirstByteMiss=sgProxyHttpFirstByteMiss, sgProxyHttpClientHitRate=sgProxyHttpClientHitRate, sgProxyHttpClientByteHitRate=sgProxyHttpClientByteHitRate, sgProxyHttpConnections=sgProxyHttpConnections, sgProxyHttpFirstBytePartialHit=sgProxyHttpFirstBytePartialHit, sgProxyStorage=sgProxyStorage, sgProxyMemSysUsage=sgProxyMemSysUsage, sgProxyMemAvailable=sgProxyMemAvailable, sgProxyHttpMedianServiceTimeHit=sgProxyHttpMedianServiceTimeHit, sgProxyMemory=sgProxyMemory, sgProxyCpuCoreIndex=sgProxyCpuCoreIndex, sgProxyHttpServer=sgProxyHttpServer, sgProxyHttpMedianServiceTimeAll=sgProxyHttpMedianServiceTimeAll, sgProxyCpuUpTimeSinceLastAccess=sgProxyCpuUpTimeSinceLastAccess, sgProxyCpuCoreIdlePerCent=sgProxyCpuCoreIdlePerCent, sgProxyHttpClientOutBytes=sgProxyHttpClientOutBytes, sgProxyHttpClientRequests=sgProxyHttpClientRequests, sgProxyHttpServiceTimeAll=sgProxyHttpServiceTimeAll, sgProxyHttpResponse=sgProxyHttpResponse, sgProxyHttpFirstByteAll=sgProxyHttpFirstByteAll, sgProxyHttpServerOutBytes=sgProxyHttpServerOutBytes, sgProxyHttpTotalFetchTimeAll=sgProxyHttpTotalFetchTimeAll, sgProxyHttpClientConnections=sgProxyHttpClientConnections, sgProxyCache=sgProxyCache, sgProxyConfig=sgProxyConfig, sgProxyHttpMedian=sgProxyHttpMedian, sgProxyCpuCoreUpTimeSinceLastAccess=sgProxyCpuCoreUpTimeSinceLastAccess, sgProxyHttpByteRateMiss=sgProxyHttpByteRateMiss, sgProxyHttpServerConnections=sgProxyHttpServerConnections, sgProxyAdmin=sgProxyAdmin, sgProxyHttpClientRequestRate=sgProxyHttpClientRequestRate, sgProxyCpuIdlePerCent=sgProxyCpuIdlePerCent, sgProxyHttpClientPartialHits=sgProxyHttpClientPartialHits, PYSNMP_MODULE_ID=bluecoatSGProxyMIB, sgProxyHttpClientHits=sgProxyHttpClientHits, sgProxyCpuCoreIdleTime=sgProxyCpuCoreIdleTime, sgProxyHttpServerRequests=sgProxyHttpServerRequests, sgProxyCpu=sgProxyCpu, sgProxyHttpByteRateAll=sgProxyHttpByteRateAll, sgProxyCpuIdleTime=sgProxyCpuIdleTime, sgProxyMemCacheUsage=sgProxyMemCacheUsage, sgProxyHttpServerErrors=sgProxyHttpServerErrors, sgProxyHttpTotalFetchTimeMiss=sgProxyHttpTotalFetchTimeMiss, sgProxyHttpServerConnectionsIdle=sgProxyHttpServerConnectionsIdle, sgProxyHttpMedianServiceTimeMiss=sgProxyHttpMedianServiceTimeMiss, sgProxyCpuBusyTimeSinceLastAccess=sgProxyCpuBusyTimeSinceLastAccess, sgProxySerialNumber=sgProxySerialNumber, sgProxyHttp=sgProxyHttp, sgProxyHttpByteRatePartialHit=sgProxyHttpByteRatePartialHit, sgProxyCpuCoreBusyPerCent=sgProxyCpuCoreBusyPerCent, sgProxyCpuCoreIdleTimeSinceLastAccess=sgProxyCpuCoreIdleTimeSinceLastAccess, sgProxyHttpResponseSizeAll=sgProxyHttpResponseSizeAll, sgProxyHttpClientConnectionsIdle=sgProxyHttpClientConnectionsIdle, sgProxyHttpResponseSizeMiss=sgProxyHttpResponseSizeMiss, sgProxyCpuUpTime=sgProxyCpuUpTime, sgProxyCpuCoreUpTime=sgProxyCpuCoreUpTime, sgProxyHttpMedianServiceTable=sgProxyHttpMedianServiceTable, sgProxyHttpServerInBytes=sgProxyHttpServerInBytes, sgProxyHttpClientInBytes=sgProxyHttpClientInBytes, sgProxyCpuBusyTime=sgProxyCpuBusyTime, sgProxyHttpResponseSizeHit=sgProxyHttpResponseSizeHit, sgProxySoftware=sgProxySoftware, sgProxyHttpPerf=sgProxyHttpPerf, sgProxyHttpResponseByteRate=sgProxyHttpResponseByteRate, bluecoatSGProxyMIB=bluecoatSGProxyMIB, sgProxyCpuCoreTable=sgProxyCpuCoreTable, sgProxyHttpServerConnectionsActive=sgProxyHttpServerConnectionsActive, sgProxySystem=sgProxySystem, sgProxyMemoryPressure=sgProxyMemoryPressure, sgProxyCpuIdleTimeSinceLastAccess=sgProxyCpuIdleTimeSinceLastAccess, sgProxyHttpMedianServiceEntry=sgProxyHttpMedianServiceEntry, sgProxyVersion=sgProxyVersion, sgProxyNumObjects=sgProxyNumObjects, sgProxyHttpTotalFetchTimePartialHit=sgProxyHttpTotalFetchTimePartialHit, sgProxyHttpTotalFetchTimeHit=sgProxyHttpTotalFetchTimeHit)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_intersection, single_value_constraint, value_range_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion') (blue_coat_mgmt,) = mibBuilder.importSymbols('BLUECOAT-MIB', 'blueCoatMgmt') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (mib_scalar, mib_table, mib_table_row, mib_table_column, mib_identifier, bits, module_identity, time_ticks, unsigned32, object_identity, ip_address, integer32, counter64, gauge32, notification_type, counter32, iso) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'MibIdentifier', 'Bits', 'ModuleIdentity', 'TimeTicks', 'Unsigned32', 'ObjectIdentity', 'IpAddress', 'Integer32', 'Counter64', 'Gauge32', 'NotificationType', 'Counter32', 'iso') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') bluecoat_sg_proxy_mib = module_identity((1, 3, 6, 1, 4, 1, 3417, 2, 11)) bluecoatSGProxyMIB.setRevisions(('2011-11-01 03:00', '2007-11-05 03:00', '2007-08-28 03:00')) if mibBuilder.loadTexts: bluecoatSGProxyMIB.setLastUpdated('201111010300Z') if mibBuilder.loadTexts: bluecoatSGProxyMIB.setOrganization('Blue Coat Systems, Inc.') sg_proxy_config = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 1)) sg_proxy_system = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2)) sg_proxy_http = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3)) sg_proxy_admin = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 1, 1), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyAdmin.setStatus('current') sg_proxy_software = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxySoftware.setStatus('current') sg_proxy_version = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 1, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyVersion.setStatus('current') sg_proxy_serial_number = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 1, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxySerialNumber.setStatus('current') sg_proxy_cpu = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1)) sg_proxy_cache = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 2)) sg_proxy_memory = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 3)) sg_proxy_cpu_core_table = mib_table((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4)) if mibBuilder.loadTexts: sgProxyCpuCoreTable.setStatus('current') sg_proxy_cpu_up_time = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 1), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuUpTime.setStatus('deprecated') sg_proxy_cpu_busy_time = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 2), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuBusyTime.setStatus('deprecated') sg_proxy_cpu_idle_time = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 3), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuIdleTime.setStatus('deprecated') sg_proxy_cpu_up_time_since_last_access = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 4), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuUpTimeSinceLastAccess.setStatus('deprecated') sg_proxy_cpu_busy_time_since_last_access = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 5), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuBusyTimeSinceLastAccess.setStatus('deprecated') sg_proxy_cpu_idle_time_since_last_access = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 6), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuIdleTimeSinceLastAccess.setStatus('deprecated') sg_proxy_cpu_busy_per_cent = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 7), gauge32()).setUnits('Percentage').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuBusyPerCent.setStatus('deprecated') sg_proxy_cpu_idle_per_cent = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 1, 8), gauge32()).setUnits('Percentage').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuIdlePerCent.setStatus('deprecated') sg_proxy_storage = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 2, 1), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyStorage.setStatus('current') sg_proxy_num_objects = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 2, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyNumObjects.setStatus('current') sg_proxy_mem_available = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 3, 1), counter64()).setUnits('Bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyMemAvailable.setStatus('current') sg_proxy_mem_cache_usage = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 3, 2), counter64()).setUnits('Bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyMemCacheUsage.setStatus('current') sg_proxy_mem_sys_usage = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 3, 3), counter64()).setUnits('Bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyMemSysUsage.setStatus('current') sg_proxy_memory_pressure = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 3, 4), gauge32()).setUnits('Percentage').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyMemoryPressure.setStatus('current') sg_proxy_cpu_core_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1)).setIndexNames((0, 'BLUECOAT-SG-PROXY-MIB', 'sgProxyCpuCoreIndex')) if mibBuilder.loadTexts: sgProxyCpuCoreTableEntry.setStatus('current') sg_proxy_cpu_core_index = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 32))) if mibBuilder.loadTexts: sgProxyCpuCoreIndex.setStatus('current') sg_proxy_cpu_core_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 2), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuCoreUpTime.setStatus('current') sg_proxy_cpu_core_busy_time = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 3), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuCoreBusyTime.setStatus('current') sg_proxy_cpu_core_idle_time = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 4), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuCoreIdleTime.setStatus('current') sg_proxy_cpu_core_up_time_since_last_access = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 5), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuCoreUpTimeSinceLastAccess.setStatus('current') sg_proxy_cpu_core_busy_time_since_last_access = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 6), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuCoreBusyTimeSinceLastAccess.setStatus('current') sg_proxy_cpu_core_idle_time_since_last_access = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 7), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuCoreIdleTimeSinceLastAccess.setStatus('current') sg_proxy_cpu_core_busy_per_cent = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 8), gauge32()).setUnits('Percentage').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuCoreBusyPerCent.setStatus('current') sg_proxy_cpu_core_idle_per_cent = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 2, 4, 1, 9), gauge32()).setUnits('Percentage').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyCpuCoreIdlePerCent.setStatus('current') sg_proxy_http_perf = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1)) sg_proxy_http_response = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2)) sg_proxy_http_median = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3)) sg_proxy_http_client = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1)) sg_proxy_http_server = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 2)) sg_proxy_http_connections = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3)) sg_proxy_http_client_requests = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 1), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientRequests.setStatus('current') sg_proxy_http_client_hits = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 2), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientHits.setStatus('current') sg_proxy_http_client_partial_hits = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 3), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientPartialHits.setStatus('current') sg_proxy_http_client_misses = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 4), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientMisses.setStatus('current') sg_proxy_http_client_errors = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 5), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientErrors.setStatus('current') sg_proxy_http_client_request_rate = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 6), gauge32()).setUnits('Requests Per Second').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientRequestRate.setStatus('current') sg_proxy_http_client_hit_rate = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 7), gauge32()).setUnits('Percentage').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientHitRate.setStatus('current') sg_proxy_http_client_byte_hit_rate = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 8), gauge32()).setUnits('Percentage').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientByteHitRate.setStatus('current') sg_proxy_http_client_in_bytes = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 9), counter64()).setUnits('Bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientInBytes.setStatus('current') sg_proxy_http_client_out_bytes = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 1, 10), counter64()).setUnits('Bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientOutBytes.setStatus('current') sg_proxy_http_server_requests = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 2, 1), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpServerRequests.setStatus('current') sg_proxy_http_server_errors = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 2, 2), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpServerErrors.setStatus('current') sg_proxy_http_server_in_bytes = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 2, 3), counter64()).setUnits('Bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpServerInBytes.setStatus('current') sg_proxy_http_server_out_bytes = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 2, 4), counter64()).setUnits('Bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpServerOutBytes.setStatus('current') sg_proxy_http_client_connections = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 1), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientConnections.setStatus('current') sg_proxy_http_client_connections_active = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientConnectionsActive.setStatus('current') sg_proxy_http_client_connections_idle = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpClientConnectionsIdle.setStatus('current') sg_proxy_http_server_connections = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpServerConnections.setStatus('current') sg_proxy_http_server_connections_active = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 5), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpServerConnectionsActive.setStatus('current') sg_proxy_http_server_connections_idle = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 1, 3, 6), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpServerConnectionsIdle.setStatus('current') sg_proxy_http_response_time = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1)) sg_proxy_http_response_first_byte = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 2)) sg_proxy_http_response_byte_rate = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 3)) sg_proxy_http_response_size = mib_identifier((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 4)) sg_proxy_http_service_time_all = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 1), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpServiceTimeAll.setStatus('current') sg_proxy_http_service_time_hit = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 2), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpServiceTimeHit.setStatus('current') sg_proxy_http_service_time_partial_hit = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 3), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpServiceTimePartialHit.setStatus('current') sg_proxy_http_service_time_miss = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 4), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpServiceTimeMiss.setStatus('current') sg_proxy_http_total_fetch_time_all = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 5), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpTotalFetchTimeAll.setStatus('current') sg_proxy_http_total_fetch_time_hit = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 6), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpTotalFetchTimeHit.setStatus('current') sg_proxy_http_total_fetch_time_partial_hit = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 7), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpTotalFetchTimePartialHit.setStatus('current') sg_proxy_http_total_fetch_time_miss = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 1, 8), counter64()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpTotalFetchTimeMiss.setStatus('current') sg_proxy_http_first_byte_all = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 2, 1), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpFirstByteAll.setStatus('current') sg_proxy_http_first_byte_hit = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 2, 2), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpFirstByteHit.setStatus('current') sg_proxy_http_first_byte_partial_hit = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 2, 3), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpFirstBytePartialHit.setStatus('current') sg_proxy_http_first_byte_miss = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 2, 4), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpFirstByteMiss.setStatus('current') sg_proxy_http_byte_rate_all = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 3, 1), gauge32()).setUnits('Bytes Per Second').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpByteRateAll.setStatus('current') sg_proxy_http_byte_rate_hit = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 3, 2), gauge32()).setUnits('Bytes Per Second').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpByteRateHit.setStatus('current') sg_proxy_http_byte_rate_partial_hit = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 3, 3), gauge32()).setUnits('Bytes Per Second').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpByteRatePartialHit.setStatus('current') sg_proxy_http_byte_rate_miss = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 3, 4), gauge32()).setUnits('Bytes Per Second').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpByteRateMiss.setStatus('current') sg_proxy_http_response_size_all = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 4, 1), gauge32()).setUnits('Bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpResponseSizeAll.setStatus('current') sg_proxy_http_response_size_hit = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 4, 2), gauge32()).setUnits('Bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpResponseSizeHit.setStatus('current') sg_proxy_http_response_size_partial_hit = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 4, 3), gauge32()).setUnits('Bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpResponseSizePartialHit.setStatus('current') sg_proxy_http_response_size_miss = mib_scalar((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 2, 4, 4), gauge32()).setUnits('Bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpResponseSizeMiss.setStatus('current') sg_proxy_http_median_service_table = mib_table((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1)) if mibBuilder.loadTexts: sgProxyHttpMedianServiceTable.setStatus('current') sg_proxy_http_median_service_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1)).setIndexNames((0, 'BLUECOAT-SG-PROXY-MIB', 'sgProxyHttpMedianServiceTime')) if mibBuilder.loadTexts: sgProxyHttpMedianServiceEntry.setStatus('current') sg_proxy_http_median_service_time = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 5, 60))).clone(namedValues=named_values(('one', 1), ('five', 5), ('sixty', 60)))).setUnits('Minutes') if mibBuilder.loadTexts: sgProxyHttpMedianServiceTime.setStatus('current') sg_proxy_http_median_service_time_all = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 2), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpMedianServiceTimeAll.setStatus('current') sg_proxy_http_median_service_time_hit = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 3), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpMedianServiceTimeHit.setStatus('current') sg_proxy_http_median_service_time_partial_hit = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 4), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpMedianServiceTimePartialHit.setStatus('current') sg_proxy_http_median_service_time_miss = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 5), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyHttpMedianServiceTimeMiss.setStatus('current') sg_proxy_dns_median_service_time = mib_table_column((1, 3, 6, 1, 4, 1, 3417, 2, 11, 3, 3, 1, 1, 6), gauge32()).setUnits('Milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: sgProxyDnsMedianServiceTime.setStatus('current') mibBuilder.exportSymbols('BLUECOAT-SG-PROXY-MIB', sgProxyHttpResponseSize=sgProxyHttpResponseSize, sgProxyHttpClientMisses=sgProxyHttpClientMisses, sgProxyHttpFirstByteHit=sgProxyHttpFirstByteHit, sgProxyHttpMedianServiceTime=sgProxyHttpMedianServiceTime, sgProxyCpuCoreBusyTime=sgProxyCpuCoreBusyTime, sgProxyHttpClientErrors=sgProxyHttpClientErrors, sgProxyDnsMedianServiceTime=sgProxyDnsMedianServiceTime, sgProxyHttpClientConnectionsActive=sgProxyHttpClientConnectionsActive, sgProxyHttpByteRateHit=sgProxyHttpByteRateHit, sgProxyHttpMedianServiceTimePartialHit=sgProxyHttpMedianServiceTimePartialHit, sgProxyCpuBusyPerCent=sgProxyCpuBusyPerCent, sgProxyHttpClient=sgProxyHttpClient, sgProxyHttpServiceTimeMiss=sgProxyHttpServiceTimeMiss, sgProxyHttpServiceTimePartialHit=sgProxyHttpServiceTimePartialHit, sgProxyHttpServiceTimeHit=sgProxyHttpServiceTimeHit, sgProxyCpuCoreBusyTimeSinceLastAccess=sgProxyCpuCoreBusyTimeSinceLastAccess, sgProxyCpuCoreTableEntry=sgProxyCpuCoreTableEntry, sgProxyHttpResponseTime=sgProxyHttpResponseTime, sgProxyHttpResponseFirstByte=sgProxyHttpResponseFirstByte, sgProxyHttpResponseSizePartialHit=sgProxyHttpResponseSizePartialHit, sgProxyHttpFirstByteMiss=sgProxyHttpFirstByteMiss, sgProxyHttpClientHitRate=sgProxyHttpClientHitRate, sgProxyHttpClientByteHitRate=sgProxyHttpClientByteHitRate, sgProxyHttpConnections=sgProxyHttpConnections, sgProxyHttpFirstBytePartialHit=sgProxyHttpFirstBytePartialHit, sgProxyStorage=sgProxyStorage, sgProxyMemSysUsage=sgProxyMemSysUsage, sgProxyMemAvailable=sgProxyMemAvailable, sgProxyHttpMedianServiceTimeHit=sgProxyHttpMedianServiceTimeHit, sgProxyMemory=sgProxyMemory, sgProxyCpuCoreIndex=sgProxyCpuCoreIndex, sgProxyHttpServer=sgProxyHttpServer, sgProxyHttpMedianServiceTimeAll=sgProxyHttpMedianServiceTimeAll, sgProxyCpuUpTimeSinceLastAccess=sgProxyCpuUpTimeSinceLastAccess, sgProxyCpuCoreIdlePerCent=sgProxyCpuCoreIdlePerCent, sgProxyHttpClientOutBytes=sgProxyHttpClientOutBytes, sgProxyHttpClientRequests=sgProxyHttpClientRequests, sgProxyHttpServiceTimeAll=sgProxyHttpServiceTimeAll, sgProxyHttpResponse=sgProxyHttpResponse, sgProxyHttpFirstByteAll=sgProxyHttpFirstByteAll, sgProxyHttpServerOutBytes=sgProxyHttpServerOutBytes, sgProxyHttpTotalFetchTimeAll=sgProxyHttpTotalFetchTimeAll, sgProxyHttpClientConnections=sgProxyHttpClientConnections, sgProxyCache=sgProxyCache, sgProxyConfig=sgProxyConfig, sgProxyHttpMedian=sgProxyHttpMedian, sgProxyCpuCoreUpTimeSinceLastAccess=sgProxyCpuCoreUpTimeSinceLastAccess, sgProxyHttpByteRateMiss=sgProxyHttpByteRateMiss, sgProxyHttpServerConnections=sgProxyHttpServerConnections, sgProxyAdmin=sgProxyAdmin, sgProxyHttpClientRequestRate=sgProxyHttpClientRequestRate, sgProxyCpuIdlePerCent=sgProxyCpuIdlePerCent, sgProxyHttpClientPartialHits=sgProxyHttpClientPartialHits, PYSNMP_MODULE_ID=bluecoatSGProxyMIB, sgProxyHttpClientHits=sgProxyHttpClientHits, sgProxyCpuCoreIdleTime=sgProxyCpuCoreIdleTime, sgProxyHttpServerRequests=sgProxyHttpServerRequests, sgProxyCpu=sgProxyCpu, sgProxyHttpByteRateAll=sgProxyHttpByteRateAll, sgProxyCpuIdleTime=sgProxyCpuIdleTime, sgProxyMemCacheUsage=sgProxyMemCacheUsage, sgProxyHttpServerErrors=sgProxyHttpServerErrors, sgProxyHttpTotalFetchTimeMiss=sgProxyHttpTotalFetchTimeMiss, sgProxyHttpServerConnectionsIdle=sgProxyHttpServerConnectionsIdle, sgProxyHttpMedianServiceTimeMiss=sgProxyHttpMedianServiceTimeMiss, sgProxyCpuBusyTimeSinceLastAccess=sgProxyCpuBusyTimeSinceLastAccess, sgProxySerialNumber=sgProxySerialNumber, sgProxyHttp=sgProxyHttp, sgProxyHttpByteRatePartialHit=sgProxyHttpByteRatePartialHit, sgProxyCpuCoreBusyPerCent=sgProxyCpuCoreBusyPerCent, sgProxyCpuCoreIdleTimeSinceLastAccess=sgProxyCpuCoreIdleTimeSinceLastAccess, sgProxyHttpResponseSizeAll=sgProxyHttpResponseSizeAll, sgProxyHttpClientConnectionsIdle=sgProxyHttpClientConnectionsIdle, sgProxyHttpResponseSizeMiss=sgProxyHttpResponseSizeMiss, sgProxyCpuUpTime=sgProxyCpuUpTime, sgProxyCpuCoreUpTime=sgProxyCpuCoreUpTime, sgProxyHttpMedianServiceTable=sgProxyHttpMedianServiceTable, sgProxyHttpServerInBytes=sgProxyHttpServerInBytes, sgProxyHttpClientInBytes=sgProxyHttpClientInBytes, sgProxyCpuBusyTime=sgProxyCpuBusyTime, sgProxyHttpResponseSizeHit=sgProxyHttpResponseSizeHit, sgProxySoftware=sgProxySoftware, sgProxyHttpPerf=sgProxyHttpPerf, sgProxyHttpResponseByteRate=sgProxyHttpResponseByteRate, bluecoatSGProxyMIB=bluecoatSGProxyMIB, sgProxyCpuCoreTable=sgProxyCpuCoreTable, sgProxyHttpServerConnectionsActive=sgProxyHttpServerConnectionsActive, sgProxySystem=sgProxySystem, sgProxyMemoryPressure=sgProxyMemoryPressure, sgProxyCpuIdleTimeSinceLastAccess=sgProxyCpuIdleTimeSinceLastAccess, sgProxyHttpMedianServiceEntry=sgProxyHttpMedianServiceEntry, sgProxyVersion=sgProxyVersion, sgProxyNumObjects=sgProxyNumObjects, sgProxyHttpTotalFetchTimePartialHit=sgProxyHttpTotalFetchTimePartialHit, sgProxyHttpTotalFetchTimeHit=sgProxyHttpTotalFetchTimeHit)
a = (42, 1) print(f"First value of a: {a[0]}.") # Set first value of a to 23: a[0] = 23 print(f"First value of a: {a[0]}.")
a = (42, 1) print(f'First value of a: {a[0]}.') a[0] = 23 print(f'First value of a: {a[0]}.')
# coding=utf-8 class RpcRequest(object): def __init__(self, method, params): self._method = method self._params = params @property def method(self): return self._method @property def params(self): return self._params @property def to_json(self): return { 'method': self._method, 'params': self._params }
class Rpcrequest(object): def __init__(self, method, params): self._method = method self._params = params @property def method(self): return self._method @property def params(self): return self._params @property def to_json(self): return {'method': self._method, 'params': self._params}
# original data data = "75\n\ 95 64\n\ 17 47 82\n\ 18 35 87 10\n\ 20 04 82 47 65\n\ 19 01 23 75 03 34\n\ 88 02 77 73 07 63 67\n\ 99 65 04 28 06 16 70 92\n\ 41 41 26 56 83 40 80 70 33\n\ 41 48 72 33 47 32 37 16 94 29\n\ 53 71 44 65 25 43 91 52 97 51 14\n\ 70 11 33 28 77 73 17 78 39 68 17 57\n\ 91 71 52 38 17 14 91 43 58 50 27 29 48\n\ 63 66 04 68 89 53 67 30 73 16 69 87 40 31\n\ 04 62 98 27 23 09 70 98 73 93 38 53 60 04 23" # data wrangling l = data.split("\n") triangle = [] for i in l: k = i.split(' ') n = [] for j in k: n.append(int(j)) triangle.append(n) if __name__ == "__main__": for i in range(14, 0, -1): for j in range(i): if triangle[i][j] > triangle[i][j+1]: triangle[i-1][j] += triangle[i][j] else: triangle[i-1][j] += triangle[i][j+1] print(triangle[0][0])
data = '75\n95 64\n17 47 82\n18 35 87 10\n20 04 82 47 65\n19 01 23 75 03 34\n88 02 77 73 07 63 67\n99 65 04 28 06 16 70 92\n41 41 26 56 83 40 80 70 33\n41 48 72 33 47 32 37 16 94 29\n53 71 44 65 25 43 91 52 97 51 14\n70 11 33 28 77 73 17 78 39 68 17 57\n91 71 52 38 17 14 91 43 58 50 27 29 48\n63 66 04 68 89 53 67 30 73 16 69 87 40 31\n04 62 98 27 23 09 70 98 73 93 38 53 60 04 23' l = data.split('\n') triangle = [] for i in l: k = i.split(' ') n = [] for j in k: n.append(int(j)) triangle.append(n) if __name__ == '__main__': for i in range(14, 0, -1): for j in range(i): if triangle[i][j] > triangle[i][j + 1]: triangle[i - 1][j] += triangle[i][j] else: triangle[i - 1][j] += triangle[i][j + 1] print(triangle[0][0])
def encontra_impares(lista): if len(lista) == 0: return lista if lista[0] % 2 == 0: return encontra_impares(lista[1:]) return [lista[0]] + encontra_impares(lista[1:])
def encontra_impares(lista): if len(lista) == 0: return lista if lista[0] % 2 == 0: return encontra_impares(lista[1:]) return [lista[0]] + encontra_impares(lista[1:])
# Kth smallest element # Input: # N = 6 # arr[] = 7 10 4 3 20 15 # K = 3 # Output : 7 # Explanation : # 3rd smallest element in the given # array is 7. k = int(input()) arr = list(map(int,input().split())) arr.sort() print("\n") print("{k}th min element is : ",arr[k-1]) print("{k}th max element is : ",arr[-k])
k = int(input()) arr = list(map(int, input().split())) arr.sort() print('\n') print('{k}th min element is : ', arr[k - 1]) print('{k}th max element is : ', arr[-k])
#Class for scrapers table class Scrapers: def __init__(self, cursor): self.cursor = cursor #read from db #read all scaping jobs by progress def getScrapingJobsByProgress(cursor, progress): sql= "SELECT * from scrapers WHERE scrapers_progress=%s ORDER BY RANDOM()" data = (progress) cursor.execute(sql,(data,)) rows = cursor.fetchall() return rows #read all scaping jobs by progress def getScrapingJobsByProgressSE(cursor, progress, se): sql= "SELECT * from scrapers WHERE scrapers_progress=%s AND scrapers_se =%s ORDER BY RANDOM()" data = (progress, se) cursor.execute(sql,(data)) rows = cursor.fetchall() return rows #read scaping jobs by progress and query def getScrapingJobsByQueryProgress(cursor, query_id, progress): sql= "SELECT * FROM scrapers WHERE scrapers_queries_id = %s AND scrapers_progress = %s ORDER BY scrapers_start, scrapers_se ASC" data = (query_id, progress) cursor.execute(sql,(data)) rows = cursor.fetchall() return rows def getScrapingJobsByQueryProgressSE(cursor, query_id, progress, se): sql= "SELECT * FROM scrapers WHERE scrapers_queries_id = %s AND scrapers_progress = %s AND scrapers_se = %s ORDER BY scrapers_start, scrapers_se" data = (query_id, progress, se) cursor.execute(sql,(data)) rows = cursor.fetchall() return rows #read scraping jobs by query def getScrapingJobsByQuery(cursor, query_id): sql= "SELECT * FROM scrapers WHERE scrapers_queries_id = %s ORDER BY scrapers_id" data = (query_id) cursor.execute(sql,(data,)) rows = cursor.fetchall() return rows #read scraping jobs by Search Engine def getScrapingJobsBySE(cursor, query_id, search_engine): sql= "SELECT count(scrapers_id) FROM scrapers WHERE scrapers_queries_id = %s AND scrapers_se =%s" data = (query_id, search_engine) cursor.execute(sql,(data)) rows = cursor.fetchall() return rows def getScrapingJobsByStudyQueries(cursor, study): sql= "SELECT count(distinct(scrapers_queries_id)) from scrapers, queries WHERE scrapers_queries_id = queries_id AND scrapers_studies_id=%s" data = (study) cursor.execute(sql,(data,)) rows = cursor.fetchall() return rows #write to db #generate scraping joby by queries def insertScrapingJobs(cursor, query_id, study_id, query_string, search_engine, start, today): cursor.execute( "INSERT INTO scrapers (scrapers_queries_id, scrapers_studies_id, scrapers_queries_query, scrapers_se, scrapers_start, scrapers_date, scrapers_progress) VALUES (%s, %s, %s, %s, %s, %s, %s);", # remove parenthesis here, which ends the execute call (query_id, study_id, query_string, search_engine, start, today, 0) ) #update status of scraping job def updateScrapingJob(cursor, job_id, progress): cursor.execute( "UPDATE scrapers SET scrapers_progress = %s WHERE scrapers_id = %s", (progress, job_id) ) #update status of scraping job by query; important for queries with a limited range of search results def updateScrapingJobQuery(cursor, query_id, progress): cursor.execute( "UPDATE scrapers SET scrapers_progress = %s WHERE scrapers_queries_id = %s", (progress, query_id) ) #update status of scraping job by query; important for queries with a limited range of search results def updateScrapingJobQuerySeJobId(cursor, query_id, progress, se, job_id): cursor.execute( "UPDATE scrapers SET scrapers_progress = %s WHERE scrapers_queries_id = %s AND scrapers_se = %s AND scrapers_id >= %s", (progress, query_id, se, job_id) ) #update scraping job by query and search engine def updateScrapingJobQuerySearchEngine(cursor, query_id, search_engine, progress): cursor.execute( "UPDATE scrapers SET scrapers_progress = %s WHERE scrapers_queries_id = %s AND scrapers_se =%s", (progress, query_id, search_engine) ) #reset scraper_jobs def resetScrapingJobs(cursor): cursor.execute( "DELETE FROM scrapers WHERE scrapers_progress = -1" ) def getScrapingJobs(cursor, query_id, study_id, search_engine): sql= "SELECT scrapers_id FROM scrapers WHERE scrapers_queries_id = %s AND scrapers_studies_id =%s AND scrapers_se = %s" data = (query_id, study_id, search_engine) cursor.execute(sql,(data)) rows = cursor.fetchall() return rows
class Scrapers: def __init__(self, cursor): self.cursor = cursor def get_scraping_jobs_by_progress(cursor, progress): sql = 'SELECT * from scrapers WHERE scrapers_progress=%s ORDER BY RANDOM()' data = progress cursor.execute(sql, (data,)) rows = cursor.fetchall() return rows def get_scraping_jobs_by_progress_se(cursor, progress, se): sql = 'SELECT * from scrapers WHERE scrapers_progress=%s AND scrapers_se =%s ORDER BY RANDOM()' data = (progress, se) cursor.execute(sql, data) rows = cursor.fetchall() return rows def get_scraping_jobs_by_query_progress(cursor, query_id, progress): sql = 'SELECT * FROM scrapers WHERE scrapers_queries_id = %s AND scrapers_progress = %s ORDER BY scrapers_start, scrapers_se ASC' data = (query_id, progress) cursor.execute(sql, data) rows = cursor.fetchall() return rows def get_scraping_jobs_by_query_progress_se(cursor, query_id, progress, se): sql = 'SELECT * FROM scrapers WHERE scrapers_queries_id = %s AND scrapers_progress = %s AND scrapers_se = %s ORDER BY scrapers_start, scrapers_se' data = (query_id, progress, se) cursor.execute(sql, data) rows = cursor.fetchall() return rows def get_scraping_jobs_by_query(cursor, query_id): sql = 'SELECT * FROM scrapers WHERE scrapers_queries_id = %s ORDER BY scrapers_id' data = query_id cursor.execute(sql, (data,)) rows = cursor.fetchall() return rows def get_scraping_jobs_by_se(cursor, query_id, search_engine): sql = 'SELECT count(scrapers_id) FROM scrapers WHERE scrapers_queries_id = %s AND scrapers_se =%s' data = (query_id, search_engine) cursor.execute(sql, data) rows = cursor.fetchall() return rows def get_scraping_jobs_by_study_queries(cursor, study): sql = 'SELECT count(distinct(scrapers_queries_id)) from scrapers, queries WHERE scrapers_queries_id = queries_id AND scrapers_studies_id=%s' data = study cursor.execute(sql, (data,)) rows = cursor.fetchall() return rows def insert_scraping_jobs(cursor, query_id, study_id, query_string, search_engine, start, today): cursor.execute('INSERT INTO scrapers (scrapers_queries_id, scrapers_studies_id, scrapers_queries_query, scrapers_se, scrapers_start, scrapers_date, scrapers_progress) VALUES (%s, %s, %s, %s, %s, %s, %s);', (query_id, study_id, query_string, search_engine, start, today, 0)) def update_scraping_job(cursor, job_id, progress): cursor.execute('UPDATE scrapers SET scrapers_progress = %s WHERE scrapers_id = %s', (progress, job_id)) def update_scraping_job_query(cursor, query_id, progress): cursor.execute('UPDATE scrapers SET scrapers_progress = %s WHERE scrapers_queries_id = %s', (progress, query_id)) def update_scraping_job_query_se_job_id(cursor, query_id, progress, se, job_id): cursor.execute('UPDATE scrapers SET scrapers_progress = %s WHERE scrapers_queries_id = %s AND scrapers_se = %s AND scrapers_id >= %s', (progress, query_id, se, job_id)) def update_scraping_job_query_search_engine(cursor, query_id, search_engine, progress): cursor.execute('UPDATE scrapers SET scrapers_progress = %s WHERE scrapers_queries_id = %s AND scrapers_se =%s', (progress, query_id, search_engine)) def reset_scraping_jobs(cursor): cursor.execute('DELETE FROM scrapers WHERE scrapers_progress = -1') def get_scraping_jobs(cursor, query_id, study_id, search_engine): sql = 'SELECT scrapers_id FROM scrapers WHERE scrapers_queries_id = %s AND scrapers_studies_id =%s AND scrapers_se = %s' data = (query_id, study_id, search_engine) cursor.execute(sql, data) rows = cursor.fetchall() return rows
""" @name: PyHouse_Install/src/Update/update_pyhouse.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2015-2016 by D. Brian Kimmel @license: MIT License @note: Created on Oct 20, 2015 @Summary: """ __updated__ = '2016-08-26' # Import system type stuff # Import PyHouseInstall files and modules. HOME_DIR = '/home/pyhouse/' BIN_DIR = HOME_DIR + 'bin/' class Api(object): """ """ def update(self): pass if __name__ == "__main__": print('---Running Update/update_pyhouse.py ...') l_api = Api() l_api.update() print('---Finished update_pyhouse.py\n') # ## END DBK
""" @name: PyHouse_Install/src/Update/update_pyhouse.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2015-2016 by D. Brian Kimmel @license: MIT License @note: Created on Oct 20, 2015 @Summary: """ __updated__ = '2016-08-26' home_dir = '/home/pyhouse/' bin_dir = HOME_DIR + 'bin/' class Api(object): """ """ def update(self): pass if __name__ == '__main__': print('---Running Update/update_pyhouse.py ...') l_api = api() l_api.update() print('---Finished update_pyhouse.py\n')
# # PySNMP MIB module TIMETRA-IF-GROUP-HANDLER-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TIMETRA-IF-GROUP-HANDLER-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:17:53 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint") InterfaceIndexOrZero, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") Counter32, TimeTicks, Unsigned32, Integer32, Gauge32, ObjectIdentity, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, IpAddress, NotificationType, MibIdentifier, iso, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "TimeTicks", "Unsigned32", "Integer32", "Gauge32", "ObjectIdentity", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "IpAddress", "NotificationType", "MibIdentifier", "iso", "Bits") DisplayString, TextualConvention, RowStatus, TimeStamp = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "RowStatus", "TimeStamp") tmnxChassisIndex, = mibBuilder.importSymbols("TIMETRA-CHASSIS-MIB", "tmnxChassisIndex") tmnxSRNotifyPrefix, timetraSRMIBModules, tmnxSRConfs, tmnxSRObjs = mibBuilder.importSymbols("TIMETRA-GLOBAL-MIB", "tmnxSRNotifyPrefix", "timetraSRMIBModules", "tmnxSRConfs", "tmnxSRObjs") tmnxPortPortID, = mibBuilder.importSymbols("TIMETRA-PORT-MIB", "tmnxPortPortID") TmnxEncapVal, TmnxAdminState, TItemDescription, TmnxOperState = mibBuilder.importSymbols("TIMETRA-TC-MIB", "TmnxEncapVal", "TmnxAdminState", "TItemDescription", "TmnxOperState") timetraIfGroupMIBModule = ModuleIdentity((1, 3, 6, 1, 4, 1, 6527, 1, 1, 3, 69)) timetraIfGroupMIBModule.setRevisions(('1909-02-28 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: timetraIfGroupMIBModule.setRevisionsDescriptions(('Rev 1.0 28 Feb 2009 00:00 1.0 release of the TIMETRA-IF-GROUP-HANDLER-MIB.',)) if mibBuilder.loadTexts: timetraIfGroupMIBModule.setLastUpdated('0902280000Z') if mibBuilder.loadTexts: timetraIfGroupMIBModule.setOrganization('Alcatel-Lucent') if mibBuilder.loadTexts: timetraIfGroupMIBModule.setContactInfo('Alcatel-Lucent SROS Support Web: http://support.alcatel-lucent.com') if mibBuilder.loadTexts: timetraIfGroupMIBModule.setDescription("This document is the SNMP MIB module to manage and provision the Interface Group Handler components of the Alcatel-Lucent SROS device. Copyright (c) 2009-2011 Alcatel-Lucent. All rights reserved. Reproduction of this document is authorized on the condition that the foregoing copyright notice is included. This SNMP MIB module (Specification) embodies Alcatel-Lucent's proprietary intellectual property. Alcatel-Lucent retains all title and ownership in the Specification, including any revisions. Alcatel-Lucent grants all interested parties a non-exclusive license to use and distribute an unmodified copy of this Specification in connection with management of Alcatel-Lucent products, and without fee, provided this copyright notice and license appear on all copies. This Specification is supplied 'as is', and Alcatel-Lucent makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") tmnxIfGroupObjs = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69)) tmnxIfGroupNotifyPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 3, 69)) tmnxIfGroupConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69)) tmnxIfGroupConfigTimeStamps = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 0)) tmnxIfGroupConfigurations = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1)) tmnxIfGroupStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 2)) tmnxIfGroupNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 3, 69, 0)) tmnxIfGroupCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 1)) tmnxIfGroupGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2)) class TmnxIfGroupHandlerIndex(TextualConvention, Unsigned32): description = 'The TmnxIfGroupHandlerIndex specifies the unique Interface Group Handler Identifier for an Interface Group Handler. The value zero (0) is only used by objects that reference a tmnxIfGroupHandlerConfigEntry. The value zero (0) represents an invalid index that specifies the object is not associated with an Interface Group Handler.' status = 'current' class TmnxIfGroupProtocolIndex(TextualConvention, Integer32): description = 'The TmnxIfGroupProtocolIndex specifies the protocol used by an Interface Group Handler or member. The TmnxIfGroupProtocolIndex is defined as an enumeration of the following protocols: ipcp (1) -- IP Control Protocol ipv6cp (2) -- IPV6 Control Protocol mplscp (3) -- MPLS Control Protocol osicp (4) -- OSI Control Protocol' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("ipcp", 1), ("ipv6cp", 2), ("mplscp", 3), ("osicp", 4)) tmnxIfGrpHndlrCfgTblLastChanged = MibScalar((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 0, 1), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: tmnxIfGrpHndlrCfgTblLastChanged.setStatus('current') if mibBuilder.loadTexts: tmnxIfGrpHndlrCfgTblLastChanged.setDescription('The tmnxIfGrpHndlrCfgTblLastChanged indicates the time, since system startup, when a row in the tmnxIfGroupHandlerConfigTable last changed.') tmnxIfGroupHandlerConfigTable = MibTable((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1), ) if mibBuilder.loadTexts: tmnxIfGroupHandlerConfigTable.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerConfigTable.setDescription('The tmnxIfGroupHandlerConfigTable consists of the Interface Group Handler configuration information.') tmnxIfGroupHandlerConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1), ).setIndexNames((0, "TIMETRA-CHASSIS-MIB", "tmnxChassisIndex"), (0, "TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerIndex")) if mibBuilder.loadTexts: tmnxIfGroupHandlerConfigEntry.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerConfigEntry.setDescription('The tmnxIfGroupHandlerConfigEntry contains information pertaining to an individual Interface Group Handler. Rows in this table are created and destroyed using the tmnxIfGroupHandlerRowStatus object.') tmnxIfGroupHandlerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1, 1), TmnxIfGroupHandlerIndex().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: tmnxIfGroupHandlerIndex.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerIndex.setDescription('The tmnxIfGroupHandlerIndex specifies the row index of the Interface Group Handler.') tmnxIfGroupHandlerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1, 2), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: tmnxIfGroupHandlerRowStatus.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerRowStatus.setDescription('The tmnxIfGroupHandlerRowStatus controls the creation and deletion of row entries in the tmnxIfGroupHandlerConfigTable.') tmnxIfGroupHandlerTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1, 3), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: tmnxIfGroupHandlerTimeStamp.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerTimeStamp.setDescription('The tmnxIfGroupHandlerTimeStamp indicates the time, since system startup, of the last change to this row.') tmnxIfGroupHandlerThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 8)).clone(1)).setMaxAccess("readcreate") if mibBuilder.loadTexts: tmnxIfGroupHandlerThreshold.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerThreshold.setDescription('The value of tmnxIfGroupHandlerThreshold specifies the minimum number of Interface Group Handler Members that have to be active before the Interface Group Handler can be brought operationally up.') tmnxIfGroupHandlerAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1, 5), TmnxAdminState().clone('outOfService')).setMaxAccess("readcreate") if mibBuilder.loadTexts: tmnxIfGroupHandlerAdminStatus.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerAdminStatus.setDescription('The value of tmnxIfGroupHandlerAdminStatus specifies the administrative state of the Interface Group Handler.') tmnxIfGroupHandlerProtoTable = MibTable((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2), ) if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoTable.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoTable.setDescription('The tmnxIfGroupHandlerProtoTable consists of the operational status of the protocols per Interface Group Handler.') tmnxIfGroupHandlerProtoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2, 1), ).setIndexNames((0, "TIMETRA-CHASSIS-MIB", "tmnxChassisIndex"), (0, "TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerIndex"), (0, "TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrProtoIndex")) if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoEntry.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoEntry.setDescription("The tmnxIfGroupHandlerProtoEntry contains information pertaining to an individual Interface Group Handler's operational state. Rows in this table are created and destroyed by the system, and can not be created or deleted by SNMP SET operations. A row exists for every supported protocol for each Interface Group Handler entry.") tmnxIfGroupHdlrProtoIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2, 1, 1), TmnxIfGroupProtocolIndex()) if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoIndex.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoIndex.setDescription('The tmnxIfGroupHdlrProtoIndex specifies the protocol index for the entry.') tmnxIfGroupHdlrProtoStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 0), ("blocked", 1), ("inhibited", 2), ("waiting", 3), ("pending", 4), ("up", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoStatus.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoStatus.setDescription("The tmnxIfGroupHdlrProtoStatus indicates the operational state of the protocol for the Interface Group Handler. The valid states are: none (0) -- Initializing state. All member within the group are in state 'none (0)' for the given tmnxIfGroupHdlrProtoIndex. blocked (1) -- Administratively disabled. inhibited (2) -- Administratively enabled but tmnxIfGroupHandlerThreshold is not met for enough links that have tmnxIfGroupHdlrMemberProtoStatus set to 'ready (2)'. waiting (3) -- Administratively enabled but tmnxIfGroupHandlerThreshold is not met for enough links that have tmnxIfGroupHdlrMemberProtoStatus set to 'operational (4)' or better. pending (4) -- Administratively enabled but tmnxIfGroupHandlerThreshold is not met for enough links that have tmnxIfGroupHdlrMemberProtoStatus set to 'up (5)'. up (5) -- Administratively enabled but tmnxIfGroupHandlerThreshold is met with enough links that have tmnxIfGroupHdlrMemberProtoStatus set to 'up (5)'.") tmnxIfGroupHdlrProtoActLinks = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoActLinks.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoActLinks.setDescription("The tmnxIfGroupHdlrProtoActLinks indicates the number of Interface Group Handler members with tmnxIfGroupHdlrProtoStatus set to 'up' (5).") tmnxIfGroupHdlrProtoUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2, 1, 4), Unsigned32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoUpTime.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoUpTime.setDescription("The tmnxIfGroupHdlrProtoUpTime object indicates the time since the Interface Group Handler entered the 'up (5)' state indicated by the tmnxIfGroupHdlrProtoStatus object") tmnxIfGrpHndlrMbrTblLastChanged = MibScalar((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 0, 2), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: tmnxIfGrpHndlrMbrTblLastChanged.setStatus('current') if mibBuilder.loadTexts: tmnxIfGrpHndlrMbrTblLastChanged.setDescription('The tmnxIfGrpHndlrMbrTblLastChanged indicates the time, since system startup, when a row in the tmnxIfGroupHandlerMemberTable last changed.') tmnxIfGroupHandlerMemberTable = MibTable((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 3), ) if mibBuilder.loadTexts: tmnxIfGroupHandlerMemberTable.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerMemberTable.setDescription('The tmnxIfGroupHandlerMemberTable consists of the members associated with the corresponding tmnxIfGroupHandlerConfigEntry.') tmnxIfGroupHandlerMemberEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 3, 1), ).setIndexNames((0, "TIMETRA-CHASSIS-MIB", "tmnxChassisIndex"), (0, "TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerIndex"), (0, "TIMETRA-PORT-MIB", "tmnxPortPortID")) if mibBuilder.loadTexts: tmnxIfGroupHandlerMemberEntry.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerMemberEntry.setDescription('The tmnxIfGroupHandlerMemberEntry contains information pertaining to an individual member associated with a tmnxIfGroupHandlerConfigEntry. Rows in this table are created and destroyed using the tmnxIfGrpHandlerMemberRowStatus object.') tmnxIfGrpHandlerMemberRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 3, 1, 1), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: tmnxIfGrpHandlerMemberRowStatus.setStatus('current') if mibBuilder.loadTexts: tmnxIfGrpHandlerMemberRowStatus.setDescription('The tmnxIfGrpHandlerMemberRowStatus controls the creation and deletion of row entries in the tmnxIfGroupHandlerMemberTable.') tmnxIfGroupHdlrMemberProtoTable = MibTable((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 4), ) if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoTable.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoTable.setDescription('The tmnxIfGroupHdlrMemberProtoTable consists of the information pertaining to the protocols per Interface Group Handler member.') tmnxIfGroupHdlrMemberProtoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 4, 1), ).setIndexNames((0, "TIMETRA-CHASSIS-MIB", "tmnxChassisIndex"), (0, "TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerIndex"), (0, "TIMETRA-PORT-MIB", "tmnxPortPortID"), (0, "TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrMemberProtoIndex")) if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoEntry.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoEntry.setDescription("The tmnxIfGroupHdlrMemberProtoEntry contains information pertaining to an individual Interface Group Handler's protocol information. Rows in this table are created and destroyed by the system, and can not be created or deleted by SNMP SET operations. A row exists for every supported protocol for each Interface Group Handler member entry.") tmnxIfGroupHdlrMemberProtoIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 4, 1, 1), TmnxIfGroupProtocolIndex()) if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoIndex.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoIndex.setDescription('The tmnxIfGroupHdlrMemberProtoIndex specifies the protocol index for the entry.') tmnxIfGroupHdlrMemberProtoStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 0), ("down", 1), ("ready", 2), ("running", 3), ("operational", 4), ("up", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoStatus.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoStatus.setDescription("The tmnxIfGroupHdlrMemberProtoStatus indicates the operational state of the protocol for the Interface Group Handler member. Once a member has left the 'none (0)' state for a specific tmnxIfGroupHandlerIndex it will never return to the 'none (0)' state unless the member is removed from the group or an activity switch occurs, in which case, no state updates are required for the protocol and therefore the protocol is considered 'none (0)' once more. The valid states are: none (0) -- Initializing state. down (1) -- Not in a functional state. The object tmnxPortState is set to for this member is set to 'linkDown' or lower or this protocol is not configured properly. ready (2) -- Waiting for tmnxIfGroupHdlrMemberProtoStatus to be set to waiting or better to run this protocol. running (3) -- Protocol is running, but not operational. operational (4) -- Link is operational but we are waiting for tmnxIfGroupHdlrProtoStatus to be set to 'pending (4)' or better to leave this state. up (5) -- Protocol is decalared up.") tmnxIfGroupHdlrMemberProtoUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 4, 1, 3), Unsigned32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoUpTime.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoUpTime.setDescription("The tmnxIfGroupHdlrMemberProtoUpTime object indicates the time since the member is 'up' (5)' as indicated by the tmnxIfGroupHdlrProtoStatus object.") tmnxIfGroupHandlerProtoOprChange = NotificationType((1, 3, 6, 1, 4, 1, 6527, 3, 1, 3, 69, 0, 1)).setObjects(("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerThreshold"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerAdminStatus"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrProtoStatus"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrProtoActLinks")) if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoOprChange.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoOprChange.setDescription("The tmnxIfGroupHandlerProtoOprChange notification indicates that the specified tmnxIfGroupHdlrProtoStatus has entered or left the 'up (5)' state.") tmnxIfGroupHdlrMbrProtoOprChange = NotificationType((1, 3, 6, 1, 4, 1, 6527, 3, 1, 3, 69, 0, 2)).setObjects(("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrMemberProtoStatus")) if mibBuilder.loadTexts: tmnxIfGroupHdlrMbrProtoOprChange.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMbrProtoOprChange.setDescription("The tmnxIfGroupHdlrMbrProtoOprChange notification indicates that the specified tmnxIfGroupHdlrMemberProtoStatus has entered or left the 'up (5)' state.") tmnxIfGroupHandlerCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 1, 1)).setObjects(("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerTimeStampGroup"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerConfigGroup"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerMemberGroup"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerProtocolGroup"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrNotificationGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnxIfGroupHandlerCompliance = tmnxIfGroupHandlerCompliance.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerCompliance.setDescription('The compliance statement for revision 1.0 of TIMETRA-IF-GROUP-HANDLER-MIB.') tmnxIfGroupHandlerTimeStampGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2, 1)).setObjects(("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGrpHndlrCfgTblLastChanged"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerTimeStamp"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGrpHndlrMbrTblLastChanged")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnxIfGroupHandlerTimeStampGroup = tmnxIfGroupHandlerTimeStampGroup.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerTimeStampGroup.setDescription('The group of objects that track configuration changes for the maintenance of Interface Group Handler for the 7x50.') tmnxIfGroupHandlerConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2, 2)).setObjects(("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerRowStatus"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerThreshold"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerAdminStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnxIfGroupHandlerConfigGroup = tmnxIfGroupHandlerConfigGroup.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerConfigGroup.setDescription('The group of objects for management of Interface Group Handler configurations for the 7x50.') tmnxIfGroupHandlerMemberGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2, 3)).setObjects(("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGrpHandlerMemberRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnxIfGroupHandlerMemberGroup = tmnxIfGroupHandlerMemberGroup.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerMemberGroup.setDescription('The group of objects for management of Interface Group Handler Member configurations for the 7x50.') tmnxIfGroupHandlerProtocolGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2, 4)).setObjects(("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrMemberProtoStatus"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrMemberProtoUpTime"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrProtoStatus"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrProtoActLinks"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrProtoUpTime")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnxIfGroupHandlerProtocolGroup = tmnxIfGroupHandlerProtocolGroup.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerProtocolGroup.setDescription('The group of objects for management of Interface Group Handler protocol configurations for the 7x50.') tmnxIfGroupHdlrNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2, 5)).setObjects(("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHandlerProtoOprChange"), ("TIMETRA-IF-GROUP-HANDLER-MIB", "tmnxIfGroupHdlrMbrProtoOprChange")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnxIfGroupHdlrNotificationGroup = tmnxIfGroupHdlrNotificationGroup.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrNotificationGroup.setDescription('The tmnxIfGroupHdlrNotificationGroup consists of the notifications for generating events for Interface Group Handlers for the 7x50.') mibBuilder.exportSymbols("TIMETRA-IF-GROUP-HANDLER-MIB", tmnxIfGroupHandlerRowStatus=tmnxIfGroupHandlerRowStatus, tmnxIfGroupHdlrProtoIndex=tmnxIfGroupHdlrProtoIndex, tmnxIfGroupHdlrMemberProtoUpTime=tmnxIfGroupHdlrMemberProtoUpTime, tmnxIfGroupHdlrMbrProtoOprChange=tmnxIfGroupHdlrMbrProtoOprChange, tmnxIfGroupHandlerTimeStampGroup=tmnxIfGroupHandlerTimeStampGroup, tmnxIfGroupHandlerProtocolGroup=tmnxIfGroupHandlerProtocolGroup, tmnxIfGroupConformance=tmnxIfGroupConformance, tmnxIfGroupHandlerProtoEntry=tmnxIfGroupHandlerProtoEntry, tmnxIfGroupNotifyPrefix=tmnxIfGroupNotifyPrefix, tmnxIfGroupCompliances=tmnxIfGroupCompliances, tmnxIfGrpHandlerMemberRowStatus=tmnxIfGrpHandlerMemberRowStatus, tmnxIfGroupHandlerMemberGroup=tmnxIfGroupHandlerMemberGroup, tmnxIfGroupConfigTimeStamps=tmnxIfGroupConfigTimeStamps, tmnxIfGroupHandlerProtoOprChange=tmnxIfGroupHandlerProtoOprChange, tmnxIfGrpHndlrCfgTblLastChanged=tmnxIfGrpHndlrCfgTblLastChanged, tmnxIfGroupNotifications=tmnxIfGroupNotifications, tmnxIfGroupHdlrProtoUpTime=tmnxIfGroupHdlrProtoUpTime, tmnxIfGroupHandlerConfigEntry=tmnxIfGroupHandlerConfigEntry, tmnxIfGroupHdlrMemberProtoEntry=tmnxIfGroupHdlrMemberProtoEntry, tmnxIfGroupHdlrProtoStatus=tmnxIfGroupHdlrProtoStatus, tmnxIfGroupHandlerProtoTable=tmnxIfGroupHandlerProtoTable, tmnxIfGroupHandlerCompliance=tmnxIfGroupHandlerCompliance, tmnxIfGroupHdlrMemberProtoIndex=tmnxIfGroupHdlrMemberProtoIndex, tmnxIfGroupStatistics=tmnxIfGroupStatistics, TmnxIfGroupHandlerIndex=TmnxIfGroupHandlerIndex, tmnxIfGroupHandlerConfigGroup=tmnxIfGroupHandlerConfigGroup, tmnxIfGroupHdlrMemberProtoTable=tmnxIfGroupHdlrMemberProtoTable, tmnxIfGroupHandlerTimeStamp=tmnxIfGroupHandlerTimeStamp, tmnxIfGroupHdlrProtoActLinks=tmnxIfGroupHdlrProtoActLinks, tmnxIfGroupHandlerConfigTable=tmnxIfGroupHandlerConfigTable, TmnxIfGroupProtocolIndex=TmnxIfGroupProtocolIndex, tmnxIfGroupHdlrNotificationGroup=tmnxIfGroupHdlrNotificationGroup, tmnxIfGroupObjs=tmnxIfGroupObjs, tmnxIfGroupHandlerIndex=tmnxIfGroupHandlerIndex, tmnxIfGroupHandlerThreshold=tmnxIfGroupHandlerThreshold, tmnxIfGroupHandlerAdminStatus=tmnxIfGroupHandlerAdminStatus, tmnxIfGroupHandlerMemberEntry=tmnxIfGroupHandlerMemberEntry, tmnxIfGroupConfigurations=tmnxIfGroupConfigurations, tmnxIfGrpHndlrMbrTblLastChanged=tmnxIfGrpHndlrMbrTblLastChanged, timetraIfGroupMIBModule=timetraIfGroupMIBModule, tmnxIfGroupHdlrMemberProtoStatus=tmnxIfGroupHdlrMemberProtoStatus, PYSNMP_MODULE_ID=timetraIfGroupMIBModule, tmnxIfGroupGroups=tmnxIfGroupGroups, tmnxIfGroupHandlerMemberTable=tmnxIfGroupHandlerMemberTable)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, constraints_union, value_range_constraint, single_value_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint', 'ValueSizeConstraint') (interface_index_or_zero,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndexOrZero') (object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup') (counter32, time_ticks, unsigned32, integer32, gauge32, object_identity, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, counter64, ip_address, notification_type, mib_identifier, iso, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'TimeTicks', 'Unsigned32', 'Integer32', 'Gauge32', 'ObjectIdentity', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter64', 'IpAddress', 'NotificationType', 'MibIdentifier', 'iso', 'Bits') (display_string, textual_convention, row_status, time_stamp) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention', 'RowStatus', 'TimeStamp') (tmnx_chassis_index,) = mibBuilder.importSymbols('TIMETRA-CHASSIS-MIB', 'tmnxChassisIndex') (tmnx_sr_notify_prefix, timetra_srmib_modules, tmnx_sr_confs, tmnx_sr_objs) = mibBuilder.importSymbols('TIMETRA-GLOBAL-MIB', 'tmnxSRNotifyPrefix', 'timetraSRMIBModules', 'tmnxSRConfs', 'tmnxSRObjs') (tmnx_port_port_id,) = mibBuilder.importSymbols('TIMETRA-PORT-MIB', 'tmnxPortPortID') (tmnx_encap_val, tmnx_admin_state, t_item_description, tmnx_oper_state) = mibBuilder.importSymbols('TIMETRA-TC-MIB', 'TmnxEncapVal', 'TmnxAdminState', 'TItemDescription', 'TmnxOperState') timetra_if_group_mib_module = module_identity((1, 3, 6, 1, 4, 1, 6527, 1, 1, 3, 69)) timetraIfGroupMIBModule.setRevisions(('1909-02-28 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: timetraIfGroupMIBModule.setRevisionsDescriptions(('Rev 1.0 28 Feb 2009 00:00 1.0 release of the TIMETRA-IF-GROUP-HANDLER-MIB.',)) if mibBuilder.loadTexts: timetraIfGroupMIBModule.setLastUpdated('0902280000Z') if mibBuilder.loadTexts: timetraIfGroupMIBModule.setOrganization('Alcatel-Lucent') if mibBuilder.loadTexts: timetraIfGroupMIBModule.setContactInfo('Alcatel-Lucent SROS Support Web: http://support.alcatel-lucent.com') if mibBuilder.loadTexts: timetraIfGroupMIBModule.setDescription("This document is the SNMP MIB module to manage and provision the Interface Group Handler components of the Alcatel-Lucent SROS device. Copyright (c) 2009-2011 Alcatel-Lucent. All rights reserved. Reproduction of this document is authorized on the condition that the foregoing copyright notice is included. This SNMP MIB module (Specification) embodies Alcatel-Lucent's proprietary intellectual property. Alcatel-Lucent retains all title and ownership in the Specification, including any revisions. Alcatel-Lucent grants all interested parties a non-exclusive license to use and distribute an unmodified copy of this Specification in connection with management of Alcatel-Lucent products, and without fee, provided this copyright notice and license appear on all copies. This Specification is supplied 'as is', and Alcatel-Lucent makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") tmnx_if_group_objs = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69)) tmnx_if_group_notify_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 3, 69)) tmnx_if_group_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69)) tmnx_if_group_config_time_stamps = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 0)) tmnx_if_group_configurations = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1)) tmnx_if_group_statistics = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 2)) tmnx_if_group_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 3, 69, 0)) tmnx_if_group_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 1)) tmnx_if_group_groups = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2)) class Tmnxifgrouphandlerindex(TextualConvention, Unsigned32): description = 'The TmnxIfGroupHandlerIndex specifies the unique Interface Group Handler Identifier for an Interface Group Handler. The value zero (0) is only used by objects that reference a tmnxIfGroupHandlerConfigEntry. The value zero (0) represents an invalid index that specifies the object is not associated with an Interface Group Handler.' status = 'current' class Tmnxifgroupprotocolindex(TextualConvention, Integer32): description = 'The TmnxIfGroupProtocolIndex specifies the protocol used by an Interface Group Handler or member. The TmnxIfGroupProtocolIndex is defined as an enumeration of the following protocols: ipcp (1) -- IP Control Protocol ipv6cp (2) -- IPV6 Control Protocol mplscp (3) -- MPLS Control Protocol osicp (4) -- OSI Control Protocol' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4)) named_values = named_values(('ipcp', 1), ('ipv6cp', 2), ('mplscp', 3), ('osicp', 4)) tmnx_if_grp_hndlr_cfg_tbl_last_changed = mib_scalar((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 0, 1), time_stamp()).setMaxAccess('readonly') if mibBuilder.loadTexts: tmnxIfGrpHndlrCfgTblLastChanged.setStatus('current') if mibBuilder.loadTexts: tmnxIfGrpHndlrCfgTblLastChanged.setDescription('The tmnxIfGrpHndlrCfgTblLastChanged indicates the time, since system startup, when a row in the tmnxIfGroupHandlerConfigTable last changed.') tmnx_if_group_handler_config_table = mib_table((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1)) if mibBuilder.loadTexts: tmnxIfGroupHandlerConfigTable.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerConfigTable.setDescription('The tmnxIfGroupHandlerConfigTable consists of the Interface Group Handler configuration information.') tmnx_if_group_handler_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1)).setIndexNames((0, 'TIMETRA-CHASSIS-MIB', 'tmnxChassisIndex'), (0, 'TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerIndex')) if mibBuilder.loadTexts: tmnxIfGroupHandlerConfigEntry.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerConfigEntry.setDescription('The tmnxIfGroupHandlerConfigEntry contains information pertaining to an individual Interface Group Handler. Rows in this table are created and destroyed using the tmnxIfGroupHandlerRowStatus object.') tmnx_if_group_handler_index = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1, 1), tmnx_if_group_handler_index().subtype(subtypeSpec=value_range_constraint(1, 4294967295))) if mibBuilder.loadTexts: tmnxIfGroupHandlerIndex.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerIndex.setDescription('The tmnxIfGroupHandlerIndex specifies the row index of the Interface Group Handler.') tmnx_if_group_handler_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1, 2), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: tmnxIfGroupHandlerRowStatus.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerRowStatus.setDescription('The tmnxIfGroupHandlerRowStatus controls the creation and deletion of row entries in the tmnxIfGroupHandlerConfigTable.') tmnx_if_group_handler_time_stamp = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1, 3), time_stamp()).setMaxAccess('readonly') if mibBuilder.loadTexts: tmnxIfGroupHandlerTimeStamp.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerTimeStamp.setDescription('The tmnxIfGroupHandlerTimeStamp indicates the time, since system startup, of the last change to this row.') tmnx_if_group_handler_threshold = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 8)).clone(1)).setMaxAccess('readcreate') if mibBuilder.loadTexts: tmnxIfGroupHandlerThreshold.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerThreshold.setDescription('The value of tmnxIfGroupHandlerThreshold specifies the minimum number of Interface Group Handler Members that have to be active before the Interface Group Handler can be brought operationally up.') tmnx_if_group_handler_admin_status = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 1, 1, 5), tmnx_admin_state().clone('outOfService')).setMaxAccess('readcreate') if mibBuilder.loadTexts: tmnxIfGroupHandlerAdminStatus.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerAdminStatus.setDescription('The value of tmnxIfGroupHandlerAdminStatus specifies the administrative state of the Interface Group Handler.') tmnx_if_group_handler_proto_table = mib_table((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2)) if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoTable.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoTable.setDescription('The tmnxIfGroupHandlerProtoTable consists of the operational status of the protocols per Interface Group Handler.') tmnx_if_group_handler_proto_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2, 1)).setIndexNames((0, 'TIMETRA-CHASSIS-MIB', 'tmnxChassisIndex'), (0, 'TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerIndex'), (0, 'TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrProtoIndex')) if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoEntry.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoEntry.setDescription("The tmnxIfGroupHandlerProtoEntry contains information pertaining to an individual Interface Group Handler's operational state. Rows in this table are created and destroyed by the system, and can not be created or deleted by SNMP SET operations. A row exists for every supported protocol for each Interface Group Handler entry.") tmnx_if_group_hdlr_proto_index = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2, 1, 1), tmnx_if_group_protocol_index()) if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoIndex.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoIndex.setDescription('The tmnxIfGroupHdlrProtoIndex specifies the protocol index for the entry.') tmnx_if_group_hdlr_proto_status = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('none', 0), ('blocked', 1), ('inhibited', 2), ('waiting', 3), ('pending', 4), ('up', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoStatus.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoStatus.setDescription("The tmnxIfGroupHdlrProtoStatus indicates the operational state of the protocol for the Interface Group Handler. The valid states are: none (0) -- Initializing state. All member within the group are in state 'none (0)' for the given tmnxIfGroupHdlrProtoIndex. blocked (1) -- Administratively disabled. inhibited (2) -- Administratively enabled but tmnxIfGroupHandlerThreshold is not met for enough links that have tmnxIfGroupHdlrMemberProtoStatus set to 'ready (2)'. waiting (3) -- Administratively enabled but tmnxIfGroupHandlerThreshold is not met for enough links that have tmnxIfGroupHdlrMemberProtoStatus set to 'operational (4)' or better. pending (4) -- Administratively enabled but tmnxIfGroupHandlerThreshold is not met for enough links that have tmnxIfGroupHdlrMemberProtoStatus set to 'up (5)'. up (5) -- Administratively enabled but tmnxIfGroupHandlerThreshold is met with enough links that have tmnxIfGroupHdlrMemberProtoStatus set to 'up (5)'.") tmnx_if_group_hdlr_proto_act_links = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2, 1, 3), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoActLinks.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoActLinks.setDescription("The tmnxIfGroupHdlrProtoActLinks indicates the number of Interface Group Handler members with tmnxIfGroupHdlrProtoStatus set to 'up' (5).") tmnx_if_group_hdlr_proto_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 2, 1, 4), unsigned32()).setUnits('seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoUpTime.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrProtoUpTime.setDescription("The tmnxIfGroupHdlrProtoUpTime object indicates the time since the Interface Group Handler entered the 'up (5)' state indicated by the tmnxIfGroupHdlrProtoStatus object") tmnx_if_grp_hndlr_mbr_tbl_last_changed = mib_scalar((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 0, 2), time_stamp()).setMaxAccess('readonly') if mibBuilder.loadTexts: tmnxIfGrpHndlrMbrTblLastChanged.setStatus('current') if mibBuilder.loadTexts: tmnxIfGrpHndlrMbrTblLastChanged.setDescription('The tmnxIfGrpHndlrMbrTblLastChanged indicates the time, since system startup, when a row in the tmnxIfGroupHandlerMemberTable last changed.') tmnx_if_group_handler_member_table = mib_table((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 3)) if mibBuilder.loadTexts: tmnxIfGroupHandlerMemberTable.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerMemberTable.setDescription('The tmnxIfGroupHandlerMemberTable consists of the members associated with the corresponding tmnxIfGroupHandlerConfigEntry.') tmnx_if_group_handler_member_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 3, 1)).setIndexNames((0, 'TIMETRA-CHASSIS-MIB', 'tmnxChassisIndex'), (0, 'TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerIndex'), (0, 'TIMETRA-PORT-MIB', 'tmnxPortPortID')) if mibBuilder.loadTexts: tmnxIfGroupHandlerMemberEntry.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerMemberEntry.setDescription('The tmnxIfGroupHandlerMemberEntry contains information pertaining to an individual member associated with a tmnxIfGroupHandlerConfigEntry. Rows in this table are created and destroyed using the tmnxIfGrpHandlerMemberRowStatus object.') tmnx_if_grp_handler_member_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 3, 1, 1), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: tmnxIfGrpHandlerMemberRowStatus.setStatus('current') if mibBuilder.loadTexts: tmnxIfGrpHandlerMemberRowStatus.setDescription('The tmnxIfGrpHandlerMemberRowStatus controls the creation and deletion of row entries in the tmnxIfGroupHandlerMemberTable.') tmnx_if_group_hdlr_member_proto_table = mib_table((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 4)) if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoTable.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoTable.setDescription('The tmnxIfGroupHdlrMemberProtoTable consists of the information pertaining to the protocols per Interface Group Handler member.') tmnx_if_group_hdlr_member_proto_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 4, 1)).setIndexNames((0, 'TIMETRA-CHASSIS-MIB', 'tmnxChassisIndex'), (0, 'TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerIndex'), (0, 'TIMETRA-PORT-MIB', 'tmnxPortPortID'), (0, 'TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrMemberProtoIndex')) if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoEntry.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoEntry.setDescription("The tmnxIfGroupHdlrMemberProtoEntry contains information pertaining to an individual Interface Group Handler's protocol information. Rows in this table are created and destroyed by the system, and can not be created or deleted by SNMP SET operations. A row exists for every supported protocol for each Interface Group Handler member entry.") tmnx_if_group_hdlr_member_proto_index = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 4, 1, 1), tmnx_if_group_protocol_index()) if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoIndex.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoIndex.setDescription('The tmnxIfGroupHdlrMemberProtoIndex specifies the protocol index for the entry.') tmnx_if_group_hdlr_member_proto_status = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 4, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('none', 0), ('down', 1), ('ready', 2), ('running', 3), ('operational', 4), ('up', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoStatus.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoStatus.setDescription("The tmnxIfGroupHdlrMemberProtoStatus indicates the operational state of the protocol for the Interface Group Handler member. Once a member has left the 'none (0)' state for a specific tmnxIfGroupHandlerIndex it will never return to the 'none (0)' state unless the member is removed from the group or an activity switch occurs, in which case, no state updates are required for the protocol and therefore the protocol is considered 'none (0)' once more. The valid states are: none (0) -- Initializing state. down (1) -- Not in a functional state. The object tmnxPortState is set to for this member is set to 'linkDown' or lower or this protocol is not configured properly. ready (2) -- Waiting for tmnxIfGroupHdlrMemberProtoStatus to be set to waiting or better to run this protocol. running (3) -- Protocol is running, but not operational. operational (4) -- Link is operational but we are waiting for tmnxIfGroupHdlrProtoStatus to be set to 'pending (4)' or better to leave this state. up (5) -- Protocol is decalared up.") tmnx_if_group_hdlr_member_proto_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 3, 1, 2, 69, 1, 4, 1, 3), unsigned32()).setUnits('seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoUpTime.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMemberProtoUpTime.setDescription("The tmnxIfGroupHdlrMemberProtoUpTime object indicates the time since the member is 'up' (5)' as indicated by the tmnxIfGroupHdlrProtoStatus object.") tmnx_if_group_handler_proto_opr_change = notification_type((1, 3, 6, 1, 4, 1, 6527, 3, 1, 3, 69, 0, 1)).setObjects(('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerThreshold'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerAdminStatus'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrProtoStatus'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrProtoActLinks')) if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoOprChange.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerProtoOprChange.setDescription("The tmnxIfGroupHandlerProtoOprChange notification indicates that the specified tmnxIfGroupHdlrProtoStatus has entered or left the 'up (5)' state.") tmnx_if_group_hdlr_mbr_proto_opr_change = notification_type((1, 3, 6, 1, 4, 1, 6527, 3, 1, 3, 69, 0, 2)).setObjects(('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrMemberProtoStatus')) if mibBuilder.loadTexts: tmnxIfGroupHdlrMbrProtoOprChange.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrMbrProtoOprChange.setDescription("The tmnxIfGroupHdlrMbrProtoOprChange notification indicates that the specified tmnxIfGroupHdlrMemberProtoStatus has entered or left the 'up (5)' state.") tmnx_if_group_handler_compliance = module_compliance((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 1, 1)).setObjects(('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerTimeStampGroup'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerConfigGroup'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerMemberGroup'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerProtocolGroup'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrNotificationGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnx_if_group_handler_compliance = tmnxIfGroupHandlerCompliance.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerCompliance.setDescription('The compliance statement for revision 1.0 of TIMETRA-IF-GROUP-HANDLER-MIB.') tmnx_if_group_handler_time_stamp_group = object_group((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2, 1)).setObjects(('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGrpHndlrCfgTblLastChanged'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerTimeStamp'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGrpHndlrMbrTblLastChanged')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnx_if_group_handler_time_stamp_group = tmnxIfGroupHandlerTimeStampGroup.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerTimeStampGroup.setDescription('The group of objects that track configuration changes for the maintenance of Interface Group Handler for the 7x50.') tmnx_if_group_handler_config_group = object_group((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2, 2)).setObjects(('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerRowStatus'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerThreshold'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerAdminStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnx_if_group_handler_config_group = tmnxIfGroupHandlerConfigGroup.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerConfigGroup.setDescription('The group of objects for management of Interface Group Handler configurations for the 7x50.') tmnx_if_group_handler_member_group = object_group((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2, 3)).setObjects(('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGrpHandlerMemberRowStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnx_if_group_handler_member_group = tmnxIfGroupHandlerMemberGroup.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerMemberGroup.setDescription('The group of objects for management of Interface Group Handler Member configurations for the 7x50.') tmnx_if_group_handler_protocol_group = object_group((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2, 4)).setObjects(('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrMemberProtoStatus'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrMemberProtoUpTime'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrProtoStatus'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrProtoActLinks'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrProtoUpTime')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnx_if_group_handler_protocol_group = tmnxIfGroupHandlerProtocolGroup.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHandlerProtocolGroup.setDescription('The group of objects for management of Interface Group Handler protocol configurations for the 7x50.') tmnx_if_group_hdlr_notification_group = notification_group((1, 3, 6, 1, 4, 1, 6527, 3, 1, 1, 69, 2, 5)).setObjects(('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHandlerProtoOprChange'), ('TIMETRA-IF-GROUP-HANDLER-MIB', 'tmnxIfGroupHdlrMbrProtoOprChange')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): tmnx_if_group_hdlr_notification_group = tmnxIfGroupHdlrNotificationGroup.setStatus('current') if mibBuilder.loadTexts: tmnxIfGroupHdlrNotificationGroup.setDescription('The tmnxIfGroupHdlrNotificationGroup consists of the notifications for generating events for Interface Group Handlers for the 7x50.') mibBuilder.exportSymbols('TIMETRA-IF-GROUP-HANDLER-MIB', tmnxIfGroupHandlerRowStatus=tmnxIfGroupHandlerRowStatus, tmnxIfGroupHdlrProtoIndex=tmnxIfGroupHdlrProtoIndex, tmnxIfGroupHdlrMemberProtoUpTime=tmnxIfGroupHdlrMemberProtoUpTime, tmnxIfGroupHdlrMbrProtoOprChange=tmnxIfGroupHdlrMbrProtoOprChange, tmnxIfGroupHandlerTimeStampGroup=tmnxIfGroupHandlerTimeStampGroup, tmnxIfGroupHandlerProtocolGroup=tmnxIfGroupHandlerProtocolGroup, tmnxIfGroupConformance=tmnxIfGroupConformance, tmnxIfGroupHandlerProtoEntry=tmnxIfGroupHandlerProtoEntry, tmnxIfGroupNotifyPrefix=tmnxIfGroupNotifyPrefix, tmnxIfGroupCompliances=tmnxIfGroupCompliances, tmnxIfGrpHandlerMemberRowStatus=tmnxIfGrpHandlerMemberRowStatus, tmnxIfGroupHandlerMemberGroup=tmnxIfGroupHandlerMemberGroup, tmnxIfGroupConfigTimeStamps=tmnxIfGroupConfigTimeStamps, tmnxIfGroupHandlerProtoOprChange=tmnxIfGroupHandlerProtoOprChange, tmnxIfGrpHndlrCfgTblLastChanged=tmnxIfGrpHndlrCfgTblLastChanged, tmnxIfGroupNotifications=tmnxIfGroupNotifications, tmnxIfGroupHdlrProtoUpTime=tmnxIfGroupHdlrProtoUpTime, tmnxIfGroupHandlerConfigEntry=tmnxIfGroupHandlerConfigEntry, tmnxIfGroupHdlrMemberProtoEntry=tmnxIfGroupHdlrMemberProtoEntry, tmnxIfGroupHdlrProtoStatus=tmnxIfGroupHdlrProtoStatus, tmnxIfGroupHandlerProtoTable=tmnxIfGroupHandlerProtoTable, tmnxIfGroupHandlerCompliance=tmnxIfGroupHandlerCompliance, tmnxIfGroupHdlrMemberProtoIndex=tmnxIfGroupHdlrMemberProtoIndex, tmnxIfGroupStatistics=tmnxIfGroupStatistics, TmnxIfGroupHandlerIndex=TmnxIfGroupHandlerIndex, tmnxIfGroupHandlerConfigGroup=tmnxIfGroupHandlerConfigGroup, tmnxIfGroupHdlrMemberProtoTable=tmnxIfGroupHdlrMemberProtoTable, tmnxIfGroupHandlerTimeStamp=tmnxIfGroupHandlerTimeStamp, tmnxIfGroupHdlrProtoActLinks=tmnxIfGroupHdlrProtoActLinks, tmnxIfGroupHandlerConfigTable=tmnxIfGroupHandlerConfigTable, TmnxIfGroupProtocolIndex=TmnxIfGroupProtocolIndex, tmnxIfGroupHdlrNotificationGroup=tmnxIfGroupHdlrNotificationGroup, tmnxIfGroupObjs=tmnxIfGroupObjs, tmnxIfGroupHandlerIndex=tmnxIfGroupHandlerIndex, tmnxIfGroupHandlerThreshold=tmnxIfGroupHandlerThreshold, tmnxIfGroupHandlerAdminStatus=tmnxIfGroupHandlerAdminStatus, tmnxIfGroupHandlerMemberEntry=tmnxIfGroupHandlerMemberEntry, tmnxIfGroupConfigurations=tmnxIfGroupConfigurations, tmnxIfGrpHndlrMbrTblLastChanged=tmnxIfGrpHndlrMbrTblLastChanged, timetraIfGroupMIBModule=timetraIfGroupMIBModule, tmnxIfGroupHdlrMemberProtoStatus=tmnxIfGroupHdlrMemberProtoStatus, PYSNMP_MODULE_ID=timetraIfGroupMIBModule, tmnxIfGroupGroups=tmnxIfGroupGroups, tmnxIfGroupHandlerMemberTable=tmnxIfGroupHandlerMemberTable)
async def create_table(database): conn = await database.get_connection() await conn.execute( """ CREATE TABLE IF NOT EXISTS users( id serial PRIMARY KEY, name text, dob date ) """ ) await conn.close() return True async def drop_table(database): conn = await database.get_connection() await conn.execute( """ DROP TABLE users """ ) await conn.close() return True
async def create_table(database): conn = await database.get_connection() await conn.execute('\n CREATE TABLE IF NOT EXISTS users(\n id serial PRIMARY KEY,\n name text,\n dob date\n )\n ') await conn.close() return True async def drop_table(database): conn = await database.get_connection() await conn.execute('\n DROP TABLE users\n ') await conn.close() return True
class JobResult(): def __init__(self, job, build_number, status): self.job = job self.build_number = int(build_number) self.status = status def __repr__(self): return "job: %s, build number: %s, status: %s" % (self.job, self.build_number, self.status)
class Jobresult: def __init__(self, job, build_number, status): self.job = job self.build_number = int(build_number) self.status = status def __repr__(self): return 'job: %s, build number: %s, status: %s' % (self.job, self.build_number, self.status)
# Please refer to sanitizers.gni for detail. load("@cc//:compiler.bzl", "is_linux", "is_x64") load("//third_party/chromium/build/config:buildconfig.bzl", "IS_OFFICIAL_BUILD") IS_HWASAN = False IS_CFI = is_linux() and is_x64() USE_CFI_CAST = False USE_CFI_ICALL = is_linux() and is_x64() and IS_OFFICIAL_BUILD USE_CFI_DIAG = False USE_CFI_RECOVER = False USING_SANITIZER = IS_HWASAN or USE_CFI_DIAG # and more
load('@cc//:compiler.bzl', 'is_linux', 'is_x64') load('//third_party/chromium/build/config:buildconfig.bzl', 'IS_OFFICIAL_BUILD') is_hwasan = False is_cfi = is_linux() and is_x64() use_cfi_cast = False use_cfi_icall = is_linux() and is_x64() and IS_OFFICIAL_BUILD use_cfi_diag = False use_cfi_recover = False using_sanitizer = IS_HWASAN or USE_CFI_DIAG