content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
#!/usr/bin/python2.4 # # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """AppEngine Datastore/GQL related Utilities module. This common util provides helper functionality to extend/support various GQL related queries. """ def FetchEntities(query_obj, limit): """Fetches number of Entities up to limit using query object. Args: query_obj: AppEngine Datastore Query Object. limit: Fetch limit on number of records you want to fetch. Returns: Fetched Entities. """ entities = [] # If Limit is more than 1000 than let's fetch more records using cursor. if limit > 1000: results = query_obj.fetch(1000) entities.extend(results) cursor = query_obj.cursor() while results and limit > len(entities): query_obj.with_cursor(cursor) results = query_obj.fetch(1000) entities.extend(results) cursor = query_obj.cursor() else: entities = query_obj.fetch(limit) return entities
"""AppEngine Datastore/GQL related Utilities module. This common util provides helper functionality to extend/support various GQL related queries. """ def fetch_entities(query_obj, limit): """Fetches number of Entities up to limit using query object. Args: query_obj: AppEngine Datastore Query Object. limit: Fetch limit on number of records you want to fetch. Returns: Fetched Entities. """ entities = [] if limit > 1000: results = query_obj.fetch(1000) entities.extend(results) cursor = query_obj.cursor() while results and limit > len(entities): query_obj.with_cursor(cursor) results = query_obj.fetch(1000) entities.extend(results) cursor = query_obj.cursor() else: entities = query_obj.fetch(limit) return entities
''' QUESTION: 344. Reverse String Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. You may assume all the characters consist of printable ascii characters. Example 1: Input: ["h","e","l","l","o"] Output: ["o","l","l","e","h"] Example 2: Input: ["H","a","n","n","a","h"] Output: ["h","a","n","n","a","H"] ''' class Solution(object): def reverseString(self, s): leftindex = 0 rightindex = len(s) - 1 while (leftindex < rightindex): s[leftindex], s[rightindex] = s[rightindex], s[leftindex] leftindex += 1 rightindex -= 1 ''' Ideas/thoughts: As need to modify in place, without creating new array. As python can do pair value assign, assign left to right, right value to left until leftindex is less than right. No need to return anything '''
""" QUESTION: 344. Reverse String Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. You may assume all the characters consist of printable ascii characters. Example 1: Input: ["h","e","l","l","o"] Output: ["o","l","l","e","h"] Example 2: Input: ["H","a","n","n","a","h"] Output: ["h","a","n","n","a","H"] """ class Solution(object): def reverse_string(self, s): leftindex = 0 rightindex = len(s) - 1 while leftindex < rightindex: (s[leftindex], s[rightindex]) = (s[rightindex], s[leftindex]) leftindex += 1 rightindex -= 1 '\nIdeas/thoughts:\nAs need to modify in place, without creating new array.\nAs python can do pair value assign,\nassign left to right, right value to left until leftindex is less than right.\n\nNo need to return anything\n\n'
{ "targets":[ { "target_name":"stp", "sources":["calc_grid.cc"] } ] }
{'targets': [{'target_name': 'stp', 'sources': ['calc_grid.cc']}]}
s = input() hachi = set() if len(s) < 3: if int(s) % 8 == 0 or int(s[::-1]) % 8 == 0: print("Yes") else: print("No") exit() t = 104 while t < 1000: hachi.add(str(t)) t += 8 counter = [0 for _ in range(10)] for i in s: counter[int(i)] += 1 for h in hachi: count = [0 for _ in range(10)] for i in str(h): count[int(i)] += 1 for i in range(10): if counter[i] < count[i]: break else: print("Yes") exit() print("No")
s = input() hachi = set() if len(s) < 3: if int(s) % 8 == 0 or int(s[::-1]) % 8 == 0: print('Yes') else: print('No') exit() t = 104 while t < 1000: hachi.add(str(t)) t += 8 counter = [0 for _ in range(10)] for i in s: counter[int(i)] += 1 for h in hachi: count = [0 for _ in range(10)] for i in str(h): count[int(i)] += 1 for i in range(10): if counter[i] < count[i]: break else: print('Yes') exit() print('No')
# # PySNMP MIB module DLINK-3100-BRIDGEMIBOBJECTS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DLINK-3100-BRIDGEMIBOBJECTS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:33:05 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion") Timeout, BridgeId, dot1dBasePort = mibBuilder.importSymbols("BRIDGE-MIB", "Timeout", "BridgeId", "dot1dBasePort") rnd, = mibBuilder.importSymbols("DLINK-3100-MIB", "rnd") InterfaceIndex, ifIndex = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex", "ifIndex") PortList, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "PortList") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") iso, Counter64, TimeTicks, ModuleIdentity, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, ObjectIdentity, NotificationType, MibIdentifier, Integer32, Gauge32, Unsigned32, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "Counter64", "TimeTicks", "ModuleIdentity", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "ObjectIdentity", "NotificationType", "MibIdentifier", "Integer32", "Gauge32", "Unsigned32", "Counter32") RowStatus, TruthValue, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "TruthValue", "TextualConvention", "DisplayString") rlpBridgeMIBObjects = ModuleIdentity((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57)) rlpBridgeMIBObjects.setRevisions(('2007-01-02 00:00',)) if mibBuilder.loadTexts: rlpBridgeMIBObjects.setLastUpdated('200701020000Z') if mibBuilder.loadTexts: rlpBridgeMIBObjects.setOrganization('Dlink, Inc. Dlink Semiconductor, Inc.') rldot1dPriority = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 1)) rldot1dPriorityMibVersion = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dPriorityMibVersion.setStatus('current') rldot1dPriorityPortGroupTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 1, 2), ) if mibBuilder.loadTexts: rldot1dPriorityPortGroupTable.setStatus('current') rldot1dPriorityPortGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 1, 2, 1), ).setIndexNames((0, "BRIDGE-MIB", "dot1dBasePort")) if mibBuilder.loadTexts: rldot1dPriorityPortGroupEntry.setStatus('current') rldot1dPriorityPortGroupNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 1, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dPriorityPortGroupNumber.setStatus('current') rldot1dStp = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2)) rldot1dStpMibVersion = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpMibVersion.setStatus('current') rldot1dStpType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 4))).clone(namedValues=NamedValues(("perDevice", 1), ("mstp", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpType.setStatus('current') rldot1dStpEnable = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 3), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpEnable.setStatus('current') rldot1dStpPortMustBelongToVlan = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 4), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpPortMustBelongToVlan.setStatus('current') rldot1dStpExtendedPortNumberFormat = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 5), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpExtendedPortNumberFormat.setStatus('current') rldot1dStpVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6), ) if mibBuilder.loadTexts: rldot1dStpVlanTable.setStatus('current') rldot1dStpVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1), ).setIndexNames((0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1dStpVlan")) if mibBuilder.loadTexts: rldot1dStpVlanEntry.setStatus('current') rldot1dStpVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpVlan.setStatus('current') rldot1dStpVlanEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 2), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpVlanEnable.setStatus('current') rldot1dStpTimeSinceTopologyChange = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 3), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpTimeSinceTopologyChange.setStatus('current') rldot1dStpTopChanges = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpTopChanges.setStatus('current') rldot1dStpDesignatedRoot = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 5), BridgeId()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpDesignatedRoot.setStatus('current') rldot1dStpRootCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpRootCost.setStatus('current') rldot1dStpRootPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpRootPort.setStatus('current') rldot1dStpMaxAge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 8), Timeout()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpMaxAge.setStatus('current') rldot1dStpHelloTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 9), Timeout()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpHelloTime.setStatus('current') rldot1dStpHoldTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpHoldTime.setStatus('current') rldot1dStpForwardDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 11), Timeout()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpForwardDelay.setStatus('current') rldot1dStpVlanPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7), ) if mibBuilder.loadTexts: rldot1dStpVlanPortTable.setStatus('current') rldot1dStpVlanPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1), ).setIndexNames((0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1dStpVlanPortVlan"), (0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1dStpVlanPortPort")) if mibBuilder.loadTexts: rldot1dStpVlanPortEntry.setStatus('current') rldot1dStpVlanPortVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4095))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpVlanPortVlan.setStatus('current') rldot1dStpVlanPortPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4096))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpVlanPortPort.setStatus('current') rldot1dStpVlanPortPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpVlanPortPriority.setStatus('current') rldot1dStpVlanPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("disabled", 1), ("blocking", 2), ("listening", 3), ("learning", 4), ("forwarding", 5), ("broken", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpVlanPortState.setStatus('current') rldot1dStpVlanPortEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpVlanPortEnable.setStatus('current') rldot1dStpVlanPortPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpVlanPortPathCost.setStatus('current') rldot1dStpVlanPortDesignatedRoot = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 7), BridgeId()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpVlanPortDesignatedRoot.setStatus('current') rldot1dStpVlanPortDesignatedCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpVlanPortDesignatedCost.setStatus('current') rldot1dStpVlanPortDesignatedBridge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 9), BridgeId()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpVlanPortDesignatedBridge.setStatus('current') rldot1dStpVlanPortDesignatedPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpVlanPortDesignatedPort.setStatus('current') rldot1dStpVlanPortForwardTransitions = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpVlanPortForwardTransitions.setStatus('current') rldot1dStpTrapVariable = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 8)) rldot1dStpTrapVrblifIndex = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 8, 1), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpTrapVrblifIndex.setStatus('current') rldot1dStpTrapVrblVID = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 8, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpTrapVrblVID.setStatus('current') rldot1dStpTypeAfterReset = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 4))).clone(namedValues=NamedValues(("perDevice", 1), ("mstp", 4))).clone('perDevice')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpTypeAfterReset.setStatus('current') rldot1dStpMonitorTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 20)).clone(10)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpMonitorTime.setStatus('current') rldot1dStpBpduCount = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 60)).clone(10)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpBpduCount.setStatus('current') rldot1dStpLastChanged = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 12), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpLastChanged.setStatus('current') rldot1dStpPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13), ) if mibBuilder.loadTexts: rldot1dStpPortTable.setStatus('current') rldot1dStpPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1), ).setIndexNames((0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1dStpPortPort")) if mibBuilder.loadTexts: rldot1dStpPortEntry.setStatus('current') rldot1dStpPortPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4096))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpPortPort.setStatus('current') rldot1dStpPortDampEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 2), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpPortDampEnable.setStatus('current') rldot1dStpPortDampStable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 3), TruthValue().clone('true')).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpPortDampStable.setStatus('current') rldot1dStpPortFilterBpdu = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("false", 0), ("true", 1), ("none", 2))).clone('none')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpPortFilterBpdu.setStatus('current') rldot1dStpPortBpduSent = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpPortBpduSent.setStatus('current') rldot1dStpPortBpduReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpPortBpduReceived.setStatus('current') rldot1dStpPortRole = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unknown", 0), ("disabled", 1), ("alternate", 2), ("backup", 3), ("root", 4), ("designated", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpPortRole.setStatus('current') rldot1dStpBpduType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("stp", 0), ("rstp", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpBpduType.setStatus('current') rldot1dStpPortRestrictedRole = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 9), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpPortRestrictedRole.setStatus('current') rldot1dStpPortAutoEdgePort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 10), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpPortAutoEdgePort.setStatus('current') rldot1dStpPortLoopback = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 11), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpPortLoopback.setStatus('current') rldot1dStpPortBpduOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("filter", 0), ("flood", 1), ("bridge", 2), ("stp", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpPortBpduOperStatus.setStatus('current') rldot1dStpPortsEnable = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 14), TruthValue().clone('true')).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpPortsEnable.setStatus('current') rldot1dStpTaggedFlooding = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 15), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpTaggedFlooding.setStatus('current') rldot1dStpPortBelongToVlanDefault = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 16), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpPortBelongToVlanDefault.setStatus('current') rldot1dStpEnableByDefault = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 17), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpEnableByDefault.setStatus('current') rldot1dStpPortToDefault = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 18), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpPortToDefault.setStatus('current') rldot1dStpSupportedType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("perDevice", 1), ("perVlan", 2), ("mstp", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpSupportedType.setStatus('current') rldot1dStpEdgeportSupportInStp = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 20), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dStpEdgeportSupportInStp.setStatus('current') rldot1dStpFilterBpdu = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 21), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpFilterBpdu.setStatus('current') rldot1dStpFloodBpduMethod = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("classic", 0), ("bridging", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpFloodBpduMethod.setStatus('current') rldot1dStpSeparatedBridges = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23)) rldot1dStpPortBpduGuardTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 24), ) if mibBuilder.loadTexts: rldot1dStpPortBpduGuardTable.setStatus('current') rldot1dStpPortBpduGuardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 24, 1), ).setIndexNames((0, "BRIDGE-MIB", "dot1dBasePort")) if mibBuilder.loadTexts: rldot1dStpPortBpduGuardEntry.setStatus('current') rldot1dStpPortBpduGuardEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 24, 1, 1), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpPortBpduGuardEnable.setStatus('current') rldot1dStpLoopbackGuardEnable = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 25), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpLoopbackGuardEnable.setStatus('current') rldot1dStpSeparatedBridgesTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23, 1), ) if mibBuilder.loadTexts: rldot1dStpSeparatedBridgesTable.setStatus('current') rldot1dStpSeparatedBridgesEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: rldot1dStpSeparatedBridgesEntry.setStatus('current') rldot1dStpSeparatedBridgesPortEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23, 1, 1, 1), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpSeparatedBridgesPortEnable.setStatus('current') rldot1dStpSeparatedBridgesEnable = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23, 2), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpSeparatedBridgesEnable.setStatus('current') rldot1dStpSeparatedBridgesAutoConfig = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23, 3), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1dStpSeparatedBridgesAutoConfig.setStatus('current') rldot1dExtBase = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 3)) rldot1dExtBaseMibVersion = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 3, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dExtBaseMibVersion.setStatus('current') rldot1dDeviceCapabilities = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 3, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dDeviceCapabilities.setStatus('current') rldot1wRStp = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4)) rldot1wRStpVlanEdgePortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 1), ) if mibBuilder.loadTexts: rldot1wRStpVlanEdgePortTable.setStatus('current') rldot1wRStpVlanEdgePortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 1, 1), ).setIndexNames((0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1wRStpVlanEdgePortVlan"), (0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1wRStpVlanEdgePortPort")) if mibBuilder.loadTexts: rldot1wRStpVlanEdgePortEntry.setStatus('current') rldot1wRStpVlanEdgePortVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4095))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1wRStpVlanEdgePortVlan.setStatus('current') rldot1wRStpVlanEdgePortPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1wRStpVlanEdgePortPort.setStatus('current') rldot1wRStpEdgePortStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 1, 1, 3), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1wRStpEdgePortStatus.setStatus('current') rldot1wRStpForceVersionTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 2), ) if mibBuilder.loadTexts: rldot1wRStpForceVersionTable.setStatus('current') rldot1wRStpForceVersionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 2, 1), ).setIndexNames((0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1wRStpForceVersionVlan")) if mibBuilder.loadTexts: rldot1wRStpForceVersionEntry.setStatus('current') rldot1wRStpForceVersionVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4095))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1wRStpForceVersionVlan.setStatus('current') rldot1wRStpForceVersionState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 2, 1, 2), Integer32().clone(2)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1wRStpForceVersionState.setStatus('current') rldot1pPriorityMap = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5)) rldot1pPriorityMapState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1pPriorityMapState.setStatus('current') rldot1pPriorityMapTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2), ) if mibBuilder.loadTexts: rldot1pPriorityMapTable.setStatus('current') rldot1pPriorityMapEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1), ).setIndexNames((0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1pPriorityMapName")) if mibBuilder.loadTexts: rldot1pPriorityMapEntry.setStatus('current') rldot1pPriorityMapName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 25))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1pPriorityMapName.setStatus('current') rldot1pPriorityMapPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readcreate") if mibBuilder.loadTexts: rldot1pPriorityMapPriority.setStatus('current') rldot1pPriorityMapPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1, 3), PortList()).setMaxAccess("readcreate") if mibBuilder.loadTexts: rldot1pPriorityMapPort.setStatus('current') rldot1pPriorityMapPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1, 4), PortList()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1pPriorityMapPortList.setStatus('current') rldot1pPriorityMapStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1, 5), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: rldot1pPriorityMapStatus.setStatus('current') rldot1sMstp = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6)) rldot1sMstpInstanceTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1), ) if mibBuilder.loadTexts: rldot1sMstpInstanceTable.setStatus('current') rldot1sMstpInstanceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1), ).setIndexNames((0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1sMstpInstanceId")) if mibBuilder.loadTexts: rldot1sMstpInstanceEntry.setStatus('current') rldot1sMstpInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceId.setStatus('current') rldot1sMstpInstanceEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 2), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceEnable.setStatus('current') rldot1sMstpInstanceTimeSinceTopologyChange = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 3), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceTimeSinceTopologyChange.setStatus('current') rldot1sMstpInstanceTopChanges = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceTopChanges.setStatus('current') rldot1sMstpInstanceDesignatedRoot = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 5), BridgeId()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceDesignatedRoot.setStatus('current') rldot1sMstpInstanceRootCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceRootCost.setStatus('current') rldot1sMstpInstanceRootPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceRootPort.setStatus('current') rldot1sMstpInstanceMaxAge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 8), Timeout()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceMaxAge.setStatus('current') rldot1sMstpInstanceHelloTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 9), Timeout()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceHelloTime.setStatus('current') rldot1sMstpInstanceHoldTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceHoldTime.setStatus('current') rldot1sMstpInstanceForwardDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 11), Timeout()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceForwardDelay.setStatus('current') rldot1sMstpInstancePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 61440))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1sMstpInstancePriority.setStatus('current') rldot1sMstpInstanceRemainingHopes = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstanceRemainingHopes.setStatus('current') rldot1sMstpInstancePortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2), ) if mibBuilder.loadTexts: rldot1sMstpInstancePortTable.setStatus('current') rldot1sMstpInstancePortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1), ).setIndexNames((0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1sMstpInstancePortMstiId"), (0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1sMstpInstancePortPort")) if mibBuilder.loadTexts: rldot1sMstpInstancePortEntry.setStatus('current') rldot1sMstpInstancePortMstiId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstancePortMstiId.setStatus('current') rldot1sMstpInstancePortPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4096))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstancePortPort.setStatus('current') rldot1sMstpInstancePortPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 240))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1sMstpInstancePortPriority.setStatus('current') rldot1sMstpInstancePortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("disabled", 1), ("blocking", 2), ("listening", 3), ("learning", 4), ("forwarding", 5), ("broken", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstancePortState.setStatus('current') rldot1sMstpInstancePortEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstancePortEnable.setStatus('current') rldot1sMstpInstancePortPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 200000000))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstancePortPathCost.setStatus('current') rldot1sMstpInstancePortDesignatedRoot = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 7), BridgeId()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstancePortDesignatedRoot.setStatus('current') rldot1sMstpInstancePortDesignatedCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstancePortDesignatedCost.setStatus('current') rldot1sMstpInstancePortDesignatedBridge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 9), BridgeId()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstancePortDesignatedBridge.setStatus('current') rldot1sMstpInstancePortDesignatedPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstancePortDesignatedPort.setStatus('current') rldot1sMstpInstancePortForwardTransitions = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpInstancePortForwardTransitions.setStatus('current') rldot1sMStpInstancePortAdminPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200000000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1sMStpInstancePortAdminPathCost.setStatus('current') rldot1sMStpInstancePortRole = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("unknown", 0), ("disabled", 1), ("alternate", 2), ("backup", 3), ("root", 4), ("designated", 5), ("master", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMStpInstancePortRole.setStatus('current') rldot1sMstpMaxHopes = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 40)).clone(20)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1sMstpMaxHopes.setStatus('current') rldot1sMstpConfigurationName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 4), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpConfigurationName.setStatus('current') rldot1sMstpRevisionLevel = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpRevisionLevel.setStatus('current') rldot1sMstpVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 6), ) if mibBuilder.loadTexts: rldot1sMstpVlanTable.setStatus('current') rldot1sMstpVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 6, 1), ).setIndexNames((0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1sMstpVlan")) if mibBuilder.loadTexts: rldot1sMstpVlanEntry.setStatus('current') rldot1sMstpVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpVlan.setStatus('current') rldot1sMstpGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 6, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpGroup.setStatus('current') rldot1sMstpPendingGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 6, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1sMstpPendingGroup.setStatus('current') rldot1sMstpExtPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7), ) if mibBuilder.loadTexts: rldot1sMstpExtPortTable.setStatus('current') rldot1sMstpExtPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1), ).setIndexNames((0, "DLINK-3100-BRIDGEMIBOBJECTS-MIB", "rldot1sMstpExtPortPort")) if mibBuilder.loadTexts: rldot1sMstpExtPortEntry.setStatus('current') rldot1sMstpExtPortPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4096))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpExtPortPort.setStatus('current') rldot1sMstpExtPortInternalOperPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 200000000))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpExtPortInternalOperPathCost.setStatus('current') rldot1sMstpExtPortDesignatedRegionalRoot = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 3), BridgeId()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpExtPortDesignatedRegionalRoot.setStatus('current') rldot1sMstpExtPortDesignatedRegionalCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpExtPortDesignatedRegionalCost.setStatus('current') rldot1sMstpExtPortBoundary = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 5), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpExtPortBoundary.setStatus('current') rldot1sMstpExtPortInternalAdminPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200000000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1sMstpExtPortInternalAdminPathCost.setStatus('current') rldot1sMstpDesignatedMaxHopes = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 40))).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpDesignatedMaxHopes.setStatus('current') rldot1sMstpRegionalRoot = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 9), BridgeId()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpRegionalRoot.setStatus('current') rldot1sMstpRegionalRootCost = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpRegionalRootCost.setStatus('current') rldot1sMstpPendingConfigurationName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 11), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1sMstpPendingConfigurationName.setStatus('current') rldot1sMstpPendingRevisionLevel = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1sMstpPendingRevisionLevel.setStatus('current') rldot1sMstpPendingAction = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("copyPendingActive", 1), ("copyActivePending", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rldot1sMstpPendingAction.setStatus('current') rldot1sMstpRemainingHops = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1sMstpRemainingHops.setStatus('current') rldot1dTpAgingTime = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 7)) rldot1dTpAgingTimeMin = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 7, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dTpAgingTimeMin.setStatus('current') rldot1dTpAgingTimeMax = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 7, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rldot1dTpAgingTimeMax.setStatus('current') mibBuilder.exportSymbols("DLINK-3100-BRIDGEMIBOBJECTS-MIB", rldot1dStpVlanPortDesignatedBridge=rldot1dStpVlanPortDesignatedBridge, rldot1pPriorityMapEntry=rldot1pPriorityMapEntry, rldot1sMStpInstancePortRole=rldot1sMStpInstancePortRole, rldot1sMstpInstancePriority=rldot1sMstpInstancePriority, rldot1pPriorityMapPriority=rldot1pPriorityMapPriority, rldot1dStpVlan=rldot1dStpVlan, rldot1sMstpExtPortInternalAdminPathCost=rldot1sMstpExtPortInternalAdminPathCost, rldot1dStpVlanPortPriority=rldot1dStpVlanPortPriority, rldot1sMstpInstancePortPathCost=rldot1sMstpInstancePortPathCost, rlpBridgeMIBObjects=rlpBridgeMIBObjects, rldot1dStpMibVersion=rldot1dStpMibVersion, rldot1sMstpExtPortPort=rldot1sMstpExtPortPort, rldot1sMstpInstanceHoldTime=rldot1sMstpInstanceHoldTime, rldot1dStpPortBpduSent=rldot1dStpPortBpduSent, rldot1sMstpInstancePortPort=rldot1sMstpInstancePortPort, rldot1sMstpConfigurationName=rldot1sMstpConfigurationName, rldot1dStpSeparatedBridgesTable=rldot1dStpSeparatedBridgesTable, rldot1dStpTopChanges=rldot1dStpTopChanges, rldot1dStpTypeAfterReset=rldot1dStpTypeAfterReset, rldot1dStpHoldTime=rldot1dStpHoldTime, rldot1dExtBaseMibVersion=rldot1dExtBaseMibVersion, rldot1dTpAgingTime=rldot1dTpAgingTime, rldot1sMstpInstancePortDesignatedBridge=rldot1sMstpInstancePortDesignatedBridge, rldot1dTpAgingTimeMin=rldot1dTpAgingTimeMin, rldot1dStpVlanPortForwardTransitions=rldot1dStpVlanPortForwardTransitions, rldot1dExtBase=rldot1dExtBase, rldot1dStpBpduType=rldot1dStpBpduType, rldot1sMstpInstanceId=rldot1sMstpInstanceId, rldot1sMstp=rldot1sMstp, rldot1sMstpRegionalRootCost=rldot1sMstpRegionalRootCost, rldot1dStpSeparatedBridgesEntry=rldot1dStpSeparatedBridgesEntry, rldot1dStpPortBpduReceived=rldot1dStpPortBpduReceived, rldot1sMstpGroup=rldot1sMstpGroup, rldot1sMstpPendingGroup=rldot1sMstpPendingGroup, rldot1dStpSeparatedBridgesEnable=rldot1dStpSeparatedBridgesEnable, rldot1dPriorityPortGroupTable=rldot1dPriorityPortGroupTable, rldot1dStpRootPort=rldot1dStpRootPort, rldot1dStpPortsEnable=rldot1dStpPortsEnable, rldot1sMstpInstanceTimeSinceTopologyChange=rldot1sMstpInstanceTimeSinceTopologyChange, rldot1pPriorityMapName=rldot1pPriorityMapName, rldot1pPriorityMap=rldot1pPriorityMap, rldot1sMstpInstanceRootCost=rldot1sMstpInstanceRootCost, rldot1dStpDesignatedRoot=rldot1dStpDesignatedRoot, rldot1dStp=rldot1dStp, rldot1sMstpInstancePortPriority=rldot1sMstpInstancePortPriority, rldot1dDeviceCapabilities=rldot1dDeviceCapabilities, rldot1sMstpPendingConfigurationName=rldot1sMstpPendingConfigurationName, rldot1sMstpInstanceEnable=rldot1sMstpInstanceEnable, rldot1dPriorityPortGroupEntry=rldot1dPriorityPortGroupEntry, rldot1dStpPortLoopback=rldot1dStpPortLoopback, rldot1sMstpRegionalRoot=rldot1sMstpRegionalRoot, rldot1pPriorityMapStatus=rldot1pPriorityMapStatus, rldot1sMstpInstanceTable=rldot1sMstpInstanceTable, rldot1dStpVlanEntry=rldot1dStpVlanEntry, rldot1dStpMaxAge=rldot1dStpMaxAge, rldot1sMstpMaxHopes=rldot1sMstpMaxHopes, rldot1dStpPortPort=rldot1dStpPortPort, rldot1sMStpInstancePortAdminPathCost=rldot1sMStpInstancePortAdminPathCost, rldot1dStpTrapVrblifIndex=rldot1dStpTrapVrblifIndex, rldot1wRStpForceVersionEntry=rldot1wRStpForceVersionEntry, rldot1dTpAgingTimeMax=rldot1dTpAgingTimeMax, rldot1dStpBpduCount=rldot1dStpBpduCount, rldot1sMstpPendingRevisionLevel=rldot1sMstpPendingRevisionLevel, rldot1dStpPortBpduGuardEntry=rldot1dStpPortBpduGuardEntry, rldot1dStpPortTable=rldot1dStpPortTable, rldot1dStpVlanPortDesignatedPort=rldot1dStpVlanPortDesignatedPort, rldot1dStpExtendedPortNumberFormat=rldot1dStpExtendedPortNumberFormat, rldot1dStpVlanPortVlan=rldot1dStpVlanPortVlan, rldot1wRStpForceVersionState=rldot1wRStpForceVersionState, rldot1sMstpInstancePortForwardTransitions=rldot1sMstpInstancePortForwardTransitions, rldot1dStpVlanEnable=rldot1dStpVlanEnable, rldot1sMstpInstanceForwardDelay=rldot1sMstpInstanceForwardDelay, rldot1dStpPortFilterBpdu=rldot1dStpPortFilterBpdu, rldot1dStpPortBpduGuardTable=rldot1dStpPortBpduGuardTable, rldot1dPriorityPortGroupNumber=rldot1dPriorityPortGroupNumber, rldot1dStpTrapVrblVID=rldot1dStpTrapVrblVID, rldot1dStpSeparatedBridges=rldot1dStpSeparatedBridges, rldot1dStpVlanTable=rldot1dStpVlanTable, rldot1dStpMonitorTime=rldot1dStpMonitorTime, rldot1sMstpExtPortInternalOperPathCost=rldot1sMstpExtPortInternalOperPathCost, rldot1pPriorityMapPort=rldot1pPriorityMapPort, rldot1dStpPortRole=rldot1dStpPortRole, rldot1wRStpForceVersionVlan=rldot1wRStpForceVersionVlan, rldot1pPriorityMapTable=rldot1pPriorityMapTable, rldot1dStpVlanPortEntry=rldot1dStpVlanPortEntry, rldot1dStpSeparatedBridgesPortEnable=rldot1dStpSeparatedBridgesPortEnable, rldot1sMstpInstancePortDesignatedRoot=rldot1sMstpInstancePortDesignatedRoot, rldot1sMstpInstanceEntry=rldot1sMstpInstanceEntry, rldot1sMstpVlanTable=rldot1sMstpVlanTable, PYSNMP_MODULE_ID=rlpBridgeMIBObjects, rldot1dPriority=rldot1dPriority, rldot1dStpPortBpduOperStatus=rldot1dStpPortBpduOperStatus, rldot1wRStpVlanEdgePortEntry=rldot1wRStpVlanEdgePortEntry, rldot1pPriorityMapState=rldot1pPriorityMapState, rldot1dStpPortDampEnable=rldot1dStpPortDampEnable, rldot1sMstpExtPortDesignatedRegionalRoot=rldot1sMstpExtPortDesignatedRegionalRoot, rldot1sMstpInstancePortTable=rldot1sMstpInstancePortTable, rldot1dStpType=rldot1dStpType, rldot1dStpPortDampStable=rldot1dStpPortDampStable, rldot1dStpPortEntry=rldot1dStpPortEntry, rldot1dStpVlanPortPathCost=rldot1dStpVlanPortPathCost, rldot1dStpEdgeportSupportInStp=rldot1dStpEdgeportSupportInStp, rldot1sMstpExtPortEntry=rldot1sMstpExtPortEntry, rldot1sMstpInstanceRootPort=rldot1sMstpInstanceRootPort, rldot1sMstpVlanEntry=rldot1sMstpVlanEntry, rldot1wRStp=rldot1wRStp, rldot1sMstpInstanceTopChanges=rldot1sMstpInstanceTopChanges, rldot1dStpVlanPortDesignatedCost=rldot1dStpVlanPortDesignatedCost, rldot1sMstpDesignatedMaxHopes=rldot1sMstpDesignatedMaxHopes, rldot1dStpHelloTime=rldot1dStpHelloTime, rldot1dPriorityMibVersion=rldot1dPriorityMibVersion, rldot1dStpTaggedFlooding=rldot1dStpTaggedFlooding, rldot1dStpPortBpduGuardEnable=rldot1dStpPortBpduGuardEnable, rldot1dStpEnable=rldot1dStpEnable, rldot1wRStpVlanEdgePortPort=rldot1wRStpVlanEdgePortPort, rldot1wRStpVlanEdgePortTable=rldot1wRStpVlanEdgePortTable, rldot1sMstpInstanceRemainingHopes=rldot1sMstpInstanceRemainingHopes, rldot1wRStpVlanEdgePortVlan=rldot1wRStpVlanEdgePortVlan, rldot1dStpPortToDefault=rldot1dStpPortToDefault, rldot1dStpLastChanged=rldot1dStpLastChanged, rldot1sMstpPendingAction=rldot1sMstpPendingAction, rldot1dStpRootCost=rldot1dStpRootCost, rldot1sMstpInstancePortDesignatedPort=rldot1sMstpInstancePortDesignatedPort, rldot1dStpForwardDelay=rldot1dStpForwardDelay, rldot1wRStpEdgePortStatus=rldot1wRStpEdgePortStatus, rldot1sMstpExtPortTable=rldot1sMstpExtPortTable, rldot1sMstpInstanceDesignatedRoot=rldot1sMstpInstanceDesignatedRoot, rldot1sMstpInstancePortEnable=rldot1sMstpInstancePortEnable, rldot1dStpVlanPortDesignatedRoot=rldot1dStpVlanPortDesignatedRoot, rldot1sMstpInstancePortDesignatedCost=rldot1sMstpInstancePortDesignatedCost, rldot1dStpTimeSinceTopologyChange=rldot1dStpTimeSinceTopologyChange, rldot1dStpVlanPortState=rldot1dStpVlanPortState, rldot1pPriorityMapPortList=rldot1pPriorityMapPortList, rldot1sMstpInstancePortMstiId=rldot1sMstpInstancePortMstiId, rldot1sMstpInstanceMaxAge=rldot1sMstpInstanceMaxAge, rldot1sMstpInstancePortEntry=rldot1sMstpInstancePortEntry, rldot1dStpPortBelongToVlanDefault=rldot1dStpPortBelongToVlanDefault, rldot1sMstpExtPortBoundary=rldot1sMstpExtPortBoundary, rldot1dStpEnableByDefault=rldot1dStpEnableByDefault, rldot1sMstpRemainingHops=rldot1sMstpRemainingHops, rldot1dStpFloodBpduMethod=rldot1dStpFloodBpduMethod, rldot1dStpSeparatedBridgesAutoConfig=rldot1dStpSeparatedBridgesAutoConfig, rldot1dStpPortRestrictedRole=rldot1dStpPortRestrictedRole, rldot1dStpTrapVariable=rldot1dStpTrapVariable, rldot1dStpVlanPortEnable=rldot1dStpVlanPortEnable, rldot1sMstpInstanceHelloTime=rldot1sMstpInstanceHelloTime, rldot1dStpSupportedType=rldot1dStpSupportedType, rldot1dStpLoopbackGuardEnable=rldot1dStpLoopbackGuardEnable, rldot1wRStpForceVersionTable=rldot1wRStpForceVersionTable, rldot1sMstpInstancePortState=rldot1sMstpInstancePortState, rldot1sMstpVlan=rldot1sMstpVlan, rldot1dStpPortAutoEdgePort=rldot1dStpPortAutoEdgePort, rldot1sMstpRevisionLevel=rldot1sMstpRevisionLevel, rldot1dStpFilterBpdu=rldot1dStpFilterBpdu, rldot1dStpVlanPortTable=rldot1dStpVlanPortTable, rldot1sMstpExtPortDesignatedRegionalCost=rldot1sMstpExtPortDesignatedRegionalCost, rldot1dStpVlanPortPort=rldot1dStpVlanPortPort, rldot1dStpPortMustBelongToVlan=rldot1dStpPortMustBelongToVlan)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, value_range_constraint, value_size_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion') (timeout, bridge_id, dot1d_base_port) = mibBuilder.importSymbols('BRIDGE-MIB', 'Timeout', 'BridgeId', 'dot1dBasePort') (rnd,) = mibBuilder.importSymbols('DLINK-3100-MIB', 'rnd') (interface_index, if_index) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex', 'ifIndex') (port_list,) = mibBuilder.importSymbols('Q-BRIDGE-MIB', 'PortList') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (iso, counter64, time_ticks, module_identity, bits, mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, object_identity, notification_type, mib_identifier, integer32, gauge32, unsigned32, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'Counter64', 'TimeTicks', 'ModuleIdentity', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'ObjectIdentity', 'NotificationType', 'MibIdentifier', 'Integer32', 'Gauge32', 'Unsigned32', 'Counter32') (row_status, truth_value, textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'TruthValue', 'TextualConvention', 'DisplayString') rlp_bridge_mib_objects = module_identity((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57)) rlpBridgeMIBObjects.setRevisions(('2007-01-02 00:00',)) if mibBuilder.loadTexts: rlpBridgeMIBObjects.setLastUpdated('200701020000Z') if mibBuilder.loadTexts: rlpBridgeMIBObjects.setOrganization('Dlink, Inc. Dlink Semiconductor, Inc.') rldot1d_priority = mib_identifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 1)) rldot1d_priority_mib_version = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dPriorityMibVersion.setStatus('current') rldot1d_priority_port_group_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 1, 2)) if mibBuilder.loadTexts: rldot1dPriorityPortGroupTable.setStatus('current') rldot1d_priority_port_group_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 1, 2, 1)).setIndexNames((0, 'BRIDGE-MIB', 'dot1dBasePort')) if mibBuilder.loadTexts: rldot1dPriorityPortGroupEntry.setStatus('current') rldot1d_priority_port_group_number = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 1, 2, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dPriorityPortGroupNumber.setStatus('current') rldot1d_stp = mib_identifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2)) rldot1d_stp_mib_version = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpMibVersion.setStatus('current') rldot1d_stp_type = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 4))).clone(namedValues=named_values(('perDevice', 1), ('mstp', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpType.setStatus('current') rldot1d_stp_enable = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 3), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpEnable.setStatus('current') rldot1d_stp_port_must_belong_to_vlan = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 4), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpPortMustBelongToVlan.setStatus('current') rldot1d_stp_extended_port_number_format = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 5), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpExtendedPortNumberFormat.setStatus('current') rldot1d_stp_vlan_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6)) if mibBuilder.loadTexts: rldot1dStpVlanTable.setStatus('current') rldot1d_stp_vlan_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1)).setIndexNames((0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1dStpVlan')) if mibBuilder.loadTexts: rldot1dStpVlanEntry.setStatus('current') rldot1d_stp_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpVlan.setStatus('current') rldot1d_stp_vlan_enable = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 2), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpVlanEnable.setStatus('current') rldot1d_stp_time_since_topology_change = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 3), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpTimeSinceTopologyChange.setStatus('current') rldot1d_stp_top_changes = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpTopChanges.setStatus('current') rldot1d_stp_designated_root = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 5), bridge_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpDesignatedRoot.setStatus('current') rldot1d_stp_root_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpRootCost.setStatus('current') rldot1d_stp_root_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpRootPort.setStatus('current') rldot1d_stp_max_age = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 8), timeout()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpMaxAge.setStatus('current') rldot1d_stp_hello_time = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 9), timeout()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpHelloTime.setStatus('current') rldot1d_stp_hold_time = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 10), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpHoldTime.setStatus('current') rldot1d_stp_forward_delay = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 6, 1, 11), timeout()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpForwardDelay.setStatus('current') rldot1d_stp_vlan_port_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7)) if mibBuilder.loadTexts: rldot1dStpVlanPortTable.setStatus('current') rldot1d_stp_vlan_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1)).setIndexNames((0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1dStpVlanPortVlan'), (0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1dStpVlanPortPort')) if mibBuilder.loadTexts: rldot1dStpVlanPortEntry.setStatus('current') rldot1d_stp_vlan_port_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4095))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpVlanPortVlan.setStatus('current') rldot1d_stp_vlan_port_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 4096))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpVlanPortPort.setStatus('current') rldot1d_stp_vlan_port_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpVlanPortPriority.setStatus('current') rldot1d_stp_vlan_port_state = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('disabled', 1), ('blocking', 2), ('listening', 3), ('learning', 4), ('forwarding', 5), ('broken', 6)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpVlanPortState.setStatus('current') rldot1d_stp_vlan_port_enable = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpVlanPortEnable.setStatus('current') rldot1d_stp_vlan_port_path_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpVlanPortPathCost.setStatus('current') rldot1d_stp_vlan_port_designated_root = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 7), bridge_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpVlanPortDesignatedRoot.setStatus('current') rldot1d_stp_vlan_port_designated_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpVlanPortDesignatedCost.setStatus('current') rldot1d_stp_vlan_port_designated_bridge = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 9), bridge_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpVlanPortDesignatedBridge.setStatus('current') rldot1d_stp_vlan_port_designated_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 10), octet_string().subtype(subtypeSpec=value_size_constraint(2, 2)).setFixedLength(2)).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpVlanPortDesignatedPort.setStatus('current') rldot1d_stp_vlan_port_forward_transitions = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 7, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpVlanPortForwardTransitions.setStatus('current') rldot1d_stp_trap_variable = mib_identifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 8)) rldot1d_stp_trap_vrblif_index = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 8, 1), interface_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpTrapVrblifIndex.setStatus('current') rldot1d_stp_trap_vrbl_vid = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 8, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpTrapVrblVID.setStatus('current') rldot1d_stp_type_after_reset = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 4))).clone(namedValues=named_values(('perDevice', 1), ('mstp', 4))).clone('perDevice')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpTypeAfterReset.setStatus('current') rldot1d_stp_monitor_time = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 10), integer32().subtype(subtypeSpec=value_range_constraint(1, 20)).clone(10)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpMonitorTime.setStatus('current') rldot1d_stp_bpdu_count = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 11), integer32().subtype(subtypeSpec=value_range_constraint(1, 60)).clone(10)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpBpduCount.setStatus('current') rldot1d_stp_last_changed = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 12), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpLastChanged.setStatus('current') rldot1d_stp_port_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13)) if mibBuilder.loadTexts: rldot1dStpPortTable.setStatus('current') rldot1d_stp_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1)).setIndexNames((0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1dStpPortPort')) if mibBuilder.loadTexts: rldot1dStpPortEntry.setStatus('current') rldot1d_stp_port_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4096))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpPortPort.setStatus('current') rldot1d_stp_port_damp_enable = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 2), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpPortDampEnable.setStatus('current') rldot1d_stp_port_damp_stable = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 3), truth_value().clone('true')).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpPortDampStable.setStatus('current') rldot1d_stp_port_filter_bpdu = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('false', 0), ('true', 1), ('none', 2))).clone('none')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpPortFilterBpdu.setStatus('current') rldot1d_stp_port_bpdu_sent = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpPortBpduSent.setStatus('current') rldot1d_stp_port_bpdu_received = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpPortBpduReceived.setStatus('current') rldot1d_stp_port_role = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('unknown', 0), ('disabled', 1), ('alternate', 2), ('backup', 3), ('root', 4), ('designated', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpPortRole.setStatus('current') rldot1d_stp_bpdu_type = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('stp', 0), ('rstp', 1)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpBpduType.setStatus('current') rldot1d_stp_port_restricted_role = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 9), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpPortRestrictedRole.setStatus('current') rldot1d_stp_port_auto_edge_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 10), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpPortAutoEdgePort.setStatus('current') rldot1d_stp_port_loopback = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 11), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpPortLoopback.setStatus('current') rldot1d_stp_port_bpdu_oper_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 13, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('filter', 0), ('flood', 1), ('bridge', 2), ('stp', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpPortBpduOperStatus.setStatus('current') rldot1d_stp_ports_enable = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 14), truth_value().clone('true')).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpPortsEnable.setStatus('current') rldot1d_stp_tagged_flooding = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 15), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpTaggedFlooding.setStatus('current') rldot1d_stp_port_belong_to_vlan_default = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 16), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpPortBelongToVlanDefault.setStatus('current') rldot1d_stp_enable_by_default = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 17), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpEnableByDefault.setStatus('current') rldot1d_stp_port_to_default = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 18), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpPortToDefault.setStatus('current') rldot1d_stp_supported_type = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('perDevice', 1), ('perVlan', 2), ('mstp', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpSupportedType.setStatus('current') rldot1d_stp_edgeport_support_in_stp = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 20), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dStpEdgeportSupportInStp.setStatus('current') rldot1d_stp_filter_bpdu = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 21), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpFilterBpdu.setStatus('current') rldot1d_stp_flood_bpdu_method = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 22), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('classic', 0), ('bridging', 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpFloodBpduMethod.setStatus('current') rldot1d_stp_separated_bridges = mib_identifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23)) rldot1d_stp_port_bpdu_guard_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 24)) if mibBuilder.loadTexts: rldot1dStpPortBpduGuardTable.setStatus('current') rldot1d_stp_port_bpdu_guard_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 24, 1)).setIndexNames((0, 'BRIDGE-MIB', 'dot1dBasePort')) if mibBuilder.loadTexts: rldot1dStpPortBpduGuardEntry.setStatus('current') rldot1d_stp_port_bpdu_guard_enable = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 24, 1, 1), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpPortBpduGuardEnable.setStatus('current') rldot1d_stp_loopback_guard_enable = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 25), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpLoopbackGuardEnable.setStatus('current') rldot1d_stp_separated_bridges_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23, 1)) if mibBuilder.loadTexts: rldot1dStpSeparatedBridgesTable.setStatus('current') rldot1d_stp_separated_bridges_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex')) if mibBuilder.loadTexts: rldot1dStpSeparatedBridgesEntry.setStatus('current') rldot1d_stp_separated_bridges_port_enable = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23, 1, 1, 1), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpSeparatedBridgesPortEnable.setStatus('current') rldot1d_stp_separated_bridges_enable = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23, 2), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpSeparatedBridgesEnable.setStatus('current') rldot1d_stp_separated_bridges_auto_config = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 2, 23, 3), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1dStpSeparatedBridgesAutoConfig.setStatus('current') rldot1d_ext_base = mib_identifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 3)) rldot1d_ext_base_mib_version = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 3, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dExtBaseMibVersion.setStatus('current') rldot1d_device_capabilities = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 3, 2), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1)).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dDeviceCapabilities.setStatus('current') rldot1w_r_stp = mib_identifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4)) rldot1w_r_stp_vlan_edge_port_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 1)) if mibBuilder.loadTexts: rldot1wRStpVlanEdgePortTable.setStatus('current') rldot1w_r_stp_vlan_edge_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 1, 1)).setIndexNames((0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1wRStpVlanEdgePortVlan'), (0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1wRStpVlanEdgePortPort')) if mibBuilder.loadTexts: rldot1wRStpVlanEdgePortEntry.setStatus('current') rldot1w_r_stp_vlan_edge_port_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4095))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1wRStpVlanEdgePortVlan.setStatus('current') rldot1w_r_stp_vlan_edge_port_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 1, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1wRStpVlanEdgePortPort.setStatus('current') rldot1w_r_stp_edge_port_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 1, 1, 3), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1wRStpEdgePortStatus.setStatus('current') rldot1w_r_stp_force_version_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 2)) if mibBuilder.loadTexts: rldot1wRStpForceVersionTable.setStatus('current') rldot1w_r_stp_force_version_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 2, 1)).setIndexNames((0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1wRStpForceVersionVlan')) if mibBuilder.loadTexts: rldot1wRStpForceVersionEntry.setStatus('current') rldot1w_r_stp_force_version_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4095))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1wRStpForceVersionVlan.setStatus('current') rldot1w_r_stp_force_version_state = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 4, 2, 1, 2), integer32().clone(2)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1wRStpForceVersionState.setStatus('current') rldot1p_priority_map = mib_identifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5)) rldot1p_priority_map_state = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1pPriorityMapState.setStatus('current') rldot1p_priority_map_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2)) if mibBuilder.loadTexts: rldot1pPriorityMapTable.setStatus('current') rldot1p_priority_map_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1)).setIndexNames((0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1pPriorityMapName')) if mibBuilder.loadTexts: rldot1pPriorityMapEntry.setStatus('current') rldot1p_priority_map_name = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(1, 25))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1pPriorityMapName.setStatus('current') rldot1p_priority_map_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readcreate') if mibBuilder.loadTexts: rldot1pPriorityMapPriority.setStatus('current') rldot1p_priority_map_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1, 3), port_list()).setMaxAccess('readcreate') if mibBuilder.loadTexts: rldot1pPriorityMapPort.setStatus('current') rldot1p_priority_map_port_list = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1, 4), port_list()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1pPriorityMapPortList.setStatus('current') rldot1p_priority_map_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 5, 2, 1, 5), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: rldot1pPriorityMapStatus.setStatus('current') rldot1s_mstp = mib_identifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6)) rldot1s_mstp_instance_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1)) if mibBuilder.loadTexts: rldot1sMstpInstanceTable.setStatus('current') rldot1s_mstp_instance_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1)).setIndexNames((0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1sMstpInstanceId')) if mibBuilder.loadTexts: rldot1sMstpInstanceEntry.setStatus('current') rldot1s_mstp_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceId.setStatus('current') rldot1s_mstp_instance_enable = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 2), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceEnable.setStatus('current') rldot1s_mstp_instance_time_since_topology_change = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 3), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceTimeSinceTopologyChange.setStatus('current') rldot1s_mstp_instance_top_changes = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceTopChanges.setStatus('current') rldot1s_mstp_instance_designated_root = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 5), bridge_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceDesignatedRoot.setStatus('current') rldot1s_mstp_instance_root_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceRootCost.setStatus('current') rldot1s_mstp_instance_root_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceRootPort.setStatus('current') rldot1s_mstp_instance_max_age = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 8), timeout()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceMaxAge.setStatus('current') rldot1s_mstp_instance_hello_time = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 9), timeout()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceHelloTime.setStatus('current') rldot1s_mstp_instance_hold_time = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 10), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceHoldTime.setStatus('current') rldot1s_mstp_instance_forward_delay = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 11), timeout()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceForwardDelay.setStatus('current') rldot1s_mstp_instance_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 61440))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1sMstpInstancePriority.setStatus('current') rldot1s_mstp_instance_remaining_hopes = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 1, 1, 13), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstanceRemainingHopes.setStatus('current') rldot1s_mstp_instance_port_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2)) if mibBuilder.loadTexts: rldot1sMstpInstancePortTable.setStatus('current') rldot1s_mstp_instance_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1)).setIndexNames((0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1sMstpInstancePortMstiId'), (0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1sMstpInstancePortPort')) if mibBuilder.loadTexts: rldot1sMstpInstancePortEntry.setStatus('current') rldot1s_mstp_instance_port_msti_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstancePortMstiId.setStatus('current') rldot1s_mstp_instance_port_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 4096))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstancePortPort.setStatus('current') rldot1s_mstp_instance_port_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 240))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1sMstpInstancePortPriority.setStatus('current') rldot1s_mstp_instance_port_state = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('disabled', 1), ('blocking', 2), ('listening', 3), ('learning', 4), ('forwarding', 5), ('broken', 6)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstancePortState.setStatus('current') rldot1s_mstp_instance_port_enable = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstancePortEnable.setStatus('current') rldot1s_mstp_instance_port_path_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(1, 200000000))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstancePortPathCost.setStatus('current') rldot1s_mstp_instance_port_designated_root = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 7), bridge_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstancePortDesignatedRoot.setStatus('current') rldot1s_mstp_instance_port_designated_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstancePortDesignatedCost.setStatus('current') rldot1s_mstp_instance_port_designated_bridge = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 9), bridge_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstancePortDesignatedBridge.setStatus('current') rldot1s_mstp_instance_port_designated_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 10), octet_string().subtype(subtypeSpec=value_size_constraint(2, 2)).setFixedLength(2)).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstancePortDesignatedPort.setStatus('current') rldot1s_mstp_instance_port_forward_transitions = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpInstancePortForwardTransitions.setStatus('current') rldot1s_m_stp_instance_port_admin_path_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 200000000))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1sMStpInstancePortAdminPathCost.setStatus('current') rldot1s_m_stp_instance_port_role = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 2, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('unknown', 0), ('disabled', 1), ('alternate', 2), ('backup', 3), ('root', 4), ('designated', 5), ('master', 6)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMStpInstancePortRole.setStatus('current') rldot1s_mstp_max_hopes = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 40)).clone(20)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1sMstpMaxHopes.setStatus('current') rldot1s_mstp_configuration_name = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 4), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpConfigurationName.setStatus('current') rldot1s_mstp_revision_level = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpRevisionLevel.setStatus('current') rldot1s_mstp_vlan_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 6)) if mibBuilder.loadTexts: rldot1sMstpVlanTable.setStatus('current') rldot1s_mstp_vlan_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 6, 1)).setIndexNames((0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1sMstpVlan')) if mibBuilder.loadTexts: rldot1sMstpVlanEntry.setStatus('current') rldot1s_mstp_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 6, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpVlan.setStatus('current') rldot1s_mstp_group = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 6, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpGroup.setStatus('current') rldot1s_mstp_pending_group = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 6, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 64))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1sMstpPendingGroup.setStatus('current') rldot1s_mstp_ext_port_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7)) if mibBuilder.loadTexts: rldot1sMstpExtPortTable.setStatus('current') rldot1s_mstp_ext_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1)).setIndexNames((0, 'DLINK-3100-BRIDGEMIBOBJECTS-MIB', 'rldot1sMstpExtPortPort')) if mibBuilder.loadTexts: rldot1sMstpExtPortEntry.setStatus('current') rldot1s_mstp_ext_port_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4096))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpExtPortPort.setStatus('current') rldot1s_mstp_ext_port_internal_oper_path_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 200000000))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpExtPortInternalOperPathCost.setStatus('current') rldot1s_mstp_ext_port_designated_regional_root = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 3), bridge_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpExtPortDesignatedRegionalRoot.setStatus('current') rldot1s_mstp_ext_port_designated_regional_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpExtPortDesignatedRegionalCost.setStatus('current') rldot1s_mstp_ext_port_boundary = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 5), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpExtPortBoundary.setStatus('current') rldot1s_mstp_ext_port_internal_admin_path_cost = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 7, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 200000000))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1sMstpExtPortInternalAdminPathCost.setStatus('current') rldot1s_mstp_designated_max_hopes = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 8), integer32().subtype(subtypeSpec=value_range_constraint(1, 40))).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpDesignatedMaxHopes.setStatus('current') rldot1s_mstp_regional_root = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 9), bridge_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpRegionalRoot.setStatus('current') rldot1s_mstp_regional_root_cost = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 10), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpRegionalRootCost.setStatus('current') rldot1s_mstp_pending_configuration_name = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 11), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1sMstpPendingConfigurationName.setStatus('current') rldot1s_mstp_pending_revision_level = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1sMstpPendingRevisionLevel.setStatus('current') rldot1s_mstp_pending_action = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('copyPendingActive', 1), ('copyActivePending', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rldot1sMstpPendingAction.setStatus('current') rldot1s_mstp_remaining_hops = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 6, 14), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1sMstpRemainingHops.setStatus('current') rldot1d_tp_aging_time = mib_identifier((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 7)) rldot1d_tp_aging_time_min = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 7, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dTpAgingTimeMin.setStatus('current') rldot1d_tp_aging_time_max = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 57, 7, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rldot1dTpAgingTimeMax.setStatus('current') mibBuilder.exportSymbols('DLINK-3100-BRIDGEMIBOBJECTS-MIB', rldot1dStpVlanPortDesignatedBridge=rldot1dStpVlanPortDesignatedBridge, rldot1pPriorityMapEntry=rldot1pPriorityMapEntry, rldot1sMStpInstancePortRole=rldot1sMStpInstancePortRole, rldot1sMstpInstancePriority=rldot1sMstpInstancePriority, rldot1pPriorityMapPriority=rldot1pPriorityMapPriority, rldot1dStpVlan=rldot1dStpVlan, rldot1sMstpExtPortInternalAdminPathCost=rldot1sMstpExtPortInternalAdminPathCost, rldot1dStpVlanPortPriority=rldot1dStpVlanPortPriority, rldot1sMstpInstancePortPathCost=rldot1sMstpInstancePortPathCost, rlpBridgeMIBObjects=rlpBridgeMIBObjects, rldot1dStpMibVersion=rldot1dStpMibVersion, rldot1sMstpExtPortPort=rldot1sMstpExtPortPort, rldot1sMstpInstanceHoldTime=rldot1sMstpInstanceHoldTime, rldot1dStpPortBpduSent=rldot1dStpPortBpduSent, rldot1sMstpInstancePortPort=rldot1sMstpInstancePortPort, rldot1sMstpConfigurationName=rldot1sMstpConfigurationName, rldot1dStpSeparatedBridgesTable=rldot1dStpSeparatedBridgesTable, rldot1dStpTopChanges=rldot1dStpTopChanges, rldot1dStpTypeAfterReset=rldot1dStpTypeAfterReset, rldot1dStpHoldTime=rldot1dStpHoldTime, rldot1dExtBaseMibVersion=rldot1dExtBaseMibVersion, rldot1dTpAgingTime=rldot1dTpAgingTime, rldot1sMstpInstancePortDesignatedBridge=rldot1sMstpInstancePortDesignatedBridge, rldot1dTpAgingTimeMin=rldot1dTpAgingTimeMin, rldot1dStpVlanPortForwardTransitions=rldot1dStpVlanPortForwardTransitions, rldot1dExtBase=rldot1dExtBase, rldot1dStpBpduType=rldot1dStpBpduType, rldot1sMstpInstanceId=rldot1sMstpInstanceId, rldot1sMstp=rldot1sMstp, rldot1sMstpRegionalRootCost=rldot1sMstpRegionalRootCost, rldot1dStpSeparatedBridgesEntry=rldot1dStpSeparatedBridgesEntry, rldot1dStpPortBpduReceived=rldot1dStpPortBpduReceived, rldot1sMstpGroup=rldot1sMstpGroup, rldot1sMstpPendingGroup=rldot1sMstpPendingGroup, rldot1dStpSeparatedBridgesEnable=rldot1dStpSeparatedBridgesEnable, rldot1dPriorityPortGroupTable=rldot1dPriorityPortGroupTable, rldot1dStpRootPort=rldot1dStpRootPort, rldot1dStpPortsEnable=rldot1dStpPortsEnable, rldot1sMstpInstanceTimeSinceTopologyChange=rldot1sMstpInstanceTimeSinceTopologyChange, rldot1pPriorityMapName=rldot1pPriorityMapName, rldot1pPriorityMap=rldot1pPriorityMap, rldot1sMstpInstanceRootCost=rldot1sMstpInstanceRootCost, rldot1dStpDesignatedRoot=rldot1dStpDesignatedRoot, rldot1dStp=rldot1dStp, rldot1sMstpInstancePortPriority=rldot1sMstpInstancePortPriority, rldot1dDeviceCapabilities=rldot1dDeviceCapabilities, rldot1sMstpPendingConfigurationName=rldot1sMstpPendingConfigurationName, rldot1sMstpInstanceEnable=rldot1sMstpInstanceEnable, rldot1dPriorityPortGroupEntry=rldot1dPriorityPortGroupEntry, rldot1dStpPortLoopback=rldot1dStpPortLoopback, rldot1sMstpRegionalRoot=rldot1sMstpRegionalRoot, rldot1pPriorityMapStatus=rldot1pPriorityMapStatus, rldot1sMstpInstanceTable=rldot1sMstpInstanceTable, rldot1dStpVlanEntry=rldot1dStpVlanEntry, rldot1dStpMaxAge=rldot1dStpMaxAge, rldot1sMstpMaxHopes=rldot1sMstpMaxHopes, rldot1dStpPortPort=rldot1dStpPortPort, rldot1sMStpInstancePortAdminPathCost=rldot1sMStpInstancePortAdminPathCost, rldot1dStpTrapVrblifIndex=rldot1dStpTrapVrblifIndex, rldot1wRStpForceVersionEntry=rldot1wRStpForceVersionEntry, rldot1dTpAgingTimeMax=rldot1dTpAgingTimeMax, rldot1dStpBpduCount=rldot1dStpBpduCount, rldot1sMstpPendingRevisionLevel=rldot1sMstpPendingRevisionLevel, rldot1dStpPortBpduGuardEntry=rldot1dStpPortBpduGuardEntry, rldot1dStpPortTable=rldot1dStpPortTable, rldot1dStpVlanPortDesignatedPort=rldot1dStpVlanPortDesignatedPort, rldot1dStpExtendedPortNumberFormat=rldot1dStpExtendedPortNumberFormat, rldot1dStpVlanPortVlan=rldot1dStpVlanPortVlan, rldot1wRStpForceVersionState=rldot1wRStpForceVersionState, rldot1sMstpInstancePortForwardTransitions=rldot1sMstpInstancePortForwardTransitions, rldot1dStpVlanEnable=rldot1dStpVlanEnable, rldot1sMstpInstanceForwardDelay=rldot1sMstpInstanceForwardDelay, rldot1dStpPortFilterBpdu=rldot1dStpPortFilterBpdu, rldot1dStpPortBpduGuardTable=rldot1dStpPortBpduGuardTable, rldot1dPriorityPortGroupNumber=rldot1dPriorityPortGroupNumber, rldot1dStpTrapVrblVID=rldot1dStpTrapVrblVID, rldot1dStpSeparatedBridges=rldot1dStpSeparatedBridges, rldot1dStpVlanTable=rldot1dStpVlanTable, rldot1dStpMonitorTime=rldot1dStpMonitorTime, rldot1sMstpExtPortInternalOperPathCost=rldot1sMstpExtPortInternalOperPathCost, rldot1pPriorityMapPort=rldot1pPriorityMapPort, rldot1dStpPortRole=rldot1dStpPortRole, rldot1wRStpForceVersionVlan=rldot1wRStpForceVersionVlan, rldot1pPriorityMapTable=rldot1pPriorityMapTable, rldot1dStpVlanPortEntry=rldot1dStpVlanPortEntry, rldot1dStpSeparatedBridgesPortEnable=rldot1dStpSeparatedBridgesPortEnable, rldot1sMstpInstancePortDesignatedRoot=rldot1sMstpInstancePortDesignatedRoot, rldot1sMstpInstanceEntry=rldot1sMstpInstanceEntry, rldot1sMstpVlanTable=rldot1sMstpVlanTable, PYSNMP_MODULE_ID=rlpBridgeMIBObjects, rldot1dPriority=rldot1dPriority, rldot1dStpPortBpduOperStatus=rldot1dStpPortBpduOperStatus, rldot1wRStpVlanEdgePortEntry=rldot1wRStpVlanEdgePortEntry, rldot1pPriorityMapState=rldot1pPriorityMapState, rldot1dStpPortDampEnable=rldot1dStpPortDampEnable, rldot1sMstpExtPortDesignatedRegionalRoot=rldot1sMstpExtPortDesignatedRegionalRoot, rldot1sMstpInstancePortTable=rldot1sMstpInstancePortTable, rldot1dStpType=rldot1dStpType, rldot1dStpPortDampStable=rldot1dStpPortDampStable, rldot1dStpPortEntry=rldot1dStpPortEntry, rldot1dStpVlanPortPathCost=rldot1dStpVlanPortPathCost, rldot1dStpEdgeportSupportInStp=rldot1dStpEdgeportSupportInStp, rldot1sMstpExtPortEntry=rldot1sMstpExtPortEntry, rldot1sMstpInstanceRootPort=rldot1sMstpInstanceRootPort, rldot1sMstpVlanEntry=rldot1sMstpVlanEntry, rldot1wRStp=rldot1wRStp, rldot1sMstpInstanceTopChanges=rldot1sMstpInstanceTopChanges, rldot1dStpVlanPortDesignatedCost=rldot1dStpVlanPortDesignatedCost, rldot1sMstpDesignatedMaxHopes=rldot1sMstpDesignatedMaxHopes, rldot1dStpHelloTime=rldot1dStpHelloTime, rldot1dPriorityMibVersion=rldot1dPriorityMibVersion, rldot1dStpTaggedFlooding=rldot1dStpTaggedFlooding, rldot1dStpPortBpduGuardEnable=rldot1dStpPortBpduGuardEnable, rldot1dStpEnable=rldot1dStpEnable, rldot1wRStpVlanEdgePortPort=rldot1wRStpVlanEdgePortPort, rldot1wRStpVlanEdgePortTable=rldot1wRStpVlanEdgePortTable, rldot1sMstpInstanceRemainingHopes=rldot1sMstpInstanceRemainingHopes, rldot1wRStpVlanEdgePortVlan=rldot1wRStpVlanEdgePortVlan, rldot1dStpPortToDefault=rldot1dStpPortToDefault, rldot1dStpLastChanged=rldot1dStpLastChanged, rldot1sMstpPendingAction=rldot1sMstpPendingAction, rldot1dStpRootCost=rldot1dStpRootCost, rldot1sMstpInstancePortDesignatedPort=rldot1sMstpInstancePortDesignatedPort, rldot1dStpForwardDelay=rldot1dStpForwardDelay, rldot1wRStpEdgePortStatus=rldot1wRStpEdgePortStatus, rldot1sMstpExtPortTable=rldot1sMstpExtPortTable, rldot1sMstpInstanceDesignatedRoot=rldot1sMstpInstanceDesignatedRoot, rldot1sMstpInstancePortEnable=rldot1sMstpInstancePortEnable, rldot1dStpVlanPortDesignatedRoot=rldot1dStpVlanPortDesignatedRoot, rldot1sMstpInstancePortDesignatedCost=rldot1sMstpInstancePortDesignatedCost, rldot1dStpTimeSinceTopologyChange=rldot1dStpTimeSinceTopologyChange, rldot1dStpVlanPortState=rldot1dStpVlanPortState, rldot1pPriorityMapPortList=rldot1pPriorityMapPortList, rldot1sMstpInstancePortMstiId=rldot1sMstpInstancePortMstiId, rldot1sMstpInstanceMaxAge=rldot1sMstpInstanceMaxAge, rldot1sMstpInstancePortEntry=rldot1sMstpInstancePortEntry, rldot1dStpPortBelongToVlanDefault=rldot1dStpPortBelongToVlanDefault, rldot1sMstpExtPortBoundary=rldot1sMstpExtPortBoundary, rldot1dStpEnableByDefault=rldot1dStpEnableByDefault, rldot1sMstpRemainingHops=rldot1sMstpRemainingHops, rldot1dStpFloodBpduMethod=rldot1dStpFloodBpduMethod, rldot1dStpSeparatedBridgesAutoConfig=rldot1dStpSeparatedBridgesAutoConfig, rldot1dStpPortRestrictedRole=rldot1dStpPortRestrictedRole, rldot1dStpTrapVariable=rldot1dStpTrapVariable, rldot1dStpVlanPortEnable=rldot1dStpVlanPortEnable, rldot1sMstpInstanceHelloTime=rldot1sMstpInstanceHelloTime, rldot1dStpSupportedType=rldot1dStpSupportedType, rldot1dStpLoopbackGuardEnable=rldot1dStpLoopbackGuardEnable, rldot1wRStpForceVersionTable=rldot1wRStpForceVersionTable, rldot1sMstpInstancePortState=rldot1sMstpInstancePortState, rldot1sMstpVlan=rldot1sMstpVlan, rldot1dStpPortAutoEdgePort=rldot1dStpPortAutoEdgePort, rldot1sMstpRevisionLevel=rldot1sMstpRevisionLevel, rldot1dStpFilterBpdu=rldot1dStpFilterBpdu, rldot1dStpVlanPortTable=rldot1dStpVlanPortTable, rldot1sMstpExtPortDesignatedRegionalCost=rldot1sMstpExtPortDesignatedRegionalCost, rldot1dStpVlanPortPort=rldot1dStpVlanPortPort, rldot1dStpPortMustBelongToVlan=rldot1dStpPortMustBelongToVlan)
def has_doi(bib_info): return "doi" in bib_info def get_doi(bib_info): return bib_info["doi"] def has_title(bib_info): return "title" in bib_info def get_title(bib_info): return bib_info["title"] def has_url(bib_info): return "url" in bib_info def get_url(bib_info): if "url" in bib_info: return bib_info["url"] else: return "" def has_author(bib_info): return "author" in bib_info def get_author(bib_info): return bib_info["author"]
def has_doi(bib_info): return 'doi' in bib_info def get_doi(bib_info): return bib_info['doi'] def has_title(bib_info): return 'title' in bib_info def get_title(bib_info): return bib_info['title'] def has_url(bib_info): return 'url' in bib_info def get_url(bib_info): if 'url' in bib_info: return bib_info['url'] else: return '' def has_author(bib_info): return 'author' in bib_info def get_author(bib_info): return bib_info['author']
payload_mass=5 payload_fairing_height=1 stage1_height=7.5 stage1_burnTime=74 stage1_propellant_mass=15000 stage1_engine_mass=1779 stage1_thrust=469054 stage1_isp=235.88175331294596 stage1_coastTime=51 stage2_height=3.35 stage2_burnTime=64 stage2_propellant_mass=5080 stage2_engine_mass=527 stage2_thrust=220345 stage2_isp=282.97655453618756 stage2_coastTime=164 stage3_height=2.1 stage3_burnTime=46 stage3_propellant_mass=1760 stage3_engine_mass=189 stage3_thrust=106212 stage3_isp=282.97655453618756 stage3_coastTime=50 outside_diameter=1.405 propulsion_modifier=0.02 voltage = 28.8
payload_mass = 5 payload_fairing_height = 1 stage1_height = 7.5 stage1_burn_time = 74 stage1_propellant_mass = 15000 stage1_engine_mass = 1779 stage1_thrust = 469054 stage1_isp = 235.88175331294596 stage1_coast_time = 51 stage2_height = 3.35 stage2_burn_time = 64 stage2_propellant_mass = 5080 stage2_engine_mass = 527 stage2_thrust = 220345 stage2_isp = 282.97655453618756 stage2_coast_time = 164 stage3_height = 2.1 stage3_burn_time = 46 stage3_propellant_mass = 1760 stage3_engine_mass = 189 stage3_thrust = 106212 stage3_isp = 282.97655453618756 stage3_coast_time = 50 outside_diameter = 1.405 propulsion_modifier = 0.02 voltage = 28.8
digit1 = 999 digit2 = 999 largestpal = 0 #always save the largest palindrome #nested loop for 3digit product while digit1 >= 1: while digit2 >= 1: #get string from int p1 = str(digit1 * digit2) #check string for palindrome by comparing first-last, etc. for i in range(0, (len(p1) - 1)): #no pal? go on if p1[i] != p1[len(p1)-i-1]: break #pal? save if larger than current elif i >= (len(p1)-1)/2: if largestpal < int(p1): largestpal = digit1 * digit2 print (largestpal) digit2 -= 1 digit1 -= 1 digit2 = 999 print (largestpal)
digit1 = 999 digit2 = 999 largestpal = 0 while digit1 >= 1: while digit2 >= 1: p1 = str(digit1 * digit2) for i in range(0, len(p1) - 1): if p1[i] != p1[len(p1) - i - 1]: break elif i >= (len(p1) - 1) / 2: if largestpal < int(p1): largestpal = digit1 * digit2 print(largestpal) digit2 -= 1 digit1 -= 1 digit2 = 999 print(largestpal)
class InvalidMoveException(Exception): pass class InvalidPlayerException(Exception): pass class InvalidGivenBallsException(Exception): pass class GameIsOverException(Exception): pass
class Invalidmoveexception(Exception): pass class Invalidplayerexception(Exception): pass class Invalidgivenballsexception(Exception): pass class Gameisoverexception(Exception): pass
while True: try: dinheiro = [] nota = input() cent = input() if(len(cent) < 2): cent += '0' cent = cent[::-1] dinheiro += '.' + cent print(dinheiro) except EOFError: break
while True: try: dinheiro = [] nota = input() cent = input() if len(cent) < 2: cent += '0' cent = cent[::-1] dinheiro += '.' + cent print(dinheiro) except EOFError: break
# import sys # from io import StringIO # # input_1 = """3, 6 # 7, 1, 3, 3, 2, 1 # 1, 3, 9, 8, 5, 6 # 4, 6, 7, 9, 1, 0 # """ # # sys.stdin = StringIO(input_1) rows, columns = [int(x) for x in input().split(", ")] matrix = [] sum_matrix = 0 for _ in range(rows): row = [int(x) for x in input().split(", ")] matrix.append(row) sum_matrix += sum(row) print(sum_matrix) print(matrix)
(rows, columns) = [int(x) for x in input().split(', ')] matrix = [] sum_matrix = 0 for _ in range(rows): row = [int(x) for x in input().split(', ')] matrix.append(row) sum_matrix += sum(row) print(sum_matrix) print(matrix)
''' Design a HashSet without using any built-in hash table libraries. To be specific, your design should include these functions: add(value): Insert a value into the HashSet. contains(value) : Return whether the value exists in the HashSet or not. remove(value): Remove a value in the HashSet. If the value does not exist in the HashSet, do nothing. Example: MyHashSet hashSet = new MyHashSet(); hashSet.add(1); hashSet.add(2); hashSet.contains(1); // returns true hashSet.contains(3); // returns false (not found) hashSet.add(2); hashSet.contains(2); // returns true hashSet.remove(2); hashSet.contains(2); // returns false (already removed) Note: All values will be in the range of [0, 1000000]. The number of operations will be in the range of [1, 10000]. Please do not use the built-in HashSet library. ''' class MyHashSet: def eval_hash(self, key): return ((key*1031237) & (1<<20) - 1)>>5 def __init__(self): self.a = [[] for _ in range(1<<15)] def add(self, key: int) -> None: pos = self.eval_hash(key) #calling function foa a key to generate a position using hash formula if key not in self.a[pos]: self.a[pos].append(key) def remove(self, key: int) -> None: pos = self.eval_hash(key) if key in self.a[pos]: self.a[pos].remove(key) def contains(self, key: int) -> bool: pos = self.eval_hash(key) print(pos,self.a[pos]) if key in self.a[pos]: return True return False ''' The idea is to have hash function in the following form. image Here we use the following notations: K is our number (key), we want to hash. a is some big odd number (sometimes good idea to use prime number) I choose a = 1031237 without any special reason, it is just random odd number. m is length in bits of output we wan to have. We are given, that we have no more than 10000 operations overall, so we can choose such m, so that 2^m > 10000. I chose m = 15, so in this case we have less collistions. if you go to wikipedia, you can read that w is size of machine word. Here we do not really matter, what is this size, we can choose any w > m. I chose m = 20. So, everything is ready for function eval_hash(key): ((key*1031237) & (1<<20) - 1)>>5. Here I also used trick for fast bit operation modulo 2^t: for any s: s % (2^t) = s & (1<<t) - 1.'''
""" Design a HashSet without using any built-in hash table libraries. To be specific, your design should include these functions: add(value): Insert a value into the HashSet. contains(value) : Return whether the value exists in the HashSet or not. remove(value): Remove a value in the HashSet. If the value does not exist in the HashSet, do nothing. Example: MyHashSet hashSet = new MyHashSet(); hashSet.add(1); hashSet.add(2); hashSet.contains(1); // returns true hashSet.contains(3); // returns false (not found) hashSet.add(2); hashSet.contains(2); // returns true hashSet.remove(2); hashSet.contains(2); // returns false (already removed) Note: All values will be in the range of [0, 1000000]. The number of operations will be in the range of [1, 10000]. Please do not use the built-in HashSet library. """ class Myhashset: def eval_hash(self, key): return (key * 1031237 & (1 << 20) - 1) >> 5 def __init__(self): self.a = [[] for _ in range(1 << 15)] def add(self, key: int) -> None: pos = self.eval_hash(key) if key not in self.a[pos]: self.a[pos].append(key) def remove(self, key: int) -> None: pos = self.eval_hash(key) if key in self.a[pos]: self.a[pos].remove(key) def contains(self, key: int) -> bool: pos = self.eval_hash(key) print(pos, self.a[pos]) if key in self.a[pos]: return True return False '\nThe idea is to have hash function in the following form.\nimage\n\nHere we use the following notations:\n\nK is our number (key), we want to hash.\na is some big odd number (sometimes good idea to use prime number) I choose a = 1031237 without any special reason, it is just random odd number.\nm is length in bits of output we wan to have. We are given, that we have no more than 10000 operations overall, so we can choose such m, so that 2^m > 10000. I chose m = 15, so in this case we have less collistions.\nif you go to wikipedia, you can read that w is size of machine word. Here we do not really matter, what is this size, we can choose any w > m. I chose m = 20.\nSo, everything is ready for function eval_hash(key): ((key*1031237) & (1<<20) - 1)>>5. Here I also used trick for fast bit operation modulo 2^t: for any s: s % (2^t) = s & (1<<t) - 1.'
# -*- coding: UTF-8 -*- class MyClass(object): def __init__(self): pass def __eq__(self, other): return type(self) == type(other) if __name__ == '__main__': print (MyClass()) print (MyClass()) print (MyClass() == MyClass()) print (MyClass() == 42)
class Myclass(object): def __init__(self): pass def __eq__(self, other): return type(self) == type(other) if __name__ == '__main__': print(my_class()) print(my_class()) print(my_class() == my_class()) print(my_class() == 42)
"""pandas-data-dictionary - Pandas extension adding data dictionary accessor for describing and validating data.""" __version__ = '0.1.0' __author__ = 'Tom Couch <t.couch@ucl.ac.uk>' __all__ = []
"""pandas-data-dictionary - Pandas extension adding data dictionary accessor for describing and validating data.""" __version__ = '0.1.0' __author__ = 'Tom Couch <t.couch@ucl.ac.uk>' __all__ = []
# 2020.08.02 # Problem Statement: # https://leetcode.com/problems/substring-with-concatenation-of-all-words/ class Solution: def findSubstring(self, s: str, words: List[str]) -> List[int]: # check if s is empty or words is empty if len(s) * len(words) == 0: return [] # length is the total length of words # word_length is the length per word in words (all the same) # word_dict is the hash table to store words and their occurance times length = len(words) * len(words[0]) word_length = len(words[0]) word_dict = {} # initialize the occurances to all 0 for word in words: word_dict[word] = 0 # calculate for occurance times for word in words: word_dict[word] = word_dict[word] + 1 # do a deep copy for word_dict word_dict_copy = deepcopy(word_dict) # initialize answer to return answer = [] # start index can be any index between [0, len(s)-length] for start in range(0, len(s)-length+1): # if this substring is legal add = True # check all the potential matched words in substring for word_index in range(0, len(words)): # get the single word word = s[start+word_index*word_length: start+(word_index+1)*word_length] # not match, this substring should not count if word not in word_dict.keys(): add = False break # match else: # check occurance time, should have 1 less occurance time remaining word_dict[word] = word_dict[word] - 1 # exceed the occurance times if word_dict[word] < 0: add = False break # add the result if add: answer.append(start) # get back the orginal word_dict word_dict = deepcopy(word_dict_copy) return answer
class Solution: def find_substring(self, s: str, words: List[str]) -> List[int]: if len(s) * len(words) == 0: return [] length = len(words) * len(words[0]) word_length = len(words[0]) word_dict = {} for word in words: word_dict[word] = 0 for word in words: word_dict[word] = word_dict[word] + 1 word_dict_copy = deepcopy(word_dict) answer = [] for start in range(0, len(s) - length + 1): add = True for word_index in range(0, len(words)): word = s[start + word_index * word_length:start + (word_index + 1) * word_length] if word not in word_dict.keys(): add = False break else: word_dict[word] = word_dict[word] - 1 if word_dict[word] < 0: add = False break if add: answer.append(start) word_dict = deepcopy(word_dict_copy) return answer
print("hello") print("hello") print("hello") print("hello") print("It's me") print("I'm here")
print('hello') print('hello') print('hello') print('hello') print("It's me") print("I'm here")
class CourseType(): __doc__ = "Type of degree, e.g. BA, BEng, BSc" possibleCourseTypes = ["BA", "BSc"] #TODO extend to values from http://typesofdegrees.org/ def __init__(self, name, accepts, singleHons = 0, jointHons = 0): if self.checkName(name): self._name = name self.accepts = accepts self.singleHons = singleHons self.jointHons = jointHons @property def name(self): return self._name @name.setter def name(self, value): if self.checkName(value): self._name = name # Must be one of possibleCourseTypes def checkName(self, name): if (name in self.possibleCourseTypes): return True else: raise ValueError("Name must be one of: ", self.possibleCourseTypes)
class Coursetype: __doc__ = 'Type of degree, e.g. BA, BEng, BSc' possible_course_types = ['BA', 'BSc'] def __init__(self, name, accepts, singleHons=0, jointHons=0): if self.checkName(name): self._name = name self.accepts = accepts self.singleHons = singleHons self.jointHons = jointHons @property def name(self): return self._name @name.setter def name(self, value): if self.checkName(value): self._name = name def check_name(self, name): if name in self.possibleCourseTypes: return True else: raise value_error('Name must be one of: ', self.possibleCourseTypes)
#Given an array of integers, return the 3rd Maximum Number in this array, if it doesn't exist, return the Maximum Number. The time complexity must be O(n) or less. class Solution(object): def thirdMax(self, nums): """ :type nums: List[int] :rtype: int """ a=b=c=-pow(10, 18) nums=set(nums) for i in nums: if i>=a: c,b,a=b,a,i elif i>=b: c,b=b,i elif i>=c: c=i return c if len(nums)>2 else max(nums)
class Solution(object): def third_max(self, nums): """ :type nums: List[int] :rtype: int """ a = b = c = -pow(10, 18) nums = set(nums) for i in nums: if i >= a: (c, b, a) = (b, a, i) elif i >= b: (c, b) = (b, i) elif i >= c: c = i return c if len(nums) > 2 else max(nums)
def collatz_len(n): ct = 1 while n != 1: if n % 2 == 0: n = n/2 else: n = 3*n+1 ct += 1 return ct len_max = i_max = 0 for i in range(1, 1000001): current_len = collatz_len(i) if current_len > len_max: len_max = current_len i_max = i print(i_max)
def collatz_len(n): ct = 1 while n != 1: if n % 2 == 0: n = n / 2 else: n = 3 * n + 1 ct += 1 return ct len_max = i_max = 0 for i in range(1, 1000001): current_len = collatz_len(i) if current_len > len_max: len_max = current_len i_max = i print(i_max)
# Sorts a Python list in ascending order using the quick sort # algorithm def quickSort(theList): n = len(theList) recQuickSort(theList, 0, n-1) # The recursive "in-place" implementation def recQuickSort(theList, first, last): # Check the base case (range is trivially sorted) if first >= last: return else: # Partition the list and obtain the pivot position pos = partitionSeq(theList, first, last) # Repeat the process on the two sublists recQuickSort(theList, first, pos - 1) recQuickSort(theList, pos + 1, last) # Partitions the list using the first key as the pivot def partitionSeq(theList, first, last): # Save a copy of the pivot value. pivot = theList[first] # first element of range is pivot # Find the pivot position and move the elements around it left = first + 1 # will scan rightward right = last # will scan leftward while left <= right: # Scan until reaches value equal or larger than pivot (or # right marker) while left <= right and theList[left] < pivot: left += 1 # Scan until reaches value equal or smaller than pivot (or # left marker) while left <= right and theList[right] > pivot: right -= 1 # Scans did not strictly cross if left <= right: # swap values theList[left], theList[right] = theList[right], theList[left] # Shrink range (Recursion: Progress towards base case) left += 1 right -= 1 # Put the pivot in the proper position (marked by the right index) theList[first] , theList[right] = theList[right] , pivot # Return the index position of the pivot value. return right # Test code list_of_numbers = [12, 7, 9, 24, 7, 29, 5, 3, 11, 7] print('Input List:', list_of_numbers) quickSort(list_of_numbers) print('Sorted List:', list_of_numbers)
def quick_sort(theList): n = len(theList) rec_quick_sort(theList, 0, n - 1) def rec_quick_sort(theList, first, last): if first >= last: return else: pos = partition_seq(theList, first, last) rec_quick_sort(theList, first, pos - 1) rec_quick_sort(theList, pos + 1, last) def partition_seq(theList, first, last): pivot = theList[first] left = first + 1 right = last while left <= right: while left <= right and theList[left] < pivot: left += 1 while left <= right and theList[right] > pivot: right -= 1 if left <= right: (theList[left], theList[right]) = (theList[right], theList[left]) left += 1 right -= 1 (theList[first], theList[right]) = (theList[right], pivot) return right list_of_numbers = [12, 7, 9, 24, 7, 29, 5, 3, 11, 7] print('Input List:', list_of_numbers) quick_sort(list_of_numbers) print('Sorted List:', list_of_numbers)
class Commitment(object): """ Abstraction from the messages.Commitment Purpose: don't mix messaging logic with internal logic Expect that the `protocol.send()` takes an instance of Commitment and constructs the message by itself. On incoming messages, the protocol will use the `Commitment.from_message(msg)` to construct a Commitment Bottom line: don't worry about messages, but use this class instead! """ def __init__(self, amount, offer_id, timeout, signature, sender): self.amount = amount self.offer = offer_id self.timeout = timeout self.sender = sender self.signature = signature @classmethod def from_message(cls, message): offer_id = message.offer_id timeout = message.timeout amount = message.amount signature = message.signature sender = message.sender return cls(amount, offer_id, timeout, signature, sender) class SwapExecution(object): """ Abstraction from the messages.SwapExecution Purpose: don't mix messaging logic with internal logic Expect that the `protocol.send()` takes an instance of SwapExecution and constructs the message by itself. On incoming messages, the protocol will use the `SwapExecution.from_message(msg)` to construct a SwapExecution Bottom line: don't worry about messages, but use this class instead! """ def __init__(self, offer_id, timestamp, sender): self.offer_id = offer_id self.timestamp = timestamp self.sender = sender @classmethod def from_message(cls, message): offer_id = message.offer_id timestamp = message.timestamp sender = message.sender return cls(offer_id, timestamp, sender)
class Commitment(object): """ Abstraction from the messages.Commitment Purpose: don't mix messaging logic with internal logic Expect that the `protocol.send()` takes an instance of Commitment and constructs the message by itself. On incoming messages, the protocol will use the `Commitment.from_message(msg)` to construct a Commitment Bottom line: don't worry about messages, but use this class instead! """ def __init__(self, amount, offer_id, timeout, signature, sender): self.amount = amount self.offer = offer_id self.timeout = timeout self.sender = sender self.signature = signature @classmethod def from_message(cls, message): offer_id = message.offer_id timeout = message.timeout amount = message.amount signature = message.signature sender = message.sender return cls(amount, offer_id, timeout, signature, sender) class Swapexecution(object): """ Abstraction from the messages.SwapExecution Purpose: don't mix messaging logic with internal logic Expect that the `protocol.send()` takes an instance of SwapExecution and constructs the message by itself. On incoming messages, the protocol will use the `SwapExecution.from_message(msg)` to construct a SwapExecution Bottom line: don't worry about messages, but use this class instead! """ def __init__(self, offer_id, timestamp, sender): self.offer_id = offer_id self.timestamp = timestamp self.sender = sender @classmethod def from_message(cls, message): offer_id = message.offer_id timestamp = message.timestamp sender = message.sender return cls(offer_id, timestamp, sender)
class Time: max_hours = 23 max_minutes = 59 max_seconds = 59 def __init__(self, hours: int, minutes: int, seconds: int): self.hours = hours self.minutes = minutes self.seconds = seconds def set_time(self, hours, minutes, seconds): self.hours = hours self.minutes = minutes self.seconds = seconds def get_time(self): hh = str(self.hours) mm = str(self.minutes) ss = str(self.seconds) return f"{hh.zfill(2)}:{mm.zfill(2)}:{ss.zfill(2)}" def next_second(self): self.seconds = (self.seconds + 1) % 60 self.minutes = (self.minutes + int(self.seconds == 0)) % 60 self.hours = (self.hours + int(self.minutes == 0 and self.seconds == 0)) % 24 return self.get_time() # time = Time(9, 30, 59) # print(time.next_second()) # time = Time(10, 59, 59) # print(time.next_second()) time = Time(24, 59, 59) print(time.get_time()) print(time.next_second()) print(time.next_second()) print(time.next_second()) print(time.next_second()) print(time.next_second()) print(time.next_second())
class Time: max_hours = 23 max_minutes = 59 max_seconds = 59 def __init__(self, hours: int, minutes: int, seconds: int): self.hours = hours self.minutes = minutes self.seconds = seconds def set_time(self, hours, minutes, seconds): self.hours = hours self.minutes = minutes self.seconds = seconds def get_time(self): hh = str(self.hours) mm = str(self.minutes) ss = str(self.seconds) return f'{hh.zfill(2)}:{mm.zfill(2)}:{ss.zfill(2)}' def next_second(self): self.seconds = (self.seconds + 1) % 60 self.minutes = (self.minutes + int(self.seconds == 0)) % 60 self.hours = (self.hours + int(self.minutes == 0 and self.seconds == 0)) % 24 return self.get_time() time = time(24, 59, 59) print(time.get_time()) print(time.next_second()) print(time.next_second()) print(time.next_second()) print(time.next_second()) print(time.next_second()) print(time.next_second())
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isValidBST(self, root: Optional[TreeNode]) -> bool: def subfun(root, minimal, maximal): if not root: return if root.val >= maximal or root.val <= minimal: self.out = False else: subfun(root.left, minimal, root.val) if self.out: subfun(root.right, root.val, maximal) self.out = True subfun(root, -inf, inf) return self.out
class Solution: def is_valid_bst(self, root: Optional[TreeNode]) -> bool: def subfun(root, minimal, maximal): if not root: return if root.val >= maximal or root.val <= minimal: self.out = False else: subfun(root.left, minimal, root.val) if self.out: subfun(root.right, root.val, maximal) self.out = True subfun(root, -inf, inf) return self.out
# Lambda funkcie # # Tato sekcia sluzi na precvicenie si lambda vyrazov # # Uloha 1: def make_square(): return(lambda x: x*x) # Uloha 2: def make_upper(): return(lambda x: x.upper()) # Uloha 3: def make_power(): return(lambda x, N: x ** N) # Uloha 4: def make_power2(N): return(lambda x: x ** N) # Uloha 5: def call_name(): return(lambda x, name: getattr(x, name)())
def make_square(): return lambda x: x * x def make_upper(): return lambda x: x.upper() def make_power(): return lambda x, N: x ** N def make_power2(N): return lambda x: x ** N def call_name(): return lambda x, name: getattr(x, name)()
def forever2(): pass forever(forever2)
def forever2(): pass forever(forever2)
IMU_BUS = 2 # MPU9250 Default I2C slave address MPU_DEFAULT_I2C_ADDR = 0x68 """ register offsets """ SMPLRT_DIV = 0x19 CONFIG = 0x1A GYRO_CONFIG = 0x1B ACCEL_CONFIG = 0x1C ACCEL_CONFIG_2 = 0x1D INT_PIN_CFG = 0x37 ACCEL_XOUT_H = 0x3B ACCEL_XOUT_L = 0x3C ACCEL_YOUT_H = 0x3D ACCEL_YOUT_L = 0x3E ACCEL_ZOUT_H = 0x3F ACCEL_ZOUT_L = 0x40 TEMP_OUT_H = 0x41 TEMP_OUT_L = 0x42 GYRO_XOUT_H = 0x43 GYRO_XOUT_L = 0x44 GYRO_YOUT_H = 0x45 GYRO_YOUT_L = 0x46 GYRO_ZOUT_H = 0x47 GYRO_ZOUT_L = 0x48 USER_CTRL = 0x6A PWR_MGMT_1 = 0x6B PWR_MGMT_2 = 0x6C WHO_AM_I_MPU9250 = 0x71 """ CONFIG register bits """ FIFO_MODE_REPLACE_OLD = 0 FIFO_MODE_KEEP_OLD = 0x01 << 6 EXT_SYNC_SET_DISABLE = 0 """ ACCEL_CONFIG register bits """ AX_ST_EN = 0x01 << 7 AY_ST_EN = 0x01 << 6 AZ_ST_EN = 0x01 << 5 ACCEL_FSR_CFG_2G = 0x00 << 3 ACCEL_FSR_CFG_4G = 0x01 << 3 ACCEL_FSR_CFG_8G = 0x02 << 3 ACCEL_FSR_CFG_16G = 0x03 << 3 """ * ACCEL_CONFIG2 register bits """ ACCEL_FCHOICE_1KHZ = 0x00 << 3 ACCEL_FCHOICE_4KHZ = 0x01 << 3 """ INT_PIN_CFG """ ACTL_ACTIVE_LOW = 0x01 << 7 ACTL_ACTIVE_HIGH = 0 INT_OPEN_DRAIN = 0 INT_PUSH_PULL = 0x00 << 6 LATCH_INT_EN = 0x01 << 5 INT_ANYRD_CLEAR = 0x01 << 4 ACTL_FSYNC_ACTIVE_LOW = 0x01 << 3 ACTL_FSYNC_ACTIVE_HIGH = 0x00 << 3 FSYNC_INT_MODE_EN = 0x01 << 2 FSYNC_INT_MODE_DIS = 0x00 << 2 BYPASS_EN = 0x01 << 1 """ GYRO_CONFIG register bits """ XGYRO_CTEN = 0x01 << 7 YGYRO_CTEN = 0x01 << 6 ZGYRO_CTEN = 0x01 << 5 GYRO_FSR_CFG_250 = 0x00 << 3 GYRO_FSR_CFG_500 = 0x01 << 3 GYRO_FSR_CFG_1000 = 0x02 << 3 GYRO_FSR_CFG_2000 = 0x03 << 3 FCHOICE_B_DLPF_EN = 0x00 FCHOICE_B_DLPF_DISABLE = 0x01 """ PWR_MGMT_1 register settings """ H_RESET = 0x01 << 7 MPU_SLEEP = 0x01 << 6 MPU_CYCLE = 0x01 << 5 """ temperature reading constants """ ROOM_TEMP_OFFSET = 0x00 TEMP_SENSITIVITY = 333.87 """ USER_CTRL settings bits """ FIFO_EN_BIT = 0x01 << 6 I2C_MST_EN = 0x01 << 5 I2C_IF_DIS = 0x01 << 4 FIFO_RST = 0x01 << 2 I2C_MST_RST = 0x01 << 1 SIG_COND_RST = 0x01 """ Magnetometer Registers """ AK8963_ADDR = 0x0C WHO_AM_I_AK8963 = 0x48 INFO = 0x01 AK8963_ST1 = 0x02 AK8963_XOUT_L = 0x03 AK8963_XOUT_H = 0x04 AK8963_YOUT_L = 0x05 AK8963_YOUT_H = 0x06 AK8963_ZOUT_L = 0x07 AK8963_ZOUT_H = 0x08 AK8963_ST2 = 0x09 AK8963_CNTL = 0x0A AK8963_ASTC = 0x0C AK8963_I2CDIS = 0x0F AK8963_ASAX = 0x10 AK8963_ASAY = 0x11 AK8963_ASAZ = 0x12 """ Magnetometer AK8963_CNTL register Settings """ MAG_POWER_DN = 0x00 MAG_SINGLE_MES = 0x01 MAG_CONT_MES_1 = 0x02 MAG_CONT_MES_2 = 0x06 MAG_EXT_TRIG = 0x04 MAG_SELF_TEST = 0x08 MAG_FUSE_ROM = 0x0F MSCALE_16 = 0x01 << 4 MSCALE_14 = 0x00 """ Magnetometer AK8963_ST2 register definitions """ MAGNETOMETER_SATURATION = 0x01 << 3 """ Magnetometer AK8963_ST1 register definitions """ MAG_DATA_READY = 0x01 """ Magnetometer sensitivity in micro Teslas to LSB """ MAG_RAW_TO_uT = 4912.0 / 32760.0 BIT_I2C_MST_VDDIO = 0x80 BIT_FIFO_EN = 0x40 BIT_DMP_EN = 0x80 BIT_FIFO_RST = 0x04 BIT_DMP_RST = 0x08 BIT_FIFO_OVERFLOW = 0x10 BIT_DATA_RDY_EN = 0x01 BIT_DMP_INT_EN = 0x02 BIT_MOT_INT_EN = 0x40 BITS_FSR = 0x18 BITS_LPF = 0x07 BITS_HPF = 0x07 BITS_CLK = 0x07 BIT_FIFO_SIZE_1024 = 0x40
imu_bus = 2 mpu_default_i2_c_addr = 104 '\nregister offsets\n' smplrt_div = 25 config = 26 gyro_config = 27 accel_config = 28 accel_config_2 = 29 int_pin_cfg = 55 accel_xout_h = 59 accel_xout_l = 60 accel_yout_h = 61 accel_yout_l = 62 accel_zout_h = 63 accel_zout_l = 64 temp_out_h = 65 temp_out_l = 66 gyro_xout_h = 67 gyro_xout_l = 68 gyro_yout_h = 69 gyro_yout_l = 70 gyro_zout_h = 71 gyro_zout_l = 72 user_ctrl = 106 pwr_mgmt_1 = 107 pwr_mgmt_2 = 108 who_am_i_mpu9250 = 113 '\nCONFIG register bits\n' fifo_mode_replace_old = 0 fifo_mode_keep_old = 1 << 6 ext_sync_set_disable = 0 '\nACCEL_CONFIG register bits\n' ax_st_en = 1 << 7 ay_st_en = 1 << 6 az_st_en = 1 << 5 accel_fsr_cfg_2_g = 0 << 3 accel_fsr_cfg_4_g = 1 << 3 accel_fsr_cfg_8_g = 2 << 3 accel_fsr_cfg_16_g = 3 << 3 '\n* ACCEL_CONFIG2 register bits\n' accel_fchoice_1_khz = 0 << 3 accel_fchoice_4_khz = 1 << 3 '\nINT_PIN_CFG\n' actl_active_low = 1 << 7 actl_active_high = 0 int_open_drain = 0 int_push_pull = 0 << 6 latch_int_en = 1 << 5 int_anyrd_clear = 1 << 4 actl_fsync_active_low = 1 << 3 actl_fsync_active_high = 0 << 3 fsync_int_mode_en = 1 << 2 fsync_int_mode_dis = 0 << 2 bypass_en = 1 << 1 '\nGYRO_CONFIG register bits\n' xgyro_cten = 1 << 7 ygyro_cten = 1 << 6 zgyro_cten = 1 << 5 gyro_fsr_cfg_250 = 0 << 3 gyro_fsr_cfg_500 = 1 << 3 gyro_fsr_cfg_1000 = 2 << 3 gyro_fsr_cfg_2000 = 3 << 3 fchoice_b_dlpf_en = 0 fchoice_b_dlpf_disable = 1 '\nPWR_MGMT_1 register settings\n' h_reset = 1 << 7 mpu_sleep = 1 << 6 mpu_cycle = 1 << 5 '\ntemperature reading constants\n' room_temp_offset = 0 temp_sensitivity = 333.87 '\nUSER_CTRL settings bits\n' fifo_en_bit = 1 << 6 i2_c_mst_en = 1 << 5 i2_c_if_dis = 1 << 4 fifo_rst = 1 << 2 i2_c_mst_rst = 1 << 1 sig_cond_rst = 1 '\nMagnetometer Registers\n' ak8963_addr = 12 who_am_i_ak8963 = 72 info = 1 ak8963_st1 = 2 ak8963_xout_l = 3 ak8963_xout_h = 4 ak8963_yout_l = 5 ak8963_yout_h = 6 ak8963_zout_l = 7 ak8963_zout_h = 8 ak8963_st2 = 9 ak8963_cntl = 10 ak8963_astc = 12 ak8963_i2_cdis = 15 ak8963_asax = 16 ak8963_asay = 17 ak8963_asaz = 18 '\nMagnetometer AK8963_CNTL register Settings\n' mag_power_dn = 0 mag_single_mes = 1 mag_cont_mes_1 = 2 mag_cont_mes_2 = 6 mag_ext_trig = 4 mag_self_test = 8 mag_fuse_rom = 15 mscale_16 = 1 << 4 mscale_14 = 0 '\nMagnetometer AK8963_ST2 register definitions\n' magnetometer_saturation = 1 << 3 '\nMagnetometer AK8963_ST1 register definitions\n' mag_data_ready = 1 '\nMagnetometer sensitivity in micro Teslas to LSB\n' mag_raw_to_u_t = 4912.0 / 32760.0 bit_i2_c_mst_vddio = 128 bit_fifo_en = 64 bit_dmp_en = 128 bit_fifo_rst = 4 bit_dmp_rst = 8 bit_fifo_overflow = 16 bit_data_rdy_en = 1 bit_dmp_int_en = 2 bit_mot_int_en = 64 bits_fsr = 24 bits_lpf = 7 bits_hpf = 7 bits_clk = 7 bit_fifo_size_1024 = 64
def retrieve_page(page): if page > 3: return {"next_page": None, "items": []} return {"next_page": page + 1, "items": ["A", "B", "C"]} items = [] page = 1 while page is not None: page_result = retrieve_page(page) items += page_result["items"] page = page_result["next_page"] print(items) # ["A", "B", "C", "A", "B", "C", "A", "B", "C"]
def retrieve_page(page): if page > 3: return {'next_page': None, 'items': []} return {'next_page': page + 1, 'items': ['A', 'B', 'C']} items = [] page = 1 while page is not None: page_result = retrieve_page(page) items += page_result['items'] page = page_result['next_page'] print(items)
# SIEL type compliance cases require a specific control code prefixes. currently: (0 to 9)D, (0 to 9)E, ML21, ML22. COMPLIANCE_CASE_ACCEPTABLE_GOOD_CONTROL_CODES = "(^[0-9][DE].*$)|(^ML21.*$)|(^ML22.*$)" class ComplianceVisitTypes: FIRST_CONTACT = "first_contact" FIRST_VISIT = "first_visit" ROUTINE_VISIT = "routine_visit" REVISIT = "revisit" choices = [ (FIRST_CONTACT, "First contact"), (FIRST_VISIT, "First visit"), (ROUTINE_VISIT, "Routine visit"), (REVISIT, "Revisit"), ] @classmethod def to_str(cls, visit_type): return next(choice[1] for choice in cls.choices if choice[0] == visit_type) class ComplianceRiskValues: VERY_LOW = "very_low" LOWER = "lower" MEDIUM = "medium" HIGHER = "higher" HIGHEST = "highest" choices = ( (VERY_LOW, "Very low risk"), (LOWER, "Lower risk"), (MEDIUM, "Medium risk"), (HIGHER, "Higher risk"), (HIGHEST, "Highest risk"), ) @classmethod def to_str(cls, risk_value): for value, label in cls.choices: if value == risk_value: return label return ""
compliance_case_acceptable_good_control_codes = '(^[0-9][DE].*$)|(^ML21.*$)|(^ML22.*$)' class Compliancevisittypes: first_contact = 'first_contact' first_visit = 'first_visit' routine_visit = 'routine_visit' revisit = 'revisit' choices = [(FIRST_CONTACT, 'First contact'), (FIRST_VISIT, 'First visit'), (ROUTINE_VISIT, 'Routine visit'), (REVISIT, 'Revisit')] @classmethod def to_str(cls, visit_type): return next((choice[1] for choice in cls.choices if choice[0] == visit_type)) class Complianceriskvalues: very_low = 'very_low' lower = 'lower' medium = 'medium' higher = 'higher' highest = 'highest' choices = ((VERY_LOW, 'Very low risk'), (LOWER, 'Lower risk'), (MEDIUM, 'Medium risk'), (HIGHER, 'Higher risk'), (HIGHEST, 'Highest risk')) @classmethod def to_str(cls, risk_value): for (value, label) in cls.choices: if value == risk_value: return label return ''
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def mergeInBetween(self, list1: ListNode, a: int, b: int, list2: ListNode) -> ListNode: k=-1 pre=ListNode(-1000,list1) x=ListNode() y=ListNode() while pre: if pre.next and k==a-1: x=pre while k!=b: pre=pre.next k+=1 y=pre.next k+=1 pre=pre.next x.next=list2 print(x.val,y.val) while list2: if list2.next: list2=list2.next else: list2.next=y break return list1
class Solution: def merge_in_between(self, list1: ListNode, a: int, b: int, list2: ListNode) -> ListNode: k = -1 pre = list_node(-1000, list1) x = list_node() y = list_node() while pre: if pre.next and k == a - 1: x = pre while k != b: pre = pre.next k += 1 y = pre.next k += 1 pre = pre.next x.next = list2 print(x.val, y.val) while list2: if list2.next: list2 = list2.next else: list2.next = y break return list1
class Stack: def __init__(self): self.items = [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self): return self.items[-1] def size(self): return len(self.items) def get_max(self): return max(self.items) def is_correct_bracket_seq(line): if len(line) % 2 != 0: return False stack = Stack() # opening_brackets = ('{','[','(') opening_brackets = { '{': 0, '[': 1, '(': 2 } # closing_brackets = ('}',']',')') closing_brackets = { '}': 0, ']': 1, ')': 2 } for ch in line: if ch in closing_brackets.keys() and stack.size() == 0: return False if ch in opening_brackets.keys(): stack.push(ch) if ch in closing_brackets.keys(): index_stack = opening_brackets[stack.peek()] index_new = closing_brackets[ch] # print(stack.peek(), ch) if index_new != index_stack: return False else: stack.pop() return True def main(): line = input().strip() print(is_correct_bracket_seq(line)) main()
class Stack: def __init__(self): self.items = [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self): return self.items[-1] def size(self): return len(self.items) def get_max(self): return max(self.items) def is_correct_bracket_seq(line): if len(line) % 2 != 0: return False stack = stack() opening_brackets = {'{': 0, '[': 1, '(': 2} closing_brackets = {'}': 0, ']': 1, ')': 2} for ch in line: if ch in closing_brackets.keys() and stack.size() == 0: return False if ch in opening_brackets.keys(): stack.push(ch) if ch in closing_brackets.keys(): index_stack = opening_brackets[stack.peek()] index_new = closing_brackets[ch] if index_new != index_stack: return False else: stack.pop() return True def main(): line = input().strip() print(is_correct_bracket_seq(line)) main()
def palindrome(word, index): left = index right = len(word) - 1 - index if left >= right: return f"{word} is a palindrome" right_letter = word[len(word)-1-index] left_letter = word[index] if left_letter != right_letter: return f"{word} is not a palindrome" return palindrome(word, index + 1) print(palindrome("abcba", 0)) print((palindrome("peter", 0)))
def palindrome(word, index): left = index right = len(word) - 1 - index if left >= right: return f'{word} is a palindrome' right_letter = word[len(word) - 1 - index] left_letter = word[index] if left_letter != right_letter: return f'{word} is not a palindrome' return palindrome(word, index + 1) print(palindrome('abcba', 0)) print(palindrome('peter', 0))
# # PySNMP MIB module CISCO-HEALTH-MONITOR-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-HEALTH-MONITOR-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:59:45 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") entPhysicalIndex, = mibBuilder.importSymbols("ENTITY-MIB", "entPhysicalIndex") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") ModuleIdentity, TimeTicks, Bits, iso, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, MibIdentifier, IpAddress, Counter32, Unsigned32, Gauge32, Integer32, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "TimeTicks", "Bits", "iso", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "MibIdentifier", "IpAddress", "Counter32", "Unsigned32", "Gauge32", "Integer32", "Counter64") TruthValue, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "DisplayString", "TextualConvention") ciscoHealthMonitorMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 243)) ciscoHealthMonitorMIB.setRevisions(('2003-09-12 12:30',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoHealthMonitorMIB.setRevisionsDescriptions(('Initial version of this MIB module.',)) if mibBuilder.loadTexts: ciscoHealthMonitorMIB.setLastUpdated('200309121230Z') if mibBuilder.loadTexts: ciscoHealthMonitorMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoHealthMonitorMIB.setContactInfo(' Cisco Systems Customer Service Postal: 170 W. Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-healthmonitor@cisco.com') if mibBuilder.loadTexts: ciscoHealthMonitorMIB.setDescription("Health Monitor MIB module. The Health Monitor uses a model based on events of varying severity and frequency, and predefined rules, to generate a metric that represents a system's (and its subsystems') level of health. The events are typically internally generated notifications in response to detrimental or correctional changes in the state of the hardware or software of the system. Detrimental events are classified under one of the following severity levels: Catastrophic - Causes or leads to system failure Critical - Major subsystem or functionality failure High - Potential for major impact to important functions Medium - Potential for minor impact to functionality Low - Negligible impact to functionality Whilst correctional events fall under the following classification: Positive - Not a fault event. May cause or lead to the return of functionality This MIB module provides information for tracking occurrences of the above events, and presents the associated health metric for the system and its component subsystems.") ciscoHealthMonitorMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 243, 1)) class HealthLevel(TextualConvention, Gauge32): description = 'Reflects the health of a system or subsystem based on system events and predefined rules, expressed as a percentage. The UNITS clause associated with each object will indicate the degree of precision.' status = 'current' subtypeSpec = Gauge32.subtypeSpec + ValueRangeConstraint(0, 10000) ciscoHealthMonitorTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1), ) if mibBuilder.loadTexts: ciscoHealthMonitorTable.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorTable.setDescription('This table contains Health Monitor statistics for physical entities and their constituent hardware and/or software subsystems. The Health Monitor statistics present in each row provide information such as the computed health of the indicated subsystem and the number of faults it has experienced.') ciscoHealthMonitorEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"), (1, "CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorSubsysName")) if mibBuilder.loadTexts: ciscoHealthMonitorEntry.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorEntry.setDescription('A Health Monitor statistics entry. The entPhysicalIndex identifies the physical entity (chassis or container), while the ciscoHealthMonitorSubsysName identifies by name the appropriate subsystem for which these statistics apply. If there are other entities such as peer routers or line cards then, in the context of this MIB, these are also defined to be in the same system. If these entities also run an instance of the Health Monitor then the summary information from the distributed Health Monitors is obtained here.') ciscoHealthMonitorSubsysName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 128))) if mibBuilder.loadTexts: ciscoHealthMonitorSubsysName.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorSubsysName.setDescription("A textual string containing the name of the hardware or software subsystem. A management station wishing to obtain summary statistics for a physical entity should use a value of 'system' for this object.") ciscoHealthMonitorHealth = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 2), HealthLevel()).setUnits('0.01 percent').setMaxAccess("readonly") if mibBuilder.loadTexts: ciscoHealthMonitorHealth.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHealth.setDescription('The computed current health of this subsystem on the specified entity. This health metric is based on predefined rules that specify how the health should be adjusted in response to certain events of varying severity and frequency. As these events are encountered by each subsystem or physical entity, the appropriate rules are applied and the health is modified accordingly.') ciscoHealthMonitorHealthNotifyEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 3), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyEnable.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyEnable.setDescription('Enables or disables health level notifications. When set to true(1), the ciscoHealthMonitorHealthLevel notification is enabled. When set to false(0), the ciscoHealthMonitorHealthLevel notification is disabled. If such a notification is desired, it is the responsibility of the management entity to ensure that the SNMP administrative model is configured in such a way as to allow the notification to be delivered.') ciscoHealthMonitorHealthNotifyHighThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 4), HealthLevel().clone(10000)).setUnits('0.01 percent').setMaxAccess("readwrite") if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyHighThreshold.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyHighThreshold.setDescription('Specifies the health level at which a ciscoHealthMonitorHealthLevel notification will be generated for the specified subsystem and entity. A notification will only be generated if the health level had previously reached the low threshold level prior to reaching this high threshold level. Health levels oscillating within the high and the low threshold levels do not generate notifications. A health level going from low threshold (or below) to high threshold (or above) represents a return to normal health for the specified subsystem. Set your optimal health level to this threshold.') ciscoHealthMonitorHealthNotifyLowThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 5), HealthLevel()).setUnits('0.01 percent').setMaxAccess("readwrite") if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyLowThreshold.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyLowThreshold.setDescription('Specifies the health level at which a ciscoHealthMonitorHealthLevel notification will be generated for the specified subsystem and entity. A notification will only be generated if the health level had previously reached the high threshold level prior to reaching this low threshold level. Health levels oscillating within the high and the low threshold levels do not generate notifications. A health level going from high threshold (or above) to low threshold (or below) represents a deterioration of the health for the specified subsystem. Set your unacceptable health level to this threshold.') ciscoHealthMonitorCatastrophicFaults = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ciscoHealthMonitorCatastrophicFaults.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorCatastrophicFaults.setDescription('The number of catastrophic faults that have occurred in this subsystem on the specified entity since the system was initialized.') ciscoHealthMonitorCriticalFaults = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ciscoHealthMonitorCriticalFaults.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorCriticalFaults.setDescription('The number of critical faults that have occurred in this subsystem on the specified entity since the system was initialized.') ciscoHealthMonitorHighSeverityFaults = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ciscoHealthMonitorHighSeverityFaults.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHighSeverityFaults.setDescription('The number of high severity faults that have occurred in this subsystem on the specified entity since the system was initialized.') ciscoHealthMonitorMediumSeverityFaults = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ciscoHealthMonitorMediumSeverityFaults.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorMediumSeverityFaults.setDescription('The number of medium severity faults that have occurred in this subsystem on the specified entity since the system was initialized.') ciscoHealthMonitorLowSeverityFaults = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ciscoHealthMonitorLowSeverityFaults.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorLowSeverityFaults.setDescription('The number of low severity faults that have occurred in this subsystem on the specified entity since the system was initialized.') ciscoHealthMonitorPositiveEvents = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ciscoHealthMonitorPositiveEvents.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorPositiveEvents.setDescription('The number of positive events that have occurred in this subsystem on the specified entity since the system was initialized.') ciscoHealthMonitorMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 243, 0)) ciscoHealthMonitorHealthLevel = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 243, 0, 1)).setObjects(("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorHealth")) if mibBuilder.loadTexts: ciscoHealthMonitorHealthLevel.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHealthLevel.setDescription('A ciscoHealthMonitorHealthLevel notification is sent when the health of a subsystem reaches either the ciscoHealthMonitorHealthNotifyLowThreshold or ciscoHealthMonitorHealthNotifyHighThreshold threshold as described above.') ciscoHealthMonitorMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 243, 2)) ciscoHealthMonitorMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 243, 2, 1)) ciscoHealthMonitorMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 243, 2, 2)) ciscoHealthMonitorMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 243, 2, 1, 1)).setObjects(("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoHealthMonitorMIBCompliance = ciscoHealthMonitorMIBCompliance.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorMIBCompliance.setDescription('The compliance statement for entities which implement the Cisco Health Monitor MIB') ciscoHealthMonitorGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 243, 2, 2, 1)).setObjects(("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorHealth"), ("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorHealthNotifyEnable"), ("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorHealthNotifyHighThreshold"), ("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorHealthNotifyLowThreshold"), ("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorCatastrophicFaults"), ("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorCriticalFaults"), ("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorHighSeverityFaults"), ("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorMediumSeverityFaults"), ("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorLowSeverityFaults"), ("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorPositiveEvents")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoHealthMonitorGroup = ciscoHealthMonitorGroup.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorGroup.setDescription('The collection of objects providing health information.') ciscoHealthMonitorMIBNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 243, 2, 2, 2)).setObjects(("CISCO-HEALTH-MONITOR-MIB", "ciscoHealthMonitorHealthLevel")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoHealthMonitorMIBNotificationGroup = ciscoHealthMonitorMIBNotificationGroup.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorMIBNotificationGroup.setDescription('Set of notifications implemented in this module.') mibBuilder.exportSymbols("CISCO-HEALTH-MONITOR-MIB", ciscoHealthMonitorCatastrophicFaults=ciscoHealthMonitorCatastrophicFaults, ciscoHealthMonitorEntry=ciscoHealthMonitorEntry, ciscoHealthMonitorPositiveEvents=ciscoHealthMonitorPositiveEvents, HealthLevel=HealthLevel, ciscoHealthMonitorHealthNotifyHighThreshold=ciscoHealthMonitorHealthNotifyHighThreshold, ciscoHealthMonitorMIBGroups=ciscoHealthMonitorMIBGroups, ciscoHealthMonitorMIBConform=ciscoHealthMonitorMIBConform, ciscoHealthMonitorHighSeverityFaults=ciscoHealthMonitorHighSeverityFaults, ciscoHealthMonitorCriticalFaults=ciscoHealthMonitorCriticalFaults, ciscoHealthMonitorHealth=ciscoHealthMonitorHealth, ciscoHealthMonitorHealthNotifyEnable=ciscoHealthMonitorHealthNotifyEnable, ciscoHealthMonitorMIB=ciscoHealthMonitorMIB, ciscoHealthMonitorGroup=ciscoHealthMonitorGroup, ciscoHealthMonitorMIBNotificationGroup=ciscoHealthMonitorMIBNotificationGroup, PYSNMP_MODULE_ID=ciscoHealthMonitorMIB, ciscoHealthMonitorLowSeverityFaults=ciscoHealthMonitorLowSeverityFaults, ciscoHealthMonitorSubsysName=ciscoHealthMonitorSubsysName, ciscoHealthMonitorMIBNotifs=ciscoHealthMonitorMIBNotifs, ciscoHealthMonitorMIBCompliances=ciscoHealthMonitorMIBCompliances, ciscoHealthMonitorHealthNotifyLowThreshold=ciscoHealthMonitorHealthNotifyLowThreshold, ciscoHealthMonitorMediumSeverityFaults=ciscoHealthMonitorMediumSeverityFaults, ciscoHealthMonitorMIBObjects=ciscoHealthMonitorMIBObjects, ciscoHealthMonitorHealthLevel=ciscoHealthMonitorHealthLevel, ciscoHealthMonitorMIBCompliance=ciscoHealthMonitorMIBCompliance, ciscoHealthMonitorTable=ciscoHealthMonitorTable)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, single_value_constraint, value_range_constraint, constraints_union, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection') (cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt') (ent_physical_index,) = mibBuilder.importSymbols('ENTITY-MIB', 'entPhysicalIndex') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup') (module_identity, time_ticks, bits, iso, notification_type, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity, mib_identifier, ip_address, counter32, unsigned32, gauge32, integer32, counter64) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'TimeTicks', 'Bits', 'iso', 'NotificationType', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity', 'MibIdentifier', 'IpAddress', 'Counter32', 'Unsigned32', 'Gauge32', 'Integer32', 'Counter64') (truth_value, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'TruthValue', 'DisplayString', 'TextualConvention') cisco_health_monitor_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 243)) ciscoHealthMonitorMIB.setRevisions(('2003-09-12 12:30',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoHealthMonitorMIB.setRevisionsDescriptions(('Initial version of this MIB module.',)) if mibBuilder.loadTexts: ciscoHealthMonitorMIB.setLastUpdated('200309121230Z') if mibBuilder.loadTexts: ciscoHealthMonitorMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoHealthMonitorMIB.setContactInfo(' Cisco Systems Customer Service Postal: 170 W. Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-healthmonitor@cisco.com') if mibBuilder.loadTexts: ciscoHealthMonitorMIB.setDescription("Health Monitor MIB module. The Health Monitor uses a model based on events of varying severity and frequency, and predefined rules, to generate a metric that represents a system's (and its subsystems') level of health. The events are typically internally generated notifications in response to detrimental or correctional changes in the state of the hardware or software of the system. Detrimental events are classified under one of the following severity levels: Catastrophic - Causes or leads to system failure Critical - Major subsystem or functionality failure High - Potential for major impact to important functions Medium - Potential for minor impact to functionality Low - Negligible impact to functionality Whilst correctional events fall under the following classification: Positive - Not a fault event. May cause or lead to the return of functionality This MIB module provides information for tracking occurrences of the above events, and presents the associated health metric for the system and its component subsystems.") cisco_health_monitor_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 243, 1)) class Healthlevel(TextualConvention, Gauge32): description = 'Reflects the health of a system or subsystem based on system events and predefined rules, expressed as a percentage. The UNITS clause associated with each object will indicate the degree of precision.' status = 'current' subtype_spec = Gauge32.subtypeSpec + value_range_constraint(0, 10000) cisco_health_monitor_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1)) if mibBuilder.loadTexts: ciscoHealthMonitorTable.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorTable.setDescription('This table contains Health Monitor statistics for physical entities and their constituent hardware and/or software subsystems. The Health Monitor statistics present in each row provide information such as the computed health of the indicated subsystem and the number of faults it has experienced.') cisco_health_monitor_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1)).setIndexNames((0, 'ENTITY-MIB', 'entPhysicalIndex'), (1, 'CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorSubsysName')) if mibBuilder.loadTexts: ciscoHealthMonitorEntry.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorEntry.setDescription('A Health Monitor statistics entry. The entPhysicalIndex identifies the physical entity (chassis or container), while the ciscoHealthMonitorSubsysName identifies by name the appropriate subsystem for which these statistics apply. If there are other entities such as peer routers or line cards then, in the context of this MIB, these are also defined to be in the same system. If these entities also run an instance of the Health Monitor then the summary information from the distributed Health Monitors is obtained here.') cisco_health_monitor_subsys_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 1), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(1, 128))) if mibBuilder.loadTexts: ciscoHealthMonitorSubsysName.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorSubsysName.setDescription("A textual string containing the name of the hardware or software subsystem. A management station wishing to obtain summary statistics for a physical entity should use a value of 'system' for this object.") cisco_health_monitor_health = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 2), health_level()).setUnits('0.01 percent').setMaxAccess('readonly') if mibBuilder.loadTexts: ciscoHealthMonitorHealth.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHealth.setDescription('The computed current health of this subsystem on the specified entity. This health metric is based on predefined rules that specify how the health should be adjusted in response to certain events of varying severity and frequency. As these events are encountered by each subsystem or physical entity, the appropriate rules are applied and the health is modified accordingly.') cisco_health_monitor_health_notify_enable = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 3), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyEnable.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyEnable.setDescription('Enables or disables health level notifications. When set to true(1), the ciscoHealthMonitorHealthLevel notification is enabled. When set to false(0), the ciscoHealthMonitorHealthLevel notification is disabled. If such a notification is desired, it is the responsibility of the management entity to ensure that the SNMP administrative model is configured in such a way as to allow the notification to be delivered.') cisco_health_monitor_health_notify_high_threshold = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 4), health_level().clone(10000)).setUnits('0.01 percent').setMaxAccess('readwrite') if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyHighThreshold.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyHighThreshold.setDescription('Specifies the health level at which a ciscoHealthMonitorHealthLevel notification will be generated for the specified subsystem and entity. A notification will only be generated if the health level had previously reached the low threshold level prior to reaching this high threshold level. Health levels oscillating within the high and the low threshold levels do not generate notifications. A health level going from low threshold (or below) to high threshold (or above) represents a return to normal health for the specified subsystem. Set your optimal health level to this threshold.') cisco_health_monitor_health_notify_low_threshold = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 5), health_level()).setUnits('0.01 percent').setMaxAccess('readwrite') if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyLowThreshold.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHealthNotifyLowThreshold.setDescription('Specifies the health level at which a ciscoHealthMonitorHealthLevel notification will be generated for the specified subsystem and entity. A notification will only be generated if the health level had previously reached the high threshold level prior to reaching this low threshold level. Health levels oscillating within the high and the low threshold levels do not generate notifications. A health level going from high threshold (or above) to low threshold (or below) represents a deterioration of the health for the specified subsystem. Set your unacceptable health level to this threshold.') cisco_health_monitor_catastrophic_faults = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ciscoHealthMonitorCatastrophicFaults.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorCatastrophicFaults.setDescription('The number of catastrophic faults that have occurred in this subsystem on the specified entity since the system was initialized.') cisco_health_monitor_critical_faults = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ciscoHealthMonitorCriticalFaults.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorCriticalFaults.setDescription('The number of critical faults that have occurred in this subsystem on the specified entity since the system was initialized.') cisco_health_monitor_high_severity_faults = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ciscoHealthMonitorHighSeverityFaults.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHighSeverityFaults.setDescription('The number of high severity faults that have occurred in this subsystem on the specified entity since the system was initialized.') cisco_health_monitor_medium_severity_faults = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ciscoHealthMonitorMediumSeverityFaults.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorMediumSeverityFaults.setDescription('The number of medium severity faults that have occurred in this subsystem on the specified entity since the system was initialized.') cisco_health_monitor_low_severity_faults = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ciscoHealthMonitorLowSeverityFaults.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorLowSeverityFaults.setDescription('The number of low severity faults that have occurred in this subsystem on the specified entity since the system was initialized.') cisco_health_monitor_positive_events = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 243, 1, 1, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ciscoHealthMonitorPositiveEvents.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorPositiveEvents.setDescription('The number of positive events that have occurred in this subsystem on the specified entity since the system was initialized.') cisco_health_monitor_mib_notifs = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 243, 0)) cisco_health_monitor_health_level = notification_type((1, 3, 6, 1, 4, 1, 9, 9, 243, 0, 1)).setObjects(('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorHealth')) if mibBuilder.loadTexts: ciscoHealthMonitorHealthLevel.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorHealthLevel.setDescription('A ciscoHealthMonitorHealthLevel notification is sent when the health of a subsystem reaches either the ciscoHealthMonitorHealthNotifyLowThreshold or ciscoHealthMonitorHealthNotifyHighThreshold threshold as described above.') cisco_health_monitor_mib_conform = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 243, 2)) cisco_health_monitor_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 243, 2, 1)) cisco_health_monitor_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 243, 2, 2)) cisco_health_monitor_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 243, 2, 1, 1)).setObjects(('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_health_monitor_mib_compliance = ciscoHealthMonitorMIBCompliance.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorMIBCompliance.setDescription('The compliance statement for entities which implement the Cisco Health Monitor MIB') cisco_health_monitor_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 243, 2, 2, 1)).setObjects(('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorHealth'), ('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorHealthNotifyEnable'), ('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorHealthNotifyHighThreshold'), ('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorHealthNotifyLowThreshold'), ('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorCatastrophicFaults'), ('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorCriticalFaults'), ('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorHighSeverityFaults'), ('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorMediumSeverityFaults'), ('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorLowSeverityFaults'), ('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorPositiveEvents')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_health_monitor_group = ciscoHealthMonitorGroup.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorGroup.setDescription('The collection of objects providing health information.') cisco_health_monitor_mib_notification_group = notification_group((1, 3, 6, 1, 4, 1, 9, 9, 243, 2, 2, 2)).setObjects(('CISCO-HEALTH-MONITOR-MIB', 'ciscoHealthMonitorHealthLevel')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_health_monitor_mib_notification_group = ciscoHealthMonitorMIBNotificationGroup.setStatus('current') if mibBuilder.loadTexts: ciscoHealthMonitorMIBNotificationGroup.setDescription('Set of notifications implemented in this module.') mibBuilder.exportSymbols('CISCO-HEALTH-MONITOR-MIB', ciscoHealthMonitorCatastrophicFaults=ciscoHealthMonitorCatastrophicFaults, ciscoHealthMonitorEntry=ciscoHealthMonitorEntry, ciscoHealthMonitorPositiveEvents=ciscoHealthMonitorPositiveEvents, HealthLevel=HealthLevel, ciscoHealthMonitorHealthNotifyHighThreshold=ciscoHealthMonitorHealthNotifyHighThreshold, ciscoHealthMonitorMIBGroups=ciscoHealthMonitorMIBGroups, ciscoHealthMonitorMIBConform=ciscoHealthMonitorMIBConform, ciscoHealthMonitorHighSeverityFaults=ciscoHealthMonitorHighSeverityFaults, ciscoHealthMonitorCriticalFaults=ciscoHealthMonitorCriticalFaults, ciscoHealthMonitorHealth=ciscoHealthMonitorHealth, ciscoHealthMonitorHealthNotifyEnable=ciscoHealthMonitorHealthNotifyEnable, ciscoHealthMonitorMIB=ciscoHealthMonitorMIB, ciscoHealthMonitorGroup=ciscoHealthMonitorGroup, ciscoHealthMonitorMIBNotificationGroup=ciscoHealthMonitorMIBNotificationGroup, PYSNMP_MODULE_ID=ciscoHealthMonitorMIB, ciscoHealthMonitorLowSeverityFaults=ciscoHealthMonitorLowSeverityFaults, ciscoHealthMonitorSubsysName=ciscoHealthMonitorSubsysName, ciscoHealthMonitorMIBNotifs=ciscoHealthMonitorMIBNotifs, ciscoHealthMonitorMIBCompliances=ciscoHealthMonitorMIBCompliances, ciscoHealthMonitorHealthNotifyLowThreshold=ciscoHealthMonitorHealthNotifyLowThreshold, ciscoHealthMonitorMediumSeverityFaults=ciscoHealthMonitorMediumSeverityFaults, ciscoHealthMonitorMIBObjects=ciscoHealthMonitorMIBObjects, ciscoHealthMonitorHealthLevel=ciscoHealthMonitorHealthLevel, ciscoHealthMonitorMIBCompliance=ciscoHealthMonitorMIBCompliance, ciscoHealthMonitorTable=ciscoHealthMonitorTable)
class ListNode: def __init__(self, key=None, value=None, next_node=None): self.key = key self.val = value self.next = next_node class MyHashMap: def __init__(self): self.size = 8 self.used = 0 self.threshold = 0.618 self.buckets = [None] * self.size def _resize(self): self.size *= 2 self.used = 0 new_buckets = [None] * self.size for b in self.buckets: current = b while current: h = self._hash(current.key) new_buckets[h] = ListNode(current.key, current.val, new_buckets[h]) self.used += 1 current = current.next self.buckets = new_buckets # print("Resizing: current size: {} current used: {} new size {}".format(self.size // 2, self.used, self.size)) def _check_capacity_and_resize(self): capacity = self.used / self.size if capacity > self.threshold: self._resize() def _hash(self, key): return key % self.size def _find_node_return_previous_and_current(self, key): h = self._hash(key) current = previous = self.buckets[h] while current and current.key != key: previous = current current = current.next return previous, current def put(self, key: int, value: int) -> None: self._check_capacity_and_resize() previous, current = self._find_node_return_previous_and_current(key) if current is None and previous is None: self.buckets[self._hash(key)] = ListNode(key, value) self.used += 1 elif previous is not None and current is not None: current.val = value elif previous is not None and current is None: previous.next = ListNode(key, value) self.used += 1 def get(self, key: int) -> int: previous, current = self._find_node_return_previous_and_current(key) return -1 if not previous or not current else current.val def remove(self, key: int) -> None: previous, current = self._find_node_return_previous_and_current(key) if current is None: return elif previous == current: self.buckets[self._hash(key)] = current.next else: previous.next = current.next self.used -= 1 op = ["MyHashMap", "put", "put", "put", "remove", "get", "put", "put", "get", "put", "put", "put", "put", "put", "put", "put", "put", "put", "put", "put", "put", "remove", "put", "remove", "put", "put", "remove", "put", "get", "put", "get", "put", "put", "put", "put", "put", "get", "put", "remove", "put", "remove", "put", "put", "put", "put", "put", "remove", "put", "put", "remove", "put", "put", "put", "get", "get", "put", "remove", "put", "put", "put", "get", "put", "put", "put", "remove", "put", "put", "put", "put", "put", "get", "put", "put", "get", "get", "put", "remove", "remove", "get", "put", "remove", "put", "remove", "put", "put", "put", "get", "put", "put", "put", "remove", "put", "put", "get", "put", "put", "get", "remove", "get", "get", "put"] param = [[], [24, 31], [58, 35], [59, 88], [84], [62], [2, 22], [44, 70], [24], [24, 42], [58, 99], [74, 29], [40, 66], [55, 83], [21, 27], [31, 25], [78, 19], [86, 70], [71, 73], [39, 95], [6, 96], [76], [62, 22], [78], [53, 51], [66, 53], [44], [14, 46], [77], [15, 32], [22], [53, 79], [35, 21], [73, 57], [18, 67], [96, 61], [73], [58, 77], [6], [5, 58], [17], [25, 14], [16, 13], [4, 37], [47, 43], [14, 79], [35], [7, 13], [78, 85], [27], [73, 33], [95, 87], [31, 21], [20], [64], [90, 22], [16], [77, 50], [55, 41], [33, 62], [44], [73, 16], [13, 54], [41, 5], [71], [81, 6], [20, 98], [35, 64], [15, 35], [74, 31], [90], [32, 15], [44, 79], [37], [53], [22, 80], [24], [10], [7], [53, 61], [65], [63, 99], [47], [97, 68], [7, 0], [9, 25], [97], [93, 13], [92, 43], [83, 73], [74], [41, 78], [39, 28], [52], [34, 16], [93, 63], [82], [77], [16], [50], [68, 47]] hm = MyHashMap() for i in range(len(op)): if op[i] == "MyHashMap": hm = MyHashMap() continue if op[i] == "put": print(hm.put(param[i][0], param[i][1])) if op[i] == "get": print(hm.get(param[i][0])) if op[i] == "remove": print(hm.remove(param[i][0])) print("simple test") hm = MyHashMap() for i in range(0, 10): hm.put(i, i) hm.remove(2) hm.remove(11) print(hm.get(1)) print(hm.get(2)) print("test resizing") hm = MyHashMap() for i in range(0, 10): hm.put(i * 8, i * 8) print(hm.buckets) c = hm.buckets[0] while c: print(c.val) c = c.next c = hm.buckets[8] while c: print(c.val) c = c.next
class Listnode: def __init__(self, key=None, value=None, next_node=None): self.key = key self.val = value self.next = next_node class Myhashmap: def __init__(self): self.size = 8 self.used = 0 self.threshold = 0.618 self.buckets = [None] * self.size def _resize(self): self.size *= 2 self.used = 0 new_buckets = [None] * self.size for b in self.buckets: current = b while current: h = self._hash(current.key) new_buckets[h] = list_node(current.key, current.val, new_buckets[h]) self.used += 1 current = current.next self.buckets = new_buckets def _check_capacity_and_resize(self): capacity = self.used / self.size if capacity > self.threshold: self._resize() def _hash(self, key): return key % self.size def _find_node_return_previous_and_current(self, key): h = self._hash(key) current = previous = self.buckets[h] while current and current.key != key: previous = current current = current.next return (previous, current) def put(self, key: int, value: int) -> None: self._check_capacity_and_resize() (previous, current) = self._find_node_return_previous_and_current(key) if current is None and previous is None: self.buckets[self._hash(key)] = list_node(key, value) self.used += 1 elif previous is not None and current is not None: current.val = value elif previous is not None and current is None: previous.next = list_node(key, value) self.used += 1 def get(self, key: int) -> int: (previous, current) = self._find_node_return_previous_and_current(key) return -1 if not previous or not current else current.val def remove(self, key: int) -> None: (previous, current) = self._find_node_return_previous_and_current(key) if current is None: return elif previous == current: self.buckets[self._hash(key)] = current.next else: previous.next = current.next self.used -= 1 op = ['MyHashMap', 'put', 'put', 'put', 'remove', 'get', 'put', 'put', 'get', 'put', 'put', 'put', 'put', 'put', 'put', 'put', 'put', 'put', 'put', 'put', 'put', 'remove', 'put', 'remove', 'put', 'put', 'remove', 'put', 'get', 'put', 'get', 'put', 'put', 'put', 'put', 'put', 'get', 'put', 'remove', 'put', 'remove', 'put', 'put', 'put', 'put', 'put', 'remove', 'put', 'put', 'remove', 'put', 'put', 'put', 'get', 'get', 'put', 'remove', 'put', 'put', 'put', 'get', 'put', 'put', 'put', 'remove', 'put', 'put', 'put', 'put', 'put', 'get', 'put', 'put', 'get', 'get', 'put', 'remove', 'remove', 'get', 'put', 'remove', 'put', 'remove', 'put', 'put', 'put', 'get', 'put', 'put', 'put', 'remove', 'put', 'put', 'get', 'put', 'put', 'get', 'remove', 'get', 'get', 'put'] param = [[], [24, 31], [58, 35], [59, 88], [84], [62], [2, 22], [44, 70], [24], [24, 42], [58, 99], [74, 29], [40, 66], [55, 83], [21, 27], [31, 25], [78, 19], [86, 70], [71, 73], [39, 95], [6, 96], [76], [62, 22], [78], [53, 51], [66, 53], [44], [14, 46], [77], [15, 32], [22], [53, 79], [35, 21], [73, 57], [18, 67], [96, 61], [73], [58, 77], [6], [5, 58], [17], [25, 14], [16, 13], [4, 37], [47, 43], [14, 79], [35], [7, 13], [78, 85], [27], [73, 33], [95, 87], [31, 21], [20], [64], [90, 22], [16], [77, 50], [55, 41], [33, 62], [44], [73, 16], [13, 54], [41, 5], [71], [81, 6], [20, 98], [35, 64], [15, 35], [74, 31], [90], [32, 15], [44, 79], [37], [53], [22, 80], [24], [10], [7], [53, 61], [65], [63, 99], [47], [97, 68], [7, 0], [9, 25], [97], [93, 13], [92, 43], [83, 73], [74], [41, 78], [39, 28], [52], [34, 16], [93, 63], [82], [77], [16], [50], [68, 47]] hm = my_hash_map() for i in range(len(op)): if op[i] == 'MyHashMap': hm = my_hash_map() continue if op[i] == 'put': print(hm.put(param[i][0], param[i][1])) if op[i] == 'get': print(hm.get(param[i][0])) if op[i] == 'remove': print(hm.remove(param[i][0])) print('simple test') hm = my_hash_map() for i in range(0, 10): hm.put(i, i) hm.remove(2) hm.remove(11) print(hm.get(1)) print(hm.get(2)) print('test resizing') hm = my_hash_map() for i in range(0, 10): hm.put(i * 8, i * 8) print(hm.buckets) c = hm.buckets[0] while c: print(c.val) c = c.next c = hm.buckets[8] while c: print(c.val) c = c.next
DOC_CHAPTER( header = 'If statements', topic = 'Reference', text = """ There are two main forms of if-statements. 1. Regular if-then with optional else-clause $DOC_LIST_UNORDERED( $DOC_WORD( if ) $DOC_QUOTE( [ condition ] ), $DOC_WORD( if ) $DOC_QUOTE( [ condition ] ) $DOC_WORD( then ) $DOC_QUOTE( [ value ] ), $DOC_WORD( if ) $DOC_QUOTE( [ condition ] ) $DOC_WORD( then ) $DOC_QUOTE( [ value ] ) $DOC_WORD( else ) $DOC_QUOTE( [ alternative-value ] ) ) 2. The if-let statement where the result of the condition, named $DOC_QUOTE( variable ), can be used in the then-clause. $DOC_LIST_UNORDERED( $DOC_WORD( if ) $DOC_QUOTE( variable ) $DOC_QUOTE( [ condition ] ), $DOC_WORD( if ) $DOC_QUOTE( variable ) $DOC_QUOTE( [ condition ] ) $DOC_WORD( then ) $DOC_QUOTE( [ value ] ), $DOC_WORD( if ) $DOC_QUOTE( variable ) $DOC_QUOTE( [ condition ] ) $DOC_WORD( then ) $DOC_QUOTE( [ value ] ) $DOC_WORD( else ) $DOC_QUOTE( [ alternative-value ] ) ) Notice that there are no booleans. Instead, the then-clause is evaluated if the condition-clause does not fail, and if it does fail, the optional else-clause is evaluated. An if-expression is similar to a try-clause. The if-statement without either a then-clause or else-clause simply prevents a fail message from propagating. """ ) ROOT_SCOPE_METHOD( MC( ARG( CW( 'if' ), CT( 'WORD', 'word' ), CG( 'LIST', 'if_phrase' ), CW( 'then' ), CG( 'LIST', 'then_phrase' ), CW( 'else' ), CG( 'LIST', 'else_phrase' ) ), """ JUMP__this( $CA(FRAME__CONDITIONALS_IF_0_new( CONTEXT, $CA(PARAM_word), PARAM_if_phrase, PARAM_then_phrase, PARAM_else_phrase )), CONTEXT ) ; """ ), MC( ARG( CW( 'if' ), CT( 'WORD', 'word' ), CG( 'LIST', 'if_phrase' ), CW( 'then' ), CG( 'LIST', 'then_phrase' ) ), """ JUMP__this( $CA(FRAME__CONDITIONALS_IF_0_new( CONTEXT, $CA(PARAM_word), PARAM_if_phrase, PARAM_then_phrase, $NONE )), CONTEXT ) ; """ ), MC( ARG( CW( 'if' ), CG( 'LIST', 'if_phrase' ), CW( 'then' ), CG( 'LIST', 'then_phrase' ), CW( 'else' ), CG( 'LIST', 'else_phrase' ) ), """ JUMP__this( $CA(FRAME__CONDITIONALS_IF_0_new( CONTEXT, $NONE, PARAM_if_phrase, PARAM_then_phrase, PARAM_else_phrase )), CONTEXT ) ; """ ), MC( ARG( CW( 'if' ), CG( 'LIST', 'if_phrase' ), CW( 'then' ), CG( 'LIST', 'then_phrase' ) ), """ JUMP__this( $CA(FRAME__CONDITIONALS_IF_0_new( CONTEXT, $NONE, PARAM_if_phrase, PARAM_then_phrase, $NONE )), CONTEXT ) ; """ ), MC( ARG( CW( 'if' ), CG( 'LIST', 'if_phrase' ) ), """ JUMP__this( $CA(FRAME__CONDITIONALS_IF_0_new( CONTEXT, $NONE, PARAM_if_phrase, $NONE, $NONE )), CONTEXT ) ; """ ) ) TEST( """ if [ . 1 == 2 ] """ ) TEST( """ if [ . 2 == 2 ] """ ) TEST( """ if [ . 1 == 2 ] then [ . 3 ] """ ) TEST( """ if [ . 2 == 2 ] then [ . 3 ] == 3 """ ) TEST( """ if it [ . 7 == 7 ] then [ . 3 * ( it ) ] == 21 """ ) TEST( """ if [ . 1 == 2 ] then [ . 3 ] else [ . 4 ] == 4 """ ) TEST( """ if [ . 2 == 2 ] then [ . 3 ] else [ . 4 ] == 3 """ ) TEST( """ if x [ . 2 == 2 ] then [ x + 3 ] else [ . 4 ] == 5 """ ) TEST( """ if x [ . 1 == 2 ] then [ x + 2 ] else [ . 7 ] == 7 """ ) TEST( """ if [ asdf asdf asdf ] then [ it ] else [ . 123 ] == 123 """ ) FRAME( 'CONDITIONALS_IF_0', attributes = [ A( 'ANY', 'word' ), A( 'ANY', 'if_phrase' ), A( 'ANY', 'then_phrase' ), A( 'ANY', 'else_phrase' ), ], methods = [ MS( ARG( CW( 'return' ), CG( 'ANY', 'value' ) ), """ JUMP__evaluate_ANY( $CA(FRAME__CONDITIONALS_IF_1_new( ACTION->parent, PARAM_value, ACTION->word, ACTION->then_phrase, ACTION->else_phrase )), ACTION->if_phrase, PARAM_value ) ; """ ), ] ) FRAME( 'CONDITIONALS_IF_1', attributes = [ A( 'ANY', 'scope' ), A( 'ANY', 'word' ), A( 'ANY', 'then_phrase' ), A( 'ANY', 'else_phrase' ), ], methods = [ MS( ARG( CW( 'return' ), CG( 'ANY', 'value' ) ), """ if ( ACTION->then_phrase != $NONE ) { if ( ACTION->word != $NONE ) { JUMP__evaluate_ANY( ACTION->parent, ACTION->then_phrase, $CA(UNION_new( $LISTNEW( nom_definition( ACTION->word, PARAM_value ), ACTION->scope ) )) ) ; } else { JUMP__evaluate_ANY( ACTION->parent, ACTION->then_phrase, ACTION->scope ) ; } } else { JUMP__return_ANY( ACTION->parent, ACTION->parent, $NONE ) ; } """ ), MS( ARG( CW( 'fail' ), CG( 'ANY', 'error' ) ), """ if ( ACTION->else_phrase != $NONE ) { JUMP__evaluate_ANY( ACTION->parent, ACTION->else_phrase, ACTION->scope ) ; } else { JUMP__return_ANY( ACTION->parent, ACTION->parent, $NONE ) ; } """ ), ] )
doc_chapter(header='If statements', topic='Reference', text='\n\nThere are two main forms of if-statements.\n\n1. Regular if-then with optional else-clause\n\n$DOC_LIST_UNORDERED(\n $DOC_WORD( if ) $DOC_QUOTE( [ condition ] ),\n $DOC_WORD( if ) $DOC_QUOTE( [ condition ] ) $DOC_WORD( then ) $DOC_QUOTE( [ value ] ),\n $DOC_WORD( if ) $DOC_QUOTE( [ condition ] ) $DOC_WORD( then ) $DOC_QUOTE( [ value ] ) $DOC_WORD( else ) $DOC_QUOTE( [ alternative-value ] )\n)\n2. The if-let statement where the result of the condition, named $DOC_QUOTE( variable ), can be used in the then-clause.\n\n$DOC_LIST_UNORDERED(\n $DOC_WORD( if ) $DOC_QUOTE( variable ) $DOC_QUOTE( [ condition ] ),\n $DOC_WORD( if ) $DOC_QUOTE( variable ) $DOC_QUOTE( [ condition ] ) $DOC_WORD( then ) $DOC_QUOTE( [ value ] ),\n $DOC_WORD( if ) $DOC_QUOTE( variable ) $DOC_QUOTE( [ condition ] ) $DOC_WORD( then ) $DOC_QUOTE( [ value ] ) $DOC_WORD( else ) $DOC_QUOTE( [ alternative-value ] )\n)\n\nNotice that there are no booleans.\nInstead, the then-clause is evaluated if the condition-clause does not fail,\nand if it does fail, the optional else-clause is evaluated.\n\nAn if-expression is similar to a try-clause.\nThe if-statement without either a then-clause or else-clause simply prevents a fail message from propagating.\n\n ') root_scope_method(mc(arg(cw('if'), ct('WORD', 'word'), cg('LIST', 'if_phrase'), cw('then'), cg('LIST', 'then_phrase'), cw('else'), cg('LIST', 'else_phrase')), '\n JUMP__this( $CA(FRAME__CONDITIONALS_IF_0_new( CONTEXT, $CA(PARAM_word), PARAM_if_phrase, PARAM_then_phrase, PARAM_else_phrase )), CONTEXT ) ;\n '), mc(arg(cw('if'), ct('WORD', 'word'), cg('LIST', 'if_phrase'), cw('then'), cg('LIST', 'then_phrase')), '\n JUMP__this( $CA(FRAME__CONDITIONALS_IF_0_new( CONTEXT, $CA(PARAM_word), PARAM_if_phrase, PARAM_then_phrase, $NONE )), CONTEXT ) ;\n '), mc(arg(cw('if'), cg('LIST', 'if_phrase'), cw('then'), cg('LIST', 'then_phrase'), cw('else'), cg('LIST', 'else_phrase')), '\n JUMP__this( $CA(FRAME__CONDITIONALS_IF_0_new( CONTEXT, $NONE, PARAM_if_phrase, PARAM_then_phrase, PARAM_else_phrase )), CONTEXT ) ;\n '), mc(arg(cw('if'), cg('LIST', 'if_phrase'), cw('then'), cg('LIST', 'then_phrase')), '\n JUMP__this( $CA(FRAME__CONDITIONALS_IF_0_new( CONTEXT, $NONE, PARAM_if_phrase, PARAM_then_phrase, $NONE )), CONTEXT ) ;\n '), mc(arg(cw('if'), cg('LIST', 'if_phrase')), '\n JUMP__this( $CA(FRAME__CONDITIONALS_IF_0_new( CONTEXT, $NONE, PARAM_if_phrase, $NONE, $NONE )), CONTEXT ) ;\n ')) test(' if [ . 1 == 2 ] ') test(' if [ . 2 == 2 ] ') test(' if [ . 1 == 2 ] then [ . 3 ] ') test(' if [ . 2 == 2 ] then [ . 3 ] == 3 ') test(' if it [ . 7 == 7 ] then [ . 3 * ( it ) ] == 21 ') test(' if [ . 1 == 2 ] then [ . 3 ] else [ . 4 ] == 4 ') test(' if [ . 2 == 2 ] then [ . 3 ] else [ . 4 ] == 3 ') test(' if x [ . 2 == 2 ] then [ x + 3 ] else [ . 4 ] == 5 ') test(' if x [ . 1 == 2 ] then [ x + 2 ] else [ . 7 ] == 7 ') test(' if [ asdf asdf asdf ] then [ it ] else [ . 123 ] == 123 ') frame('CONDITIONALS_IF_0', attributes=[a('ANY', 'word'), a('ANY', 'if_phrase'), a('ANY', 'then_phrase'), a('ANY', 'else_phrase')], methods=[ms(arg(cw('return'), cg('ANY', 'value')), '\n JUMP__evaluate_ANY( $CA(FRAME__CONDITIONALS_IF_1_new( ACTION->parent, PARAM_value, ACTION->word, ACTION->then_phrase, ACTION->else_phrase )), ACTION->if_phrase, PARAM_value ) ;\n ')]) frame('CONDITIONALS_IF_1', attributes=[a('ANY', 'scope'), a('ANY', 'word'), a('ANY', 'then_phrase'), a('ANY', 'else_phrase')], methods=[ms(arg(cw('return'), cg('ANY', 'value')), '\n if ( ACTION->then_phrase != $NONE ) {\n if ( ACTION->word != $NONE ) {\n JUMP__evaluate_ANY( ACTION->parent, ACTION->then_phrase, $CA(UNION_new( $LISTNEW( nom_definition( ACTION->word, PARAM_value ), ACTION->scope ) )) ) ;\n } else {\n JUMP__evaluate_ANY( ACTION->parent, ACTION->then_phrase, ACTION->scope ) ;\n }\n } else {\n JUMP__return_ANY( ACTION->parent, ACTION->parent, $NONE ) ;\n }\n '), ms(arg(cw('fail'), cg('ANY', 'error')), '\n if ( ACTION->else_phrase != $NONE ) {\n JUMP__evaluate_ANY( ACTION->parent, ACTION->else_phrase, ACTION->scope ) ;\n } else {\n JUMP__return_ANY( ACTION->parent, ACTION->parent, $NONE ) ;\n }\n ')])
n=int(input());ans=0 def s(x,h): global ans for i in range(3): if i==0 and x==0: continue if x==n: if h%3==0: ans+=1;return else: s(x+1,h+i) s(0,0) print(ans)
n = int(input()) ans = 0 def s(x, h): global ans for i in range(3): if i == 0 and x == 0: continue if x == n: if h % 3 == 0: ans += 1 return else: s(x + 1, h + i) s(0, 0) print(ans)
def slack_escape(text: str) -> str: """ Escape special control characters in text formatted for Slack's markup. This applies escaping rules as documented on https://api.slack.com/reference/surfaces/formatting#escaping """ return text.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;") def incident_modal_payload(): """Return the Slack Block Kit payload for the "Create new incident" modal""" return { "type": "modal", "submit": {"type": "plain_text", "text": "Submit", "emoji": True}, "close": {"type": "plain_text", "text": "Cancel", "emoji": True}, "title": {"type": "plain_text", "text": "PagerDuty", "emoji": True}, "blocks": [ { "type": "header", "text": { "type": "plain_text", "text": "Create a new PagerDuty incident", "emoji": True, }, }, { "type": "input", "block_id": "service", "element": { "type": "external_select", "placeholder": { "type": "plain_text", "text": "Select service", "emoji": True, }, "action_id": "service_value", "min_query_length": 0, }, "label": { "type": "plain_text", "text": "Affected service", "emoji": True, }, }, { "type": "input", "block_id": "title", "element": {"type": "plain_text_input", "action_id": "title_value"}, "label": {"type": "plain_text", "text": "Title", "emoji": True}, }, { "type": "input", "block_id": "description", "optional": True, "element": { "type": "plain_text_input", "multiline": True, "action_id": "description_value", }, "label": { "type": "plain_text", "text": "Description", "emoji": True, }, }, ], } def incident_created_modal_payload(pd_api_response): """Return the Slack Block Kit payload for the "Incident created" modal""" safe_summary = slack_escape(pd_api_response["summary"]) return { "response_action": "update", "view": { "type": "modal", "title": {"type": "plain_text", "text": "Success"}, "close": {"type": "plain_text", "text": "Close"}, "blocks": [ { "type": "section", "text": { "type": "mrkdwn", "text": f"*The incident <{pd_api_response['html_url']}|{safe_summary}> was successfully created*", }, }, ], }, }
def slack_escape(text: str) -> str: """ Escape special control characters in text formatted for Slack's markup. This applies escaping rules as documented on https://api.slack.com/reference/surfaces/formatting#escaping """ return text.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;') def incident_modal_payload(): """Return the Slack Block Kit payload for the "Create new incident" modal""" return {'type': 'modal', 'submit': {'type': 'plain_text', 'text': 'Submit', 'emoji': True}, 'close': {'type': 'plain_text', 'text': 'Cancel', 'emoji': True}, 'title': {'type': 'plain_text', 'text': 'PagerDuty', 'emoji': True}, 'blocks': [{'type': 'header', 'text': {'type': 'plain_text', 'text': 'Create a new PagerDuty incident', 'emoji': True}}, {'type': 'input', 'block_id': 'service', 'element': {'type': 'external_select', 'placeholder': {'type': 'plain_text', 'text': 'Select service', 'emoji': True}, 'action_id': 'service_value', 'min_query_length': 0}, 'label': {'type': 'plain_text', 'text': 'Affected service', 'emoji': True}}, {'type': 'input', 'block_id': 'title', 'element': {'type': 'plain_text_input', 'action_id': 'title_value'}, 'label': {'type': 'plain_text', 'text': 'Title', 'emoji': True}}, {'type': 'input', 'block_id': 'description', 'optional': True, 'element': {'type': 'plain_text_input', 'multiline': True, 'action_id': 'description_value'}, 'label': {'type': 'plain_text', 'text': 'Description', 'emoji': True}}]} def incident_created_modal_payload(pd_api_response): """Return the Slack Block Kit payload for the "Incident created" modal""" safe_summary = slack_escape(pd_api_response['summary']) return {'response_action': 'update', 'view': {'type': 'modal', 'title': {'type': 'plain_text', 'text': 'Success'}, 'close': {'type': 'plain_text', 'text': 'Close'}, 'blocks': [{'type': 'section', 'text': {'type': 'mrkdwn', 'text': f"*The incident <{pd_api_response['html_url']}|{safe_summary}> was successfully created*"}}]}}
class NoChoice(Exception): def __init__(self): super().__init__("Took too long.") class PaginationError(Exception): pass class CannotEmbedLinks(PaginationError): def __init__(self): super().__init__("Bot cannot embed links in this channel.")
class Nochoice(Exception): def __init__(self): super().__init__('Took too long.') class Paginationerror(Exception): pass class Cannotembedlinks(PaginationError): def __init__(self): super().__init__('Bot cannot embed links in this channel.')
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. def isStringHTML(s): if not isinstance(s, str): return False s = s.lower() return any(tag in s for tag in ('<p>', '<p ', '<br', '<li>'))
def is_string_html(s): if not isinstance(s, str): return False s = s.lower() return any((tag in s for tag in ('<p>', '<p ', '<br', '<li>')))
def assert_dict_equal(expected, actual): message = [] equal = True for k, v in expected.items(): if actual[k] != v: message.append(f"For key {k} want {v}, got {actual[k]}") equal = False for k, v in actual.items(): if not k in expected: message.append(f"Got extra key {k} with value {v}") equal = False assert equal, "\n".join(message)
def assert_dict_equal(expected, actual): message = [] equal = True for (k, v) in expected.items(): if actual[k] != v: message.append(f'For key {k} want {v}, got {actual[k]}') equal = False for (k, v) in actual.items(): if not k in expected: message.append(f'Got extra key {k} with value {v}') equal = False assert equal, '\n'.join(message)
""" :copyright: (c) 2020 Yotam Rechnitz :license: MIT, see LICENSE for more details """ class Assists: def __init__(self, js: dict): self._defensive_assists = js["defensiveAssists"] if "defensiveAssists" in js else 0 self._healing_done = js["healing_done"] if "healing_done" in js else 0 self._offensive_assists = js["offensive_assists"] if "offensive_assists" in js else 0 self._recon_assists = js["recon_assists"] if "recon_assists" in js else 0 @property def defensive_assists(self) -> int: return self._defensive_assists @property def healing_done(self) -> int: return self._healing_done @property def offensive_assists(self) -> int: return self._offensive_assists @property def recon_assists(self) -> int: return self._recon_assists
""" :copyright: (c) 2020 Yotam Rechnitz :license: MIT, see LICENSE for more details """ class Assists: def __init__(self, js: dict): self._defensive_assists = js['defensiveAssists'] if 'defensiveAssists' in js else 0 self._healing_done = js['healing_done'] if 'healing_done' in js else 0 self._offensive_assists = js['offensive_assists'] if 'offensive_assists' in js else 0 self._recon_assists = js['recon_assists'] if 'recon_assists' in js else 0 @property def defensive_assists(self) -> int: return self._defensive_assists @property def healing_done(self) -> int: return self._healing_done @property def offensive_assists(self) -> int: return self._offensive_assists @property def recon_assists(self) -> int: return self._recon_assists
x = int(input()) for j in range(x): q = int(input()) print("Case", j + 1, end=": ") for t in range(1, int(q / 2 + 1)): if q % t == 0: print(t, end=" ") print(q)
x = int(input()) for j in range(x): q = int(input()) print('Case', j + 1, end=': ') for t in range(1, int(q / 2 + 1)): if q % t == 0: print(t, end=' ') print(q)
""" Write a Python program to replace last element in a list with another list. """ num1 = [1, 3, 5, 7, 9] num2 = [2, 4, 6, 8, 0] num1[-1:] = num2 print(num1)
""" Write a Python program to replace last element in a list with another list. """ num1 = [1, 3, 5, 7, 9] num2 = [2, 4, 6, 8, 0] num1[-1:] = num2 print(num1)
class RobotStatus: def __init__(self): self.status = 'init' self.position = '' def isAvailable(self): if self.status == 'available': return True else: return False def isWaitEV(self): if self.status == 'waitEV': return True else: return False def isInEV(self): if self.status == 'inEV': return True else: return False def setAvailable(self): self.status = 'available' def setMoving(self): self.status = 'moving' def setWaitEV(self): self.status = 'waitEV' def setInEV(self): self.status = 'inEV' def getPosition(self): return self.position def setPosition(self,newPose): self.position = newPose
class Robotstatus: def __init__(self): self.status = 'init' self.position = '' def is_available(self): if self.status == 'available': return True else: return False def is_wait_ev(self): if self.status == 'waitEV': return True else: return False def is_in_ev(self): if self.status == 'inEV': return True else: return False def set_available(self): self.status = 'available' def set_moving(self): self.status = 'moving' def set_wait_ev(self): self.status = 'waitEV' def set_in_ev(self): self.status = 'inEV' def get_position(self): return self.position def set_position(self, newPose): self.position = newPose
# The language mapping for 2 and 3 character language code. language_dict = { "kn": "kannada", "kan": "kannada", "hi": "hindi", "hin": "hindi", }
language_dict = {'kn': 'kannada', 'kan': 'kannada', 'hi': 'hindi', 'hin': 'hindi'}
# Recursive Functions def iterTest(low, high): while low <= high: print(low) low=low+1 def recurTest(low,high): if low <= high: print(low) recurTest(low+1, high)
def iter_test(low, high): while low <= high: print(low) low = low + 1 def recur_test(low, high): if low <= high: print(low) recur_test(low + 1, high)
#!/usr/bin/env python3 """ Bradley N. Miller, David L. Ranum Problem Solving with Algorithms and Data Structures using Python Copyright 2005 Updated by Roman Yasinovskyy, 2017 """ class BinaryHeap: """Minimal Binary Heap""" def __init__(self): """Create a heap""" self._heap = [] def _perc_up(self, cur_idx): """Move a node up""" while (cur_idx - 1) // 2 >= 0: parent_idx = (cur_idx - 1) // 2 if self._heap[cur_idx] < self._heap[parent_idx]: self._heap[cur_idx], self._heap[parent_idx] = ( self._heap[parent_idx], self._heap[cur_idx], ) cur_idx = parent_idx def _perc_down(self, cur_idx): """Move a node down""" while 2 * cur_idx + 1 < len(self._heap): min_child_idx = self._get_min_child(cur_idx) if self._heap[cur_idx] > self._heap[min_child_idx]: self._heap[cur_idx], self._heap[min_child_idx] = ( self._heap[min_child_idx], self._heap[cur_idx], ) else: return cur_idx = min_child_idx def _get_min_child(self, parent_idx): """Get a smaller child""" if 2 * parent_idx + 2 > len(self._heap) - 1: return 2 * parent_idx + 1 if self._heap[2 * parent_idx + 1] < self._heap[2 * parent_idx + 2]: return 2 * parent_idx + 1 return 2 * parent_idx + 2 def heapify(self, not_a_heap, show_details=False): """Build a heap from any list""" self._heap = not_a_heap[:] cur_idx = len(self._heap) // 2 - 1 while cur_idx >= 0: self._perc_down(cur_idx) cur_idx = cur_idx - 1 if show_details: print(self._heap) def insert(self, item): """Add a new item""" self._heap.append(item) self._perc_up(len(self._heap) - 1) def delete(self): """Remove an item""" self._heap[0], self._heap[-1] = self._heap[-1], self._heap[0] result = self._heap.pop() self._perc_down(0) return result def is_empty(self): """Check if the heap is empty""" return not bool(self._heap) def __len__(self): """Get heap size""" return len(self._heap) def __str__(self): """Heap as a string""" return str(self._heap) def __contains__(self, item): """__contains__in method override""" return item in self._heap
""" Bradley N. Miller, David L. Ranum Problem Solving with Algorithms and Data Structures using Python Copyright 2005 Updated by Roman Yasinovskyy, 2017 """ class Binaryheap: """Minimal Binary Heap""" def __init__(self): """Create a heap""" self._heap = [] def _perc_up(self, cur_idx): """Move a node up""" while (cur_idx - 1) // 2 >= 0: parent_idx = (cur_idx - 1) // 2 if self._heap[cur_idx] < self._heap[parent_idx]: (self._heap[cur_idx], self._heap[parent_idx]) = (self._heap[parent_idx], self._heap[cur_idx]) cur_idx = parent_idx def _perc_down(self, cur_idx): """Move a node down""" while 2 * cur_idx + 1 < len(self._heap): min_child_idx = self._get_min_child(cur_idx) if self._heap[cur_idx] > self._heap[min_child_idx]: (self._heap[cur_idx], self._heap[min_child_idx]) = (self._heap[min_child_idx], self._heap[cur_idx]) else: return cur_idx = min_child_idx def _get_min_child(self, parent_idx): """Get a smaller child""" if 2 * parent_idx + 2 > len(self._heap) - 1: return 2 * parent_idx + 1 if self._heap[2 * parent_idx + 1] < self._heap[2 * parent_idx + 2]: return 2 * parent_idx + 1 return 2 * parent_idx + 2 def heapify(self, not_a_heap, show_details=False): """Build a heap from any list""" self._heap = not_a_heap[:] cur_idx = len(self._heap) // 2 - 1 while cur_idx >= 0: self._perc_down(cur_idx) cur_idx = cur_idx - 1 if show_details: print(self._heap) def insert(self, item): """Add a new item""" self._heap.append(item) self._perc_up(len(self._heap) - 1) def delete(self): """Remove an item""" (self._heap[0], self._heap[-1]) = (self._heap[-1], self._heap[0]) result = self._heap.pop() self._perc_down(0) return result def is_empty(self): """Check if the heap is empty""" return not bool(self._heap) def __len__(self): """Get heap size""" return len(self._heap) def __str__(self): """Heap as a string""" return str(self._heap) def __contains__(self, item): """__contains__in method override""" return item in self._heap
# find min. no. of sets an array (awards) can be divided into such that couple-wise difference of each element is at most k # ex: awards=[1,5,4,6,8,9,2], k=3, o/p=3 # [1,2][4,5,6][8,9] with max diff 1,2,1 respectively # int minimumGroups(int awards[n],int k) => o/p def max_diff(arr): return max(arr) - min(arr) def minimumGroups(awards, k): awards.sort() count = 1 n = len(awards) i, j = 0, 1 while j != n: # print(awards[i : j + 1], max_diff(awards[i : j + 1])) if max_diff(awards[i : j + 1]) >= k: count += 1 i = j j = i + 1 j = j + 1 return count def main(): awards = [1, 5, 4, 6, 8, 9, 2] k = 3 print(minimumGroups(awards, k)) if __name__ == "__main__": main()
def max_diff(arr): return max(arr) - min(arr) def minimum_groups(awards, k): awards.sort() count = 1 n = len(awards) (i, j) = (0, 1) while j != n: if max_diff(awards[i:j + 1]) >= k: count += 1 i = j j = i + 1 j = j + 1 return count def main(): awards = [1, 5, 4, 6, 8, 9, 2] k = 3 print(minimum_groups(awards, k)) if __name__ == '__main__': main()
class Solution: def countBits(self, n: int) -> List[int]: arr = [] for i in range(n+1): i_b = int(bin(i)[2:]) arr.append(self.calculate1(i_b)) return arr def calculate1(self, i): count = 0 while i >= 1: res = i%10 if res == 1: count += 1 i //= 10 return count
class Solution: def count_bits(self, n: int) -> List[int]: arr = [] for i in range(n + 1): i_b = int(bin(i)[2:]) arr.append(self.calculate1(i_b)) return arr def calculate1(self, i): count = 0 while i >= 1: res = i % 10 if res == 1: count += 1 i //= 10 return count
class Heap: def __init__(self, arr): self.arr = arr self.size = len(self.arr) def max_heapify(self, current_index): if not self.is_leaf(current_index): left_child = (2 * current_index) + 1 right_child = (2 * current_index) + 2 if right_child < self.size: if self.arr[left_child] > self.arr[current_index] or self.arr[right_child] > self.arr[current_index]: if self.arr[left_child] > self.arr[right_child]: self.arr[left_child], self.arr[current_index] = self.arr[current_index], self.arr[left_child] self.max_heapify(left_child) else: self.arr[right_child], self.arr[current_index] = self.arr[current_index], self.arr[right_child] self.max_heapify(right_child) else: if self.arr[left_child] > self.arr[current_index]: self.arr[left_child], self.arr[current_index] = self.arr[current_index], self.arr[left_child] self.max_heapify(left_child) def build_heap(self): for index in range((self.size//2) - 1, -1, -1): self.max_heapify(index) def is_leaf(self, current_index): if current_index >= self.size // 2 and current_index <= self.size - 1: return True return False def return_arr(self): return self.arr if __name__ == '__main__': heap = Heap([3, 6, 5, 0, 8, 2, 1, 9]) heap.build_heap() print(heap.return_arr())
class Heap: def __init__(self, arr): self.arr = arr self.size = len(self.arr) def max_heapify(self, current_index): if not self.is_leaf(current_index): left_child = 2 * current_index + 1 right_child = 2 * current_index + 2 if right_child < self.size: if self.arr[left_child] > self.arr[current_index] or self.arr[right_child] > self.arr[current_index]: if self.arr[left_child] > self.arr[right_child]: (self.arr[left_child], self.arr[current_index]) = (self.arr[current_index], self.arr[left_child]) self.max_heapify(left_child) else: (self.arr[right_child], self.arr[current_index]) = (self.arr[current_index], self.arr[right_child]) self.max_heapify(right_child) elif self.arr[left_child] > self.arr[current_index]: (self.arr[left_child], self.arr[current_index]) = (self.arr[current_index], self.arr[left_child]) self.max_heapify(left_child) def build_heap(self): for index in range(self.size // 2 - 1, -1, -1): self.max_heapify(index) def is_leaf(self, current_index): if current_index >= self.size // 2 and current_index <= self.size - 1: return True return False def return_arr(self): return self.arr if __name__ == '__main__': heap = heap([3, 6, 5, 0, 8, 2, 1, 9]) heap.build_heap() print(heap.return_arr())
# -*- coding: utf-8 -*- # @Author: Wenwen Yu # @Created Time: 7/8/2020 9:34 PM Entities_list = [ "date_echeance", "date_facture", "methode_payement", "numero_facture", "rib", "adresse", "contact", "nom_fournisseur", "matricule_fiscale", "total_ht", "total_ttc" ] # Entities_list = [ # "ticket_num", # "starting_station", # "train_num", # "destination_station", # "date", # "ticket_rates", # "seat_category", # "name" # ]
entities_list = ['date_echeance', 'date_facture', 'methode_payement', 'numero_facture', 'rib', 'adresse', 'contact', 'nom_fournisseur', 'matricule_fiscale', 'total_ht', 'total_ttc']
""" Script to specify the config @author: AbinayaM02 """ # Gunicorn config bind = '0.0.0.0:5069' workers = 1 timeout = 0 max_requests = 1
""" Script to specify the config @author: AbinayaM02 """ bind = '0.0.0.0:5069' workers = 1 timeout = 0 max_requests = 1
data = ( 'Guo ', # 0x00 'Yin ', # 0x01 'Hun ', # 0x02 'Pu ', # 0x03 'Yu ', # 0x04 'Han ', # 0x05 'Yuan ', # 0x06 'Lun ', # 0x07 'Quan ', # 0x08 'Yu ', # 0x09 'Qing ', # 0x0a 'Guo ', # 0x0b 'Chuan ', # 0x0c 'Wei ', # 0x0d 'Yuan ', # 0x0e 'Quan ', # 0x0f 'Ku ', # 0x10 'Fu ', # 0x11 'Yuan ', # 0x12 'Yuan ', # 0x13 'E ', # 0x14 'Tu ', # 0x15 'Tu ', # 0x16 'Tu ', # 0x17 'Tuan ', # 0x18 'Lue ', # 0x19 'Hui ', # 0x1a 'Yi ', # 0x1b 'Yuan ', # 0x1c 'Luan ', # 0x1d 'Luan ', # 0x1e 'Tu ', # 0x1f 'Ya ', # 0x20 'Tu ', # 0x21 'Ting ', # 0x22 'Sheng ', # 0x23 'Pu ', # 0x24 'Lu ', # 0x25 'Iri ', # 0x26 'Ya ', # 0x27 'Zai ', # 0x28 'Wei ', # 0x29 'Ge ', # 0x2a 'Yu ', # 0x2b 'Wu ', # 0x2c 'Gui ', # 0x2d 'Pi ', # 0x2e 'Yi ', # 0x2f 'Di ', # 0x30 'Qian ', # 0x31 'Qian ', # 0x32 'Zhen ', # 0x33 'Zhuo ', # 0x34 'Dang ', # 0x35 'Qia ', # 0x36 'Akutsu ', # 0x37 'Yama ', # 0x38 'Kuang ', # 0x39 'Chang ', # 0x3a 'Qi ', # 0x3b 'Nie ', # 0x3c 'Mo ', # 0x3d 'Ji ', # 0x3e 'Jia ', # 0x3f 'Zhi ', # 0x40 'Zhi ', # 0x41 'Ban ', # 0x42 'Xun ', # 0x43 'Tou ', # 0x44 'Qin ', # 0x45 'Fen ', # 0x46 'Jun ', # 0x47 'Keng ', # 0x48 'Tun ', # 0x49 'Fang ', # 0x4a 'Fen ', # 0x4b 'Ben ', # 0x4c 'Tan ', # 0x4d 'Kan ', # 0x4e 'Pi ', # 0x4f 'Zuo ', # 0x50 'Keng ', # 0x51 'Bi ', # 0x52 'Xing ', # 0x53 'Di ', # 0x54 'Jing ', # 0x55 'Ji ', # 0x56 'Kuai ', # 0x57 'Di ', # 0x58 'Jing ', # 0x59 'Jian ', # 0x5a 'Tan ', # 0x5b 'Li ', # 0x5c 'Ba ', # 0x5d 'Wu ', # 0x5e 'Fen ', # 0x5f 'Zhui ', # 0x60 'Po ', # 0x61 'Pan ', # 0x62 'Tang ', # 0x63 'Kun ', # 0x64 'Qu ', # 0x65 'Tan ', # 0x66 'Zhi ', # 0x67 'Tuo ', # 0x68 'Gan ', # 0x69 'Ping ', # 0x6a 'Dian ', # 0x6b 'Gua ', # 0x6c 'Ni ', # 0x6d 'Tai ', # 0x6e 'Pi ', # 0x6f 'Jiong ', # 0x70 'Yang ', # 0x71 'Fo ', # 0x72 'Ao ', # 0x73 'Liu ', # 0x74 'Qiu ', # 0x75 'Mu ', # 0x76 'Ke ', # 0x77 'Gou ', # 0x78 'Xue ', # 0x79 'Ba ', # 0x7a 'Chi ', # 0x7b 'Che ', # 0x7c 'Ling ', # 0x7d 'Zhu ', # 0x7e 'Fu ', # 0x7f 'Hu ', # 0x80 'Zhi ', # 0x81 'Chui ', # 0x82 'La ', # 0x83 'Long ', # 0x84 'Long ', # 0x85 'Lu ', # 0x86 'Ao ', # 0x87 'Tay ', # 0x88 'Pao ', # 0x89 '[?] ', # 0x8a 'Xing ', # 0x8b 'Dong ', # 0x8c 'Ji ', # 0x8d 'Ke ', # 0x8e 'Lu ', # 0x8f 'Ci ', # 0x90 'Chi ', # 0x91 'Lei ', # 0x92 'Gai ', # 0x93 'Yin ', # 0x94 'Hou ', # 0x95 'Dui ', # 0x96 'Zhao ', # 0x97 'Fu ', # 0x98 'Guang ', # 0x99 'Yao ', # 0x9a 'Duo ', # 0x9b 'Duo ', # 0x9c 'Gui ', # 0x9d 'Cha ', # 0x9e 'Yang ', # 0x9f 'Yin ', # 0xa0 'Fa ', # 0xa1 'Gou ', # 0xa2 'Yuan ', # 0xa3 'Die ', # 0xa4 'Xie ', # 0xa5 'Ken ', # 0xa6 'Jiong ', # 0xa7 'Shou ', # 0xa8 'E ', # 0xa9 'Ha ', # 0xaa 'Dian ', # 0xab 'Hong ', # 0xac 'Wu ', # 0xad 'Kua ', # 0xae '[?] ', # 0xaf 'Tao ', # 0xb0 'Dang ', # 0xb1 'Kai ', # 0xb2 'Gake ', # 0xb3 'Nao ', # 0xb4 'An ', # 0xb5 'Xing ', # 0xb6 'Xian ', # 0xb7 'Huan ', # 0xb8 'Bang ', # 0xb9 'Pei ', # 0xba 'Ba ', # 0xbb 'Yi ', # 0xbc 'Yin ', # 0xbd 'Han ', # 0xbe 'Xu ', # 0xbf 'Chui ', # 0xc0 'Cen ', # 0xc1 'Geng ', # 0xc2 'Ai ', # 0xc3 'Peng ', # 0xc4 'Fang ', # 0xc5 'Que ', # 0xc6 'Yong ', # 0xc7 'Xun ', # 0xc8 'Jia ', # 0xc9 'Di ', # 0xca 'Mai ', # 0xcb 'Lang ', # 0xcc 'Xuan ', # 0xcd 'Cheng ', # 0xce 'Yan ', # 0xcf 'Jin ', # 0xd0 'Zhe ', # 0xd1 'Lei ', # 0xd2 'Lie ', # 0xd3 'Bu ', # 0xd4 'Cheng ', # 0xd5 'Gomi ', # 0xd6 'Bu ', # 0xd7 'Shi ', # 0xd8 'Xun ', # 0xd9 'Guo ', # 0xda 'Jiong ', # 0xdb 'Ye ', # 0xdc 'Nian ', # 0xdd 'Di ', # 0xde 'Yu ', # 0xdf 'Bu ', # 0xe0 'Ya ', # 0xe1 'Juan ', # 0xe2 'Sui ', # 0xe3 'Pi ', # 0xe4 'Cheng ', # 0xe5 'Wan ', # 0xe6 'Ju ', # 0xe7 'Lun ', # 0xe8 'Zheng ', # 0xe9 'Kong ', # 0xea 'Chong ', # 0xeb 'Dong ', # 0xec 'Dai ', # 0xed 'Tan ', # 0xee 'An ', # 0xef 'Cai ', # 0xf0 'Shu ', # 0xf1 'Beng ', # 0xf2 'Kan ', # 0xf3 'Zhi ', # 0xf4 'Duo ', # 0xf5 'Yi ', # 0xf6 'Zhi ', # 0xf7 'Yi ', # 0xf8 'Pei ', # 0xf9 'Ji ', # 0xfa 'Zhun ', # 0xfb 'Qi ', # 0xfc 'Sao ', # 0xfd 'Ju ', # 0xfe 'Ni ', # 0xff )
data = ('Guo ', 'Yin ', 'Hun ', 'Pu ', 'Yu ', 'Han ', 'Yuan ', 'Lun ', 'Quan ', 'Yu ', 'Qing ', 'Guo ', 'Chuan ', 'Wei ', 'Yuan ', 'Quan ', 'Ku ', 'Fu ', 'Yuan ', 'Yuan ', 'E ', 'Tu ', 'Tu ', 'Tu ', 'Tuan ', 'Lue ', 'Hui ', 'Yi ', 'Yuan ', 'Luan ', 'Luan ', 'Tu ', 'Ya ', 'Tu ', 'Ting ', 'Sheng ', 'Pu ', 'Lu ', 'Iri ', 'Ya ', 'Zai ', 'Wei ', 'Ge ', 'Yu ', 'Wu ', 'Gui ', 'Pi ', 'Yi ', 'Di ', 'Qian ', 'Qian ', 'Zhen ', 'Zhuo ', 'Dang ', 'Qia ', 'Akutsu ', 'Yama ', 'Kuang ', 'Chang ', 'Qi ', 'Nie ', 'Mo ', 'Ji ', 'Jia ', 'Zhi ', 'Zhi ', 'Ban ', 'Xun ', 'Tou ', 'Qin ', 'Fen ', 'Jun ', 'Keng ', 'Tun ', 'Fang ', 'Fen ', 'Ben ', 'Tan ', 'Kan ', 'Pi ', 'Zuo ', 'Keng ', 'Bi ', 'Xing ', 'Di ', 'Jing ', 'Ji ', 'Kuai ', 'Di ', 'Jing ', 'Jian ', 'Tan ', 'Li ', 'Ba ', 'Wu ', 'Fen ', 'Zhui ', 'Po ', 'Pan ', 'Tang ', 'Kun ', 'Qu ', 'Tan ', 'Zhi ', 'Tuo ', 'Gan ', 'Ping ', 'Dian ', 'Gua ', 'Ni ', 'Tai ', 'Pi ', 'Jiong ', 'Yang ', 'Fo ', 'Ao ', 'Liu ', 'Qiu ', 'Mu ', 'Ke ', 'Gou ', 'Xue ', 'Ba ', 'Chi ', 'Che ', 'Ling ', 'Zhu ', 'Fu ', 'Hu ', 'Zhi ', 'Chui ', 'La ', 'Long ', 'Long ', 'Lu ', 'Ao ', 'Tay ', 'Pao ', '[?] ', 'Xing ', 'Dong ', 'Ji ', 'Ke ', 'Lu ', 'Ci ', 'Chi ', 'Lei ', 'Gai ', 'Yin ', 'Hou ', 'Dui ', 'Zhao ', 'Fu ', 'Guang ', 'Yao ', 'Duo ', 'Duo ', 'Gui ', 'Cha ', 'Yang ', 'Yin ', 'Fa ', 'Gou ', 'Yuan ', 'Die ', 'Xie ', 'Ken ', 'Jiong ', 'Shou ', 'E ', 'Ha ', 'Dian ', 'Hong ', 'Wu ', 'Kua ', '[?] ', 'Tao ', 'Dang ', 'Kai ', 'Gake ', 'Nao ', 'An ', 'Xing ', 'Xian ', 'Huan ', 'Bang ', 'Pei ', 'Ba ', 'Yi ', 'Yin ', 'Han ', 'Xu ', 'Chui ', 'Cen ', 'Geng ', 'Ai ', 'Peng ', 'Fang ', 'Que ', 'Yong ', 'Xun ', 'Jia ', 'Di ', 'Mai ', 'Lang ', 'Xuan ', 'Cheng ', 'Yan ', 'Jin ', 'Zhe ', 'Lei ', 'Lie ', 'Bu ', 'Cheng ', 'Gomi ', 'Bu ', 'Shi ', 'Xun ', 'Guo ', 'Jiong ', 'Ye ', 'Nian ', 'Di ', 'Yu ', 'Bu ', 'Ya ', 'Juan ', 'Sui ', 'Pi ', 'Cheng ', 'Wan ', 'Ju ', 'Lun ', 'Zheng ', 'Kong ', 'Chong ', 'Dong ', 'Dai ', 'Tan ', 'An ', 'Cai ', 'Shu ', 'Beng ', 'Kan ', 'Zhi ', 'Duo ', 'Yi ', 'Zhi ', 'Yi ', 'Pei ', 'Ji ', 'Zhun ', 'Qi ', 'Sao ', 'Ju ', 'Ni ')
FEATURES = {"DEBUG_MODE": False} def feature(feature_id: str) -> bool: if feature_id not in FEATURES: raise ValueError("Key not a valid feature") return FEATURES[feature_id]
features = {'DEBUG_MODE': False} def feature(feature_id: str) -> bool: if feature_id not in FEATURES: raise value_error('Key not a valid feature') return FEATURES[feature_id]
team_names = ['LA Chargers', 'LA Rams', 'NE Patriots', 'NY Giants', 'Chicago Bears'] locations = ['LA', 'NY', 'SF', 'CH', 'NE'] weeks = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
team_names = ['LA Chargers', 'LA Rams', 'NE Patriots', 'NY Giants', 'Chicago Bears'] locations = ['LA', 'NY', 'SF', 'CH', 'NE'] weeks = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
def any_lowercase(s): """ incorrect - only checks whether first letter is lower case""" for c in s: if c.islower(): return True else: return False def any_lowercase_fixed(s): for c in s: if c.islower(): return True return False def any_lowercase2(s): """ incorrect - checks if 'c' is lower case, which is always True, and returns a string not a Boolean""" for c in s: if 'c'.islower(): return 'True' else: return 'False' def any_lowercase3(s): """ incorrect - only returns the value of the final character of s""" for c in s: flag = c.islower() return flag def any_lowercase4(s): """ correct """ flag = False for c in s: flag = flag or c.islower() return flag def any_lowercase5(s): """ incorrect - returns whether false if s contains any capital letters""" for c in s: if not c.islower(): return False return True
def any_lowercase(s): """ incorrect - only checks whether first letter is lower case""" for c in s: if c.islower(): return True else: return False def any_lowercase_fixed(s): for c in s: if c.islower(): return True return False def any_lowercase2(s): """ incorrect - checks if 'c' is lower case, which is always True, and returns a string not a Boolean""" for c in s: if 'c'.islower(): return 'True' else: return 'False' def any_lowercase3(s): """ incorrect - only returns the value of the final character of s""" for c in s: flag = c.islower() return flag def any_lowercase4(s): """ correct """ flag = False for c in s: flag = flag or c.islower() return flag def any_lowercase5(s): """ incorrect - returns whether false if s contains any capital letters""" for c in s: if not c.islower(): return False return True
""" 53. Maximum Subarray Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. A subarray is a contiguous part of an array. Examples -------- Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: [4,-1,2,1] has the largest sum = 6. Example 2: Input: nums = [1] Output: 1 Example 3: Input: nums = [5,4,-1,7,8] Output: 23 Constraints ----------- * 1 <= nums.length <= 105 * -104 <= nums[i] <= 104 """ def initial_pass(nums: list[int]) -> int: # Check each subarray from size 1 to size n max_sum = -105 * 106 # Ensures we start at a value that can be overwritten for i in range(1, len(nums)+1): start_index = 0 end_index = i while end_index <= len(nums): max_sum = max(max_sum, sum(nums[start_index:end_index])) start_index += 1 end_index += 1 return max_sum
""" 53. Maximum Subarray Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. A subarray is a contiguous part of an array. Examples -------- Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: [4,-1,2,1] has the largest sum = 6. Example 2: Input: nums = [1] Output: 1 Example 3: Input: nums = [5,4,-1,7,8] Output: 23 Constraints ----------- * 1 <= nums.length <= 105 * -104 <= nums[i] <= 104 """ def initial_pass(nums: list[int]) -> int: max_sum = -105 * 106 for i in range(1, len(nums) + 1): start_index = 0 end_index = i while end_index <= len(nums): max_sum = max(max_sum, sum(nums[start_index:end_index])) start_index += 1 end_index += 1 return max_sum
x = int(input("")) y = int(input("")) div = int(x/y) print(div) mod = int(x % y) print(mod) z = divmod(x, y) print(z)
x = int(input('')) y = int(input('')) div = int(x / y) print(div) mod = int(x % y) print(mod) z = divmod(x, y) print(z)
red = 'Red' blue = 'Blue' green = 'Green' spring_green = 'SpringGreen' hot_pink = 'HotPink' blue_violet = 'BlueViolet' cadet_blue = 'CadetBlue' chocolate = 'Chocolate' coral = 'Coral' dodger_blue = 'DodgerBlue' firebrick = 'Firebrick' golden_rod = 'GoldenRod' orange_red = 'OrangeRed' yellow_green = 'YellowGreen' sea_green = 'SeaGreen'
red = 'Red' blue = 'Blue' green = 'Green' spring_green = 'SpringGreen' hot_pink = 'HotPink' blue_violet = 'BlueViolet' cadet_blue = 'CadetBlue' chocolate = 'Chocolate' coral = 'Coral' dodger_blue = 'DodgerBlue' firebrick = 'Firebrick' golden_rod = 'GoldenRod' orange_red = 'OrangeRed' yellow_green = 'YellowGreen' sea_green = 'SeaGreen'
class Solution: def numSub(self, s: str) -> int: l = [int(i) for i in s] res = 0 i = 0 while i < len(l): if l[i] != 1: i += 1 continue count = 0 curr = 0 while i < len(l) and l[i] == 1: i += 1 count += 1 curr += count res += curr res %= 10**9+7 return res
class Solution: def num_sub(self, s: str) -> int: l = [int(i) for i in s] res = 0 i = 0 while i < len(l): if l[i] != 1: i += 1 continue count = 0 curr = 0 while i < len(l) and l[i] == 1: i += 1 count += 1 curr += count res += curr res %= 10 ** 9 + 7 return res
class conta_corrente: def __Init__(self, nome): self.nome = nome self.email = None self.telefone = None self._saldo = 0 def _checar_saldo(self, valor): return self._saldo >= valor def depositar(self, valor): self._saldo += valor def sacar(self, valor): if self._checar_saldo(valor): self._saldo -= valor return True else: return False def obter_saldo(self): return self._saldo
class Conta_Corrente: def ___init__(self, nome): self.nome = nome self.email = None self.telefone = None self._saldo = 0 def _checar_saldo(self, valor): return self._saldo >= valor def depositar(self, valor): self._saldo += valor def sacar(self, valor): if self._checar_saldo(valor): self._saldo -= valor return True else: return False def obter_saldo(self): return self._saldo
chromedriver_path='***' from_station='***' to_station='***' email='***' phone_num='***' full_name='***' card_num='***' exp='***' cvv='***'
chromedriver_path = '***' from_station = '***' to_station = '***' email = '***' phone_num = '***' full_name = '***' card_num = '***' exp = '***' cvv = '***'
# terrascript/data/camptocamp/jwt.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:19:50 UTC) __all__ = []
__all__ = []
mon_fichier = open("mdp.txt" , "r") crypt = mon_fichier.read() mon_fichier.close() mon_fichier = open("encrypt.txt" , "r") decrypt1 = mon_fichier.read() mon_fichier.close() def encrypt(crypt): number=input("donner une cle de cryptage (numero)") b=list(crypt) str(b) c=[ord(x)for x in(b)] d=[] for i in c: d.append(i+number) e=[chr(i) for i in (d)] e="".join(e) print ("ta cle est:", number,) mon_fichier = open("encrypt.txt" , "w") mon_fichier.write(e) mon_fichier.close() def decrypt(decrypt1): number=input("quelle est la cle de cryptage ?") b=list(decrypt1) str(b) c=[ord(x)for x in(b)] d=[] for i in c: d.append(i-number) e=[chr(i) for i in (d)] e="".join(e) mon_fichier = open("decrypt.txt" , "w") mon_fichier.write(e) mon_fichier.close() def menu(): print ("Que veut-tu faire ??") print ("1 pour Encrypter un document") print ("2 pour Decrypter un ducoment") choice=input("fait ton choix:") if choice=="1": run = encrypt(crypt) run menu() elif choice=="2": derun=decrypt(decrypt1) derun menu() menu()
mon_fichier = open('mdp.txt', 'r') crypt = mon_fichier.read() mon_fichier.close() mon_fichier = open('encrypt.txt', 'r') decrypt1 = mon_fichier.read() mon_fichier.close() def encrypt(crypt): number = input('donner une cle de cryptage (numero)') b = list(crypt) str(b) c = [ord(x) for x in b] d = [] for i in c: d.append(i + number) e = [chr(i) for i in d] e = ''.join(e) print('ta cle est:', number) mon_fichier = open('encrypt.txt', 'w') mon_fichier.write(e) mon_fichier.close() def decrypt(decrypt1): number = input('quelle est la cle de cryptage ?') b = list(decrypt1) str(b) c = [ord(x) for x in b] d = [] for i in c: d.append(i - number) e = [chr(i) for i in d] e = ''.join(e) mon_fichier = open('decrypt.txt', 'w') mon_fichier.write(e) mon_fichier.close() def menu(): print('Que veut-tu faire ??') print('1 pour Encrypter un document') print('2 pour Decrypter un ducoment') choice = input('fait ton choix:') if choice == '1': run = encrypt(crypt) run menu() elif choice == '2': derun = decrypt(decrypt1) derun menu() menu()
'''dom.py contains all referenced dom elements. Gathering all fragile dom elements in one config file makes it easier to maintain the code''' def dom(): dom = { 'loginButton': 'html/body/div[3]/header/div/div/div/div[2]/button/span', 'einverstandenButton': 'div.c-button--bold', 'usernameInput': 'Username' } return dom
"""dom.py contains all referenced dom elements. Gathering all fragile dom elements in one config file makes it easier to maintain the code""" def dom(): dom = {'loginButton': 'html/body/div[3]/header/div/div/div/div[2]/button/span', 'einverstandenButton': 'div.c-button--bold', 'usernameInput': 'Username'} return dom
def template_expand(tool, template, output, subs, executable = False, execution_requirements = None): """Powerful template expansion rule. template_expand uses the powerful golang text/template engine to expand an input template into an output file. The subs dict provide keys and values, where the values can either be plain strings, or File objects that end up read from disk. The full documentation of text/template syntax can be found here: https://golang.org/pkg/text/template/ Args: template: a File object, the template to expand. The template can use any syntax supported by the golang text/template library. output: a File object, the file to create with the expanded template. subs: a dict, {"key": value}, with key being a string, and value being either a string, or a file object. If the value is a file, the corresponding file will be read and expanded every time key is used. If the key is set to "myKey", you can reference it in the template by either using {{.myKey}}, or by using {{.Get "myKey"}}. Using ".Get" allows to access keys that use invalid go syntax (for example, "my-key:next"), and causes the substitution to fail if the key is not present. Returns: A dict that can be simply passed as **kwarg to ctx.actions.run(), or mangled before it is passed over. Example: my_rule_implementation(ctx): ... expander = template_expand(ctx.file._tool, template = ctx.file.config, output = output, subs = subs) ctx.actions.run(**expander) In the rule definition: ... attrs = { "_tool": template_tool, } """ args = [ "-template", template.path, "-output", output.path, ] if executable: args.append("-executable") inputs = [template] for key, value in subs.items(): args.extend(["-key", key]) if type(value) == "string": args.extend(["-value", value]) else: inputs.append(value) args.extend(["-valuefile", value.path]) return dict( executable = tool, arguments = args, inputs = inputs, outputs = [output], execution_requirements = execution_requirements, ) # Use template_tool in your rule definition, and pass the corresponding attribute # to template_execute as the first parameter. # # For example: # # example_rule = rule( # implementation = _example_rule_impl, # attrs = { # "output": attr.string(...), # [...] # "_expander": template_tool, # } # ) # # def _example_rule_impl(ctx): # [...] # expander = template_expand(ctx.attr._expander, ...) # ctx.actions.run(**expander) # template_tool = attr.label( default = Label("//bazel/utils/template"), cfg = "host", executable = True, allow_single_file = True, )
def template_expand(tool, template, output, subs, executable=False, execution_requirements=None): """Powerful template expansion rule. template_expand uses the powerful golang text/template engine to expand an input template into an output file. The subs dict provide keys and values, where the values can either be plain strings, or File objects that end up read from disk. The full documentation of text/template syntax can be found here: https://golang.org/pkg/text/template/ Args: template: a File object, the template to expand. The template can use any syntax supported by the golang text/template library. output: a File object, the file to create with the expanded template. subs: a dict, {"key": value}, with key being a string, and value being either a string, or a file object. If the value is a file, the corresponding file will be read and expanded every time key is used. If the key is set to "myKey", you can reference it in the template by either using {{.myKey}}, or by using {{.Get "myKey"}}. Using ".Get" allows to access keys that use invalid go syntax (for example, "my-key:next"), and causes the substitution to fail if the key is not present. Returns: A dict that can be simply passed as **kwarg to ctx.actions.run(), or mangled before it is passed over. Example: my_rule_implementation(ctx): ... expander = template_expand(ctx.file._tool, template = ctx.file.config, output = output, subs = subs) ctx.actions.run(**expander) In the rule definition: ... attrs = { "_tool": template_tool, } """ args = ['-template', template.path, '-output', output.path] if executable: args.append('-executable') inputs = [template] for (key, value) in subs.items(): args.extend(['-key', key]) if type(value) == 'string': args.extend(['-value', value]) else: inputs.append(value) args.extend(['-valuefile', value.path]) return dict(executable=tool, arguments=args, inputs=inputs, outputs=[output], execution_requirements=execution_requirements) template_tool = attr.label(default=label('//bazel/utils/template'), cfg='host', executable=True, allow_single_file=True)
''' 2. Write a Python Program to read the contents of a file and find how many upper case letters, lower case letters and digits existed in the file. ''' file = open('SampleCount.txt','r') data = file.read() print('Contents of a file is') print(data) digit = upper = lower = special = 0 for ch in data: if ch.islower(): lower += 1 elif ch.isupper(): upper += 1 elif ch.isdigit(): digit += 1 else: special += 1 print('Number of Upper Case Letters in a file is',upper) print('Number of Lower Case Letters in a file is',lower) print('Number of digits in a file is',digit) print('Number of Special Characters in a file is',special) file.close()
""" 2. Write a Python Program to read the contents of a file and find how many upper case letters, lower case letters and digits existed in the file. """ file = open('SampleCount.txt', 'r') data = file.read() print('Contents of a file is') print(data) digit = upper = lower = special = 0 for ch in data: if ch.islower(): lower += 1 elif ch.isupper(): upper += 1 elif ch.isdigit(): digit += 1 else: special += 1 print('Number of Upper Case Letters in a file is', upper) print('Number of Lower Case Letters in a file is', lower) print('Number of digits in a file is', digit) print('Number of Special Characters in a file is', special) file.close()
# Specialization: Google IT Automation with Python # Course 01: Crash Course with Python # Week 5 Module Part 2 Exercise 02 # Student: Shawn Solomon # Learning Platform: Coursera.org # Want to see this in action? # In this code, there's a Person class that has an attribute name, which gets set when constructing # the object. Fill in the blanks so that 1) when an instance of the class is created, the attribute # gets set correctly, and 2) when the greeting() method is called, the greeting states the assigned name. # class Person: # def __init__(self, name): # self.name = ___ # def greeting(self): # # Should return "hi, my name is " followed by the name of the Person. # return ___ # # Create a new instance with a name of your choice # some_person = ___ # # Call the greeting method # print(some_person.___) class Person: def __init__(self, name): self.name = name def greeting(self): # Should return "hi, my name is " followed by the name of the Person. return "hi, my name is {}".format(self.name) # Create a new instance with a name of your choice some_person = Person("Nobody") # Call the greeting method print(some_person.greeting())
class Person: def __init__(self, name): self.name = name def greeting(self): return 'hi, my name is {}'.format(self.name) some_person = person('Nobody') print(some_person.greeting())
def solve(data): result = 0 # Declares an unordered collection of unique elements unique_frequencies = set() while True: for number in data: result += number # Checks if current sum(result) already exists in the collection if result in unique_frequencies: # Breaks out of the function and returns the result return result # Adds current sum(result) to the collection unique_frequencies.add(result)
def solve(data): result = 0 unique_frequencies = set() while True: for number in data: result += number if result in unique_frequencies: return result unique_frequencies.add(result)
class InMemoryStorage: __instance = None def __init__(self): self.room_data = dict() self.user_data = dict() @classmethod def __getInstance(cls): return cls.__instance @classmethod def instance(cls, *args, **kargs): cls.__instance = cls(*args, **kargs) cls.instance = cls.__getInstance return cls.__instance def join_user(self, user_id, room_id, user_info): self.room_data[room_id]['users'][user_id] = { 'score': 0, 'nickname': user_info['nickname'], 'character': user_info['character'] } storage = InMemoryStorage.instance() """ { room_id: { 'round': int, 'problem': str, 'host': int 'paint': ???(ask to SH), 'remaining_time': int, 'status': Enum, 'is_public': bool, 'users': { session_id: { 'score': int, 'nickname: str, 'character': str } } 'correct_users': [session_id], 'drawer': session_id } } """
class Inmemorystorage: __instance = None def __init__(self): self.room_data = dict() self.user_data = dict() @classmethod def __get_instance(cls): return cls.__instance @classmethod def instance(cls, *args, **kargs): cls.__instance = cls(*args, **kargs) cls.instance = cls.__getInstance return cls.__instance def join_user(self, user_id, room_id, user_info): self.room_data[room_id]['users'][user_id] = {'score': 0, 'nickname': user_info['nickname'], 'character': user_info['character']} storage = InMemoryStorage.instance() "\n{\n\troom_id: {\n\t\t'round': int,\n\t\t'problem': str,\n\t\t'host': int\n\t\t'paint': ???(ask to SH),\n\t\t'remaining_time': int,\n\t\t'status': Enum,\n\t\t'is_public': bool,\n\t\t'users': {\n\t\t\tsession_id: {\n\t\t\t\t'score': int,\n\t\t\t\t'nickname: str,\n\t\t\t\t'character': str\n\t\t\t}\n\t\t}\n\t\t'correct_users': [session_id],\n\t\t'drawer': session_id\n\t}\n}\n"
def next_13_numbers_product(num, start): if start + 13 > len(num): return 0 x = 1 for index in range(start, start + 13): x *= int(num[index]) return x number = "73167176531330624919225119674426574742355349194934\ 96983520312774506326239578318016984801869478851843\ 85861560789112949495459501737958331952853208805511\ 12540698747158523863050715693290963295227443043557\ 66896648950445244523161731856403098711121722383113\ 62229893423380308135336276614282806444486645238749\ 30358907296290491560440772390713810515859307960866\ 70172427121883998797908792274921901699720888093776\ 65727333001053367881220235421809751254540594752243\ 52584907711670556013604839586446706324415722155397\ 53697817977846174064955149290862569321978468622482\ 83972241375657056057490261407972968652414535100474\ 82166370484403199890008895243450658541227588666881\ 16427171479924442928230863465674813919123162824586\ 17866458359124566529476545682848912883142607690042\ 24219022671055626321111109370544217506941658960408\ 07198403850962455444362981230987879927244284909188\ 84580156166097919133875499200524063689912560717606\ 05886116467109405077541002256983155200055935729725\ 71636269561882670428252483600823257530420752963450" maxValue = 0 for i in range(0, len(number)): value = next_13_numbers_product(number, i) maxValue = value if value > maxValue else maxValue print(maxValue)
def next_13_numbers_product(num, start): if start + 13 > len(num): return 0 x = 1 for index in range(start, start + 13): x *= int(num[index]) return x number = '7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450' max_value = 0 for i in range(0, len(number)): value = next_13_numbers_product(number, i) max_value = value if value > maxValue else maxValue print(maxValue)
class Solution: def intervalIntersection(self, A: List[List[int]], B: List[List[int]]) -> List[List[int]]: ans = [] i = 0 j = 0 while i < len(A) and j < len(B): if A[i][0] <= B[j][0] and A[i][1] >= B[j][1]: C = [] C.append(B[j][0]) C.append(B[j][1]) ans.append(C) elif B[j][0] <= A[i][0] and B[j][1] >= A[i][1]: C = [] C.append(A[i][0]) C.append(A[i][1]) ans.append(C) elif A[i][0] <= B[j][0] and B[j][0] <= A[i][1] and A[i][1] <= B[j][1]: C = [] C.append(B[j][0]) C.append(A[i][1]) ans.append(C) elif B[j][0] <= A[i][0] and A[i][0] <= B[j][1] and B[j][1] <= A[i][1]: C = [] C.append(A[i][0]) C.append(B[j][1]) ans.append(C) if A[i][1] < B[j][1]: i += 1 else: j += 1 return ans
class Solution: def interval_intersection(self, A: List[List[int]], B: List[List[int]]) -> List[List[int]]: ans = [] i = 0 j = 0 while i < len(A) and j < len(B): if A[i][0] <= B[j][0] and A[i][1] >= B[j][1]: c = [] C.append(B[j][0]) C.append(B[j][1]) ans.append(C) elif B[j][0] <= A[i][0] and B[j][1] >= A[i][1]: c = [] C.append(A[i][0]) C.append(A[i][1]) ans.append(C) elif A[i][0] <= B[j][0] and B[j][0] <= A[i][1] and (A[i][1] <= B[j][1]): c = [] C.append(B[j][0]) C.append(A[i][1]) ans.append(C) elif B[j][0] <= A[i][0] and A[i][0] <= B[j][1] and (B[j][1] <= A[i][1]): c = [] C.append(A[i][0]) C.append(B[j][1]) ans.append(C) if A[i][1] < B[j][1]: i += 1 else: j += 1 return ans
def fibonacci(): a = 0 b = 1 while True: # keep going... yield a # report value, a, during this pass future = a + b a = b # this will be next value reported b = future # and subsequently this
def fibonacci(): a = 0 b = 1 while True: yield a future = a + b a = b b = future
X = int(input()) Y = int(input()) print(int(input())*60 + int(input())) a = int(input()) print(a//60) print(a%60) x=int(input()) h=int(input()) m=int(input()) print(h+(x+m)//60) print((x+m)%60)
x = int(input()) y = int(input()) print(int(input()) * 60 + int(input())) a = int(input()) print(a // 60) print(a % 60) x = int(input()) h = int(input()) m = int(input()) print(h + (x + m) // 60) print((x + m) % 60)
def confusion_matrix(yreal, ypred): n_classes = len(set(yreal)) new_matrix = [] print("len yreal: ", len(yreal)) print("len ypred: ", len(ypred)) print("n classes: ", n_classes) for i_class in range(n_classes): new_matrix.append([]) for _ in range(n_classes): #i_ypred new_matrix[i_class].append(0.0) for i_yreal in range(len(yreal)): new_matrix[yreal[i_yreal]][ypred[i_yreal]] += 1 return new_matrix def normalize(confusion_matrix): new_matrix = [] for irow in range(len(confusion_matrix)): new_matrix.append([]) sum_row = sum(confusion_matrix[irow]) for idata in range(len(confusion_matrix[irow])): if sum_row == 0: new_matrix[irow].append(0.0) else: new_matrix[irow].append(confusion_matrix[irow][idata]/float(sum_row)) return new_matrix
def confusion_matrix(yreal, ypred): n_classes = len(set(yreal)) new_matrix = [] print('len yreal: ', len(yreal)) print('len ypred: ', len(ypred)) print('n classes: ', n_classes) for i_class in range(n_classes): new_matrix.append([]) for _ in range(n_classes): new_matrix[i_class].append(0.0) for i_yreal in range(len(yreal)): new_matrix[yreal[i_yreal]][ypred[i_yreal]] += 1 return new_matrix def normalize(confusion_matrix): new_matrix = [] for irow in range(len(confusion_matrix)): new_matrix.append([]) sum_row = sum(confusion_matrix[irow]) for idata in range(len(confusion_matrix[irow])): if sum_row == 0: new_matrix[irow].append(0.0) else: new_matrix[irow].append(confusion_matrix[irow][idata] / float(sum_row)) return new_matrix
def quicksort(array): if len(array) < 2: return array print(quicksort([ ]))
def quicksort(array): if len(array) < 2: return array print(quicksort([]))
"""Generate a file. In this example, the content is passed via an attribute. If you generate large files with a lot of static content, consider using `ctx.actions.expand_template` instead. """ def file(**kwargs): _file(out = "{name}.txt".format(**kwargs), **kwargs) def _impl(ctx): output = ctx.outputs.out ctx.actions.write(output = output, content = ctx.attr.content) _file = rule( implementation = _impl, attrs = {"content": attr.string(), "out": attr.output()}, )
"""Generate a file. In this example, the content is passed via an attribute. If you generate large files with a lot of static content, consider using `ctx.actions.expand_template` instead. """ def file(**kwargs): _file(out='{name}.txt'.format(**kwargs), **kwargs) def _impl(ctx): output = ctx.outputs.out ctx.actions.write(output=output, content=ctx.attr.content) _file = rule(implementation=_impl, attrs={'content': attr.string(), 'out': attr.output()})
# Assign String to a Variable a = 'Hello' print (a,'\n') # Multiline Strings # using three double quotes: b = """Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.""" print(b,'\n') # using three single quotes: b = '''Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.''' print(b,'\n') # Strings are Arrays a = 'I Love Bangladesh' print(a[2],'\n') # at index 2 we will get 'L', beecause array index start from 0. # Looping Through a String for x in "Bangladesh": print(x) print('\n') # String Length p = 'I Love Bangladesh' print('length of p: ',len(p),'\n') # The len() function returns the length of a string # Check String """ To check if a certain phrase or character is present in a string, we can use the keyword 'in'. it will returns Boolean(true/false). """ txt = "I Love Bangladesh" print("my" in txt," 'my' is not present in txt ") # it will print False print("I" in txt," 'I' is present in txt ") # it will print True if "Love" in txt: print("Yes, 'Love' is present in txt.\n") # Check if NOT """ To check if a certain phrase or character is NOT present in a string, we can use the keyword 'not in'. """ print("my" not in txt," 'my' is not present in txt ") # it will print True print("I" not in txt," 'I' is present in txt ") # it will print False if 'base' not in txt: print("No, 'base' is NOT present in txt.")
a = 'Hello' print(a, '\n') b = 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit,\nsed do eiusmod tempor incididunt.' print(b, '\n') b = 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit,\nsed do eiusmod tempor incididunt\nut labore et dolore magna aliqua.' print(b, '\n') a = 'I Love Bangladesh' print(a[2], '\n') for x in 'Bangladesh': print(x) print('\n') p = 'I Love Bangladesh' print('length of p: ', len(p), '\n') " To check if a certain phrase or character is present in a string, we can use the keyword 'in'. \nit will returns Boolean(true/false). " txt = 'I Love Bangladesh' print('my' in txt, " 'my' is not present in txt ") print('I' in txt, " 'I' is present in txt ") if 'Love' in txt: print("Yes, 'Love' is present in txt.\n") " To check if a certain phrase or character is NOT present in a string, we can use the keyword 'not in'. " print('my' not in txt, " 'my' is not present in txt ") print('I' not in txt, " 'I' is present in txt ") if 'base' not in txt: print("No, 'base' is NOT present in txt.")
# # PySNMP MIB module Unisphere-Data-SONET-CONF (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Unisphere-Data-SONET-CONF # Produced by pysmi-0.3.4 at Wed May 1 15:32:59 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint") ModuleCompliance, NotificationGroup, AgentCapabilities = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "AgentCapabilities") iso, ModuleIdentity, TimeTicks, Integer32, ObjectIdentity, Counter64, Gauge32, Unsigned32, Counter32, NotificationType, Bits, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "ModuleIdentity", "TimeTicks", "Integer32", "ObjectIdentity", "Counter64", "Gauge32", "Unsigned32", "Counter32", "NotificationType", "Bits", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") sonetLineStuff2, sonetSectionStuff, sonetVTStuff2, sonetMediumTimeElapsed, sonetVTStuff, sonetMediumLineType, sonetMediumValidIntervals, sonetSectionStuff2, sonetPathStuff2, sonetFarEndPathStuff2, sonetFarEndVTStuff2, sonetFarEndLineStuff2, sonetMediumStuff2, sonetMediumStuff, sonetPathStuff, sonetLineStuff, sonetMediumLoopbackConfig, sonetMediumLineCoding = mibBuilder.importSymbols("SONET-MIB", "sonetLineStuff2", "sonetSectionStuff", "sonetVTStuff2", "sonetMediumTimeElapsed", "sonetVTStuff", "sonetMediumLineType", "sonetMediumValidIntervals", "sonetSectionStuff2", "sonetPathStuff2", "sonetFarEndPathStuff2", "sonetFarEndVTStuff2", "sonetFarEndLineStuff2", "sonetMediumStuff2", "sonetMediumStuff", "sonetPathStuff", "sonetLineStuff", "sonetMediumLoopbackConfig", "sonetMediumLineCoding") usDataAgents, = mibBuilder.importSymbols("Unisphere-Data-Agents", "usDataAgents") usdSonetGroup, usdSonetVirtualTributaryGroup, usdSonetPathGroup = mibBuilder.importSymbols("Unisphere-Data-SONET-MIB", "usdSonetGroup", "usdSonetVirtualTributaryGroup", "usdSonetPathGroup") usdSonetAgent = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40)) usdSonetAgent.setRevisions(('2002-02-04 21:35', '2001-04-03 22:35',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: usdSonetAgent.setRevisionsDescriptions(('Separate out the SONET VT support.', 'The initial release of this management information module.',)) if mibBuilder.loadTexts: usdSonetAgent.setLastUpdated('200202042135Z') if mibBuilder.loadTexts: usdSonetAgent.setOrganization('Unisphere Networks, Inc.') if mibBuilder.loadTexts: usdSonetAgent.setContactInfo(' Unisphere Networks, Inc. Postal: 10 Technology Park Drive Westford, MA 01886 USA Tel: +1 978 589 5800 E-mail: mib@UnisphereNetworks.com') if mibBuilder.loadTexts: usdSonetAgent.setDescription('The agent capabilities definitions for the SONET component of the SNMP agent in the Unisphere Routing Switch family of products.') usdSonetAgentV1 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetAgentV1 = usdSonetAgentV1.setProductRelease('Version 1 of the SONET component of the Unisphere Routing Switch SNMP\n agent. This version of the SONET component was supported in the\n Unisphere RX 1.x system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetAgentV1 = usdSonetAgentV1.setStatus('obsolete') if mibBuilder.loadTexts: usdSonetAgentV1.setDescription('The MIBs supported by the SNMP agent for the SONET application in the Unisphere Routing Switch. These capabilities became obsolete when support for the standard VT group was added.') usdSonetAgentV2 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 2)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetAgentV2 = usdSonetAgentV2.setProductRelease('Version 2 of the SONET component of the Unisphere Routing Switch SNMP\n agent. This version of the SONET component was supported in the\n Unisphere RX 2.x system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetAgentV2 = usdSonetAgentV2.setStatus('obsolete') if mibBuilder.loadTexts: usdSonetAgentV2.setDescription('The MIBs supported by the SNMP agent for the SONET application in the Unisphere Routing Switch. These capabilities became obsolete when support for the proprietary path and VT groups were added.') usdSonetAgentV3 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 3)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetAgentV3 = usdSonetAgentV3.setProductRelease('Version 3 of the SONET component of the Unisphere Routing Switch SNMP\n agent. This version of the SONET component was supported in the\n Unisphere RX 3.0 and 3.1 system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetAgentV3 = usdSonetAgentV3.setStatus('obsolete') if mibBuilder.loadTexts: usdSonetAgentV3.setDescription('The MIBs supported by the SNMP agent for the SONET application in the Unisphere Routing Switch. These capabilities became obsolete when support for the RFC-2558 version of the SONET-MIB and far-end statistics were added.') usdSonetAgentV4 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 4)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetAgentV4 = usdSonetAgentV4.setProductRelease('Version 4 of the SONET component of the Unisphere Routing Switch SNMP\n agent. This version of the SONET component was supported in the\n Unisphere RX 3.2 system release.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetAgentV4 = usdSonetAgentV4.setStatus('obsolete') if mibBuilder.loadTexts: usdSonetAgentV4.setDescription('The MIBs supported by the SNMP agent for the SONET application in the Unisphere Routing Switch. These capabilities became obsolete when Virtual Tributary (VT) support was searated out into a separate capabilities statement.') usdSonetBasicAgent = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 5)) usdSonetBasicAgentV1 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 5, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetBasicAgentV1 = usdSonetBasicAgentV1.setProductRelease('Version 1 of the basic SONET component of the Unisphere Routing Switch\n SNMP agent. It does not include Virtual Tributary (VT) support. This\n version of the basic SONET component is supported in the Unisphere RX\n 3.3 and subsequent system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetBasicAgentV1 = usdSonetBasicAgentV1.setStatus('current') if mibBuilder.loadTexts: usdSonetBasicAgentV1.setDescription('The MIB conformance groups supported by the SNMP agent for the SONET application in the Unisphere Routing Switch.') usdSonetVTAgent = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 6)) usdSonetVTAgentV1 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 6, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetVTAgentV1 = usdSonetVTAgentV1.setProductRelease('Version 1 of the SONET VT component of the Unisphere Routing Switch\n SNMP agent. This version of the SONET component is supported in the\n Unisphere RX 3.3 and subsequent system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdSonetVTAgentV1 = usdSonetVTAgentV1.setStatus('current') if mibBuilder.loadTexts: usdSonetVTAgentV1.setDescription('The MIB conformance groups supported by the SNMP agent for the SONET application in the Unisphere Routing Switch.') mibBuilder.exportSymbols("Unisphere-Data-SONET-CONF", usdSonetVTAgentV1=usdSonetVTAgentV1, usdSonetAgentV3=usdSonetAgentV3, usdSonetAgentV4=usdSonetAgentV4, usdSonetAgentV1=usdSonetAgentV1, usdSonetVTAgent=usdSonetVTAgent, usdSonetBasicAgent=usdSonetBasicAgent, usdSonetAgentV2=usdSonetAgentV2, usdSonetAgent=usdSonetAgent, PYSNMP_MODULE_ID=usdSonetAgent, usdSonetBasicAgentV1=usdSonetBasicAgentV1)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_union, value_range_constraint, constraints_intersection, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint') (module_compliance, notification_group, agent_capabilities) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'AgentCapabilities') (iso, module_identity, time_ticks, integer32, object_identity, counter64, gauge32, unsigned32, counter32, notification_type, bits, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, mib_identifier) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'ModuleIdentity', 'TimeTicks', 'Integer32', 'ObjectIdentity', 'Counter64', 'Gauge32', 'Unsigned32', 'Counter32', 'NotificationType', 'Bits', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'MibIdentifier') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') (sonet_line_stuff2, sonet_section_stuff, sonet_vt_stuff2, sonet_medium_time_elapsed, sonet_vt_stuff, sonet_medium_line_type, sonet_medium_valid_intervals, sonet_section_stuff2, sonet_path_stuff2, sonet_far_end_path_stuff2, sonet_far_end_vt_stuff2, sonet_far_end_line_stuff2, sonet_medium_stuff2, sonet_medium_stuff, sonet_path_stuff, sonet_line_stuff, sonet_medium_loopback_config, sonet_medium_line_coding) = mibBuilder.importSymbols('SONET-MIB', 'sonetLineStuff2', 'sonetSectionStuff', 'sonetVTStuff2', 'sonetMediumTimeElapsed', 'sonetVTStuff', 'sonetMediumLineType', 'sonetMediumValidIntervals', 'sonetSectionStuff2', 'sonetPathStuff2', 'sonetFarEndPathStuff2', 'sonetFarEndVTStuff2', 'sonetFarEndLineStuff2', 'sonetMediumStuff2', 'sonetMediumStuff', 'sonetPathStuff', 'sonetLineStuff', 'sonetMediumLoopbackConfig', 'sonetMediumLineCoding') (us_data_agents,) = mibBuilder.importSymbols('Unisphere-Data-Agents', 'usDataAgents') (usd_sonet_group, usd_sonet_virtual_tributary_group, usd_sonet_path_group) = mibBuilder.importSymbols('Unisphere-Data-SONET-MIB', 'usdSonetGroup', 'usdSonetVirtualTributaryGroup', 'usdSonetPathGroup') usd_sonet_agent = module_identity((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40)) usdSonetAgent.setRevisions(('2002-02-04 21:35', '2001-04-03 22:35')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: usdSonetAgent.setRevisionsDescriptions(('Separate out the SONET VT support.', 'The initial release of this management information module.')) if mibBuilder.loadTexts: usdSonetAgent.setLastUpdated('200202042135Z') if mibBuilder.loadTexts: usdSonetAgent.setOrganization('Unisphere Networks, Inc.') if mibBuilder.loadTexts: usdSonetAgent.setContactInfo(' Unisphere Networks, Inc. Postal: 10 Technology Park Drive Westford, MA 01886 USA Tel: +1 978 589 5800 E-mail: mib@UnisphereNetworks.com') if mibBuilder.loadTexts: usdSonetAgent.setDescription('The agent capabilities definitions for the SONET component of the SNMP agent in the Unisphere Routing Switch family of products.') usd_sonet_agent_v1 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_agent_v1 = usdSonetAgentV1.setProductRelease('Version 1 of the SONET component of the Unisphere Routing Switch SNMP\n agent. This version of the SONET component was supported in the\n Unisphere RX 1.x system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_agent_v1 = usdSonetAgentV1.setStatus('obsolete') if mibBuilder.loadTexts: usdSonetAgentV1.setDescription('The MIBs supported by the SNMP agent for the SONET application in the Unisphere Routing Switch. These capabilities became obsolete when support for the standard VT group was added.') usd_sonet_agent_v2 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 2)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_agent_v2 = usdSonetAgentV2.setProductRelease('Version 2 of the SONET component of the Unisphere Routing Switch SNMP\n agent. This version of the SONET component was supported in the\n Unisphere RX 2.x system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_agent_v2 = usdSonetAgentV2.setStatus('obsolete') if mibBuilder.loadTexts: usdSonetAgentV2.setDescription('The MIBs supported by the SNMP agent for the SONET application in the Unisphere Routing Switch. These capabilities became obsolete when support for the proprietary path and VT groups were added.') usd_sonet_agent_v3 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 3)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_agent_v3 = usdSonetAgentV3.setProductRelease('Version 3 of the SONET component of the Unisphere Routing Switch SNMP\n agent. This version of the SONET component was supported in the\n Unisphere RX 3.0 and 3.1 system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_agent_v3 = usdSonetAgentV3.setStatus('obsolete') if mibBuilder.loadTexts: usdSonetAgentV3.setDescription('The MIBs supported by the SNMP agent for the SONET application in the Unisphere Routing Switch. These capabilities became obsolete when support for the RFC-2558 version of the SONET-MIB and far-end statistics were added.') usd_sonet_agent_v4 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 4)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_agent_v4 = usdSonetAgentV4.setProductRelease('Version 4 of the SONET component of the Unisphere Routing Switch SNMP\n agent. This version of the SONET component was supported in the\n Unisphere RX 3.2 system release.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_agent_v4 = usdSonetAgentV4.setStatus('obsolete') if mibBuilder.loadTexts: usdSonetAgentV4.setDescription('The MIBs supported by the SNMP agent for the SONET application in the Unisphere Routing Switch. These capabilities became obsolete when Virtual Tributary (VT) support was searated out into a separate capabilities statement.') usd_sonet_basic_agent = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 5)) usd_sonet_basic_agent_v1 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 5, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_basic_agent_v1 = usdSonetBasicAgentV1.setProductRelease('Version 1 of the basic SONET component of the Unisphere Routing Switch\n SNMP agent. It does not include Virtual Tributary (VT) support. This\n version of the basic SONET component is supported in the Unisphere RX\n 3.3 and subsequent system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_basic_agent_v1 = usdSonetBasicAgentV1.setStatus('current') if mibBuilder.loadTexts: usdSonetBasicAgentV1.setDescription('The MIB conformance groups supported by the SNMP agent for the SONET application in the Unisphere Routing Switch.') usd_sonet_vt_agent = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 6)) usd_sonet_vt_agent_v1 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 40, 6, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_vt_agent_v1 = usdSonetVTAgentV1.setProductRelease('Version 1 of the SONET VT component of the Unisphere Routing Switch\n SNMP agent. This version of the SONET component is supported in the\n Unisphere RX 3.3 and subsequent system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usd_sonet_vt_agent_v1 = usdSonetVTAgentV1.setStatus('current') if mibBuilder.loadTexts: usdSonetVTAgentV1.setDescription('The MIB conformance groups supported by the SNMP agent for the SONET application in the Unisphere Routing Switch.') mibBuilder.exportSymbols('Unisphere-Data-SONET-CONF', usdSonetVTAgentV1=usdSonetVTAgentV1, usdSonetAgentV3=usdSonetAgentV3, usdSonetAgentV4=usdSonetAgentV4, usdSonetAgentV1=usdSonetAgentV1, usdSonetVTAgent=usdSonetVTAgent, usdSonetBasicAgent=usdSonetBasicAgent, usdSonetAgentV2=usdSonetAgentV2, usdSonetAgent=usdSonetAgent, PYSNMP_MODULE_ID=usdSonetAgent, usdSonetBasicAgentV1=usdSonetBasicAgentV1)
name1=["ales","Mark","Deny","Hendry"] name2=name1 name3=name1[:] name1=["Anand"] name3=["Murugan"] sum=0 for ls in (name1,name2,name3): if ls[0]=="Anand": sum+=1 pass if ls[1]=="Murugan": sum+=5 print(sum) pass
name1 = ['ales', 'Mark', 'Deny', 'Hendry'] name2 = name1 name3 = name1[:] name1 = ['Anand'] name3 = ['Murugan'] sum = 0 for ls in (name1, name2, name3): if ls[0] == 'Anand': sum += 1 pass if ls[1] == 'Murugan': sum += 5 print(sum) pass
def solution(): def integers(): x = 1 while True: yield x x += 1 def halves(): for x in integers(): yield x / 2 def take(n, seq): result = [] for i in range(n): result.append(next(seq)) return result return take, halves, integers take = solution()[0] halves = solution()[1] print(take(5, halves()))
def solution(): def integers(): x = 1 while True: yield x x += 1 def halves(): for x in integers(): yield (x / 2) def take(n, seq): result = [] for i in range(n): result.append(next(seq)) return result return (take, halves, integers) take = solution()[0] halves = solution()[1] print(take(5, halves()))
"""Classes for stateful data stream sampling """ def create_sampler(mode, **kwargs): """Creates a specified sampler instance """ if mode == 'uniform': return UniformSampler(**kwargs) elif mode == 'contiguous': return ContiguousSampler(**kwargs) else: raise ValueError('Unknown sampling mode: %s' % mode) class UniformSampler(object): """Uniform samples from a stream to maintain a certain ratio of validation data """ def __init__(self, rate): self.rate = rate self.num_all = 0 self.num_val = 0 def reset(self): self.num_all = 0 self.num_val = 0 def sample(self): """Returns whether to pull the sample for validation """ pull_val = self.num_val <= self.num_all * self.rate self.num_all += 1 if pull_val: self.num_val += 1 return pull_val class ContiguousSampler(object): """Samples fixed-lengths of data to maintain a ratio of validation data """ def __init__(self, rate, segment_length): self.rate = rate self.seg_len = segment_length self.num_all = 0 self.num_val = 0 self.is_pulling = False self.num_pulled = 0 def reset(self): self.num_all = 0 self.num_val = 0 self.is_pulling = False self.num_pulled = 0 def sample(self): """Returns whether to pull the sample for validation """ if not self.is_pulling: self.is_pulling = self.num_val < self.num_all * self.rate self.num_all += 1 if self.is_pulling: self.num_pulled += 1 if self.num_pulled >= self.seg_len: self.is_pulling = False self.num_pulled = 0 self.num_val += 1 return True else: return False
"""Classes for stateful data stream sampling """ def create_sampler(mode, **kwargs): """Creates a specified sampler instance """ if mode == 'uniform': return uniform_sampler(**kwargs) elif mode == 'contiguous': return contiguous_sampler(**kwargs) else: raise value_error('Unknown sampling mode: %s' % mode) class Uniformsampler(object): """Uniform samples from a stream to maintain a certain ratio of validation data """ def __init__(self, rate): self.rate = rate self.num_all = 0 self.num_val = 0 def reset(self): self.num_all = 0 self.num_val = 0 def sample(self): """Returns whether to pull the sample for validation """ pull_val = self.num_val <= self.num_all * self.rate self.num_all += 1 if pull_val: self.num_val += 1 return pull_val class Contiguoussampler(object): """Samples fixed-lengths of data to maintain a ratio of validation data """ def __init__(self, rate, segment_length): self.rate = rate self.seg_len = segment_length self.num_all = 0 self.num_val = 0 self.is_pulling = False self.num_pulled = 0 def reset(self): self.num_all = 0 self.num_val = 0 self.is_pulling = False self.num_pulled = 0 def sample(self): """Returns whether to pull the sample for validation """ if not self.is_pulling: self.is_pulling = self.num_val < self.num_all * self.rate self.num_all += 1 if self.is_pulling: self.num_pulled += 1 if self.num_pulled >= self.seg_len: self.is_pulling = False self.num_pulled = 0 self.num_val += 1 return True else: return False
# Copyright (c) 2017 Pieter Wuille # Copyright (c) 2018 Oskar Hladky # Copyright (c) 2018 Pavol Rusnak # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l" ADDRESS_TYPE_P2KH = 0 ADDRESS_TYPE_P2SH = 8 def cashaddr_polymod(values): generator = [0x98F2BC8E61, 0x79B76D99E2, 0xF33E5FB3C4, 0xAE2EABE2A8, 0x1E4F43E470] chk = 1 for value in values: top = chk >> 35 chk = ((chk & 0x07FFFFFFFF) << 5) ^ value for i in range(5): chk ^= generator[i] if (top & (1 << i)) else 0 return chk ^ 1 def prefix_expand(prefix): return [ord(x) & 0x1F for x in prefix] + [0] def calculate_checksum(prefix, payload): poly = cashaddr_polymod(prefix_expand(prefix) + payload + [0, 0, 0, 0, 0, 0, 0, 0]) out = list() for i in range(8): out.append((poly >> 5 * (7 - i)) & 0x1F) return out def verify_checksum(prefix, payload): return cashaddr_polymod(prefix_expand(prefix) + payload) == 0 def b32decode(inputs): out = list() for letter in inputs: out.append(CHARSET.find(letter)) return out def b32encode(inputs): out = "" for char_code in inputs: out += CHARSET[char_code] return out def convertbits(data, frombits, tobits, pad=True): acc = 0 bits = 0 ret = [] maxv = (1 << tobits) - 1 max_acc = (1 << (frombits + tobits - 1)) - 1 for value in data: if value < 0 or (value >> frombits): return None acc = ((acc << frombits) | value) & max_acc bits += frombits while bits >= tobits: bits -= tobits ret.append((acc >> bits) & maxv) if pad: if bits: ret.append((acc << (tobits - bits)) & maxv) elif bits >= frombits or ((acc << (tobits - bits)) & maxv): return None return ret def encode(prefix, version, payload): payload = bytes([version]) + payload payload = convertbits(payload, 8, 5) checksum = calculate_checksum(prefix, payload) return prefix + ":" + b32encode(payload + checksum) def decode(prefix, addr): addr = addr.lower() decoded = b32decode(addr) if not verify_checksum(prefix, decoded): raise ValueError("Bad cashaddr checksum") data = bytes(convertbits(decoded, 5, 8)) return data[0], data[1:-6]
charset = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l' address_type_p2_kh = 0 address_type_p2_sh = 8 def cashaddr_polymod(values): generator = [656907472481, 522768456162, 1044723512260, 748107326120, 130178868336] chk = 1 for value in values: top = chk >> 35 chk = (chk & 34359738367) << 5 ^ value for i in range(5): chk ^= generator[i] if top & 1 << i else 0 return chk ^ 1 def prefix_expand(prefix): return [ord(x) & 31 for x in prefix] + [0] def calculate_checksum(prefix, payload): poly = cashaddr_polymod(prefix_expand(prefix) + payload + [0, 0, 0, 0, 0, 0, 0, 0]) out = list() for i in range(8): out.append(poly >> 5 * (7 - i) & 31) return out def verify_checksum(prefix, payload): return cashaddr_polymod(prefix_expand(prefix) + payload) == 0 def b32decode(inputs): out = list() for letter in inputs: out.append(CHARSET.find(letter)) return out def b32encode(inputs): out = '' for char_code in inputs: out += CHARSET[char_code] return out def convertbits(data, frombits, tobits, pad=True): acc = 0 bits = 0 ret = [] maxv = (1 << tobits) - 1 max_acc = (1 << frombits + tobits - 1) - 1 for value in data: if value < 0 or value >> frombits: return None acc = (acc << frombits | value) & max_acc bits += frombits while bits >= tobits: bits -= tobits ret.append(acc >> bits & maxv) if pad: if bits: ret.append(acc << tobits - bits & maxv) elif bits >= frombits or acc << tobits - bits & maxv: return None return ret def encode(prefix, version, payload): payload = bytes([version]) + payload payload = convertbits(payload, 8, 5) checksum = calculate_checksum(prefix, payload) return prefix + ':' + b32encode(payload + checksum) def decode(prefix, addr): addr = addr.lower() decoded = b32decode(addr) if not verify_checksum(prefix, decoded): raise value_error('Bad cashaddr checksum') data = bytes(convertbits(decoded, 5, 8)) return (data[0], data[1:-6])
class Iec6205621Exception(Exception): """General IEC62056-21 Exception""" class Iec6205621ClientError(Iec6205621Exception): """Client error""" class Iec6205621ParseError(Iec6205621Exception): """Error in parsing IEC62056-21 data""" class ValidationError(Iec6205621Exception): """Not valid data error""" class TooManyValuesReturned(Iec6205621Exception): """If a request for a single value returned more than one value""" class NoDataReturned(Iec6205621Exception): """No data was returned""" class Iec6206521BaseErrorParser: """ Error messages are contained in DataSets and values without unit. Their format is manufacturer specific so the library can only define a way to handle them not the exact implementation. The DummyErrorParser will we used as standard that ignores all errors. An ErrorParser should take an answer response and parse each data set in it to see if there is any errors. It should raise appropriate exceptions. """ def __init__(self): pass def check_for_errors(self, answer_response): raise NotImplementedError("check_for_errors must be implemented in subclass") class DummyErrorParser(Iec6206521BaseErrorParser): """ A Dummy parser that fits in as default. Should be overridden if you want to define an error parser. """ def check_for_errors(self, answer_response): pass
class Iec6205621Exception(Exception): """General IEC62056-21 Exception""" class Iec6205621Clienterror(Iec6205621Exception): """Client error""" class Iec6205621Parseerror(Iec6205621Exception): """Error in parsing IEC62056-21 data""" class Validationerror(Iec6205621Exception): """Not valid data error""" class Toomanyvaluesreturned(Iec6205621Exception): """If a request for a single value returned more than one value""" class Nodatareturned(Iec6205621Exception): """No data was returned""" class Iec6206521Baseerrorparser: """ Error messages are contained in DataSets and values without unit. Their format is manufacturer specific so the library can only define a way to handle them not the exact implementation. The DummyErrorParser will we used as standard that ignores all errors. An ErrorParser should take an answer response and parse each data set in it to see if there is any errors. It should raise appropriate exceptions. """ def __init__(self): pass def check_for_errors(self, answer_response): raise not_implemented_error('check_for_errors must be implemented in subclass') class Dummyerrorparser(Iec6206521BaseErrorParser): """ A Dummy parser that fits in as default. Should be overridden if you want to define an error parser. """ def check_for_errors(self, answer_response): pass
lines = open('input','r').readlines() size_linea = 12 unos = [0,0,0,0,0,0,0,0,0,0,0,0] for line in lines: for i in range(size_linea): if (line[i] == '1'): unos[i] += 1 media = len(lines)/2 gamma = 0 epsilon = 0 for i in range(size_linea): if (unos[i] > media): gamma += 2**(size_linea - (i+1)) else: epsilon += 2**(size_linea - (i+1)) print(gamma) print(epsilon) print(gamma*epsilon)
lines = open('input', 'r').readlines() size_linea = 12 unos = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] for line in lines: for i in range(size_linea): if line[i] == '1': unos[i] += 1 media = len(lines) / 2 gamma = 0 epsilon = 0 for i in range(size_linea): if unos[i] > media: gamma += 2 ** (size_linea - (i + 1)) else: epsilon += 2 ** (size_linea - (i + 1)) print(gamma) print(epsilon) print(gamma * epsilon)
# Using flag prompt = "\nTell me your name, and I will reprint your name: " prompt += "\nEnter 'quit' to end the program." active = True while active: message = input(prompt) if message == 'quit': active = False else: print(message)
prompt = '\nTell me your name, and I will reprint your name: ' prompt += "\nEnter 'quit' to end the program." active = True while active: message = input(prompt) if message == 'quit': active = False else: print(message)
print('Numeros pares!!!') print('=-=' * 15) for c in range(2, 52, 2): print(c) print('=-=' * 15) print('ACABOU.')
print('Numeros pares!!!') print('=-=' * 15) for c in range(2, 52, 2): print(c) print('=-=' * 15) print('ACABOU.')
class medicamento: def __init__(self, id, nombre, precio, descripcion, cantidad, rol): self.id = id self.nombre = nombre self.precio = precio self.descripcion = descripcion self.cantidad = cantidad self.rol = rol def actualizar_datos(self, id, nombre, precio, descripcion, cantidad, rol): self.id = id self.nombre = nombre self.precio = precio self.descripcion = descripcion self.cantidad = cantidad self.rol = rol def dump(self): return { 'id': self.id, 'nombre': self.nombre, 'precio': self.precio, 'cantidad': self.cantidad, 'rol': self.rol } def __str__(self): return f"Medicamento: [ id: {self.id}, nombre: {self.nombre}, precio: {self.precio}, cantidad: {self.cantidad}, rol: {self.rol}]"
class Medicamento: def __init__(self, id, nombre, precio, descripcion, cantidad, rol): self.id = id self.nombre = nombre self.precio = precio self.descripcion = descripcion self.cantidad = cantidad self.rol = rol def actualizar_datos(self, id, nombre, precio, descripcion, cantidad, rol): self.id = id self.nombre = nombre self.precio = precio self.descripcion = descripcion self.cantidad = cantidad self.rol = rol def dump(self): return {'id': self.id, 'nombre': self.nombre, 'precio': self.precio, 'cantidad': self.cantidad, 'rol': self.rol} def __str__(self): return f'Medicamento: [ id: {self.id}, nombre: {self.nombre}, precio: {self.precio}, cantidad: {self.cantidad}, rol: {self.rol}]'
def test_it(binbb, groups_cfg): for account, accgrp_cfg in groups_cfg.items(): bbcmd = ["groups", "--account", account] res = binbb.sysexec(*bbcmd) # very simple test of group names and member names being seen in output for group_name, members in accgrp_cfg.items(): assert group_name in res for member_name in members: assert member_name in res
def test_it(binbb, groups_cfg): for (account, accgrp_cfg) in groups_cfg.items(): bbcmd = ['groups', '--account', account] res = binbb.sysexec(*bbcmd) for (group_name, members) in accgrp_cfg.items(): assert group_name in res for member_name in members: assert member_name in res
def pattern_eighten(steps): ''' Pattern eighteen 9 8 7 6 5 4 3 2 1 9 8 7 6 5 4 3 2 9 8 7 6 5 4 3 9 8 7 6 5 4 9 8 7 6 5 9 8 7 6 9 8 7 9 8 9 ''' get_range = [str(i) for i in range(1, steps + 1)][::-1] for i in range(len(get_range), 0, -1): join = ' '.join(get_range[:i]) print(join) if __name__ == '__main__': try: pattern_eighten(9) except NameError: print('Integer was expected')
def pattern_eighten(steps): """ Pattern eighteen 9 8 7 6 5 4 3 2 1 9 8 7 6 5 4 3 2 9 8 7 6 5 4 3 9 8 7 6 5 4 9 8 7 6 5 9 8 7 6 9 8 7 9 8 9 """ get_range = [str(i) for i in range(1, steps + 1)][::-1] for i in range(len(get_range), 0, -1): join = ' '.join(get_range[:i]) print(join) if __name__ == '__main__': try: pattern_eighten(9) except NameError: print('Integer was expected')
#!/usr/bin/env python3 class Album: """ Class representing an album """ def __init__(self, title): self.title = str(title) self.tracks = [] self.coverFile = None def add(self, track): self.tracks.append(track)
class Album: """ Class representing an album """ def __init__(self, title): self.title = str(title) self.tracks = [] self.coverFile = None def add(self, track): self.tracks.append(track)
# -*- coding: utf-8 -*- """ abide.registry ~~~~~~~~~~~~~~ """ class PropertyDoesNotExist(AttributeError): pass class AbidePropertyRegistry(): """ Contains the properties that have been registered for persistence. When a Class is created, the """ def __init__(self, *args, **kwargs): self._property_references = {} self._property_instances = {} def __iter__(self): yield from self._property_references def __contains__(self, prop_name): return prop_name in self._property_references def __len__(self): return len(self._property_references) def items(self): yield from self._property_references.items() def set_property(self, prop): self._property_references[prop.name] = prop def get_property(self, prop_name): try: return self._property_references[prop_name] except KeyError: raise PropertyDoesNotExist(prop_name) def remove_property(self, prop_name): try: del self._property_references[prop_name] except KeyError: raise PropertyDoesNotExist(prop_name) def has_property(self, prop_name): return prop_name in self._property_references def create_instance(self, prop_name): pass def merge(self, registry): """ Merge an existing AbideRegistry into this one, keeping properties already present in this one and only merging properties that don't yet exist. """ for property_name, property_item in registry.items(): if property_name not in self: self.set_property(property_item)
""" abide.registry ~~~~~~~~~~~~~~ """ class Propertydoesnotexist(AttributeError): pass class Abidepropertyregistry: """ Contains the properties that have been registered for persistence. When a Class is created, the """ def __init__(self, *args, **kwargs): self._property_references = {} self._property_instances = {} def __iter__(self): yield from self._property_references def __contains__(self, prop_name): return prop_name in self._property_references def __len__(self): return len(self._property_references) def items(self): yield from self._property_references.items() def set_property(self, prop): self._property_references[prop.name] = prop def get_property(self, prop_name): try: return self._property_references[prop_name] except KeyError: raise property_does_not_exist(prop_name) def remove_property(self, prop_name): try: del self._property_references[prop_name] except KeyError: raise property_does_not_exist(prop_name) def has_property(self, prop_name): return prop_name in self._property_references def create_instance(self, prop_name): pass def merge(self, registry): """ Merge an existing AbideRegistry into this one, keeping properties already present in this one and only merging properties that don't yet exist. """ for (property_name, property_item) in registry.items(): if property_name not in self: self.set_property(property_item)
# puck_properties_consts.py # # ~~~~~~~~~~~~ # # pyHand Constants File # # ~~~~~~~~~~~~ # # ------------------------------------------------------------------ # Authors : Chloe Eghtebas, # Brendan Ritter, # Pravina Samaratunga, # Jason Schwartz # # Last change: 08.08.2013 # # Language: Python 2.7 # ------------------------------------------------------------------ # # This version of pyHand 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. # #PuckID FINGER1 = 11 FINGER2 = 12 FINGER3 = 13 SPREAD = 14 ALL_FINGERS=(FINGER1,FINGER2,FINGER3,SPREAD) GRASP=(FINGER1,FINGER2,FINGER3) #Property = ID ACCEL = 82 ADDR = 6 ANA0 = 18 ANA1 = 19 BAUD = 12 CMD = 29 CMD_LOAD=0 CMD_SAVE=1 CMD_RESET=2 CMD_DEF=3 CMD_GET=4 CMD_FIND=5 CMD_SET=6 CMD_HOME=7 CMD_KEEP=8 CMD_LOOP=9 CMD_PASS=10 CMD_VERS=11 CMD_ERR=12 CMD_HI=13 CMD_IC=14 CMD_IO=15 CMD_TC=16 CMD_TO=17 CMD_CLOSE=18 CMD_MOVE=19 CMD_OPEN=20 CMD_TERM=21 CMD_HELP=22 CMD_PPSINIT=23 CMD_TESTEE=24 CT = 56 CT2 = 57 CTS = 68 CTS2 = 69 DEF = 32 DIG0 = 14 DIG1 = 15 DP = 50 DP2 = 51 DS = 60 E = 52 E2 = 53 ECMAX = 101 ECMIN = 102 EN = 94 EN2 = 95 ERROR = 4 FET0 = 16 FET1 = 17 FIND = 33 GRPA = 26 GRPB = 27 GRPC = 28 HALLH = 88 HALLH2 = 89 HALLS = 87 HOLD = 77 HSG = 71 ID = 3 IHIT = 108 IKCOR = 93 IKI = 92 IKP = 91 ILOGIC = 24 IMOTOR = 22 IOFF = 74 IOFF2 = 75 IOFST = 62 IPNM = 86 IVEL = 73 JIDX = 85 JOFST = 98 JOFST2 = 99 JP = 96 JP2 = 97 KD = 80 KI = 81 KP = 79 LCTC = 104 LCVC = 105 LFLAGS = 103 LOAD = 31 LOCK = 13 LSG = 72 M = 58 M2 = 59 MAX_ENCODER_TICKS=195000.0 MAX_SPREAD_TICKS=36000.0 MAX_FINGERTIP_TICKS=78000.0 MCV = 46 MDS = 65 MECH = 66 MECH2 = 67 MODE = 8 MODE_IDLE=0 MODE_TORQUE=2 MODE_PID=3 MODE_VEL=4 MODE_TRAP=5 MOFST = 61 MOV = 47 MPE = 76 MT = 43 MV = 45 OD = 64 OT = 54 OT2 = 55 OTEMP = 11 P = 48 P2 = 49 PIDX = 70 POLES = 90 PTEMP = 10 ROLE = 1 SAVE = 30 SG = 25 SN = 2 STAT = 5 T = 42 TACT = 106 TACT_FULL=2 TACT_10=1 TACTID = 107 TACTID = 107 TEMP = 9 TENSO = 84 TENST = 83 THERM = 20 TIE = 100 TSTOP = 78 UPSECS = 63 V = 44 VALUE = 7 VBUS = 21 VERS = 0 VLOGIC = 23 X0 = 34 X1 = 35 X2 = 36 X3 = 37 X4 = 38 X5 = 39 X6 = 40 X7 = 41 FTS = 8 FTS_SG1 = 42 FTS_SG2 = 43 FTS_SG3 = 44 FTS_SG4 = 45 FTS_SG5 = 46 FTS_SG6 = 47 FTS_FX = 48 FTS_FY = 49 FTS_FZ = 50 FTS_TX = 51 FTS_TY = 52 FTS_TZ = 53 FTS_FT = 54 FTS_AX = 55 FTS_AY = 56 FTS_AZ = 57 FTS_GM = 58 FTS_OV = 59 FTS_LED = 60 FTS_T1 = 61 FTS_T2 = 62 FTS_T3 = 63 FTS_A = 64 NO_WRITE_PROPERTIES = [ANA0, ANA1, CT2, DP2, E2, EN2, ERROR, HALLH2, ILOGIC, IMOTOR, IOFF2, JOFST2, JP2, M2, MECH, MECH2, OT2, P2, SG, TEMP, THERM, VBUS, VLOGIC] NO_READ_PROPERTIES = [CMD, CT2, DEF, DP2, E2, EN2, FIND, HALLH2, IOFF2, JOFST2, JP2, LOAD, LOCK, M, M2, MECH2, OT2, P2, SAVE] LOCKED_PROPERTIES = [DIG0, DIG1, FET0, FET1, HALLH, HALLS, OD, PTEMP, ROLE, SN]
finger1 = 11 finger2 = 12 finger3 = 13 spread = 14 all_fingers = (FINGER1, FINGER2, FINGER3, SPREAD) grasp = (FINGER1, FINGER2, FINGER3) accel = 82 addr = 6 ana0 = 18 ana1 = 19 baud = 12 cmd = 29 cmd_load = 0 cmd_save = 1 cmd_reset = 2 cmd_def = 3 cmd_get = 4 cmd_find = 5 cmd_set = 6 cmd_home = 7 cmd_keep = 8 cmd_loop = 9 cmd_pass = 10 cmd_vers = 11 cmd_err = 12 cmd_hi = 13 cmd_ic = 14 cmd_io = 15 cmd_tc = 16 cmd_to = 17 cmd_close = 18 cmd_move = 19 cmd_open = 20 cmd_term = 21 cmd_help = 22 cmd_ppsinit = 23 cmd_testee = 24 ct = 56 ct2 = 57 cts = 68 cts2 = 69 def = 32 dig0 = 14 dig1 = 15 dp = 50 dp2 = 51 ds = 60 e = 52 e2 = 53 ecmax = 101 ecmin = 102 en = 94 en2 = 95 error = 4 fet0 = 16 fet1 = 17 find = 33 grpa = 26 grpb = 27 grpc = 28 hallh = 88 hallh2 = 89 halls = 87 hold = 77 hsg = 71 id = 3 ihit = 108 ikcor = 93 iki = 92 ikp = 91 ilogic = 24 imotor = 22 ioff = 74 ioff2 = 75 iofst = 62 ipnm = 86 ivel = 73 jidx = 85 jofst = 98 jofst2 = 99 jp = 96 jp2 = 97 kd = 80 ki = 81 kp = 79 lctc = 104 lcvc = 105 lflags = 103 load = 31 lock = 13 lsg = 72 m = 58 m2 = 59 max_encoder_ticks = 195000.0 max_spread_ticks = 36000.0 max_fingertip_ticks = 78000.0 mcv = 46 mds = 65 mech = 66 mech2 = 67 mode = 8 mode_idle = 0 mode_torque = 2 mode_pid = 3 mode_vel = 4 mode_trap = 5 mofst = 61 mov = 47 mpe = 76 mt = 43 mv = 45 od = 64 ot = 54 ot2 = 55 otemp = 11 p = 48 p2 = 49 pidx = 70 poles = 90 ptemp = 10 role = 1 save = 30 sg = 25 sn = 2 stat = 5 t = 42 tact = 106 tact_full = 2 tact_10 = 1 tactid = 107 tactid = 107 temp = 9 tenso = 84 tenst = 83 therm = 20 tie = 100 tstop = 78 upsecs = 63 v = 44 value = 7 vbus = 21 vers = 0 vlogic = 23 x0 = 34 x1 = 35 x2 = 36 x3 = 37 x4 = 38 x5 = 39 x6 = 40 x7 = 41 fts = 8 fts_sg1 = 42 fts_sg2 = 43 fts_sg3 = 44 fts_sg4 = 45 fts_sg5 = 46 fts_sg6 = 47 fts_fx = 48 fts_fy = 49 fts_fz = 50 fts_tx = 51 fts_ty = 52 fts_tz = 53 fts_ft = 54 fts_ax = 55 fts_ay = 56 fts_az = 57 fts_gm = 58 fts_ov = 59 fts_led = 60 fts_t1 = 61 fts_t2 = 62 fts_t3 = 63 fts_a = 64 no_write_properties = [ANA0, ANA1, CT2, DP2, E2, EN2, ERROR, HALLH2, ILOGIC, IMOTOR, IOFF2, JOFST2, JP2, M2, MECH, MECH2, OT2, P2, SG, TEMP, THERM, VBUS, VLOGIC] no_read_properties = [CMD, CT2, DEF, DP2, E2, EN2, FIND, HALLH2, IOFF2, JOFST2, JP2, LOAD, LOCK, M, M2, MECH2, OT2, P2, SAVE] locked_properties = [DIG0, DIG1, FET0, FET1, HALLH, HALLS, OD, PTEMP, ROLE, SN]
# # @lc app=leetcode id=680 lang=python3 # # [680] Valid Palindrome II # # https://leetcode.com/problems/valid-palindrome-ii/description/ # # algorithms # Easy (37.22%) # Total Accepted: 275.1K # Total Submissions: 737.9K # Testcase Example: '"aba"' # # Given a string s, return true if the s can be palindrome after deleting at # most one character from it. # # # Example 1: # # # Input: s = "aba" # Output: true # # # Example 2: # # # Input: s = "abca" # Output: true # Explanation: You could delete the character 'c'. # # # Example 3: # # # Input: s = "abc" # Output: false # # # # Constraints: # # # 1 <= s.length <= 10^5 # s consists of lowercase English letters. # # # class Solution: def validPalindrome(self, s: str) -> bool: head = 0 tail = len(s) - 1 while head < tail: if s[head] == s[tail]: head += 1 tail -= 1 else: return self.isPalindrome(s[head+1:tail+1]) or self.isPalindrome(s[head:tail]) return True def isPalindrome(self, s: str) -> bool: head = 0 tail = len(s) - 1 while head < tail: if s[head] == s[tail]: head += 1 tail -= 1 else: return False return True
class Solution: def valid_palindrome(self, s: str) -> bool: head = 0 tail = len(s) - 1 while head < tail: if s[head] == s[tail]: head += 1 tail -= 1 else: return self.isPalindrome(s[head + 1:tail + 1]) or self.isPalindrome(s[head:tail]) return True def is_palindrome(self, s: str) -> bool: head = 0 tail = len(s) - 1 while head < tail: if s[head] == s[tail]: head += 1 tail -= 1 else: return False return True
''' Module contains basic functions ''' def number_to_power(number, power): ''' :param number: number to be taken :param power: :return: number to power >>> number_to_power(3, 2) 9 >>> number_to_power(2, 3) 8 ''' return number**power def number_addition(number1, number2): return number1 + number2 def number_substract(number1, number2): return number1 - number2
""" Module contains basic functions """ def number_to_power(number, power): """ :param number: number to be taken :param power: :return: number to power >>> number_to_power(3, 2) 9 >>> number_to_power(2, 3) 8 """ return number ** power def number_addition(number1, number2): return number1 + number2 def number_substract(number1, number2): return number1 - number2
def mask_out(sentence, banned, substitutes): # write your answer between #start and #end #start return '' #end print('Test 1') print('Expected:abcd#') print('Actual :' + mask_out('abcde', 'e', '#')) print() print('Test 2') print('Expected:#$solute') print('Actual :' + mask_out('absolute', 'ab', '#$')) print() print('Test 3') print('Expected:121hon') print('Actual :' + mask_out('python', 'pyt', '12')) print()
def mask_out(sentence, banned, substitutes): return '' print('Test 1') print('Expected:abcd#') print('Actual :' + mask_out('abcde', 'e', '#')) print() print('Test 2') print('Expected:#$solute') print('Actual :' + mask_out('absolute', 'ab', '#$')) print() print('Test 3') print('Expected:121hon') print('Actual :' + mask_out('python', 'pyt', '12')) print()
def linear_search_recursive(arr, value, start, end): if start >= end: return -1 if arr[start] == value: return start if arr[end] == value: return end else: return linear_search_recursive(arr, value, start+1, end-1) test_list = [1,3,9,11,15,19,29] print(linear_search_recursive(test_list, 15, 0, len(test_list)-1)) #prints 4 print(linear_search_recursive(test_list, 29, 0, len(test_list)-1)) #prints 4 print(linear_search_recursive(test_list, 25, 0, len(test_list)-1)) #prints -1
def linear_search_recursive(arr, value, start, end): if start >= end: return -1 if arr[start] == value: return start if arr[end] == value: return end else: return linear_search_recursive(arr, value, start + 1, end - 1) test_list = [1, 3, 9, 11, 15, 19, 29] print(linear_search_recursive(test_list, 15, 0, len(test_list) - 1)) print(linear_search_recursive(test_list, 29, 0, len(test_list) - 1)) print(linear_search_recursive(test_list, 25, 0, len(test_list) - 1))
''' Joe Walter difficulty: 5% run time: 0:20 answer: 40730 *** 034 Digit Factorials 145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find the sum of all numbers which are equal to the sum of the factorial of their digits. Note: as 1! = 1 and 2! = 2 are not sums they are not included. *** Observations After 1999999, numbers n are too large to be expressed as sum_fact_digits(n) ''' max = 19_999_999 f = {'0':1, '1':1, '2':2, '3':6, '4':24, '5':120, '6':720, '7':5040, '8':40320, '9':362880} # faster than a list def sum_fact_digits(n): return sum(f[d] for d in str(n)) def solve(): ans = 0 for n in range(10, max): if n == sum_fact_digits(n): ans += n return ans print(solve())
""" Joe Walter difficulty: 5% run time: 0:20 answer: 40730 *** 034 Digit Factorials 145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find the sum of all numbers which are equal to the sum of the factorial of their digits. Note: as 1! = 1 and 2! = 2 are not sums they are not included. *** Observations After 1999999, numbers n are too large to be expressed as sum_fact_digits(n) """ max = 19999999 f = {'0': 1, '1': 1, '2': 2, '3': 6, '4': 24, '5': 120, '6': 720, '7': 5040, '8': 40320, '9': 362880} def sum_fact_digits(n): return sum((f[d] for d in str(n))) def solve(): ans = 0 for n in range(10, max): if n == sum_fact_digits(n): ans += n return ans print(solve())
class Config: """ :ivar endpoint: url path for docs :ivar filename: openapi spec file name :ivar openapi_version: openapi spec version :ivar title: document title :ivar version: service version :ivar ui: ui theme, choose 'redoc' or 'swagger' :ivar mode: mode for route. **normal** includes undecorated routes and routes decorated by this instance. **strict** only includes routes decorated by this instance. **greedy** includes all the routes. Flaskerk configuration. """ def __init__(self): self.name = 'docs' self.endpoint = '/docs/' self.url_prefix = None self.template_folder = 'templates' self.filename = 'openapi.json' self.mode = 'normal' self.openapi_veresion = '3.0.2' self.title = 'Service Documents' self.version = 'latest' self.ui = 'redoc' self._support_ui = {'redoc', 'swagger'} self._support_mode = {'normal', 'greedy', 'strict'}
class Config: """ :ivar endpoint: url path for docs :ivar filename: openapi spec file name :ivar openapi_version: openapi spec version :ivar title: document title :ivar version: service version :ivar ui: ui theme, choose 'redoc' or 'swagger' :ivar mode: mode for route. **normal** includes undecorated routes and routes decorated by this instance. **strict** only includes routes decorated by this instance. **greedy** includes all the routes. Flaskerk configuration. """ def __init__(self): self.name = 'docs' self.endpoint = '/docs/' self.url_prefix = None self.template_folder = 'templates' self.filename = 'openapi.json' self.mode = 'normal' self.openapi_veresion = '3.0.2' self.title = 'Service Documents' self.version = 'latest' self.ui = 'redoc' self._support_ui = {'redoc', 'swagger'} self._support_mode = {'normal', 'greedy', 'strict'}
config = { "bootstrap_servers": 'localhost:9092', "async_produce": False, "models": [ { "module_name": "image_classification.predict", "class_name": "ModelPredictor", } ] }
config = {'bootstrap_servers': 'localhost:9092', 'async_produce': False, 'models': [{'module_name': 'image_classification.predict', 'class_name': 'ModelPredictor'}]}
# -*- coding: utf-8 -*- """As the name suggests, this file contains (almost?) all the constants we need: - The tablenames and their web urls - The county sets - Column names for all the tables """ url_prefix = 'http://www.cdss.ca.gov/inforesources/' table_url_map = { 'tbl_cf296': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/CF296', 'tbl_churn_data': url_prefix + 'CalFresh-Resource-Center/Data', 'tbl_data_dashboard': url_prefix + 'Data-Portal/Research-and-Data/CalFresh-Data-Dashboard', 'tbl_dfa256': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/DFA256', 'tbl_dfa296x': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/DFA296x', 'tbl_dfa358f': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/DFA358F', 'tbl_dfa358s': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/DFA358S', 'tbl_stat47': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/STAT-47', } # county_dict has keys stripped of all whitespace for use in the cleanCounties function # in the file_factory module county_dict = { 'Statewide': 'Statewide', 'California': 'California', 'Alameda': 'Alameda', 'Alpine': 'Alpine', 'Amador': 'Amador', 'Butte': 'Butte', 'Calaveras': 'Calaveras', 'Colusa': 'Colusa', 'ContraCosta': 'Contra Costa', 'DelNorte': 'Del Norte', 'ElDorado': 'El Dorado', 'Fresno': 'Fresno', 'Glenn': 'Glenn', 'Humboldt': 'Humboldt', 'Imperial': 'Imperial', 'Inyo': 'Inyo', 'Kern': 'Kern', 'Kings': 'Kings', 'Lake': 'Lake', 'Lassen': 'Lassen', 'LosAngeles': 'Los Angeles', 'Madera': 'Madera', 'Marin': 'Marin', 'Mariposa': 'Mariposa', 'Mendocino': 'Mendocino', 'Merced': 'Merced', 'Modoc': 'Modoc', 'Mono': 'Mono', 'Monterey': 'Monterey', 'Napa': 'Napa', 'Nevada': 'Nevada', 'Orange': 'Orange', 'Placer': 'Placer', 'Plumas': 'Plumas', 'Riverside': 'Riverside', 'Sacramento': 'Sacramento', 'SanBenito': 'San Benito', 'SanBernardino': 'San Bernardino', 'SanDiego': 'San Diego', 'SanFrancisco': 'San Francisco', 'SanJoaquin': 'San Joaquin', 'SanLuisObispo': 'San Luis Obispo', 'SanMateo': 'San Mateo', 'SantaBarbara': 'Santa Barbara', 'SantaClara': 'Santa Clara', 'SantaCruz': 'Santa Cruz', 'Shasta': 'Shasta', 'Sierra': 'Sierra', 'Siskiyou': 'Siskiyou', 'Solano': 'Solano', 'Sonoma': 'Sonoma', 'Stanislaus': 'Stanislaus', 'Sutter': 'Sutter', 'Tehama': 'Tehama', 'Trinity': 'Trinity', 'Tulare': 'Tulare', 'Tuolumne': 'Tuolumne', 'Ventura': 'Ventura', 'Yolo': 'Yolo', 'Yuba': 'Yuba', } county_set = set([ 'Statewide', 'California', 'Alameda', 'Alpine', 'Amador', 'Butte', 'Calaveras', 'Colusa', 'Contra Costa', 'Del Norte', 'El Dorado', 'Fresno', 'Glenn', 'Humboldt', 'Imperial', 'Inyo', 'Kern', 'Kings', 'Lake', 'Lassen', 'Los Angeles', 'Madera', 'Marin', 'Mariposa', 'Mendocino', 'Merced', 'Modoc', 'Mono', 'Monterey', 'Napa', 'Nevada', 'Orange', 'Placer', 'Plumas', 'Riverside', 'Sacramento', 'San Benito', 'San Bernardino', 'San Diego', 'San Francisco', 'San Joaquin', 'San Luis Obispo', 'San Mateo', 'Santa Barbara', 'Santa Clara', 'Santa Cruz', 'Shasta', 'Sierra', 'Siskiyou', 'Solano', 'Sonoma', 'Stanislaus', 'Sutter', 'Tehama', 'Trinity', 'Tulare', 'Tuolumne', 'Ventura', 'Yolo', 'Yuba', ]) CF296Columns = [ 'county', 'apps_rcvd_during_month', 'online_apps_rcvd_during_month', 'apps_disposed_during_month', 'apps_approved', 'pacf_apps_approved_over_30d', 'nacf_apps_approved_over_30d', 'total_apps_approved_over_30d', 'pacf_apps_denied', 'nacf_apps_denied', 'total_apps_denied', 'pacf_apps_denied_because_ineligible', 'nacf_apps_denied_because_ineligible', 'total_apps_denied_because_ineligible', 'pacf_apps_denied_procedural_reasons', 'nacf_apps_denied_procedural_reasons', 'total_apps_denied_procedural_reasons', 'pacf_apps_denied_over_30d', 'nacf_apps_denied_over_30d', 'total_apps_denied_over_30d', 'pacf_apps_withdrawn', 'nacf_apps_withdrawn', 'total_apps_withdrawn', 'pacf_apps_processed_under_ES_disposed_during_month', 'nacf_apps_processed_under_ES_disposed_during_month', 'total_apps_processed_under_ES_disposed_during_month', 'pacf_found_entitled_to_ES', 'nacf_found_entitled_to_ES', 'total_found_entitled_to_ES', 'pacf_benefits_issued_1_to_3d', 'nacf_benefits_issued_1_to_3d', 'total_benefits_issued_1_to_3d', 'pacf_benefits_issued_4_to_7d', 'nacf_benefits_issued_4_to_7d', 'total_benefits_issued_4_to_7d', 'pacf_benefits_issued_over_7d', 'nacf_benefits_issued_over_7d', 'total_benefits_issued_over_7d', 'pacf_found_not_entitled_to_ES', 'nacf_found_not_entitled_to_ES', 'total_found_not_entitled_to_ES', 'pacf_cases_brought_from_begin_month', 'nacf_cases_brought_from_begin_month', 'total_cases_brought_from_begin_month', 'pacf_item_8_from_last_month_report', 'nacf_item_8_from_last_month_report', 'total_item_8_from_last_month_report', 'pacf_adjustment', 'nacf_adjustment', 'total_adjustment', 'pacf_cases_added_during_month', 'nacf_cases_added_during_month', 'total_cases_added_during_month', 'pacf_federal_apps_approved', 'pacf_fed_st_apps_approved', 'pacf_state_apps_approved', 'nacf_federal_apps_approved', 'nacf_fed_st_apps_approved', 'nacf_state_apps_approved', 'pacf_apps_approved', 'nacf_apps_approved', 'total_apps_approved', 'pacf_change_assist_status_PACF_or_NACF', 'nacf_change_assist_status_PACF_or_NACF', 'total_change_assist_status_PACF_or_NACF', 'pacf_intercounty_transfers', 'nacf_intercounty_transfers', 'total_intercounty_transfers', 'pacf_cases_reinstated_benefits_prorated_during_month', 'nacf_cases_reinstated_benefits_prorated_during_month', 'total_cases_reinstated_benefits_prorated_during_month', 'pacf_other_approvals', 'nacf_other_approvals', 'total_other_approvals', 'pacf_total_cases_open_during_month', 'nacf_total_cases_open_during_month', 'total_total_cases_open_during_month', 'pacf_pure_federal_cases', 'nacf_pure_federal_cases', 'total_pure_federal_cases', 'federal_persons_in_6A_and_6B', 'state_persons_single_fed_st_combined_cases', 'state_persons_families_fed_st_combined_cases', 'pacf_fed_st_combined_cases', 'nacf_fed_st_combined_cases', 'total_fed_st_combined_cases', 'state_persons_single_pure_state_cases', 'state_persons_families_pure_state_cases', 'pacf_pure_state_cases', 'nacf_pure_state_cases', 'total_pure_state_cases', 'pacf_cases_discontinued_during_month', 'nacf_cases_discontinued_during_month', 'total_cases_discontinued_during_month', 'pacf_household_discontinued_failed_to_complete_app', 'nacf_household_discontinued_failed_to_complete_app', 'total_household_discontinued_failed_to_complete_app', 'pacf_cases_brought_forward_at_end_month', 'nacf_cases_brought_forward_at_end_month', 'total_cases_brought_forward_at_end_month', 'pacf_recertification_disposed_during_month', 'nacf_recertification_disposed_during_month', 'total_recertification_disposed_during_month', 'pacf_federal_determined_continuing_eligible', 'pacf_fed_st_determined_continuing_eligible', 'pacf_state_determined_continuing_eligible', 'nacf_federal_determined_continuing_eligible', 'nacf_fed_st_determined_continuing_eligible', 'nacf_state_determined_continuing_eligible', 'pacf_determined_continuing_eligible', 'nacf_determined_continuing_eligible', 'total_determined_continuing_eligible', 'pacf_federal_determined_ineligible', 'pacf_fed_st_determined_ineligible', 'pacf_state_determined_ineligible', 'nacf_federal_determined_ineligible', 'nacf_fed_st_determined_ineligible', 'nacf_state_determined_ineligible', 'pacf_determined_ineligible', 'nacf_determined_ineligible', 'total_determined_ineligible', 'pacf_overdue_recertifications_during_month', 'nacf_overdue_recertifications_during_month', 'total_overdue_recertifications_during_month', 'year', 'month', ] ChurnDataColumns = [ 'county', 'snap_apps_rcvd', 'init_apps', 'apps_rcvd_bene_prev_30d', 'apps_rcvd_bene_prev_60d', 'apps_rcvd_bene_prev_90d', 'apps_rcvd_bene_over_90d', 'ave_days_apprv_bene', 'cases_sched_recert', 'recert_rcvd_snap_follow_mth', 'recert_not_rcvd_snap_follow_mth', 'incomp_recert_no_bene_reapp', 'incomp_recert_no_bene_reapp_30d', 'incomp_recert_no_bene_reapp_60d', 'incomp_recert_no_bene_reapp_90d', 'avg_days_btw_notice_recert', 'pct_reapps_churning', 'pct_reapps_churning_in_30d', 'pct_recerts_churning', 'pct_recerts_churning_in_30d', 'year', 'month', ] ChurnDataPercentColumns = [ 'pct_reapps_churning', 'pct_reapps_churning_in_30d', 'pct_recerts_churning', 'pct_recerts_churning_in_30d', ] DataDashboardPercentColumns = [ 'unemployment_pct', 'qtr_timeliness_exp_pct', 'qtr_30d_churn_reapps_pct', 'qtr_90d_churn_reapps_pct', 'qtr_30d_churn_recerts_pct', 'qtr_90d_churn_recerts_pct', 'mth_timeliness_30d_pct', 'mth_timeliness_exp_pct', 'mth_active_error_rate_pct', 'qtr_medical_rcv_calfresh_pct', 'qtr_calfresh_persons_rcv_medical_pct', 'pri_us_census_est_pct', ] DataDashboardAnnualColumns = [ 'county', 'consortium', 'year', 'state_fiscal_year', 'ann_calfresh_hh_sfy_avg', 'ann_calfresh_hh_cy_avg', 'ann_calfresh_persons_sfy_avg', 'ann_calfresh_persons_cy_avg', 'ann_elderly', 'ann_children', 'ann_child_only_hh', 'ann_esl', 'ann_wic_calfresh_reachable', 'ann_calfresh_in_wic', 'ann_tot_pop', 'ann_elderly_over60', 'ann_children_under18', 'ann_tot_esl_over5', 'ann_tot_ssi_recipients', 'unemployment_pct', 'ann_calfresh_eligibles', 'month', ] DataDashboardQuarterlyColumns = [ 'county', 'consortium', 'quarter', 'year', 'federal_fiscal_year', 'state_fiscal_year', 'qtr_timeliness_exp_pct', 'qtr_30d_churn_reapps_pct', 'qtr_90d_churn_reapps_pct', 'qtr_30d_churn_recerts_pct', 'qtr_90d_churn_recerts_pct', ] DataDashboardMonthlyColumns = [ 'county', 'consortium', 'month', 'year', 'federal_fiscal_year', 'state_fiscal_year', 'mth_calfresh_hh', 'mth_calfresh_persons', 'mth_medical_enrollment', 'mth_timeliness_30d_pct', 'mth_timeliness_exp_pct', 'mth_negative_error_completed_cases', 'mth_negative_error_pct', 'mth_active_error_rate_pct', ] DataDashboard3MthColumns = [ 'county', 'consortium', 'month', 'year', 'federal_fiscal_year', 'state_fiscal_year', 'qtr_medical_rcv_calfresh_pct', 'qtr_calfresh_persons_rcv_medical', 'qtr_calfresh_persons_rcv_medical_pct', ] DataDashboardPRIRawColumns = [ 'county', 'consortium', 'year', 'pri_est_frequency', 'calfresh_persons_cy_avg', 'calfresh_eligibles', 'five_yr_est_range', 'pri_us_census_est_pct', 'month', ] DFA256Columns1 = [ 'county', 'num_hh_pub_asst_fed', 'num_hh_pub_asst_fed_st', 'num_hh_pub_asst_st', 'num_hh_nonpub_asst_fed', 'num_hh_nonpub_asst_fed_st', 'num_hh_nonpub_asst_st', 'num_hh_both_fed', 'num_hh_both_fed_st', 'num_hh_both_st', 'num_pers_fedonly_pub_asst', 'num_pers_fedonly_nonpub_asst', 'num_pers_fedonly_both', 'num_pers_fed_st_pub_asst_fed', 'num_pers_fed_st_pub_asst_st', 'num_pers_fed_st_nonpub_asst_fed', 'num_pers_fed_st_nonpub_asst_st', 'num_pers_fed_st_both_fed', 'num_pers_fed_st_both_st', 'num_pers_stonly_pub_asst', 'num_pers_stonly_nonpub_asst', 'num_pers_stonly_both', 'issuances_mail', 'issuances_contract_otc', 'issuances_other_otc', 'issuances_total', 'val_issuances_fed_only', 'val_issuances_fed_st_fed', 'val_issuances_fed_st_st', 'val_issuences_st_only', 'val_issuances_tot_fed', 'val_issuances_tot_st', 'val_issuances_tot_all', 'year', 'month', ] DFA256Columns2 = [ 'county', 'num_hh_pub_asst_fed', 'num_hh_pub_asst_fed_st', 'num_hh_pub_asst_st', 'num_hh_nonpub_asst_fed', 'num_hh_nonpub_asst_fed_st', 'num_hh_nonpub_asst_st', 'num_hh_both_fed', 'num_hh_both_fed_st', 'num_hh_both_st', 'num_pers_fedonly_pub_asst', 'num_pers_fedonly_nonpub_asst', 'num_pers_fedonly_both', 'num_pers_fed_st_pub_asst_fed', 'num_pers_fed_st_pub_asst_st', 'num_pers_fed_st_nonpub_asst_fed', 'num_pers_fed_st_nonpub_asst_st', 'num_pers_fed_st_both_fed', 'num_pers_fed_st_both_st', 'num_pers_stonly_pub_asst', 'num_pers_stonly_nonpub_asst', 'num_pers_stonly_both', 'issuances_mail_ebt', 'issuances_contract_otc', 'issuances_other_otc', 'issuances_total', 'val_issuances_fed_only', 'val_issuances_fed_st_fed', 'val_issuances_fed_st_st', 'val_issuences_st_only', 'val_issuances_tot_fed', 'val_issuances_tot_st', 'val_issuances_tot_all', 'year', 'month', ] DFA256Columns3 = [ 'county', 'num_hh_pub_asst_fed', 'num_hh_pub_asst_fed_st', 'num_hh_pub_asst_st', 'num_hh_nonpub_asst_fed', 'num_hh_nonpub_asst_fed_st', 'num_hh_nonpub_asst_st', 'num_hh_both_fed', 'num_hh_both_fed_st', 'num_hh_both_st', 'num_pers_fedonly_pub_asst', 'num_pers_fedonly_nonpub_asst', 'num_pers_fedonly_both', 'num_pers_fed_st_pub_asst_fed', 'num_pers_fed_st_pub_asst_st', 'num_pers_fed_st_nonpub_asst_fed', 'num_pers_fed_st_nonpub_asst_st', 'num_pers_fed_st_both_fed', 'num_pers_fed_st_both_st', 'num_pers_stonly_pub_asst', 'num_pers_stonly_nonpub_asst', 'num_pers_stonly_both', 'issuances_mail', 'issuances_contract_otc', 'issuances_other_otc', 'issuances_ebt', 'issuances_total', 'issuances_ebt_conv_coupon', 'val_issuances_fed_only', 'val_issuences_st_only', 'val_issuances_tot_all', 'year', 'month', ] DFA296XColumns1 = [ 'county', 'req_exped_service_adjustment', 'req_exped_service_pend_prev_qtr', 'req_exped_service_rcv_this_qtr', 'req_exped_service_tot_this_qtr', 'req_exped_service_tot_disposed_this_qtr', 'req_exped_service_tot_disposed_entitled_to_exped_service', 'req_exped_service_disposed_entitled_pacf_1_to_3_days', 'req_exped_service_disposed_entitled_pacf_4_to_5_days', 'req_exped_service_disposed_entitled_pacf_over_5_days', 'req_exped_service_disposed_entitled_nacf_1_to_3_days', 'req_exped_service_disposed_entitled_nacf_4_to_5_days', 'req_exped_service_disposed_entitled_nacf_over_5_days', 'req_exped_service_disposed_tot_not_entitled', 'req_exped_service_disposed_pacf_not_entitled', 'req_exped_service_disposed_nacf_not_entitled', 'req_exped_service_disposed_pending_end_qtr', 'app_compliance_info_tot_hh_fail_complete_app_process', 'app_compliance_info_pacf_fail_complete_app_process', 'app_compliance_info_nacf_fail_complete_app_process', 'year', 'month', ] DFA296XColumns2 = [ 'county', 'req_exped_service_pend_prev_qtr', 'req_exped_service_reported_pending_end_prev_qtr', 'req_exped_service_adjustment', 'req_exped_service_rcv_this_qtr', 'req_exped_service_tot_this_qtr', 'req_exped_service_tot_pacf_disposed_this_qtr', 'req_exped_service_tot_disposed_pacf_entitled_to_exped_service', 'req_exped_service_disposed_entitled_pacf_1_to_3_days', 'req_exped_service_disposed_entitled_pacf_4_to_7_days', 'req_exped_service_disposed_entitled_pacf_over_7_days', 'req_exped_service_tot_nacf_disposed_this_qtr', 'req_exped_service_tot_disposed_nacf_entitled_to_exped_service', 'req_exped_service_disposed_entitled_nacf_1_to_3_days', 'req_exped_service_disposed_entitled_nacf_4_to_7_days', 'req_exped_service_disposed_entitled_nacf_over_7_days', 'req_exped_service_tot_disposed_this_qtr', 'req_exped_service_tot_disposed_entitled_to_exped_service', 'req_exped_service_disposed_entitled_tot_1_to_3_days', 'req_exped_service_disposed_entitled_tot_4_to_7_days', 'req_exped_service_disposed_entitled_tot_over_7_days', 'req_exped_service_disposed_pacf_not_entitled', 'req_exped_service_disposed_nacf_not_entitled', 'req_exped_service_disposed_tot_not_entitled', 'req_exped_service_disposed_pending_end_qtr', 'app_compliance_info_pacf_fail_complete_app_process', 'app_compliance_info_nacf_fail_complete_app_process', 'app_compliance_info_tot_hh_fail_complete_app_process', 'year', 'month', ] DFA296XColumns3 = [ 'county', 'req_exped_service_pend_prev_qtr', 'req_exped_service_reported_pending_end_prev_qtr', 'req_exped_service_adjustment', 'req_exped_service_rcv_this_qtr', 'req_exped_service_tot_this_qtr', 'req_exped_service_tot_pacf_disposed_this_qtr', 'req_exped_service_tot_disposed_pacf_entitled_to_exped_service', 'req_exped_service_disposed_entitled_pacf_1_to_3_days', 'req_exped_service_disposed_entitled_pacf_4_to_7_days', 'req_exped_service_pacf_4_to_7_days_client_delay', 'req_exped_service_pacf_4_to_7_days_county_delay', 'req_exped_service_disposed_entitled_pacf_over_7_days', 'req_exped_service_pacf_over_7_days_client_delay', 'req_exped_service_pacf_over_7_days_county_delay', 'req_exped_service_tot_nacf_disposed_this_qtr', 'req_exped_service_tot_disposed_nacf_entitled_to_exped_service', 'req_exped_service_disposed_entitled_nacf_1_to_3_days', 'req_exped_service_disposed_entitled_nacf_4_to_7_days', 'req_exped_service_nacf_4_to_7_days_client_delay', 'req_exped_service_nacf_4_to_7_days_county_delay', 'req_exped_service_disposed_entitled_nacf_over_7_days', 'req_exped_service_nacf_over_7_days_client_delay', 'req_exped_service_nacf_over_7_days_county_delay', 'req_exped_service_tot_disposed_this_qtr', 'req_exped_service_tot_disposed_entitled_to_exped_service', 'req_exped_service_disposed_entitled_tot_1_to_3_days', 'req_exped_service_disposed_entitled_tot_4_to_7_days', 'req_exped_service_tot_4_to_7_days_client_delay', 'req_exped_service_tot_4_to_7_days_county_delay', 'req_exped_service_disposed_entitled_tot_over_7_days', 'req_exped_service_tot_over_7_days_client_delay', 'req_exped_service_tot_over_7_days_county_delay', 'req_exped_service_disposed_pacf_not_entitled', 'req_exped_service_disposed_nacf_not_entitled', 'req_exped_service_disposed_tot_not_entitled', 'req_exped_service_disposed_pending_end_qtr', 'app_compliance_info_pacf_fail_complete_app_process', 'app_compliance_info_nacf_fail_complete_app_process', 'app_compliance_info_tot_hh_fail_complete_app_process', 'year', 'month', ] DFA358Columns1 = [ 'county', 'black_pa', 'black_na', 'black_tot', 'hispanic_pa', 'hispanic_na', 'hispanic_tot', 'asian_pac_islander_pa', 'asian_pac_islander_na', 'asian_pac_islander_tot', 'am_indian_alaskan_nat_pa', 'am_indian_alaskan_nat_na', 'am_indian_alaskan_nat_tot', 'white_pa', 'white_na', 'white_tot', 'filipino_pa', 'filipino_na', 'filipino_tot', 'other_pa', 'other_na', 'other_tot', 'total_pa', 'total_na', 'total_tot', 'chinese_pa', 'chinese_na', 'chinese_tot', 'cambodian_pa', 'cambodian_na', 'cambodian_tot', 'japanese_pa', 'japanese_na', 'japanese_tot', 'korean_pa', 'korean_na', 'korean_tot', 'samoan_pa', 'samoan_na', 'samoan_tot', 'asian_indian_pa', 'asian_indian_na', 'asian_indian_tot', 'hawaiian_pa', 'hawaiian_na', 'hawaiian_tot', 'guamanian_pa', 'guamanian_na', 'guamanian_tot', 'laotian_pa', 'laotian_na', 'laotian_tot', 'vietnamese_pa', 'vietnamese_na', 'vietnamese_tot', 'asian_pac_islander_other_pa', 'asian_pac_islander_other_na', 'asian_pac_islander_other_tot', 'asian_pac_islander_total_pa', 'asian_pac_islander_total_na', 'asian_pac_islander_total_tot', 'year', 'month', ] DFA358Columns2 = [ 'county', 'am_indian_alaskan_nat_pa', 'am_indian_alaskan_nat_na', 'am_indian_alaskan_nat_tot', 'tot_asian_pa', 'tot_asian_na', 'tot_asian_tot', 'asian_indian_pa', 'asian_indian_na', 'asian_indian_tot', 'cambodian_pa', 'cambodian_na', 'cambodian_tot', 'chinese_pa', 'chinese_na', 'chinese_tot', 'japanese_pa', 'japanese_na', 'japanese_tot', 'filipino_pa', 'filipino_na', 'filipino_tot', 'korean_pa', 'korean_na', 'korean_tot', 'laotian_pa', 'laotian_na', 'laotian_tot', 'vietnamese_pa', 'vietnamese_na', 'vietnamese_tot', 'other_asian_pa', 'other_asian_na', 'other_asian_tot', 'more_than_one_asian_pa', 'more_than_one_asian_na', 'more_than_one_asian_tot', 'black_pa', 'black_na', 'black_tot', 'tot_hawaiian_or_other_pa', 'tot_hawaiian_or_other_na', 'tot_hawaiian_or_other_tot', 'hawaiian_pa', 'hawaiian_na', 'hawaiian_tot', 'guamanian_pa', 'guamanian_na', 'guamanian_tot', 'samoan_pa', 'samoan_na', 'samoan_tot', 'other_pac_island_pa', 'other_pac_island_na', 'other_pac_island_tot', 'more_than_one_hawaiian_pac_island_pa', 'more_than_one_hawaiian_pac_island_na', 'more_than_one_hawaiian_pac_island_tot', 'white_pa', 'white_na', 'white_tot', 'two_races_am_indian_alaska_nat_white_pa', 'two_races_am_indian_alaska_nat_white_na', 'two_races_am_indian_alaska_nat_white_tot', 'two_races_asian_white_pa', 'two_races_asian_white_na', 'two_races_asian_white_tot', 'two_races_black_white_pa', 'two_races_black_white_na', 'two_races_black_white_tot', 'two_races_am_indian_alaska_nat_black_pa', 'two_races_am_indian_alaska_nat_black_na', 'two_races_am_indian_alaska_nat_black_tot', 'reported_races_not_incl_pa', 'reported_races_not_incl_na', 'reported_races_not_incl_tot', 'nonreporting_worker_undecided_pa', 'nonreporting_worker_undecided_na', 'nonreporting_worker_undecided_tot', 'total_pa', 'total_na', 'total_tot', 'hispanic_am_indian_alaska_nat_pa', 'hispanic_am_indian_alaska_nat_na', 'hispanic_am_indian_alaska_nat_tot', 'hispanic_tot_asian_pa', 'hispanic_tot_asian_na', 'hispanic_tot_asian_tot', 'hispanic_asian_indian_pa', 'hispanic_asian_indian_na', 'hispanic_asian_indian_tot', 'hispanic_cambodian_pa', 'hispanic_cambodian_na', 'hispanic_cambodian_tot', 'hispanic_chinese_pa', 'hispanic_chinese_na', 'hispanic_chinese_tot', 'hispanic_japanese_pa', 'hispanic_japanese_na', 'hispanic_japanese_tot', 'hispanic_filipino_pa', 'hispanic_filipino_na', 'hispanic_filipino_tot', 'hispanic_korean_pa', 'hispanic_korean_na', 'hispanic_korean_tot', 'hispanic_laotian_pa', 'hispanic_laotian_na', 'hispanic_laotian_tot', 'hispanic_vietnamese_pa', 'hispanic_vietnamese_na', 'hispanic_vietnamese_tot', 'hispanic_other_asian_pa', 'hispanic_other_asian_na', 'hispanic_other_asian_tot', 'hispanic_more_than_one_asian_pa', 'hispanic_more_than_one_asian_na', 'hispanic_more_than_one_asian_tot', 'hispanic_black_pa', 'hispanic_black_na', 'hispanic_black_tot', 'hispanic_tot_hawaiian_other_pac_island_pa', 'hispanic_tot_hawaiian_other_pac_island_na', 'hispanic_tot_hawaiian_other_pac_island_tot', 'hispanic_hawaiian_pa', 'hispanic_hawaiian_na', 'hispanic_hawaiian_tot', 'hispanic_guamanian_pa', 'hispanic_guamanian_na', 'hispanic_guamanian_tot', 'hispanic_samoan_pa', 'hispanic_samoan_na', 'hispanic_samoan_tot', 'hispanic_other_pac_island_pa', 'hispanic_other_pac_island_na', 'hispanic_other_pac_island_tot', 'hispanic_more_than_one_hawaiian_pac_island_pa', 'hispanic_more_than_one_hawaiian_pac_island_na', 'hispanic_more_than_one_hawaiian_pac_island_tot', 'hispanic_white_pa', 'hispanic_white_na', 'hispanic_white_tot', 'hispanic_two_races_am_indian_alaska_nat_white_pa', 'hispanic_two_races_am_indian_alaska_nat_white_na', 'hispanic_two_races_am_indian_alaska_nat_white_tot', 'hispanic_two_races_asian_white_pa', 'hispanic_two_races_asian_white_na', 'hispanic_two_races_asian_white_tot', 'hispanic_two_races_black_white_pa', 'hispanic_two_races_black_white_na', 'hispanic_two_races_black_white_tot', 'hispanic_two_races_am_indian_alaska_nat_black_pa', 'hispanic_two_races_am_indian_alaska_nat_black_na', 'hispanic_two_races_am_indian_alaska_nat_black_tot', 'hispanic_reported_races_not_incl_pa', 'hispanic_reported_races_not_incl_na', 'hispanic_reported_races_not_incl_tot', 'hispanic_nonreporting_worker_undecided_pa', 'hispanic_nonreporting_worker_undecided_na', 'hispanic_nonreporting_worker_undecided_tot', 'hispanic_tot_pa', 'hispanic_tot_na', 'hispanic_tot_tot', 'year', 'month', ] Stat47Columns1 = [ 'county', 'registrant_abawd_undup_new_registrants_month1', 'registrant_abawd_undup_new_registrants_month2', 'registrant_abawd_undup_new_registrants_month3', 'registrant_abawd_undup_new_registrants_qtr_total', 'registrant_abawd_undup_new_abawds_month1', 'registrant_abawd_undup_new_abawds_month2', 'registrant_abawd_undup_new_abawds_month3', 'registrant_abawd_undup_new_abawds_qtr_total', 'registrant_abawd_abawds_exempt_month1', 'registrant_abawd_abawds_exempt_month2', 'registrant_abawd_abawds_exempt_month3', 'registrant_abawd_abawds_exempt_qtr_total', 'new_et_participants_new_et_individuals_month1', 'new_et_participants_new_et_individuals_month2', 'new_et_participants_new_et_individuals_month3', 'new_et_participants_new_et_individuals_qtr_total', 'new_et_participants_new_et_undup_abawds_month1', 'new_et_participants_new_et_undup_abawds_month2', 'new_et_participants_new_et_undup_abawds_month3', 'new_et_participants_new_et_undup_abawds_qtr_total', 'new_et_participants_new_et_undup_nonabawds_month1', 'new_et_participants_new_et_undup_nonabawds_month2', 'new_et_participants_new_et_undup_nonabawds_month3', 'new_et_participants_new_et_undup_nonabawds_qtr_total', 'new_et_component_new_job_placements_month1', 'new_et_component_new_job_placements_month2', 'new_et_component_new_job_placements_month3', 'new_et_component_new_job_placements_qtr_total', 'new_et_component_new_job_abawd_placements_month1', 'new_et_component_new_job_abawd_placements_month2', 'new_et_component_new_job_abawd_placements_month3', 'new_et_component_new_job_abawd_placements_qtr_total', 'new_et_component_new_job_nonabawd_placements_month1', 'new_et_component_new_job_nonabawd_placements_month2', 'new_et_component_new_job_nonabawd_placements_month3', 'new_et_component_new_job_nonabawd_placements_qtr_total', 'new_et_component_new_job_club_placements_month1', 'new_et_component_new_job_club_placements_month2', 'new_et_component_new_job_club_placements_month3', 'new_et_component_new_job_club_placements_qtr_total', 'new_et_component_job_club_abawd_placements_month1', 'new_et_component_job_club_abawd_placements_month2', 'new_et_component_job_club_abawd_placements_month3', 'new_et_component_job_club_abawd_placements_qtr_total', 'new_et_component_job_club_nonabawd_placements_month1', 'new_et_component_job_club_nonabawd_placements_month2', 'new_et_component_job_club_nonabawd_placements_month3', 'new_et_component_job_club_nonabawd_placements_qtr_total', 'new_et_component_workfare_placements_month1', 'new_et_component_workfare_placements_month2', 'new_et_component_workfare_placements_month3', 'new_et_component_workfare_placements_qtr_total', 'new_et_component_workfare_abawd_placements_month1', 'new_et_component_workfare_abawd_placements_month2', 'new_et_component_workfare_abawd_placements_month3', 'new_et_component_workfare_abawd_placements_qtr_total', 'new_et_component_workfare_nonabawd_placements_month1', 'new_et_component_workfare_nonabawd_placements_month2', 'new_et_component_workfare_nonabawd_placements_month3', 'new_et_component_workfare_nonabawd_placements_qtr_total', 'new_et_component_selfinitiated_placements_month1', 'new_et_component_selfinitiated_placements_month2', 'new_et_component_selfinitiated_placements_month3', 'new_et_component_selfinitiated_placements_qtr_total', 'new_et_component_selfinitiated_abawd_placements_month1', 'new_et_component_selfinitiated_abawd_placements_month2', 'new_et_component_selfinitiated_abawd_placements_month3', 'new_et_component_selfinitiated_abawd_placements_qtr_total', 'new_et_component_selfinitiated_nonabawd_placements_month1', 'new_et_component_selfinitiated_nonabawd_placements_month2', 'new_et_component_selfinitiated_nonabawd_placements_month3', 'new_et_component_selfinitiated_nonabawd_placements_qtr_total', 'new_et_component_work_exp_placements_month1', 'new_et_component_work_exp_placements_month2', 'new_et_component_work_exp_placements_month3', 'new_et_component_work_exp_placements_qtr_total', 'new_et_component_work_exp_abawd_placements_month1', 'new_et_component_work_exp_abawd_placements_month2', 'new_et_component_work_exp_abawd_placements_month3', 'new_et_component_work_exp_abawd_placements_qtr_total', 'new_et_component_work_exp_nonabawd_placements_month1', 'new_et_component_work_exp_nonabawd_placements_month2', 'new_et_component_work_exp_nonabawd_placements_month3', 'new_et_component_work_exp_nonabawd_placements_qtr_total', 'new_et_component_vocation_placements_month1', 'new_et_component_vocation_placements_month2', 'new_et_component_vocation_placements_month3', 'new_et_component_vocation_placements_qtr_total', 'new_et_component_vocation_abawd_placements_month1', 'new_et_component_vocation_abawd_placements_month2', 'new_et_component_vocation_abawd_placements_month3', 'new_et_component_vocation_abawd_placements_qtr_total', 'new_et_component_vocation_nonabawd_placements_month1', 'new_et_component_vocation_nonabawd_placements_month2', 'new_et_component_vocation_nonabawd_placements_month3', 'new_et_component_vocation_nonabawd_placements_qtr_total', 'new_et_component_education_placements_month1', 'new_et_component_education_placements_month2', 'new_et_component_education_placements_month3', 'new_et_component_education_placements_qtr_total', 'new_et_component_education_abawd_placements_month1', 'new_et_component_education_abawd_placements_month2', 'new_et_component_education_abawd_placements_month3', 'new_et_component_education_abawd_placements_qtr_total', 'new_et_component_education_nonabawd_placements_month1', 'new_et_component_education_nonabawd_placements_month2', 'new_et_component_education_nonabawd_placements_month3', 'new_et_component_education_nonabawd_placements_qtr_total', 'new_et_component_retention_placements_month1', 'new_et_component_retention_placements_month2', 'new_et_component_retention_placements_month3', 'new_et_component_retention_placements_qtr_total', 'new_et_component_retention_abawd_placements_month1', 'new_et_component_retention_abawd_placements_month2', 'new_et_component_retention_abawd_placements_month3', 'new_et_component_retention_abawd_placements_qtr_total', 'new_et_component_retention_nonabawd_placements_month1', 'new_et_component_retention_nonabawd_placements_month2', 'new_et_component_retention_nonabawd_placements_month3', 'new_et_component_retention_nonabawd_placements_qtr_total', 'new_et_component_other_placements_month1', 'new_et_component_other_placements_month2', 'new_et_component_other_placements_month3', 'new_et_component_other_placements_qtr_total', 'new_et_component_other_abawd_placements_month1', 'new_et_component_other_abawd_placements_month2', 'new_et_component_other_abawd_placements_month3', 'new_et_component_other_abawd_placements_qtr_total', 'new_et_component_other_nonabawd_placements_month1', 'new_et_component_other_nonabawd_placements_month2', 'new_et_component_other_nonabawd_placements_month3', 'new_et_component_other_nonabawd_placements_qtr_total', 'new_et_component_all_placements_month1', 'new_et_component_all_placements_month2', 'new_et_component_all_placements_month3', 'new_et_component_all_placements_qtr_total', 'new_et_component_all_abawd_placements_month1', 'new_et_component_all_abawd_placements_month2', 'new_et_component_all_abawd_placements_month3', 'new_et_component_all_abawd_placements_qtr_total', 'new_et_component_all_nonabawd_placements_month1', 'new_et_component_all_nonabawd_placements_month2', 'new_et_component_all_nonabawd_placements_month3', 'new_et_component_all_nonabawd_placements_qtr_total', 'year', 'month', ] Stat47Columns2 = [ 'county', 'new_contin_job_search_participants_month1', 'new_contin_job_search_participants_month2', 'new_contin_job_search_participants_month3', 'new_contin_job_search_participants_qtr_total', 'new_contin_job_search_abawd_participants_month1', 'new_contin_job_search_abawd_participants_month2', 'new_contin_job_search_abawd_participants_month3', 'new_contin_job_search_abawd_participants_qtr_total', 'new_contin_job_search_nonabawd_participants_month1', 'new_contin_job_search_nonabawd_participants_month2', 'new_contin_job_search_nonabawd_participants_month3', 'new_contin_job_search_nonabawd_participants_qtr_total', 'new_contin_job_club_participants_month1', 'new_contin_job_club_participants_month2', 'new_contin_job_club_participants_month3', 'new_contin_job_club_participants_qtr_total', 'new_contin_job_club_abawd_participants_month1', 'new_contin_job_club_abawd_participants_month2', 'new_contin_job_club_abawd_participants_month3', 'new_contin_job_club_abawd_participants_qtr_total', 'new_contin_job_club_nonabawd_participants_month1', 'new_contin_job_club_nonabawd_participants_month2', 'new_contin_job_club_nonabawd_participants_month3', 'new_contin_job_club_nonabawd_participants_qtr_total', 'new_contin_workfare_participants_month1', 'new_contin_workfare_participants_month2', 'new_contin_workfare_participants_month3', 'new_contin_workfare_participants_qtr_total', 'new_contin_workfare_abawd_participants_month1', 'new_contin_workfare_abawd_participants_month2', 'new_contin_workfare_abawd_participants_month3', 'new_contin_workfare_abawd_participants_qtr_total', 'new_contin_workfare_nonabawd_participants_month1', 'new_contin_workfare_nonabawd_participants_month2', 'new_contin_workfare_nonabawd_participants_month3', 'new_contin_workfare_nonabawd_participants_qtr_total', 'new_contin_selfinitiated_participants_month1', 'new_contin_selfinitiated_participants_month2', 'new_contin_selfinitiated_participants_month3', 'new_contin_selfinitiated_participants_qtr_total', 'new_contin_selfinitiated_abawd_participants_month1', 'new_contin_selfinitiated_abawd_participants_month2', 'new_contin_selfinitiated_abawd_participants_month3', 'new_contin_selfinitiated_abawd_participants_qtr_total', 'new_contin_selfinitiated_nonabawd_participants_month1', 'new_contin_selfinitiated_nonabawd_participants_month2', 'new_contin_selfinitiated_nonabawd_participants_month3', 'new_contin_selfinitiated_nonabawd_participants_qtr_total', 'new_contin_workexp_participants_month1', 'new_contin_workexp_participants_month2', 'new_contin_workexp_participants_month3', 'new_contin_workexp_participants_qtr_total', 'new_contin_workexp_abawd_participants_month1', 'new_contin_workexp_abawd_participants_month2', 'new_contin_workexp_abawd_participants_month3', 'new_contin_workexp_abawd_participants_qtr_total', 'new_contin_workexp_nonabawd_participants_month1', 'new_contin_workexp_nonabawd_participants_month2', 'new_contin_workexp_nonabawd_participants_month3', 'new_contin_workexp_nonabawd_participants_qtr_total', 'new_contin_vocational_participants_month1', 'new_contin_vocational_participants_month2', 'new_contin_vocational_participants_month3', 'new_contin_vocational_participants_qtr_total', 'new_contin_vocational_abawd_participants_month1', 'new_contin_vocational_abawd_participants_month2', 'new_contin_vocational_abawd_participants_month3', 'new_contin_vocational_abawd_participants_qtr_total', 'new_contin_vocational_nonabawd_participants_month1', 'new_contin_vocational_nonabawd_participants_month2', 'new_contin_vocational_nonabawd_participants_month3', 'new_contin_vocational_nonabawd_participants_qtr_total', 'new_contin_education_participants_month1', 'new_contin_education_participants_month2', 'new_contin_education_participants_month3', 'new_contin_education_participants_qtr_total', 'new_contin_education_abawd_participants_month1', 'new_contin_education_abawd_participants_month2', 'new_contin_education_abawd_participants_month3', 'new_contin_education_abawd_participants_qtr_total', 'new_contin_education_nonabawd_participants_month1', 'new_contin_education_nonabawd_participants_month2', 'new_contin_education_nonabawd_participants_month3', 'new_contin_education_nonabawd_participants_qtr_total', 'new_contin_retention_participants_month1', 'new_contin_retention_participants_month2', 'new_contin_retention_participants_month3', 'new_contin_retention_participants_qtr_total', 'new_contin_retention_abawd_participants_month1', 'new_contin_retention_abawd_participants_month2', 'new_contin_retention_abawd_participants_month3', 'new_contin_retention_abawd_participants_qtr_total', 'new_contin_retention_nonabawd_participants_month1', 'new_contin_retention_nonabawd_participants_month2', 'new_contin_retention_nonabawd_participants_month3', 'new_contin_retention_nonabawd_participants_qtr_total', 'new_contin_other_participants_month1', 'new_contin_other_participants_month2', 'new_contin_other_participants_month3', 'new_contin_other_participants_qtr_total', 'new_contin_other_abawd_participants_month1', 'new_contin_other_abawd_participants_month2', 'new_contin_other_abawd_participants_month3', 'new_contin_other_abawd_participants_qtr_total', 'new_contin_other_nonabawd_participants_month1', 'new_contin_other_nonabawd_participants_month2', 'new_contin_other_nonabawd_participants_month3', 'new_contin_other_nonabawd_participants_qtr_total', 'et_totals_fns583_abawds_in_qualifying_et_month1', 'et_totals_fns583_abawds_in_qualifying_et_month2', 'et_totals_fns583_abawds_in_qualifying_et_month3', 'et_totals_fns583_abawds_in_qualifying_et_qtr_total', 'et_totals_fns583_abawds_in_nonqualifying_et_month1', 'et_totals_fns583_abawds_in_nonqualifying_et_month2', 'et_totals_fns583_abawds_in_nonqualifying_et_month3', 'et_totals_fns583_abawds_in_nonqualifying_et_qtr_total', 'et_totals_fns583_nonabawds_in_et_month1', 'et_totals_fns583_nonabawds_in_et_month2', 'et_totals_fns583_nonabawds_in_et_month3', 'et_totals_fns583_nonabawds_in_et_qtr_total', 'point_in_time_et_participants_nonabawd_month1', 'point_in_time_et_participants_nonabawd_month2', 'point_in_time_et_participants_nonabawd_month3', 'point_in_time_et_participants_nonabawd_qtr_total', 'point_in_time_work_registrants_qtr_start', 'point_in_time_abawds_qtr_start', 'year', 'month', ]
"""As the name suggests, this file contains (almost?) all the constants we need: - The tablenames and their web urls - The county sets - Column names for all the tables """ url_prefix = 'http://www.cdss.ca.gov/inforesources/' table_url_map = {'tbl_cf296': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/CF296', 'tbl_churn_data': url_prefix + 'CalFresh-Resource-Center/Data', 'tbl_data_dashboard': url_prefix + 'Data-Portal/Research-and-Data/CalFresh-Data-Dashboard', 'tbl_dfa256': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/DFA256', 'tbl_dfa296x': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/DFA296x', 'tbl_dfa358f': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/DFA358F', 'tbl_dfa358s': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/DFA358S', 'tbl_stat47': url_prefix + 'Research-and-Data/CalFresh-Data-Tables/STAT-47'} county_dict = {'Statewide': 'Statewide', 'California': 'California', 'Alameda': 'Alameda', 'Alpine': 'Alpine', 'Amador': 'Amador', 'Butte': 'Butte', 'Calaveras': 'Calaveras', 'Colusa': 'Colusa', 'ContraCosta': 'Contra Costa', 'DelNorte': 'Del Norte', 'ElDorado': 'El Dorado', 'Fresno': 'Fresno', 'Glenn': 'Glenn', 'Humboldt': 'Humboldt', 'Imperial': 'Imperial', 'Inyo': 'Inyo', 'Kern': 'Kern', 'Kings': 'Kings', 'Lake': 'Lake', 'Lassen': 'Lassen', 'LosAngeles': 'Los Angeles', 'Madera': 'Madera', 'Marin': 'Marin', 'Mariposa': 'Mariposa', 'Mendocino': 'Mendocino', 'Merced': 'Merced', 'Modoc': 'Modoc', 'Mono': 'Mono', 'Monterey': 'Monterey', 'Napa': 'Napa', 'Nevada': 'Nevada', 'Orange': 'Orange', 'Placer': 'Placer', 'Plumas': 'Plumas', 'Riverside': 'Riverside', 'Sacramento': 'Sacramento', 'SanBenito': 'San Benito', 'SanBernardino': 'San Bernardino', 'SanDiego': 'San Diego', 'SanFrancisco': 'San Francisco', 'SanJoaquin': 'San Joaquin', 'SanLuisObispo': 'San Luis Obispo', 'SanMateo': 'San Mateo', 'SantaBarbara': 'Santa Barbara', 'SantaClara': 'Santa Clara', 'SantaCruz': 'Santa Cruz', 'Shasta': 'Shasta', 'Sierra': 'Sierra', 'Siskiyou': 'Siskiyou', 'Solano': 'Solano', 'Sonoma': 'Sonoma', 'Stanislaus': 'Stanislaus', 'Sutter': 'Sutter', 'Tehama': 'Tehama', 'Trinity': 'Trinity', 'Tulare': 'Tulare', 'Tuolumne': 'Tuolumne', 'Ventura': 'Ventura', 'Yolo': 'Yolo', 'Yuba': 'Yuba'} county_set = set(['Statewide', 'California', 'Alameda', 'Alpine', 'Amador', 'Butte', 'Calaveras', 'Colusa', 'Contra Costa', 'Del Norte', 'El Dorado', 'Fresno', 'Glenn', 'Humboldt', 'Imperial', 'Inyo', 'Kern', 'Kings', 'Lake', 'Lassen', 'Los Angeles', 'Madera', 'Marin', 'Mariposa', 'Mendocino', 'Merced', 'Modoc', 'Mono', 'Monterey', 'Napa', 'Nevada', 'Orange', 'Placer', 'Plumas', 'Riverside', 'Sacramento', 'San Benito', 'San Bernardino', 'San Diego', 'San Francisco', 'San Joaquin', 'San Luis Obispo', 'San Mateo', 'Santa Barbara', 'Santa Clara', 'Santa Cruz', 'Shasta', 'Sierra', 'Siskiyou', 'Solano', 'Sonoma', 'Stanislaus', 'Sutter', 'Tehama', 'Trinity', 'Tulare', 'Tuolumne', 'Ventura', 'Yolo', 'Yuba']) cf296_columns = ['county', 'apps_rcvd_during_month', 'online_apps_rcvd_during_month', 'apps_disposed_during_month', 'apps_approved', 'pacf_apps_approved_over_30d', 'nacf_apps_approved_over_30d', 'total_apps_approved_over_30d', 'pacf_apps_denied', 'nacf_apps_denied', 'total_apps_denied', 'pacf_apps_denied_because_ineligible', 'nacf_apps_denied_because_ineligible', 'total_apps_denied_because_ineligible', 'pacf_apps_denied_procedural_reasons', 'nacf_apps_denied_procedural_reasons', 'total_apps_denied_procedural_reasons', 'pacf_apps_denied_over_30d', 'nacf_apps_denied_over_30d', 'total_apps_denied_over_30d', 'pacf_apps_withdrawn', 'nacf_apps_withdrawn', 'total_apps_withdrawn', 'pacf_apps_processed_under_ES_disposed_during_month', 'nacf_apps_processed_under_ES_disposed_during_month', 'total_apps_processed_under_ES_disposed_during_month', 'pacf_found_entitled_to_ES', 'nacf_found_entitled_to_ES', 'total_found_entitled_to_ES', 'pacf_benefits_issued_1_to_3d', 'nacf_benefits_issued_1_to_3d', 'total_benefits_issued_1_to_3d', 'pacf_benefits_issued_4_to_7d', 'nacf_benefits_issued_4_to_7d', 'total_benefits_issued_4_to_7d', 'pacf_benefits_issued_over_7d', 'nacf_benefits_issued_over_7d', 'total_benefits_issued_over_7d', 'pacf_found_not_entitled_to_ES', 'nacf_found_not_entitled_to_ES', 'total_found_not_entitled_to_ES', 'pacf_cases_brought_from_begin_month', 'nacf_cases_brought_from_begin_month', 'total_cases_brought_from_begin_month', 'pacf_item_8_from_last_month_report', 'nacf_item_8_from_last_month_report', 'total_item_8_from_last_month_report', 'pacf_adjustment', 'nacf_adjustment', 'total_adjustment', 'pacf_cases_added_during_month', 'nacf_cases_added_during_month', 'total_cases_added_during_month', 'pacf_federal_apps_approved', 'pacf_fed_st_apps_approved', 'pacf_state_apps_approved', 'nacf_federal_apps_approved', 'nacf_fed_st_apps_approved', 'nacf_state_apps_approved', 'pacf_apps_approved', 'nacf_apps_approved', 'total_apps_approved', 'pacf_change_assist_status_PACF_or_NACF', 'nacf_change_assist_status_PACF_or_NACF', 'total_change_assist_status_PACF_or_NACF', 'pacf_intercounty_transfers', 'nacf_intercounty_transfers', 'total_intercounty_transfers', 'pacf_cases_reinstated_benefits_prorated_during_month', 'nacf_cases_reinstated_benefits_prorated_during_month', 'total_cases_reinstated_benefits_prorated_during_month', 'pacf_other_approvals', 'nacf_other_approvals', 'total_other_approvals', 'pacf_total_cases_open_during_month', 'nacf_total_cases_open_during_month', 'total_total_cases_open_during_month', 'pacf_pure_federal_cases', 'nacf_pure_federal_cases', 'total_pure_federal_cases', 'federal_persons_in_6A_and_6B', 'state_persons_single_fed_st_combined_cases', 'state_persons_families_fed_st_combined_cases', 'pacf_fed_st_combined_cases', 'nacf_fed_st_combined_cases', 'total_fed_st_combined_cases', 'state_persons_single_pure_state_cases', 'state_persons_families_pure_state_cases', 'pacf_pure_state_cases', 'nacf_pure_state_cases', 'total_pure_state_cases', 'pacf_cases_discontinued_during_month', 'nacf_cases_discontinued_during_month', 'total_cases_discontinued_during_month', 'pacf_household_discontinued_failed_to_complete_app', 'nacf_household_discontinued_failed_to_complete_app', 'total_household_discontinued_failed_to_complete_app', 'pacf_cases_brought_forward_at_end_month', 'nacf_cases_brought_forward_at_end_month', 'total_cases_brought_forward_at_end_month', 'pacf_recertification_disposed_during_month', 'nacf_recertification_disposed_during_month', 'total_recertification_disposed_during_month', 'pacf_federal_determined_continuing_eligible', 'pacf_fed_st_determined_continuing_eligible', 'pacf_state_determined_continuing_eligible', 'nacf_federal_determined_continuing_eligible', 'nacf_fed_st_determined_continuing_eligible', 'nacf_state_determined_continuing_eligible', 'pacf_determined_continuing_eligible', 'nacf_determined_continuing_eligible', 'total_determined_continuing_eligible', 'pacf_federal_determined_ineligible', 'pacf_fed_st_determined_ineligible', 'pacf_state_determined_ineligible', 'nacf_federal_determined_ineligible', 'nacf_fed_st_determined_ineligible', 'nacf_state_determined_ineligible', 'pacf_determined_ineligible', 'nacf_determined_ineligible', 'total_determined_ineligible', 'pacf_overdue_recertifications_during_month', 'nacf_overdue_recertifications_during_month', 'total_overdue_recertifications_during_month', 'year', 'month'] churn_data_columns = ['county', 'snap_apps_rcvd', 'init_apps', 'apps_rcvd_bene_prev_30d', 'apps_rcvd_bene_prev_60d', 'apps_rcvd_bene_prev_90d', 'apps_rcvd_bene_over_90d', 'ave_days_apprv_bene', 'cases_sched_recert', 'recert_rcvd_snap_follow_mth', 'recert_not_rcvd_snap_follow_mth', 'incomp_recert_no_bene_reapp', 'incomp_recert_no_bene_reapp_30d', 'incomp_recert_no_bene_reapp_60d', 'incomp_recert_no_bene_reapp_90d', 'avg_days_btw_notice_recert', 'pct_reapps_churning', 'pct_reapps_churning_in_30d', 'pct_recerts_churning', 'pct_recerts_churning_in_30d', 'year', 'month'] churn_data_percent_columns = ['pct_reapps_churning', 'pct_reapps_churning_in_30d', 'pct_recerts_churning', 'pct_recerts_churning_in_30d'] data_dashboard_percent_columns = ['unemployment_pct', 'qtr_timeliness_exp_pct', 'qtr_30d_churn_reapps_pct', 'qtr_90d_churn_reapps_pct', 'qtr_30d_churn_recerts_pct', 'qtr_90d_churn_recerts_pct', 'mth_timeliness_30d_pct', 'mth_timeliness_exp_pct', 'mth_active_error_rate_pct', 'qtr_medical_rcv_calfresh_pct', 'qtr_calfresh_persons_rcv_medical_pct', 'pri_us_census_est_pct'] data_dashboard_annual_columns = ['county', 'consortium', 'year', 'state_fiscal_year', 'ann_calfresh_hh_sfy_avg', 'ann_calfresh_hh_cy_avg', 'ann_calfresh_persons_sfy_avg', 'ann_calfresh_persons_cy_avg', 'ann_elderly', 'ann_children', 'ann_child_only_hh', 'ann_esl', 'ann_wic_calfresh_reachable', 'ann_calfresh_in_wic', 'ann_tot_pop', 'ann_elderly_over60', 'ann_children_under18', 'ann_tot_esl_over5', 'ann_tot_ssi_recipients', 'unemployment_pct', 'ann_calfresh_eligibles', 'month'] data_dashboard_quarterly_columns = ['county', 'consortium', 'quarter', 'year', 'federal_fiscal_year', 'state_fiscal_year', 'qtr_timeliness_exp_pct', 'qtr_30d_churn_reapps_pct', 'qtr_90d_churn_reapps_pct', 'qtr_30d_churn_recerts_pct', 'qtr_90d_churn_recerts_pct'] data_dashboard_monthly_columns = ['county', 'consortium', 'month', 'year', 'federal_fiscal_year', 'state_fiscal_year', 'mth_calfresh_hh', 'mth_calfresh_persons', 'mth_medical_enrollment', 'mth_timeliness_30d_pct', 'mth_timeliness_exp_pct', 'mth_negative_error_completed_cases', 'mth_negative_error_pct', 'mth_active_error_rate_pct'] data_dashboard3_mth_columns = ['county', 'consortium', 'month', 'year', 'federal_fiscal_year', 'state_fiscal_year', 'qtr_medical_rcv_calfresh_pct', 'qtr_calfresh_persons_rcv_medical', 'qtr_calfresh_persons_rcv_medical_pct'] data_dashboard_pri_raw_columns = ['county', 'consortium', 'year', 'pri_est_frequency', 'calfresh_persons_cy_avg', 'calfresh_eligibles', 'five_yr_est_range', 'pri_us_census_est_pct', 'month'] dfa256_columns1 = ['county', 'num_hh_pub_asst_fed', 'num_hh_pub_asst_fed_st', 'num_hh_pub_asst_st', 'num_hh_nonpub_asst_fed', 'num_hh_nonpub_asst_fed_st', 'num_hh_nonpub_asst_st', 'num_hh_both_fed', 'num_hh_both_fed_st', 'num_hh_both_st', 'num_pers_fedonly_pub_asst', 'num_pers_fedonly_nonpub_asst', 'num_pers_fedonly_both', 'num_pers_fed_st_pub_asst_fed', 'num_pers_fed_st_pub_asst_st', 'num_pers_fed_st_nonpub_asst_fed', 'num_pers_fed_st_nonpub_asst_st', 'num_pers_fed_st_both_fed', 'num_pers_fed_st_both_st', 'num_pers_stonly_pub_asst', 'num_pers_stonly_nonpub_asst', 'num_pers_stonly_both', 'issuances_mail', 'issuances_contract_otc', 'issuances_other_otc', 'issuances_total', 'val_issuances_fed_only', 'val_issuances_fed_st_fed', 'val_issuances_fed_st_st', 'val_issuences_st_only', 'val_issuances_tot_fed', 'val_issuances_tot_st', 'val_issuances_tot_all', 'year', 'month'] dfa256_columns2 = ['county', 'num_hh_pub_asst_fed', 'num_hh_pub_asst_fed_st', 'num_hh_pub_asst_st', 'num_hh_nonpub_asst_fed', 'num_hh_nonpub_asst_fed_st', 'num_hh_nonpub_asst_st', 'num_hh_both_fed', 'num_hh_both_fed_st', 'num_hh_both_st', 'num_pers_fedonly_pub_asst', 'num_pers_fedonly_nonpub_asst', 'num_pers_fedonly_both', 'num_pers_fed_st_pub_asst_fed', 'num_pers_fed_st_pub_asst_st', 'num_pers_fed_st_nonpub_asst_fed', 'num_pers_fed_st_nonpub_asst_st', 'num_pers_fed_st_both_fed', 'num_pers_fed_st_both_st', 'num_pers_stonly_pub_asst', 'num_pers_stonly_nonpub_asst', 'num_pers_stonly_both', 'issuances_mail_ebt', 'issuances_contract_otc', 'issuances_other_otc', 'issuances_total', 'val_issuances_fed_only', 'val_issuances_fed_st_fed', 'val_issuances_fed_st_st', 'val_issuences_st_only', 'val_issuances_tot_fed', 'val_issuances_tot_st', 'val_issuances_tot_all', 'year', 'month'] dfa256_columns3 = ['county', 'num_hh_pub_asst_fed', 'num_hh_pub_asst_fed_st', 'num_hh_pub_asst_st', 'num_hh_nonpub_asst_fed', 'num_hh_nonpub_asst_fed_st', 'num_hh_nonpub_asst_st', 'num_hh_both_fed', 'num_hh_both_fed_st', 'num_hh_both_st', 'num_pers_fedonly_pub_asst', 'num_pers_fedonly_nonpub_asst', 'num_pers_fedonly_both', 'num_pers_fed_st_pub_asst_fed', 'num_pers_fed_st_pub_asst_st', 'num_pers_fed_st_nonpub_asst_fed', 'num_pers_fed_st_nonpub_asst_st', 'num_pers_fed_st_both_fed', 'num_pers_fed_st_both_st', 'num_pers_stonly_pub_asst', 'num_pers_stonly_nonpub_asst', 'num_pers_stonly_both', 'issuances_mail', 'issuances_contract_otc', 'issuances_other_otc', 'issuances_ebt', 'issuances_total', 'issuances_ebt_conv_coupon', 'val_issuances_fed_only', 'val_issuences_st_only', 'val_issuances_tot_all', 'year', 'month'] dfa296_x_columns1 = ['county', 'req_exped_service_adjustment', 'req_exped_service_pend_prev_qtr', 'req_exped_service_rcv_this_qtr', 'req_exped_service_tot_this_qtr', 'req_exped_service_tot_disposed_this_qtr', 'req_exped_service_tot_disposed_entitled_to_exped_service', 'req_exped_service_disposed_entitled_pacf_1_to_3_days', 'req_exped_service_disposed_entitled_pacf_4_to_5_days', 'req_exped_service_disposed_entitled_pacf_over_5_days', 'req_exped_service_disposed_entitled_nacf_1_to_3_days', 'req_exped_service_disposed_entitled_nacf_4_to_5_days', 'req_exped_service_disposed_entitled_nacf_over_5_days', 'req_exped_service_disposed_tot_not_entitled', 'req_exped_service_disposed_pacf_not_entitled', 'req_exped_service_disposed_nacf_not_entitled', 'req_exped_service_disposed_pending_end_qtr', 'app_compliance_info_tot_hh_fail_complete_app_process', 'app_compliance_info_pacf_fail_complete_app_process', 'app_compliance_info_nacf_fail_complete_app_process', 'year', 'month'] dfa296_x_columns2 = ['county', 'req_exped_service_pend_prev_qtr', 'req_exped_service_reported_pending_end_prev_qtr', 'req_exped_service_adjustment', 'req_exped_service_rcv_this_qtr', 'req_exped_service_tot_this_qtr', 'req_exped_service_tot_pacf_disposed_this_qtr', 'req_exped_service_tot_disposed_pacf_entitled_to_exped_service', 'req_exped_service_disposed_entitled_pacf_1_to_3_days', 'req_exped_service_disposed_entitled_pacf_4_to_7_days', 'req_exped_service_disposed_entitled_pacf_over_7_days', 'req_exped_service_tot_nacf_disposed_this_qtr', 'req_exped_service_tot_disposed_nacf_entitled_to_exped_service', 'req_exped_service_disposed_entitled_nacf_1_to_3_days', 'req_exped_service_disposed_entitled_nacf_4_to_7_days', 'req_exped_service_disposed_entitled_nacf_over_7_days', 'req_exped_service_tot_disposed_this_qtr', 'req_exped_service_tot_disposed_entitled_to_exped_service', 'req_exped_service_disposed_entitled_tot_1_to_3_days', 'req_exped_service_disposed_entitled_tot_4_to_7_days', 'req_exped_service_disposed_entitled_tot_over_7_days', 'req_exped_service_disposed_pacf_not_entitled', 'req_exped_service_disposed_nacf_not_entitled', 'req_exped_service_disposed_tot_not_entitled', 'req_exped_service_disposed_pending_end_qtr', 'app_compliance_info_pacf_fail_complete_app_process', 'app_compliance_info_nacf_fail_complete_app_process', 'app_compliance_info_tot_hh_fail_complete_app_process', 'year', 'month'] dfa296_x_columns3 = ['county', 'req_exped_service_pend_prev_qtr', 'req_exped_service_reported_pending_end_prev_qtr', 'req_exped_service_adjustment', 'req_exped_service_rcv_this_qtr', 'req_exped_service_tot_this_qtr', 'req_exped_service_tot_pacf_disposed_this_qtr', 'req_exped_service_tot_disposed_pacf_entitled_to_exped_service', 'req_exped_service_disposed_entitled_pacf_1_to_3_days', 'req_exped_service_disposed_entitled_pacf_4_to_7_days', 'req_exped_service_pacf_4_to_7_days_client_delay', 'req_exped_service_pacf_4_to_7_days_county_delay', 'req_exped_service_disposed_entitled_pacf_over_7_days', 'req_exped_service_pacf_over_7_days_client_delay', 'req_exped_service_pacf_over_7_days_county_delay', 'req_exped_service_tot_nacf_disposed_this_qtr', 'req_exped_service_tot_disposed_nacf_entitled_to_exped_service', 'req_exped_service_disposed_entitled_nacf_1_to_3_days', 'req_exped_service_disposed_entitled_nacf_4_to_7_days', 'req_exped_service_nacf_4_to_7_days_client_delay', 'req_exped_service_nacf_4_to_7_days_county_delay', 'req_exped_service_disposed_entitled_nacf_over_7_days', 'req_exped_service_nacf_over_7_days_client_delay', 'req_exped_service_nacf_over_7_days_county_delay', 'req_exped_service_tot_disposed_this_qtr', 'req_exped_service_tot_disposed_entitled_to_exped_service', 'req_exped_service_disposed_entitled_tot_1_to_3_days', 'req_exped_service_disposed_entitled_tot_4_to_7_days', 'req_exped_service_tot_4_to_7_days_client_delay', 'req_exped_service_tot_4_to_7_days_county_delay', 'req_exped_service_disposed_entitled_tot_over_7_days', 'req_exped_service_tot_over_7_days_client_delay', 'req_exped_service_tot_over_7_days_county_delay', 'req_exped_service_disposed_pacf_not_entitled', 'req_exped_service_disposed_nacf_not_entitled', 'req_exped_service_disposed_tot_not_entitled', 'req_exped_service_disposed_pending_end_qtr', 'app_compliance_info_pacf_fail_complete_app_process', 'app_compliance_info_nacf_fail_complete_app_process', 'app_compliance_info_tot_hh_fail_complete_app_process', 'year', 'month'] dfa358_columns1 = ['county', 'black_pa', 'black_na', 'black_tot', 'hispanic_pa', 'hispanic_na', 'hispanic_tot', 'asian_pac_islander_pa', 'asian_pac_islander_na', 'asian_pac_islander_tot', 'am_indian_alaskan_nat_pa', 'am_indian_alaskan_nat_na', 'am_indian_alaskan_nat_tot', 'white_pa', 'white_na', 'white_tot', 'filipino_pa', 'filipino_na', 'filipino_tot', 'other_pa', 'other_na', 'other_tot', 'total_pa', 'total_na', 'total_tot', 'chinese_pa', 'chinese_na', 'chinese_tot', 'cambodian_pa', 'cambodian_na', 'cambodian_tot', 'japanese_pa', 'japanese_na', 'japanese_tot', 'korean_pa', 'korean_na', 'korean_tot', 'samoan_pa', 'samoan_na', 'samoan_tot', 'asian_indian_pa', 'asian_indian_na', 'asian_indian_tot', 'hawaiian_pa', 'hawaiian_na', 'hawaiian_tot', 'guamanian_pa', 'guamanian_na', 'guamanian_tot', 'laotian_pa', 'laotian_na', 'laotian_tot', 'vietnamese_pa', 'vietnamese_na', 'vietnamese_tot', 'asian_pac_islander_other_pa', 'asian_pac_islander_other_na', 'asian_pac_islander_other_tot', 'asian_pac_islander_total_pa', 'asian_pac_islander_total_na', 'asian_pac_islander_total_tot', 'year', 'month'] dfa358_columns2 = ['county', 'am_indian_alaskan_nat_pa', 'am_indian_alaskan_nat_na', 'am_indian_alaskan_nat_tot', 'tot_asian_pa', 'tot_asian_na', 'tot_asian_tot', 'asian_indian_pa', 'asian_indian_na', 'asian_indian_tot', 'cambodian_pa', 'cambodian_na', 'cambodian_tot', 'chinese_pa', 'chinese_na', 'chinese_tot', 'japanese_pa', 'japanese_na', 'japanese_tot', 'filipino_pa', 'filipino_na', 'filipino_tot', 'korean_pa', 'korean_na', 'korean_tot', 'laotian_pa', 'laotian_na', 'laotian_tot', 'vietnamese_pa', 'vietnamese_na', 'vietnamese_tot', 'other_asian_pa', 'other_asian_na', 'other_asian_tot', 'more_than_one_asian_pa', 'more_than_one_asian_na', 'more_than_one_asian_tot', 'black_pa', 'black_na', 'black_tot', 'tot_hawaiian_or_other_pa', 'tot_hawaiian_or_other_na', 'tot_hawaiian_or_other_tot', 'hawaiian_pa', 'hawaiian_na', 'hawaiian_tot', 'guamanian_pa', 'guamanian_na', 'guamanian_tot', 'samoan_pa', 'samoan_na', 'samoan_tot', 'other_pac_island_pa', 'other_pac_island_na', 'other_pac_island_tot', 'more_than_one_hawaiian_pac_island_pa', 'more_than_one_hawaiian_pac_island_na', 'more_than_one_hawaiian_pac_island_tot', 'white_pa', 'white_na', 'white_tot', 'two_races_am_indian_alaska_nat_white_pa', 'two_races_am_indian_alaska_nat_white_na', 'two_races_am_indian_alaska_nat_white_tot', 'two_races_asian_white_pa', 'two_races_asian_white_na', 'two_races_asian_white_tot', 'two_races_black_white_pa', 'two_races_black_white_na', 'two_races_black_white_tot', 'two_races_am_indian_alaska_nat_black_pa', 'two_races_am_indian_alaska_nat_black_na', 'two_races_am_indian_alaska_nat_black_tot', 'reported_races_not_incl_pa', 'reported_races_not_incl_na', 'reported_races_not_incl_tot', 'nonreporting_worker_undecided_pa', 'nonreporting_worker_undecided_na', 'nonreporting_worker_undecided_tot', 'total_pa', 'total_na', 'total_tot', 'hispanic_am_indian_alaska_nat_pa', 'hispanic_am_indian_alaska_nat_na', 'hispanic_am_indian_alaska_nat_tot', 'hispanic_tot_asian_pa', 'hispanic_tot_asian_na', 'hispanic_tot_asian_tot', 'hispanic_asian_indian_pa', 'hispanic_asian_indian_na', 'hispanic_asian_indian_tot', 'hispanic_cambodian_pa', 'hispanic_cambodian_na', 'hispanic_cambodian_tot', 'hispanic_chinese_pa', 'hispanic_chinese_na', 'hispanic_chinese_tot', 'hispanic_japanese_pa', 'hispanic_japanese_na', 'hispanic_japanese_tot', 'hispanic_filipino_pa', 'hispanic_filipino_na', 'hispanic_filipino_tot', 'hispanic_korean_pa', 'hispanic_korean_na', 'hispanic_korean_tot', 'hispanic_laotian_pa', 'hispanic_laotian_na', 'hispanic_laotian_tot', 'hispanic_vietnamese_pa', 'hispanic_vietnamese_na', 'hispanic_vietnamese_tot', 'hispanic_other_asian_pa', 'hispanic_other_asian_na', 'hispanic_other_asian_tot', 'hispanic_more_than_one_asian_pa', 'hispanic_more_than_one_asian_na', 'hispanic_more_than_one_asian_tot', 'hispanic_black_pa', 'hispanic_black_na', 'hispanic_black_tot', 'hispanic_tot_hawaiian_other_pac_island_pa', 'hispanic_tot_hawaiian_other_pac_island_na', 'hispanic_tot_hawaiian_other_pac_island_tot', 'hispanic_hawaiian_pa', 'hispanic_hawaiian_na', 'hispanic_hawaiian_tot', 'hispanic_guamanian_pa', 'hispanic_guamanian_na', 'hispanic_guamanian_tot', 'hispanic_samoan_pa', 'hispanic_samoan_na', 'hispanic_samoan_tot', 'hispanic_other_pac_island_pa', 'hispanic_other_pac_island_na', 'hispanic_other_pac_island_tot', 'hispanic_more_than_one_hawaiian_pac_island_pa', 'hispanic_more_than_one_hawaiian_pac_island_na', 'hispanic_more_than_one_hawaiian_pac_island_tot', 'hispanic_white_pa', 'hispanic_white_na', 'hispanic_white_tot', 'hispanic_two_races_am_indian_alaska_nat_white_pa', 'hispanic_two_races_am_indian_alaska_nat_white_na', 'hispanic_two_races_am_indian_alaska_nat_white_tot', 'hispanic_two_races_asian_white_pa', 'hispanic_two_races_asian_white_na', 'hispanic_two_races_asian_white_tot', 'hispanic_two_races_black_white_pa', 'hispanic_two_races_black_white_na', 'hispanic_two_races_black_white_tot', 'hispanic_two_races_am_indian_alaska_nat_black_pa', 'hispanic_two_races_am_indian_alaska_nat_black_na', 'hispanic_two_races_am_indian_alaska_nat_black_tot', 'hispanic_reported_races_not_incl_pa', 'hispanic_reported_races_not_incl_na', 'hispanic_reported_races_not_incl_tot', 'hispanic_nonreporting_worker_undecided_pa', 'hispanic_nonreporting_worker_undecided_na', 'hispanic_nonreporting_worker_undecided_tot', 'hispanic_tot_pa', 'hispanic_tot_na', 'hispanic_tot_tot', 'year', 'month'] stat47_columns1 = ['county', 'registrant_abawd_undup_new_registrants_month1', 'registrant_abawd_undup_new_registrants_month2', 'registrant_abawd_undup_new_registrants_month3', 'registrant_abawd_undup_new_registrants_qtr_total', 'registrant_abawd_undup_new_abawds_month1', 'registrant_abawd_undup_new_abawds_month2', 'registrant_abawd_undup_new_abawds_month3', 'registrant_abawd_undup_new_abawds_qtr_total', 'registrant_abawd_abawds_exempt_month1', 'registrant_abawd_abawds_exempt_month2', 'registrant_abawd_abawds_exempt_month3', 'registrant_abawd_abawds_exempt_qtr_total', 'new_et_participants_new_et_individuals_month1', 'new_et_participants_new_et_individuals_month2', 'new_et_participants_new_et_individuals_month3', 'new_et_participants_new_et_individuals_qtr_total', 'new_et_participants_new_et_undup_abawds_month1', 'new_et_participants_new_et_undup_abawds_month2', 'new_et_participants_new_et_undup_abawds_month3', 'new_et_participants_new_et_undup_abawds_qtr_total', 'new_et_participants_new_et_undup_nonabawds_month1', 'new_et_participants_new_et_undup_nonabawds_month2', 'new_et_participants_new_et_undup_nonabawds_month3', 'new_et_participants_new_et_undup_nonabawds_qtr_total', 'new_et_component_new_job_placements_month1', 'new_et_component_new_job_placements_month2', 'new_et_component_new_job_placements_month3', 'new_et_component_new_job_placements_qtr_total', 'new_et_component_new_job_abawd_placements_month1', 'new_et_component_new_job_abawd_placements_month2', 'new_et_component_new_job_abawd_placements_month3', 'new_et_component_new_job_abawd_placements_qtr_total', 'new_et_component_new_job_nonabawd_placements_month1', 'new_et_component_new_job_nonabawd_placements_month2', 'new_et_component_new_job_nonabawd_placements_month3', 'new_et_component_new_job_nonabawd_placements_qtr_total', 'new_et_component_new_job_club_placements_month1', 'new_et_component_new_job_club_placements_month2', 'new_et_component_new_job_club_placements_month3', 'new_et_component_new_job_club_placements_qtr_total', 'new_et_component_job_club_abawd_placements_month1', 'new_et_component_job_club_abawd_placements_month2', 'new_et_component_job_club_abawd_placements_month3', 'new_et_component_job_club_abawd_placements_qtr_total', 'new_et_component_job_club_nonabawd_placements_month1', 'new_et_component_job_club_nonabawd_placements_month2', 'new_et_component_job_club_nonabawd_placements_month3', 'new_et_component_job_club_nonabawd_placements_qtr_total', 'new_et_component_workfare_placements_month1', 'new_et_component_workfare_placements_month2', 'new_et_component_workfare_placements_month3', 'new_et_component_workfare_placements_qtr_total', 'new_et_component_workfare_abawd_placements_month1', 'new_et_component_workfare_abawd_placements_month2', 'new_et_component_workfare_abawd_placements_month3', 'new_et_component_workfare_abawd_placements_qtr_total', 'new_et_component_workfare_nonabawd_placements_month1', 'new_et_component_workfare_nonabawd_placements_month2', 'new_et_component_workfare_nonabawd_placements_month3', 'new_et_component_workfare_nonabawd_placements_qtr_total', 'new_et_component_selfinitiated_placements_month1', 'new_et_component_selfinitiated_placements_month2', 'new_et_component_selfinitiated_placements_month3', 'new_et_component_selfinitiated_placements_qtr_total', 'new_et_component_selfinitiated_abawd_placements_month1', 'new_et_component_selfinitiated_abawd_placements_month2', 'new_et_component_selfinitiated_abawd_placements_month3', 'new_et_component_selfinitiated_abawd_placements_qtr_total', 'new_et_component_selfinitiated_nonabawd_placements_month1', 'new_et_component_selfinitiated_nonabawd_placements_month2', 'new_et_component_selfinitiated_nonabawd_placements_month3', 'new_et_component_selfinitiated_nonabawd_placements_qtr_total', 'new_et_component_work_exp_placements_month1', 'new_et_component_work_exp_placements_month2', 'new_et_component_work_exp_placements_month3', 'new_et_component_work_exp_placements_qtr_total', 'new_et_component_work_exp_abawd_placements_month1', 'new_et_component_work_exp_abawd_placements_month2', 'new_et_component_work_exp_abawd_placements_month3', 'new_et_component_work_exp_abawd_placements_qtr_total', 'new_et_component_work_exp_nonabawd_placements_month1', 'new_et_component_work_exp_nonabawd_placements_month2', 'new_et_component_work_exp_nonabawd_placements_month3', 'new_et_component_work_exp_nonabawd_placements_qtr_total', 'new_et_component_vocation_placements_month1', 'new_et_component_vocation_placements_month2', 'new_et_component_vocation_placements_month3', 'new_et_component_vocation_placements_qtr_total', 'new_et_component_vocation_abawd_placements_month1', 'new_et_component_vocation_abawd_placements_month2', 'new_et_component_vocation_abawd_placements_month3', 'new_et_component_vocation_abawd_placements_qtr_total', 'new_et_component_vocation_nonabawd_placements_month1', 'new_et_component_vocation_nonabawd_placements_month2', 'new_et_component_vocation_nonabawd_placements_month3', 'new_et_component_vocation_nonabawd_placements_qtr_total', 'new_et_component_education_placements_month1', 'new_et_component_education_placements_month2', 'new_et_component_education_placements_month3', 'new_et_component_education_placements_qtr_total', 'new_et_component_education_abawd_placements_month1', 'new_et_component_education_abawd_placements_month2', 'new_et_component_education_abawd_placements_month3', 'new_et_component_education_abawd_placements_qtr_total', 'new_et_component_education_nonabawd_placements_month1', 'new_et_component_education_nonabawd_placements_month2', 'new_et_component_education_nonabawd_placements_month3', 'new_et_component_education_nonabawd_placements_qtr_total', 'new_et_component_retention_placements_month1', 'new_et_component_retention_placements_month2', 'new_et_component_retention_placements_month3', 'new_et_component_retention_placements_qtr_total', 'new_et_component_retention_abawd_placements_month1', 'new_et_component_retention_abawd_placements_month2', 'new_et_component_retention_abawd_placements_month3', 'new_et_component_retention_abawd_placements_qtr_total', 'new_et_component_retention_nonabawd_placements_month1', 'new_et_component_retention_nonabawd_placements_month2', 'new_et_component_retention_nonabawd_placements_month3', 'new_et_component_retention_nonabawd_placements_qtr_total', 'new_et_component_other_placements_month1', 'new_et_component_other_placements_month2', 'new_et_component_other_placements_month3', 'new_et_component_other_placements_qtr_total', 'new_et_component_other_abawd_placements_month1', 'new_et_component_other_abawd_placements_month2', 'new_et_component_other_abawd_placements_month3', 'new_et_component_other_abawd_placements_qtr_total', 'new_et_component_other_nonabawd_placements_month1', 'new_et_component_other_nonabawd_placements_month2', 'new_et_component_other_nonabawd_placements_month3', 'new_et_component_other_nonabawd_placements_qtr_total', 'new_et_component_all_placements_month1', 'new_et_component_all_placements_month2', 'new_et_component_all_placements_month3', 'new_et_component_all_placements_qtr_total', 'new_et_component_all_abawd_placements_month1', 'new_et_component_all_abawd_placements_month2', 'new_et_component_all_abawd_placements_month3', 'new_et_component_all_abawd_placements_qtr_total', 'new_et_component_all_nonabawd_placements_month1', 'new_et_component_all_nonabawd_placements_month2', 'new_et_component_all_nonabawd_placements_month3', 'new_et_component_all_nonabawd_placements_qtr_total', 'year', 'month'] stat47_columns2 = ['county', 'new_contin_job_search_participants_month1', 'new_contin_job_search_participants_month2', 'new_contin_job_search_participants_month3', 'new_contin_job_search_participants_qtr_total', 'new_contin_job_search_abawd_participants_month1', 'new_contin_job_search_abawd_participants_month2', 'new_contin_job_search_abawd_participants_month3', 'new_contin_job_search_abawd_participants_qtr_total', 'new_contin_job_search_nonabawd_participants_month1', 'new_contin_job_search_nonabawd_participants_month2', 'new_contin_job_search_nonabawd_participants_month3', 'new_contin_job_search_nonabawd_participants_qtr_total', 'new_contin_job_club_participants_month1', 'new_contin_job_club_participants_month2', 'new_contin_job_club_participants_month3', 'new_contin_job_club_participants_qtr_total', 'new_contin_job_club_abawd_participants_month1', 'new_contin_job_club_abawd_participants_month2', 'new_contin_job_club_abawd_participants_month3', 'new_contin_job_club_abawd_participants_qtr_total', 'new_contin_job_club_nonabawd_participants_month1', 'new_contin_job_club_nonabawd_participants_month2', 'new_contin_job_club_nonabawd_participants_month3', 'new_contin_job_club_nonabawd_participants_qtr_total', 'new_contin_workfare_participants_month1', 'new_contin_workfare_participants_month2', 'new_contin_workfare_participants_month3', 'new_contin_workfare_participants_qtr_total', 'new_contin_workfare_abawd_participants_month1', 'new_contin_workfare_abawd_participants_month2', 'new_contin_workfare_abawd_participants_month3', 'new_contin_workfare_abawd_participants_qtr_total', 'new_contin_workfare_nonabawd_participants_month1', 'new_contin_workfare_nonabawd_participants_month2', 'new_contin_workfare_nonabawd_participants_month3', 'new_contin_workfare_nonabawd_participants_qtr_total', 'new_contin_selfinitiated_participants_month1', 'new_contin_selfinitiated_participants_month2', 'new_contin_selfinitiated_participants_month3', 'new_contin_selfinitiated_participants_qtr_total', 'new_contin_selfinitiated_abawd_participants_month1', 'new_contin_selfinitiated_abawd_participants_month2', 'new_contin_selfinitiated_abawd_participants_month3', 'new_contin_selfinitiated_abawd_participants_qtr_total', 'new_contin_selfinitiated_nonabawd_participants_month1', 'new_contin_selfinitiated_nonabawd_participants_month2', 'new_contin_selfinitiated_nonabawd_participants_month3', 'new_contin_selfinitiated_nonabawd_participants_qtr_total', 'new_contin_workexp_participants_month1', 'new_contin_workexp_participants_month2', 'new_contin_workexp_participants_month3', 'new_contin_workexp_participants_qtr_total', 'new_contin_workexp_abawd_participants_month1', 'new_contin_workexp_abawd_participants_month2', 'new_contin_workexp_abawd_participants_month3', 'new_contin_workexp_abawd_participants_qtr_total', 'new_contin_workexp_nonabawd_participants_month1', 'new_contin_workexp_nonabawd_participants_month2', 'new_contin_workexp_nonabawd_participants_month3', 'new_contin_workexp_nonabawd_participants_qtr_total', 'new_contin_vocational_participants_month1', 'new_contin_vocational_participants_month2', 'new_contin_vocational_participants_month3', 'new_contin_vocational_participants_qtr_total', 'new_contin_vocational_abawd_participants_month1', 'new_contin_vocational_abawd_participants_month2', 'new_contin_vocational_abawd_participants_month3', 'new_contin_vocational_abawd_participants_qtr_total', 'new_contin_vocational_nonabawd_participants_month1', 'new_contin_vocational_nonabawd_participants_month2', 'new_contin_vocational_nonabawd_participants_month3', 'new_contin_vocational_nonabawd_participants_qtr_total', 'new_contin_education_participants_month1', 'new_contin_education_participants_month2', 'new_contin_education_participants_month3', 'new_contin_education_participants_qtr_total', 'new_contin_education_abawd_participants_month1', 'new_contin_education_abawd_participants_month2', 'new_contin_education_abawd_participants_month3', 'new_contin_education_abawd_participants_qtr_total', 'new_contin_education_nonabawd_participants_month1', 'new_contin_education_nonabawd_participants_month2', 'new_contin_education_nonabawd_participants_month3', 'new_contin_education_nonabawd_participants_qtr_total', 'new_contin_retention_participants_month1', 'new_contin_retention_participants_month2', 'new_contin_retention_participants_month3', 'new_contin_retention_participants_qtr_total', 'new_contin_retention_abawd_participants_month1', 'new_contin_retention_abawd_participants_month2', 'new_contin_retention_abawd_participants_month3', 'new_contin_retention_abawd_participants_qtr_total', 'new_contin_retention_nonabawd_participants_month1', 'new_contin_retention_nonabawd_participants_month2', 'new_contin_retention_nonabawd_participants_month3', 'new_contin_retention_nonabawd_participants_qtr_total', 'new_contin_other_participants_month1', 'new_contin_other_participants_month2', 'new_contin_other_participants_month3', 'new_contin_other_participants_qtr_total', 'new_contin_other_abawd_participants_month1', 'new_contin_other_abawd_participants_month2', 'new_contin_other_abawd_participants_month3', 'new_contin_other_abawd_participants_qtr_total', 'new_contin_other_nonabawd_participants_month1', 'new_contin_other_nonabawd_participants_month2', 'new_contin_other_nonabawd_participants_month3', 'new_contin_other_nonabawd_participants_qtr_total', 'et_totals_fns583_abawds_in_qualifying_et_month1', 'et_totals_fns583_abawds_in_qualifying_et_month2', 'et_totals_fns583_abawds_in_qualifying_et_month3', 'et_totals_fns583_abawds_in_qualifying_et_qtr_total', 'et_totals_fns583_abawds_in_nonqualifying_et_month1', 'et_totals_fns583_abawds_in_nonqualifying_et_month2', 'et_totals_fns583_abawds_in_nonqualifying_et_month3', 'et_totals_fns583_abawds_in_nonqualifying_et_qtr_total', 'et_totals_fns583_nonabawds_in_et_month1', 'et_totals_fns583_nonabawds_in_et_month2', 'et_totals_fns583_nonabawds_in_et_month3', 'et_totals_fns583_nonabawds_in_et_qtr_total', 'point_in_time_et_participants_nonabawd_month1', 'point_in_time_et_participants_nonabawd_month2', 'point_in_time_et_participants_nonabawd_month3', 'point_in_time_et_participants_nonabawd_qtr_total', 'point_in_time_work_registrants_qtr_start', 'point_in_time_abawds_qtr_start', 'year', 'month']