content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
COLLECTION = "user" blog_collection = "blogs" blogs_comments = "comments" Activities ="requests"
collection = 'user' blog_collection = 'blogs' blogs_comments = 'comments' activities = 'requests'
array = [116, 176382, 94, 325, 3476, 4, 2542, 9, 21, 56, 322, 322] print(array) def insertion(array, g): for i in range(g, len(array)): v = array[i] j = i-g while j >= 0 and array[j] > v: array[j + g] = array[j] j = j - g array[j+g] = v def shellsort(array): G = [1, 4, 13, 40, 121] for i in G[::-1]: insertion(array, i) shellsort(array) print(array)
array = [116, 176382, 94, 325, 3476, 4, 2542, 9, 21, 56, 322, 322] print(array) def insertion(array, g): for i in range(g, len(array)): v = array[i] j = i - g while j >= 0 and array[j] > v: array[j + g] = array[j] j = j - g array[j + g] = v def shellsort(array): g = [1, 4, 13, 40, 121] for i in G[::-1]: insertion(array, i) shellsort(array) print(array)
class A: def foo(self): print('a') class B: def foo(self): print('b') class C: def foo(self): print('c') class D: def foo2(self): print('d') class E(A, B, C): def __init__(self): super() class F(D, C, B): def __init__(self): super() class G(A, B, C): def foo(self): super(G, self).foo() e = E() e.foo() f = F() f.foo() g = G() g.foo()
class A: def foo(self): print('a') class B: def foo(self): print('b') class C: def foo(self): print('c') class D: def foo2(self): print('d') class E(A, B, C): def __init__(self): super() class F(D, C, B): def __init__(self): super() class G(A, B, C): def foo(self): super(G, self).foo() e = e() e.foo() f = f() f.foo() g = g() g.foo()
print("Wellcome to the Multiplication/Exponent Tabel App\n") name = str(input("What is your name: ")).title() number = float(input("What number would you like to work with: ")) print(f"\nMultiplication Table For {number}\n") print(f"\t1.0 * {number} = {number * 1}") print(f"\t2.0 * {number} = {number * 2}") print(f"\t3.0 * {number} = {number * 3}") print(f"\t4.0 * {number} = {number * 4}") print(f"\t5.0 * {number} = {number * 5}") print(f"\t6.0 * {number} = {number * 6}") print(f"\t7.0 * {number} = {number * 7}") print(f"\t8.0 * {number} = {number * 8}") print(f"\t9.0 * {number} = {number * 9}") print(f"\nExponent Table For {number}\n") print(f"\t{number} ** 1 = {number ** 1}") print(f"\t{number} ** 2 = {number ** 2}") print(f"\t{number} ** 3 = {number ** 3}") print(f"\t{number} ** 4 = {number ** 4}") print(f"\t{number} ** 5 = {number ** 5}") print(f"\t{number} ** 6 = {number ** 6}") print(f"\t{number} ** 7 = {number ** 7}") print(f"\t{number} ** 8 = {number ** 8}") print(f"\t{number} ** 9 = {number ** 9}") print(f"\n{name} Math is cool!") print(f"\t{name.lower()} math is cool!") print(f"\t\t{name} Math Is Cool!") print(f"\t\t\t{name.upper()} MATH IS COOL!")
print('Wellcome to the Multiplication/Exponent Tabel App\n') name = str(input('What is your name: ')).title() number = float(input('What number would you like to work with: ')) print(f'\nMultiplication Table For {number}\n') print(f'\t1.0 * {number} = {number * 1}') print(f'\t2.0 * {number} = {number * 2}') print(f'\t3.0 * {number} = {number * 3}') print(f'\t4.0 * {number} = {number * 4}') print(f'\t5.0 * {number} = {number * 5}') print(f'\t6.0 * {number} = {number * 6}') print(f'\t7.0 * {number} = {number * 7}') print(f'\t8.0 * {number} = {number * 8}') print(f'\t9.0 * {number} = {number * 9}') print(f'\nExponent Table For {number}\n') print(f'\t{number} ** 1 = {number ** 1}') print(f'\t{number} ** 2 = {number ** 2}') print(f'\t{number} ** 3 = {number ** 3}') print(f'\t{number} ** 4 = {number ** 4}') print(f'\t{number} ** 5 = {number ** 5}') print(f'\t{number} ** 6 = {number ** 6}') print(f'\t{number} ** 7 = {number ** 7}') print(f'\t{number} ** 8 = {number ** 8}') print(f'\t{number} ** 9 = {number ** 9}') print(f'\n{name} Math is cool!') print(f'\t{name.lower()} math is cool!') print(f'\t\t{name} Math Is Cool!') print(f'\t\t\t{name.upper()} MATH IS COOL!')
n = 6 a = [0] * n result = [] def recur(s, n, was, result): if len(s) == n: result.append(s) return for i in range(0, n): if was[i] == 0: was[i] = 1 recur(s + str(i + 1), n, was, result) was[i] = 0 recur("", n, a, result) print(result)
n = 6 a = [0] * n result = [] def recur(s, n, was, result): if len(s) == n: result.append(s) return for i in range(0, n): if was[i] == 0: was[i] = 1 recur(s + str(i + 1), n, was, result) was[i] = 0 recur('', n, a, result) print(result)
def calculate_price_change(curr_state: dict, new_state: dict): curr_price = curr_state["coinbase_btcusd_close"] next_price = new_state["coinbase_btcusd_close"] return curr_price - next_price def buy(curr_state: dict, prev_interps, new_state: dict, new_interps): return calculate_price_change(curr_state=curr_state, new_state=new_state) def sell(curr_state: dict, prev_interps, new_state: dict, new_interps): return -calculate_price_change(curr_state=curr_state, new_state=new_state) def hold(curr_state: dict, prev_interps, new_state: dict, new_interps): return -0.1
def calculate_price_change(curr_state: dict, new_state: dict): curr_price = curr_state['coinbase_btcusd_close'] next_price = new_state['coinbase_btcusd_close'] return curr_price - next_price def buy(curr_state: dict, prev_interps, new_state: dict, new_interps): return calculate_price_change(curr_state=curr_state, new_state=new_state) def sell(curr_state: dict, prev_interps, new_state: dict, new_interps): return -calculate_price_change(curr_state=curr_state, new_state=new_state) def hold(curr_state: dict, prev_interps, new_state: dict, new_interps): return -0.1
#!/usr/bin/env python # -*- coding: utf-8 -*- # Artificially cap how fast we can launch our probe. # Select this value carefully, or else we might lose valid # shot selections. MAX_Y_VELOCITY = 1000 def tick(pos, vel): # On each step, these changes occur in the following order: # # The probe's x position increases by its x velocity. # The probe's y position increases by its y velocity. pos = (pos[0] + vel[0], pos[1] + vel[1]) # Due to drag, the probe's x velocity changes by 1 toward the value 0; # that is, it decreases by 1 if it is greater than 0, increases by 1 if it is less than 0, # or does not change if it is already 0. if vel[0] > 0: vel = (vel[0] - 1, vel[1]) elif vel[0] < 0: vel = (vel[0] + 1, vel[1]) # Due to gravity, the probe's y velocity decreases by 1. vel = (vel[0], vel[1] - 1) return (pos, vel) # Parse the transmission packets file with open('day17_input.txt') as f: for line in f: (x, y) = line.split('target area: x=')[1:][0].split(', y=') (x_min, x_max) = [int(n) for n in x.split('..')] (y_min, y_max) = [int(n) for n in y.split('..')] # Find the initial velocity that causes the probe to reach the highest y position # and still eventually be within the target area after any step. What is the highest # y position it reaches on this trajectory? apogee_max = 0 apogee_max_y_vel = 0 # Only consider Y velocity. No need to care about X yet. for initial_y_vel in range(MAX_Y_VELOCITY): pos = (0, 0) vel = (0, initial_y_vel) apogee = 0 while pos[1] >= y_min: (pos, vel) = tick(pos, vel) apogee = max(apogee, pos[1]) if pos[1] >= y_min and pos[1] <= y_max: # Match! if apogee > apogee_max: apogee_max = apogee apogee_max_y_vel = initial_y_vel print('Part One: best apogee was {0}.'.format(apogee_max)) # Maybe a fancy trick shot isn't the best idea; after all, you only have one probe, # so you had better not miss. # # To get the best idea of what your options are for launching the probe, you need to find # every initial velocity that causes the probe to eventually be within the target area after any step. hits = set() # Cut down the range of test values by being a little clever: # Any X velocity too low will never hit the target. if x_min < 0: search_x_min = x_min else: search_x_min = 0 # Any X velocity that puts us past the target area after only one tick, is too high. if x_max < 0: search_x_max = 0 else: search_x_max = x_max # Any Y velocity that puts us past the target area after only one tick, is too low. # Any Y velocity higher than the one that helped us in Part One, is too high. search_y_min = y_min search_y_max = apogee_max_y_vel for initial_x_vel in range(search_x_min, search_x_max + 1): for initial_y_vel in range(search_y_min, search_y_max + 1): pos = (0, 0) vel = (initial_x_vel, initial_y_vel) while pos[1] >= y_min: (pos, vel) = tick(pos, vel) if pos[0] >= x_min and pos[0] <= x_max and pos[1] >= y_min and pos[1] <= y_max: # Match! hits.add((initial_x_vel, initial_y_vel)) print('Part Two: there were {0} distinct initial velocity values that landed in the target area.'.format(len(hits)))
max_y_velocity = 1000 def tick(pos, vel): pos = (pos[0] + vel[0], pos[1] + vel[1]) if vel[0] > 0: vel = (vel[0] - 1, vel[1]) elif vel[0] < 0: vel = (vel[0] + 1, vel[1]) vel = (vel[0], vel[1] - 1) return (pos, vel) with open('day17_input.txt') as f: for line in f: (x, y) = line.split('target area: x=')[1:][0].split(', y=') (x_min, x_max) = [int(n) for n in x.split('..')] (y_min, y_max) = [int(n) for n in y.split('..')] apogee_max = 0 apogee_max_y_vel = 0 for initial_y_vel in range(MAX_Y_VELOCITY): pos = (0, 0) vel = (0, initial_y_vel) apogee = 0 while pos[1] >= y_min: (pos, vel) = tick(pos, vel) apogee = max(apogee, pos[1]) if pos[1] >= y_min and pos[1] <= y_max: if apogee > apogee_max: apogee_max = apogee apogee_max_y_vel = initial_y_vel print('Part One: best apogee was {0}.'.format(apogee_max)) hits = set() if x_min < 0: search_x_min = x_min else: search_x_min = 0 if x_max < 0: search_x_max = 0 else: search_x_max = x_max search_y_min = y_min search_y_max = apogee_max_y_vel for initial_x_vel in range(search_x_min, search_x_max + 1): for initial_y_vel in range(search_y_min, search_y_max + 1): pos = (0, 0) vel = (initial_x_vel, initial_y_vel) while pos[1] >= y_min: (pos, vel) = tick(pos, vel) if pos[0] >= x_min and pos[0] <= x_max and (pos[1] >= y_min) and (pos[1] <= y_max): hits.add((initial_x_vel, initial_y_vel)) print('Part Two: there were {0} distinct initial velocity values that landed in the target area.'.format(len(hits)))
# -*- coding: utf-8 -*- class ClassifyBar: def polarity(self,a,b): return a <= b pass class RetrieveData: def init(): pass class FormatData: def init(): pass class ConsolidateBar: def init(): pass # Test Class for Simple Calculator functions to understand TDD/BDD class SimpleCalculator: def add(self,*args): return sum(args) pass def subtract(self,a,b,c=0): return a-b-c pass
class Classifybar: def polarity(self, a, b): return a <= b pass class Retrievedata: def init(): pass class Formatdata: def init(): pass class Consolidatebar: def init(): pass class Simplecalculator: def add(self, *args): return sum(args) pass def subtract(self, a, b, c=0): return a - b - c pass
# # PySNMP MIB module A3COM-HUAWEI-IPV6-ADDRESS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-HUAWEI-IPV6-ADDRESS-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:05:25 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # h3cCommon, = mibBuilder.importSymbols("A3COM-HUAWEI-OID-MIB", "h3cCommon") Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint") InetAddress, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Counter32, Integer32, Counter64, TimeTicks, Gauge32, iso, Bits, ObjectIdentity, Unsigned32, MibIdentifier, ModuleIdentity, NotificationType, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Integer32", "Counter64", "TimeTicks", "Gauge32", "iso", "Bits", "ObjectIdentity", "Unsigned32", "MibIdentifier", "ModuleIdentity", "NotificationType", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") TextualConvention, DisplayString, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus") h3cIpv6AddrMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71)) h3cIpv6AddrMIB.setRevisions(('2006-03-15 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: h3cIpv6AddrMIB.setRevisionsDescriptions(('The initial revision of this MIB module.',)) if mibBuilder.loadTexts: h3cIpv6AddrMIB.setLastUpdated('200603150000Z') if mibBuilder.loadTexts: h3cIpv6AddrMIB.setOrganization('Huawei 3Com Technologies Co., Ltd.') if mibBuilder.loadTexts: h3cIpv6AddrMIB.setContactInfo('Platform Team Huawei 3Com Technologies Co., Ltd. HaiDian District Beijing P.R. China http://www.huawei-3com.com Zip:100085') if mibBuilder.loadTexts: h3cIpv6AddrMIB.setDescription('The MIB module for managing IPv6 address') h3cIpv6AddressObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1)) h3cIpv6AddressConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1)) h3cIpv6AddrSetTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1), ) if mibBuilder.loadTexts: h3cIpv6AddrSetTable.setReference('RFC 2456') if mibBuilder.loadTexts: h3cIpv6AddrSetTable.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetTable.setDescription("The table of address information is relevant to this entity's IPv6 addresses for setting. The address information that can be read and set in this table is a subset of the address information that can be read in h3cIpv6AddrReadTable and ipv6AddrTable in IPV6-MIB. This table is used to configure IPv6 addresses of an interface identified by h3cIpv6AddrSetIfIndex. When users create or delete an entry in this table, the agent also increases or reduces a corresponding entry in the h3cIpv6AddrReadTable and ipv6AddrTable in IPV6-MIB. When an interface which has been assigned IPv6 address is deleted, the agent also deletes the entry corresponding to the interface in this table and h3cIpv6AddrReadTable. All IPv6 addresses in this table will also show in ipv6AddrTable in IPV6-MIB.") h3cIpv6AddrSetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1), ).setIndexNames((0, "A3COM-HUAWEI-IPV6-ADDRESS-MIB", "h3cIpv6AddrSetIfIndex"), (0, "A3COM-HUAWEI-IPV6-ADDRESS-MIB", "h3cIpv6AddrSetAddrType"), (0, "A3COM-HUAWEI-IPV6-ADDRESS-MIB", "h3cIpv6AddrSetAddr")) if mibBuilder.loadTexts: h3cIpv6AddrSetEntry.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetEntry.setDescription('Define the IPv6 address information.') h3cIpv6AddrSetIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: h3cIpv6AddrSetIfIndex.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetIfIndex.setDescription("The index value which uniquely identifies the interface to which this entry is applicable. The interface identified by a particular value of this index is the same interface as identified by the same value of RFC 1573's ifIndex.") h3cIpv6AddrSetAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 2), InetAddressType()) if mibBuilder.loadTexts: h3cIpv6AddrSetAddrType.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetAddrType.setDescription("The IP address type to which this entry's address information pertains. The value must be ipv6.") h3cIpv6AddrSetAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 3), InetAddress()) if mibBuilder.loadTexts: h3cIpv6AddrSetAddr.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetAddr.setDescription("The IPv6 address to which this entry's address information pertains.") h3cIpv6AddrSetPfxLength = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readcreate") if mibBuilder.loadTexts: h3cIpv6AddrSetPfxLength.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetPfxLength.setDescription('The length of the prefix (in bits) associated with the IPv6 address of this entry.') h3cIpv6AddrSetSourceType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("assignedIp", 1), ("assignedEUI64Ip", 2), ("assignedLinklocalIp", 3)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: h3cIpv6AddrSetSourceType.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetSourceType.setDescription("Indicate the type of source of IPv6 address. The value can be one of following: 'assignedIp': Assigned global/site-local IPv6 address; 'assignedEUI64Ip': Assigned global/site-local IPv6 address by using EUI-64 interface identifier; 'assignedLinklocalIp': Assigned link-local IPv6 address. The value of h3cIpv6AddrSetSourceType is relevant to h3cIpv6AddrReadSourceType and h3cIpv6AddrReadCatalog . For example, if the value of h3cIpv6AddrSetSourceType is set to 'assignedIp', then the value of h3cIpv6AddrReadSourceType is 'assignedIp' and the value of h3cIpv6AddrReadCatalog is 'global' or 'sitelocal'. The relation listed in the following table. ---------------------------------------------------------------- h3cIpv6Addr- | h3cIpv6Addr- | h3cIpv6Addr- SetSourceType | ReadSourceType | ReadCatalog ---------------------------------------------------------------- assignedIp | assignedIp | global or sitelocal ---------------------------------------------------------------- assignedEUI64Ip | assignedIp | global or sitelocal ---------------------------------------------------------------- assignedLinklocalIp | assignedIp | linklocal ---------------------------------------------------------------- ") h3cIpv6AddrSetRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: h3cIpv6AddrSetRowStatus.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetRowStatus.setDescription('This object is used to create a new row or delete an existing row in this table, only supports active(1), createAndGo(4) and destroy(6).') h3cIpv6AddrReadTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2), ) if mibBuilder.loadTexts: h3cIpv6AddrReadTable.setReference('RFC 2456') if mibBuilder.loadTexts: h3cIpv6AddrReadTable.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadTable.setDescription("The table of address information is relevant to this entity's IPv6 addresses for reading. This is the extension of the ipv6AddrTable in IPV6-MIB. All IPv6 addresses in this table will also show in ipv6AddrTable in IPV6-MIB.") h3cIpv6AddrReadEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1), ).setIndexNames((0, "A3COM-HUAWEI-IPV6-ADDRESS-MIB", "h3cIpv6AddrReadIfIndex"), (0, "A3COM-HUAWEI-IPV6-ADDRESS-MIB", "h3cIpv6AddrReadAddrType"), (0, "A3COM-HUAWEI-IPV6-ADDRESS-MIB", "h3cIpv6AddrReadAddr")) if mibBuilder.loadTexts: h3cIpv6AddrReadEntry.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadEntry.setDescription('Define the IPv6 address information.') h3cIpv6AddrReadIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: h3cIpv6AddrReadIfIndex.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadIfIndex.setDescription("The index value which uniquely identifies the interface to which this entry is applicable. The interface identified by a particular value of this index is the same interface as identified by the same value of RFC 1573's ifIndex.") h3cIpv6AddrReadAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 2), InetAddressType()) if mibBuilder.loadTexts: h3cIpv6AddrReadAddrType.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadAddrType.setDescription("The IP address type to which this entry's address information pertains. The value must be ipv6.") h3cIpv6AddrReadAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 3), InetAddress()) if mibBuilder.loadTexts: h3cIpv6AddrReadAddr.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadAddr.setDescription("The IPv6 address to which this entry's address information pertains.") h3cIpv6AddrReadPfxLength = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: h3cIpv6AddrReadPfxLength.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadPfxLength.setDescription('The length of the prefix (in bits) associated with the IPv6 address of this entry.') h3cIpv6AddrReadSourceType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("assignedIp", 1), ("assignedEUI64Ip", 2), ("assignedAutoIp", 3), ("autoIp", 4), ("dhcpv6", 5), ("negotiate", 6), ("cluster", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: h3cIpv6AddrReadSourceType.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadSourceType.setDescription("Indicate the type of source of IPv6 address. The value can be one of following: 'assignedIp': Assigned IPv6 address; 'assignedEUI64Ip': Assigned IPv6 address by using EUI-64 interface identifier; 'assignedAutoIp': Auto generated IPv6 address by user setting; 'autoIp': Auto generated IPv6 address as a result of non-linklocal anycast/unicast address configuration; 'dhcpv6': Assigned IPv6 address through DHCPv6 protocol; 'negotiate': Assigned IPv6 address through negotiation; 'cluster': Assigned IPv6 address through cluster module.") h3cIpv6AddrReadCatalog = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("nodelocal", 1), ("linklocal", 2), ("sitelocal", 3), ("orglocal", 4), ("global", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: h3cIpv6AddrReadCatalog.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadCatalog.setDescription("Indicate the category of the IPv6 address. The value can be one of following: 'nodelocal': node-local scope; 'linklocal': link-local scope; 'sitelocal': site-local scope; 'orglocal': organization-local scope; 'global': global scope. ") mibBuilder.exportSymbols("A3COM-HUAWEI-IPV6-ADDRESS-MIB", h3cIpv6AddrReadTable=h3cIpv6AddrReadTable, h3cIpv6AddrSetSourceType=h3cIpv6AddrSetSourceType, h3cIpv6AddrSetPfxLength=h3cIpv6AddrSetPfxLength, h3cIpv6AddressConfig=h3cIpv6AddressConfig, h3cIpv6AddrReadCatalog=h3cIpv6AddrReadCatalog, h3cIpv6AddrReadAddr=h3cIpv6AddrReadAddr, h3cIpv6AddrReadEntry=h3cIpv6AddrReadEntry, h3cIpv6AddrSetRowStatus=h3cIpv6AddrSetRowStatus, h3cIpv6AddressObjects=h3cIpv6AddressObjects, h3cIpv6AddrReadSourceType=h3cIpv6AddrReadSourceType, PYSNMP_MODULE_ID=h3cIpv6AddrMIB, h3cIpv6AddrSetEntry=h3cIpv6AddrSetEntry, h3cIpv6AddrSetAddr=h3cIpv6AddrSetAddr, h3cIpv6AddrReadAddrType=h3cIpv6AddrReadAddrType, h3cIpv6AddrMIB=h3cIpv6AddrMIB, h3cIpv6AddrSetAddrType=h3cIpv6AddrSetAddrType, h3cIpv6AddrSetIfIndex=h3cIpv6AddrSetIfIndex, h3cIpv6AddrSetTable=h3cIpv6AddrSetTable, h3cIpv6AddrReadPfxLength=h3cIpv6AddrReadPfxLength, h3cIpv6AddrReadIfIndex=h3cIpv6AddrReadIfIndex)
(h3c_common,) = mibBuilder.importSymbols('A3COM-HUAWEI-OID-MIB', 'h3cCommon') (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, single_value_constraint, constraints_union, constraints_intersection, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'ValueSizeConstraint') (inet_address, inet_address_type) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddress', 'InetAddressType') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (counter32, integer32, counter64, time_ticks, gauge32, iso, bits, object_identity, unsigned32, mib_identifier, module_identity, notification_type, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'Integer32', 'Counter64', 'TimeTicks', 'Gauge32', 'iso', 'Bits', 'ObjectIdentity', 'Unsigned32', 'MibIdentifier', 'ModuleIdentity', 'NotificationType', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn') (textual_convention, display_string, row_status) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'RowStatus') h3c_ipv6_addr_mib = module_identity((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71)) h3cIpv6AddrMIB.setRevisions(('2006-03-15 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: h3cIpv6AddrMIB.setRevisionsDescriptions(('The initial revision of this MIB module.',)) if mibBuilder.loadTexts: h3cIpv6AddrMIB.setLastUpdated('200603150000Z') if mibBuilder.loadTexts: h3cIpv6AddrMIB.setOrganization('Huawei 3Com Technologies Co., Ltd.') if mibBuilder.loadTexts: h3cIpv6AddrMIB.setContactInfo('Platform Team Huawei 3Com Technologies Co., Ltd. HaiDian District Beijing P.R. China http://www.huawei-3com.com Zip:100085') if mibBuilder.loadTexts: h3cIpv6AddrMIB.setDescription('The MIB module for managing IPv6 address') h3c_ipv6_address_objects = mib_identifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1)) h3c_ipv6_address_config = mib_identifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1)) h3c_ipv6_addr_set_table = mib_table((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1)) if mibBuilder.loadTexts: h3cIpv6AddrSetTable.setReference('RFC 2456') if mibBuilder.loadTexts: h3cIpv6AddrSetTable.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetTable.setDescription("The table of address information is relevant to this entity's IPv6 addresses for setting. The address information that can be read and set in this table is a subset of the address information that can be read in h3cIpv6AddrReadTable and ipv6AddrTable in IPV6-MIB. This table is used to configure IPv6 addresses of an interface identified by h3cIpv6AddrSetIfIndex. When users create or delete an entry in this table, the agent also increases or reduces a corresponding entry in the h3cIpv6AddrReadTable and ipv6AddrTable in IPV6-MIB. When an interface which has been assigned IPv6 address is deleted, the agent also deletes the entry corresponding to the interface in this table and h3cIpv6AddrReadTable. All IPv6 addresses in this table will also show in ipv6AddrTable in IPV6-MIB.") h3c_ipv6_addr_set_entry = mib_table_row((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1)).setIndexNames((0, 'A3COM-HUAWEI-IPV6-ADDRESS-MIB', 'h3cIpv6AddrSetIfIndex'), (0, 'A3COM-HUAWEI-IPV6-ADDRESS-MIB', 'h3cIpv6AddrSetAddrType'), (0, 'A3COM-HUAWEI-IPV6-ADDRESS-MIB', 'h3cIpv6AddrSetAddr')) if mibBuilder.loadTexts: h3cIpv6AddrSetEntry.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetEntry.setDescription('Define the IPv6 address information.') h3c_ipv6_addr_set_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))) if mibBuilder.loadTexts: h3cIpv6AddrSetIfIndex.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetIfIndex.setDescription("The index value which uniquely identifies the interface to which this entry is applicable. The interface identified by a particular value of this index is the same interface as identified by the same value of RFC 1573's ifIndex.") h3c_ipv6_addr_set_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 2), inet_address_type()) if mibBuilder.loadTexts: h3cIpv6AddrSetAddrType.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetAddrType.setDescription("The IP address type to which this entry's address information pertains. The value must be ipv6.") h3c_ipv6_addr_set_addr = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 3), inet_address()) if mibBuilder.loadTexts: h3cIpv6AddrSetAddr.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetAddr.setDescription("The IPv6 address to which this entry's address information pertains.") h3c_ipv6_addr_set_pfx_length = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 128))).setMaxAccess('readcreate') if mibBuilder.loadTexts: h3cIpv6AddrSetPfxLength.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetPfxLength.setDescription('The length of the prefix (in bits) associated with the IPv6 address of this entry.') h3c_ipv6_addr_set_source_type = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('assignedIp', 1), ('assignedEUI64Ip', 2), ('assignedLinklocalIp', 3)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: h3cIpv6AddrSetSourceType.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetSourceType.setDescription("Indicate the type of source of IPv6 address. The value can be one of following: 'assignedIp': Assigned global/site-local IPv6 address; 'assignedEUI64Ip': Assigned global/site-local IPv6 address by using EUI-64 interface identifier; 'assignedLinklocalIp': Assigned link-local IPv6 address. The value of h3cIpv6AddrSetSourceType is relevant to h3cIpv6AddrReadSourceType and h3cIpv6AddrReadCatalog . For example, if the value of h3cIpv6AddrSetSourceType is set to 'assignedIp', then the value of h3cIpv6AddrReadSourceType is 'assignedIp' and the value of h3cIpv6AddrReadCatalog is 'global' or 'sitelocal'. The relation listed in the following table. ---------------------------------------------------------------- h3cIpv6Addr- | h3cIpv6Addr- | h3cIpv6Addr- SetSourceType | ReadSourceType | ReadCatalog ---------------------------------------------------------------- assignedIp | assignedIp | global or sitelocal ---------------------------------------------------------------- assignedEUI64Ip | assignedIp | global or sitelocal ---------------------------------------------------------------- assignedLinklocalIp | assignedIp | linklocal ---------------------------------------------------------------- ") h3c_ipv6_addr_set_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 1, 1, 6), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: h3cIpv6AddrSetRowStatus.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrSetRowStatus.setDescription('This object is used to create a new row or delete an existing row in this table, only supports active(1), createAndGo(4) and destroy(6).') h3c_ipv6_addr_read_table = mib_table((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2)) if mibBuilder.loadTexts: h3cIpv6AddrReadTable.setReference('RFC 2456') if mibBuilder.loadTexts: h3cIpv6AddrReadTable.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadTable.setDescription("The table of address information is relevant to this entity's IPv6 addresses for reading. This is the extension of the ipv6AddrTable in IPV6-MIB. All IPv6 addresses in this table will also show in ipv6AddrTable in IPV6-MIB.") h3c_ipv6_addr_read_entry = mib_table_row((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1)).setIndexNames((0, 'A3COM-HUAWEI-IPV6-ADDRESS-MIB', 'h3cIpv6AddrReadIfIndex'), (0, 'A3COM-HUAWEI-IPV6-ADDRESS-MIB', 'h3cIpv6AddrReadAddrType'), (0, 'A3COM-HUAWEI-IPV6-ADDRESS-MIB', 'h3cIpv6AddrReadAddr')) if mibBuilder.loadTexts: h3cIpv6AddrReadEntry.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadEntry.setDescription('Define the IPv6 address information.') h3c_ipv6_addr_read_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))) if mibBuilder.loadTexts: h3cIpv6AddrReadIfIndex.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadIfIndex.setDescription("The index value which uniquely identifies the interface to which this entry is applicable. The interface identified by a particular value of this index is the same interface as identified by the same value of RFC 1573's ifIndex.") h3c_ipv6_addr_read_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 2), inet_address_type()) if mibBuilder.loadTexts: h3cIpv6AddrReadAddrType.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadAddrType.setDescription("The IP address type to which this entry's address information pertains. The value must be ipv6.") h3c_ipv6_addr_read_addr = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 3), inet_address()) if mibBuilder.loadTexts: h3cIpv6AddrReadAddr.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadAddr.setDescription("The IPv6 address to which this entry's address information pertains.") h3c_ipv6_addr_read_pfx_length = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: h3cIpv6AddrReadPfxLength.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadPfxLength.setDescription('The length of the prefix (in bits) associated with the IPv6 address of this entry.') h3c_ipv6_addr_read_source_type = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('assignedIp', 1), ('assignedEUI64Ip', 2), ('assignedAutoIp', 3), ('autoIp', 4), ('dhcpv6', 5), ('negotiate', 6), ('cluster', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: h3cIpv6AddrReadSourceType.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadSourceType.setDescription("Indicate the type of source of IPv6 address. The value can be one of following: 'assignedIp': Assigned IPv6 address; 'assignedEUI64Ip': Assigned IPv6 address by using EUI-64 interface identifier; 'assignedAutoIp': Auto generated IPv6 address by user setting; 'autoIp': Auto generated IPv6 address as a result of non-linklocal anycast/unicast address configuration; 'dhcpv6': Assigned IPv6 address through DHCPv6 protocol; 'negotiate': Assigned IPv6 address through negotiation; 'cluster': Assigned IPv6 address through cluster module.") h3c_ipv6_addr_read_catalog = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 71, 1, 1, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('nodelocal', 1), ('linklocal', 2), ('sitelocal', 3), ('orglocal', 4), ('global', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: h3cIpv6AddrReadCatalog.setStatus('current') if mibBuilder.loadTexts: h3cIpv6AddrReadCatalog.setDescription("Indicate the category of the IPv6 address. The value can be one of following: 'nodelocal': node-local scope; 'linklocal': link-local scope; 'sitelocal': site-local scope; 'orglocal': organization-local scope; 'global': global scope. ") mibBuilder.exportSymbols('A3COM-HUAWEI-IPV6-ADDRESS-MIB', h3cIpv6AddrReadTable=h3cIpv6AddrReadTable, h3cIpv6AddrSetSourceType=h3cIpv6AddrSetSourceType, h3cIpv6AddrSetPfxLength=h3cIpv6AddrSetPfxLength, h3cIpv6AddressConfig=h3cIpv6AddressConfig, h3cIpv6AddrReadCatalog=h3cIpv6AddrReadCatalog, h3cIpv6AddrReadAddr=h3cIpv6AddrReadAddr, h3cIpv6AddrReadEntry=h3cIpv6AddrReadEntry, h3cIpv6AddrSetRowStatus=h3cIpv6AddrSetRowStatus, h3cIpv6AddressObjects=h3cIpv6AddressObjects, h3cIpv6AddrReadSourceType=h3cIpv6AddrReadSourceType, PYSNMP_MODULE_ID=h3cIpv6AddrMIB, h3cIpv6AddrSetEntry=h3cIpv6AddrSetEntry, h3cIpv6AddrSetAddr=h3cIpv6AddrSetAddr, h3cIpv6AddrReadAddrType=h3cIpv6AddrReadAddrType, h3cIpv6AddrMIB=h3cIpv6AddrMIB, h3cIpv6AddrSetAddrType=h3cIpv6AddrSetAddrType, h3cIpv6AddrSetIfIndex=h3cIpv6AddrSetIfIndex, h3cIpv6AddrSetTable=h3cIpv6AddrSetTable, h3cIpv6AddrReadPfxLength=h3cIpv6AddrReadPfxLength, h3cIpv6AddrReadIfIndex=h3cIpv6AddrReadIfIndex)
class Solution(object): def strStr(self, haystack, needle): i = 0 j = 0 m = len(needle) n = len(haystack) if m ==0: return 0 while i<n and n-i+1>=m: if haystack[i] == needle[j]: temp = i while j<m and i<n and needle[j]==haystack[i]: i+=1 j+=1 if j == m: return temp i= temp+1 j = 0 else: i+=1 return -1
class Solution(object): def str_str(self, haystack, needle): i = 0 j = 0 m = len(needle) n = len(haystack) if m == 0: return 0 while i < n and n - i + 1 >= m: if haystack[i] == needle[j]: temp = i while j < m and i < n and (needle[j] == haystack[i]): i += 1 j += 1 if j == m: return temp i = temp + 1 j = 0 else: i += 1 return -1
a = int(input()) f = int(input()) if a == f: print('YES') elif a != 1 and f != 1: print('YES') else: print('NO')
a = int(input()) f = int(input()) if a == f: print('YES') elif a != 1 and f != 1: print('YES') else: print('NO')
extn2tag = { '.c' : 'c', \ '.cpp' : 'cpp', '.cpp_' : 'cpp', '.cpp1' : 'cpp', '.cpp2' : 'cpp', '.cppclean' : 'cpp', '.cpp_NvidiaAPI_sample' : 'cpp', '.cpp-s8inyu' : 'cpp', '.cpp-woains' : 'cpp', \ '.cs' : 'csharp', '.csharp' : 'csharp', \ '.m' : 'objc', \ '.java' : 'java', \ '.scala' : 'scala', '.scla' : 'scala', \ '.go' : 'go', \ '.javascript' : 'javascript', '.js' : 'javascript', \ '.coffee' : 'coffeescript', '.coffeescript' : 'coffeescript', \ '.ts' : 'typescript', '.typescript' : 'typescript', \ '.rb' : 'ruby', \ '.php' : 'php', \ '.pl' : 'perl', \ '.py' : 'python', \ '.sh' : 'shell', '.SH' : 'shell', '.ksh' : 'shell', '.bash' : 'shell', '.bat' : 'shell', '.bats' : 'shell', \ '.cljx' : 'clojure', '.cljscm' : 'clojure', '.clj' : 'clojure', '.cljc': 'clojure', '.cljs' : 'clojure', \ '.css' : 'css', \ '.erl' : 'erlang', \ '.hs' : 'haskell' } bug_type_root = { 'ALGO' : "algorithm", 'CONCURRANCY' : " multi thread | multi process | multithread | multiprocess | multi-thread | multi-process | race | deadlock | synchronize", 'MEMORY' : "memory leak | buffer overflow | null pointer | dangling pointer | heap overflow | double free | memory corruption | segmentation fault ", 'PROGRAMMING' : "missing switch | control flow | exception handl | template | field | method | class | derived | implement | call | parsing | parse | namespace | " \ + "copy | paste | clone | refactor | merge | " \ + "cast | type | integer | float | int | character | overload | initializ | reference | reflect | array | " \ + "indent | formatting | " \ + "initializ | default value | " \ + "typo | " \ + "compile | build " } bug_type_impact = { 'SECURITY' : "security | secure | vulnerability | vulnerable | malicious | attack | ssl | sandbox | remote code | auth | password", 'PERFORMANCE' : "performance | slow | delay | optimization | optimize", 'CRASH' : "crash | halt | hang | reboot | restart | stop responding | not working | not responding " } bug_type_comp = { 'CORE' : "kernel | vm | core | system | env", 'GUI' : "gui | user interface | screen | touch | progress bar | display | view", 'NETWORK' : "network | packet | tcp | socket | http", 'IO' : "i/o | disk" }
extn2tag = {'.c': 'c', '.cpp': 'cpp', '.cpp_': 'cpp', '.cpp1': 'cpp', '.cpp2': 'cpp', '.cppclean': 'cpp', '.cpp_NvidiaAPI_sample': 'cpp', '.cpp-s8inyu': 'cpp', '.cpp-woains': 'cpp', '.cs': 'csharp', '.csharp': 'csharp', '.m': 'objc', '.java': 'java', '.scala': 'scala', '.scla': 'scala', '.go': 'go', '.javascript': 'javascript', '.js': 'javascript', '.coffee': 'coffeescript', '.coffeescript': 'coffeescript', '.ts': 'typescript', '.typescript': 'typescript', '.rb': 'ruby', '.php': 'php', '.pl': 'perl', '.py': 'python', '.sh': 'shell', '.SH': 'shell', '.ksh': 'shell', '.bash': 'shell', '.bat': 'shell', '.bats': 'shell', '.cljx': 'clojure', '.cljscm': 'clojure', '.clj': 'clojure', '.cljc': 'clojure', '.cljs': 'clojure', '.css': 'css', '.erl': 'erlang', '.hs': 'haskell'} bug_type_root = {'ALGO': 'algorithm', 'CONCURRANCY': ' multi thread | multi process | multithread | multiprocess | multi-thread | multi-process | race | deadlock | synchronize', 'MEMORY': 'memory leak | buffer overflow | null pointer | dangling pointer | heap overflow | double free | memory corruption | segmentation fault ', 'PROGRAMMING': 'missing switch | control flow | exception handl | template | field | method | class | derived | implement | call | parsing | parse | namespace | ' + 'copy | paste | clone | refactor | merge | ' + 'cast | type | integer | float | int | character | overload | initializ | reference | reflect | array | ' + 'indent | formatting | ' + 'initializ | default value | ' + 'typo | ' + 'compile | build '} bug_type_impact = {'SECURITY': 'security | secure | vulnerability | vulnerable | malicious | attack | ssl | sandbox | remote code | auth | password', 'PERFORMANCE': 'performance | slow | delay | optimization | optimize', 'CRASH': 'crash | halt | hang | reboot | restart | stop responding | not working | not responding '} bug_type_comp = {'CORE': 'kernel | vm | core | system | env', 'GUI': 'gui | user interface | screen | touch | progress bar | display | view', 'NETWORK': 'network | packet | tcp | socket | http', 'IO': 'i/o | disk'}
#! /usr/bin/env python def count_routes(n, a): count = 1 for i in range(len(a)): count *= a[i] return count if __name__ == '__main__': t = int(input()) for _ in range(t): n = int(input()) a = [int(x) for x in input().split()] print(count_routes(n, a) % 1234567)
def count_routes(n, a): count = 1 for i in range(len(a)): count *= a[i] return count if __name__ == '__main__': t = int(input()) for _ in range(t): n = int(input()) a = [int(x) for x in input().split()] print(count_routes(n, a) % 1234567)
print('\033[32m =\033[m'*50) print('BUILD AN PYTHON SCRIPT THAT READ AN NAME AND SHOW AN MENSAGE OF GRETTINS ACORD WITH TYPED VALUE'.title()) print('\033[32m =\033[m'*50) name = str(input('\033[4m Welcome Little Locust please type your name :\033[m \n')) print(' Hello \033[4;34m{}!\033[m nice to meet you '.format(name).capitalize())
print('\x1b[32m =\x1b[m' * 50) print('BUILD AN PYTHON SCRIPT THAT READ AN NAME AND SHOW AN MENSAGE OF GRETTINS ACORD WITH TYPED VALUE'.title()) print('\x1b[32m =\x1b[m' * 50) name = str(input('\x1b[4m Welcome Little Locust please type your name :\x1b[m \n')) print(' Hello \x1b[4;34m{}!\x1b[m nice to meet you '.format(name).capitalize())
# coding:utf-8 class SSError(Exception): pass
class Sserror(Exception): pass
# x = int(input("How many candies you want:")) # av = 5 # i = 1 # while i <= x: # if i > av: # print("We are out of stock") # break # print("Candy") # i = i+1 # print("Bye") # for i in range(1,101): # if i %3 == 0 and i%5==0:# skip the values whick=h are divisible by 3 and(both) 5 # continue # print(i) # print("Bye") # or is used for skipping the number which are divisible by 3 or 5 # for i in range(1,101): # if(i%2!=0): # pass#pass means just ignore it # else: # print(i) # print("\nBye") x = int(input("How many candies do you want?")) av = 3 i = 1 while i <= x: if i > av: break print("candy") i = i+1 print("Bye")
x = int(input('How many candies do you want?')) av = 3 i = 1 while i <= x: if i > av: break print('candy') i = i + 1 print('Bye')
def parse_field(field): name, valid = field.split(':') valid = [tuple(map(int, r)) for r in (r.split('-') for r in valid.split(' or '))] return name, valid def read_ticket(_ticket): return list(map(int, _ticket.split(','))) with open("input.txt") as f: fields, ticket, nearby = f.read().split('\n\n') fields = {f[0]: f[1] for f in (parse_field(f) for f in fields.splitlines())} ticket = read_ticket(ticket.splitlines()[1]) nearby = [read_ticket(t) for t in nearby.splitlines()[1:]] def valid_value(_fields, value): return any(r[0] <= value <= r[1] for v in _fields.values() for r in v) def part1(): return sum(n for t in nearby for n in t if not valid_value(fields, n)) print(part1())
def parse_field(field): (name, valid) = field.split(':') valid = [tuple(map(int, r)) for r in (r.split('-') for r in valid.split(' or '))] return (name, valid) def read_ticket(_ticket): return list(map(int, _ticket.split(','))) with open('input.txt') as f: (fields, ticket, nearby) = f.read().split('\n\n') fields = {f[0]: f[1] for f in (parse_field(f) for f in fields.splitlines())} ticket = read_ticket(ticket.splitlines()[1]) nearby = [read_ticket(t) for t in nearby.splitlines()[1:]] def valid_value(_fields, value): return any((r[0] <= value <= r[1] for v in _fields.values() for r in v)) def part1(): return sum((n for t in nearby for n in t if not valid_value(fields, n))) print(part1())
# do not create a map in this way names = ['Jack', 'John', 'Joe', 'Mary'] m = {} for name in names: m[name] = len(name) # create a map in this way, using a map comprehension names = ['Jack', 'John', 'Joe', 'Mary'] m = {name: len(name) for name in names}
names = ['Jack', 'John', 'Joe', 'Mary'] m = {} for name in names: m[name] = len(name) names = ['Jack', 'John', 'Joe', 'Mary'] m = {name: len(name) for name in names}
# code/load_original_interkey_speeds.py # Left: Right: # 1 2 3 4 25 28 13 14 15 16 31 # 5 6 7 8 26 29 17 18 19 20 32 # 9 10 11 12 27 30 21 22 23 24 Time24x24 = np.array([ [196,225,204,164,266,258,231,166,357,325,263,186,169,176,178,186,156,156,158,163,171,175,177,189], [225,181,182,147,239,245,196,150,289,296,229,167,162,169,170,178,148,148,150,155,163,167,169,182], [204,182,170,149,196,194,232,155,237,214,263,166,157,164,165,173,143,143,145,150,158,163,164,177], [164,147,149,169,160,161,157,226,165,185,234,257,154,162,163,171,141,141,143,148,156,160,162,175], [266,239,196,160,196,240,208,166,271,267,208,169,143,150,151,160,129,129,132,137,145,149,151,163], [258,245,194,161,240,181,183,149,245,256,184,150,138,145,146,154,124,124,126,131,139,144,145,158], [231,196,232,157,208,183,170,149,201,215,239,151,134,141,142,150,120,120,122,127,135,140,141,154], [166,150,155,226,166,149,149,169,160,147,170,221,133,140,141,150,119,119,122,126,135,139,141,153], [357,289,237,165,271,245,201,160,196,236,194,161,171,178,179,188,157,157,160,164,173,177,179,191], [325,296,214,185,267,256,215,147,236,181,184,157,166,173,174,182,152,152,154,159,167,172,173,186], [263,229,263,234,208,184,239,170,194,184,170,150,159,166,167,176,145,145,148,153,161,165,167,179], [186,167,166,257,169,150,151,221,161,157,150,169,153,160,161,169,139,139,141,146,154,159,160,173], [169,162,157,154,143,138,134,133,171,166,159,153,151,147,141,145,188,151,142,164,213,204,162,149], [176,169,164,162,150,145,141,140,178,173,166,160,147,151,189,209,137,207,191,206,149,227,208,197], [178,170,165,163,151,146,142,141,179,174,167,161,141,189,157,253,136,188,210,231,155,226,239,276], [186,178,173,171,160,154,150,150,188,182,176,169,145,209,253,170,147,206,251,233,164,268,362,271], [156,148,143,141,129,124,120,119,157,152,145,139,188,137,136,147,151,133,138,152,192,149,139,144], [156,148,143,141,129,124,120,119,157,152,145,139,151,207,188,206,133,151,179,183,145,204,183,201], [158,150,145,143,132,126,122,122,160,154,148,141,142,191,210,251,138,179,157,240,145,185,208,229], [163,155,150,148,137,131,127,126,164,159,153,146,164,206,231,233,152,183,240,170,160,220,293,242], [171,163,158,156,145,139,135,135,173,167,161,154,213,149,155,164,192,145,145,160,151,140,142,145], [175,167,163,160,149,144,140,139,177,172,165,159,204,227,226,268,149,204,185,220,140,151,175,188], [177,169,164,162,151,145,141,141,179,173,167,160,162,208,239,362,139,183,208,293,142,175,157,230], [189,182,177,175,163,158,154,153,191,186,179,173,149,197,276,271,144,201,229,242,145,188,230,170]])
time24x24 = np.array([[196, 225, 204, 164, 266, 258, 231, 166, 357, 325, 263, 186, 169, 176, 178, 186, 156, 156, 158, 163, 171, 175, 177, 189], [225, 181, 182, 147, 239, 245, 196, 150, 289, 296, 229, 167, 162, 169, 170, 178, 148, 148, 150, 155, 163, 167, 169, 182], [204, 182, 170, 149, 196, 194, 232, 155, 237, 214, 263, 166, 157, 164, 165, 173, 143, 143, 145, 150, 158, 163, 164, 177], [164, 147, 149, 169, 160, 161, 157, 226, 165, 185, 234, 257, 154, 162, 163, 171, 141, 141, 143, 148, 156, 160, 162, 175], [266, 239, 196, 160, 196, 240, 208, 166, 271, 267, 208, 169, 143, 150, 151, 160, 129, 129, 132, 137, 145, 149, 151, 163], [258, 245, 194, 161, 240, 181, 183, 149, 245, 256, 184, 150, 138, 145, 146, 154, 124, 124, 126, 131, 139, 144, 145, 158], [231, 196, 232, 157, 208, 183, 170, 149, 201, 215, 239, 151, 134, 141, 142, 150, 120, 120, 122, 127, 135, 140, 141, 154], [166, 150, 155, 226, 166, 149, 149, 169, 160, 147, 170, 221, 133, 140, 141, 150, 119, 119, 122, 126, 135, 139, 141, 153], [357, 289, 237, 165, 271, 245, 201, 160, 196, 236, 194, 161, 171, 178, 179, 188, 157, 157, 160, 164, 173, 177, 179, 191], [325, 296, 214, 185, 267, 256, 215, 147, 236, 181, 184, 157, 166, 173, 174, 182, 152, 152, 154, 159, 167, 172, 173, 186], [263, 229, 263, 234, 208, 184, 239, 170, 194, 184, 170, 150, 159, 166, 167, 176, 145, 145, 148, 153, 161, 165, 167, 179], [186, 167, 166, 257, 169, 150, 151, 221, 161, 157, 150, 169, 153, 160, 161, 169, 139, 139, 141, 146, 154, 159, 160, 173], [169, 162, 157, 154, 143, 138, 134, 133, 171, 166, 159, 153, 151, 147, 141, 145, 188, 151, 142, 164, 213, 204, 162, 149], [176, 169, 164, 162, 150, 145, 141, 140, 178, 173, 166, 160, 147, 151, 189, 209, 137, 207, 191, 206, 149, 227, 208, 197], [178, 170, 165, 163, 151, 146, 142, 141, 179, 174, 167, 161, 141, 189, 157, 253, 136, 188, 210, 231, 155, 226, 239, 276], [186, 178, 173, 171, 160, 154, 150, 150, 188, 182, 176, 169, 145, 209, 253, 170, 147, 206, 251, 233, 164, 268, 362, 271], [156, 148, 143, 141, 129, 124, 120, 119, 157, 152, 145, 139, 188, 137, 136, 147, 151, 133, 138, 152, 192, 149, 139, 144], [156, 148, 143, 141, 129, 124, 120, 119, 157, 152, 145, 139, 151, 207, 188, 206, 133, 151, 179, 183, 145, 204, 183, 201], [158, 150, 145, 143, 132, 126, 122, 122, 160, 154, 148, 141, 142, 191, 210, 251, 138, 179, 157, 240, 145, 185, 208, 229], [163, 155, 150, 148, 137, 131, 127, 126, 164, 159, 153, 146, 164, 206, 231, 233, 152, 183, 240, 170, 160, 220, 293, 242], [171, 163, 158, 156, 145, 139, 135, 135, 173, 167, 161, 154, 213, 149, 155, 164, 192, 145, 145, 160, 151, 140, 142, 145], [175, 167, 163, 160, 149, 144, 140, 139, 177, 172, 165, 159, 204, 227, 226, 268, 149, 204, 185, 220, 140, 151, 175, 188], [177, 169, 164, 162, 151, 145, 141, 141, 179, 173, 167, 160, 162, 208, 239, 362, 139, 183, 208, 293, 142, 175, 157, 230], [189, 182, 177, 175, 163, 158, 154, 153, 191, 186, 179, 173, 149, 197, 276, 271, 144, 201, 229, 242, 145, 188, 230, 170]])
class Solution: def maximalSquare(self, matrix: List[List[str]]) -> int: maxlen = 0 for i in range(len(matrix)): for j in range(len(matrix[i])): matrix[i][j] = int(matrix[i][j]) if matrix[i][j] and i and j: matrix[i][j] = min(matrix[i - 1][j], matrix[i][j - 1], matrix[i - 1][j - 1]) + 1 if matrix[i][j] > maxlen: maxlen = matrix[i][j] return maxlen ** 2
class Solution: def maximal_square(self, matrix: List[List[str]]) -> int: maxlen = 0 for i in range(len(matrix)): for j in range(len(matrix[i])): matrix[i][j] = int(matrix[i][j]) if matrix[i][j] and i and j: matrix[i][j] = min(matrix[i - 1][j], matrix[i][j - 1], matrix[i - 1][j - 1]) + 1 if matrix[i][j] > maxlen: maxlen = matrix[i][j] return maxlen ** 2
class InvalidListOfWordsException(Exception): print("Invalid list of words exception raised") class InvalidWordException(Exception): print("InvalidWordException raised") class GameWonException(Exception): print("You won the game! Congrats!") class GameLostException(Exception): print("You lost the game!") class GameFinishedException(Exception): print("Game Finished!") class InvalidGuessedLetterException(Exception): print("Incorrect letter. Try again!")
class Invalidlistofwordsexception(Exception): print('Invalid list of words exception raised') class Invalidwordexception(Exception): print('InvalidWordException raised') class Gamewonexception(Exception): print('You won the game! Congrats!') class Gamelostexception(Exception): print('You lost the game!') class Gamefinishedexception(Exception): print('Game Finished!') class Invalidguessedletterexception(Exception): print('Incorrect letter. Try again!')
{ "cells": [ { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[ 0.20107669 0.29543058 -0.16135565 -0.26139101 0.21345801]]\n", "[ 0.20107669 0.29543058 -0.16135565 -0.26139101 0.21345801]\n" ] }, { "ename": "ValueError", "evalue": "operands could not be broadcast together with shapes (4,5) (4,) ", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m<ipython-input-24-9f4a1b7ee149>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 100\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 101\u001b[0m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msubplot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 102\u001b[0;31m \u001b[0mbetas\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmetropolis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 103\u001b[0m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbetas\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m20\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 104\u001b[0m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtitle\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mr\"$m_{}={:.2f}$ $c_{}={:.2f}$\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mm\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mc\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m<ipython-input-24-9f4a1b7ee149>\u001b[0m in \u001b[0;36mmetropolis\u001b[0;34m(x)\u001b[0m\n\u001b[1;32m 69\u001b[0m \u001b[0mx_guess\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnormal\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx_walk\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m0.1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnormal\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx_walk\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m0.1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnormal\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx_walk\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m0.1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnormal\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx_walk\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m0.1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnormal\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx_walk\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m0.1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0mprint\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mx_walk\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 71\u001b[0;31m \u001b[0ma\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mposterior\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmu\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0msigma\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mx_guess\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0mposterior\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmu\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0msigma\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mx_walk\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 72\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m>=\u001b[0m\u001b[0;36m1.\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 73\u001b[0m \u001b[0mx_walk\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvstack\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx_walk\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mx_guess\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m<ipython-input-24-9f4a1b7ee149>\u001b[0m in \u001b[0;36mposterior\u001b[0;34m(mu, x, sigma, a)\u001b[0m\n\u001b[1;32m 28\u001b[0m \u001b[0mPosterior\u001b[0m \u001b[0mcalculado\u001b[0m \u001b[0mcon\u001b[0m \u001b[0mla\u001b[0m \u001b[0mnormalizacion\u001b[0m \u001b[0madecuada\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 29\u001b[0m \"\"\"\n\u001b[0;32m---> 30\u001b[0;31m \u001b[0mpost\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlike\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msigma\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmu\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mprior\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmu\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 31\u001b[0m \u001b[0mevidencia\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrapz\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpost\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmu\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 32\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mpost\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0mevidencia\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m<ipython-input-24-9f4a1b7ee149>\u001b[0m in \u001b[0;36mlike\u001b[0;34m(x, sigma, mu, a)\u001b[0m\n\u001b[1;32m 21\u001b[0m \"\"\"\n\u001b[1;32m 22\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 23\u001b[0;31m \u001b[0mL\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msum\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0my\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0my\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1.\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m2.\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 24\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mL\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mValueError\u001b[0m: operands could not be broadcast together with shapes (4,5) (4,) " ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMsAAACGCAYAAABzPX6BAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAJF0lEQVR4nO3dX4wdZR3G8e8jFYiIsFBMiNLSxmIpaChsEEOiGLWUmhQSjLYJsTXVBgRM9ErDBabcoEZJSFBotAFM5O/VGiGkWpomhALbgBRqgLaithIpbOEGRFp+XsxbnR673d9u33POHvp8kpOdMzPved852Wdn5pzZ3ygiMLOJfaDfAzAbFA6LWZLDYpbksJglOSxmSQ6LWdKEYZG0TtKrkp4bZ7kk3Sppu6RnJZ3fWrZC0kvlsaLmwM16LbNnuRNYfJjllwHzymM18EsASacANwKfAS4EbpQ0dCSDNeunCcMSEZuAscOscjlwdzQ2AydLOh24FFgfEWMRsRdYz+FDZzat1Thn+Rjw99bzXWXeePPNBtKMfg8AQNJqmkM4TjjhhAvmz5/f5xHZ+9mWLVtei4jTJtuuRlh2A2e0nn+8zNsNXNIxf+OhXiAi1gJrAYaHh2N0dLTCsMwOTdJfp9KuxmHYCPCN8qnYRcCbEfEK8AiwSNJQObFfVOaZDaQJ9yyS7qHZQ8yUtIvmE64PAkTE7cBDwBJgO/AW8M2ybEzSTcBT5aXWRMThPigwm9YmDEtELJ9geQDXjrNsHbBuakMzm178Db5ZksNiluSwmCU5LGZJDotZksNiluSwmCU5LGZJDotZksNiluSwmCU5LGZJDotZksNiluSwmCU5LGZJqbBIWizphVJI7weHWH6LpGfK40VJb7SW7W8tG6k5eLNeyvxb8THAbcCXacoZPSVpJCK2HVgnIr7XWv96YGHrJd6OiPPqDdmsPzJ7lguB7RGxMyL+DdxLU1hvPMuBe2oMzmw6yYQlXSxP0mxgDrChNft4SaOSNku6YsojNeuz2kX2lgEPRsT+1rzZEbFb0lxgg6StEbGj3ahdZG/WrFmVh2RWR2bPMl4RvUNZRschWETsLj930hTZW9jZKCLWRsRwRAyfdtqkCwWa9UQmLE8B8yTNkXQsTSD+71MtSfOBIeDx1rwhSceV6ZnAxcC2zrZmgyBTN2yfpOtoqkkeA6yLiOclrQFGI+JAcJYB98bB9wo/G7hD0ns0wby5/Sma2SDRwb/b/edax9ZtkrZExPBk2/kbfLMkh8UsyWExS3JYzJIcFrMkh8UsyWExS3JYzJIcFrMkh8UsyWExS3JYzJIcFrMkh8UsyWExS3JYzJJqFdlbKWlPq5jet1rLVkh6qTxW1By8WS9VKbJX3BcR13W0PQW4ERgGAthS2u6tMnqzHupGkb22S4H1ETFWArIeWDy1oZr1V80ie1dKelbSg5IOlE5KtZW0uhTiG92zZ09y6Ga9VesE/3fAmRHxaZq9x12Taey6YTYIqhTZi4jXI+Kd8vRXwAXZtmaDokqRPUmnt54uBf5cph8BFpVie0PAojLPbODUKrL3XUlLgX3AGLCytB2TdBNN4ADWRMRYF7bDrOtcZM+OOi6yZ9ZlDotZksNiluSwmCU5LGZJDotZksNiluSwmCU5LGZJDotZksNiluSwmCU5LGZJDotZksNillSrbtj3JW0rBSv+KGl2a9n+Vj2xkc62ZoOiVt2wp4HhiHhL0jXAT4Cvl2VvR8R5lcdt1nNV6oZFxKMR8VZ5upmmMIXZ+0rNumEHrAIebj0/vtQE2yzpiimM0WxamPAwbDIkXUVTqvXzrdmzI2K3pLnABklbI2JHR7vVwGqAWbNm1RySWTVV6oYBSPoScAOwtFVDjIjYXX7uBDYCCzvbusieDYJadcMWAnfQBOXV1vwhSceV6ZnAxUBnQXGzgVCrbthPgQ8DD0gC+FtELAXOBu6Q9B5NMG8+RPV9s4HgumF21HHdMLMuc1jMkhwWsySHxSzJYTFLcljMkhwWsySHxSzJYTFLcljMkhwWsySHxSzJYTFLcljMkhwWsySHxSypVpG94yTdV5Y/IenM1rIflvkvSLq03tDNemvCsLSK7F0GLACWS1rQsdoqYG9EfAK4BfhxabuA5n/2zwEWA78or2c2cKoU2SvP7yrTDwJfVPPP+JcD90bEOxHxF2B7eT2zgVOryN5/14mIfcCbwKnJtmYDoWqRvalqF9kD3pH0XJ+GMhN47Sjqt59993ObPzmVRpmwZIrsHVhnl6QZwEnA68m2RMRaYC2ApNGpVN6ooV99e5t73/dU2lUpsleeryjTXwU2RFNjaQRYVj4tmwPMA56cykDN+q1Wkb1fA7+RtB0YowkUZb37aapQ7gOujYj9XdoWs+6KiGn1AFYfbX17mwej72lXkdJsuvLlLmZJfQvLkVxC04O+x71HZjf7ba13paSQVOXToky/kr5Wtvl5Sb+t0W+mb0mzJD0q6enyfi+p1O86Sa+O9zWEGreWcT0r6fwJX7RPx4zHADuAucCxwJ+ABR3rfAe4vUwvA+7rYd9fAD5Upq+p0Xem37LeicAmmtsNDvdoe+fR3Bd0qDz/aA/f67XANWV6AfBypb4/B5wPPDfO8iU0d6gTcBHwxESv2a89y5FcQtP1vqM798jMbDPATTTX1v2rQp/Zfr8N3BYRewGidY+dHvQdwEfK9EnAP2p0HBGbaD6ZHc/lwN3R2AycLOn0w71mv8JyJJfQ9KLvts57ZHat33IocEZE/L5Cf+l+gbOAsyQ9Vu79ubiHff8IuErSLuAh4PpKfU9k0pdiTYvLXaarce6R2a2+PgD8HFjZ7b4OYQbNodglNHvRTZI+FRFv9KDv5cCdEfEzSZ+l+b7u3Ih4rwd9T0q/9iyTuYSGjktoetH3uPfI7GK/JwLnAhslvUxzHD1S4SQ/s727gJGIeDeaq8NfpAnPkcr0vQq4HyAiHgeOp7lurNtSvwcHqXEyNYWTrxnATmAO/zvxO6djnWs5+AT//h72vZDmxHReL7e5Y/2N1DnBz2zvYuCuMj2T5vDk1B71/TCwskyfTXPOokrv+ZmMf4L/FQ4+wX9ywter9cswhQ1ZQvMXbAdwQ5m3huYvOTR/YR6g+R+YJ4G5Pez7D8A/gWfKY6QX/XasWyUsye0VzSHgNmArsKyH7/UC4LESpGeARZX6vQd4BXiXZs+5CrgauLq1zbeVcW3NvNf+Bt8syd/gmyU5LGZJDotZksNiluSwmCU5LGZJDotZksNilvQfW3XWBOWLVHgAAAAASUVORK5CYII=\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "def prior(mu):\n", " \"\"\"\n", " Densidad de probabilidad de mu\n", " \"\"\"\n", " p = np.ones(len(mu))/(mu.max()-mu.min())\n", " return p\n", "\n", "def like(x, sigma, mu,a):\n", " \"\"\"\n", " Likelihod de tener un dato x e incertidumbre sigma\n", " \"\"\"\n", " L = np.ones(len(mu))\n", " \n", " \"\"\"\n", " for x_i in (x):\n", " L *= (1.0/np.sqrt(2.0*np.pi*sigma**2))*np.exp(-0.5*(x_i-mu)**2/(sigma**2))\n", " return L\n", " \"\"\"\n", " for i in range(len(x)):\n", " L += np.sum((a[1:]*x[i]+a[0]-y[i])**2)**((len(y)*-1.)/-2.)\n", " return L\n", "\n", "def posterior(mu, x, sigma,a):\n", " \"\"\"\n", " Posterior calculado con la normalizacion adecuada\n", " \"\"\"\n", " post = like(x, sigma, mu,a) * prior(mu)\n", " evidencia = np.trapz(post, mu)\n", " return post/evidencia\n", "\n", "def estimados(x,y,sigma,a):\n", " w=2./sigma**2\n", " alfa=w*np.sum(x**2)\n", " beta=len(x)*w\n", " gamma=np.sum(x)*w\n", " p=np.sum(x*y)*w\n", " q=np.sum(y)*w\n", " m=(beta*p-gamma*q)/(alfa*beta-gamma**2)\n", " c=(alfa*q-gamma*p)/(alfa*beta-gamma**2)\n", " return m,c\n", "\n", "def maximo_incertidumbre(x, y):\n", " deltax = x[1] - x[0]\n", "\n", " # maximo de y\n", " ii = np.argmax(y)\n", "\n", " # segunda derivada\n", " d = (y[ii+1] - 2*y[ii] + y[ii-1]) / (deltax**2)\n", "\n", " return x[ii], 1.0/np.sqrt(-d)\n", " \n", "def newsigma(a,b,x,y):\n", " return np.sum((a*x+c-y)**2)**(2)/(len/(y)-1)\n", "\n", "x = np.linspace(-4.0,4.0,1000)\n", "y = np.linspace(-4.0,4.0,1000)\n", "\n", "def metropolis(x):\n", " \n", " x_walk=np.empty([0,5])\n", " x0=[(np.random.random()-0.5),(np.random.random()-0.5),(np.random.random()-0.5),(np.random.random()-0.5),(np.random.random()-0.5)]\n", " x_walk=np.vstack((x_walk,x0))\n", " \n", " for i in range(20000):\n", " x_guess=[np.random.normal(x_walk[i],0.1),np.random.normal(x_walk[i],0.1),np.random.normal(x_walk[i],0.1),np.random.normal(x_walk[i],0.1),np.random.normal(x_walk[i],0.1)]\n", " print (x_walk[i])\n", " \n", " a=posterior(mu,x,sigma,x_guess)/posterior(mu,x,sigma,x_walk[i])\n", " if a>=1.:\n", " x_walk=np.vstack((x_walk,x_guess))\n", " \n", " else:\n", " b=np.random.random()\n", " if a>=b:\n", " x_walk=np.vstack((x_walk,x_guess))\n", " else:\n", " x_walk=np.vstack((x_walk,x_walk[i]))\n", " return x_walk()\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", "\n", " \n", "\n", "data = np.loadtxt(\"notas_andes.dat\", skiprows=1)\n", "Y = data[:,4]\n", "X = data[:,:4]\n", "mu = np.linspace(1E-4, 10.0, 1000)\n", "sigma=0.1\n", "\n", "\n", "plt.figure()\n", "for i in range(5):\n", " plt.subplot(2,2,i+1)\n", " betas=metropolis(X)\n", " plt.hist(betas[:,i],20)\n", " plt.title(r\"$m_{}={:.2f}$ $c_{}={:.2f}$\".format(i+1,m,i+1,c))\n", " plt.xlabel(\"x\")\n", " \n", "\n", "plt.subplots_adjust(hspace=0.55)\n", "plt.savefig(\"ajuste_bayes-mcmc.png\", bbox_inches='tight')\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "m1,c1=estimados(X[:,0],Y,sigma)\n", "\n", "print (m1,c1)\n", "\n", "\n", "plt.figure()\n", "for i in range(4):\n", " plt.subplot(2,2,i+1)\n", " xf=np.linspace(np.amin(X[:,i]),np.amax(X[:,i]),1000)\n", " m,c=estimados(X[:,i],Y,sigma)\n", " plt.scatter(X[:,i], Y)\n", " plt.plot(xf,m*xf+c)\n", " plt.title(r\"$m_{}={:.2f}$ $c_{}={:.2f}$\".format(i+1,m,i+1,c))\n", " plt.xlabel(\"x\")\n", " \n", "\n", "plt.subplots_adjust(hspace=0.55)\n", "plt.savefig(\"bayes.png\", bbox_inches='tight')\n", "\n", "\n", "\n", "\n", "\n", "\n", "\"\"\"\n", "post = posterior(mu, X[:,0], sigma)\n", "max, incertidumbre = maximo_incertidumbre(mu, np.log(post))\n", "plt.figure()\n", "plt.plot(mu, post)\n", "plt.title('$\\mu$= {:.2f} $\\pm$ {:.2f}'.format(max, incertidumbre))\n", "plt.xlabel('$\\mu$')\n", "plt.ylabel('prob($\\mu$|datos)')\n", "plt.savefig('mean.png')\n", "\"\"\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.6" } }, "nbformat": 4, "nbformat_minor": 4 }
{'cells': [{'cell_type': 'code', 'execution_count': 24, 'metadata': {}, 'outputs': [{'name': 'stdout', 'output_type': 'stream', 'text': ['[[ 0.20107669 0.29543058 -0.16135565 -0.26139101 0.21345801]]\n', '[ 0.20107669 0.29543058 -0.16135565 -0.26139101 0.21345801]\n']}, {'ename': 'ValueError', 'evalue': 'operands could not be broadcast together with shapes (4,5) (4,) ', 'output_type': 'error', 'traceback': ['\x1b[0;31m---------------------------------------------------------------------------\x1b[0m', '\x1b[0;31mValueError\x1b[0m Traceback (most recent call last)', '\x1b[0;32m<ipython-input-24-9f4a1b7ee149>\x1b[0m in \x1b[0;36m<module>\x1b[0;34m\x1b[0m\n\x1b[1;32m 100\x1b[0m \x1b[0;32mfor\x1b[0m \x1b[0mi\x1b[0m \x1b[0;32min\x1b[0m \x1b[0mrange\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0;36m5\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m:\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[1;32m 101\x1b[0m \x1b[0mplt\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0msubplot\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0;36m2\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0;36m2\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m+\x1b[0m\x1b[0;36m1\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[0;32m--> 102\x1b[0;31m \x1b[0mbetas\x1b[0m\x1b[0;34m=\x1b[0m\x1b[0mmetropolis\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mX\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[0m\x1b[1;32m 103\x1b[0m \x1b[0mplt\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mhist\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mbetas\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0;34m:\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0;36m20\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[1;32m 104\x1b[0m \x1b[0mplt\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mtitle\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0;34mr"$m_{}={:.2f}$ $c_{}={:.2f}$"\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mformat\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m+\x1b[0m\x1b[0;36m1\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mm\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m+\x1b[0m\x1b[0;36m1\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mc\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n', '\x1b[0;32m<ipython-input-24-9f4a1b7ee149>\x1b[0m in \x1b[0;36mmetropolis\x1b[0;34m(x)\x1b[0m\n\x1b[1;32m 69\x1b[0m \x1b[0mx_guess\x1b[0m\x1b[0;34m=\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0mnp\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mrandom\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mnormal\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mx_walk\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0;36m0.1\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mnp\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mrandom\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mnormal\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mx_walk\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0;36m0.1\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mnp\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mrandom\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mnormal\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mx_walk\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0;36m0.1\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mnp\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mrandom\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mnormal\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mx_walk\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0;36m0.1\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mnp\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mrandom\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mnormal\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mx_walk\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0;36m0.1\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[1;32m 70\x1b[0m \x1b[0mprint\x1b[0m \x1b[0;34m(\x1b[0m\x1b[0mx_walk\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[0;32m---> 71\x1b[0;31m \x1b[0ma\x1b[0m\x1b[0;34m=\x1b[0m\x1b[0mposterior\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mmu\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mx\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0msigma\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mx_guess\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m/\x1b[0m\x1b[0mposterior\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mmu\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mx\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0msigma\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mx_walk\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[0m\x1b[1;32m 72\x1b[0m \x1b[0;32mif\x1b[0m \x1b[0ma\x1b[0m\x1b[0;34m>=\x1b[0m\x1b[0;36m1.\x1b[0m\x1b[0;34m:\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[1;32m 73\x1b[0m \x1b[0mx_walk\x1b[0m\x1b[0;34m=\x1b[0m\x1b[0mnp\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mvstack\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mx_walk\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0mx_guess\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n', '\x1b[0;32m<ipython-input-24-9f4a1b7ee149>\x1b[0m in \x1b[0;36mposterior\x1b[0;34m(mu, x, sigma, a)\x1b[0m\n\x1b[1;32m 28\x1b[0m \x1b[0mPosterior\x1b[0m \x1b[0mcalculado\x1b[0m \x1b[0mcon\x1b[0m \x1b[0mla\x1b[0m \x1b[0mnormalizacion\x1b[0m \x1b[0madecuada\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[1;32m 29\x1b[0m """\n\x1b[0;32m---> 30\x1b[0;31m \x1b[0mpost\x1b[0m \x1b[0;34m=\x1b[0m \x1b[0mlike\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mx\x1b[0m\x1b[0;34m,\x1b[0m \x1b[0msigma\x1b[0m\x1b[0;34m,\x1b[0m \x1b[0mmu\x1b[0m\x1b[0;34m,\x1b[0m\x1b[0ma\x1b[0m\x1b[0;34m)\x1b[0m \x1b[0;34m*\x1b[0m \x1b[0mprior\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mmu\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[0m\x1b[1;32m 31\x1b[0m \x1b[0mevidencia\x1b[0m \x1b[0;34m=\x1b[0m \x1b[0mnp\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mtrapz\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mpost\x1b[0m\x1b[0;34m,\x1b[0m \x1b[0mmu\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[1;32m 32\x1b[0m \x1b[0;32mreturn\x1b[0m \x1b[0mpost\x1b[0m\x1b[0;34m/\x1b[0m\x1b[0mevidencia\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n', '\x1b[0;32m<ipython-input-24-9f4a1b7ee149>\x1b[0m in \x1b[0;36mlike\x1b[0;34m(x, sigma, mu, a)\x1b[0m\n\x1b[1;32m 21\x1b[0m """\n\x1b[1;32m 22\x1b[0m \x1b[0;32mfor\x1b[0m \x1b[0mi\x1b[0m \x1b[0;32min\x1b[0m \x1b[0mrange\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mlen\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mx\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m:\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[0;32m---> 23\x1b[0;31m \x1b[0mL\x1b[0m \x1b[0;34m+=\x1b[0m \x1b[0mnp\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0msum\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0ma\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0;36m1\x1b[0m\x1b[0;34m:\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m*\x1b[0m\x1b[0mx\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m+\x1b[0m\x1b[0ma\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0;36m0\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m-\x1b[0m\x1b[0my\x1b[0m\x1b[0;34m[\x1b[0m\x1b[0mi\x1b[0m\x1b[0;34m]\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m**\x1b[0m\x1b[0;36m2\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m**\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mlen\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0my\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m*\x1b[0m\x1b[0;34m-\x1b[0m\x1b[0;36m1.\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m/\x1b[0m\x1b[0;34m-\x1b[0m\x1b[0;36m2.\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[0m\x1b[1;32m 24\x1b[0m \x1b[0;32mreturn\x1b[0m \x1b[0mL\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[1;32m 25\x1b[0m \x1b[0;34m\x1b[0m\x1b[0m\n', '\x1b[0;31mValueError\x1b[0m: operands could not be broadcast together with shapes (4,5) (4,) ']}, {'data': {'image/png': 'iVBORw0KGgoAAAANSUhEUgAAAMsAAACGCAYAAABzPX6BAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAJF0lEQVR4nO3dX4wdZR3G8e8jFYiIsFBMiNLSxmIpaChsEEOiGLWUmhQSjLYJsTXVBgRM9ErDBabcoEZJSFBotAFM5O/VGiGkWpomhALbgBRqgLaithIpbOEGRFp+XsxbnR673d9u33POHvp8kpOdMzPved852Wdn5pzZ3ygiMLOJfaDfAzAbFA6LWZLDYpbksJglOSxmSQ6LWdKEYZG0TtKrkp4bZ7kk3Sppu6RnJZ3fWrZC0kvlsaLmwM16LbNnuRNYfJjllwHzymM18EsASacANwKfAS4EbpQ0dCSDNeunCcMSEZuAscOscjlwdzQ2AydLOh24FFgfEWMRsRdYz+FDZzat1Thn+Rjw99bzXWXeePPNBtKMfg8AQNJqmkM4TjjhhAvmz5/f5xHZ+9mWLVtei4jTJtuuRlh2A2e0nn+8zNsNXNIxf+OhXiAi1gJrAYaHh2N0dLTCsMwOTdJfp9KuxmHYCPCN8qnYRcCbEfEK8AiwSNJQObFfVOaZDaQJ9yyS7qHZQ8yUtIvmE64PAkTE7cBDwBJgO/AW8M2ybEzSTcBT5aXWRMThPigwm9YmDEtELJ9geQDXjrNsHbBuakMzm178Db5ZksNiluSwmCU5LGZJDotZksNiluSwmCU5LGZJDotZksNiluSwmCU5LGZJDotZksNiluSwmCU5LGZJqbBIWizphVJI7weHWH6LpGfK40VJb7SW7W8tG6k5eLNeyvxb8THAbcCXacoZPSVpJCK2HVgnIr7XWv96YGHrJd6OiPPqDdmsPzJ7lguB7RGxMyL+DdxLU1hvPMuBe2oMzmw6yYQlXSxP0mxgDrChNft4SaOSNku6YsojNeuz2kX2lgEPRsT+1rzZEbFb0lxgg6StEbGj3ahdZG/WrFmVh2RWR2bPMl4RvUNZRschWETsLj930hTZW9jZKCLWRsRwRAyfdtqkCwWa9UQmLE8B8yTNkXQsTSD+71MtSfOBIeDx1rwhSceV6ZnAxcC2zrZmgyBTN2yfpOtoqkkeA6yLiOclrQFGI+JAcJYB98bB9wo/G7hD0ns0wby5/Sma2SDRwb/b/edax9ZtkrZExPBk2/kbfLMkh8UsyWExS3JYzJIcFrMkh8UsyWExS3JYzJIcFrMkh8UsyWExS3JYzJIcFrMkh8UsyWExS3JYzJJqFdlbKWlPq5jet1rLVkh6qTxW1By8WS9VKbJX3BcR13W0PQW4ERgGAthS2u6tMnqzHupGkb22S4H1ETFWArIeWDy1oZr1V80ie1dKelbSg5IOlE5KtZW0uhTiG92zZ09y6Ga9VesE/3fAmRHxaZq9x12Taey6YTYIqhTZi4jXI+Kd8vRXwAXZtmaDokqRPUmnt54uBf5cph8BFpVie0PAojLPbODUKrL3XUlLgX3AGLCytB2TdBNN4ADWRMRYF7bDrOtcZM+OOi6yZ9ZlDotZksNiluSwmCU5LGZJDotZksNiluSwmCU5LGZJDotZksNiluSwmCU5LGZJDotZksNillSrbtj3JW0rBSv+KGl2a9n+Vj2xkc62ZoOiVt2wp4HhiHhL0jXAT4Cvl2VvR8R5lcdt1nNV6oZFxKMR8VZ5upmmMIXZ+0rNumEHrAIebj0/vtQE2yzpiimM0WxamPAwbDIkXUVTqvXzrdmzI2K3pLnABklbI2JHR7vVwGqAWbNm1RySWTVV6oYBSPoScAOwtFVDjIjYXX7uBDYCCzvbusieDYJadcMWAnfQBOXV1vwhSceV6ZnAxUBnQXGzgVCrbthPgQ8DD0gC+FtELAXOBu6Q9B5NMG8+RPV9s4HgumF21HHdMLMuc1jMkhwWsySHxSzJYTFLcljMkhwWsySHxSzJYTFLcljMkhwWsySHxSzJYTFLcljMkhwWsySHxSypVpG94yTdV5Y/IenM1rIflvkvSLq03tDNemvCsLSK7F0GLACWS1rQsdoqYG9EfAK4BfhxabuA5n/2zwEWA78or2c2cKoU2SvP7yrTDwJfVPPP+JcD90bEOxHxF2B7eT2zgVOryN5/14mIfcCbwKnJtmYDoWqRvalqF9kD3pH0XJ+GMhN47Sjqt59993ObPzmVRpmwZIrsHVhnl6QZwEnA68m2RMRaYC2ApNGpVN6ooV99e5t73/dU2lUpsleeryjTXwU2RFNjaQRYVj4tmwPMA56cykDN+q1Wkb1fA7+RtB0YowkUZb37aapQ7gOujYj9XdoWs+6KiGn1AFYfbX17mwej72lXkdJsuvLlLmZJfQvLkVxC04O+x71HZjf7ba13paSQVOXToky/kr5Wtvl5Sb+t0W+mb0mzJD0q6enyfi+p1O86Sa+O9zWEGreWcT0r6fwJX7RPx4zHADuAucCxwJ+ABR3rfAe4vUwvA+7rYd9fAD5Upq+p0Xem37LeicAmmtsNDvdoe+fR3Bd0qDz/aA/f67XANWV6AfBypb4/B5wPPDfO8iU0d6gTcBHwxESv2a89y5FcQtP1vqM798jMbDPATTTX1v2rQp/Zfr8N3BYRewGidY+dHvQdwEfK9EnAP2p0HBGbaD6ZHc/lwN3R2AycLOn0w71mv8JyJJfQ9KLvts57ZHat33IocEZE/L5Cf+l+gbOAsyQ9Vu79ubiHff8IuErSLuAh4PpKfU9k0pdiTYvLXaarce6R2a2+PgD8HFjZ7b4OYQbNodglNHvRTZI+FRFv9KDv5cCdEfEzSZ+l+b7u3Ih4rwd9T0q/9iyTuYSGjktoetH3uPfI7GK/JwLnAhslvUxzHD1S4SQ/s727gJGIeDeaq8NfpAnPkcr0vQq4HyAiHgeOp7lurNtSvwcHqXEyNYWTrxnATmAO/zvxO6djnWs5+AT//h72vZDmxHReL7e5Y/2N1DnBz2zvYuCuMj2T5vDk1B71/TCwskyfTXPOokrv+ZmMf4L/FQ4+wX9ywter9cswhQ1ZQvMXbAdwQ5m3huYvOTR/YR6g+R+YJ4G5Pez7D8A/gWfKY6QX/XasWyUsye0VzSHgNmArsKyH7/UC4LESpGeARZX6vQd4BXiXZs+5CrgauLq1zbeVcW3NvNf+Bt8syd/gmyU5LGZJDotZksNiluSwmCU5LGZJDotZksNilvQfW3XWBOWLVHgAAAAASUVORK5CYII=\n', 'text/plain': ['<Figure size 432x288 with 1 Axes>']}, 'metadata': {'needs_background': 'light'}, 'output_type': 'display_data'}], 'source': ['\n', 'import numpy as np\n', 'import matplotlib.pyplot as plt\n', '\n', 'def prior(mu):\n', ' """\n', ' Densidad de probabilidad de mu\n', ' """\n', ' p = np.ones(len(mu))/(mu.max()-mu.min())\n', ' return p\n', '\n', 'def like(x, sigma, mu,a):\n', ' """\n', ' Likelihod de tener un dato x e incertidumbre sigma\n', ' """\n', ' L = np.ones(len(mu))\n', ' \n', ' """\n', ' for x_i in (x):\n', ' L *= (1.0/np.sqrt(2.0*np.pi*sigma**2))*np.exp(-0.5*(x_i-mu)**2/(sigma**2))\n', ' return L\n', ' """\n', ' for i in range(len(x)):\n', ' L += np.sum((a[1:]*x[i]+a[0]-y[i])**2)**((len(y)*-1.)/-2.)\n', ' return L\n', '\n', 'def posterior(mu, x, sigma,a):\n', ' """\n', ' Posterior calculado con la normalizacion adecuada\n', ' """\n', ' post = like(x, sigma, mu,a) * prior(mu)\n', ' evidencia = np.trapz(post, mu)\n', ' return post/evidencia\n', '\n', 'def estimados(x,y,sigma,a):\n', ' w=2./sigma**2\n', ' alfa=w*np.sum(x**2)\n', ' beta=len(x)*w\n', ' gamma=np.sum(x)*w\n', ' p=np.sum(x*y)*w\n', ' q=np.sum(y)*w\n', ' m=(beta*p-gamma*q)/(alfa*beta-gamma**2)\n', ' c=(alfa*q-gamma*p)/(alfa*beta-gamma**2)\n', ' return m,c\n', '\n', 'def maximo_incertidumbre(x, y):\n', ' deltax = x[1] - x[0]\n', '\n', ' # maximo de y\n', ' ii = np.argmax(y)\n', '\n', ' # segunda derivada\n', ' d = (y[ii+1] - 2*y[ii] + y[ii-1]) / (deltax**2)\n', '\n', ' return x[ii], 1.0/np.sqrt(-d)\n', ' \n', 'def newsigma(a,b,x,y):\n', ' return np.sum((a*x+c-y)**2)**(2)/(len/(y)-1)\n', '\n', 'x = np.linspace(-4.0,4.0,1000)\n', 'y = np.linspace(-4.0,4.0,1000)\n', '\n', 'def metropolis(x):\n', ' \n', ' x_walk=np.empty([0,5])\n', ' x0=[(np.random.random()-0.5),(np.random.random()-0.5),(np.random.random()-0.5),(np.random.random()-0.5),(np.random.random()-0.5)]\n', ' x_walk=np.vstack((x_walk,x0))\n', ' \n', ' for i in range(20000):\n', ' x_guess=[np.random.normal(x_walk[i],0.1),np.random.normal(x_walk[i],0.1),np.random.normal(x_walk[i],0.1),np.random.normal(x_walk[i],0.1),np.random.normal(x_walk[i],0.1)]\n', ' print (x_walk[i])\n', ' \n', ' a=posterior(mu,x,sigma,x_guess)/posterior(mu,x,sigma,x_walk[i])\n', ' if a>=1.:\n', ' x_walk=np.vstack((x_walk,x_guess))\n', ' \n', ' else:\n', ' b=np.random.random()\n', ' if a>=b:\n', ' x_walk=np.vstack((x_walk,x_guess))\n', ' else:\n', ' x_walk=np.vstack((x_walk,x_walk[i]))\n', ' return x_walk()\n', ' \n', ' \n', ' \n', ' \n', '\n', '\n', '\n', '\n', ' \n', '\n', 'data = np.loadtxt("notas_andes.dat", skiprows=1)\n', 'Y = data[:,4]\n', 'X = data[:,:4]\n', 'mu = np.linspace(1E-4, 10.0, 1000)\n', 'sigma=0.1\n', '\n', '\n', 'plt.figure()\n', 'for i in range(5):\n', ' plt.subplot(2,2,i+1)\n', ' betas=metropolis(X)\n', ' plt.hist(betas[:,i],20)\n', ' plt.title(r"$m_{}={:.2f}$ $c_{}={:.2f}$".format(i+1,m,i+1,c))\n', ' plt.xlabel("x")\n', ' \n', '\n', 'plt.subplots_adjust(hspace=0.55)\n', 'plt.savefig("ajuste_bayes-mcmc.png", bbox_inches=\'tight\')\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', 'm1,c1=estimados(X[:,0],Y,sigma)\n', '\n', 'print (m1,c1)\n', '\n', '\n', 'plt.figure()\n', 'for i in range(4):\n', ' plt.subplot(2,2,i+1)\n', ' xf=np.linspace(np.amin(X[:,i]),np.amax(X[:,i]),1000)\n', ' m,c=estimados(X[:,i],Y,sigma)\n', ' plt.scatter(X[:,i], Y)\n', ' plt.plot(xf,m*xf+c)\n', ' plt.title(r"$m_{}={:.2f}$ $c_{}={:.2f}$".format(i+1,m,i+1,c))\n', ' plt.xlabel("x")\n', ' \n', '\n', 'plt.subplots_adjust(hspace=0.55)\n', 'plt.savefig("bayes.png", bbox_inches=\'tight\')\n', '\n', '\n', '\n', '\n', '\n', '\n', '"""\n', 'post = posterior(mu, X[:,0], sigma)\n', 'max, incertidumbre = maximo_incertidumbre(mu, np.log(post))\n', 'plt.figure()\n', 'plt.plot(mu, post)\n', "plt.title('$\\mu$= {:.2f} $\\pm$ {:.2f}'.format(max, incertidumbre))\n", "plt.xlabel('$\\mu$')\n", "plt.ylabel('prob($\\mu$|datos)')\n", "plt.savefig('mean.png')\n", '"""']}, {'cell_type': 'code', 'execution_count': null, 'metadata': {}, 'outputs': [], 'source': []}], 'metadata': {'kernelspec': {'display_name': 'Python 3', 'language': 'python', 'name': 'python3'}, 'language_info': {'codemirror_mode': {'name': 'ipython', 'version': 3}, 'file_extension': '.py', 'mimetype': 'text/x-python', 'name': 'python', 'nbconvert_exporter': 'python', 'pygments_lexer': 'ipython3', 'version': '3.7.6'}}, 'nbformat': 4, 'nbformat_minor': 4}
def power_level(x, y, grid_sn): rack_id = x + 10 result = rack_id * y + grid_sn result *= rack_id return (result % 1000 // 100) - 5 def create_grid(grid_sn): return [[power_level(x, y, grid_sn) for y in range(301)] for x in range(301)] def best(grid_sn, sq): grid = create_grid(grid_sn) def compute(): for x in range(1, 301 - sq): for y in range(1, 301 - sq): tp = sum(grid[xx][yy] for xx in range(x, x + sq) for yy in range(y, y + sq)) yield (x, y, tp) return max(compute(), key=lambda tpl: tpl[2]) def all_best(grid_sn): def compute(): grid = create_grid(grid_sn) for x in range(1, 301): for y in range(1, 301): yield (x, y, 1, grid[x][y]) cur = create_grid(grid_sn) for sq in range(2, 301): for x in range(1, 301 - sq): for y in range(1, 301 - sq): tp = (cur[x][y] + sum(grid[xx][y + sq - 1] for xx in range(x, x + sq - 1)) + sum(grid[x + sq - 1][yy] for yy in range(y, y + sq - 1)) + grid[x + sq - 1][y + sq - 1]) cur[x][y] = tp yield (x, y, sq, tp) return max(compute(), key=lambda tpl: tpl[3]) if __name__ == '__main__': assert power_level(122, 79, 57) == -5 assert power_level(217, 196, 39) == 0 assert power_level(101, 153, 71) == 4 assert best(18, 3) == (33, 45, 29) assert best(42, 3) == (21, 61, 30) x, y, pwr = best(5235, 3) print("Part 1: %s at %d,%d" % (pwr, x, y)) # assert all_best(18) == (90, 269, 16, 113) # assert all_best(42) == (232, 251, 12, 119) x, y, sq, pwr = all_best(5235) print("Part 2: %s at %d,%d,%d" % (pwr, x, y, sq))
def power_level(x, y, grid_sn): rack_id = x + 10 result = rack_id * y + grid_sn result *= rack_id return result % 1000 // 100 - 5 def create_grid(grid_sn): return [[power_level(x, y, grid_sn) for y in range(301)] for x in range(301)] def best(grid_sn, sq): grid = create_grid(grid_sn) def compute(): for x in range(1, 301 - sq): for y in range(1, 301 - sq): tp = sum((grid[xx][yy] for xx in range(x, x + sq) for yy in range(y, y + sq))) yield (x, y, tp) return max(compute(), key=lambda tpl: tpl[2]) def all_best(grid_sn): def compute(): grid = create_grid(grid_sn) for x in range(1, 301): for y in range(1, 301): yield (x, y, 1, grid[x][y]) cur = create_grid(grid_sn) for sq in range(2, 301): for x in range(1, 301 - sq): for y in range(1, 301 - sq): tp = cur[x][y] + sum((grid[xx][y + sq - 1] for xx in range(x, x + sq - 1))) + sum((grid[x + sq - 1][yy] for yy in range(y, y + sq - 1))) + grid[x + sq - 1][y + sq - 1] cur[x][y] = tp yield (x, y, sq, tp) return max(compute(), key=lambda tpl: tpl[3]) if __name__ == '__main__': assert power_level(122, 79, 57) == -5 assert power_level(217, 196, 39) == 0 assert power_level(101, 153, 71) == 4 assert best(18, 3) == (33, 45, 29) assert best(42, 3) == (21, 61, 30) (x, y, pwr) = best(5235, 3) print('Part 1: %s at %d,%d' % (pwr, x, y)) (x, y, sq, pwr) = all_best(5235) print('Part 2: %s at %d,%d,%d' % (pwr, x, y, sq))
class queue_array(): def __init__(self, length = 10): self.array = [None]*length self.index = 0 def __str__(self): output = "" for i in range(len(self.array)): if (self.array[i]): output += str(self.array[i]) + " -> " output += " End " return output def enqueue(self, value): if (self.full()): return "queue Full" self.array[self.index] = value self.index += 1 def dequeue(self): if (self.empty()): return "queue empty" self.index -= 1 result = self.array[0] for i in range(len(self.array)-1): self.array[i] = self.array[i+1] return result def empty(self): return (self.index == 0) def full(self): return (len(self.array) == self.index)
class Queue_Array: def __init__(self, length=10): self.array = [None] * length self.index = 0 def __str__(self): output = '' for i in range(len(self.array)): if self.array[i]: output += str(self.array[i]) + ' -> ' output += ' End ' return output def enqueue(self, value): if self.full(): return 'queue Full' self.array[self.index] = value self.index += 1 def dequeue(self): if self.empty(): return 'queue empty' self.index -= 1 result = self.array[0] for i in range(len(self.array) - 1): self.array[i] = self.array[i + 1] return result def empty(self): return self.index == 0 def full(self): return len(self.array) == self.index
# put lua51 include path before macports in case lua 5.2 is installed CPPPATH = ['__PREFIX__/include/lua-5.1', '__PREFIX__/include'] CPPDEFINES = [] LIBPATH = ['__PREFIX__/lib'] CCFLAGS = ['-fsigned-char'] LINKFLAGS = ['$__RPATH'] CC = ['__CC__'] CXX = ['__CXX__'] MINGWCPPPATH = [] MINGWLIBPATH = []
cpppath = ['__PREFIX__/include/lua-5.1', '__PREFIX__/include'] cppdefines = [] libpath = ['__PREFIX__/lib'] ccflags = ['-fsigned-char'] linkflags = ['$__RPATH'] cc = ['__CC__'] cxx = ['__CXX__'] mingwcpppath = [] mingwlibpath = []
sjzips = [ '95101', '95102', '95106', '95108', '95109', '95110', '95111', '95112', '95113', '95114', '95115', '95116', '95117', '95118', '95119', '95120', '95121', '95122', '95123', '95124', '95125', '95126', '95127', '95128', '95129', '95130', '95131', '95132', '95133', '95134', '95135', '95136', '95137', '95138', '95118', '95124', '95141', '95142', '95148', '95150', '95151', '95152', '95153', '95154', '95155', '95156', '95157', '95158', '95159', '95160', '95164', '95170', '95171', '95172', '95190', '95191', '95192', '95193', '95196', '95116' ] sfzips = ['94101', '94102', '94103', '94104', '94105', '94106', '94107', '94108', '94109', '94110', '94111', '94114', '94115', '94116', '94117', '94118', '94119', '94120', '94121', '94122', '94123', '94124', '94125', '94126', '94127', '94128', '94129', '94130', '94131', '94132', '94133', '94134', '94135', '94136', '94137', '94138', '94139', '94140', '94141', '94142', '94143', '94144', '94145', '94146', '94150', '94151', '94152', '94153', '94154', '94155', '94156', '94157', '94158', '94159', '94160', '94161', '94162', '94163', '94164', '94165', '94166', '94167', '94168', '94169', '94172', '94175', '94177']
sjzips = ['95101', '95102', '95106', '95108', '95109', '95110', '95111', '95112', '95113', '95114', '95115', '95116', '95117', '95118', '95119', '95120', '95121', '95122', '95123', '95124', '95125', '95126', '95127', '95128', '95129', '95130', '95131', '95132', '95133', '95134', '95135', '95136', '95137', '95138', '95118', '95124', '95141', '95142', '95148', '95150', '95151', '95152', '95153', '95154', '95155', '95156', '95157', '95158', '95159', '95160', '95164', '95170', '95171', '95172', '95190', '95191', '95192', '95193', '95196', '95116'] sfzips = ['94101', '94102', '94103', '94104', '94105', '94106', '94107', '94108', '94109', '94110', '94111', '94114', '94115', '94116', '94117', '94118', '94119', '94120', '94121', '94122', '94123', '94124', '94125', '94126', '94127', '94128', '94129', '94130', '94131', '94132', '94133', '94134', '94135', '94136', '94137', '94138', '94139', '94140', '94141', '94142', '94143', '94144', '94145', '94146', '94150', '94151', '94152', '94153', '94154', '94155', '94156', '94157', '94158', '94159', '94160', '94161', '94162', '94163', '94164', '94165', '94166', '94167', '94168', '94169', '94172', '94175', '94177']
#!/usr/bin/env python # This python script checks the sfincsOutput.h5 file for an example to # see if the results are close to expected values. This script may be # run directly, and it is also called when "make test" is run from the # main SFINCS directory. execfile('../testsCommon.py') desiredTolerance = 0.001 numFailures = 0 species = 0 numFailures += shouldBe("FSABFlow", species, 9.193502564773663E-003, desiredTolerance) numFailures += shouldBe("particleFlux", species, -1.078924587797651E-006, desiredTolerance) numFailures += shouldBe("heatFlux", species, -2.337320329279748E-006, desiredTolerance) species = 1 numFailures += shouldBe("FSABFlow", species, 1.441006015653415E-003, desiredTolerance) numFailures += shouldBe("particleFlux", species, -5.355677905882999E-008, desiredTolerance) numFailures += shouldBe("heatFlux", species, -1.075782052474404E-007, desiredTolerance) numFailures += shouldBe("FSABjHat", 0, 7.752496549120249E-003, desiredTolerance) exit(numFailures > 0)
execfile('../testsCommon.py') desired_tolerance = 0.001 num_failures = 0 species = 0 num_failures += should_be('FSABFlow', species, 0.009193502564773663, desiredTolerance) num_failures += should_be('particleFlux', species, -1.078924587797651e-06, desiredTolerance) num_failures += should_be('heatFlux', species, -2.337320329279748e-06, desiredTolerance) species = 1 num_failures += should_be('FSABFlow', species, 0.001441006015653415, desiredTolerance) num_failures += should_be('particleFlux', species, -5.355677905882999e-08, desiredTolerance) num_failures += should_be('heatFlux', species, -1.075782052474404e-07, desiredTolerance) num_failures += should_be('FSABjHat', 0, 0.007752496549120249, desiredTolerance) exit(numFailures > 0)
n = int(input()) if n >= 404: print("MSU") elif n >= 322: print("MPI") elif n >= 239: print("MIT") else: print(":(")
n = int(input()) if n >= 404: print('MSU') elif n >= 322: print('MPI') elif n >= 239: print('MIT') else: print(':(')
def z_algorithm(S: str): ret = [0] * len(S) ret[0] = len(S) i, j = 1, 0 while i < len(S): while i + j < len(S) and S[j] == S[i + j]: j += 1 ret[i] = j if j == 0: i += 1 continue k = 1 while i + k < len(S) and k + ret[k] < j: ret[i + k] = ret[k] k += 1 i, j = i + k, j - k return ret
def z_algorithm(S: str): ret = [0] * len(S) ret[0] = len(S) (i, j) = (1, 0) while i < len(S): while i + j < len(S) and S[j] == S[i + j]: j += 1 ret[i] = j if j == 0: i += 1 continue k = 1 while i + k < len(S) and k + ret[k] < j: ret[i + k] = ret[k] k += 1 (i, j) = (i + k, j - k) return ret
# ---------- PROBLEM : SECRET STRING ---------- # Receive a uppercase string and then hide its meaning by turning it into a string of unicode # Then translate it from unicode back into its original meaning # Enter a string to hide in uppercase # Secret Message : 34567890 # Original Message : HIDE # Input string to be encrypted orig_message = input("Enter a string in uppercase :") secret_message = '' # cycle through each character in the string for char in orig_message: # store each character code in secret message if char.isalpha(): secret_message += str(ord(char)-23) elif char.isspace(): secret_message += str(ord(char)) # Print "Secret message: 98989099" print("Secret message: ", secret_message) # Cycle through each character code 2 at a time norm_string = '' for i in range(0, len(secret_message)-1, 2): # Convert the code into characters and add them to the string char_code = secret_message[i] + secret_message[i+1] if char_code != '32': norm_string += chr(int(char_code) + 23) else: norm_string += chr(int(char_code)) # Print the string print("Original message : ", norm_string)
orig_message = input('Enter a string in uppercase :') secret_message = '' for char in orig_message: if char.isalpha(): secret_message += str(ord(char) - 23) elif char.isspace(): secret_message += str(ord(char)) print('Secret message: ', secret_message) norm_string = '' for i in range(0, len(secret_message) - 1, 2): char_code = secret_message[i] + secret_message[i + 1] if char_code != '32': norm_string += chr(int(char_code) + 23) else: norm_string += chr(int(char_code)) print('Original message : ', norm_string)
BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) GREEN = ( 0, 255, 0) #S-BLOCK RED = ( 255, 0, 0) # Z-BLOCK BLUE = (0,0,255) # J-BLOCK ORANGE = (255, 127, 0) # L-BLOCK YELLOW = (255,255,0) # O-BLOCK PURPLE = (128, 0 , 128) # T-BLOCK TURQUOISE = (64, 224, 208) # I-BLOCK x = 50 # The direction of our Blocks, LEFT/UP is negative direction y = 50 #axis # TODO: Set up rotation height = 60 width = 40 vel = 5 level = [ i for i in range(100)] level_speed = [i for i in range(10)] #This the gird the game occurs in, 16 rows by 10 coloums #tile_gird= ([], [])
black = (0, 0, 0) white = (255, 255, 255) green = (0, 255, 0) red = (255, 0, 0) blue = (0, 0, 255) orange = (255, 127, 0) yellow = (255, 255, 0) purple = (128, 0, 128) turquoise = (64, 224, 208) x = 50 y = 50 height = 60 width = 40 vel = 5 level = [i for i in range(100)] level_speed = [i for i in range(10)]
N = int(input()) mod = 10 ** 9 + 7 dp = [[[[0] * 4 for _ in range(4)] for _ in range(4)] for _ in range(N + 1)] dp[0][3][3][3] = 1 for i in range(N): for j in range(4): for k in range(4): for m in range(4): if dp[i][j][k][m] == 0: continue for l in range(4): if l == 2 and j == 1 and k == 0: continue if l == 2 and j == 0 and k == 1: continue if l == 1 and j == 2 and k == 0: continue if l == 2 and j == 1 and m == 0: continue if l == 2 and k == 1 and m == 0: continue dp[i + 1][l][j][k] += dp[i][j][k][m] dp[i + 1][l][j][k] %= mod ans = 0 for i in range(4): for j in range(4): for k in range(4): ans += dp[N][i][j][k] ans %= mod print(ans)
n = int(input()) mod = 10 ** 9 + 7 dp = [[[[0] * 4 for _ in range(4)] for _ in range(4)] for _ in range(N + 1)] dp[0][3][3][3] = 1 for i in range(N): for j in range(4): for k in range(4): for m in range(4): if dp[i][j][k][m] == 0: continue for l in range(4): if l == 2 and j == 1 and (k == 0): continue if l == 2 and j == 0 and (k == 1): continue if l == 1 and j == 2 and (k == 0): continue if l == 2 and j == 1 and (m == 0): continue if l == 2 and k == 1 and (m == 0): continue dp[i + 1][l][j][k] += dp[i][j][k][m] dp[i + 1][l][j][k] %= mod ans = 0 for i in range(4): for j in range(4): for k in range(4): ans += dp[N][i][j][k] ans %= mod print(ans)
load( "@bazel_gazelle//internal:go_repository.bzl", _go_repository = "go_repository", ) load( "@bazel_gazelle//internal:go_repository_cache.bzl", "go_repository_cache", ) load( "@bazel_gazelle//internal:go_repository_tools.bzl", "go_repository_tools", ) load( "@bazel_gazelle//internal:go_repository_config.bzl", "go_repository_config", ) load( "@bazel_tools//tools/build_defs/repo:git.bzl", _tools_git_repository = "git_repository", ) def _maybe(repo_rule, name, **kwargs): if name not in native.existing_rules(): repo_rule(name = name, **kwargs) def _go_default_dependencies(): pass def go_dependencies(): _go_default_dependencies()
load('@bazel_gazelle//internal:go_repository.bzl', _go_repository='go_repository') load('@bazel_gazelle//internal:go_repository_cache.bzl', 'go_repository_cache') load('@bazel_gazelle//internal:go_repository_tools.bzl', 'go_repository_tools') load('@bazel_gazelle//internal:go_repository_config.bzl', 'go_repository_config') load('@bazel_tools//tools/build_defs/repo:git.bzl', _tools_git_repository='git_repository') def _maybe(repo_rule, name, **kwargs): if name not in native.existing_rules(): repo_rule(name=name, **kwargs) def _go_default_dependencies(): pass def go_dependencies(): _go_default_dependencies()
# source unclear # modified to add policy funder_names = [ { "name": "Wellcome Trust", "alternate_names": "Wellcome Trust", "works_count": 13550, "id": 100004440, "policy": "plan-s", "country": "United Kingdom", "country_iso": "GB" }, # { # "name": "National Science Foundation", # "alternate_names": "National Science Foundation|NSF", # "works_count": 176506, # "id": 100000001, # "policy": None, # "country": "United States", # "country_iso": "US" # }, { "name": "Nederlandse Organisatie voor Wetenschappelijk Onderzoek", "alternate_names": "Dutch National Scientific Foundation|Dutch National Science Foundation|NWO|Netherlands Organisation for Scientific Research", "works_count": 11467, "id": 501100003246, "policy": "plan-s", "country": "Netherlands", "country_iso": "NL" }, { "id": 100000865, "country": "United States", "country_iso": "US", "name": "Bill and Melinda Gates Foundation", "alternate_names": "Bill and Melinda Gates Foundation", "policy": "plan-s" } ] # later: use http://flag-icon-css.lip.is/
funder_names = [{'name': 'Wellcome Trust', 'alternate_names': 'Wellcome Trust', 'works_count': 13550, 'id': 100004440, 'policy': 'plan-s', 'country': 'United Kingdom', 'country_iso': 'GB'}, {'name': 'Nederlandse Organisatie voor Wetenschappelijk Onderzoek', 'alternate_names': 'Dutch National Scientific Foundation|Dutch National Science Foundation|NWO|Netherlands Organisation for Scientific Research', 'works_count': 11467, 'id': 501100003246, 'policy': 'plan-s', 'country': 'Netherlands', 'country_iso': 'NL'}, {'id': 100000865, 'country': 'United States', 'country_iso': 'US', 'name': 'Bill and Melinda Gates Foundation', 'alternate_names': 'Bill and Melinda Gates Foundation', 'policy': 'plan-s'}]
'''10. Write a Python program to reverse the digits of a given number and add it to the original, If the sum is not a palindrome repeat this procedure. Note: A palindrome is a word, number, or other sequence of characters which reads the same backward as forward, such as madam or racecar.''' def reverseInteger(x): sign = -1 if x < 0 else 1 x * sign while x: if x % 10 == 0: x /= 10 else: break x = str(x) lst =list(x) lst.reverse() x = "".join(lst) x = int(x) return sign*x print(reverseInteger(234)) print(reverseInteger(894))
"""10. Write a Python program to reverse the digits of a given number and add it to the original, If the sum is not a palindrome repeat this procedure. Note: A palindrome is a word, number, or other sequence of characters which reads the same backward as forward, such as madam or racecar.""" def reverse_integer(x): sign = -1 if x < 0 else 1 x * sign while x: if x % 10 == 0: x /= 10 else: break x = str(x) lst = list(x) lst.reverse() x = ''.join(lst) x = int(x) return sign * x print(reverse_integer(234)) print(reverse_integer(894))
prefixes = { 8: "ampersand_angleBracket_currency_accent_tilde_mathPower_@_scriptIndicator_dagger_prefix", 16: "asterisk_roundBracket_basicMathSign_ditto_dash_prefix", 24: "genderSign_doubleQuotation_IP_accent_paragraphSection_degree_boldIndicator_ligaturedIndicator_prefix", 32: "capital_singleQuotation_prefix", 40: "squareBracket_percentage_greekLetter_underscore_italicIndicator_generalFractionline_prefix", 43: "shapeIndicator_prefix", 51: "arrow_Prefix", 54: "feet_inches_prefix", 56: "curlyBracket_bulletPoint_hashTag_slash_guillemet_underlineIndicator_prefix", 60: "number_musicSymbol_prefix", } prefix_8 = { 47: u'\u0026', # "ampersand" 35: u'\u3008', # "openingAngleBracket" 28: u'\u3009', # "closingAngleBracket" 9: u'\u00A2', # "cent" 14: u'\u0024', # "dollar" 17: u'\u20AC', # "euro" 7: u'\u00A3', # "pound" 61: u'\u00A5', # "yen" # Accented letters # if letter is capital capital indicator comes before accent indicator which in turn comes before the letter 44: "breve", 36: "macron", 20: u'\u007E', # "tilde" - used for approximately 34: u'\u005E', # "mathPower"8, 1 1: u'\u0040', # "@" 32: "daggerIndicator", 6: "scriptSymbol", 2: "scriptWord", 54: "scriptPassage", 4: "scriptTerminator", } prefix_8_32 = { 57: u'\u2020', # "dagger" 59: u'\u2021', # "doubleDagger" } prefix_16 = { 20: u'\u002A', # "asterisk" 35: u'\u0028', # "openingRoundBracket" 28: u'\u0029', # "closingRoundBracket" 22: u'\u002B', # "additionSign" 38: u'\u00D7', # "multiplicationSign" 12: u'\u00F7', # "divisionSign" 54: u'\u003D', # "equalsSign" 2: u'\u3003', # "ditto" 32: "emDashIndicator", 36: u'\u2212', # "enDash_minusSign" } prefix_16_32 = { 36: u'\u2014', # "emDash" } prefix_24 = { 45: u'\u2640', # "femaleGenderSign", 61: u'\u2642', # "maleGenderSign", 38: u'\u201C', # "openingDoubleQuotation" 52: u'\u201D', # "closingDoubleQuotation" 9: u'\u00A9', # "copyright" 23: u'\u00AE', # "registered" 30: u'\u2122', # "trademark" # Accented letters # if letter is capital capital indicator comes before accent indicator which in turn comes before the letter 12: "acute", 44: "caron", 47: "cedilla", 41: "circumflex", 18: "diaeresis", 33: "grave", 43: "ring", 59: "tilde", 15: u'\u2761', # "paragraph" 14: u'\u00A7', # "section" 26: u'\u00B0', # "degree" 6: "boldSymbol", 2: "boldWord", 54: "boldPassage", 4: "boldTerminator", 22: "ligatureIndicator", } # could have signified a capital letter if subsequent cell is not one of these prefix_32 = { 38: u'\u2018', # "openingSingleQuotation", 52: u'\u2019', # "closingSingleQuotation", 32: "capitalWord", 4: "capitalTerminator" } prefix_32_32 = { 32: "capitalPassage" } prefix_40 = { 35: u'\u005B', # "openingSquareBracket" 28: u'\u005D', # "closingSquareBracket" 52: u'\u0025', # "percentage" 36: u'\u005F', # "underscore" 12: u'\u2044', # "generalFractionLine" 6: "italicSymbol", 2: "italicWord", 54: "italicPassage", 4: "italicTerminator", # greek # comes before every greek letter # if letter is capital - capital indicator (32) comes before each indicator 1: u'\u03B1', # alpha 3: u'\u03B2', # "beta" 27: u'\u03B3', # "gamma" 25: u'\u03B4', # "delta" 17: u'\u03B5', # "epsilon" 53: u'\u03B6', # "zeta" 49: u'\u03B7', # "eta" 57: u'\u03B8', # "theta" 10: u'\u03B9', # "iota" 5: u'\u03BA', # "kappa" 7: u'\u03BB', # "lambda" 13: u'\u03BC', # "mu" 29: u'\u03BD', # "nu" 45: u'\u03BE', # "xi" 21: u'\u03BF', # "omicron" 15: u'\u03C0', # "pi" 23: u'\u03C1', # "rho" 14: u'\u03C3', # "sigma" 30: u'\u03C4', # "tau" 37: u'\u03C5', # "upsilon" 11: u'\u03C6', # "phi" 47: u'\u03C7', # "chi" 61: u'\u03C8', # "psi" 58: u'\u03C9', # "omega" } prefix_43 = { 63: u'\u25CF', # "circle" 60: "squareTriangleIndicator" } prefix_43_60 = { 25: u'\u25A0', # "square" 9: u'\u25B2', # "triangle" } # Arrows prefix_51 = { 21: u'\u2192', # "rightArrow" 42: u'\u2190', # "leftArrow" 41: u'\u2193', # "downArrow" 44: u'\u2191', # "upArrow" 14: u'\u2197', # "upRightArrow" 35: u'\u2198', # "downRightArrow" 28: u'\u2199', # "downLeftArrow" 49: u'\u2196', # "upLeftArrow" } # not here - feet prefix_54 = { 54: u'\u2033' # " (inches) } prefix_56 = { 35: u'\u007B', # "openingCurlyBracket" 28: u'\u007D', # "closingCurlyBracket" 50: u'\u2022', # "bulletPoint" 57: u'\u0023', # "hashTag" 33: u'\u2216', # "backwardSlash" 12: u'\u2215', # "forwardSlash" 38: u'\u00AB', # "openingGuillemet" 52: u'\u00BB', # "closingGuillement" 6: "underlineSymbol", 2: "underlineWord", 54: "underlinePassage", 4: "underlineTerminator", } # UEB Music prefix_60 = { 35: u'\u266D', # "flat" 33: u'\u266E', # "natural" 41: u'\u266F', # "sharp" } numberMode = { 48: "grade1Indicator", # used if number is followed by a lowercase letter from "a-j" (even if there is a "." or "," after number 16: "numericSpace" } letters = { 1: u'\u0061', # a 3: u'\u0062', # b 9: u'\u0063', # c 25: u'\u0064', # d 17: u'\u0065', # e 11: u'\u0066', # f 27: u'\u0067', # g 19: u'\u0068', # h 10: u'\u0069', # i 26: u'\u006A', # j 5: u'\u006B', # k 7: u'\u006C', # l 13: u'\u006D', # m 29: u'\u006E', # n 21: u'\u006F', # o 15: u'\u0070', # p 31: u'\u0071', # q 23: u'\u0072', # r 14: u'\u0073', # s 30: u'\u0074', # t 37: u'\u0075', # u 39: u'\u0076', # v 58: u'\u0077', # w 45: u'\u0078', # x 61: u'\u0079', # y 53: u'\u007A' # z } numbers = { 26: u'\u0030', 1: u'\u0031', 3: u'\u0032', 9: u'\u0033', 25: u'\u0034', 17: u'\u0035', 11: u'\u0036', 27: u'\u0037', 19: u'\u0038', 10: u'\u0039' } basicPunctuation = { 4: "apostrophe_capitalTerminator", # capitalTerminator only required when following a capital prefix (word/passage) 2: u'\u002C', # comma 36: u'\u002D', # hyphen 50: u'\u002E', # full stop - 3 in a row is an elipsis 22: u'\u0021', # exclamation mark 6: u'\u003B', # semi-colon 18: u'\u003A', # colon 38: "questionMark_openingNonSpecificQuotation", 52: "'", # 41: u'\u221A', # "openSquareRoot", 44: "closeSquareRoot", 34: "subscriptIndicator", 20: "superscriptIndicator", 12: u'\u2044', # "simpleNumericFractionLine" 55: "generalFractionOpenIndicator", 62: "generalFractionCloseIndicator", 49: "shapeTerminator" # not required if shape is followed by space (only followed by letter, number or punctuation) }
prefixes = {8: 'ampersand_angleBracket_currency_accent_tilde_mathPower_@_scriptIndicator_dagger_prefix', 16: 'asterisk_roundBracket_basicMathSign_ditto_dash_prefix', 24: 'genderSign_doubleQuotation_IP_accent_paragraphSection_degree_boldIndicator_ligaturedIndicator_prefix', 32: 'capital_singleQuotation_prefix', 40: 'squareBracket_percentage_greekLetter_underscore_italicIndicator_generalFractionline_prefix', 43: 'shapeIndicator_prefix', 51: 'arrow_Prefix', 54: 'feet_inches_prefix', 56: 'curlyBracket_bulletPoint_hashTag_slash_guillemet_underlineIndicator_prefix', 60: 'number_musicSymbol_prefix'} prefix_8 = {47: u'&', 35: u'〈', 28: u'〉', 9: u'¢', 14: u'$', 17: u'€', 7: u'£', 61: u'¥', 44: 'breve', 36: 'macron', 20: u'~', 34: u'^', 1: u'@', 32: 'daggerIndicator', 6: 'scriptSymbol', 2: 'scriptWord', 54: 'scriptPassage', 4: 'scriptTerminator'} prefix_8_32 = {57: u'†', 59: u'‡'} prefix_16 = {20: u'*', 35: u'(', 28: u')', 22: u'+', 38: u'×', 12: u'÷', 54: u'=', 2: u'〃', 32: 'emDashIndicator', 36: u'−'} prefix_16_32 = {36: u'—'} prefix_24 = {45: u'♀', 61: u'♂', 38: u'“', 52: u'”', 9: u'©', 23: u'®', 30: u'™', 12: 'acute', 44: 'caron', 47: 'cedilla', 41: 'circumflex', 18: 'diaeresis', 33: 'grave', 43: 'ring', 59: 'tilde', 15: u'❡', 14: u'§', 26: u'°', 6: 'boldSymbol', 2: 'boldWord', 54: 'boldPassage', 4: 'boldTerminator', 22: 'ligatureIndicator'} prefix_32 = {38: u'‘', 52: u'’', 32: 'capitalWord', 4: 'capitalTerminator'} prefix_32_32 = {32: 'capitalPassage'} prefix_40 = {35: u'[', 28: u']', 52: u'%', 36: u'_', 12: u'⁄', 6: 'italicSymbol', 2: 'italicWord', 54: 'italicPassage', 4: 'italicTerminator', 1: u'α', 3: u'β', 27: u'γ', 25: u'δ', 17: u'ε', 53: u'ζ', 49: u'η', 57: u'θ', 10: u'ι', 5: u'κ', 7: u'λ', 13: u'μ', 29: u'ν', 45: u'ξ', 21: u'ο', 15: u'π', 23: u'ρ', 14: u'σ', 30: u'τ', 37: u'υ', 11: u'φ', 47: u'χ', 61: u'ψ', 58: u'ω'} prefix_43 = {63: u'●', 60: 'squareTriangleIndicator'} prefix_43_60 = {25: u'■', 9: u'▲'} prefix_51 = {21: u'→', 42: u'←', 41: u'↓', 44: u'↑', 14: u'↗', 35: u'↘', 28: u'↙', 49: u'↖'} prefix_54 = {54: u'″'} prefix_56 = {35: u'{', 28: u'}', 50: u'•', 57: u'#', 33: u'∖', 12: u'∕', 38: u'«', 52: u'»', 6: 'underlineSymbol', 2: 'underlineWord', 54: 'underlinePassage', 4: 'underlineTerminator'} prefix_60 = {35: u'♭', 33: u'♮', 41: u'♯'} number_mode = {48: 'grade1Indicator', 16: 'numericSpace'} letters = {1: u'a', 3: u'b', 9: u'c', 25: u'd', 17: u'e', 11: u'f', 27: u'g', 19: u'h', 10: u'i', 26: u'j', 5: u'k', 7: u'l', 13: u'm', 29: u'n', 21: u'o', 15: u'p', 31: u'q', 23: u'r', 14: u's', 30: u't', 37: u'u', 39: u'v', 58: u'w', 45: u'x', 61: u'y', 53: u'z'} numbers = {26: u'0', 1: u'1', 3: u'2', 9: u'3', 25: u'4', 17: u'5', 11: u'6', 27: u'7', 19: u'8', 10: u'9'} basic_punctuation = {4: 'apostrophe_capitalTerminator', 2: u',', 36: u'-', 50: u'.', 22: u'!', 6: u';', 18: u':', 38: 'questionMark_openingNonSpecificQuotation', 52: "'", 41: u'√', 44: 'closeSquareRoot', 34: 'subscriptIndicator', 20: 'superscriptIndicator', 12: u'⁄', 55: 'generalFractionOpenIndicator', 62: 'generalFractionCloseIndicator', 49: 'shapeTerminator'}
class Solution: def minCostClimbingStairs(self, cost: List[int]) -> int: l = len(cost) if l == 2: return min(cost) res = [0] * (l) for i in range(2, l): res[i] = min(cost[i-1] + res[i-1], res[i-2] + cost[i-2]) return min(res[l-1] + cost[l-1], res[l-2] + cost[l-2])
class Solution: def min_cost_climbing_stairs(self, cost: List[int]) -> int: l = len(cost) if l == 2: return min(cost) res = [0] * l for i in range(2, l): res[i] = min(cost[i - 1] + res[i - 1], res[i - 2] + cost[i - 2]) return min(res[l - 1] + cost[l - 1], res[l - 2] + cost[l - 2])
def get_max(lst): return max(lst) def get_min(lst): return min(lst) def get_avg(lst): return sum(lst)/len(lst)
def get_max(lst): return max(lst) def get_min(lst): return min(lst) def get_avg(lst): return sum(lst) / len(lst)
# -*- coding: utf-8 -*- linha = int(input()) coluna = int(input()) if linha == coluna: corCasaInferiorDireito = 1 elif linha % 2 == 0: if coluna % 2 != 0: corCasaInferiorDireito = 0 else: corCasaInferiorDireito = 1 elif linha % 2 != 0: if coluna % 2 != 0: corCasaInferiorDireito = 1 else: corCasaInferiorDireito = 0 print(corCasaInferiorDireito)
linha = int(input()) coluna = int(input()) if linha == coluna: cor_casa_inferior_direito = 1 elif linha % 2 == 0: if coluna % 2 != 0: cor_casa_inferior_direito = 0 else: cor_casa_inferior_direito = 1 elif linha % 2 != 0: if coluna % 2 != 0: cor_casa_inferior_direito = 1 else: cor_casa_inferior_direito = 0 print(corCasaInferiorDireito)
# read file file = open('data.txt') data = file.read() file.close() # write file out = open('data2.txt', 'w') out.write(data) out.close()
file = open('data.txt') data = file.read() file.close() out = open('data2.txt', 'w') out.write(data) out.close()
# # PySNMP MIB module BDCOM-MEMORY-POOL-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BDCOM-MEMORY-POOL-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:19:51 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection") Percent, = mibBuilder.importSymbols("BDCOM-QOS-PIB-MIB", "Percent") bdMgmt, = mibBuilder.importSymbols("BDCOM-SMI", "bdMgmt") NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup") Counter64, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, NotificationType, iso, Unsigned32, MibIdentifier, Bits, Gauge32, Counter32, ObjectIdentity, TimeTicks, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "NotificationType", "iso", "Unsigned32", "MibIdentifier", "Bits", "Gauge32", "Counter32", "ObjectIdentity", "TimeTicks", "IpAddress") DisplayString, TruthValue, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TruthValue", "TextualConvention") bdcomMemoryPoolMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 3320, 9, 48)) bdcomMemoryPoolMIB.setRevisions(('2003-10-16 00:00',)) if mibBuilder.loadTexts: bdcomMemoryPoolMIB.setLastUpdated('200310160000Z') if mibBuilder.loadTexts: bdcomMemoryPoolMIB.setOrganization('BDCOM, Inc.') class BDCOMMemoryPoolTypes(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 65535) bdcomMemoryPoolObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1)) bdcomMemoryPoolTable = MibTable((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1), ) if mibBuilder.loadTexts: bdcomMemoryPoolTable.setStatus('current') bdcomMemoryPoolEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1), ).setIndexNames((0, "BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolType")) if mibBuilder.loadTexts: bdcomMemoryPoolEntry.setStatus('current') bdcomMemoryPoolType = MibTableColumn((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 1), BDCOMMemoryPoolTypes()) if mibBuilder.loadTexts: bdcomMemoryPoolType.setStatus('current') bdcomMemoryPoolName = MibTableColumn((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: bdcomMemoryPoolName.setStatus('current') bdcomMemoryPoolAlternate = MibTableColumn((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: bdcomMemoryPoolAlternate.setStatus('current') bdcomMemoryPoolValid = MibTableColumn((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 4), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: bdcomMemoryPoolValid.setStatus('current') bdcomMemoryPoolUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 5), Gauge32()).setUnits('bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: bdcomMemoryPoolUsed.setStatus('current') bdcomMemoryPoolFree = MibTableColumn((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 6), Gauge32()).setUnits('bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: bdcomMemoryPoolFree.setStatus('current') bdcomMemoryPoolLargestFree = MibTableColumn((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 7), Gauge32()).setUnits('bytes').setMaxAccess("readonly") if mibBuilder.loadTexts: bdcomMemoryPoolLargestFree.setStatus('current') bdcomMemoryPoolUtilizationTable = MibTable((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 2), ) if mibBuilder.loadTexts: bdcomMemoryPoolUtilizationTable.setStatus('current') bdcomMemoryPoolUtilizationEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 2, 1), ) bdcomMemoryPoolEntry.registerAugmentions(("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolUtilizationEntry")) bdcomMemoryPoolUtilizationEntry.setIndexNames(*bdcomMemoryPoolEntry.getIndexNames()) if mibBuilder.loadTexts: bdcomMemoryPoolUtilizationEntry.setStatus('current') bdcomMemoryPoolUtilization1Min = MibTableColumn((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 2, 1, 1), Percent()).setMaxAccess("readonly") if mibBuilder.loadTexts: bdcomMemoryPoolUtilization1Min.setStatus('current') bdcomMemoryPoolUtilization5Min = MibTableColumn((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 2, 1, 2), Percent()).setMaxAccess("readonly") if mibBuilder.loadTexts: bdcomMemoryPoolUtilization5Min.setStatus('current') bdcomMemoryPoolUtilization10Min = MibTableColumn((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 2, 1, 3), Percent()).setMaxAccess("readonly") if mibBuilder.loadTexts: bdcomMemoryPoolUtilization10Min.setStatus('current') bdcomMemoryPoolNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 3320, 9, 48, 2)) bdcomMemoryPoolConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3)) bdcomMemoryPoolCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 1)) bdcomMemoryPoolGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 2)) bdcomMemoryPoolCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 1, 1)).setObjects(("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): bdcomMemoryPoolCompliance = bdcomMemoryPoolCompliance.setStatus('deprecated') bdcomMemoryPoolComplianceRev1 = ModuleCompliance((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 1, 2)).setObjects(("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolGroup"), ("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolUtilizationGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): bdcomMemoryPoolComplianceRev1 = bdcomMemoryPoolComplianceRev1.setStatus('current') bdcomMemoryPoolGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 2, 1)).setObjects(("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolName"), ("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolAlternate"), ("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolValid"), ("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolUsed"), ("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolFree"), ("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolLargestFree")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): bdcomMemoryPoolGroup = bdcomMemoryPoolGroup.setStatus('current') bdcomMemoryPoolUtilizationGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 2, 2)).setObjects(("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolUtilization1Min"), ("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolUtilization5Min"), ("BDCOM-MEMORY-POOL-MIB", "bdcomMemoryPoolUtilization10Min")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): bdcomMemoryPoolUtilizationGroup = bdcomMemoryPoolUtilizationGroup.setStatus('current') mibBuilder.exportSymbols("BDCOM-MEMORY-POOL-MIB", bdcomMemoryPoolCompliances=bdcomMemoryPoolCompliances, bdcomMemoryPoolTable=bdcomMemoryPoolTable, bdcomMemoryPoolUtilization5Min=bdcomMemoryPoolUtilization5Min, bdcomMemoryPoolMIB=bdcomMemoryPoolMIB, bdcomMemoryPoolConformance=bdcomMemoryPoolConformance, bdcomMemoryPoolGroup=bdcomMemoryPoolGroup, bdcomMemoryPoolEntry=bdcomMemoryPoolEntry, bdcomMemoryPoolComplianceRev1=bdcomMemoryPoolComplianceRev1, bdcomMemoryPoolAlternate=bdcomMemoryPoolAlternate, bdcomMemoryPoolUtilization1Min=bdcomMemoryPoolUtilization1Min, bdcomMemoryPoolUsed=bdcomMemoryPoolUsed, bdcomMemoryPoolType=bdcomMemoryPoolType, bdcomMemoryPoolLargestFree=bdcomMemoryPoolLargestFree, bdcomMemoryPoolNotifications=bdcomMemoryPoolNotifications, bdcomMemoryPoolGroups=bdcomMemoryPoolGroups, bdcomMemoryPoolName=bdcomMemoryPoolName, bdcomMemoryPoolFree=bdcomMemoryPoolFree, bdcomMemoryPoolUtilizationGroup=bdcomMemoryPoolUtilizationGroup, bdcomMemoryPoolValid=bdcomMemoryPoolValid, bdcomMemoryPoolObjects=bdcomMemoryPoolObjects, bdcomMemoryPoolUtilizationTable=bdcomMemoryPoolUtilizationTable, BDCOMMemoryPoolTypes=BDCOMMemoryPoolTypes, bdcomMemoryPoolUtilizationEntry=bdcomMemoryPoolUtilizationEntry, PYSNMP_MODULE_ID=bdcomMemoryPoolMIB, bdcomMemoryPoolCompliance=bdcomMemoryPoolCompliance, bdcomMemoryPoolUtilization10Min=bdcomMemoryPoolUtilization10Min)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, single_value_constraint, constraints_union, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'ConstraintsIntersection') (percent,) = mibBuilder.importSymbols('BDCOM-QOS-PIB-MIB', 'Percent') (bd_mgmt,) = mibBuilder.importSymbols('BDCOM-SMI', 'bdMgmt') (notification_group, module_compliance, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance', 'ObjectGroup') (counter64, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, module_identity, notification_type, iso, unsigned32, mib_identifier, bits, gauge32, counter32, object_identity, time_ticks, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ModuleIdentity', 'NotificationType', 'iso', 'Unsigned32', 'MibIdentifier', 'Bits', 'Gauge32', 'Counter32', 'ObjectIdentity', 'TimeTicks', 'IpAddress') (display_string, truth_value, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TruthValue', 'TextualConvention') bdcom_memory_pool_mib = module_identity((1, 3, 6, 1, 4, 1, 3320, 9, 48)) bdcomMemoryPoolMIB.setRevisions(('2003-10-16 00:00',)) if mibBuilder.loadTexts: bdcomMemoryPoolMIB.setLastUpdated('200310160000Z') if mibBuilder.loadTexts: bdcomMemoryPoolMIB.setOrganization('BDCOM, Inc.') class Bdcommemorypooltypes(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + value_range_constraint(1, 65535) bdcom_memory_pool_objects = mib_identifier((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1)) bdcom_memory_pool_table = mib_table((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1)) if mibBuilder.loadTexts: bdcomMemoryPoolTable.setStatus('current') bdcom_memory_pool_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1)).setIndexNames((0, 'BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolType')) if mibBuilder.loadTexts: bdcomMemoryPoolEntry.setStatus('current') bdcom_memory_pool_type = mib_table_column((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 1), bdcom_memory_pool_types()) if mibBuilder.loadTexts: bdcomMemoryPoolType.setStatus('current') bdcom_memory_pool_name = mib_table_column((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: bdcomMemoryPoolName.setStatus('current') bdcom_memory_pool_alternate = mib_table_column((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: bdcomMemoryPoolAlternate.setStatus('current') bdcom_memory_pool_valid = mib_table_column((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 4), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: bdcomMemoryPoolValid.setStatus('current') bdcom_memory_pool_used = mib_table_column((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 5), gauge32()).setUnits('bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: bdcomMemoryPoolUsed.setStatus('current') bdcom_memory_pool_free = mib_table_column((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 6), gauge32()).setUnits('bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: bdcomMemoryPoolFree.setStatus('current') bdcom_memory_pool_largest_free = mib_table_column((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 1, 1, 7), gauge32()).setUnits('bytes').setMaxAccess('readonly') if mibBuilder.loadTexts: bdcomMemoryPoolLargestFree.setStatus('current') bdcom_memory_pool_utilization_table = mib_table((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 2)) if mibBuilder.loadTexts: bdcomMemoryPoolUtilizationTable.setStatus('current') bdcom_memory_pool_utilization_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 2, 1)) bdcomMemoryPoolEntry.registerAugmentions(('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolUtilizationEntry')) bdcomMemoryPoolUtilizationEntry.setIndexNames(*bdcomMemoryPoolEntry.getIndexNames()) if mibBuilder.loadTexts: bdcomMemoryPoolUtilizationEntry.setStatus('current') bdcom_memory_pool_utilization1_min = mib_table_column((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 2, 1, 1), percent()).setMaxAccess('readonly') if mibBuilder.loadTexts: bdcomMemoryPoolUtilization1Min.setStatus('current') bdcom_memory_pool_utilization5_min = mib_table_column((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 2, 1, 2), percent()).setMaxAccess('readonly') if mibBuilder.loadTexts: bdcomMemoryPoolUtilization5Min.setStatus('current') bdcom_memory_pool_utilization10_min = mib_table_column((1, 3, 6, 1, 4, 1, 3320, 9, 48, 1, 2, 1, 3), percent()).setMaxAccess('readonly') if mibBuilder.loadTexts: bdcomMemoryPoolUtilization10Min.setStatus('current') bdcom_memory_pool_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 3320, 9, 48, 2)) bdcom_memory_pool_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3)) bdcom_memory_pool_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 1)) bdcom_memory_pool_groups = mib_identifier((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 2)) bdcom_memory_pool_compliance = module_compliance((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 1, 1)).setObjects(('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): bdcom_memory_pool_compliance = bdcomMemoryPoolCompliance.setStatus('deprecated') bdcom_memory_pool_compliance_rev1 = module_compliance((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 1, 2)).setObjects(('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolGroup'), ('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolUtilizationGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): bdcom_memory_pool_compliance_rev1 = bdcomMemoryPoolComplianceRev1.setStatus('current') bdcom_memory_pool_group = object_group((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 2, 1)).setObjects(('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolName'), ('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolAlternate'), ('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolValid'), ('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolUsed'), ('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolFree'), ('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolLargestFree')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): bdcom_memory_pool_group = bdcomMemoryPoolGroup.setStatus('current') bdcom_memory_pool_utilization_group = object_group((1, 3, 6, 1, 4, 1, 3320, 9, 48, 3, 2, 2)).setObjects(('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolUtilization1Min'), ('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolUtilization5Min'), ('BDCOM-MEMORY-POOL-MIB', 'bdcomMemoryPoolUtilization10Min')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): bdcom_memory_pool_utilization_group = bdcomMemoryPoolUtilizationGroup.setStatus('current') mibBuilder.exportSymbols('BDCOM-MEMORY-POOL-MIB', bdcomMemoryPoolCompliances=bdcomMemoryPoolCompliances, bdcomMemoryPoolTable=bdcomMemoryPoolTable, bdcomMemoryPoolUtilization5Min=bdcomMemoryPoolUtilization5Min, bdcomMemoryPoolMIB=bdcomMemoryPoolMIB, bdcomMemoryPoolConformance=bdcomMemoryPoolConformance, bdcomMemoryPoolGroup=bdcomMemoryPoolGroup, bdcomMemoryPoolEntry=bdcomMemoryPoolEntry, bdcomMemoryPoolComplianceRev1=bdcomMemoryPoolComplianceRev1, bdcomMemoryPoolAlternate=bdcomMemoryPoolAlternate, bdcomMemoryPoolUtilization1Min=bdcomMemoryPoolUtilization1Min, bdcomMemoryPoolUsed=bdcomMemoryPoolUsed, bdcomMemoryPoolType=bdcomMemoryPoolType, bdcomMemoryPoolLargestFree=bdcomMemoryPoolLargestFree, bdcomMemoryPoolNotifications=bdcomMemoryPoolNotifications, bdcomMemoryPoolGroups=bdcomMemoryPoolGroups, bdcomMemoryPoolName=bdcomMemoryPoolName, bdcomMemoryPoolFree=bdcomMemoryPoolFree, bdcomMemoryPoolUtilizationGroup=bdcomMemoryPoolUtilizationGroup, bdcomMemoryPoolValid=bdcomMemoryPoolValid, bdcomMemoryPoolObjects=bdcomMemoryPoolObjects, bdcomMemoryPoolUtilizationTable=bdcomMemoryPoolUtilizationTable, BDCOMMemoryPoolTypes=BDCOMMemoryPoolTypes, bdcomMemoryPoolUtilizationEntry=bdcomMemoryPoolUtilizationEntry, PYSNMP_MODULE_ID=bdcomMemoryPoolMIB, bdcomMemoryPoolCompliance=bdcomMemoryPoolCompliance, bdcomMemoryPoolUtilization10Min=bdcomMemoryPoolUtilization10Min)
a = int(input()) x = "" c = 0 b = False for i in range(a): x += input() for char in x: if char == "{": c += 1 elif char == "}": c -= 1 if c < 0: b = True break if c != 0 or b: print("N") else: print("S")
a = int(input()) x = '' c = 0 b = False for i in range(a): x += input() for char in x: if char == '{': c += 1 elif char == '}': c -= 1 if c < 0: b = True break if c != 0 or b: print('N') else: print('S')
class Contact: def __init__(self, name, midname, last_name, nick, title, comp_name, address, home, email, date, birth_month, birth_year): self.name = name self.midname = midname self.last_name = last_name self.nick = nick self.title = title self.comp_name = comp_name self.address = address self.home = home self.email = email self.date = date self.birth_month = birth_month self.birth_year = birth_year
class Contact: def __init__(self, name, midname, last_name, nick, title, comp_name, address, home, email, date, birth_month, birth_year): self.name = name self.midname = midname self.last_name = last_name self.nick = nick self.title = title self.comp_name = comp_name self.address = address self.home = home self.email = email self.date = date self.birth_month = birth_month self.birth_year = birth_year
def hex_to_rgb(hex_code): hex_code = hex_code.lstrip('#') return tuple(int(hex_code[i:i + 2], 16) for i in (0, 2, 4)) def rgb_to_float(red, green, blue): return tuple(x / 255.0 for x in (red, green, blue)) def hex_to_float(hex_code): rgb = hex_to_rgb(hex_code) return rgb_to_float(*rgb) class Color: def __init__(self, hex_code, alpha=1.0): self.hex = hex_code.lstrip('#') self.red, self.green, self.blue = hex_to_float(self.hex) self.alpha = alpha
def hex_to_rgb(hex_code): hex_code = hex_code.lstrip('#') return tuple((int(hex_code[i:i + 2], 16) for i in (0, 2, 4))) def rgb_to_float(red, green, blue): return tuple((x / 255.0 for x in (red, green, blue))) def hex_to_float(hex_code): rgb = hex_to_rgb(hex_code) return rgb_to_float(*rgb) class Color: def __init__(self, hex_code, alpha=1.0): self.hex = hex_code.lstrip('#') (self.red, self.green, self.blue) = hex_to_float(self.hex) self.alpha = alpha
def isPrime(num): for k in range(2, num // 2): if (num % k == 0): return False return True numSets = int(input()) for _ in range(numSets): num = int(input()) print("%d " % num, end='') if (isPrime(num)): print("0") else: i = num - 1 while True: if (isPrime(i)): break else: i = i - 1 j = num + 1 while True: if (isPrime(j)): break else: j = j + 1 if num - i <= j - num: print("%d" % (num - i)) else: print("%d" % (j - num))
def is_prime(num): for k in range(2, num // 2): if num % k == 0: return False return True num_sets = int(input()) for _ in range(numSets): num = int(input()) print('%d ' % num, end='') if is_prime(num): print('0') else: i = num - 1 while True: if is_prime(i): break else: i = i - 1 j = num + 1 while True: if is_prime(j): break else: j = j + 1 if num - i <= j - num: print('%d' % (num - i)) else: print('%d' % (j - num))
class Employee: num_of_emps = 0 raise_amount = 1.04 def __init__ (self, first, last, pay): self.first = first self.last = last self.pay = pay self.email = f'{first.lower()}.{last.lower()}@company.com' #first + '.' + last + '@company.com' Employee.num_of_emps += 1 def fullname(self): return f'{self.first} {self.last}' def apply_raise(self): self.pay = int(self.pay * self.raise_amount) def __repr__(self): return f"Employee('{self.first}','{self.last}', {self.pay})" #"Employee('{}', '{}', {})".format(self.first, self.last, self.pay) def __str__(self): return f'{self.fullname()} - {self.email}' def __len__ (self): return len(self.fullname()) @classmethod def set_raise_amount(cls, amount): cls.raise_amount = amount @classmethod def from_string(cls, emp_str): first, last, pay = emp_str.split('-') return cls(first, last, pay) @staticmethod def is_workday(day): if day.weekday() == 5 or day.weekday() == 6: return False return True def __add__ (self, other): return self.pay + other.pay class Developer(Employee): #Subclasse raise_amount = 1.1 def __init__ (self, first, last, pay, prog_lang): super().__init__(first, last, pay) self.prog_lang = prog_lang class Manager(Employee): #Subclasse def __init__ (self, first, last, pay, employees=None): super().__init__(first, last, pay) if employees is None: self.employees = [] else: self.employees = employees def add_emp(self, emp): if emp not in self.empolyees: self.employees.append(emp) def remove_emp(self, emp): if emp in self.employees: self.employees.remove(emp) def print_emps(self): for emp in self.employees: print('-->', emp.fullname()) emp_1 = Employee('Corey', 'Schafer', 5000) emp_2 = Employee('Thiago', 'Antunes', 6000,) dev_1 = Developer('Smith', 'Will', 8000, 'JavaScript') dev_2 = Developer('Thiago', 'Antunes', 6000, 'Java') mngr1 = Manager('Sue', 'Smith', 90000, [dev_1, dev_2]) # emp_string_1 = 'Rod-Stewart-5000' # new_emp_1 = Employee.from_string(emp_string_1) # print(new_emp_1.email) # print(emp_1.__len__()) # print(emp_1 + emp_2) # print(emp_1) # print(repr(emp_1)) # print(str(emp_1)) # print(emp_1.__str__()) # print(emp_1.__repr__()) # print(issubclass(Developer, Manager)) # print(isinstance(mngr1, Employee)) # print(mngr1.email) # mngr1.remove_emp(dev_2) # mngr1.print_emps() # print(dev_1.email) # print(dev_1.prog_lang) # print(emp_1.email) # import datetime # my_date = datetime.date(2016, 7, 11) # print(Employee.is_workday(my_date)) # emp_3 = Employee('Test', 'User', 7000) # emp_string_1 = 'John-Doe-7000' # print(new_emp_1.email) # Employee.set_raise_amount(1.25) # emp_1.raise_amount = 1.55 # print(Employee.raise_amount) # print(emp_1.raise_amount) # print(emp_1.pay) # emp_1.raise_amount = 1.15 # print(Employee.raise_amount) # print(emp_1.raise_amount) # emp_1.apply_raise() # print(emp_1.pay) # print(Employee.fullname(emp_1)) # print(emp_1.fullname()) # print(Employee.num_of_emps) # print(int.__add__(1,2)) # print(str.__add__('a', 'b')) # print(len(emp_1))
class Employee: num_of_emps = 0 raise_amount = 1.04 def __init__(self, first, last, pay): self.first = first self.last = last self.pay = pay self.email = f'{first.lower()}.{last.lower()}@company.com' Employee.num_of_emps += 1 def fullname(self): return f'{self.first} {self.last}' def apply_raise(self): self.pay = int(self.pay * self.raise_amount) def __repr__(self): return f"Employee('{self.first}','{self.last}', {self.pay})" def __str__(self): return f'{self.fullname()} - {self.email}' def __len__(self): return len(self.fullname()) @classmethod def set_raise_amount(cls, amount): cls.raise_amount = amount @classmethod def from_string(cls, emp_str): (first, last, pay) = emp_str.split('-') return cls(first, last, pay) @staticmethod def is_workday(day): if day.weekday() == 5 or day.weekday() == 6: return False return True def __add__(self, other): return self.pay + other.pay class Developer(Employee): raise_amount = 1.1 def __init__(self, first, last, pay, prog_lang): super().__init__(first, last, pay) self.prog_lang = prog_lang class Manager(Employee): def __init__(self, first, last, pay, employees=None): super().__init__(first, last, pay) if employees is None: self.employees = [] else: self.employees = employees def add_emp(self, emp): if emp not in self.empolyees: self.employees.append(emp) def remove_emp(self, emp): if emp in self.employees: self.employees.remove(emp) def print_emps(self): for emp in self.employees: print('-->', emp.fullname()) emp_1 = employee('Corey', 'Schafer', 5000) emp_2 = employee('Thiago', 'Antunes', 6000) dev_1 = developer('Smith', 'Will', 8000, 'JavaScript') dev_2 = developer('Thiago', 'Antunes', 6000, 'Java') mngr1 = manager('Sue', 'Smith', 90000, [dev_1, dev_2])
# 1 test case failed def isPrime(n) : if (n <= 1) : return False if (n <= 3) : return True if (n % 2 == 0 or n % 3 == 0) : return False i = 5 while(i * i <= n) : if (n % i == 0 or n % (i + 2) == 0) : return False i = i + 6 return True n = int(input()) arr = list(map(int, input().split())) stack = [] queue = [] for i in arr: if isPrime(i): queue.append(i) else: stack.append(i) for i in queue: print(i, end = " ") print() stack = reversed(stack) for i in stack: print(i, end = " ")
def is_prime(n): if n <= 1: return False if n <= 3: return True if n % 2 == 0 or n % 3 == 0: return False i = 5 while i * i <= n: if n % i == 0 or n % (i + 2) == 0: return False i = i + 6 return True n = int(input()) arr = list(map(int, input().split())) stack = [] queue = [] for i in arr: if is_prime(i): queue.append(i) else: stack.append(i) for i in queue: print(i, end=' ') print() stack = reversed(stack) for i in stack: print(i, end=' ')
sol = [0,1] disBS = False def disG(n: int): print( "Sequence number " + str(n) + " is " + str(get(n)) ) def disS(n: int): print( str(n) + " is sequence " + str(search(n)) ) def solT(): print( "Solution Table: \n" + "\t" + str(sol) ) def get(n: int) -> int: if(len(sol) - 1 >= n): # Then we have the solution return sol[n] else: # We must find the solution sol.append( get(n-1) + get(n-2)) return sol[n] def search(n: int) -> int: size = len(sol) - 1 try: if(sol[size] <= n): # We must find the solution while(sol[size] < n): # We get the next fib number until we calculate it print("sol: " + str(sol[size]) + " | n: " + str(n) ) print(get(size + 1)) size += 1 if (sol[-1] == n): return len(sol) - 1 else: # Invalid Fib number raise Exception("Invalid Fib Number") else: val = bs(n) return val except Exception as e: print(str(e) + ": " + str(n)) else: return None def bs(n: int) -> int: size = len(sol) c = 0 midP = 0 mid = int(size/2) while True: if (disBS): print("mid: " + str(mid) + " | midP: " + str(midP) + " | diff: " + str(abs(mid-midP)) + " | c: " + str(c) + " | n: " + str(n)) c = sol[mid] if (c == n): return mid elif (c < n): print(mid) mid = mid + int(abs(mid-midP)/2) print(mid) print(midP) else: mid = mid - int(abs(mid-midP)/2) if ( midP == mid or mid < 0 or mid >= size): # invalid value raise Exception("Invalid Fib Number") midP = mid raise Exception("Invalid Fib Number") def getS(n: int) -> int: if(len(sol) - 1 >= n): # Then we have the solution return sol[n] if(n <= 0): return 0 elif(n == 1): return 1 else: a = sol[-2] b = sol[-1] for i in range (len(sol) - 1,n): c = a + b a = b b = c return c
sol = [0, 1] dis_bs = False def dis_g(n: int): print('Sequence number ' + str(n) + ' is ' + str(get(n))) def dis_s(n: int): print(str(n) + ' is sequence ' + str(search(n))) def sol_t(): print('Solution Table: \n' + '\t' + str(sol)) def get(n: int) -> int: if len(sol) - 1 >= n: return sol[n] else: sol.append(get(n - 1) + get(n - 2)) return sol[n] def search(n: int) -> int: size = len(sol) - 1 try: if sol[size] <= n: while sol[size] < n: print('sol: ' + str(sol[size]) + ' | n: ' + str(n)) print(get(size + 1)) size += 1 if sol[-1] == n: return len(sol) - 1 else: raise exception('Invalid Fib Number') else: val = bs(n) return val except Exception as e: print(str(e) + ': ' + str(n)) else: return None def bs(n: int) -> int: size = len(sol) c = 0 mid_p = 0 mid = int(size / 2) while True: if disBS: print('mid: ' + str(mid) + ' | midP: ' + str(midP) + ' | diff: ' + str(abs(mid - midP)) + ' | c: ' + str(c) + ' | n: ' + str(n)) c = sol[mid] if c == n: return mid elif c < n: print(mid) mid = mid + int(abs(mid - midP) / 2) print(mid) print(midP) else: mid = mid - int(abs(mid - midP) / 2) if midP == mid or mid < 0 or mid >= size: raise exception('Invalid Fib Number') mid_p = mid raise exception('Invalid Fib Number') def get_s(n: int) -> int: if len(sol) - 1 >= n: return sol[n] if n <= 0: return 0 elif n == 1: return 1 else: a = sol[-2] b = sol[-1] for i in range(len(sol) - 1, n): c = a + b a = b b = c return c
cities = [ 'Asuncion', 'Ciudad del Este', 'San Lorenzo', 'Capiata', 'Lambare', 'Fernando de la Mora', 'Limpio', 'Nemby', 'Pedro Juan Caballero', 'Encarnacion', 'Mariano Roque Alonso', 'Itaugua', 'Villa Elisa', 'Villa Hayes', 'San Antonio', 'Caaguazu', 'Presidente Franco', 'Coronel Oviedo', 'Concepcion', 'Villarrica', 'Pilar', 'Caazapa', 'Caacupe', 'Ita', 'San Juan Bautista', 'Nueva Esperanza', 'Juan de Ayolas', 'Santa Rita', 'Colonia General Alfredo Stroessner', 'Aregua', 'San Isidro de Curuguaty', 'Horqueta', 'Lima', 'Piribebuy', 'Paraguari', 'Tobati', 'Ypacarai', 'San Pedro de Ycuamandiyu', 'Capitan Bado', 'Guarambare', 'Eusebio Ayala', 'Filadelfia', 'San Juan Nepomuceno', 'Benjamin Aceval', 'Doctor Juan Leon Mallorquin', 'Salto del Guaira', 'Santa Rosa Misiones', 'Yaguaron', 'Repatriacion', 'Obligado', 'Emboscada', 'Carapegua', 'San Pedro del Parana', 'Bella Vista', 'Colonia Menno', 'Nanawua', 'Arquitecto Tomas Romero Pereira', 'Hohenau', 'Quiindy', 'Puerto Rosario', 'San Jose', 'Fuerte Olimpo' ]
cities = ['Asuncion', 'Ciudad del Este', 'San Lorenzo', 'Capiata', 'Lambare', 'Fernando de la Mora', 'Limpio', 'Nemby', 'Pedro Juan Caballero', 'Encarnacion', 'Mariano Roque Alonso', 'Itaugua', 'Villa Elisa', 'Villa Hayes', 'San Antonio', 'Caaguazu', 'Presidente Franco', 'Coronel Oviedo', 'Concepcion', 'Villarrica', 'Pilar', 'Caazapa', 'Caacupe', 'Ita', 'San Juan Bautista', 'Nueva Esperanza', 'Juan de Ayolas', 'Santa Rita', 'Colonia General Alfredo Stroessner', 'Aregua', 'San Isidro de Curuguaty', 'Horqueta', 'Lima', 'Piribebuy', 'Paraguari', 'Tobati', 'Ypacarai', 'San Pedro de Ycuamandiyu', 'Capitan Bado', 'Guarambare', 'Eusebio Ayala', 'Filadelfia', 'San Juan Nepomuceno', 'Benjamin Aceval', 'Doctor Juan Leon Mallorquin', 'Salto del Guaira', 'Santa Rosa Misiones', 'Yaguaron', 'Repatriacion', 'Obligado', 'Emboscada', 'Carapegua', 'San Pedro del Parana', 'Bella Vista', 'Colonia Menno', 'Nanawua', 'Arquitecto Tomas Romero Pereira', 'Hohenau', 'Quiindy', 'Puerto Rosario', 'San Jose', 'Fuerte Olimpo']
#input # 17 # 15 4 3 3 16 4 14 2 2 10 11 2 6 18 17 10 4 8 11 3 19 9 4 13 6 6 14 3 3 14 19 16 17 3 # 13 5 13 14 6 4 5 6 9 3 4 17 6 10 8 8 9 16 10 3 2 15 15 4 16 10 4 13 7 5 11 19 8 5 # 13 7 17 17 14 19 19 12 6 10 19 12 17 15 2 19 15 15 14 17 11 5 19 5 11 5 15 10 11 18 # 4 6 2 2 19 2 2 12 6 10 11 17 8 6 17 7 2 13 2 18 5 5 # 8 14 3 4 5 13 2 8 15 7 9 16 7 9 16 17 14 7 9 11 13 13 9 19 14 3 19 12 7 5 11 13 18 12 # 4 5 16 10 19 4 17 15 9 7 12 7 2 17 14 11 11 8 19 10 2 2 10 13 7 13 4 19 12 15 15 14 # 12 4 17 14 2 13 4 8 5 10 8 2 4 18 12 11 17 2 12 18 10 6 5 4 8 5 14 4 18 9 2 10 12 18 # 12 12 8 19 15 16 7 16 19 6 8 11 3 9 3 19 17 7 5 2 14 8 15 # 6 4 17 15 14 16 19 7 8 7 6 4 4 12 19 3 16 7 13 17 15 14 17 12 2 2 13 15 8 8 12 13 11 # 8 5 7 7 10 14 13 15 17 15 7 16 17 3 4 10 18 17 5 16 10 6 16 3 19 4 10 # 15 19 3 4 5 9 9 13 3 2 8 19 15 14 15 13 15 17 3 14 14 6 10 5 10 6 6 10 9 # 3 4 14 5 6 18 13 14 11 14 15 18 13 11 13 9 4 8 6 5 2 19 10 11 4 19 15 9 10 4 4 # 7 17 15 12 15 8 6 7 3 19 6 15 10 18 4 13 6 9 16 7 9 6 16 12 6 12 19 14 # 4 6 2 2 2 13 16 8 17 4 10 17 9 5 8 7 8 19 12 16 16 17 5 3 14 15 7 6 15 19 19 # 6 2 18 6 14 14 13 11 17 4 9 6 8 16 11 14 15 3 11 12 19 14 13 13 10 18 18 5 18 18 2 5 19 19 # 13 13 3 4 10 6 12 15 12 8 7 7 4 9 16 14 8 10 8 2 19 7 18 4 5 16 5 # 15 4 17 8 16 19 11 7 5 4 2 15 11 7 3 14 14 17 9 3 8 15 3 7 2 19 def choose_best_path(isle, max_candies): rec(isle[1:], isle[0], max_candies) def rec(isle, score, max_candies): if len(isle) <= 1: max_candies.append(score) return if len(isle) >= 2: score1 = score + isle[1] rec(isle[2:], score1, max_candies) if len(isle) >= 3: score2 = score + isle[2] rec(isle[3:], score2, max_candies) n = int(input()) isles = [] for i in range(0, n): isle = [int(x) for x in input().split()] max_candies = [] choose_best_path(isle, max_candies) print(max(max_candies), "", end="")
def choose_best_path(isle, max_candies): rec(isle[1:], isle[0], max_candies) def rec(isle, score, max_candies): if len(isle) <= 1: max_candies.append(score) return if len(isle) >= 2: score1 = score + isle[1] rec(isle[2:], score1, max_candies) if len(isle) >= 3: score2 = score + isle[2] rec(isle[3:], score2, max_candies) n = int(input()) isles = [] for i in range(0, n): isle = [int(x) for x in input().split()] max_candies = [] choose_best_path(isle, max_candies) print(max(max_candies), '', end='')
class Counter: instance = None def __init__(self): self.same_as_original = 0 self.dict = {} @staticmethod def get(): if Counter.instance is None: Counter.instance = Counter() return Counter.instance
class Counter: instance = None def __init__(self): self.same_as_original = 0 self.dict = {} @staticmethod def get(): if Counter.instance is None: Counter.instance = counter() return Counter.instance
class CILNode: pass class CILProgram(CILNode): def __init__(self, dottypes, dotdata, dotcode): self.dottypes = dottypes self.dotdata = dotdata self.dotcode = dotcode class CILType(CILNode): def __init__(self, name, attributes, methods): self.name = name self.attributes = attributes self.methods = methods class CILData(CILNode): def __init__(self, name, value): self.name = name self.value = value # I don't think this is it... # class CILFunction(CILNode): # def __init__(self, fname, params, localvars, instructions): # self.fname = fname # self.params = params # self.localvars = localvars # self.instructions = instructions class CILFunction(CILNode): def __init__(self, fname, instructions): self.fname = fname self.instructions = instructions self.localvars = [] self.param_count = 0 self.holder = -1 class CILMethod(CILNode): def __init__(self, mname): self.mname = mname self.holder = -1 class CILParam(CILNode): def __init__(self, vinfo): self.vinfo = vinfo class CILLocal(CILNode): def __init__(self, vinfo): self.vinfo = vinfo class CILInstruction(CILNode): pass class CILAssign(CILInstruction): def __init__(self, dest, source): self.dest = dest self.source = source class CILArithmetic(CILInstruction): def __init__(self, dest, left, right): self.dest = dest self.left = left self.right = right class CILPlus(CILArithmetic): pass class CILMinus(CILArithmetic): pass class CILStar(CILArithmetic): pass class CILDiv(CILArithmetic): pass class CILBoolean(CILInstruction): def __init__(self, dest, left, right): self.dest = dest self.left = left self.right = right class CILEqual(CILBoolean): pass class CILLessThan(CILBoolean): pass class CILLessThanOrEqual(CILBoolean): pass class CILGetAttrib(CILInstruction): def __init__(self, dest, instance, attribute): self.dest = dest self.instance = instance self.attribute = attribute class CILSetAttrib(CILInstruction): def __init__(self, instance, attribute, src): self.instance = instance self.attribute = attribute self.src = src class CILAllocate(CILInstruction): def __init__(self, dest, ttype): self.dest = dest self.ttype = ttype class CILTypeOf(CILInstruction): def __init__(self, dest, var): self.dest = dest self.var = var class CILLabel(CILInstruction): def __init__(self, name): self.name = name class CILGoto(CILInstruction): def __init__(self, name): self.name = name class CILGotoIf(CILInstruction): def __init__(self, condition, label): self.condition = condition self.label = label class CILCall(CILInstruction): def __init__(self, dest, func): self.dest = dest self.func = func class CILVCall(CILInstruction): def __init__(self, dest, ttype, func): self.dest = dest self.ttype = ttype self.func = func class CILArg(CILInstruction): def __init__(self, vinfo): self.vinfo = vinfo class CILReturn(CILInstruction): def __init__(self, value): self.value = value class CILDummy(CILInstruction): def __init__(self, value): self.value = value # class CILLoad(CILInstruction): # def __init__(self, dest, value): # self.dest = dest # self.value = value class CILLength(CILInstruction): def __init__(self, dest, str_addr): self.dest = dest self.str_addr = str_addr class CILConcat(CILInstruction): def __init__(self, dest, head, tail): self.dest = dest self.head = head self.tail = tail class CILPrefix(CILInstruction): def __init__(self, dest, str_addr, pos): self.dest = dest self.str_addr = str_addr self.pos = pos class CILSubstring(CILInstruction): def __init__(self, dest, str_addr, pos): self.dest = dest self.str_addr = str_addr self.pos = pos
class Cilnode: pass class Cilprogram(CILNode): def __init__(self, dottypes, dotdata, dotcode): self.dottypes = dottypes self.dotdata = dotdata self.dotcode = dotcode class Ciltype(CILNode): def __init__(self, name, attributes, methods): self.name = name self.attributes = attributes self.methods = methods class Cildata(CILNode): def __init__(self, name, value): self.name = name self.value = value class Cilfunction(CILNode): def __init__(self, fname, instructions): self.fname = fname self.instructions = instructions self.localvars = [] self.param_count = 0 self.holder = -1 class Cilmethod(CILNode): def __init__(self, mname): self.mname = mname self.holder = -1 class Cilparam(CILNode): def __init__(self, vinfo): self.vinfo = vinfo class Cillocal(CILNode): def __init__(self, vinfo): self.vinfo = vinfo class Cilinstruction(CILNode): pass class Cilassign(CILInstruction): def __init__(self, dest, source): self.dest = dest self.source = source class Cilarithmetic(CILInstruction): def __init__(self, dest, left, right): self.dest = dest self.left = left self.right = right class Cilplus(CILArithmetic): pass class Cilminus(CILArithmetic): pass class Cilstar(CILArithmetic): pass class Cildiv(CILArithmetic): pass class Cilboolean(CILInstruction): def __init__(self, dest, left, right): self.dest = dest self.left = left self.right = right class Cilequal(CILBoolean): pass class Cillessthan(CILBoolean): pass class Cillessthanorequal(CILBoolean): pass class Cilgetattrib(CILInstruction): def __init__(self, dest, instance, attribute): self.dest = dest self.instance = instance self.attribute = attribute class Cilsetattrib(CILInstruction): def __init__(self, instance, attribute, src): self.instance = instance self.attribute = attribute self.src = src class Cilallocate(CILInstruction): def __init__(self, dest, ttype): self.dest = dest self.ttype = ttype class Ciltypeof(CILInstruction): def __init__(self, dest, var): self.dest = dest self.var = var class Cillabel(CILInstruction): def __init__(self, name): self.name = name class Cilgoto(CILInstruction): def __init__(self, name): self.name = name class Cilgotoif(CILInstruction): def __init__(self, condition, label): self.condition = condition self.label = label class Cilcall(CILInstruction): def __init__(self, dest, func): self.dest = dest self.func = func class Cilvcall(CILInstruction): def __init__(self, dest, ttype, func): self.dest = dest self.ttype = ttype self.func = func class Cilarg(CILInstruction): def __init__(self, vinfo): self.vinfo = vinfo class Cilreturn(CILInstruction): def __init__(self, value): self.value = value class Cildummy(CILInstruction): def __init__(self, value): self.value = value class Cillength(CILInstruction): def __init__(self, dest, str_addr): self.dest = dest self.str_addr = str_addr class Cilconcat(CILInstruction): def __init__(self, dest, head, tail): self.dest = dest self.head = head self.tail = tail class Cilprefix(CILInstruction): def __init__(self, dest, str_addr, pos): self.dest = dest self.str_addr = str_addr self.pos = pos class Cilsubstring(CILInstruction): def __init__(self, dest, str_addr, pos): self.dest = dest self.str_addr = str_addr self.pos = pos
titles = ['Creature if Habit','Crewel Fate'] plots = ['A num turns into a monster', 'A haunted yarn shop'] movies = dict( zip(titles, plots) ) # expected output: ''' {'Creature if Habit': 'A num turns into a monster', 'Crewel Fate': 'A haunted yarn shop'} ''' print( movies)
titles = ['Creature if Habit', 'Crewel Fate'] plots = ['A num turns into a monster', 'A haunted yarn shop'] movies = dict(zip(titles, plots)) "\n{'Creature if Habit': 'A num turns into a monster', 'Crewel Fate': 'A haunted yarn shop'}\n" print(movies)
## Predicting using a regression model # Generate predictions with the model using those inputs predictions = model.predict(new_inputs.reshape(-1,1)) # Visualize the inputs and predicted values plt.scatter(new_inputs, predictions, color='r', s=3) plt.xlabel('inputs') plt.ylabel('predictions') plt.show()
predictions = model.predict(new_inputs.reshape(-1, 1)) plt.scatter(new_inputs, predictions, color='r', s=3) plt.xlabel('inputs') plt.ylabel('predictions') plt.show()
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next def _deleteDuplicates(self,head,a,pointer): if head.next is None: return 0 else: if head.val == head.next.val: a = head.val return self._deleteDuplicates(head.next,a,pointer) else: if a == head.val: #if head.next.next is not None: # if pointer.next.val == head.next.next.val: # return self._deleteDuplicates(head.next,a,pointer) # return self._deleteDuplicates(head.next,a,pointer) #else: # pass #pointer.next = head.next return self._deleteDuplicates(head.next,a,pointer) else: pointer.next = head return self._deleteDuplicates(head.next,a,head) def _deleteDuplicates_2(self,head,pointer): a = 0 c = None while head.next is not None: if head.val == head.next.val: a = head.val else: if a == head.val: if pointer.val != a: pointer.next = head.next c = pointer pointer = head.next else: c.next = head.next c = head.next pass else: pointer.next = head pointer = head head = head.next def _deleteDuplicates_3(self,head,pointer_a,pointer): a = 0 head_main = head while head.next is not None: if head.val == head.next.val: a = head.val else: if a == head.val: if pointer_a.val != a: pointer.next = head.next pointer_a = pointer else: pointer_a.next = head.next else: pointer.next = head pointer = head head = head.next return head_main class Solution: def _deleteDuplicates_4(self,head): if head is None: return head a = 0 list_of_nodes = [] while head is not None: if head.next is not None and head.val == head.next.val: a = head.val if len(list_of_nodes) != 0\ and list_of_nodes[-1].val == head.next.val: print(list_of_nodes.pop().val) else: if a == head.val: if head.next is not None: list_of_nodes.append(head.next) else: list_of_nodes.append(head) head = head.next print(list_of_nodes) if len(list_of_nodes) != 0: if list_of_nodes != [None]: for i in range(len(list_of_nodes)): if i < len(list_of_nodes) - 1: list_of_nodes[i].next = list_of_nodes[i+1] else: list_of_nodes[i].next = None return list_of_nodes[0] else: return None def deleteDuplicates(self, head: Optional[ListNode]) -> Optional[ListNode]: return self._deleteDuplicates_4(head)
def _delete_duplicates(self, head, a, pointer): if head.next is None: return 0 elif head.val == head.next.val: a = head.val return self._deleteDuplicates(head.next, a, pointer) elif a == head.val: return self._deleteDuplicates(head.next, a, pointer) else: pointer.next = head return self._deleteDuplicates(head.next, a, head) def _delete_duplicates_2(self, head, pointer): a = 0 c = None while head.next is not None: if head.val == head.next.val: a = head.val elif a == head.val: if pointer.val != a: pointer.next = head.next c = pointer pointer = head.next else: c.next = head.next c = head.next pass else: pointer.next = head pointer = head head = head.next def _delete_duplicates_3(self, head, pointer_a, pointer): a = 0 head_main = head while head.next is not None: if head.val == head.next.val: a = head.val elif a == head.val: if pointer_a.val != a: pointer.next = head.next pointer_a = pointer else: pointer_a.next = head.next else: pointer.next = head pointer = head head = head.next return head_main class Solution: def _delete_duplicates_4(self, head): if head is None: return head a = 0 list_of_nodes = [] while head is not None: if head.next is not None and head.val == head.next.val: a = head.val if len(list_of_nodes) != 0 and list_of_nodes[-1].val == head.next.val: print(list_of_nodes.pop().val) elif a == head.val: if head.next is not None: list_of_nodes.append(head.next) else: list_of_nodes.append(head) head = head.next print(list_of_nodes) if len(list_of_nodes) != 0: if list_of_nodes != [None]: for i in range(len(list_of_nodes)): if i < len(list_of_nodes) - 1: list_of_nodes[i].next = list_of_nodes[i + 1] else: list_of_nodes[i].next = None return list_of_nodes[0] else: return None def delete_duplicates(self, head: Optional[ListNode]) -> Optional[ListNode]: return self._deleteDuplicates_4(head)
class AudioModel(): classes_: [] classifier: None def __init__(self, settings, classifier): self.settings = {} self.settings['version'] = settings['version'] self.settings['RATE'] = settings['RATE'] self.settings['CHANNELS'] = settings['CHANNELS'] self.settings['RECORD_SECONDS'] = settings['RECORD_SECONDS'] self.settings['SLIDING_WINDOW_AMOUNT'] = settings['SLIDING_WINDOW_AMOUNT'] self.settings['FEATURE_ENGINEERING_TYPE'] = settings['FEATURE_ENGINEERING_TYPE'] self.classifier = classifier self.classes_ = classifier.classes_ if ( self.settings['version'] == 0 ): print( "!----Upgrade note-----!" ) print( "Parrot has added the AudioModel class to encapsulate models." ) print( "This class aims to provide better backwards compatibility between minor versions." ) print( "If you are still using the old method, it is encouraged to update using the [C] menu in the settings" ) print( "-----------------------" ) def predict_proba(self, data): return self.classifier.predict_proba(data) def get_setting(self, setting_key, default_value): if( setting_key in self.settings ): return self.settings[setting_key] else: return default_value def get_classifier(self): return self.classifier
class Audiomodel: classes_: [] classifier: None def __init__(self, settings, classifier): self.settings = {} self.settings['version'] = settings['version'] self.settings['RATE'] = settings['RATE'] self.settings['CHANNELS'] = settings['CHANNELS'] self.settings['RECORD_SECONDS'] = settings['RECORD_SECONDS'] self.settings['SLIDING_WINDOW_AMOUNT'] = settings['SLIDING_WINDOW_AMOUNT'] self.settings['FEATURE_ENGINEERING_TYPE'] = settings['FEATURE_ENGINEERING_TYPE'] self.classifier = classifier self.classes_ = classifier.classes_ if self.settings['version'] == 0: print('!----Upgrade note-----!') print('Parrot has added the AudioModel class to encapsulate models.') print('This class aims to provide better backwards compatibility between minor versions.') print('If you are still using the old method, it is encouraged to update using the [C] menu in the settings') print('-----------------------') def predict_proba(self, data): return self.classifier.predict_proba(data) def get_setting(self, setting_key, default_value): if setting_key in self.settings: return self.settings[setting_key] else: return default_value def get_classifier(self): return self.classifier
class Czlowiek: iloscOczu = 2 def __init__(self,imie,wiek): self.imie = imie self.wiek = wiek And = Czlowiek("Andrzej", 22) Ann = Czlowiek("Anna", 17) print(And.iloscOczu) print(Ann.wiek) #------------------------------- def dodawanie(x,y): return x+y dod = lambda x,y: x+y #print(dodawanie(2,3)) #print(dod(2,3))
class Czlowiek: ilosc_oczu = 2 def __init__(self, imie, wiek): self.imie = imie self.wiek = wiek and = czlowiek('Andrzej', 22) ann = czlowiek('Anna', 17) print(And.iloscOczu) print(Ann.wiek) def dodawanie(x, y): return x + y dod = lambda x, y: x + y
class RangeMethod: RANGE_MAX = 0 RANGE_3SIGMA = 1 RANGE_MAX_TENPERCENT = 2 RANGE_SWEEP = 3 class QuantizeMethod: # quantize methods FIX_NONE = 0 FIX_AUTO = 1 FIX_FIXED = 2
class Rangemethod: range_max = 0 range_3_sigma = 1 range_max_tenpercent = 2 range_sweep = 3 class Quantizemethod: fix_none = 0 fix_auto = 1 fix_fixed = 2
class Logger: def __init__(self, name: str): self.name: str = name def console_log(self, message: str): print('<{0}> {1}'.format(self.name, message))
class Logger: def __init__(self, name: str): self.name: str = name def console_log(self, message: str): print('<{0}> {1}'.format(self.name, message))
# # PySNMP MIB module SEI-SMI (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SEI-SMI # Produced by pysmi-0.3.4 at Wed May 1 15:01:44 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") sysName, = mibBuilder.importSymbols("SNMPv2-MIB", "sysName") iso, Counter64, TimeTicks, IpAddress, Bits, ObjectIdentity, Unsigned32, ModuleIdentity, NotificationType, enterprises, MibIdentifier, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Counter32, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "Counter64", "TimeTicks", "IpAddress", "Bits", "ObjectIdentity", "Unsigned32", "ModuleIdentity", "NotificationType", "enterprises", "MibIdentifier", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Counter32", "Gauge32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") sei = ModuleIdentity((1, 3, 6, 1, 4, 1, 20364)) sei.setRevisions(('2004-06-08 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: sei.setRevisionsDescriptions(('Initial version.',)) if mibBuilder.loadTexts: sei.setLastUpdated('200406080000Z') if mibBuilder.loadTexts: sei.setOrganization('System Engineering International') if mibBuilder.loadTexts: sei.setContactInfo(' System Engineering International Postal: 5115 Pegasus Ct., Suite Q Frederick, MD 21704 USA Tel: +1 301 694 9601 E-mail: tdiamond@seipower.com') if mibBuilder.loadTexts: sei.setDescription('The Enterprise Number for System Engineering International') juiceBoxPse = MibIdentifier((1, 3, 6, 1, 4, 1, 20364, 1)) juiceBoxObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 20364, 1, 1)) juiceBoxPortTable = MibTable((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1), ) if mibBuilder.loadTexts: juiceBoxPortTable.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortTable.setDescription('A table of objects that display and control the power characteristics of an individual port on a Juice Box Midspan Power Hub. Values of all read-write objects in this table are persistent at restart/reboot.') juiceBoxPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1), ).setIndexNames((0, "SEI-SMI", "juiceBoxPortIndex")) if mibBuilder.loadTexts: juiceBoxPortEntry.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortEntry.setDescription('A set of objects that display and control the power characteristics of a Juice Box Midspan Power Hub port.') juiceBoxPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: juiceBoxPortIndex.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortIndex.setDescription('This variable uniquely identifies the port within the Juice Box Midspan Power Hub.') juiceBoxPortDetectionSetting = MibTableColumn((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("disabled", 1), ("ieee8023afonly", 2), ("ieee8023afandlegacy", 3), ("forcedon", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: juiceBoxPortDetectionSetting.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortDetectionSetting.setDescription('Describes the type of PD detection performed by the port. A value of disabled(1) means that no PD detection is performed. If a port currently delivering power is set to disabled(1), power will be removed from the port. A value of ieee802.3afonly(2) means only PDs with valid signatures as defined by ieee 802.3af will be detected and powered. A value of ieee8023afandlegacy(3) means that PDs with 802.3af and legacy signatures will be detected and powered. A value of forcedon(4) means the port is powered without regard to detection status. A setting of forcedon(4) is not persistent and must be re-asserted after restart/reboot') juiceBoxPortMaxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15))).clone(namedValues=NamedValues(("max1W", 1), ("max2W", 2), ("max3W", 3), ("max4W", 4), ("max5W", 5), ("max6W", 6), ("max7W", 7), ("max8W", 8), ("max9W", 9), ("max10W", 10), ("max11W", 11), ("max12W", 12), ("max13W", 13), ("max14W", 14), ("max15W", 15)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: juiceBoxPortMaxPower.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortMaxPower.setDescription('Describes the maximum power setting for the port in watts. This setting is used by to calculate Allocated Power. It is only used if the port is classified as Class 0 or Legacy.') juiceBoxPortDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 4), SnmpAdminString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: juiceBoxPortDescription.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortDescription.setDescription('A manager will set the value of this variable to indicate the type of powered device that is connected to the port. The default value supplied by the agent if no value has ever been set is PORT x where x is the port number') juiceBoxPortStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15))).clone(namedValues=NamedValues(("disabled", 1), ("deliveringPower", 2), ("startupFault", 3), ("overCurrentFault", 4), ("short", 5), ("open", 6), ("rsignatureHi", 7), ("rsignatureLow", 8), ("invalidDetect", 9), ("disconnect", 10), ("powerup", 12), ("overPowerWarning", 13), ("overPowerFault", 14), ("insufficientPower", 15)))).setMaxAccess("readonly") if mibBuilder.loadTexts: juiceBoxPortStatus.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortStatus.setDescription('Describes the status of the port. A value of disabled(1) means that juiceBoxPortDetectionSetting for the port is set to disabled. No PD detection will be performed. A value of deliveringPower(2) means the port is delivering power within operational parameters. A value of startupFault(3) means that port failed to power up properly. A value of overCurrentFault(4) means the port current was greater than the 350mA maximum value specified by IEEE 802.3af. A value of short(5) means an short circuit was discovered during PD detection. A value of open(6) means an open circuit was discovered during PD detection. A value of rsignatureHi(7) means a resistance greater than the valid signature specified by IEEE 802.3af was discovered during PD detection. A value of rsignatureLow(8) means a resistance less than the valid signature specified by IEEE 802.3af was discovered during PD detection. A value of invalidDetect(9) means an invalid signature as specified by IEEE 802.3af was discovered during PD detection. A value of disconnect(10) means that the port current was less than the 10mA mininum value specified by IEEE 802.3af required to maintain power. A value of powerup(12) means the port is in the process of being powered. A value of overPowerWarning(13) means the port is delivering power greater than the maximum value for its Class or the value set with juiceBoxPortMaxPower. A value of overPowerFault(14) means the port was shut down because the power delivered was at least 1 Watt greater than the maximum value for its Class or the value set with juiceBoxPortMaxPower. A value of insufficientPower(15) means the port could not be powered because there is insuffiecent power capability remaining to fully power the port.') juiceBoxPortClassifications = MibTableColumn((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("class0", 1), ("class1", 2), ("class2", 3), ("class3", 4), ("class4", 5), ("legacy", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: juiceBoxPortClassifications.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortClassifications.setDescription('Classification is a way to identify a Powered Device according to its power consumption. The meaning of the classification labels is defined in the IEEE specification. This variable is valid only while a PD is being powered, that is, while the attribute juiceBoxPortStatus is reporting the enumeration deliveringPower or overpowerWarning.') juiceBoxPortPowerDelivered = MibTableColumn((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 7), Gauge32()).setUnits('milliWatts').setMaxAccess("readonly") if mibBuilder.loadTexts: juiceBoxPortPowerDelivered.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortPowerDelivered.setDescription('Measured usage power of port expressed in milliWatts. This variable is valid only while a PD is being powered, that is, while the attribute juiceBoxPortStatus is reporting the enumeration deliveringPower or overPowerWarning. If an overPowerFault has occured on the port, the power level that caused the fault is indicated') juiceBoxMainObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2)) juiceBoxMainSystemVoltage = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 1), Gauge32()).setUnits('milliVolts').setMaxAccess("readonly") if mibBuilder.loadTexts: juiceBoxMainSystemVoltage.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainSystemVoltage.setDescription('Measured system voltage in millivolts .') juiceBoxMainTemperature = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 2), Gauge32()).setUnits('degrees C').setMaxAccess("readonly") if mibBuilder.loadTexts: juiceBoxMainTemperature.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainTemperature.setDescription('Measured internal temperature in degrees C.') juiceBoxMainPowerAvailable = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 3), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setUnits('Watts').setMaxAccess("readonly") if mibBuilder.loadTexts: juiceBoxMainPowerAvailable.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainPowerAvailable.setDescription('The nominal power of the JuiceBox expressed in Watts.') juiceBoxMainPowerDelivered = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 4), Gauge32()).setUnits('Watts').setMaxAccess("readonly") if mibBuilder.loadTexts: juiceBoxMainPowerDelivered.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainPowerDelivered.setDescription('Total Power Delivered to the PDs.') juiceBoxMainAllocatedPower = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 5), Gauge32()).setUnits('Watts').setMaxAccess("readonly") if mibBuilder.loadTexts: juiceBoxMainAllocatedPower.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainAllocatedPower.setDescription('Total Power Allocated to the PDs. This value is calculated base on the Classification of the PDs powered by the Juice Box. If the PD classified as Class 0 or Legacy, the juiceBoxPortMaxPower setting for the port is used.') juiceBoxMainAllocatedPowerThreshold = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 99))).setUnits('%').setMaxAccess("readwrite") if mibBuilder.loadTexts: juiceBoxMainAllocatedPowerThreshold.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainAllocatedPowerThreshold.setDescription('The usage threshold expressed in percents for comparing the alocated power and initiating an alarm (trap) if the threshold is exceeded.') juiceBoxMainTrapDestinationIPAddr = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 7), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: juiceBoxMainTrapDestinationIPAddr.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainTrapDestinationIPAddr.setDescription('A read/write IP address. This is the address to which the agent sends traps. The value is initialized as 0.0.0.0. Traps will not be sent until a new value is entered') juiceBoxMainTrapReXmitPeriod = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3600))).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: juiceBoxMainTrapReXmitPeriod.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainTrapReXmitPeriod.setDescription('The period of time in seconds after which a trap will be re-transmitted if the fault condition is still present') juiceBoxMainGlobalPortDetectionSetting = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("disabled", 1), ("ieee8023afonly", 2), ("ieee8023afandlegacy", 3), ("forcedon", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: juiceBoxMainGlobalPortDetectionSetting.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainGlobalPortDetectionSetting.setDescription('Sets the PortDetectionSetting for all the Juice Box ports to the selected value. Describes the type of PD detection performed by the port. A value of disabled(1) means that no PD detection is performed. If a port currently delivering power is set to disabled(1), power will be removed from the port. A value of ieee802.3afonly(2) means only PDs with valid signatures as defined by ieee 802.3af will be detected and powered. A value of ieee8023afandlegacy(3) means that PDs with 802.3af and legacy signatures will be detected and powered. A value of forcedon(4) means the port is powered without regard to detection status. A setting of forcedon(4) is not persistent and must be re-asserted after restart/reboot') juiceBoxMainGlobalPortMaxPower = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15))).clone(namedValues=NamedValues(("max1W", 1), ("max2W", 2), ("max3W", 3), ("max4W", 4), ("max5W", 5), ("max6W", 6), ("max7W", 7), ("max8W", 8), ("max9W", 9), ("max10W", 10), ("max11W", 11), ("max12W", 12), ("max13W", 13), ("max14W", 14), ("max15W", 15)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: juiceBoxMainGlobalPortMaxPower.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainGlobalPortMaxPower.setDescription('Used to set PortMaxPower for all ports to the same value. Describes the maximum power setting for the port in watts. This setting is used by to calculate Allocated Power. It is only used if the port is classified as Class 0 or Legacy.') juiceBoxMainNetworkControllerFirmware = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 11), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: juiceBoxMainNetworkControllerFirmware.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainNetworkControllerFirmware.setDescription('Firmware Version of the JuiceBox Network Controller.') juiceBoxMainSystemControllerFirmware = MibScalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 12), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: juiceBoxMainSystemControllerFirmware.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainSystemControllerFirmware.setDescription('Firmware Version of the JuiceBox SystemController.') juiceBoxPortStatusChange = NotificationType((1, 3, 6, 1, 4, 1, 20364) + (0,20)).setObjects(("SNMPv2-MIB", "sysName"), ("SEI-SMI", "juiceBoxPortIndex"), ("SEI-SMI", "juiceBoxPortStatus")) if mibBuilder.loadTexts: juiceBoxPortStatusChange.setDescription('This trap will be sent anytime the status of a Juice Box port changes.') juiceBoxAllocatedPowerThresholdReached = NotificationType((1, 3, 6, 1, 4, 1, 20364) + (0,10)).setObjects(("SNMPv2-MIB", "sysName"), ("SEI-SMI", "juiceBoxMainAllocatedPower"), ("SEI-SMI", "juiceBoxMainPowerDelivered")) if mibBuilder.loadTexts: juiceBoxAllocatedPowerThresholdReached.setDescription('This trap is sent when the Allocated Power is greater than the percentage threshold set juiceBoxMainAllocatedPowerThreshold.') mibBuilder.exportSymbols("SEI-SMI", juiceBoxPortDescription=juiceBoxPortDescription, PYSNMP_MODULE_ID=sei, juiceBoxPortMaxPower=juiceBoxPortMaxPower, juiceBoxPortDetectionSetting=juiceBoxPortDetectionSetting, juiceBoxPortClassifications=juiceBoxPortClassifications, juiceBoxObjects=juiceBoxObjects, juiceBoxPse=juiceBoxPse, juiceBoxMainPowerDelivered=juiceBoxMainPowerDelivered, juiceBoxMainAllocatedPower=juiceBoxMainAllocatedPower, juiceBoxPortPowerDelivered=juiceBoxPortPowerDelivered, juiceBoxMainSystemControllerFirmware=juiceBoxMainSystemControllerFirmware, sei=sei, juiceBoxMainGlobalPortMaxPower=juiceBoxMainGlobalPortMaxPower, juiceBoxMainPowerAvailable=juiceBoxMainPowerAvailable, juiceBoxMainTrapReXmitPeriod=juiceBoxMainTrapReXmitPeriod, juiceBoxMainGlobalPortDetectionSetting=juiceBoxMainGlobalPortDetectionSetting, juiceBoxMainSystemVoltage=juiceBoxMainSystemVoltage, juiceBoxMainTrapDestinationIPAddr=juiceBoxMainTrapDestinationIPAddr, juiceBoxPortIndex=juiceBoxPortIndex, juiceBoxMainAllocatedPowerThreshold=juiceBoxMainAllocatedPowerThreshold, juiceBoxMainNetworkControllerFirmware=juiceBoxMainNetworkControllerFirmware, juiceBoxPortEntry=juiceBoxPortEntry, juiceBoxAllocatedPowerThresholdReached=juiceBoxAllocatedPowerThresholdReached, juiceBoxMainObjects=juiceBoxMainObjects, juiceBoxPortStatusChange=juiceBoxPortStatusChange, juiceBoxPortStatus=juiceBoxPortStatus, juiceBoxMainTemperature=juiceBoxMainTemperature, juiceBoxPortTable=juiceBoxPortTable)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, single_value_constraint, value_size_constraint, value_range_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsUnion') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (sys_name,) = mibBuilder.importSymbols('SNMPv2-MIB', 'sysName') (iso, counter64, time_ticks, ip_address, bits, object_identity, unsigned32, module_identity, notification_type, enterprises, mib_identifier, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, counter32, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'Counter64', 'TimeTicks', 'IpAddress', 'Bits', 'ObjectIdentity', 'Unsigned32', 'ModuleIdentity', 'NotificationType', 'enterprises', 'MibIdentifier', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'Counter32', 'Gauge32') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') sei = module_identity((1, 3, 6, 1, 4, 1, 20364)) sei.setRevisions(('2004-06-08 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: sei.setRevisionsDescriptions(('Initial version.',)) if mibBuilder.loadTexts: sei.setLastUpdated('200406080000Z') if mibBuilder.loadTexts: sei.setOrganization('System Engineering International') if mibBuilder.loadTexts: sei.setContactInfo(' System Engineering International Postal: 5115 Pegasus Ct., Suite Q Frederick, MD 21704 USA Tel: +1 301 694 9601 E-mail: tdiamond@seipower.com') if mibBuilder.loadTexts: sei.setDescription('The Enterprise Number for System Engineering International') juice_box_pse = mib_identifier((1, 3, 6, 1, 4, 1, 20364, 1)) juice_box_objects = mib_identifier((1, 3, 6, 1, 4, 1, 20364, 1, 1)) juice_box_port_table = mib_table((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1)) if mibBuilder.loadTexts: juiceBoxPortTable.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortTable.setDescription('A table of objects that display and control the power characteristics of an individual port on a Juice Box Midspan Power Hub. Values of all read-write objects in this table are persistent at restart/reboot.') juice_box_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1)).setIndexNames((0, 'SEI-SMI', 'juiceBoxPortIndex')) if mibBuilder.loadTexts: juiceBoxPortEntry.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortEntry.setDescription('A set of objects that display and control the power characteristics of a Juice Box Midspan Power Hub port.') juice_box_port_index = mib_table_column((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))) if mibBuilder.loadTexts: juiceBoxPortIndex.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortIndex.setDescription('This variable uniquely identifies the port within the Juice Box Midspan Power Hub.') juice_box_port_detection_setting = mib_table_column((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('disabled', 1), ('ieee8023afonly', 2), ('ieee8023afandlegacy', 3), ('forcedon', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: juiceBoxPortDetectionSetting.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortDetectionSetting.setDescription('Describes the type of PD detection performed by the port. A value of disabled(1) means that no PD detection is performed. If a port currently delivering power is set to disabled(1), power will be removed from the port. A value of ieee802.3afonly(2) means only PDs with valid signatures as defined by ieee 802.3af will be detected and powered. A value of ieee8023afandlegacy(3) means that PDs with 802.3af and legacy signatures will be detected and powered. A value of forcedon(4) means the port is powered without regard to detection status. A setting of forcedon(4) is not persistent and must be re-asserted after restart/reboot') juice_box_port_max_power = mib_table_column((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15))).clone(namedValues=named_values(('max1W', 1), ('max2W', 2), ('max3W', 3), ('max4W', 4), ('max5W', 5), ('max6W', 6), ('max7W', 7), ('max8W', 8), ('max9W', 9), ('max10W', 10), ('max11W', 11), ('max12W', 12), ('max13W', 13), ('max14W', 14), ('max15W', 15)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: juiceBoxPortMaxPower.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortMaxPower.setDescription('Describes the maximum power setting for the port in watts. This setting is used by to calculate Allocated Power. It is only used if the port is classified as Class 0 or Legacy.') juice_box_port_description = mib_table_column((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 4), snmp_admin_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: juiceBoxPortDescription.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortDescription.setDescription('A manager will set the value of this variable to indicate the type of powered device that is connected to the port. The default value supplied by the agent if no value has ever been set is PORT x where x is the port number') juice_box_port_status = mib_table_column((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15))).clone(namedValues=named_values(('disabled', 1), ('deliveringPower', 2), ('startupFault', 3), ('overCurrentFault', 4), ('short', 5), ('open', 6), ('rsignatureHi', 7), ('rsignatureLow', 8), ('invalidDetect', 9), ('disconnect', 10), ('powerup', 12), ('overPowerWarning', 13), ('overPowerFault', 14), ('insufficientPower', 15)))).setMaxAccess('readonly') if mibBuilder.loadTexts: juiceBoxPortStatus.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortStatus.setDescription('Describes the status of the port. A value of disabled(1) means that juiceBoxPortDetectionSetting for the port is set to disabled. No PD detection will be performed. A value of deliveringPower(2) means the port is delivering power within operational parameters. A value of startupFault(3) means that port failed to power up properly. A value of overCurrentFault(4) means the port current was greater than the 350mA maximum value specified by IEEE 802.3af. A value of short(5) means an short circuit was discovered during PD detection. A value of open(6) means an open circuit was discovered during PD detection. A value of rsignatureHi(7) means a resistance greater than the valid signature specified by IEEE 802.3af was discovered during PD detection. A value of rsignatureLow(8) means a resistance less than the valid signature specified by IEEE 802.3af was discovered during PD detection. A value of invalidDetect(9) means an invalid signature as specified by IEEE 802.3af was discovered during PD detection. A value of disconnect(10) means that the port current was less than the 10mA mininum value specified by IEEE 802.3af required to maintain power. A value of powerup(12) means the port is in the process of being powered. A value of overPowerWarning(13) means the port is delivering power greater than the maximum value for its Class or the value set with juiceBoxPortMaxPower. A value of overPowerFault(14) means the port was shut down because the power delivered was at least 1 Watt greater than the maximum value for its Class or the value set with juiceBoxPortMaxPower. A value of insufficientPower(15) means the port could not be powered because there is insuffiecent power capability remaining to fully power the port.') juice_box_port_classifications = mib_table_column((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('class0', 1), ('class1', 2), ('class2', 3), ('class3', 4), ('class4', 5), ('legacy', 6)))).setMaxAccess('readonly') if mibBuilder.loadTexts: juiceBoxPortClassifications.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortClassifications.setDescription('Classification is a way to identify a Powered Device according to its power consumption. The meaning of the classification labels is defined in the IEEE specification. This variable is valid only while a PD is being powered, that is, while the attribute juiceBoxPortStatus is reporting the enumeration deliveringPower or overpowerWarning.') juice_box_port_power_delivered = mib_table_column((1, 3, 6, 1, 4, 1, 20364, 1, 1, 1, 1, 7), gauge32()).setUnits('milliWatts').setMaxAccess('readonly') if mibBuilder.loadTexts: juiceBoxPortPowerDelivered.setStatus('current') if mibBuilder.loadTexts: juiceBoxPortPowerDelivered.setDescription('Measured usage power of port expressed in milliWatts. This variable is valid only while a PD is being powered, that is, while the attribute juiceBoxPortStatus is reporting the enumeration deliveringPower or overPowerWarning. If an overPowerFault has occured on the port, the power level that caused the fault is indicated') juice_box_main_objects = mib_identifier((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2)) juice_box_main_system_voltage = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 1), gauge32()).setUnits('milliVolts').setMaxAccess('readonly') if mibBuilder.loadTexts: juiceBoxMainSystemVoltage.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainSystemVoltage.setDescription('Measured system voltage in millivolts .') juice_box_main_temperature = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 2), gauge32()).setUnits('degrees C').setMaxAccess('readonly') if mibBuilder.loadTexts: juiceBoxMainTemperature.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainTemperature.setDescription('Measured internal temperature in degrees C.') juice_box_main_power_available = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 3), gauge32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setUnits('Watts').setMaxAccess('readonly') if mibBuilder.loadTexts: juiceBoxMainPowerAvailable.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainPowerAvailable.setDescription('The nominal power of the JuiceBox expressed in Watts.') juice_box_main_power_delivered = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 4), gauge32()).setUnits('Watts').setMaxAccess('readonly') if mibBuilder.loadTexts: juiceBoxMainPowerDelivered.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainPowerDelivered.setDescription('Total Power Delivered to the PDs.') juice_box_main_allocated_power = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 5), gauge32()).setUnits('Watts').setMaxAccess('readonly') if mibBuilder.loadTexts: juiceBoxMainAllocatedPower.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainAllocatedPower.setDescription('Total Power Allocated to the PDs. This value is calculated base on the Classification of the PDs powered by the Juice Box. If the PD classified as Class 0 or Legacy, the juiceBoxPortMaxPower setting for the port is used.') juice_box_main_allocated_power_threshold = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 6), integer32().subtype(subtypeSpec=value_range_constraint(1, 99))).setUnits('%').setMaxAccess('readwrite') if mibBuilder.loadTexts: juiceBoxMainAllocatedPowerThreshold.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainAllocatedPowerThreshold.setDescription('The usage threshold expressed in percents for comparing the alocated power and initiating an alarm (trap) if the threshold is exceeded.') juice_box_main_trap_destination_ip_addr = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 7), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: juiceBoxMainTrapDestinationIPAddr.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainTrapDestinationIPAddr.setDescription('A read/write IP address. This is the address to which the agent sends traps. The value is initialized as 0.0.0.0. Traps will not be sent until a new value is entered') juice_box_main_trap_re_xmit_period = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 8), integer32().subtype(subtypeSpec=value_range_constraint(1, 3600))).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: juiceBoxMainTrapReXmitPeriod.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainTrapReXmitPeriod.setDescription('The period of time in seconds after which a trap will be re-transmitted if the fault condition is still present') juice_box_main_global_port_detection_setting = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('disabled', 1), ('ieee8023afonly', 2), ('ieee8023afandlegacy', 3), ('forcedon', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: juiceBoxMainGlobalPortDetectionSetting.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainGlobalPortDetectionSetting.setDescription('Sets the PortDetectionSetting for all the Juice Box ports to the selected value. Describes the type of PD detection performed by the port. A value of disabled(1) means that no PD detection is performed. If a port currently delivering power is set to disabled(1), power will be removed from the port. A value of ieee802.3afonly(2) means only PDs with valid signatures as defined by ieee 802.3af will be detected and powered. A value of ieee8023afandlegacy(3) means that PDs with 802.3af and legacy signatures will be detected and powered. A value of forcedon(4) means the port is powered without regard to detection status. A setting of forcedon(4) is not persistent and must be re-asserted after restart/reboot') juice_box_main_global_port_max_power = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15))).clone(namedValues=named_values(('max1W', 1), ('max2W', 2), ('max3W', 3), ('max4W', 4), ('max5W', 5), ('max6W', 6), ('max7W', 7), ('max8W', 8), ('max9W', 9), ('max10W', 10), ('max11W', 11), ('max12W', 12), ('max13W', 13), ('max14W', 14), ('max15W', 15)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: juiceBoxMainGlobalPortMaxPower.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainGlobalPortMaxPower.setDescription('Used to set PortMaxPower for all ports to the same value. Describes the maximum power setting for the port in watts. This setting is used by to calculate Allocated Power. It is only used if the port is classified as Class 0 or Legacy.') juice_box_main_network_controller_firmware = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 11), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: juiceBoxMainNetworkControllerFirmware.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainNetworkControllerFirmware.setDescription('Firmware Version of the JuiceBox Network Controller.') juice_box_main_system_controller_firmware = mib_scalar((1, 3, 6, 1, 4, 1, 20364, 1, 1, 2, 12), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: juiceBoxMainSystemControllerFirmware.setStatus('current') if mibBuilder.loadTexts: juiceBoxMainSystemControllerFirmware.setDescription('Firmware Version of the JuiceBox SystemController.') juice_box_port_status_change = notification_type((1, 3, 6, 1, 4, 1, 20364) + (0, 20)).setObjects(('SNMPv2-MIB', 'sysName'), ('SEI-SMI', 'juiceBoxPortIndex'), ('SEI-SMI', 'juiceBoxPortStatus')) if mibBuilder.loadTexts: juiceBoxPortStatusChange.setDescription('This trap will be sent anytime the status of a Juice Box port changes.') juice_box_allocated_power_threshold_reached = notification_type((1, 3, 6, 1, 4, 1, 20364) + (0, 10)).setObjects(('SNMPv2-MIB', 'sysName'), ('SEI-SMI', 'juiceBoxMainAllocatedPower'), ('SEI-SMI', 'juiceBoxMainPowerDelivered')) if mibBuilder.loadTexts: juiceBoxAllocatedPowerThresholdReached.setDescription('This trap is sent when the Allocated Power is greater than the percentage threshold set juiceBoxMainAllocatedPowerThreshold.') mibBuilder.exportSymbols('SEI-SMI', juiceBoxPortDescription=juiceBoxPortDescription, PYSNMP_MODULE_ID=sei, juiceBoxPortMaxPower=juiceBoxPortMaxPower, juiceBoxPortDetectionSetting=juiceBoxPortDetectionSetting, juiceBoxPortClassifications=juiceBoxPortClassifications, juiceBoxObjects=juiceBoxObjects, juiceBoxPse=juiceBoxPse, juiceBoxMainPowerDelivered=juiceBoxMainPowerDelivered, juiceBoxMainAllocatedPower=juiceBoxMainAllocatedPower, juiceBoxPortPowerDelivered=juiceBoxPortPowerDelivered, juiceBoxMainSystemControllerFirmware=juiceBoxMainSystemControllerFirmware, sei=sei, juiceBoxMainGlobalPortMaxPower=juiceBoxMainGlobalPortMaxPower, juiceBoxMainPowerAvailable=juiceBoxMainPowerAvailable, juiceBoxMainTrapReXmitPeriod=juiceBoxMainTrapReXmitPeriod, juiceBoxMainGlobalPortDetectionSetting=juiceBoxMainGlobalPortDetectionSetting, juiceBoxMainSystemVoltage=juiceBoxMainSystemVoltage, juiceBoxMainTrapDestinationIPAddr=juiceBoxMainTrapDestinationIPAddr, juiceBoxPortIndex=juiceBoxPortIndex, juiceBoxMainAllocatedPowerThreshold=juiceBoxMainAllocatedPowerThreshold, juiceBoxMainNetworkControllerFirmware=juiceBoxMainNetworkControllerFirmware, juiceBoxPortEntry=juiceBoxPortEntry, juiceBoxAllocatedPowerThresholdReached=juiceBoxAllocatedPowerThresholdReached, juiceBoxMainObjects=juiceBoxMainObjects, juiceBoxPortStatusChange=juiceBoxPortStatusChange, juiceBoxPortStatus=juiceBoxPortStatus, juiceBoxMainTemperature=juiceBoxMainTemperature, juiceBoxPortTable=juiceBoxPortTable)
def solution(n): answer = 0 for i in range(1, n+1): if n % i == 0: answer += i return answer
def solution(n): answer = 0 for i in range(1, n + 1): if n % i == 0: answer += i return answer
class Solution: def lastStoneWeight(self, stones: List[int]) -> int: max_heap = [] for n in stones : heappush(max_heap,-n) while max_heap : sto1 = -heappop(max_heap) if not max_heap : return sto1 sto2 = -heappop(max_heap) diff = sto1-sto2 if diff > 0 : heappush(max_heap, -diff) return 0
class Solution: def last_stone_weight(self, stones: List[int]) -> int: max_heap = [] for n in stones: heappush(max_heap, -n) while max_heap: sto1 = -heappop(max_heap) if not max_heap: return sto1 sto2 = -heappop(max_heap) diff = sto1 - sto2 if diff > 0: heappush(max_heap, -diff) return 0
class Spam: def __init__(self): self.spam = 'spam, spam, spam' def set_eggs(eggs): self.eggs = eggs def __str__(self): return '%s and %s' % (self.spam, self.eggs) # Maybe uninitialized attribute 'eggs' #Fixed version class Spam: def __init__(self): self.spam = 'spam, spam, spam' self.eggs = None def set_eggs(eggs): self.eggs = eggs def __str__(self): return '%s and %s' % (self.spam, self.eggs) # OK
class Spam: def __init__(self): self.spam = 'spam, spam, spam' def set_eggs(eggs): self.eggs = eggs def __str__(self): return '%s and %s' % (self.spam, self.eggs) class Spam: def __init__(self): self.spam = 'spam, spam, spam' self.eggs = None def set_eggs(eggs): self.eggs = eggs def __str__(self): return '%s and %s' % (self.spam, self.eggs)
# https://edabit.com/challenge/yfooETHj3sHoHTJsv # Create a function that returns True when num1 is equal to num2; otherwise return False. def same_thing(int1: int, int2: int) -> bool: try: if int1 == int2: return True elif int1 != int2: return False except ValueError as err: print(f"Error: {err}") print(same_thing(4, 4)) print(same_thing(5, 9))
def same_thing(int1: int, int2: int) -> bool: try: if int1 == int2: return True elif int1 != int2: return False except ValueError as err: print(f'Error: {err}') print(same_thing(4, 4)) print(same_thing(5, 9))
# a metric cross reference: # <haproxy metric>: (<collectd type instance>, <collectd type>) METRIC_XREF = { # metrics from the "show info" command 'Nbproc': ('num_processes', 'gauge'), 'Process_num': ('process_num', 'gauge'), 'Pid': ('pid', 'gauge'), 'Uptime_sec': ('uptime_seconds', 'gauge'), 'Memmax_MB': ('max_memory_mb', 'gauge'), 'Maxsock': ('max_sockets', 'gauge'), 'Maxconn': ('max_connections', 'gauge'), "Hard_maxconn": ("hard_max_connections", "gauge"), 'CurrConns': ('current_connections', 'gauge'), "CumConns": ("connection_count", "counter"), "CumReq": ("request_count", "counter"), "MaxSslConns": ("max_ssl_connections", "gauge"), "CurrSslConns": ("current_ssl_conenctions", "gauge"), "CumSslConns": ("ssl_connection_count", "counter"), 'Maxpipes': ('max_pipes', 'gauge'), 'PipesUsed': ('pipes_used', 'gauge'), 'PipesFree': ('pipes_free', 'gauge'), "ConnRate": ("connection_rate", "gauge"), "ConnRateLimit": ("max_connection_rate", "gauge"), 'MaxConnRate': ('peak_connection_rate', 'gauge'), "SessRate": ("session_rate", "gauge"), "SessRateLimit": ("max_session_rate", "gauge"), 'MaxSessRate': ('peak_session_rate', 'gauge'), "SslRate": ("ssl_rate", "gauge"), "SslRateLimit": ("max_ssl_rate", "gauge"), "MaxSslRate": ("peak_ssl_rate", "gauge"), "SslFrontendKeyRate": ("ssl_frontend_key_rate", "gauge"), "SslFrontendMaxKeyRate": ("peak_ssl_frontend_key_rate", "gauge"), "SslFrontendSessionReuse_pct": ("ssl_frontend_sess_reuse_pct", "gauge"), "SslBackendKeyRate": ("ssl_backend_key_rate", "gauge"), "SslBackendMaxKeyRate": ("peak_ssl_backend_key_rate", "gauge"), "SslCacheLookups": ("ssl_cache_lookup_count", "counter"), "SslCacheMisses": ("ssl_cache_miss_count", "counter"), "CompressBpsIn": ("compress_bps_in", "gauge"), "CompressBpsOut": ("compress_bps_out", "gauge"), "CompressBpsRateLim": ("max_compress_bps_rate", "gauge"), "ZlibMemUsage": ("zlib_mem_usage", "gauge"), "MaxZlibMemUsage": ("peak_zlib_mem_usage", "gauge"), 'Tasks': ('tasks', 'gauge'), 'Run_queue': ('run_queue', 'gauge'), "Idle_pct": ("idle_pct", "gauge"), # metrics from the "show stat" command # see http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#9.1 'qcur': ('queued_request_count', 'gauge'), "qmax": ("peak_queued_request_count", "gauge"), 'scur': ('current_session_count', 'gauge'), "smax": ("peak_session_count", "gauge"), "slim": ("max_sessions", "gauge"), 'stot': ('session_count', 'counter'), 'bin': ('bytes_in', 'gauge'), 'bout': ('bytes_out', 'gauge'), 'dreq': ('denied_request_count', 'counter'), 'dresp': ('denied_response_count', 'counter'), 'ereq': ('error_request_count', 'counter'), 'econ': ('error_connection_count', 'counter'), 'eresp': ('error_response_count', 'counter'), 'wretr': ('conn_retry_count', 'counter'), 'wredis': ('redispatch_count', 'counter'), "weight": ("server_weight", "gauge"), "act": ("active_server_count", "gauge"), "bck": ("backup_server_count", "gauge"), 'chkfail': ('failed_check_count', 'counter'), "chkdown": ("down_transition_count", "counter"), "lastchg": ("last_change_seconds", "counter"), 'downtime': ('downtime_seconds', 'counter'), "qlimit": ("max_queue", "gauge"), "throttle": ("throttle_pct", "gauge"), "lbtot": ("selection_count", "counter"), 'rate': ('session_rate', 'gauge'), "rate_lim": ("max_session_rate", "gauge"), "rate_max": ("peak_session_rate", "gauge"), "check_duration": ("check_duration", "derive"), 'hrsp_1xx': ('http_response_1xx', 'counter'), 'hrsp_2xx': ('http_response_2xx', 'counter'), 'hrsp_3xx': ('http_response_3xx', 'counter'), 'hrsp_4xx': ('http_response_4xx', 'counter'), 'hrsp_5xx': ('http_response_5xx', 'counter'), 'hrsp_other': ('http_response_other', 'counter'), 'req_rate': ('request_rate', 'gauge'), "req_rate_max": ("peak_request_rate", "gauge"), "req_tot": ("request_count", "counter"), "cli_abrt": ("client_abort_count", "counter"), "srv_abrt": ("server_abort_count", "counter"), "qtime": ("avg_queue_time", "gauge"), "ctime": ("avg_connect_time", "gauge"), "rtime": ("avg_response_time", "gauge"), "ttime": ("avg_total_session_time", "gauge"), }
metric_xref = {'Nbproc': ('num_processes', 'gauge'), 'Process_num': ('process_num', 'gauge'), 'Pid': ('pid', 'gauge'), 'Uptime_sec': ('uptime_seconds', 'gauge'), 'Memmax_MB': ('max_memory_mb', 'gauge'), 'Maxsock': ('max_sockets', 'gauge'), 'Maxconn': ('max_connections', 'gauge'), 'Hard_maxconn': ('hard_max_connections', 'gauge'), 'CurrConns': ('current_connections', 'gauge'), 'CumConns': ('connection_count', 'counter'), 'CumReq': ('request_count', 'counter'), 'MaxSslConns': ('max_ssl_connections', 'gauge'), 'CurrSslConns': ('current_ssl_conenctions', 'gauge'), 'CumSslConns': ('ssl_connection_count', 'counter'), 'Maxpipes': ('max_pipes', 'gauge'), 'PipesUsed': ('pipes_used', 'gauge'), 'PipesFree': ('pipes_free', 'gauge'), 'ConnRate': ('connection_rate', 'gauge'), 'ConnRateLimit': ('max_connection_rate', 'gauge'), 'MaxConnRate': ('peak_connection_rate', 'gauge'), 'SessRate': ('session_rate', 'gauge'), 'SessRateLimit': ('max_session_rate', 'gauge'), 'MaxSessRate': ('peak_session_rate', 'gauge'), 'SslRate': ('ssl_rate', 'gauge'), 'SslRateLimit': ('max_ssl_rate', 'gauge'), 'MaxSslRate': ('peak_ssl_rate', 'gauge'), 'SslFrontendKeyRate': ('ssl_frontend_key_rate', 'gauge'), 'SslFrontendMaxKeyRate': ('peak_ssl_frontend_key_rate', 'gauge'), 'SslFrontendSessionReuse_pct': ('ssl_frontend_sess_reuse_pct', 'gauge'), 'SslBackendKeyRate': ('ssl_backend_key_rate', 'gauge'), 'SslBackendMaxKeyRate': ('peak_ssl_backend_key_rate', 'gauge'), 'SslCacheLookups': ('ssl_cache_lookup_count', 'counter'), 'SslCacheMisses': ('ssl_cache_miss_count', 'counter'), 'CompressBpsIn': ('compress_bps_in', 'gauge'), 'CompressBpsOut': ('compress_bps_out', 'gauge'), 'CompressBpsRateLim': ('max_compress_bps_rate', 'gauge'), 'ZlibMemUsage': ('zlib_mem_usage', 'gauge'), 'MaxZlibMemUsage': ('peak_zlib_mem_usage', 'gauge'), 'Tasks': ('tasks', 'gauge'), 'Run_queue': ('run_queue', 'gauge'), 'Idle_pct': ('idle_pct', 'gauge'), 'qcur': ('queued_request_count', 'gauge'), 'qmax': ('peak_queued_request_count', 'gauge'), 'scur': ('current_session_count', 'gauge'), 'smax': ('peak_session_count', 'gauge'), 'slim': ('max_sessions', 'gauge'), 'stot': ('session_count', 'counter'), 'bin': ('bytes_in', 'gauge'), 'bout': ('bytes_out', 'gauge'), 'dreq': ('denied_request_count', 'counter'), 'dresp': ('denied_response_count', 'counter'), 'ereq': ('error_request_count', 'counter'), 'econ': ('error_connection_count', 'counter'), 'eresp': ('error_response_count', 'counter'), 'wretr': ('conn_retry_count', 'counter'), 'wredis': ('redispatch_count', 'counter'), 'weight': ('server_weight', 'gauge'), 'act': ('active_server_count', 'gauge'), 'bck': ('backup_server_count', 'gauge'), 'chkfail': ('failed_check_count', 'counter'), 'chkdown': ('down_transition_count', 'counter'), 'lastchg': ('last_change_seconds', 'counter'), 'downtime': ('downtime_seconds', 'counter'), 'qlimit': ('max_queue', 'gauge'), 'throttle': ('throttle_pct', 'gauge'), 'lbtot': ('selection_count', 'counter'), 'rate': ('session_rate', 'gauge'), 'rate_lim': ('max_session_rate', 'gauge'), 'rate_max': ('peak_session_rate', 'gauge'), 'check_duration': ('check_duration', 'derive'), 'hrsp_1xx': ('http_response_1xx', 'counter'), 'hrsp_2xx': ('http_response_2xx', 'counter'), 'hrsp_3xx': ('http_response_3xx', 'counter'), 'hrsp_4xx': ('http_response_4xx', 'counter'), 'hrsp_5xx': ('http_response_5xx', 'counter'), 'hrsp_other': ('http_response_other', 'counter'), 'req_rate': ('request_rate', 'gauge'), 'req_rate_max': ('peak_request_rate', 'gauge'), 'req_tot': ('request_count', 'counter'), 'cli_abrt': ('client_abort_count', 'counter'), 'srv_abrt': ('server_abort_count', 'counter'), 'qtime': ('avg_queue_time', 'gauge'), 'ctime': ('avg_connect_time', 'gauge'), 'rtime': ('avg_response_time', 'gauge'), 'ttime': ('avg_total_session_time', 'gauge')}
class Tree: def __init__(self, content): self.content = content self.children = [] def add_child(self, tree): if not isinstance(tree, Tree): tree = self.__class__(tree) self.children.append(tree) return self def add_children(self, *trees): for tree in trees: self.add_child(tree) return self def __iter__(self): return iter(self.children)
class Tree: def __init__(self, content): self.content = content self.children = [] def add_child(self, tree): if not isinstance(tree, Tree): tree = self.__class__(tree) self.children.append(tree) return self def add_children(self, *trees): for tree in trees: self.add_child(tree) return self def __iter__(self): return iter(self.children)
CLUSTER_NODE_LABEL = 'Cluster' CLUSTER_RELATION_TYPE = 'CLUSTER' CLUSTER_REVERSE_RELATION_TYPE = 'CLUSTER_OF' CLUSTER_NAME_PROP_KEY = 'name'
cluster_node_label = 'Cluster' cluster_relation_type = 'CLUSTER' cluster_reverse_relation_type = 'CLUSTER_OF' cluster_name_prop_key = 'name'
''' Created on 23. nov. 2015 @author: kga ''' MYSQL = "mysql" POSTGRESSQL = "postgressql" SQLITE = "sqlite" ORACLE = "oracle"
""" Created on 23. nov. 2015 @author: kga """ mysql = 'mysql' postgressql = 'postgressql' sqlite = 'sqlite' oracle = 'oracle'
#!/usr/bin/python CLUSTER_NAME = 'gcp-integration-test-cluster' LOGNAME_LENGTH = 16 LOGGING_PREFIX = 'GCP_INTEGRATION_TEST_' DEFAULT_TIMEOUT = 30 # seconds ROOT_ENDPOINT = '/' ROOT_EXPECTED_OUTPUT = 'Hello World!' STANDARD_LOGGING_ENDPOINT = '/logging_standard' CUSTOM_LOGGING_ENDPOINT = '/logging_custom' MONITORING_ENDPOINT = '/monitoring' EXCEPTION_ENDPOINT = '/exception' CUSTOM_ENDPOINT = '/custom' ENVIRONMENT_ENDPOINT = '/environment' METRIC_PREFIX = 'custom.googleapis.com/{0}' METRIC_TIMEOUT = 60 # seconds # subset of levels found at # https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity SEVERITIES = [ 'WARNING', 'ERROR', 'CRITICAL' ] GAE = 'GAE' GKE = 'GKE' ENVS = [GAE, GKE]
cluster_name = 'gcp-integration-test-cluster' logname_length = 16 logging_prefix = 'GCP_INTEGRATION_TEST_' default_timeout = 30 root_endpoint = '/' root_expected_output = 'Hello World!' standard_logging_endpoint = '/logging_standard' custom_logging_endpoint = '/logging_custom' monitoring_endpoint = '/monitoring' exception_endpoint = '/exception' custom_endpoint = '/custom' environment_endpoint = '/environment' metric_prefix = 'custom.googleapis.com/{0}' metric_timeout = 60 severities = ['WARNING', 'ERROR', 'CRITICAL'] gae = 'GAE' gke = 'GKE' envs = [GAE, GKE]
class Team: def __init__( self, name: str, team_id: str, wins: int, losses: int, line_scores: list, ): self.name = name self.team_id = team_id self.wins = wins self.losses = losses self.line_scores = line_scores def __str__(self): s = "Team(name={}, team_id={}, wins={}, losses={}, line_scores={})" return s.format( self.name, self.team_id, self.wins, self.losses, self.line_scores )
class Team: def __init__(self, name: str, team_id: str, wins: int, losses: int, line_scores: list): self.name = name self.team_id = team_id self.wins = wins self.losses = losses self.line_scores = line_scores def __str__(self): s = 'Team(name={}, team_id={}, wins={}, losses={}, line_scores={})' return s.format(self.name, self.team_id, self.wins, self.losses, self.line_scores)
x = [0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 3.6, 4.8, 7.2, 9.6, 14.4, 19.2] with open("../test.txt") as f: l = f.readlines() for i in range(len(l)): l[i] = l[i].split() print(f'{x[i]:.1f} & 3 & {l[i][0]} & {l[i][1]} & {l[i][2]} ' + r'\\')
x = [0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 3.6, 4.8, 7.2, 9.6, 14.4, 19.2] with open('../test.txt') as f: l = f.readlines() for i in range(len(l)): l[i] = l[i].split() print(f'{x[i]:.1f} & 3 & {l[i][0]} & {l[i][1]} & {l[i][2]} ' + '\\\\')
def bubble_sort(arr): length = len(arr) while True: swapped = False for i in range(1, length): if arr[i - 1] > arr[i]: arr[i - 1], arr[i] = arr[i], arr[i - 1] swapped = True if not swapped: break else: pass # print(arr) # print and see how sort is working return arr if __name__ == '__main__': arr = [6, 4, 1] sortedVal = bubble_sort(arr) print(sortedVal)
def bubble_sort(arr): length = len(arr) while True: swapped = False for i in range(1, length): if arr[i - 1] > arr[i]: (arr[i - 1], arr[i]) = (arr[i], arr[i - 1]) swapped = True if not swapped: break else: pass return arr if __name__ == '__main__': arr = [6, 4, 1] sorted_val = bubble_sort(arr) print(sortedVal)
# # PySNMP MIB module HH3C-OBJP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-OBJP-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:28:53 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint") hh3cCommon, = mibBuilder.importSymbols("HH3C-OID-MIB", "hh3cCommon") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Unsigned32, Counter32, Integer32, TimeTicks, NotificationType, ObjectIdentity, Counter64, IpAddress, Gauge32, ModuleIdentity, iso, MibIdentifier, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Counter32", "Integer32", "TimeTicks", "NotificationType", "ObjectIdentity", "Counter64", "IpAddress", "Gauge32", "ModuleIdentity", "iso", "MibIdentifier", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") hh3cObjp = ModuleIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 155)) hh3cObjp.setRevisions(('2014-03-10 15:36',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: hh3cObjp.setRevisionsDescriptions(('The initial revision of this MIB module.',)) if mibBuilder.loadTexts: hh3cObjp.setLastUpdated('201403101536Z') if mibBuilder.loadTexts: hh3cObjp.setOrganization('Hangzhou H3C Technologies Co., Ltd.') if mibBuilder.loadTexts: hh3cObjp.setContactInfo('Platform Team Hangzhou H3C Technologies Co., Ltd. Hai-Dian District Beijing P.R. China http://www.h3c.com Zip:100085 ') if mibBuilder.loadTexts: hh3cObjp.setDescription('Object-policy management information base for managing devices that support object policy. ') hh3cObjpZonePairObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1)) hh3cObjpZonePairRunningInfoTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1), ) if mibBuilder.loadTexts: hh3cObjpZonePairRunningInfoTable.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairRunningInfoTable.setDescription('Object policy of zone pair running information base.') hh3cObjpZonePairRunningInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1), ).setIndexNames((0, "HH3C-OBJP-MIB", "hh3cObjpZonePairSrcZone"), (0, "HH3C-OBJP-MIB", "hh3cObjpZonePairDstZone"), (0, "HH3C-OBJP-MIB", "hh3cObjpZonePairIPVersion"), (0, "HH3C-OBJP-MIB", "hh3cObjpZonePairRuleID")) if mibBuilder.loadTexts: hh3cObjpZonePairRunningInfoEntry.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairRunningInfoEntry.setDescription('Object policy of zone pair running information entry.') hh3cObjpZonePairSrcZone = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))) if mibBuilder.loadTexts: hh3cObjpZonePairSrcZone.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairSrcZone.setDescription('Name of the source security zone.') hh3cObjpZonePairDstZone = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))) if mibBuilder.loadTexts: hh3cObjpZonePairDstZone.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairDstZone.setDescription('Name of the destination security zone.') hh3cObjpZonePairIPVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ipv4", 1), ("ipv6", 2)))) if mibBuilder.loadTexts: hh3cObjpZonePairIPVersion.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairIPVersion.setDescription('IP protocol version.') hh3cObjpZonePairRuleID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65534))) if mibBuilder.loadTexts: hh3cObjpZonePairRuleID.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairRuleID.setDescription('Rule ID of object policy.') hh3cObjpZonePairMatchPacketCount = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 5), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cObjpZonePairMatchPacketCount.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairMatchPacketCount.setDescription('Number of packets matching the rule.') hh3cObjpZonePairLastMatchTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 6), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cObjpZonePairLastMatchTime.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairLastMatchTime.setDescription('Interval in seconds between the last match and 1970/1/1 00:00:00.') mibBuilder.exportSymbols("HH3C-OBJP-MIB", hh3cObjpZonePairLastMatchTime=hh3cObjpZonePairLastMatchTime, hh3cObjpZonePairRuleID=hh3cObjpZonePairRuleID, PYSNMP_MODULE_ID=hh3cObjp, hh3cObjpZonePairDstZone=hh3cObjpZonePairDstZone, hh3cObjpZonePairObjects=hh3cObjpZonePairObjects, hh3cObjp=hh3cObjp, hh3cObjpZonePairSrcZone=hh3cObjpZonePairSrcZone, hh3cObjpZonePairRunningInfoEntry=hh3cObjpZonePairRunningInfoEntry, hh3cObjpZonePairMatchPacketCount=hh3cObjpZonePairMatchPacketCount, hh3cObjpZonePairIPVersion=hh3cObjpZonePairIPVersion, hh3cObjpZonePairRunningInfoTable=hh3cObjpZonePairRunningInfoTable)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, value_range_constraint, value_size_constraint, constraints_union, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'SingleValueConstraint') (hh3c_common,) = mibBuilder.importSymbols('HH3C-OID-MIB', 'hh3cCommon') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (unsigned32, counter32, integer32, time_ticks, notification_type, object_identity, counter64, ip_address, gauge32, module_identity, iso, mib_identifier, bits, mib_scalar, mib_table, mib_table_row, mib_table_column) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'Counter32', 'Integer32', 'TimeTicks', 'NotificationType', 'ObjectIdentity', 'Counter64', 'IpAddress', 'Gauge32', 'ModuleIdentity', 'iso', 'MibIdentifier', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') hh3c_objp = module_identity((1, 3, 6, 1, 4, 1, 25506, 2, 155)) hh3cObjp.setRevisions(('2014-03-10 15:36',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: hh3cObjp.setRevisionsDescriptions(('The initial revision of this MIB module.',)) if mibBuilder.loadTexts: hh3cObjp.setLastUpdated('201403101536Z') if mibBuilder.loadTexts: hh3cObjp.setOrganization('Hangzhou H3C Technologies Co., Ltd.') if mibBuilder.loadTexts: hh3cObjp.setContactInfo('Platform Team Hangzhou H3C Technologies Co., Ltd. Hai-Dian District Beijing P.R. China http://www.h3c.com Zip:100085 ') if mibBuilder.loadTexts: hh3cObjp.setDescription('Object-policy management information base for managing devices that support object policy. ') hh3c_objp_zone_pair_objects = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1)) hh3c_objp_zone_pair_running_info_table = mib_table((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1)) if mibBuilder.loadTexts: hh3cObjpZonePairRunningInfoTable.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairRunningInfoTable.setDescription('Object policy of zone pair running information base.') hh3c_objp_zone_pair_running_info_entry = mib_table_row((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1)).setIndexNames((0, 'HH3C-OBJP-MIB', 'hh3cObjpZonePairSrcZone'), (0, 'HH3C-OBJP-MIB', 'hh3cObjpZonePairDstZone'), (0, 'HH3C-OBJP-MIB', 'hh3cObjpZonePairIPVersion'), (0, 'HH3C-OBJP-MIB', 'hh3cObjpZonePairRuleID')) if mibBuilder.loadTexts: hh3cObjpZonePairRunningInfoEntry.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairRunningInfoEntry.setDescription('Object policy of zone pair running information entry.') hh3c_objp_zone_pair_src_zone = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(1, 31))) if mibBuilder.loadTexts: hh3cObjpZonePairSrcZone.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairSrcZone.setDescription('Name of the source security zone.') hh3c_objp_zone_pair_dst_zone = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(1, 31))) if mibBuilder.loadTexts: hh3cObjpZonePairDstZone.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairDstZone.setDescription('Name of the destination security zone.') hh3c_objp_zone_pair_ip_version = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ipv4', 1), ('ipv6', 2)))) if mibBuilder.loadTexts: hh3cObjpZonePairIPVersion.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairIPVersion.setDescription('IP protocol version.') hh3c_objp_zone_pair_rule_id = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65534))) if mibBuilder.loadTexts: hh3cObjpZonePairRuleID.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairRuleID.setDescription('Rule ID of object policy.') hh3c_objp_zone_pair_match_packet_count = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 5), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cObjpZonePairMatchPacketCount.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairMatchPacketCount.setDescription('Number of packets matching the rule.') hh3c_objp_zone_pair_last_match_time = mib_table_column((1, 3, 6, 1, 4, 1, 25506, 2, 155, 1, 1, 1, 6), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hh3cObjpZonePairLastMatchTime.setStatus('current') if mibBuilder.loadTexts: hh3cObjpZonePairLastMatchTime.setDescription('Interval in seconds between the last match and 1970/1/1 00:00:00.') mibBuilder.exportSymbols('HH3C-OBJP-MIB', hh3cObjpZonePairLastMatchTime=hh3cObjpZonePairLastMatchTime, hh3cObjpZonePairRuleID=hh3cObjpZonePairRuleID, PYSNMP_MODULE_ID=hh3cObjp, hh3cObjpZonePairDstZone=hh3cObjpZonePairDstZone, hh3cObjpZonePairObjects=hh3cObjpZonePairObjects, hh3cObjp=hh3cObjp, hh3cObjpZonePairSrcZone=hh3cObjpZonePairSrcZone, hh3cObjpZonePairRunningInfoEntry=hh3cObjpZonePairRunningInfoEntry, hh3cObjpZonePairMatchPacketCount=hh3cObjpZonePairMatchPacketCount, hh3cObjpZonePairIPVersion=hh3cObjpZonePairIPVersion, hh3cObjpZonePairRunningInfoTable=hh3cObjpZonePairRunningInfoTable)
# Given an integer array nums, return true if any value appears at least twice in the array, and return false if # every element is distinct. # # Example 1: # Input: nums = [1, 2, 3, 1] # Output: true # # Example 2: # Input: nums = [1, 2, 3, 4] # Output: false # # Example 3: # Input: nums = [1, 1, 1, 3, 3, 4, 3, 2, 4, 2] # Output: true # # Constraints: # # 1 <= nums.length <= 105 # -109 <= nums[i] <= 109 # # class Solution: def containsDuplicate(self, nums: List[int]) -> bool: hashset = set() for num in nums: if num in hashset: return True hashset.add(num) return False
class Solution: def contains_duplicate(self, nums: List[int]) -> bool: hashset = set() for num in nums: if num in hashset: return True hashset.add(num) return False
list=[1,2,3,2,1,4,56,8,7] newlist=[] for i in range(0,len(list)): if(list[i] in newlist): continue newlist.append(list[i]) print("old list: \t\t",list) print("unique elements :",newlist)
list = [1, 2, 3, 2, 1, 4, 56, 8, 7] newlist = [] for i in range(0, len(list)): if list[i] in newlist: continue newlist.append(list[i]) print('old list: \t\t', list) print('unique elements :', newlist)
p, d, m, s = map(int, input().split()) count = 0 total = 0 while p >= m and total <= s: total += p p -= d count += 1 if p - d < m: while total <= s: total += m count += 1 print(count-1)
(p, d, m, s) = map(int, input().split()) count = 0 total = 0 while p >= m and total <= s: total += p p -= d count += 1 if p - d < m: while total <= s: total += m count += 1 print(count - 1)
#!/usr/bin/env python -tt # # Copyright (c) 2007 Red Hat, Inc. # Copyright (c) 2011 Intel, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; version 2 of the License # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. class WicError(Exception): pass
class Wicerror(Exception): pass
# Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def reverseList(self, head: ListNode) -> ListNode: p1 = None p2 = head while p2 is not None: temp1 = p1 temp2 = p2 p1 = temp2 # Note we can NOT use p1 = p1.next, since p1 is None at initialization. p2 = temp2.next temp2.next = temp1 return p1
class Listnode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def reverse_list(self, head: ListNode) -> ListNode: p1 = None p2 = head while p2 is not None: temp1 = p1 temp2 = p2 p1 = temp2 p2 = temp2.next temp2.next = temp1 return p1
DATA_MEAN = 168.3172158554484 DATA_STD = 340.21625683608994 OUTPUT_CHANNELS = 1 DATA_PATH = "/home/matthew/Documents/unet_model/6375_images/" WEIGHTS = "/home/matthew/Documents/unet_model/dsc_after_bce_old.hdf5"
data_mean = 168.3172158554484 data_std = 340.21625683608994 output_channels = 1 data_path = '/home/matthew/Documents/unet_model/6375_images/' weights = '/home/matthew/Documents/unet_model/dsc_after_bce_old.hdf5'
''' lab4 dict and tuple ''' #3.1 my_dict = { 'name' : 'Athena', 'id':123 } print(my_dict) #3.2 print(my_dict.values()) print(my_dict.keys()) #3.3 my_dict['id']=321 #changing the value print(my_dict) #3.4 my_dict.pop('name',None) print(my_dict) #3.5 my_tweet = { "tweet_id":1138, "coordinates":(-75,40), "visited_countries":["GR", "HK", "MY"] } print(my_tweet) #3.6 print(len(my_tweet["visited_countries"])) #3.7 my_tweet["visited_countries"].append("CH") #add print(my_tweet) #3.8 print("US" in my_tweet["visited_countries"]) #seeing if US is in my list print("MY" in my_tweet["visited_countries"]) #seeing if MY is in my list #3.9 #remember, values in dictionary can change my_tweet["coordinates"] = (-81,45) print(my_tweet)
""" lab4 dict and tuple """ my_dict = {'name': 'Athena', 'id': 123} print(my_dict) print(my_dict.values()) print(my_dict.keys()) my_dict['id'] = 321 print(my_dict) my_dict.pop('name', None) print(my_dict) my_tweet = {'tweet_id': 1138, 'coordinates': (-75, 40), 'visited_countries': ['GR', 'HK', 'MY']} print(my_tweet) print(len(my_tweet['visited_countries'])) my_tweet['visited_countries'].append('CH') print(my_tweet) print('US' in my_tweet['visited_countries']) print('MY' in my_tweet['visited_countries']) my_tweet['coordinates'] = (-81, 45) print(my_tweet)
# # PySNMP MIB module MICOMFLTR (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MICOMFLTR # Produced by pysmi-0.3.4 at Mon Apr 29 20:02:23 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion") micom_oscar, = mibBuilder.importSymbols("MICOM-OSCAR-MIB", "micom-oscar") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Counter64, IpAddress, ObjectIdentity, NotificationType, Unsigned32, Integer32, Gauge32, ModuleIdentity, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, MibIdentifier, Bits, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "IpAddress", "ObjectIdentity", "NotificationType", "Unsigned32", "Integer32", "Gauge32", "ModuleIdentity", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "MibIdentifier", "Bits", "Counter32") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") mcmfilter = MibIdentifier((1, 3, 6, 1, 4, 1, 335, 1, 4, 12)) class NetNumber(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(4, 4) fixedLength = 4 class SapType(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(2, 2) fixedLength = 2 mcmipxMacFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1), ) if mibBuilder.loadTexts: mcmipxMacFltrTable.setStatus('obsolete') mcmipxMacFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1), ).setIndexNames((0, "MICOMFLTR", "mcmipxMacFltrSysInstance"), (0, "MICOMFLTR", "mcmipxMacFltrId")) if mibBuilder.loadTexts: mcmipxMacFltrEntry.setStatus('obsolete') mcmipxMacFltrSysInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxMacFltrSysInstance.setStatus('obsolete') mcmipxMacFltrId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxMacFltrId.setStatus('obsolete') mcmipxMacFltrStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxMacFltrStatus.setStatus('obsolete') mcmipxMacFltrSrcAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 4), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxMacFltrSrcAddress.setStatus('obsolete') mcmipxMacFltrDstAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 5), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxMacFltrDstAddress.setStatus('obsolete') mcmipxMacFltrSrcMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 6), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxMacFltrSrcMask.setStatus('obsolete') mcmipxMacFltrDstMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 7), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxMacFltrDstMask.setStatus('obsolete') mcmipxMacFltrPort = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxMacFltrPort.setStatus('obsolete') mcmipxMacFltrDir = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("incoming", 1), ("outgoing", 2), ("both", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxMacFltrDir.setStatus('obsolete') mcmipxNetFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2), ) if mibBuilder.loadTexts: mcmipxNetFltrTable.setStatus('obsolete') mcmipxNetFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1), ).setIndexNames((0, "MICOMFLTR", "mcmipxNetFltrSysInstance"), (0, "MICOMFLTR", "mcmipxNetFltrId")) if mibBuilder.loadTexts: mcmipxNetFltrEntry.setStatus('obsolete') mcmipxNetFltrSysInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxNetFltrSysInstance.setStatus('obsolete') mcmipxNetFltrId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxNetFltrId.setStatus('obsolete') mcmipxNetFltrStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxNetFltrStatus.setStatus('obsolete') mcmipxNetFltrNetNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 4), NetNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxNetFltrNetNumber.setStatus('obsolete') mcmipxNetFltrSapType = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 5), SapType()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxNetFltrSapType.setStatus('obsolete') mcmipxNetFltrNetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 6), NetNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxNetFltrNetMask.setStatus('obsolete') mcmipxNetFltrSapMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 7), SapType()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxNetFltrSapMask.setStatus('obsolete') mcmipxNetFltrPort = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxNetFltrPort.setStatus('obsolete') mcmipxNetFltrDir = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("incoming", 1), ("outgoing", 2), ("both", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxNetFltrDir.setStatus('obsolete') nvmipxMacFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3), ) if mibBuilder.loadTexts: nvmipxMacFltrTable.setStatus('obsolete') nvmipxMacFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1), ).setIndexNames((0, "MICOMFLTR", "nvmipxMacFltrSysInstance"), (0, "MICOMFLTR", "nvmipxMacFltrId")) if mibBuilder.loadTexts: nvmipxMacFltrEntry.setStatus('obsolete') nvmipxMacFltrSysInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxMacFltrSysInstance.setStatus('obsolete') nvmipxMacFltrId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxMacFltrId.setStatus('obsolete') nvmipxMacFltrStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxMacFltrStatus.setStatus('obsolete') nvmipxMacFltrSrcAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 4), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxMacFltrSrcAddress.setStatus('obsolete') nvmipxMacFltrDstAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 5), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxMacFltrDstAddress.setStatus('obsolete') nvmipxMacFltrSrcMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 6), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxMacFltrSrcMask.setStatus('obsolete') nvmipxMacFltrDstMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 7), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxMacFltrDstMask.setStatus('obsolete') nvmipxMacFltrPort = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 8), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxMacFltrPort.setStatus('obsolete') nvmipxMacFltrDir = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("incoming", 1), ("outgoing", 2), ("both", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxMacFltrDir.setStatus('obsolete') nvmipxNetFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4), ) if mibBuilder.loadTexts: nvmipxNetFltrTable.setStatus('obsolete') nvmipxNetFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1), ).setIndexNames((0, "MICOMFLTR", "nvmipxNetFltrSysInstance"), (0, "MICOMFLTR", "nvmipxNetFltrId")) if mibBuilder.loadTexts: nvmipxNetFltrEntry.setStatus('obsolete') nvmipxNetFltrSysInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxNetFltrSysInstance.setStatus('obsolete') nvmipxNetFltrId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxNetFltrId.setStatus('obsolete') nvmipxNetFltrStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxNetFltrStatus.setStatus('obsolete') nvmipxNetFltrNetNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 4), NetNumber()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxNetFltrNetNumber.setStatus('obsolete') nvmipxNetFltrSapType = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 5), SapType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxNetFltrSapType.setStatus('obsolete') nvmipxNetFltrNetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 6), NetNumber()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxNetFltrNetMask.setStatus('obsolete') nvmipxNetFltrSapMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 7), SapType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxNetFltrSapMask.setStatus('obsolete') nvmipxNetFltrPort = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 8), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxNetFltrPort.setStatus('obsolete') nvmipxNetFltrDir = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("incoming", 1), ("outgoing", 2), ("both", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxNetFltrDir.setStatus('obsolete') mcmipxSysFilterGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 19)) mcmipxSysRipFilter = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 19, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("inclusive", 1), ("exclusive", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxSysRipFilter.setStatus('mandatory') mcmipxSysSapFilter = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 19, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("inclusive", 1), ("exclusive", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxSysSapFilter.setStatus('mandatory') mcmipxSysNetFilter = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 19, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("inclusive", 1), ("exclusive", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmipxSysNetFilter.setStatus('mandatory') nvmipxSysFilterGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 20)) nvmipxSysRipFilter = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 20, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("inclusive", 1), ("exclusive", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxSysRipFilter.setStatus('mandatory') nvmipxSysSapFilter = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 20, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("inclusive", 1), ("exclusive", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxSysSapFilter.setStatus('mandatory') nvmipxSysNetFilter = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 20, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("inclusive", 1), ("exclusive", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmipxSysNetFilter.setStatus('mandatory') mcmIpxRipFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 21), ) if mibBuilder.loadTexts: mcmIpxRipFltrTable.setStatus('mandatory') mcmIpxRipFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 21, 1), ).setIndexNames((0, "MICOMFLTR", "mcmIpxRipFltrSysInstance"), (0, "MICOMFLTR", "mcmIpxRipFltrNetNumber")) if mibBuilder.loadTexts: mcmIpxRipFltrEntry.setStatus('mandatory') mcmIpxRipFltrSysInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 21, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpxRipFltrSysInstance.setStatus('mandatory') mcmIpxRipFltrNetNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 21, 1, 2), NetNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpxRipFltrNetNumber.setStatus('mandatory') mcmIpxRipFltrPort = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 21, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("wan", 1), ("ethernet", 2), ("both", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpxRipFltrPort.setStatus('mandatory') mcmIpxSapFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 22), ) if mibBuilder.loadTexts: mcmIpxSapFltrTable.setStatus('mandatory') mcmIpxSapFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 22, 1), ).setIndexNames((0, "MICOMFLTR", "mcmIpxSapFltrSysInstance"), (0, "MICOMFLTR", "mcmIpxSapFltrSapType")) if mibBuilder.loadTexts: mcmIpxSapFltrEntry.setStatus('mandatory') mcmIpxSapFltrSysInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 22, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpxSapFltrSysInstance.setStatus('mandatory') mcmIpxSapFltrSapType = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 22, 1, 2), SapType()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpxSapFltrSapType.setStatus('mandatory') mcmIpxSapFltrPort = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 22, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("wan", 1), ("ethernet", 2), ("both", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpxSapFltrPort.setStatus('mandatory') mcmIpxNetFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23), ) if mibBuilder.loadTexts: mcmIpxNetFltrTable.setStatus('mandatory') mcmIpxNetFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23, 1), ).setIndexNames((0, "MICOMFLTR", "mcmIpxNetFltrSysInstance"), (0, "MICOMFLTR", "mcmIpxNetFltrNetNumber")) if mibBuilder.loadTexts: mcmIpxNetFltrEntry.setStatus('mandatory') mcmIpxNetFltrSysInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpxNetFltrSysInstance.setStatus('mandatory') mcmIpxNetFltrNetNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23, 1, 2), NetNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpxNetFltrNetNumber.setStatus('mandatory') mcmIpxNetFltrPort = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("wan", 1), ("ethernet", 2), ("both", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpxNetFltrPort.setStatus('mandatory') mcmIpxNetFltrDir = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("source", 1), ("destination", 2), ("both", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpxNetFltrDir.setStatus('mandatory') nvmIpxRipFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24), ) if mibBuilder.loadTexts: nvmIpxRipFltrTable.setStatus('mandatory') nvmIpxRipFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24, 1), ).setIndexNames((0, "MICOMFLTR", "nvmIpxRipFltrSysInstance"), (0, "MICOMFLTR", "nvmIpxRipFltrNetNumber")) if mibBuilder.loadTexts: nvmIpxRipFltrEntry.setStatus('mandatory') nvmIpxRipFltrSysInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxRipFltrSysInstance.setStatus('mandatory') nvmIpxRipFltrNetNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24, 1, 2), NetNumber()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxRipFltrNetNumber.setStatus('mandatory') nvmIpxRipFltrPort = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("wan", 1), ("ethernet", 2), ("both", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxRipFltrPort.setStatus('mandatory') nvmIpxRipFltrRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 4, 6))).clone(namedValues=NamedValues(("active", 1), ("createAndGo", 4), ("destroy", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxRipFltrRowStatus.setStatus('mandatory') nvmIpxSapFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25), ) if mibBuilder.loadTexts: nvmIpxSapFltrTable.setStatus('mandatory') nvmIpxSapFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25, 1), ).setIndexNames((0, "MICOMFLTR", "nvmIpxSapFltrSysInstance"), (0, "MICOMFLTR", "nvmIpxSapFltrSapType")) if mibBuilder.loadTexts: nvmIpxSapFltrEntry.setStatus('mandatory') nvmIpxSapFltrSysInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxSapFltrSysInstance.setStatus('mandatory') nvmIpxSapFltrSapType = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25, 1, 2), SapType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxSapFltrSapType.setStatus('mandatory') nvmIpxSapFltrPort = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("wan", 1), ("ethernet", 2), ("both", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxSapFltrPort.setStatus('mandatory') nvmIpxSapFltrRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 4, 6))).clone(namedValues=NamedValues(("active", 1), ("createAndGo", 4), ("destroy", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxSapFltrRowStatus.setStatus('mandatory') nvmIpxNetFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26), ) if mibBuilder.loadTexts: nvmIpxNetFltrTable.setStatus('mandatory') nvmIpxNetFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1), ).setIndexNames((0, "MICOMFLTR", "nvmIpxNetFltrSysInstance"), (0, "MICOMFLTR", "nvmIpxNetFltrNetNumber")) if mibBuilder.loadTexts: nvmIpxNetFltrEntry.setStatus('mandatory') nvmIpxNetFltrSysInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxNetFltrSysInstance.setStatus('mandatory') nvmIpxNetFltrNetNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1, 2), NetNumber()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxNetFltrNetNumber.setStatus('mandatory') nvmIpxNetFltrPort = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("wan", 1), ("ethernet", 2), ("both", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxNetFltrPort.setStatus('mandatory') nvmIpxNetFltrDir = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("source", 1), ("destination", 2), ("both", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxNetFltrDir.setStatus('mandatory') nvmIpxNetFltrRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 4, 6))).clone(namedValues=NamedValues(("active", 1), ("createAndGo", 4), ("destroy", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpxNetFltrRowStatus.setStatus('mandatory') mcmIpRipInFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 5), ) if mibBuilder.loadTexts: mcmIpRipInFltrTable.setStatus('mandatory') mcmIpRipInFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 5, 1), ).setIndexNames((0, "MICOMFLTR", "mcmIpRipInFltrMask"), (0, "MICOMFLTR", "mcmIpRipInFltrAddr")) if mibBuilder.loadTexts: mcmIpRipInFltrEntry.setStatus('mandatory') mcmIpRipInFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 5, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpRipInFltrMask.setStatus('mandatory') mcmIpRipInFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 5, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpRipInFltrAddr.setStatus('mandatory') mcmIpRipInFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpRipInFltrAction.setStatus('mandatory') mcmIpRipOutFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 6), ) if mibBuilder.loadTexts: mcmIpRipOutFltrTable.setStatus('mandatory') mcmIpRipOutFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 6, 1), ).setIndexNames((0, "MICOMFLTR", "mcmIpRipOutFltrMask"), (0, "MICOMFLTR", "mcmIpRipOutFltrAddr")) if mibBuilder.loadTexts: mcmIpRipOutFltrEntry.setStatus('mandatory') mcmIpRipOutFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 6, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpRipOutFltrMask.setStatus('mandatory') mcmIpRipOutFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 6, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpRipOutFltrAddr.setStatus('mandatory') mcmIpRipOutFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 6, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpRipOutFltrAction.setStatus('mandatory') mcmIpRipGwyFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 7), ) if mibBuilder.loadTexts: mcmIpRipGwyFltrTable.setStatus('mandatory') mcmIpRipGwyFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 7, 1), ).setIndexNames((0, "MICOMFLTR", "mcmIpRipGwyFltrMask"), (0, "MICOMFLTR", "mcmIpRipGwyFltrAddr")) if mibBuilder.loadTexts: mcmIpRipGwyFltrEntry.setStatus('mandatory') mcmIpRipGwyFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 7, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpRipGwyFltrMask.setStatus('mandatory') mcmIpRipGwyFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 7, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpRipGwyFltrAddr.setStatus('mandatory') mcmIpRipGwyFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 7, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpRipGwyFltrAction.setStatus('mandatory') mcmIpOspfOutFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 8), ) if mibBuilder.loadTexts: mcmIpOspfOutFltrTable.setStatus('mandatory') mcmIpOspfOutFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 8, 1), ).setIndexNames((0, "MICOMFLTR", "mcmIpOspfOutFltrMask"), (0, "MICOMFLTR", "mcmIpOspfOutFltrAddr")) if mibBuilder.loadTexts: mcmIpOspfOutFltrEntry.setStatus('mandatory') mcmIpOspfOutFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 8, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpOspfOutFltrMask.setStatus('mandatory') mcmIpOspfOutFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 8, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpOspfOutFltrAddr.setStatus('mandatory') mcmIpOspfOutFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 8, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpOspfOutFltrAction.setStatus('mandatory') mcmIpFwdPortInFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9), ) if mibBuilder.loadTexts: mcmIpFwdPortInFltrTable.setStatus('mandatory') mcmIpFwdPortInFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1), ).setIndexNames((0, "MICOMFLTR", "mcmIpFwdPortInFltrPortNo"), (0, "MICOMFLTR", "mcmIpFwdPortInFltrMask"), (0, "MICOMFLTR", "mcmIpFwdPortInFltrAddr"), (0, "MICOMFLTR", "mcmIpFwdPortInFltrProtId"), (0, "MICOMFLTR", "mcmIpFwdPortInFltrPortId")) if mibBuilder.loadTexts: mcmIpFwdPortInFltrEntry.setStatus('mandatory') mcmIpFwdPortInFltrPortNo = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortInFltrPortNo.setStatus('mandatory') mcmIpFwdPortInFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortInFltrMask.setStatus('mandatory') mcmIpFwdPortInFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortInFltrAddr.setStatus('mandatory') mcmIpFwdPortInFltrProtId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortInFltrProtId.setStatus('mandatory') mcmIpFwdPortInFltrPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortInFltrPortId.setStatus('mandatory') mcmIpFwdPortInFltrSrcDst = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("source", 1), ("destination", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortInFltrSrcDst.setStatus('mandatory') mcmIpFwdPortInFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortInFltrAction.setStatus('mandatory') mcmIpFwdPortOutFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10), ) if mibBuilder.loadTexts: mcmIpFwdPortOutFltrTable.setStatus('mandatory') mcmIpFwdPortOutFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1), ).setIndexNames((0, "MICOMFLTR", "mcmIpFwdPortOutFltrPortNo"), (0, "MICOMFLTR", "mcmIpFwdPortOutFltrMask"), (0, "MICOMFLTR", "mcmIpFwdPortOutFltrAddr"), (0, "MICOMFLTR", "mcmIpFwdPortOutFltrProtId"), (0, "MICOMFLTR", "mcmIpFwdPortOutFltrPortId")) if mibBuilder.loadTexts: mcmIpFwdPortOutFltrEntry.setStatus('mandatory') mcmIpFwdPortOutFltrPortNo = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortOutFltrPortNo.setStatus('mandatory') mcmIpFwdPortOutFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortOutFltrMask.setStatus('mandatory') mcmIpFwdPortOutFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortOutFltrAddr.setStatus('mandatory') mcmIpFwdPortOutFltrProtId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortOutFltrProtId.setStatus('mandatory') mcmIpFwdPortOutFltrPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortOutFltrPortId.setStatus('mandatory') mcmIpFwdPortOutFltrSrcDst = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("source", 1), ("destination", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortOutFltrSrcDst.setStatus('mandatory') mcmIpFwdPortOutFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpFwdPortOutFltrAction.setStatus('mandatory') mcmIpSysFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11), ) if mibBuilder.loadTexts: mcmIpSysFltrTable.setStatus('mandatory') mcmIpSysFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1), ).setIndexNames((0, "MICOMFLTR", "mcmIpSysFltrDstMask"), (0, "MICOMFLTR", "mcmIpSysFltrDstAddr"), (0, "MICOMFLTR", "mcmIpSysFltrSrcMask"), (0, "MICOMFLTR", "mcmIpSysFltrSrcAddr"), (0, "MICOMFLTR", "mcmIpSysFltrProtId"), (0, "MICOMFLTR", "mcmIpSysFltrPortId")) if mibBuilder.loadTexts: mcmIpSysFltrEntry.setStatus('mandatory') mcmIpSysFltrDstMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpSysFltrDstMask.setStatus('mandatory') mcmIpSysFltrDstAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpSysFltrDstAddr.setStatus('mandatory') mcmIpSysFltrSrcMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpSysFltrSrcMask.setStatus('mandatory') mcmIpSysFltrSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 4), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpSysFltrSrcAddr.setStatus('mandatory') mcmIpSysFltrProtId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpSysFltrProtId.setStatus('mandatory') mcmIpSysFltrPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpSysFltrPortId.setStatus('mandatory') mcmIpSysFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmIpSysFltrAction.setStatus('mandatory') nvmIpRipInFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 12), ) if mibBuilder.loadTexts: nvmIpRipInFltrTable.setStatus('mandatory') nvmIpRipInFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 12, 1), ).setIndexNames((0, "MICOMFLTR", "nvmIpRipInFltrMask"), (0, "MICOMFLTR", "nvmIpRipInFltrAddr")) if mibBuilder.loadTexts: nvmIpRipInFltrEntry.setStatus('mandatory') nvmIpRipInFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 12, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpRipInFltrMask.setStatus('mandatory') nvmIpRipInFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 12, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpRipInFltrAddr.setStatus('mandatory') nvmIpRipInFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 12, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2), ("invalid", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpRipInFltrAction.setStatus('mandatory') nvmIpRipOutFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 13), ) if mibBuilder.loadTexts: nvmIpRipOutFltrTable.setStatus('mandatory') nvmIpRipOutFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 13, 1), ).setIndexNames((0, "MICOMFLTR", "nvmIpRipOutFltrMask"), (0, "MICOMFLTR", "nvmIpRipOutFltrAddr")) if mibBuilder.loadTexts: nvmIpRipOutFltrEntry.setStatus('mandatory') nvmIpRipOutFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 13, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpRipOutFltrMask.setStatus('mandatory') nvmIpRipOutFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 13, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpRipOutFltrAddr.setStatus('mandatory') nvmIpRipOutFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 13, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2), ("invalid", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpRipOutFltrAction.setStatus('mandatory') nvmIpRipGwyFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 14), ) if mibBuilder.loadTexts: nvmIpRipGwyFltrTable.setStatus('mandatory') nvmIpRipGwyFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 14, 1), ).setIndexNames((0, "MICOMFLTR", "nvmIpRipGwyFltrMask"), (0, "MICOMFLTR", "nvmIpRipGwyFltrAddr")) if mibBuilder.loadTexts: nvmIpRipGwyFltrEntry.setStatus('mandatory') nvmIpRipGwyFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 14, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpRipGwyFltrMask.setStatus('mandatory') nvmIpRipGwyFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 14, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpRipGwyFltrAddr.setStatus('mandatory') nvmIpRipGwyFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 14, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2), ("invalid", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpRipGwyFltrAction.setStatus('mandatory') nvmIpOspfOutFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 15), ) if mibBuilder.loadTexts: nvmIpOspfOutFltrTable.setStatus('mandatory') nvmIpOspfOutFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 15, 1), ).setIndexNames((0, "MICOMFLTR", "nvmIpOspfOutFltrMask"), (0, "MICOMFLTR", "nvmIpOspfOutFltrAddr")) if mibBuilder.loadTexts: nvmIpOspfOutFltrEntry.setStatus('mandatory') nvmIpOspfOutFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 15, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpOspfOutFltrMask.setStatus('mandatory') nvmIpOspfOutFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 15, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpOspfOutFltrAddr.setStatus('mandatory') nvmIpOspfOutFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 15, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2), ("invalid", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpOspfOutFltrAction.setStatus('mandatory') nvmIpFwdPortInFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16), ) if mibBuilder.loadTexts: nvmIpFwdPortInFltrTable.setStatus('mandatory') nvmIpFwdPortInFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1), ).setIndexNames((0, "MICOMFLTR", "nvmIpFwdPortInFltrPortNo"), (0, "MICOMFLTR", "nvmIpFwdPortInFltrMask"), (0, "MICOMFLTR", "nvmIpFwdPortInFltrAddr"), (0, "MICOMFLTR", "nvmIpFwdPortInFltrProtId"), (0, "MICOMFLTR", "nvmIpFwdPortInFltrPortId")) if mibBuilder.loadTexts: nvmIpFwdPortInFltrEntry.setStatus('mandatory') nvmIpFwdPortInFltrPortNo = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortInFltrPortNo.setStatus('mandatory') nvmIpFwdPortInFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortInFltrMask.setStatus('mandatory') nvmIpFwdPortInFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortInFltrAddr.setStatus('mandatory') nvmIpFwdPortInFltrProtId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortInFltrProtId.setStatus('mandatory') nvmIpFwdPortInFltrPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortInFltrPortId.setStatus('mandatory') nvmIpFwdPortInFltrSrcDst = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("source", 1), ("destination", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortInFltrSrcDst.setStatus('mandatory') nvmIpFwdPortInFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2), ("invalid", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortInFltrAction.setStatus('mandatory') nvmIpFwdPortOutFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17), ) if mibBuilder.loadTexts: nvmIpFwdPortOutFltrTable.setStatus('mandatory') nvmIpFwdPortOutFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1), ).setIndexNames((0, "MICOMFLTR", "nvmIpFwdPortOutFltrPortNo"), (0, "MICOMFLTR", "nvmIpFwdPortOutFltrMask"), (0, "MICOMFLTR", "nvmIpFwdPortOutFltrAddr"), (0, "MICOMFLTR", "nvmIpFwdPortOutFltrProtId"), (0, "MICOMFLTR", "nvmIpFwdPortOutFltrPortId")) if mibBuilder.loadTexts: nvmIpFwdPortOutFltrEntry.setStatus('mandatory') nvmIpFwdPortOutFltrPortNo = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortOutFltrPortNo.setStatus('mandatory') nvmIpFwdPortOutFltrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortOutFltrMask.setStatus('mandatory') nvmIpFwdPortOutFltrAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortOutFltrAddr.setStatus('mandatory') nvmIpFwdPortOutFltrProtId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortOutFltrProtId.setStatus('mandatory') nvmIpFwdPortOutFltrPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortOutFltrPortId.setStatus('mandatory') nvmIpFwdPortOutFltrSrcDst = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("source", 1), ("destination", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortOutFltrSrcDst.setStatus('mandatory') nvmIpFwdPortOutFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2), ("invalid", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpFwdPortOutFltrAction.setStatus('mandatory') nvmIpSysFltrTable = MibTable((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18), ) if mibBuilder.loadTexts: nvmIpSysFltrTable.setStatus('mandatory') nvmIpSysFltrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1), ).setIndexNames((0, "MICOMFLTR", "nvmIpSysFltrDstMask"), (0, "MICOMFLTR", "nvmIpSysFltrDstAddr"), (0, "MICOMFLTR", "nvmIpSysFltrSrcMask"), (0, "MICOMFLTR", "nvmIpSysFltrSrcAddr"), (0, "MICOMFLTR", "nvmIpSysFltrProtId"), (0, "MICOMFLTR", "nvmIpSysFltrPortId")) if mibBuilder.loadTexts: nvmIpSysFltrEntry.setStatus('mandatory') nvmIpSysFltrDstMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpSysFltrDstMask.setStatus('mandatory') nvmIpSysFltrDstAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpSysFltrDstAddr.setStatus('mandatory') nvmIpSysFltrSrcMask = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpSysFltrSrcMask.setStatus('mandatory') nvmIpSysFltrSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpSysFltrSrcAddr.setStatus('mandatory') nvmIpSysFltrProtId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpSysFltrProtId.setStatus('mandatory') nvmIpSysFltrPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpSysFltrPortId.setStatus('mandatory') nvmIpSysFltrAction = MibTableColumn((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2), ("invalid", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: nvmIpSysFltrAction.setStatus('mandatory') mibBuilder.exportSymbols("MICOMFLTR", mcmIpxRipFltrEntry=mcmIpxRipFltrEntry, mcmipxNetFltrSapMask=mcmipxNetFltrSapMask, nvmIpOspfOutFltrMask=nvmIpOspfOutFltrMask, nvmIpxNetFltrPort=nvmIpxNetFltrPort, nvmipxNetFltrId=nvmipxNetFltrId, nvmipxNetFltrSysInstance=nvmipxNetFltrSysInstance, nvmIpSysFltrProtId=nvmIpSysFltrProtId, SapType=SapType, mcmIpOspfOutFltrAddr=mcmIpOspfOutFltrAddr, mcmIpSysFltrSrcMask=mcmIpSysFltrSrcMask, mcmipxMacFltrSrcMask=mcmipxMacFltrSrcMask, mcmipxMacFltrDstAddress=mcmipxMacFltrDstAddress, nvmIpxRipFltrNetNumber=nvmIpxRipFltrNetNumber, mcmipxMacFltrSrcAddress=mcmipxMacFltrSrcAddress, mcmipxSysSapFilter=mcmipxSysSapFilter, nvmipxMacFltrSrcMask=nvmipxMacFltrSrcMask, mcmIpRipGwyFltrTable=mcmIpRipGwyFltrTable, mcmIpFwdPortInFltrTable=mcmIpFwdPortInFltrTable, mcmIpSysFltrDstAddr=mcmIpSysFltrDstAddr, mcmipxMacFltrDir=mcmipxMacFltrDir, mcmipxSysNetFilter=mcmipxSysNetFilter, nvmIpxNetFltrRowStatus=nvmIpxNetFltrRowStatus, mcmipxMacFltrDstMask=mcmipxMacFltrDstMask, nvmIpxNetFltrTable=nvmIpxNetFltrTable, mcmIpFwdPortInFltrMask=mcmIpFwdPortInFltrMask, nvmIpSysFltrDstMask=nvmIpSysFltrDstMask, mcmipxNetFltrDir=mcmipxNetFltrDir, nvmIpFwdPortInFltrPortId=nvmIpFwdPortInFltrPortId, nvmipxSysRipFilter=nvmipxSysRipFilter, mcmipxSysFilterGroup=mcmipxSysFilterGroup, mcmipxMacFltrTable=mcmipxMacFltrTable, nvmIpxSapFltrPort=nvmIpxSapFltrPort, nvmIpRipInFltrAddr=nvmIpRipInFltrAddr, nvmIpRipInFltrMask=nvmIpRipInFltrMask, nvmIpSysFltrAction=nvmIpSysFltrAction, nvmIpxRipFltrTable=nvmIpxRipFltrTable, nvmIpxRipFltrEntry=nvmIpxRipFltrEntry, nvmIpFwdPortOutFltrMask=nvmIpFwdPortOutFltrMask, mcmIpxNetFltrEntry=mcmIpxNetFltrEntry, nvmIpOspfOutFltrEntry=nvmIpOspfOutFltrEntry, nvmIpxRipFltrRowStatus=nvmIpxRipFltrRowStatus, nvmIpFwdPortInFltrAction=nvmIpFwdPortInFltrAction, mcmIpFwdPortOutFltrMask=mcmIpFwdPortOutFltrMask, nvmIpOspfOutFltrAddr=nvmIpOspfOutFltrAddr, mcmIpSysFltrProtId=mcmIpSysFltrProtId, nvmIpxNetFltrEntry=nvmIpxNetFltrEntry, mcmIpRipInFltrAction=mcmIpRipInFltrAction, mcmIpFwdPortInFltrPortNo=mcmIpFwdPortInFltrPortNo, mcmIpRipGwyFltrAction=mcmIpRipGwyFltrAction, mcmIpxSapFltrEntry=mcmIpxSapFltrEntry, mcmIpRipInFltrMask=mcmIpRipInFltrMask, mcmIpRipOutFltrMask=mcmIpRipOutFltrMask, nvmIpRipOutFltrAddr=nvmIpRipOutFltrAddr, mcmIpxRipFltrPort=mcmIpxRipFltrPort, mcmfilter=mcmfilter, mcmIpxNetFltrPort=mcmIpxNetFltrPort, nvmIpFwdPortOutFltrEntry=nvmIpFwdPortOutFltrEntry, nvmipxSysNetFilter=nvmipxSysNetFilter, nvmIpFwdPortInFltrEntry=nvmIpFwdPortInFltrEntry, nvmIpFwdPortOutFltrTable=nvmIpFwdPortOutFltrTable, nvmipxMacFltrId=nvmipxMacFltrId, mcmIpxRipFltrSysInstance=mcmIpxRipFltrSysInstance, mcmIpFwdPortOutFltrProtId=mcmIpFwdPortOutFltrProtId, nvmipxMacFltrDstMask=nvmipxMacFltrDstMask, mcmIpFwdPortInFltrSrcDst=mcmIpFwdPortInFltrSrcDst, nvmIpRipOutFltrMask=nvmIpRipOutFltrMask, mcmIpSysFltrTable=mcmIpSysFltrTable, nvmIpFwdPortOutFltrSrcDst=nvmIpFwdPortOutFltrSrcDst, mcmipxNetFltrNetNumber=mcmipxNetFltrNetNumber, mcmIpRipGwyFltrMask=mcmIpRipGwyFltrMask, nvmIpxRipFltrPort=nvmIpxRipFltrPort, nvmipxNetFltrStatus=nvmipxNetFltrStatus, nvmIpSysFltrPortId=nvmIpSysFltrPortId, nvmIpxSapFltrTable=nvmIpxSapFltrTable, mcmipxSysRipFilter=mcmipxSysRipFilter, nvmIpFwdPortInFltrAddr=nvmIpFwdPortInFltrAddr, mcmIpFwdPortOutFltrSrcDst=mcmIpFwdPortOutFltrSrcDst, nvmIpSysFltrEntry=nvmIpSysFltrEntry, mcmIpxRipFltrNetNumber=mcmIpxRipFltrNetNumber, nvmIpFwdPortInFltrTable=nvmIpFwdPortInFltrTable, nvmIpFwdPortOutFltrAction=nvmIpFwdPortOutFltrAction, nvmIpRipGwyFltrAction=nvmIpRipGwyFltrAction, mcmipxMacFltrEntry=mcmipxMacFltrEntry, mcmIpxNetFltrDir=mcmIpxNetFltrDir, nvmIpFwdPortInFltrMask=nvmIpFwdPortInFltrMask, mcmipxMacFltrId=mcmipxMacFltrId, mcmIpRipGwyFltrEntry=mcmIpRipGwyFltrEntry, nvmIpFwdPortOutFltrAddr=nvmIpFwdPortOutFltrAddr, mcmIpxNetFltrTable=mcmIpxNetFltrTable, nvmipxNetFltrNetMask=nvmipxNetFltrNetMask, nvmipxNetFltrEntry=nvmipxNetFltrEntry, mcmipxNetFltrPort=mcmipxNetFltrPort, mcmIpRipInFltrTable=mcmIpRipInFltrTable, nvmIpRipGwyFltrTable=nvmIpRipGwyFltrTable, mcmIpFwdPortInFltrAction=mcmIpFwdPortInFltrAction, nvmIpRipInFltrTable=nvmIpRipInFltrTable, nvmIpSysFltrSrcAddr=nvmIpSysFltrSrcAddr, mcmipxMacFltrSysInstance=mcmipxMacFltrSysInstance, mcmIpxNetFltrNetNumber=mcmIpxNetFltrNetNumber, mcmIpOspfOutFltrMask=mcmIpOspfOutFltrMask, mcmIpxSapFltrTable=mcmIpxSapFltrTable, mcmIpSysFltrPortId=mcmIpSysFltrPortId, mcmipxMacFltrPort=mcmipxMacFltrPort, nvmIpFwdPortOutFltrPortNo=nvmIpFwdPortOutFltrPortNo, nvmipxNetFltrPort=nvmipxNetFltrPort, mcmIpOspfOutFltrAction=mcmIpOspfOutFltrAction, nvmIpFwdPortOutFltrPortId=nvmIpFwdPortOutFltrPortId, mcmIpSysFltrDstMask=mcmIpSysFltrDstMask, nvmIpRipOutFltrTable=nvmIpRipOutFltrTable, mcmipxNetFltrTable=mcmipxNetFltrTable, nvmIpSysFltrDstAddr=nvmIpSysFltrDstAddr, nvmipxMacFltrSrcAddress=nvmipxMacFltrSrcAddress, nvmipxMacFltrDir=nvmipxMacFltrDir, nvmIpSysFltrSrcMask=nvmIpSysFltrSrcMask, nvmipxMacFltrTable=nvmipxMacFltrTable, mcmIpFwdPortOutFltrPortNo=mcmIpFwdPortOutFltrPortNo, nvmipxMacFltrSysInstance=nvmipxMacFltrSysInstance, nvmIpOspfOutFltrAction=nvmIpOspfOutFltrAction, mcmIpRipOutFltrAddr=mcmIpRipOutFltrAddr, nvmIpFwdPortOutFltrProtId=nvmIpFwdPortOutFltrProtId, mcmIpFwdPortInFltrEntry=mcmIpFwdPortInFltrEntry, nvmIpRipGwyFltrAddr=nvmIpRipGwyFltrAddr, nvmipxNetFltrSapMask=nvmipxNetFltrSapMask, nvmIpRipOutFltrAction=nvmIpRipOutFltrAction, mcmipxNetFltrSysInstance=mcmipxNetFltrSysInstance, mcmIpxSapFltrSapType=mcmIpxSapFltrSapType, mcmipxMacFltrStatus=mcmipxMacFltrStatus, mcmIpRipOutFltrAction=mcmIpRipOutFltrAction, mcmIpFwdPortOutFltrTable=mcmIpFwdPortOutFltrTable, mcmIpxSapFltrSysInstance=mcmIpxSapFltrSysInstance, nvmIpxSapFltrEntry=nvmIpxSapFltrEntry, mcmipxNetFltrSapType=mcmipxNetFltrSapType, nvmIpxSapFltrRowStatus=nvmIpxSapFltrRowStatus, mcmipxNetFltrStatus=mcmipxNetFltrStatus, mcmIpSysFltrEntry=mcmIpSysFltrEntry, mcmIpFwdPortInFltrAddr=mcmIpFwdPortInFltrAddr, mcmIpOspfOutFltrEntry=mcmIpOspfOutFltrEntry, mcmipxNetFltrNetMask=mcmipxNetFltrNetMask, nvmipxNetFltrDir=nvmipxNetFltrDir, mcmipxNetFltrEntry=mcmipxNetFltrEntry, nvmipxNetFltrSapType=nvmipxNetFltrSapType, nvmipxSysFilterGroup=nvmipxSysFilterGroup, mcmIpRipOutFltrTable=mcmIpRipOutFltrTable, nvmipxNetFltrTable=nvmipxNetFltrTable, nvmIpxSapFltrSapType=nvmIpxSapFltrSapType, nvmipxMacFltrStatus=nvmipxMacFltrStatus, NetNumber=NetNumber, mcmIpRipOutFltrEntry=mcmIpRipOutFltrEntry, mcmIpxSapFltrPort=mcmIpxSapFltrPort, nvmIpRipInFltrEntry=nvmIpRipInFltrEntry, mcmIpFwdPortOutFltrAddr=mcmIpFwdPortOutFltrAddr, nvmIpxRipFltrSysInstance=nvmIpxRipFltrSysInstance, nvmIpFwdPortInFltrPortNo=nvmIpFwdPortInFltrPortNo, nvmIpxSapFltrSysInstance=nvmIpxSapFltrSysInstance, nvmIpxNetFltrDir=nvmIpxNetFltrDir, mcmIpFwdPortOutFltrEntry=mcmIpFwdPortOutFltrEntry, mcmIpFwdPortOutFltrPortId=mcmIpFwdPortOutFltrPortId, nvmIpRipInFltrAction=nvmIpRipInFltrAction, mcmIpFwdPortOutFltrAction=mcmIpFwdPortOutFltrAction, mcmIpFwdPortInFltrProtId=mcmIpFwdPortInFltrProtId, nvmipxMacFltrPort=nvmipxMacFltrPort, mcmIpxRipFltrTable=mcmIpxRipFltrTable, mcmIpRipInFltrAddr=mcmIpRipInFltrAddr, mcmIpSysFltrAction=mcmIpSysFltrAction, nvmIpRipGwyFltrMask=nvmIpRipGwyFltrMask, mcmIpOspfOutFltrTable=mcmIpOspfOutFltrTable, nvmIpFwdPortInFltrSrcDst=nvmIpFwdPortInFltrSrcDst, mcmIpSysFltrSrcAddr=mcmIpSysFltrSrcAddr, nvmIpRipOutFltrEntry=nvmIpRipOutFltrEntry, nvmIpxNetFltrNetNumber=nvmIpxNetFltrNetNumber, nvmIpOspfOutFltrTable=nvmIpOspfOutFltrTable, nvmIpFwdPortInFltrProtId=nvmIpFwdPortInFltrProtId, nvmipxMacFltrEntry=nvmipxMacFltrEntry, mcmIpxNetFltrSysInstance=mcmIpxNetFltrSysInstance, mcmIpRipInFltrEntry=mcmIpRipInFltrEntry, nvmIpxNetFltrSysInstance=nvmIpxNetFltrSysInstance, mcmipxNetFltrId=mcmipxNetFltrId, mcmIpFwdPortInFltrPortId=mcmIpFwdPortInFltrPortId, nvmIpSysFltrTable=nvmIpSysFltrTable, nvmipxNetFltrNetNumber=nvmipxNetFltrNetNumber, nvmipxSysSapFilter=nvmipxSysSapFilter, mcmIpRipGwyFltrAddr=mcmIpRipGwyFltrAddr, nvmipxMacFltrDstAddress=nvmipxMacFltrDstAddress, nvmIpRipGwyFltrEntry=nvmIpRipGwyFltrEntry)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, value_range_constraint, single_value_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion') (micom_oscar,) = mibBuilder.importSymbols('MICOM-OSCAR-MIB', 'micom-oscar') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (counter64, ip_address, object_identity, notification_type, unsigned32, integer32, gauge32, module_identity, time_ticks, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, mib_identifier, bits, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'IpAddress', 'ObjectIdentity', 'NotificationType', 'Unsigned32', 'Integer32', 'Gauge32', 'ModuleIdentity', 'TimeTicks', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'MibIdentifier', 'Bits', 'Counter32') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') mcmfilter = mib_identifier((1, 3, 6, 1, 4, 1, 335, 1, 4, 12)) class Netnumber(OctetString): subtype_spec = OctetString.subtypeSpec + value_size_constraint(4, 4) fixed_length = 4 class Saptype(OctetString): subtype_spec = OctetString.subtypeSpec + value_size_constraint(2, 2) fixed_length = 2 mcmipx_mac_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1)) if mibBuilder.loadTexts: mcmipxMacFltrTable.setStatus('obsolete') mcmipx_mac_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmipxMacFltrSysInstance'), (0, 'MICOMFLTR', 'mcmipxMacFltrId')) if mibBuilder.loadTexts: mcmipxMacFltrEntry.setStatus('obsolete') mcmipx_mac_fltr_sys_instance = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxMacFltrSysInstance.setStatus('obsolete') mcmipx_mac_fltr_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxMacFltrId.setStatus('obsolete') mcmipx_mac_fltr_status = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('off', 1), ('on', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxMacFltrStatus.setStatus('obsolete') mcmipx_mac_fltr_src_address = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 4), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxMacFltrSrcAddress.setStatus('obsolete') mcmipx_mac_fltr_dst_address = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 5), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxMacFltrDstAddress.setStatus('obsolete') mcmipx_mac_fltr_src_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 6), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxMacFltrSrcMask.setStatus('obsolete') mcmipx_mac_fltr_dst_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 7), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxMacFltrDstMask.setStatus('obsolete') mcmipx_mac_fltr_port = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxMacFltrPort.setStatus('obsolete') mcmipx_mac_fltr_dir = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 1, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('incoming', 1), ('outgoing', 2), ('both', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxMacFltrDir.setStatus('obsolete') mcmipx_net_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2)) if mibBuilder.loadTexts: mcmipxNetFltrTable.setStatus('obsolete') mcmipx_net_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmipxNetFltrSysInstance'), (0, 'MICOMFLTR', 'mcmipxNetFltrId')) if mibBuilder.loadTexts: mcmipxNetFltrEntry.setStatus('obsolete') mcmipx_net_fltr_sys_instance = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxNetFltrSysInstance.setStatus('obsolete') mcmipx_net_fltr_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxNetFltrId.setStatus('obsolete') mcmipx_net_fltr_status = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('off', 1), ('on', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxNetFltrStatus.setStatus('obsolete') mcmipx_net_fltr_net_number = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 4), net_number()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxNetFltrNetNumber.setStatus('obsolete') mcmipx_net_fltr_sap_type = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 5), sap_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxNetFltrSapType.setStatus('obsolete') mcmipx_net_fltr_net_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 6), net_number()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxNetFltrNetMask.setStatus('obsolete') mcmipx_net_fltr_sap_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 7), sap_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxNetFltrSapMask.setStatus('obsolete') mcmipx_net_fltr_port = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxNetFltrPort.setStatus('obsolete') mcmipx_net_fltr_dir = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 2, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('incoming', 1), ('outgoing', 2), ('both', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxNetFltrDir.setStatus('obsolete') nvmipx_mac_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3)) if mibBuilder.loadTexts: nvmipxMacFltrTable.setStatus('obsolete') nvmipx_mac_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmipxMacFltrSysInstance'), (0, 'MICOMFLTR', 'nvmipxMacFltrId')) if mibBuilder.loadTexts: nvmipxMacFltrEntry.setStatus('obsolete') nvmipx_mac_fltr_sys_instance = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 1), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxMacFltrSysInstance.setStatus('obsolete') nvmipx_mac_fltr_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 2), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxMacFltrId.setStatus('obsolete') nvmipx_mac_fltr_status = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('off', 1), ('on', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxMacFltrStatus.setStatus('obsolete') nvmipx_mac_fltr_src_address = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 4), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxMacFltrSrcAddress.setStatus('obsolete') nvmipx_mac_fltr_dst_address = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 5), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxMacFltrDstAddress.setStatus('obsolete') nvmipx_mac_fltr_src_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 6), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxMacFltrSrcMask.setStatus('obsolete') nvmipx_mac_fltr_dst_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 7), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxMacFltrDstMask.setStatus('obsolete') nvmipx_mac_fltr_port = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 8), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxMacFltrPort.setStatus('obsolete') nvmipx_mac_fltr_dir = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 3, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('incoming', 1), ('outgoing', 2), ('both', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxMacFltrDir.setStatus('obsolete') nvmipx_net_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4)) if mibBuilder.loadTexts: nvmipxNetFltrTable.setStatus('obsolete') nvmipx_net_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmipxNetFltrSysInstance'), (0, 'MICOMFLTR', 'nvmipxNetFltrId')) if mibBuilder.loadTexts: nvmipxNetFltrEntry.setStatus('obsolete') nvmipx_net_fltr_sys_instance = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 1), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxNetFltrSysInstance.setStatus('obsolete') nvmipx_net_fltr_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 2), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxNetFltrId.setStatus('obsolete') nvmipx_net_fltr_status = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('off', 1), ('on', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxNetFltrStatus.setStatus('obsolete') nvmipx_net_fltr_net_number = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 4), net_number()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxNetFltrNetNumber.setStatus('obsolete') nvmipx_net_fltr_sap_type = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 5), sap_type()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxNetFltrSapType.setStatus('obsolete') nvmipx_net_fltr_net_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 6), net_number()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxNetFltrNetMask.setStatus('obsolete') nvmipx_net_fltr_sap_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 7), sap_type()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxNetFltrSapMask.setStatus('obsolete') nvmipx_net_fltr_port = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 8), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxNetFltrPort.setStatus('obsolete') nvmipx_net_fltr_dir = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 4, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('incoming', 1), ('outgoing', 2), ('both', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxNetFltrDir.setStatus('obsolete') mcmipx_sys_filter_group = mib_identifier((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 19)) mcmipx_sys_rip_filter = mib_scalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 19, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('inclusive', 1), ('exclusive', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxSysRipFilter.setStatus('mandatory') mcmipx_sys_sap_filter = mib_scalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 19, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('inclusive', 1), ('exclusive', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxSysSapFilter.setStatus('mandatory') mcmipx_sys_net_filter = mib_scalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 19, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('inclusive', 1), ('exclusive', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmipxSysNetFilter.setStatus('mandatory') nvmipx_sys_filter_group = mib_identifier((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 20)) nvmipx_sys_rip_filter = mib_scalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 20, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('inclusive', 1), ('exclusive', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxSysRipFilter.setStatus('mandatory') nvmipx_sys_sap_filter = mib_scalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 20, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('inclusive', 1), ('exclusive', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxSysSapFilter.setStatus('mandatory') nvmipx_sys_net_filter = mib_scalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 20, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('inclusive', 1), ('exclusive', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmipxSysNetFilter.setStatus('mandatory') mcm_ipx_rip_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 21)) if mibBuilder.loadTexts: mcmIpxRipFltrTable.setStatus('mandatory') mcm_ipx_rip_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 21, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmIpxRipFltrSysInstance'), (0, 'MICOMFLTR', 'mcmIpxRipFltrNetNumber')) if mibBuilder.loadTexts: mcmIpxRipFltrEntry.setStatus('mandatory') mcm_ipx_rip_fltr_sys_instance = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 21, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpxRipFltrSysInstance.setStatus('mandatory') mcm_ipx_rip_fltr_net_number = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 21, 1, 2), net_number()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpxRipFltrNetNumber.setStatus('mandatory') mcm_ipx_rip_fltr_port = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 21, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('wan', 1), ('ethernet', 2), ('both', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpxRipFltrPort.setStatus('mandatory') mcm_ipx_sap_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 22)) if mibBuilder.loadTexts: mcmIpxSapFltrTable.setStatus('mandatory') mcm_ipx_sap_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 22, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmIpxSapFltrSysInstance'), (0, 'MICOMFLTR', 'mcmIpxSapFltrSapType')) if mibBuilder.loadTexts: mcmIpxSapFltrEntry.setStatus('mandatory') mcm_ipx_sap_fltr_sys_instance = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 22, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpxSapFltrSysInstance.setStatus('mandatory') mcm_ipx_sap_fltr_sap_type = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 22, 1, 2), sap_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpxSapFltrSapType.setStatus('mandatory') mcm_ipx_sap_fltr_port = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 22, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('wan', 1), ('ethernet', 2), ('both', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpxSapFltrPort.setStatus('mandatory') mcm_ipx_net_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23)) if mibBuilder.loadTexts: mcmIpxNetFltrTable.setStatus('mandatory') mcm_ipx_net_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmIpxNetFltrSysInstance'), (0, 'MICOMFLTR', 'mcmIpxNetFltrNetNumber')) if mibBuilder.loadTexts: mcmIpxNetFltrEntry.setStatus('mandatory') mcm_ipx_net_fltr_sys_instance = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpxNetFltrSysInstance.setStatus('mandatory') mcm_ipx_net_fltr_net_number = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23, 1, 2), net_number()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpxNetFltrNetNumber.setStatus('mandatory') mcm_ipx_net_fltr_port = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('wan', 1), ('ethernet', 2), ('both', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpxNetFltrPort.setStatus('mandatory') mcm_ipx_net_fltr_dir = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 23, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('source', 1), ('destination', 2), ('both', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpxNetFltrDir.setStatus('mandatory') nvm_ipx_rip_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24)) if mibBuilder.loadTexts: nvmIpxRipFltrTable.setStatus('mandatory') nvm_ipx_rip_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmIpxRipFltrSysInstance'), (0, 'MICOMFLTR', 'nvmIpxRipFltrNetNumber')) if mibBuilder.loadTexts: nvmIpxRipFltrEntry.setStatus('mandatory') nvm_ipx_rip_fltr_sys_instance = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxRipFltrSysInstance.setStatus('mandatory') nvm_ipx_rip_fltr_net_number = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24, 1, 2), net_number()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxRipFltrNetNumber.setStatus('mandatory') nvm_ipx_rip_fltr_port = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('wan', 1), ('ethernet', 2), ('both', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxRipFltrPort.setStatus('mandatory') nvm_ipx_rip_fltr_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 24, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 4, 6))).clone(namedValues=named_values(('active', 1), ('createAndGo', 4), ('destroy', 6)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxRipFltrRowStatus.setStatus('mandatory') nvm_ipx_sap_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25)) if mibBuilder.loadTexts: nvmIpxSapFltrTable.setStatus('mandatory') nvm_ipx_sap_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmIpxSapFltrSysInstance'), (0, 'MICOMFLTR', 'nvmIpxSapFltrSapType')) if mibBuilder.loadTexts: nvmIpxSapFltrEntry.setStatus('mandatory') nvm_ipx_sap_fltr_sys_instance = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxSapFltrSysInstance.setStatus('mandatory') nvm_ipx_sap_fltr_sap_type = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25, 1, 2), sap_type()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxSapFltrSapType.setStatus('mandatory') nvm_ipx_sap_fltr_port = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('wan', 1), ('ethernet', 2), ('both', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxSapFltrPort.setStatus('mandatory') nvm_ipx_sap_fltr_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 25, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 4, 6))).clone(namedValues=named_values(('active', 1), ('createAndGo', 4), ('destroy', 6)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxSapFltrRowStatus.setStatus('mandatory') nvm_ipx_net_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26)) if mibBuilder.loadTexts: nvmIpxNetFltrTable.setStatus('mandatory') nvm_ipx_net_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmIpxNetFltrSysInstance'), (0, 'MICOMFLTR', 'nvmIpxNetFltrNetNumber')) if mibBuilder.loadTexts: nvmIpxNetFltrEntry.setStatus('mandatory') nvm_ipx_net_fltr_sys_instance = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxNetFltrSysInstance.setStatus('mandatory') nvm_ipx_net_fltr_net_number = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1, 2), net_number()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxNetFltrNetNumber.setStatus('mandatory') nvm_ipx_net_fltr_port = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('wan', 1), ('ethernet', 2), ('both', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxNetFltrPort.setStatus('mandatory') nvm_ipx_net_fltr_dir = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('source', 1), ('destination', 2), ('both', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxNetFltrDir.setStatus('mandatory') nvm_ipx_net_fltr_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 26, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 4, 6))).clone(namedValues=named_values(('active', 1), ('createAndGo', 4), ('destroy', 6)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpxNetFltrRowStatus.setStatus('mandatory') mcm_ip_rip_in_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 5)) if mibBuilder.loadTexts: mcmIpRipInFltrTable.setStatus('mandatory') mcm_ip_rip_in_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 5, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmIpRipInFltrMask'), (0, 'MICOMFLTR', 'mcmIpRipInFltrAddr')) if mibBuilder.loadTexts: mcmIpRipInFltrEntry.setStatus('mandatory') mcm_ip_rip_in_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 5, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpRipInFltrMask.setStatus('mandatory') mcm_ip_rip_in_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 5, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpRipInFltrAddr.setStatus('mandatory') mcm_ip_rip_in_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 5, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('forward', 1), ('discard', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpRipInFltrAction.setStatus('mandatory') mcm_ip_rip_out_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 6)) if mibBuilder.loadTexts: mcmIpRipOutFltrTable.setStatus('mandatory') mcm_ip_rip_out_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 6, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmIpRipOutFltrMask'), (0, 'MICOMFLTR', 'mcmIpRipOutFltrAddr')) if mibBuilder.loadTexts: mcmIpRipOutFltrEntry.setStatus('mandatory') mcm_ip_rip_out_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 6, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpRipOutFltrMask.setStatus('mandatory') mcm_ip_rip_out_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 6, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpRipOutFltrAddr.setStatus('mandatory') mcm_ip_rip_out_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 6, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('forward', 1), ('discard', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpRipOutFltrAction.setStatus('mandatory') mcm_ip_rip_gwy_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 7)) if mibBuilder.loadTexts: mcmIpRipGwyFltrTable.setStatus('mandatory') mcm_ip_rip_gwy_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 7, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmIpRipGwyFltrMask'), (0, 'MICOMFLTR', 'mcmIpRipGwyFltrAddr')) if mibBuilder.loadTexts: mcmIpRipGwyFltrEntry.setStatus('mandatory') mcm_ip_rip_gwy_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 7, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpRipGwyFltrMask.setStatus('mandatory') mcm_ip_rip_gwy_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 7, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpRipGwyFltrAddr.setStatus('mandatory') mcm_ip_rip_gwy_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 7, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('forward', 1), ('discard', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpRipGwyFltrAction.setStatus('mandatory') mcm_ip_ospf_out_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 8)) if mibBuilder.loadTexts: mcmIpOspfOutFltrTable.setStatus('mandatory') mcm_ip_ospf_out_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 8, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmIpOspfOutFltrMask'), (0, 'MICOMFLTR', 'mcmIpOspfOutFltrAddr')) if mibBuilder.loadTexts: mcmIpOspfOutFltrEntry.setStatus('mandatory') mcm_ip_ospf_out_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 8, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpOspfOutFltrMask.setStatus('mandatory') mcm_ip_ospf_out_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 8, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpOspfOutFltrAddr.setStatus('mandatory') mcm_ip_ospf_out_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 8, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('forward', 1), ('discard', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpOspfOutFltrAction.setStatus('mandatory') mcm_ip_fwd_port_in_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9)) if mibBuilder.loadTexts: mcmIpFwdPortInFltrTable.setStatus('mandatory') mcm_ip_fwd_port_in_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmIpFwdPortInFltrPortNo'), (0, 'MICOMFLTR', 'mcmIpFwdPortInFltrMask'), (0, 'MICOMFLTR', 'mcmIpFwdPortInFltrAddr'), (0, 'MICOMFLTR', 'mcmIpFwdPortInFltrProtId'), (0, 'MICOMFLTR', 'mcmIpFwdPortInFltrPortId')) if mibBuilder.loadTexts: mcmIpFwdPortInFltrEntry.setStatus('mandatory') mcm_ip_fwd_port_in_fltr_port_no = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortInFltrPortNo.setStatus('mandatory') mcm_ip_fwd_port_in_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortInFltrMask.setStatus('mandatory') mcm_ip_fwd_port_in_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 3), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortInFltrAddr.setStatus('mandatory') mcm_ip_fwd_port_in_fltr_prot_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortInFltrProtId.setStatus('mandatory') mcm_ip_fwd_port_in_fltr_port_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortInFltrPortId.setStatus('mandatory') mcm_ip_fwd_port_in_fltr_src_dst = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('source', 1), ('destination', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortInFltrSrcDst.setStatus('mandatory') mcm_ip_fwd_port_in_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 9, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('forward', 1), ('discard', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortInFltrAction.setStatus('mandatory') mcm_ip_fwd_port_out_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10)) if mibBuilder.loadTexts: mcmIpFwdPortOutFltrTable.setStatus('mandatory') mcm_ip_fwd_port_out_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmIpFwdPortOutFltrPortNo'), (0, 'MICOMFLTR', 'mcmIpFwdPortOutFltrMask'), (0, 'MICOMFLTR', 'mcmIpFwdPortOutFltrAddr'), (0, 'MICOMFLTR', 'mcmIpFwdPortOutFltrProtId'), (0, 'MICOMFLTR', 'mcmIpFwdPortOutFltrPortId')) if mibBuilder.loadTexts: mcmIpFwdPortOutFltrEntry.setStatus('mandatory') mcm_ip_fwd_port_out_fltr_port_no = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortOutFltrPortNo.setStatus('mandatory') mcm_ip_fwd_port_out_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortOutFltrMask.setStatus('mandatory') mcm_ip_fwd_port_out_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 3), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortOutFltrAddr.setStatus('mandatory') mcm_ip_fwd_port_out_fltr_prot_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortOutFltrProtId.setStatus('mandatory') mcm_ip_fwd_port_out_fltr_port_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortOutFltrPortId.setStatus('mandatory') mcm_ip_fwd_port_out_fltr_src_dst = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('source', 1), ('destination', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortOutFltrSrcDst.setStatus('mandatory') mcm_ip_fwd_port_out_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 10, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('forward', 1), ('discard', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpFwdPortOutFltrAction.setStatus('mandatory') mcm_ip_sys_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11)) if mibBuilder.loadTexts: mcmIpSysFltrTable.setStatus('mandatory') mcm_ip_sys_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1)).setIndexNames((0, 'MICOMFLTR', 'mcmIpSysFltrDstMask'), (0, 'MICOMFLTR', 'mcmIpSysFltrDstAddr'), (0, 'MICOMFLTR', 'mcmIpSysFltrSrcMask'), (0, 'MICOMFLTR', 'mcmIpSysFltrSrcAddr'), (0, 'MICOMFLTR', 'mcmIpSysFltrProtId'), (0, 'MICOMFLTR', 'mcmIpSysFltrPortId')) if mibBuilder.loadTexts: mcmIpSysFltrEntry.setStatus('mandatory') mcm_ip_sys_fltr_dst_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpSysFltrDstMask.setStatus('mandatory') mcm_ip_sys_fltr_dst_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpSysFltrDstAddr.setStatus('mandatory') mcm_ip_sys_fltr_src_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 3), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpSysFltrSrcMask.setStatus('mandatory') mcm_ip_sys_fltr_src_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 4), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpSysFltrSrcAddr.setStatus('mandatory') mcm_ip_sys_fltr_prot_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpSysFltrProtId.setStatus('mandatory') mcm_ip_sys_fltr_port_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpSysFltrPortId.setStatus('mandatory') mcm_ip_sys_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 11, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('forward', 1), ('discard', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mcmIpSysFltrAction.setStatus('mandatory') nvm_ip_rip_in_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 12)) if mibBuilder.loadTexts: nvmIpRipInFltrTable.setStatus('mandatory') nvm_ip_rip_in_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 12, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmIpRipInFltrMask'), (0, 'MICOMFLTR', 'nvmIpRipInFltrAddr')) if mibBuilder.loadTexts: nvmIpRipInFltrEntry.setStatus('mandatory') nvm_ip_rip_in_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 12, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpRipInFltrMask.setStatus('mandatory') nvm_ip_rip_in_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 12, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpRipInFltrAddr.setStatus('mandatory') nvm_ip_rip_in_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 12, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('forward', 1), ('discard', 2), ('invalid', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpRipInFltrAction.setStatus('mandatory') nvm_ip_rip_out_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 13)) if mibBuilder.loadTexts: nvmIpRipOutFltrTable.setStatus('mandatory') nvm_ip_rip_out_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 13, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmIpRipOutFltrMask'), (0, 'MICOMFLTR', 'nvmIpRipOutFltrAddr')) if mibBuilder.loadTexts: nvmIpRipOutFltrEntry.setStatus('mandatory') nvm_ip_rip_out_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 13, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpRipOutFltrMask.setStatus('mandatory') nvm_ip_rip_out_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 13, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpRipOutFltrAddr.setStatus('mandatory') nvm_ip_rip_out_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 13, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('forward', 1), ('discard', 2), ('invalid', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpRipOutFltrAction.setStatus('mandatory') nvm_ip_rip_gwy_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 14)) if mibBuilder.loadTexts: nvmIpRipGwyFltrTable.setStatus('mandatory') nvm_ip_rip_gwy_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 14, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmIpRipGwyFltrMask'), (0, 'MICOMFLTR', 'nvmIpRipGwyFltrAddr')) if mibBuilder.loadTexts: nvmIpRipGwyFltrEntry.setStatus('mandatory') nvm_ip_rip_gwy_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 14, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpRipGwyFltrMask.setStatus('mandatory') nvm_ip_rip_gwy_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 14, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpRipGwyFltrAddr.setStatus('mandatory') nvm_ip_rip_gwy_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 14, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('forward', 1), ('discard', 2), ('invalid', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpRipGwyFltrAction.setStatus('mandatory') nvm_ip_ospf_out_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 15)) if mibBuilder.loadTexts: nvmIpOspfOutFltrTable.setStatus('mandatory') nvm_ip_ospf_out_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 15, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmIpOspfOutFltrMask'), (0, 'MICOMFLTR', 'nvmIpOspfOutFltrAddr')) if mibBuilder.loadTexts: nvmIpOspfOutFltrEntry.setStatus('mandatory') nvm_ip_ospf_out_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 15, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpOspfOutFltrMask.setStatus('mandatory') nvm_ip_ospf_out_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 15, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpOspfOutFltrAddr.setStatus('mandatory') nvm_ip_ospf_out_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 15, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('forward', 1), ('discard', 2), ('invalid', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpOspfOutFltrAction.setStatus('mandatory') nvm_ip_fwd_port_in_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16)) if mibBuilder.loadTexts: nvmIpFwdPortInFltrTable.setStatus('mandatory') nvm_ip_fwd_port_in_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmIpFwdPortInFltrPortNo'), (0, 'MICOMFLTR', 'nvmIpFwdPortInFltrMask'), (0, 'MICOMFLTR', 'nvmIpFwdPortInFltrAddr'), (0, 'MICOMFLTR', 'nvmIpFwdPortInFltrProtId'), (0, 'MICOMFLTR', 'nvmIpFwdPortInFltrPortId')) if mibBuilder.loadTexts: nvmIpFwdPortInFltrEntry.setStatus('mandatory') nvm_ip_fwd_port_in_fltr_port_no = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortInFltrPortNo.setStatus('mandatory') nvm_ip_fwd_port_in_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortInFltrMask.setStatus('mandatory') nvm_ip_fwd_port_in_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortInFltrAddr.setStatus('mandatory') nvm_ip_fwd_port_in_fltr_prot_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortInFltrProtId.setStatus('mandatory') nvm_ip_fwd_port_in_fltr_port_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortInFltrPortId.setStatus('mandatory') nvm_ip_fwd_port_in_fltr_src_dst = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('source', 1), ('destination', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortInFltrSrcDst.setStatus('mandatory') nvm_ip_fwd_port_in_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 16, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('forward', 1), ('discard', 2), ('invalid', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortInFltrAction.setStatus('mandatory') nvm_ip_fwd_port_out_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17)) if mibBuilder.loadTexts: nvmIpFwdPortOutFltrTable.setStatus('mandatory') nvm_ip_fwd_port_out_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmIpFwdPortOutFltrPortNo'), (0, 'MICOMFLTR', 'nvmIpFwdPortOutFltrMask'), (0, 'MICOMFLTR', 'nvmIpFwdPortOutFltrAddr'), (0, 'MICOMFLTR', 'nvmIpFwdPortOutFltrProtId'), (0, 'MICOMFLTR', 'nvmIpFwdPortOutFltrPortId')) if mibBuilder.loadTexts: nvmIpFwdPortOutFltrEntry.setStatus('mandatory') nvm_ip_fwd_port_out_fltr_port_no = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortOutFltrPortNo.setStatus('mandatory') nvm_ip_fwd_port_out_fltr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortOutFltrMask.setStatus('mandatory') nvm_ip_fwd_port_out_fltr_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortOutFltrAddr.setStatus('mandatory') nvm_ip_fwd_port_out_fltr_prot_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortOutFltrProtId.setStatus('mandatory') nvm_ip_fwd_port_out_fltr_port_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortOutFltrPortId.setStatus('mandatory') nvm_ip_fwd_port_out_fltr_src_dst = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('source', 1), ('destination', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortOutFltrSrcDst.setStatus('mandatory') nvm_ip_fwd_port_out_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 17, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('forward', 1), ('discard', 2), ('invalid', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpFwdPortOutFltrAction.setStatus('mandatory') nvm_ip_sys_fltr_table = mib_table((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18)) if mibBuilder.loadTexts: nvmIpSysFltrTable.setStatus('mandatory') nvm_ip_sys_fltr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1)).setIndexNames((0, 'MICOMFLTR', 'nvmIpSysFltrDstMask'), (0, 'MICOMFLTR', 'nvmIpSysFltrDstAddr'), (0, 'MICOMFLTR', 'nvmIpSysFltrSrcMask'), (0, 'MICOMFLTR', 'nvmIpSysFltrSrcAddr'), (0, 'MICOMFLTR', 'nvmIpSysFltrProtId'), (0, 'MICOMFLTR', 'nvmIpSysFltrPortId')) if mibBuilder.loadTexts: nvmIpSysFltrEntry.setStatus('mandatory') nvm_ip_sys_fltr_dst_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpSysFltrDstMask.setStatus('mandatory') nvm_ip_sys_fltr_dst_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpSysFltrDstAddr.setStatus('mandatory') nvm_ip_sys_fltr_src_mask = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpSysFltrSrcMask.setStatus('mandatory') nvm_ip_sys_fltr_src_addr = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 4), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpSysFltrSrcAddr.setStatus('mandatory') nvm_ip_sys_fltr_prot_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpSysFltrProtId.setStatus('mandatory') nvm_ip_sys_fltr_port_id = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpSysFltrPortId.setStatus('mandatory') nvm_ip_sys_fltr_action = mib_table_column((1, 3, 6, 1, 4, 1, 335, 1, 4, 12, 18, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('forward', 1), ('discard', 2), ('invalid', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: nvmIpSysFltrAction.setStatus('mandatory') mibBuilder.exportSymbols('MICOMFLTR', mcmIpxRipFltrEntry=mcmIpxRipFltrEntry, mcmipxNetFltrSapMask=mcmipxNetFltrSapMask, nvmIpOspfOutFltrMask=nvmIpOspfOutFltrMask, nvmIpxNetFltrPort=nvmIpxNetFltrPort, nvmipxNetFltrId=nvmipxNetFltrId, nvmipxNetFltrSysInstance=nvmipxNetFltrSysInstance, nvmIpSysFltrProtId=nvmIpSysFltrProtId, SapType=SapType, mcmIpOspfOutFltrAddr=mcmIpOspfOutFltrAddr, mcmIpSysFltrSrcMask=mcmIpSysFltrSrcMask, mcmipxMacFltrSrcMask=mcmipxMacFltrSrcMask, mcmipxMacFltrDstAddress=mcmipxMacFltrDstAddress, nvmIpxRipFltrNetNumber=nvmIpxRipFltrNetNumber, mcmipxMacFltrSrcAddress=mcmipxMacFltrSrcAddress, mcmipxSysSapFilter=mcmipxSysSapFilter, nvmipxMacFltrSrcMask=nvmipxMacFltrSrcMask, mcmIpRipGwyFltrTable=mcmIpRipGwyFltrTable, mcmIpFwdPortInFltrTable=mcmIpFwdPortInFltrTable, mcmIpSysFltrDstAddr=mcmIpSysFltrDstAddr, mcmipxMacFltrDir=mcmipxMacFltrDir, mcmipxSysNetFilter=mcmipxSysNetFilter, nvmIpxNetFltrRowStatus=nvmIpxNetFltrRowStatus, mcmipxMacFltrDstMask=mcmipxMacFltrDstMask, nvmIpxNetFltrTable=nvmIpxNetFltrTable, mcmIpFwdPortInFltrMask=mcmIpFwdPortInFltrMask, nvmIpSysFltrDstMask=nvmIpSysFltrDstMask, mcmipxNetFltrDir=mcmipxNetFltrDir, nvmIpFwdPortInFltrPortId=nvmIpFwdPortInFltrPortId, nvmipxSysRipFilter=nvmipxSysRipFilter, mcmipxSysFilterGroup=mcmipxSysFilterGroup, mcmipxMacFltrTable=mcmipxMacFltrTable, nvmIpxSapFltrPort=nvmIpxSapFltrPort, nvmIpRipInFltrAddr=nvmIpRipInFltrAddr, nvmIpRipInFltrMask=nvmIpRipInFltrMask, nvmIpSysFltrAction=nvmIpSysFltrAction, nvmIpxRipFltrTable=nvmIpxRipFltrTable, nvmIpxRipFltrEntry=nvmIpxRipFltrEntry, nvmIpFwdPortOutFltrMask=nvmIpFwdPortOutFltrMask, mcmIpxNetFltrEntry=mcmIpxNetFltrEntry, nvmIpOspfOutFltrEntry=nvmIpOspfOutFltrEntry, nvmIpxRipFltrRowStatus=nvmIpxRipFltrRowStatus, nvmIpFwdPortInFltrAction=nvmIpFwdPortInFltrAction, mcmIpFwdPortOutFltrMask=mcmIpFwdPortOutFltrMask, nvmIpOspfOutFltrAddr=nvmIpOspfOutFltrAddr, mcmIpSysFltrProtId=mcmIpSysFltrProtId, nvmIpxNetFltrEntry=nvmIpxNetFltrEntry, mcmIpRipInFltrAction=mcmIpRipInFltrAction, mcmIpFwdPortInFltrPortNo=mcmIpFwdPortInFltrPortNo, mcmIpRipGwyFltrAction=mcmIpRipGwyFltrAction, mcmIpxSapFltrEntry=mcmIpxSapFltrEntry, mcmIpRipInFltrMask=mcmIpRipInFltrMask, mcmIpRipOutFltrMask=mcmIpRipOutFltrMask, nvmIpRipOutFltrAddr=nvmIpRipOutFltrAddr, mcmIpxRipFltrPort=mcmIpxRipFltrPort, mcmfilter=mcmfilter, mcmIpxNetFltrPort=mcmIpxNetFltrPort, nvmIpFwdPortOutFltrEntry=nvmIpFwdPortOutFltrEntry, nvmipxSysNetFilter=nvmipxSysNetFilter, nvmIpFwdPortInFltrEntry=nvmIpFwdPortInFltrEntry, nvmIpFwdPortOutFltrTable=nvmIpFwdPortOutFltrTable, nvmipxMacFltrId=nvmipxMacFltrId, mcmIpxRipFltrSysInstance=mcmIpxRipFltrSysInstance, mcmIpFwdPortOutFltrProtId=mcmIpFwdPortOutFltrProtId, nvmipxMacFltrDstMask=nvmipxMacFltrDstMask, mcmIpFwdPortInFltrSrcDst=mcmIpFwdPortInFltrSrcDst, nvmIpRipOutFltrMask=nvmIpRipOutFltrMask, mcmIpSysFltrTable=mcmIpSysFltrTable, nvmIpFwdPortOutFltrSrcDst=nvmIpFwdPortOutFltrSrcDst, mcmipxNetFltrNetNumber=mcmipxNetFltrNetNumber, mcmIpRipGwyFltrMask=mcmIpRipGwyFltrMask, nvmIpxRipFltrPort=nvmIpxRipFltrPort, nvmipxNetFltrStatus=nvmipxNetFltrStatus, nvmIpSysFltrPortId=nvmIpSysFltrPortId, nvmIpxSapFltrTable=nvmIpxSapFltrTable, mcmipxSysRipFilter=mcmipxSysRipFilter, nvmIpFwdPortInFltrAddr=nvmIpFwdPortInFltrAddr, mcmIpFwdPortOutFltrSrcDst=mcmIpFwdPortOutFltrSrcDst, nvmIpSysFltrEntry=nvmIpSysFltrEntry, mcmIpxRipFltrNetNumber=mcmIpxRipFltrNetNumber, nvmIpFwdPortInFltrTable=nvmIpFwdPortInFltrTable, nvmIpFwdPortOutFltrAction=nvmIpFwdPortOutFltrAction, nvmIpRipGwyFltrAction=nvmIpRipGwyFltrAction, mcmipxMacFltrEntry=mcmipxMacFltrEntry, mcmIpxNetFltrDir=mcmIpxNetFltrDir, nvmIpFwdPortInFltrMask=nvmIpFwdPortInFltrMask, mcmipxMacFltrId=mcmipxMacFltrId, mcmIpRipGwyFltrEntry=mcmIpRipGwyFltrEntry, nvmIpFwdPortOutFltrAddr=nvmIpFwdPortOutFltrAddr, mcmIpxNetFltrTable=mcmIpxNetFltrTable, nvmipxNetFltrNetMask=nvmipxNetFltrNetMask, nvmipxNetFltrEntry=nvmipxNetFltrEntry, mcmipxNetFltrPort=mcmipxNetFltrPort, mcmIpRipInFltrTable=mcmIpRipInFltrTable, nvmIpRipGwyFltrTable=nvmIpRipGwyFltrTable, mcmIpFwdPortInFltrAction=mcmIpFwdPortInFltrAction, nvmIpRipInFltrTable=nvmIpRipInFltrTable, nvmIpSysFltrSrcAddr=nvmIpSysFltrSrcAddr, mcmipxMacFltrSysInstance=mcmipxMacFltrSysInstance, mcmIpxNetFltrNetNumber=mcmIpxNetFltrNetNumber, mcmIpOspfOutFltrMask=mcmIpOspfOutFltrMask, mcmIpxSapFltrTable=mcmIpxSapFltrTable, mcmIpSysFltrPortId=mcmIpSysFltrPortId, mcmipxMacFltrPort=mcmipxMacFltrPort, nvmIpFwdPortOutFltrPortNo=nvmIpFwdPortOutFltrPortNo, nvmipxNetFltrPort=nvmipxNetFltrPort, mcmIpOspfOutFltrAction=mcmIpOspfOutFltrAction, nvmIpFwdPortOutFltrPortId=nvmIpFwdPortOutFltrPortId, mcmIpSysFltrDstMask=mcmIpSysFltrDstMask, nvmIpRipOutFltrTable=nvmIpRipOutFltrTable, mcmipxNetFltrTable=mcmipxNetFltrTable, nvmIpSysFltrDstAddr=nvmIpSysFltrDstAddr, nvmipxMacFltrSrcAddress=nvmipxMacFltrSrcAddress, nvmipxMacFltrDir=nvmipxMacFltrDir, nvmIpSysFltrSrcMask=nvmIpSysFltrSrcMask, nvmipxMacFltrTable=nvmipxMacFltrTable, mcmIpFwdPortOutFltrPortNo=mcmIpFwdPortOutFltrPortNo, nvmipxMacFltrSysInstance=nvmipxMacFltrSysInstance, nvmIpOspfOutFltrAction=nvmIpOspfOutFltrAction, mcmIpRipOutFltrAddr=mcmIpRipOutFltrAddr, nvmIpFwdPortOutFltrProtId=nvmIpFwdPortOutFltrProtId, mcmIpFwdPortInFltrEntry=mcmIpFwdPortInFltrEntry, nvmIpRipGwyFltrAddr=nvmIpRipGwyFltrAddr, nvmipxNetFltrSapMask=nvmipxNetFltrSapMask, nvmIpRipOutFltrAction=nvmIpRipOutFltrAction, mcmipxNetFltrSysInstance=mcmipxNetFltrSysInstance, mcmIpxSapFltrSapType=mcmIpxSapFltrSapType, mcmipxMacFltrStatus=mcmipxMacFltrStatus, mcmIpRipOutFltrAction=mcmIpRipOutFltrAction, mcmIpFwdPortOutFltrTable=mcmIpFwdPortOutFltrTable, mcmIpxSapFltrSysInstance=mcmIpxSapFltrSysInstance, nvmIpxSapFltrEntry=nvmIpxSapFltrEntry, mcmipxNetFltrSapType=mcmipxNetFltrSapType, nvmIpxSapFltrRowStatus=nvmIpxSapFltrRowStatus, mcmipxNetFltrStatus=mcmipxNetFltrStatus, mcmIpSysFltrEntry=mcmIpSysFltrEntry, mcmIpFwdPortInFltrAddr=mcmIpFwdPortInFltrAddr, mcmIpOspfOutFltrEntry=mcmIpOspfOutFltrEntry, mcmipxNetFltrNetMask=mcmipxNetFltrNetMask, nvmipxNetFltrDir=nvmipxNetFltrDir, mcmipxNetFltrEntry=mcmipxNetFltrEntry, nvmipxNetFltrSapType=nvmipxNetFltrSapType, nvmipxSysFilterGroup=nvmipxSysFilterGroup, mcmIpRipOutFltrTable=mcmIpRipOutFltrTable, nvmipxNetFltrTable=nvmipxNetFltrTable, nvmIpxSapFltrSapType=nvmIpxSapFltrSapType, nvmipxMacFltrStatus=nvmipxMacFltrStatus, NetNumber=NetNumber, mcmIpRipOutFltrEntry=mcmIpRipOutFltrEntry, mcmIpxSapFltrPort=mcmIpxSapFltrPort, nvmIpRipInFltrEntry=nvmIpRipInFltrEntry, mcmIpFwdPortOutFltrAddr=mcmIpFwdPortOutFltrAddr, nvmIpxRipFltrSysInstance=nvmIpxRipFltrSysInstance, nvmIpFwdPortInFltrPortNo=nvmIpFwdPortInFltrPortNo, nvmIpxSapFltrSysInstance=nvmIpxSapFltrSysInstance, nvmIpxNetFltrDir=nvmIpxNetFltrDir, mcmIpFwdPortOutFltrEntry=mcmIpFwdPortOutFltrEntry, mcmIpFwdPortOutFltrPortId=mcmIpFwdPortOutFltrPortId, nvmIpRipInFltrAction=nvmIpRipInFltrAction, mcmIpFwdPortOutFltrAction=mcmIpFwdPortOutFltrAction, mcmIpFwdPortInFltrProtId=mcmIpFwdPortInFltrProtId, nvmipxMacFltrPort=nvmipxMacFltrPort, mcmIpxRipFltrTable=mcmIpxRipFltrTable, mcmIpRipInFltrAddr=mcmIpRipInFltrAddr, mcmIpSysFltrAction=mcmIpSysFltrAction, nvmIpRipGwyFltrMask=nvmIpRipGwyFltrMask, mcmIpOspfOutFltrTable=mcmIpOspfOutFltrTable, nvmIpFwdPortInFltrSrcDst=nvmIpFwdPortInFltrSrcDst, mcmIpSysFltrSrcAddr=mcmIpSysFltrSrcAddr, nvmIpRipOutFltrEntry=nvmIpRipOutFltrEntry, nvmIpxNetFltrNetNumber=nvmIpxNetFltrNetNumber, nvmIpOspfOutFltrTable=nvmIpOspfOutFltrTable, nvmIpFwdPortInFltrProtId=nvmIpFwdPortInFltrProtId, nvmipxMacFltrEntry=nvmipxMacFltrEntry, mcmIpxNetFltrSysInstance=mcmIpxNetFltrSysInstance, mcmIpRipInFltrEntry=mcmIpRipInFltrEntry, nvmIpxNetFltrSysInstance=nvmIpxNetFltrSysInstance, mcmipxNetFltrId=mcmipxNetFltrId, mcmIpFwdPortInFltrPortId=mcmIpFwdPortInFltrPortId, nvmIpSysFltrTable=nvmIpSysFltrTable, nvmipxNetFltrNetNumber=nvmipxNetFltrNetNumber, nvmipxSysSapFilter=nvmipxSysSapFilter, mcmIpRipGwyFltrAddr=mcmIpRipGwyFltrAddr, nvmipxMacFltrDstAddress=nvmipxMacFltrDstAddress, nvmIpRipGwyFltrEntry=nvmIpRipGwyFltrEntry)
def delta(x): if x==0: y=1; else: y=0; return(y)
def delta(x): if x == 0: y = 1 else: y = 0 return y
a=97 b= 98 while(a>=97 and a <=1003): if(a%2==0): print("{:.0f}".format(c)) a= a+1 c= (a+b)*226.5
a = 97 b = 98 while a >= 97 and a <= 1003: if a % 2 == 0: print('{:.0f}'.format(c)) a = a + 1 c = (a + b) * 226.5
SOS_token = 0 EOS_token = 1 class Lang: def __init__(self, name): self.name = name self.word2index = {} self.word2count = {} self.index2word = {0: "SOS", 1: "EOS"} self.n_words = 2 # Count SOS and EOS def addSentence(self, sentence): for word in sentence.split(' '): self.addWord(word) def addWord(self, word): if word not in self.word2index: self.word2index[word] = self.n_words self.word2count[word] = 1 self.index2word[self.n_words] = word self.n_words += 1 else: self.word2count[word] += 1
sos_token = 0 eos_token = 1 class Lang: def __init__(self, name): self.name = name self.word2index = {} self.word2count = {} self.index2word = {0: 'SOS', 1: 'EOS'} self.n_words = 2 def add_sentence(self, sentence): for word in sentence.split(' '): self.addWord(word) def add_word(self, word): if word not in self.word2index: self.word2index[word] = self.n_words self.word2count[word] = 1 self.index2word[self.n_words] = word self.n_words += 1 else: self.word2count[word] += 1
# MYSQL_HOST = "jbw-1.cpmvfibm3vjp.ap-southeast-1.rds.amazonaws.com" MYSQL_HOST = "localhost" MYSQL_PORT = 3306 MYSQL_USER = "redatom" MYSQL_PWD = "redatom" MYSQL_DB = "redatom" Config = { "mysql": { "connection": 'mysql://%s:%s@%s:%s/%s?charset=utf8' % (MYSQL_USER, MYSQL_PWD, MYSQL_HOST, MYSQL_PORT, MYSQL_DB) } }
mysql_host = 'localhost' mysql_port = 3306 mysql_user = 'redatom' mysql_pwd = 'redatom' mysql_db = 'redatom' config = {'mysql': {'connection': 'mysql://%s:%s@%s:%s/%s?charset=utf8' % (MYSQL_USER, MYSQL_PWD, MYSQL_HOST, MYSQL_PORT, MYSQL_DB)}}
def gen_tumor_ic_file(file_dir, dp): # write to file inpf = open(file_dir + dp.tumor_ic_file, 'w') inpf.write("type, cx, cy, cz, tum_rx, tum_ry, tum_rz, hyp_rx, hyp_ry, hyp_rz\n") # type = 1 -- spherical tumor core # type = 2 -- elliptical tumor core (sharp) # type = 3 -- spherical tumor core and then spherical hypoxic core # type = 5 -- spherical tumor core (sharp) ic_type = dp.tumor_ic_type center = dp.tumor_ic_center r = dp.tumor_ic_radius for i in range(len(center)): inpf.write("{}, {}, {}, {}, {}, {}, {}, {}, {}, {}\n".format(ic_type[i], center[i][0], center[i][1], center[i][2], r[i][0], r[i][1], r[i][2], r[i][0], r[i][1], r[i][2])) inpf.close()
def gen_tumor_ic_file(file_dir, dp): inpf = open(file_dir + dp.tumor_ic_file, 'w') inpf.write('type, cx, cy, cz, tum_rx, tum_ry, tum_rz, hyp_rx, hyp_ry, hyp_rz\n') ic_type = dp.tumor_ic_type center = dp.tumor_ic_center r = dp.tumor_ic_radius for i in range(len(center)): inpf.write('{}, {}, {}, {}, {}, {}, {}, {}, {}, {}\n'.format(ic_type[i], center[i][0], center[i][1], center[i][2], r[i][0], r[i][1], r[i][2], r[i][0], r[i][1], r[i][2])) inpf.close()
'''traversetree module Module with functions to traverse our triangle. ''' __all__ = ['maximum_pathsum'] __author__ = 'Alexandre Pierre' def pairs(iterator): '''Given an iterator yields its elements in pairs in which the first element will assume values from first to second-last and the second element of the pair will range from second to last iterator elements.''' try: previous = next(iterator) except StopIteration: return for current in iterator: yield previous, current previous = current def maximum_pathsum(triangle): '''Given a triangle returns the maximum topdown path sum''' acc = (0 for _ in triangle[-1]) for triangle_row in triangle[:0:-1]: row = map(sum, zip(acc, triangle_row)) acc = map(max, pairs(row)) return triangle[0][0] + next(acc)
"""traversetree module Module with functions to traverse our triangle. """ __all__ = ['maximum_pathsum'] __author__ = 'Alexandre Pierre' def pairs(iterator): """Given an iterator yields its elements in pairs in which the first element will assume values from first to second-last and the second element of the pair will range from second to last iterator elements.""" try: previous = next(iterator) except StopIteration: return for current in iterator: yield (previous, current) previous = current def maximum_pathsum(triangle): """Given a triangle returns the maximum topdown path sum""" acc = (0 for _ in triangle[-1]) for triangle_row in triangle[:0:-1]: row = map(sum, zip(acc, triangle_row)) acc = map(max, pairs(row)) return triangle[0][0] + next(acc)
# -*- coding: UTF-8 -*- # [1,2,3] a = [1,2,3] print(a) # [1,2,3] b = a print(b) # True print(id(a) == id(b)) b[0] = 3 # [3,2,3] print(b) # [3,2,3] print(a) # True print(id(a) == id(b))
a = [1, 2, 3] print(a) b = a print(b) print(id(a) == id(b)) b[0] = 3 print(b) print(a) print(id(a) == id(b))
__author__ = 'makarenok' class Contact: def __init__(self, first_name, middle_name, last_name, nick, title, company, address, tel_home, email): self.first_name = first_name self.middle_name = middle_name self.last_name = last_name self.nick = nick self.title = title self.company = company self.address = address self.tel_home = tel_home self.email = email
__author__ = 'makarenok' class Contact: def __init__(self, first_name, middle_name, last_name, nick, title, company, address, tel_home, email): self.first_name = first_name self.middle_name = middle_name self.last_name = last_name self.nick = nick self.title = title self.company = company self.address = address self.tel_home = tel_home self.email = email
with open("input") as f: map = f.readlines() # want to make my life easier with bounds checking # so i'm going to pad the map for i in range(len(map)): map[i] = ' ' + map[i].strip('\n') + ' ' # add the extra row at the end map.append(' '*len(map[0])) row = 0 # find entry at the top for i in map[0]: if i != ' ': col = map[0].index(i) # our first direction will be down row_step = 1 col_step = 0 step_count = 0 path = '' while True: if map[row][col].isalpha(): # found a letter, add it in path += map[row][col] if map[row][col] == ' ': # no more path, the end break if map[row][col] == '+': # found a change of direction if row_step != 0: # if we were heading north/south, # find out if we are going east or west row_step = 0 if map[row][col-1] != ' ': col_step = -1 else: col_step = 1 else: # if we were heading east/west, # find out if we are going north or south col_step = 0 if map[row-1][col] != ' ': row_step = -1 else: row_step = 1 step_count += 1 # move to next pos row += row_step col += col_step print("part 1", path) print("part 2", step_count)
with open('input') as f: map = f.readlines() for i in range(len(map)): map[i] = ' ' + map[i].strip('\n') + ' ' map.append(' ' * len(map[0])) row = 0 for i in map[0]: if i != ' ': col = map[0].index(i) row_step = 1 col_step = 0 step_count = 0 path = '' while True: if map[row][col].isalpha(): path += map[row][col] if map[row][col] == ' ': break if map[row][col] == '+': if row_step != 0: row_step = 0 if map[row][col - 1] != ' ': col_step = -1 else: col_step = 1 else: col_step = 0 if map[row - 1][col] != ' ': row_step = -1 else: row_step = 1 step_count += 1 row += row_step col += col_step print('part 1', path) print('part 2', step_count)
class Solution: def minDominoRotations(self, tops: List[int], bottoms: List[int]) -> int: total = len(tops) top_fr, bot_fr, val_total = [0]*7, [0]*7, [total]*7 for top, bot in zip(tops, bottoms): if top == bot: val_total[top] -= 1 else: top_fr[top] += 1 bot_fr[bot] += 1 for val in range(1, 7): if (val_total[val] - top_fr[val]) == bot_fr[val]: return min(top_fr[val], bot_fr[val]) return -1
class Solution: def min_domino_rotations(self, tops: List[int], bottoms: List[int]) -> int: total = len(tops) (top_fr, bot_fr, val_total) = ([0] * 7, [0] * 7, [total] * 7) for (top, bot) in zip(tops, bottoms): if top == bot: val_total[top] -= 1 else: top_fr[top] += 1 bot_fr[bot] += 1 for val in range(1, 7): if val_total[val] - top_fr[val] == bot_fr[val]: return min(top_fr[val], bot_fr[val]) return -1
class A: def __contains__(self, e): return False a = A() print(0 in a)
class A: def __contains__(self, e): return False a = a() print(0 in a)
def long_text_to_list(): string = open('longtext.txt').read() return string.split() def word_frequency_dict(wordList): wordDict = {} for word in wordList: if word in wordDict: wordDict[word] = wordDict[word] + 1 else: wordDict[word] = 1 return wordDict def print_250_most_common_words(wordDict): sortedDict = sorted(wordDict.items(), key=lambda item: (item[1], item[0])) top250 = 0 print("250 most common words and number of occurrences:") while (top250 <= 250): print(sortedDict.pop()) top250 += 1 print_250_most_common_words(word_frequency_dict(long_text_to_list()))
def long_text_to_list(): string = open('longtext.txt').read() return string.split() def word_frequency_dict(wordList): word_dict = {} for word in wordList: if word in wordDict: wordDict[word] = wordDict[word] + 1 else: wordDict[word] = 1 return wordDict def print_250_most_common_words(wordDict): sorted_dict = sorted(wordDict.items(), key=lambda item: (item[1], item[0])) top250 = 0 print('250 most common words and number of occurrences:') while top250 <= 250: print(sortedDict.pop()) top250 += 1 print_250_most_common_words(word_frequency_dict(long_text_to_list()))
# -*- coding: utf-8 -*- class Registry(object): __registry = {} def add(self, command): self.__registry.update({ command.name: command }) def get_all(self): return self.__registry.copy() def get_command(self, name, default=None): return self.__registry.get(name, default) registry = Registry()
class Registry(object): __registry = {} def add(self, command): self.__registry.update({command.name: command}) def get_all(self): return self.__registry.copy() def get_command(self, name, default=None): return self.__registry.get(name, default) registry = registry()
def map(soup, payload, mappings, tag_prop): for source_key, payload_key in mappings.items(): tag = soup.find('meta', attrs={tag_prop:source_key}) if tag: payload[payload_key] = tag.get('content')
def map(soup, payload, mappings, tag_prop): for (source_key, payload_key) in mappings.items(): tag = soup.find('meta', attrs={tag_prop: source_key}) if tag: payload[payload_key] = tag.get('content')
serv_ver_info = "Connected to MySQL Server version" conn_success_info = "You're connected to database" conn_error_info = "Error while connecting to MySQL" conn_close_info = "MySQL connection is closed" error_insert_info = "Failed to insert data to table in MySQL" error_create_info = "Failed to create table in MySQL" error_drop_info = "Failed to remove tables in MySQL"
serv_ver_info = 'Connected to MySQL Server version' conn_success_info = "You're connected to database" conn_error_info = 'Error while connecting to MySQL' conn_close_info = 'MySQL connection is closed' error_insert_info = 'Failed to insert data to table in MySQL' error_create_info = 'Failed to create table in MySQL' error_drop_info = 'Failed to remove tables in MySQL'
def writer(mat_export): canvas = open("dipinto_magnified.ppm","w") canvas.write(lines[0] + "\n") canvas.write(str(width) +" "+ str(height) + "\n") canvas.write(lines[2] + "\n") for a in range (0,height): for b in range (0,width): for c in range (0,3): canvas.write(mat_export[a][b][c] + "\n") def stroke(matrix,radius,coord_x,coord_y,red,green,blue): matrix_c =[[[]for g in range(0,len(matrix[0]))] for i in range(0,len(matrix))] for a in range(0,len(matrix)): for b in range(0,len(matrix[a])): matrix_c[a][b] = matrix[a][b][0:len(matrix[a][b])] for c in range(0,height): for b in range (0,width): if ((coord_x-b)**2+(coord_y-c)**2)**0.5 < radius: #if (c**2+b**2)**0.5 < radius: matrix_c[c][b][0]=(str(red)) matrix_c[c][b][1]=(str(green)) matrix_c[c][b][2]=(str(blue)) return matrix_c raw = open("dipinto.ppm","r") raw2 = raw.read() lines = raw2.split("\n") width = int(lines[1].split(" ")[0]) height = int(lines[1].split(" ")[1]) raw_instructions = open("strokesjournal.dat","r") raw_inst2 = raw_instructions.read() lines_inst = raw_inst2.split("\n") del lines_inst[-1] strokelist = []#[] for i in range(0,len(lines_inst))] for a in lines_inst: strokelist.append(lines_inst[lines_inst.index(a)].split(",")[:-1]) magnification = 10 height = height * magnification width = width * magnification matrix_mag = [[[]for m in range (0,width)]for n in range(0,height)] for c in range(0,height): for b in range (0,width): greyscale = str(int(c*b/(height*width)*255)) matrix_mag[c][b] = ["0","0","0"] for i in strokelist: print(i) for g in range(0,len(i)-3): i[g] = float(float(i[g]) * magnification) matrix_mag = stroke(matrix_mag, i[0], i[1], i[2], i[3], i[4], i[5]) writer(matrix_mag)
def writer(mat_export): canvas = open('dipinto_magnified.ppm', 'w') canvas.write(lines[0] + '\n') canvas.write(str(width) + ' ' + str(height) + '\n') canvas.write(lines[2] + '\n') for a in range(0, height): for b in range(0, width): for c in range(0, 3): canvas.write(mat_export[a][b][c] + '\n') def stroke(matrix, radius, coord_x, coord_y, red, green, blue): matrix_c = [[[] for g in range(0, len(matrix[0]))] for i in range(0, len(matrix))] for a in range(0, len(matrix)): for b in range(0, len(matrix[a])): matrix_c[a][b] = matrix[a][b][0:len(matrix[a][b])] for c in range(0, height): for b in range(0, width): if ((coord_x - b) ** 2 + (coord_y - c) ** 2) ** 0.5 < radius: matrix_c[c][b][0] = str(red) matrix_c[c][b][1] = str(green) matrix_c[c][b][2] = str(blue) return matrix_c raw = open('dipinto.ppm', 'r') raw2 = raw.read() lines = raw2.split('\n') width = int(lines[1].split(' ')[0]) height = int(lines[1].split(' ')[1]) raw_instructions = open('strokesjournal.dat', 'r') raw_inst2 = raw_instructions.read() lines_inst = raw_inst2.split('\n') del lines_inst[-1] strokelist = [] for a in lines_inst: strokelist.append(lines_inst[lines_inst.index(a)].split(',')[:-1]) magnification = 10 height = height * magnification width = width * magnification matrix_mag = [[[] for m in range(0, width)] for n in range(0, height)] for c in range(0, height): for b in range(0, width): greyscale = str(int(c * b / (height * width) * 255)) matrix_mag[c][b] = ['0', '0', '0'] for i in strokelist: print(i) for g in range(0, len(i) - 3): i[g] = float(float(i[g]) * magnification) matrix_mag = stroke(matrix_mag, i[0], i[1], i[2], i[3], i[4], i[5]) writer(matrix_mag)
{ 'targets': [ {'target_name': 'libspedye', 'type': 'static_library', 'dependencies': [ 'deps/http-parser/http_parser.gyp:http_parser', 'deps/uv/uv.gyp:uv', 'deps/openssl/openssl.gyp:openssl', 'deps/spdylay.gyp:spdylay', ], 'export_dependent_settings': [ 'deps/http-parser/http_parser.gyp:http_parser', 'deps/uv/uv.gyp:uv', 'deps/openssl/openssl.gyp:openssl', 'deps/spdylay.gyp:spdylay', ], 'conditions': [ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { 'cflags': [ '--std=c89' ], 'defines': [ '_GNU_SOURCE' ] }], ], 'sources': [ 'src/spedye.h', 'src/spedye_error.h', 'src/spedye_init.c', 'src/spedye_master.c', 'src/spedye_worker.c', 'src/spedye_conf.c', 'src/spedye_error.c', ], 'include_dirs': [ 'src', 'deps/uv/src/ares' ], 'direct_dependent_settings': { 'include_dirs': [ 'src', 'deps/uv/src/ares' ] }, }, { 'target_name': 'spedye', 'type': 'executable', 'dependencies': [ 'libspedye', ], 'sources': [ 'src/spedye_main.c', ], 'msvs-settings': { 'VCLinkerTool': { 'SubSystem': 1, # /subsystem:console }, }, 'conditions': [ ['OS == "linux"', { 'libraries': ['-ldl'], }], ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { 'cflags': [ '--std=c89' ], 'defines': [ '_GNU_SOURCE' ] }] ], }, ], }
{'targets': [{'target_name': 'libspedye', 'type': 'static_library', 'dependencies': ['deps/http-parser/http_parser.gyp:http_parser', 'deps/uv/uv.gyp:uv', 'deps/openssl/openssl.gyp:openssl', 'deps/spdylay.gyp:spdylay'], 'export_dependent_settings': ['deps/http-parser/http_parser.gyp:http_parser', 'deps/uv/uv.gyp:uv', 'deps/openssl/openssl.gyp:openssl', 'deps/spdylay.gyp:spdylay'], 'conditions': [['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {'cflags': ['--std=c89'], 'defines': ['_GNU_SOURCE']}]], 'sources': ['src/spedye.h', 'src/spedye_error.h', 'src/spedye_init.c', 'src/spedye_master.c', 'src/spedye_worker.c', 'src/spedye_conf.c', 'src/spedye_error.c'], 'include_dirs': ['src', 'deps/uv/src/ares'], 'direct_dependent_settings': {'include_dirs': ['src', 'deps/uv/src/ares']}}, {'target_name': 'spedye', 'type': 'executable', 'dependencies': ['libspedye'], 'sources': ['src/spedye_main.c'], 'msvs-settings': {'VCLinkerTool': {'SubSystem': 1}}, 'conditions': [['OS == "linux"', {'libraries': ['-ldl']}], ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {'cflags': ['--std=c89'], 'defines': ['_GNU_SOURCE']}]]}]}
ninjas = { "Kakashi": "Jonin", "Shikamaru": "Chunin", "Naruto": "Genin" } print(ninjas) ninjas.update({"Kakashi": "Hokage", "Shikamaru": "Jonin"}) print(ninjas)
ninjas = {'Kakashi': 'Jonin', 'Shikamaru': 'Chunin', 'Naruto': 'Genin'} print(ninjas) ninjas.update({'Kakashi': 'Hokage', 'Shikamaru': 'Jonin'}) print(ninjas)
class Solution: def numberToWords(self, num: int) -> str: below_100 = ['Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety'] below_20 = ['One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen'] result = [] def numberToString(num): if num >= 10 ** 9: numberToString(num // (10**9)) result.append('Billion') numberToString(num % (10 ** 9)) elif num >= 10 ** 6: numberToString(num // (10**6)) result.append('Million') numberToString(num % (10 ** 6)) elif num >= 1000: numberToString(num // 1000) result.append('Thousand') numberToString(num % 1000) elif num >= 100: numberToString(num // 100) result.append('Hundred') numberToString(num % 100) elif num >= 20: result.append(below_100[num // 10 - 2]) numberToString(num % 10) elif num >= 1: result.append(below_20[num - 1]) if num == 0: return 'Zero' else: numberToString(num) return ' '.join(result)
class Solution: def number_to_words(self, num: int) -> str: below_100 = ['Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety'] below_20 = ['One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen'] result = [] def number_to_string(num): if num >= 10 ** 9: number_to_string(num // 10 ** 9) result.append('Billion') number_to_string(num % 10 ** 9) elif num >= 10 ** 6: number_to_string(num // 10 ** 6) result.append('Million') number_to_string(num % 10 ** 6) elif num >= 1000: number_to_string(num // 1000) result.append('Thousand') number_to_string(num % 1000) elif num >= 100: number_to_string(num // 100) result.append('Hundred') number_to_string(num % 100) elif num >= 20: result.append(below_100[num // 10 - 2]) number_to_string(num % 10) elif num >= 1: result.append(below_20[num - 1]) if num == 0: return 'Zero' else: number_to_string(num) return ' '.join(result)