content
stringlengths
7
1.05M
class RecentCounter: def __init__(self): self.queue = [] def ping(self, t: int) -> int: self.queue.append(t) if len(self.queue) > 3001: self.queue.pop(0) start = 0 for idx, item in enumerate(self.queue): if item >= t-3000: start = idx break return len(self.queue[start:]) # Your RecentCounter object will be instantiated and called as such: # obj = RecentCounter() # param_1 = obj.ping(t)
def rearrange_digits(input_list): """ Rearrange Array Elements so as to form two number such that their sum is maximum. Args: input_list(list): Input List Returns: (int),(int): Two maximum sums """ # sort the list in descending order quicksort(input_list) # fill max with digits at the odd indices of sorted list number_1 = 0 for i in range(0, len(input_list), 2): number_1 = number_1 * 10 + input_list[i] # fill y with digits at the even indices of sorted list number_2 = 0 for i in range(1, len(input_list), 2): number_2 = number_2 * 10 + input_list[i] # print x and y print("The two numbers with maximum sum are", number_1, "and", number_2) return [number_1, number_2] def sort_a_little_bit(items, begin_index, end_index): left_index = begin_index pivot_index = end_index pivot_value = items[pivot_index] while pivot_index != left_index: item = items[left_index] if item >= pivot_value: left_index += 1 continue items[left_index] = items[pivot_index - 1] items[pivot_index - 1] = pivot_value items[pivot_index] = item pivot_index -= 1 return pivot_index def sort_all(items, begin_index, end_index): if end_index <= begin_index: return pivot_index = sort_a_little_bit(items, begin_index, end_index) sort_all(items, begin_index, pivot_index - 1) sort_all(items, pivot_index + 1, end_index) def quicksort(items): return sort_all(items, 0, len(items) - 1) def test_function(test_case): output = rearrange_digits(test_case[0]) solution = test_case[1] if sum(output) == sum(solution): print("Pass") else: print("Fail") test_function([[1, 2, 3, 4, 5], [542, 31]]) # pass test_case = [[4, 6, 2, 5, 9, 8], [964, 852]] test_function(test_case) # pass test_case = [[4, 1], [4, 1]] test_function(test_case) # pass test_case = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 0], [97531, 86420]] test_function(test_case) # pass test_case = [[0, 0], [0, 0]] test_function(test_case) # pass
#!/bin/python3 n,k = input().strip().split(' ') n,k = [int(n),int(k)] height = list(map(int, input().strip().split(' '))) max_height = max(height) if max_height - k >= 1: print (max_height-k) else: print (0)
#!/usr/local/bin/python3 s1 = "floor" s2 = "brake" print(s1) for i in range(len(s1)): if s1[i] != s2[i]: print(s2[:i+1] + s1[i+1:])
def solve() -> None: # person whose strength is i can only carry parcels whose weight is less than or equal to i. # check in descending order of degree of freedom of remained parcels. a = [0] + list(map(int, input().split())) b = [0] + list(map(int, input().split())) # for i in range(1, 6): # strength # 5 -> 4 -> 3 -> 2 -> 1 if a[5] > b[5]: print("No") return b[5] -= a[5] a[5] = 0 if a[4] <= b[4]: b[4] -= a[4] a[4] = 0 else: a[4] -= b[4] b[4] = 0 if a[4] > b[5]: print("No") return b[5] -= a[4] b[1] += a[4] a[4] = 0 b[3] += b[5] b[2] += b[5] b[5] = 0 if a[3] <= b[3]: b[3] -= a[3] a[3] = 0 else: a[3] -= b[3] b[3] = 0 if a[3] > b[4]: print("No") return b[4] -= a[3] b[1] += a[3] a[3] = 0 b[2] += b[4] * 2 b[4] = 0 if a[2] <= b[2]: b[2] -= a[2] a[2] = 0 else: a[2] -= b[2] b[2] = 0 if a[2] > b[3]: print("No") return b[3] -= a[2] b[1] += a[2] a[2] = 0 b[1] += b[3] * 3 b[3] = 0 b[1] += b[2] * 2 b[2] = 0 if a[1] <= b[1]: print("Yes") else: print("No") def main() -> None: t = int(input()) for _ in range(t): solve() if __name__ == "__main__": main()
class WayPoint: code = None state = None location = None coordinate = None def __init__(self, code=None, state=None, location=None, coordinate=None): self.code = code self.state = state self.location = location self.coordinate = coordinate if self.code is None and self.coordinate is None: raise ValueError("Either code or coordinate must be set.") def __str__(self): return "Code: %s,\tState: %s, \tCoordinate: %s\tLocation: %s" % \ (self.code, self.state, self.coordinate, self.location) def get_waypoint(self): if self.code: return self.code return str(self.coordinate)
class Solution: def constructFromPrePost(self, pre: List[int], post: List[int]) -> TreeNode: if not pre: return None if len(pre) == 1: return TreeNode(pre[0]) lroot = post.index(pre[1]) l = self.constructFromPrePost(pre[1:lroot+2], post[:lroot+1]) r = self.constructFromPrePost(pre[lroot+2:], post[lroot+1:-1]) return TreeNode(pre[0], l, r)
# # @lc app=leetcode id=430 lang=python3 # # [430] Flatten a Multilevel Doubly Linked List # # https://leetcode.com/problems/flatten-a-multilevel-doubly-linked-list/description/ # # algorithms # Medium (57.21%) # Likes: 3309 # Dislikes: 244 # Total Accepted: 212.1K # Total Submissions: 361.6K # Testcase Example: '[1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]' # # You are given a doubly linked list, which contains nodes that have a next # pointer, a previous pointer, and an additional child pointer. This child # pointer may or may not point to a separate doubly linked list, also # containing these special nodes. These child lists may have one or more # children of their own, and so on, to produce a multilevel data structure as # shown in the example below. # # Given the head of the first level of the list, flatten the list so that all # the nodes appear in a single-level, doubly linked list. Let curr be a node # with a child list. The nodes in the child list should appear after curr and # before curr.next in the flattened list. # # Return the head of the flattened list. The nodes in the list must have all of # their child pointers set to null. # # # Example 1: # # # Input: head = [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12] # Output: [1,2,3,7,8,11,12,9,10,4,5,6] # Explanation: The multilevel linked list in the input is shown. # After flattening the multilevel linked list it becomes: # # # # Example 2: # # # Input: head = [1,2,null,3] # Output: [1,3,2] # Explanation: The multilevel linked list in the input is shown. # After flattening the multilevel linked list it becomes: # # # # Example 3: # # # Input: head = [] # Output: [] # Explanation: There could be empty list in the input. # # # # Constraints: # # # The number of Nodes will not exceed 1000. # 1 <= Node.val <= 10^5 # # # # How the multilevel linked list is represented in test cases: # # We use the multilevel linked list from Example 1 above: # # # โ 1---2---3---4---5---6--NULL # โ  | # โ  7---8---9---10--NULL # โ  | # โ  11--12--NULL # # The serialization of each level is as follows: # # # [1,2,3,4,5,6,null] # [7,8,9,10,null] # [11,12,null] # # # To serialize all levels together, we will add nulls in each level to signify # no node connects to the upper node of the previous level. The serialization # becomes: # # # [1, 2, 3, 4, 5, 6, null] # โ  | # [null, null, 7, 8, 9, 10, null] # โ  | # [ null, 11, 12, null] # # # Merging the serialization of each level and removing trailing nulls we # obtain: # # # [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12] # # # # @lc code=start """ # Definition for a Node. class Node: def __init__(self, val, prev, next, child): self.val = val self.prev = prev self.next = next self.child = child """ class Solution: def flatten(self, head: 'Optional[Node]') -> 'Optional[Node]': stack = [] tail = None curr = head while curr: stack.append((curr, False)) curr = curr.next while stack: node, is_traversed = stack.pop() if is_traversed: if tail: tail.prev = node node.next = tail tail = tail.prev tail.child = None else: tail = node tail.child = None else: stack.append((node, True)) child_curr = node.child while child_curr: stack.append((child_curr, False)) child_curr = child_curr.next return head # @lc code=end
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ๅ…จๅฑ€้…็ฝฎ DEBUG = True DB_HOST = '10.21.216.156' DB_PORT = 3306 DB_USER = 'root' DB_PASS = 'root' DB_NAME = 'news' DB_CHARSET = 'utf8'
BIGINT = "BIGINT" NUMERIC = "NUMERIC" NUMBER = "NUMBER" BIT = "BIT" SMALLINT = "SMALLINT" DECIMAL = "DECIMAL" SMALLMONEY = "SMALLMONEY" INT = "INT" TINYINT = "TINYINT" MONEY = "MONEY" FLOAT = "FLOAT" REAL = "REAL" DATE = "DATE" DATETIMEOFFSET = "DATETIMEOFFSET" DATETIME2 = "DATETIME2" SMALLDATETIME = "SMALLDATETIME" DATETIME = "DATETIME" TIME = "TIME" CHAR = "CHAR" VARCHAR = "VARCHAR" TEXT = "TEXT" NCHAR = "NCHAR" NVARCHAR = "NVARCHAR" NTEXT = "NTEXT" BINARY = "BINARY" VARBINARY = "VARBINARY" IMAGE = "IMAGE" CURSOR = "CURSOR" TIMESTAMP = "TIMESTAMP" HIERARCHYID = "HIERARCHYID" UNIQUEIDENTIFIER = "UNIQUEIDENTIFIER" SQL_VARIANT = "SQL_VARIANT" XML = "XML" TABLE = "TABLE" SPATIAL_TYPES = "SPATIAL TYPES" CHARACTER = "CHARACTER" BOOLEAN = "BOOLEAN" INTEGER = "INTEGER" DOUBLE_PRECISION = "DOUBLE PRECISION" INTERVAL = "INTERVAL" ARRAY = "ARRAY" MULTISET = "MULTISET" CLOB = "CLOB" BLOB = "BLOB" SERIAL = "SERIAL" IDENTITY = "IDENTITY" DOUBLE = "DOUBLE" OTHER = "OTHER" UUID = "UUID" GEOMETRY = "GEOMETRY" STRING = "STRING" UNKNOWN = "UNKNOWN"
class Solution(object): def uniquePathsIII(self, grid): """ :type grid: List[List[int]] :rtype: int """ if not grid or not grid[0]: return 0 R = len(grid) C = len(grid[0]) ans = 0 zero_count = 0 extra_count = 0 points = [(-1, 0), (0, -1), (0, 1), (1, 0)] def is_valid(x, y): return 0 <= x < R and 0 <= y < C and grid[x][y] != -1 def dfs(x, y, ans, temp_zero): for i, j in points: r, c = x+i, y+j if is_valid(r,c) and grid[r][c] == 0: temp_zero += 1 grid[r][c] = -2 ans = dfs(r, c, ans, temp_zero) grid[r][c] = 0 if grid[r][c] == -2 else grid[r][c] temp_zero -= 1 elif is_valid(r,c) and grid[r][c] == 2: if temp_zero == zero_count: ans += 1 return ans for x in xrange(R): for y in xrange(C): if grid[x][y] == 1: start_point = (x, y) elif grid[x][y] == 0: zero_count += 1 else: extra_count += 1 ans = dfs(start_point[0], start_point[1], ans, 0) return (ans) abc = Solution() abc.uniquePathsIII([[0,1],[2,0]])
xCoordinate = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30] def setup(): size(500,500) smooth() noStroke() myInit() def myInit(): println ("New coordinates : ") for i in range(len(xCoordinate)): xCoordinate [i] = 250 + random ( -100 ,100) println ( xCoordinate [i]) def draw(): background(30) for i in range(len(xCoordinate)): fill(20) ellipse(xCoordinate[i], 250, 5, 5) fill(250,40) ellipse(xCoordinate[i], 250, 10*i,10*i) if (mouseX>250): myInit() def keyPressed(): if (key == 's'): saveFrame("Photo")
# # PySNMP MIB module HUAWEI-MGMD-STD-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-MGMD-STD-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:46:50 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint") hwDatacomm, = mibBuilder.importSymbols("HUAWEI-MIB", "hwDatacomm") InterfaceIndexOrZero, InterfaceIndex = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero", "InterfaceIndex") InetAddressType, InetAddress = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") TimeTicks, NotificationType, Bits, Integer32, MibIdentifier, Gauge32, ModuleIdentity, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, Counter64, ObjectIdentity, iso, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "NotificationType", "Bits", "Integer32", "MibIdentifier", "Gauge32", "ModuleIdentity", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "Counter64", "ObjectIdentity", "iso", "Unsigned32") RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention") hwMcast = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149)) hwMgmdStdMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3)) hwMgmdStdMib.setRevisions(('2014-07-09 00:00', '2014-07-01 00:00', '2014-06-20 00:00', '2013-08-28 00:00', '2007-04-16 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: hwMgmdStdMib.setRevisionsDescriptions(('1.Add hwMgmdHostStarGThresholdExceed trap. 2.Add hwMgmdHostStarGThresholdExceedClear trap. 3.Add hwMgmdHostStarGExceed trap. 4.Add hwMgmdHostStarGExceedClear trap. 5.Add hwMgmdHostSGThreshodExceed trap. 6.Add hwMgmdHostSGThreshodExceedClear trap. 7.Add hwMgmdHostSGExceed trap. 8.Add hwMgmdHostSGExceedClear trap. ', '1.Correct trap name hwMgmdTotalLimitThreshodExceed to hwMgmdTotalLimitThresholdExceed and modify the description. 2.Correct trap name hwMgmdTotalLimitThreshodExceedClear to hwMgmdTotalLimitThresholdExceedClear and modify the description. ', '1.Add hwMgmdTotalLimitThreshodExceed trap. 2.Add hwMgmdTotalLimitThreshodExceedClear trap. ', 'Modify import mibs', 'The initial revision of this MIB module.',)) if mibBuilder.loadTexts: hwMgmdStdMib.setLastUpdated('201407090000Z') if mibBuilder.loadTexts: hwMgmdStdMib.setOrganization('Huawei Technologies Co.,Ltd.') if mibBuilder.loadTexts: hwMgmdStdMib.setContactInfo("Huawei Industrial Base Bantian, Longgang Shenzhen 518129 People's Republic of China Website: http://www.huawei.com Email: [email protected] ") if mibBuilder.loadTexts: hwMgmdStdMib.setDescription('The MIB module for MGMD Management. Huawei Technologies Co.,Ltd . Supplementary information may be available at: http://www.huawei.com') class HWMgmdCtlMsgState(TextualConvention, Integer32): description = 'The PIM control message state. valid(1) The valid IGMP/MLD control message has been received. invalid(2) The invalid IGMP/MLD control message has been received. ignore(3) The IGMP/MLD control message has been ignored.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("valid", 1), ("invalid", 2), ("ignore", 3)) hwMgmdMibObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1)) hwMgmdMibGeneralObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2)) hwMgmdMibNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3)) hwMgmdRouterInterfaceTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4), ) if mibBuilder.loadTexts: hwMgmdRouterInterfaceTable.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceTable.setDescription('The (conceptual) table listing the interfaces on which IGMP or MLD is enabled.') hwMgmdRouterInterfaceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1), ).setIndexNames((0, "HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceIfIndex"), (0, "HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceQuerierType")) if mibBuilder.loadTexts: hwMgmdRouterInterfaceEntry.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceEntry.setDescription('An entry (conceptual row) representing an interface on which IGMP or MLD is enabled.') hwMgmdRouterInterfaceIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: hwMgmdRouterInterfaceIfIndex.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceIfIndex.setDescription('The ifIndex value of the interface for which IGMP or MLD is enabled. The table is indexed by the ifIndex value and the InetAddressType to allow for interfaces that may be configured in both IPv4 and IPv6 modes.') hwMgmdRouterInterfaceQuerierType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 2), InetAddressType()) if mibBuilder.loadTexts: hwMgmdRouterInterfaceQuerierType.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceQuerierType.setDescription('The address type of this interface. This entry along with the ifIndex value acts as the index to the hwMgmdRouterInterface table. A physical interface may be configured in multiple modes concurrently, e.g., in IPv4 and IPv6 modes connected to the same interface; however, the traffic is considered to be logically separate.') hwMgmdRouterInterfaceQuerier = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 3), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterInterfaceQuerier.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceQuerier.setDescription('The address of the IGMP or MLD Querier on the IP subnet to which this interface is attached. The InetAddressType, e.g., IPv4 or IPv6, is identified by the hwMgmdRouterInterfaceQuerierType variable in the hwMgmdRouterInterface table.') hwMgmdRouterInterfaceQueryInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 31744)).clone(125)).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: hwMgmdRouterInterfaceQueryInterval.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceQueryInterval.setDescription('The frequency at which IGMP or MLD Host-Query packets are transmitted on this interface.') hwMgmdRouterInterfaceStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 5), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwMgmdRouterInterfaceStatus.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceStatus.setDescription('The activation of a row enables the router side of IGMP or MLD on the interface. The destruction of a row disables the router side of IGMP or MLD on the interface.') hwMgmdRouterInterfaceVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 3)).clone(3)).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwMgmdRouterInterfaceVersion.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceVersion.setDescription('The version of MGMD that is running on this interface. Value 1 applies to IGMPv1 routers only. Value 2 applies to IGMPv2 and MLDv1 routers, and value 3 applies to IGMPv3 and MLDv2 routers. This object can be used to configure a router capable of running either version. For IGMP and MLD to function correctly, all routers on a LAN must be configured to run the same version on that LAN.') hwMgmdRouterInterfaceQueryMaxResponseTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 31744)).clone(100)).setUnits('tenths of seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: hwMgmdRouterInterfaceQueryMaxResponseTime.setReference('RFC 3810, Section 9.3') if mibBuilder.loadTexts: hwMgmdRouterInterfaceQueryMaxResponseTime.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceQueryMaxResponseTime.setDescription('The maximum query response interval advertised in MGMDv2 or IGMPv3 queries on this interface.') hwMgmdRouterInterfaceQuerierUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 8), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterInterfaceQuerierUpTime.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceQuerierUpTime.setDescription('The time since hwMgmdRouterInterfaceQuerier was last changed.') hwMgmdRouterInterfaceQuerierExpiryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 9), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterInterfaceQuerierExpiryTime.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceQuerierExpiryTime.setDescription('The amount of time remaining before the Other Querier Present Timer expires. If the local system is the querier, the value of this object is zero.') hwMgmdRouterInterfaceWrongVersionQueries = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterInterfaceWrongVersionQueries.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceWrongVersionQueries.setDescription('The number of general queries received whose IGMP or MLD version does not match the equivalent hwMgmdRouterInterfaceVersion, over the lifetime of the row entry. Both IGMP and MLD require that all routers on a LAN be configured to run the same version. Thus, if any general queries are received with the wrong version, this indicates a configuration error.') hwMgmdRouterInterfaceJoins = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterInterfaceJoins.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceJoins.setDescription('The number of times a group membership has been added on this interface, that is, the number of times an entry for this interface has been added to the Cache Table. This object can give an indication of the amount of activity between samples over time.') hwMgmdRouterInterfaceProxyIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 12), InterfaceIndexOrZero()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwMgmdRouterInterfaceProxyIfIndex.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceProxyIfIndex.setDescription('Some devices implement a form of IGMP or MLD proxying whereby memberships learned on the interface represented by this row cause Host Membership Reports to be sent on the interface whose ifIndex value is given by this object. Such a device would implement the hwMgmdV2RouterBaseMIBGroup only on its router interfaces (those interfaces with non-zero hwMgmdRouterInterfaceProxyIfIndex). Typically, the value of this object is 0, indicating that no proxying is being done.') hwMgmdRouterInterfaceGroups = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 13), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterInterfaceGroups.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceGroups.setDescription('The current number of entries for this interface in the RouterCache Table.') hwMgmdRouterInterfaceRobustness = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 14), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(2)).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwMgmdRouterInterfaceRobustness.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceRobustness.setDescription('The Robustness Variable allows tuning for the expected packet loss on a subnet. If a subnet is expected to be lossy, the Robustness Variable may be increased. IGMP and MLD are robust to (Robustness Variable-1) packet losses.') hwMgmdRouterInterfaceLastMembQueryIntvl = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 15), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 31744)).clone(10)).setUnits('tenths of seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: hwMgmdRouterInterfaceLastMembQueryIntvl.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceLastMembQueryIntvl.setDescription('The Last Member Query Interval is the Max Query Response Interval inserted into group-specific queries sent in response to leave group messages, and is also the amount of time between group-specific query messages. This value may be tuned to modify the leave latency of the network. A reduced value results in reduced time to detect the loss of the last member of a group. The value of this object is irrelevant if hwMgmdRouterInterfaceVersion is 1.') hwMgmdRouterInterfaceLastMembQueryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 16), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterInterfaceLastMembQueryCount.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceLastMembQueryCount.setDescription('Represents the number of group-specific and group-and- source-specific queries sent by the router before it assumes there are no local members.') hwMgmdRouterInterfaceStartupQueryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 17), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterInterfaceStartupQueryCount.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceStartupQueryCount.setDescription('Represents the number of Queries sent out on startup, separated by the Startup Query Interval.') hwMgmdRouterInterfaceStartupQueryInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 4, 1, 18), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 31744))).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterInterfaceStartupQueryInterval.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterInterfaceStartupQueryInterval.setDescription('This variable represents the interval between General Queries sent by a Querier on startup.') hwMgmdRouterCacheTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6), ) if mibBuilder.loadTexts: hwMgmdRouterCacheTable.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheTable.setDescription('The (conceptual) table listing the IP multicast groups for which there are members on a particular router interface.') hwMgmdRouterCacheEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6, 1), ).setIndexNames((0, "HUAWEI-MGMD-STD-MIB", "hwMgmdRouterCacheAddressType"), (0, "HUAWEI-MGMD-STD-MIB", "hwMgmdRouterCacheAddress"), (0, "HUAWEI-MGMD-STD-MIB", "hwMgmdRouterCacheIfIndex")) if mibBuilder.loadTexts: hwMgmdRouterCacheEntry.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheEntry.setDescription('An entry (conceptual row) in the hwMgmdRouterCacheTable.') hwMgmdRouterCacheAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6, 1, 1), InetAddressType()) if mibBuilder.loadTexts: hwMgmdRouterCacheAddressType.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheAddressType.setDescription('The address type of the hwMgmdRouterCacheTable entry. This value applies to both the hwMgmdRouterCacheAddress and the hwMgmdRouterCacheLastReporter entries.') hwMgmdRouterCacheAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6, 1, 2), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))) if mibBuilder.loadTexts: hwMgmdRouterCacheAddress.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheAddress.setDescription('The IP multicast group address for which this entry contains information. The InetAddressType, e.g., IPv4 or IPv6, is identified by the hwMgmdRouterCacheAddressType variable in the hwMgmdRouterCache table.') hwMgmdRouterCacheIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6, 1, 3), InterfaceIndex()) if mibBuilder.loadTexts: hwMgmdRouterCacheIfIndex.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheIfIndex.setDescription('The interface for which this entry contains information for an IP multicast group address.') hwMgmdRouterCacheLastReporter = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6, 1, 4), InetAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterCacheLastReporter.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheLastReporter.setDescription('The IP address of the source of the last membership report received for this IP multicast group address on this interface. If no membership report has been received, this object has the value 0. The InetAddressType, e.g., IPv4 or IPv6, is identified by the hwMgmdRouterCacheAddressType variable in the hwMgmdRouterCache table.') hwMgmdRouterCacheUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6, 1, 5), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterCacheUpTime.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheUpTime.setDescription('The time elapsed since this entry was created.') hwMgmdRouterCacheExpiryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6, 1, 6), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterCacheExpiryTime.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheExpiryTime.setDescription('This value represents the time remaining before the Group Membership Interval state expires. The value must always be greater than or equal to 1.') hwMgmdRouterCacheExcludeModeExpiryTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6, 1, 7), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterCacheExcludeModeExpiryTimer.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheExcludeModeExpiryTimer.setDescription('This value is applicable only to MGMDv3-compatible nodes and represents the time remaining before the interface EXCLUDE state expires and the interface state transitions to INCLUDE mode. This value can never be greater than hwMgmdRouterCacheExpiryTime.') hwMgmdRouterCacheVersion1HostTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6, 1, 8), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterCacheVersion1HostTimer.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheVersion1HostTimer.setDescription('The time remaining until the local router will assume that there are no longer any MGMD version 1 members on the IP subnet attached to this interface. This entry only applies to IGMPv1 hosts, and is not implemented for MLD. Upon hearing any MGMDv1 Membership Report (IGMPv1 only), this value is reset to the group membership timer. While this time remaining is non-zero, the local router ignores any MGMDv2 Leave messages (IGMPv2 only) for this group that it receives on this interface.') hwMgmdRouterCacheVersion2HostTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6, 1, 9), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterCacheVersion2HostTimer.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheVersion2HostTimer.setDescription('The time remaining until the local router will assume that there are no longer any MGMD version 2 members on the IP subnet attached to this interface. This entry applies to both IGMP and MLD hosts. Upon hearing any MGMDv2 Membership Report, this value is reset to the group membership timer. Assuming no MGMDv1 hosts have been detected, the local router does not ignore any MGMDv2 Leave messages for this group that it receives on this interface.') hwMgmdRouterCacheSourceFilterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 6, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("include", 1), ("exclude", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterCacheSourceFilterMode.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterCacheSourceFilterMode.setDescription('The current cache state, applicable to MGMDv3 compatible nodes. The value indicates whether the state is INCLUDE or EXCLUDE.') hwMgmdInverseRouterCacheTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 8), ) if mibBuilder.loadTexts: hwMgmdInverseRouterCacheTable.setStatus('current') if mibBuilder.loadTexts: hwMgmdInverseRouterCacheTable.setDescription('The (conceptual) table listing the interfaces that are members of a particular group. This is an inverse lookup table for entries in the hwMgmdRouterCacheTable.') hwMgmdInverseRouterCacheEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 8, 1), ).setIndexNames((0, "HUAWEI-MGMD-STD-MIB", "hwMgmdInverseRouterCacheIfIndex"), (0, "HUAWEI-MGMD-STD-MIB", "hwMgmdInverseRouterCacheAddressType"), (0, "HUAWEI-MGMD-STD-MIB", "hwMgmdInverseRouterCacheAddress")) if mibBuilder.loadTexts: hwMgmdInverseRouterCacheEntry.setStatus('current') if mibBuilder.loadTexts: hwMgmdInverseRouterCacheEntry.setDescription('An entry (conceptual row) in the hwMgmdInverseRouterCacheTable.') hwMgmdInverseRouterCacheIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 8, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: hwMgmdInverseRouterCacheIfIndex.setStatus('current') if mibBuilder.loadTexts: hwMgmdInverseRouterCacheIfIndex.setDescription('The interface for which this entry contains information.') hwMgmdInverseRouterCacheAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 8, 1, 2), InetAddressType()) if mibBuilder.loadTexts: hwMgmdInverseRouterCacheAddressType.setStatus('current') if mibBuilder.loadTexts: hwMgmdInverseRouterCacheAddressType.setDescription('The address type of the hwMgmdInverseRouterCacheTable entry.') hwMgmdInverseRouterCacheAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 8, 1, 3), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdInverseRouterCacheAddress.setStatus('current') if mibBuilder.loadTexts: hwMgmdInverseRouterCacheAddress.setDescription('The IP multicast group address for which this entry contains information. The InetAddressType, e.g., IPv4 or IPv6, is identified by the hwMgmdInverseRouterCacheAddressType variable in the hwMgmdInverseRouterCache table.') hwMgmdRouterSrcListTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 10), ) if mibBuilder.loadTexts: hwMgmdRouterSrcListTable.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterSrcListTable.setDescription('The (conceptual) table listing the Source List entries corresponding to each interface and multicast group pair on a Router.') hwMgmdRouterSrcListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 10, 1), ).setIndexNames((0, "HUAWEI-MGMD-STD-MIB", "hwMgmdRouterSrcListAddressType"), (0, "HUAWEI-MGMD-STD-MIB", "hwMgmdRouterSrcListAddress"), (0, "HUAWEI-MGMD-STD-MIB", "hwMgmdRouterSrcListIfIndex"), (0, "HUAWEI-MGMD-STD-MIB", "hwMgmdRouterSrcListHostAddress")) if mibBuilder.loadTexts: hwMgmdRouterSrcListEntry.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterSrcListEntry.setDescription('An entry (conceptual row) in the hwMgmdRouterSrcListTable.') hwMgmdRouterSrcListAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 10, 1, 1), InetAddressType()) if mibBuilder.loadTexts: hwMgmdRouterSrcListAddressType.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterSrcListAddressType.setDescription('The address type of the InetAddress variables in this table. This value applies to the hwMgmdRouterSrcListHostAddress and hwMgmdRouterSrcListAddress entries.') hwMgmdRouterSrcListAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 10, 1, 2), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))) if mibBuilder.loadTexts: hwMgmdRouterSrcListAddress.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterSrcListAddress.setDescription('The IP multicast group address for which this entry contains information.') hwMgmdRouterSrcListIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 10, 1, 3), InterfaceIndex()) if mibBuilder.loadTexts: hwMgmdRouterSrcListIfIndex.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterSrcListIfIndex.setDescription('The interface for which this entry contains information for an IP multicast group address.') hwMgmdRouterSrcListHostAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 10, 1, 4), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterSrcListHostAddress.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterSrcListHostAddress.setDescription('The host address to which this entry corresponds. The hwMgmdRouterCacheSourceFilterMode value for this group address and interface indicates whether this host address is included or excluded.') hwMgmdRouterSrcListExpire = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 10, 1, 5), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdRouterSrcListExpire.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterSrcListExpire.setDescription('This value indicates the relevance of the SrcList entry, whereby a non-zero value indicates this is an INCLUDE state value, and a zero value indicates this to be an EXCLUDE state value.') hwMgmdCtlMsgCountTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11), ) if mibBuilder.loadTexts: hwMgmdCtlMsgCountTable.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountTable.setDescription('The (conceptual) table used to list the control message counter on all the interfaces on which IGMP or MLD is enabled.') hwMgmdCtlMsgCountEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1), ).setIndexNames((0, "HUAWEI-MGMD-STD-MIB", "hwMgmdCtlMsgCountIfIndex"), (0, "HUAWEI-MGMD-STD-MIB", "hwMgmdCtlMsgCountQuerierType"), (0, "HUAWEI-MGMD-STD-MIB", "hwMgmdCtlMsgCountState")) if mibBuilder.loadTexts: hwMgmdCtlMsgCountEntry.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountEntry.setDescription('An entry (conceptual row) representing an interface on which IGMP or MLD is enabled. Dynamically created row state is non-volatile, and upon agent reboot should be reinstantiated as a conceptual row. Any change in read-create objects should therefore be backed up by stable storage.') hwMgmdCtlMsgCountIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: hwMgmdCtlMsgCountIfIndex.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountIfIndex.setDescription('The ifIndex value of the interface for which IGMP or MLD is enabled. The table is indexed by the ifIndex value and the InetAddressType to allow for interfaces which may be configured in both IPv4 and IPv6 modes.') hwMgmdCtlMsgCountQuerierType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 2), InetAddressType()) if mibBuilder.loadTexts: hwMgmdCtlMsgCountQuerierType.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountQuerierType.setDescription('The address type of this interface. This entry along with the ifIndex value acts as the index to the hwMgmdRouterInterface table. A physical interface may be configured in multiple modes concurrently, e.g. in IPv4 and IPv6 modes connected to the same interface, however the traffic is considered to be logically separate.') hwMgmdCtlMsgCountState = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 3), HWMgmdCtlMsgState()) if mibBuilder.loadTexts: hwMgmdCtlMsgCountState.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountState.setDescription('The IGMP/MLD control message state.') hwMgmdCtlMsgCountQuery = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountQuery.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountQuery.setDescription('The number of IGMP/MLD Query on this interface.') hwMgmdCtlMsgCountReportASM = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 5), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountReportASM.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountReportASM.setDescription('The number of IGMP/MLD report with ASM group on this interface.') hwMgmdCtlMsgCountReportSSM = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 6), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountReportSSM.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountReportSSM.setDescription('The number of IGMP/MLD report with SSM group on this interface.') hwMgmdCtlMsgCountLeaveASM = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountLeaveASM.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountLeaveASM.setDescription('The number of IGMP/MLD leave with ASM group on this interface.') hwMgmdCtlMsgCountLeaveSSM = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountLeaveSSM.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountLeaveSSM.setDescription('The number of IGMP/MLD leave with ASM group on this interface.') hwMgmdCtlMsgCountISIN = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 9), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountISIN.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountISIN.setDescription('The number of IGMP/MLD is_in on this interface.') hwMgmdCtlMsgCountISEX = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 10), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountISEX.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountISEX.setDescription('The number of IGMP/MLD is_ex on this interface.') hwMgmdCtlMsgCountTOIN = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 11), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountTOIN.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountTOIN.setDescription('The number of IGMP/MLD to_in on this interface.') hwMgmdCtlMsgCountTOEX = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 12), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountTOEX.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountTOEX.setDescription('The number of IGMP/MLD to_ex on this interface.') hwMgmdCtlMsgCountALLOW = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 13), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountALLOW.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountALLOW.setDescription('The number of IGMP/MLD allow on this interface.') hwMgmdCtlMsgCountBLOCK = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 14), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountBLOCK.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountBLOCK.setDescription('The number of IGMP/MLD block on this interface.') hwMgmdCtlMsgCountSrcRecTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 15), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountSrcRecTotal.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountSrcRecTotal.setDescription('The number of total IGMP/MLD source record on this interface.') hwMgmdCtlMsgCountOthers = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 1, 11, 1, 16), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdCtlMsgCountOthers.setStatus('current') if mibBuilder.loadTexts: hwMgmdCtlMsgCountOthers.setDescription('The number of total IGMP/MLD others packet on this interface.') hwMgmdGroup = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdGroup.setStatus('obsolete') if mibBuilder.loadTexts: hwMgmdGroup.setDescription('Group address of the entry.') hwMgmdSource = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdSource.setStatus('obsolete') if mibBuilder.loadTexts: hwMgmdSource.setDescription('Source address of the entry.') hwMgmdLimitInterfaceIfIndex = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 3), InterfaceIndexOrZero()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdLimitInterfaceIfIndex.setStatus('current') if mibBuilder.loadTexts: hwMgmdLimitInterfaceIfIndex.setDescription('The interface from which an IGMP or a MLD limit trap is most recently sent. If this router has not sent a limit trap, this object is set to 0.') hwMgmdGlobalEntries = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdGlobalEntries.setStatus('current') if mibBuilder.loadTexts: hwMgmdGlobalEntries.setDescription('The total number of IGMP or MLD entries of this instance.') hwMgmdInterfaceEntries = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdInterfaceEntries.setStatus('current') if mibBuilder.loadTexts: hwMgmdInterfaceEntries.setDescription('The total number of IGMP or MLD entries on the interface.') hwMgmdTotalEntries = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdTotalEntries.setStatus('current') if mibBuilder.loadTexts: hwMgmdTotalEntries.setDescription('The total number of IGMP or MLD entries of all instances.') hwMgmdGmpJoinGrpAddr = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdGmpJoinGrpAddr.setStatus('current') if mibBuilder.loadTexts: hwMgmdGmpJoinGrpAddr.setDescription('The IGMP or MLD group address to join.') hwMgmdGmpJoinSrcAddr = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdGmpJoinSrcAddr.setStatus('current') if mibBuilder.loadTexts: hwMgmdGmpJoinSrcAddr.setDescription('The IGMP or MLD source address to join.') hwMgmdGmpJoinSenderIp = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdGmpJoinSenderIp.setStatus('current') if mibBuilder.loadTexts: hwMgmdGmpJoinSenderIp.setDescription('The host IP address for sending membership report.') hwMgmdGmpJoinVersion = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 10), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdGmpJoinVersion.setStatus('current') if mibBuilder.loadTexts: hwMgmdGmpJoinVersion.setDescription('The version of MGMD which is running on this interface. Value 1 applies to IGMPv1 and MLDv1 version. Value 2 applies to IGMPv2 and MLDv2 version, and value 3 applies to IGMPv3 version. This object can be used to configure a router capable of running either version. For IGMP and MLD to function correctly, all routers on a LAN must be configured to run the same version on that LAN. This object MAY be modified under any rowstatus condition. ???? DEFVAL { 2 }') hwMgmdGmpInterfaceIfIndex = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 11), InterfaceIndex()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdGmpInterfaceIfIndex.setStatus('current') if mibBuilder.loadTexts: hwMgmdGmpInterfaceIfIndex.setDescription('The ifIndex value of the interface for which IGMP or MLD is enabled. The table is indexed by the ifIndex value and the InetAddressType to allow for interfaces which may be configured in both IPv4 and IPv6 modes.') hwMgmdGmpInterfaceName = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdGmpInterfaceName.setStatus('current') if mibBuilder.loadTexts: hwMgmdGmpInterfaceName.setDescription('The interface name of the interface for which IGMP or MLD is enabled.') hwMgmdGmpLimitGroupAddressType = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 13), InetAddressType()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdGmpLimitGroupAddressType.setStatus('current') if mibBuilder.loadTexts: hwMgmdGmpLimitGroupAddressType.setDescription('The address type of the multicast group address in the most recently sent IGMP or MLD limit trap. If this router has not sent a limit trap, this object is set to 0.') hwMgmdGmpLimitGroup = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 14), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(8, 8), ValueSizeConstraint(16, 16), ValueSizeConstraint(20, 20), ))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdGmpLimitGroup.setStatus('current') if mibBuilder.loadTexts: hwMgmdGmpLimitGroup.setDescription('The multicast group address in the most recently sent IGMP or MLD limit trap. The InetAddressType is defined by the hwMgmdGmpLimitGroupAddressType object.') hwMgmdGmpLimitSource = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 15), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(8, 8), ValueSizeConstraint(16, 16), ValueSizeConstraint(20, 20), ))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdGmpLimitSource.setStatus('current') if mibBuilder.loadTexts: hwMgmdGmpLimitSource.setDescription('The source address in the most recently sent IGMP or MLD limit trap. The InetAddressType is defined by the hwMgmdGmpLimitGroupAddressType object.') hwMgmdInstanceName = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 16), DisplayString()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdInstanceName.setStatus('current') if mibBuilder.loadTexts: hwMgmdInstanceName.setDescription('The instance name of the trap.') hwMgmdNotificationAddressType = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 17), InetAddressType()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdNotificationAddressType.setStatus('current') if mibBuilder.loadTexts: hwMgmdNotificationAddressType.setDescription('The address type of the multicast group address in the most recently sent IGMP or MLD limit trap.') hwMgmdTotalLimitCurrentCount = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 18), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwMgmdTotalLimitCurrentCount.setStatus('current') if mibBuilder.loadTexts: hwMgmdTotalLimitCurrentCount.setDescription('The current number of IGMP or MLD entries of all instances.') hwMgmdTotalLimitThreshold = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 19), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdTotalLimitThreshold.setStatus('current') if mibBuilder.loadTexts: hwMgmdTotalLimitThreshold.setDescription('The threshold value of IGMP or MLD entries uppper limit(%) of all instances.') hwMgmdHostStarGCurrentCount = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 20), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdHostStarGCurrentCount.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostStarGCurrentCount.setDescription('The current number of IGMP or MLD proxy (*, G) entries of all instances.') hwMgmdHostStarGThreshold = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 21), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdHostStarGThreshold.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostStarGThreshold.setDescription('The threshold value of IGMP or MLD proxy (*, G) entries uppper limit(%) of all instances.') hwMgmdHostStarGTotalCount = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 22), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdHostStarGTotalCount.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostStarGTotalCount.setDescription('The total number of IGMP or MLD proxy (*, G) entries of all instances.') hwMgmdHostNotificationSrcAddr = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 23), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(8, 8), ValueSizeConstraint(16, 16), ValueSizeConstraint(20, 20), ))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdHostNotificationSrcAddr.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostNotificationSrcAddr.setDescription('The source address in the most recently sent IGMP or MLD proxy limit trap.') hwMgmdHostNotificationGrpAddr = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 24), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(8, 8), ValueSizeConstraint(16, 16), ValueSizeConstraint(20, 20), ))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdHostNotificationGrpAddr.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostNotificationGrpAddr.setDescription('The multicast group address in the most recently sent IGMP or MLD proxy limit trap.') hwMgmdHostSGCurrentCount = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 25), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdHostSGCurrentCount.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostSGCurrentCount.setDescription('The current number of IGMP or MLD proxy (S, G) entries of all instances.') hwMgmdHostSGThreshold = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 26), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdHostSGThreshold.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostSGThreshold.setDescription('The threshold value of IGMP or MLD proxy (S, G)entries uppper limit(%) of all instances.') hwMgmdHostSGTotalCount = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 2, 27), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwMgmdHostSGTotalCount.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostSGTotalCount.setDescription('The total number of IGMP or MLD proxy (S, G) entries of all instances.') hwMgmdGlobalLimit = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 1)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdSource"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGlobalEntries")) if mibBuilder.loadTexts: hwMgmdGlobalLimit.setStatus('obsolete') if mibBuilder.loadTexts: hwMgmdGlobalLimit.setDescription('A hwMgmdGlobalLimit notification signifies that an IGMP report has been limited for up to maximum entries of IGMP global routing-table. This notification is generated whenever an IGMP report failed to create membership as IGMP global routing-table limit.') hwMgmdInterfaceLimit = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 2)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdSource"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdLimitInterfaceIfIndex"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInterfaceEntries")) if mibBuilder.loadTexts: hwMgmdInterfaceLimit.setStatus('obsolete') if mibBuilder.loadTexts: hwMgmdInterfaceLimit.setDescription('A hwMgmdInterfaceLimit notification signifies that an IGMP report has been limited for up to maximum entries of IGMP interface routing-table. This notification is generated whenever an IGMP report failed to create membership as IGMP interface routing-table limit.') hwMgmdTotalLimit = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 3)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdSource"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalEntries")) if mibBuilder.loadTexts: hwMgmdTotalLimit.setStatus('obsolete') if mibBuilder.loadTexts: hwMgmdTotalLimit.setDescription('A hwMgmdTotalLimit notification signifies that an IGMP report has been limited for up to maximum entries of IGMP total routing-table. This notification is generated whenever an IGMP report failed to create membership as IGMP total routing-table limit.') hwMgmdGmpJoin = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 4)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpInterfaceName"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpInterfaceIfIndex"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpJoinVersion"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpJoinSrcAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpJoinGrpAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpJoinSenderIp"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInstanceName")) if mibBuilder.loadTexts: hwMgmdGmpJoin.setStatus('current') if mibBuilder.loadTexts: hwMgmdGmpJoin.setDescription('A hwMgmdGmpJoin notification signifies the IGMP or MLD join message was received.') hwMgmdGmpLeave = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 5)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpInterfaceName"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpInterfaceIfIndex"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpJoinSrcAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpJoinGrpAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInstanceName")) if mibBuilder.loadTexts: hwMgmdGmpLeave.setStatus('current') if mibBuilder.loadTexts: hwMgmdGmpLeave.setDescription('A hwMgmdGmpLeave notification signifies the IGMP or MLD group leaved.') hwMgmdGMPGlobalLimit = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 6)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroupAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitSource"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGlobalEntries"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInstanceName")) if mibBuilder.loadTexts: hwMgmdGMPGlobalLimit.setStatus('current') if mibBuilder.loadTexts: hwMgmdGMPGlobalLimit.setDescription('This object indicates that the number of global IGMP or MLD entries of the instance reaches the upper limit. This trap message is generated when IGMP or MLD fails to create membership because the number of global IGMP or MLD entries of the instance reaches the upper limit.') hwMgmdGMPInterfaceLimit = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 7)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroupAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitSource"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdLimitInterfaceIfIndex"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInterfaceEntries"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpInterfaceName"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInstanceName")) if mibBuilder.loadTexts: hwMgmdGMPInterfaceLimit.setStatus('current') if mibBuilder.loadTexts: hwMgmdGMPInterfaceLimit.setDescription('This object indicates that the number of IGMP or MLD entries on the interface reaches the upper limit. This trap message is generated when IGMP or MLD fails to create membership because the number of IGMP or MLD entries on the interface reaches the upper limit.') hwMgmdGMPTotalLimit = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 8)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroupAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitSource"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalEntries")) if mibBuilder.loadTexts: hwMgmdGMPTotalLimit.setStatus('current') if mibBuilder.loadTexts: hwMgmdGMPTotalLimit.setDescription('This object indicates that the number of IGMP or MLD entries of all instances reaches the upper limit. This trap message is generated when IGMP or MLD fails to create membership because the number of IGMP or MLD entries of all instances reaches the upper limit.') hwMgmdGMPInterfaceLimitClear = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 9)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroupAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitSource"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdLimitInterfaceIfIndex"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInterfaceEntries"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpInterfaceName"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInstanceName")) if mibBuilder.loadTexts: hwMgmdGMPInterfaceLimitClear.setStatus('current') if mibBuilder.loadTexts: hwMgmdGMPInterfaceLimitClear.setDescription('This object indicates that the number of IGMP or MLD entries on the interface falls below the upper limit. This trap message is generated when IGMP or MLD delete an entry resulting in the number of IGMP or MLD entries on the interface falls below the upper limit.') hwMgmdGMPGlobalLimitClear = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 10)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroupAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitSource"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGlobalEntries"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInstanceName")) if mibBuilder.loadTexts: hwMgmdGMPGlobalLimitClear.setStatus('current') if mibBuilder.loadTexts: hwMgmdGMPGlobalLimitClear.setDescription('This object indicates that the number of global IGMP or MLD entries of the instance falls blow the upper limit. This trap message is generated when IGMP or MLD delete an entry resulting in the number of global IGMP or MLD entries of the instance falls below the upper limit.') hwMgmdGMPTotalLimitClear = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 11)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroupAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitSource"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalEntries")) if mibBuilder.loadTexts: hwMgmdGMPTotalLimitClear.setStatus('current') if mibBuilder.loadTexts: hwMgmdGMPTotalLimitClear.setDescription('This object indicates that the number of IGMP or MLD entries of all instances falls below the upper limit. This trap message is generated when IGMP or MLD delete an entry resulting in the number of IGMP or MLD entries of all instances falls below the upper limit.') hwMgmdTotalLimitThresholdExceed = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 12)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdNotificationAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalLimitCurrentCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalLimitThreshold"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalEntries")) if mibBuilder.loadTexts: hwMgmdTotalLimitThresholdExceed.setStatus('current') if mibBuilder.loadTexts: hwMgmdTotalLimitThresholdExceed.setDescription('A hwMgmdTotalLimitThresholdExceed notification signifies that IGMP or MLD entries count of all instances reached the upper threshold.') hwMgmdTotalLimitThresholdExceedClear = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 13)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdNotificationAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalLimitCurrentCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalLimitThreshold"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalEntries")) if mibBuilder.loadTexts: hwMgmdTotalLimitThresholdExceedClear.setStatus('current') if mibBuilder.loadTexts: hwMgmdTotalLimitThresholdExceedClear.setDescription('A hwMgmdTotalLimitThresholdExceedClear notification signifies that IGMP or MLD entries count of all instances fell below the lower threshold.') hwMgmdHostStarGThresholdExceed = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 14)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdNotificationAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGCurrentCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGThreshold"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGTotalCount")) if mibBuilder.loadTexts: hwMgmdHostStarGThresholdExceed.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostStarGThresholdExceed.setDescription('A hwMgmdHostStarGThresholdExceed notification signifies that IGMP or MLD proxy (*, G) entries count of all instances reached the upper threshold.') hwMgmdHostStarGThresholdExceedClear = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 15)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdNotificationAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGCurrentCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGThreshold"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGTotalCount")) if mibBuilder.loadTexts: hwMgmdHostStarGThresholdExceedClear.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostStarGThresholdExceedClear.setDescription('A hwMgmdHostStarGThresholdExceedClear notification signifies that IGMP or MLD proxy (*, G) entries count of all instances fell below the lower threshold.') hwMgmdHostStarGExceed = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 16)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdNotificationAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostNotificationSrcAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostNotificationGrpAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGTotalCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInstanceName")) if mibBuilder.loadTexts: hwMgmdHostStarGExceed.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostStarGExceed.setDescription('A hwMgmdHostStarGExceed notification signifies that IGMP or MLD proxy (*, G) entries can not be created because the limit is reached.') hwMgmdHostStarGExceedClear = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 17)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdNotificationAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGTotalCount")) if mibBuilder.loadTexts: hwMgmdHostStarGExceedClear.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostStarGExceedClear.setDescription('A hwMgmdHostStarGExceedClear notification signifies that IGMP or MLD proxy (*, G) entries can be created because can be created because the number of IGMP or MLD (*, G) entries fell below the limit.') hwMgmdHostSGThresholdExceed = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 18)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdNotificationAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGCurrentCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGThreshold"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGTotalCount")) if mibBuilder.loadTexts: hwMgmdHostSGThresholdExceed.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostSGThresholdExceed.setDescription('A hwMgmdHostSGThresholdExceed notification signifies that IGMP or MLD proxy (S, G) entries count of all instances reached the upper threshold.') hwMgmdHostSGThresholdExceedClear = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 19)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdNotificationAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGCurrentCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGThreshold"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGTotalCount")) if mibBuilder.loadTexts: hwMgmdHostSGThresholdExceedClear.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostSGThresholdExceedClear.setDescription('A hwMgmdHostSGThresholdExceedClear notification signifies that IGMP or MLD proxy (S, G) entries count of all instances fell below the lower threshold.') hwMgmdHostSGExceed = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 20)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdNotificationAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostNotificationSrcAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostNotificationGrpAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGTotalCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInstanceName")) if mibBuilder.loadTexts: hwMgmdHostSGExceed.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostSGExceed.setDescription('A hwMgmdHostSGExceed notification signifies that IGMP or MLD proxy (S, G) entries can not be created because the limit of all instances is reached.') hwMgmdHostSGExceedClear = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 3, 21)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdNotificationAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGTotalCount")) if mibBuilder.loadTexts: hwMgmdHostSGExceedClear.setStatus('current') if mibBuilder.loadTexts: hwMgmdHostSGExceedClear.setDescription('A hwMgmdHostSGExceedClear notification signifies that IGMP or MLD proxy (S, G) entries can be created because can be created because the number of IGMP or MLD (S, G) entries of all instances fell below the limit.') hwMgmdMibConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4)) hwMgmdMibCompliance = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 3)) hwMgmdMibGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 4)) hwMgmdIgmpV1RouterMibCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 3, 2)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterBaseMibGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdIgmpV1RouterMibCompliance = hwMgmdIgmpV1RouterMibCompliance.setStatus('current') if mibBuilder.loadTexts: hwMgmdIgmpV1RouterMibCompliance.setDescription('The version statement for routers running IGMPv1, RFC 1112 [4], and implementing the MGMD Mib. MGMDv1 applies to hosts and routers running IGMPv1 only. IGMPv1 routers must support the IPv4 address type ') hwMgmdIgmpV2RouterMibCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 3, 4)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterBaseMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV2RouterBaseMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV2IgmpRouterMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV2RouterOptMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV2ProxyMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdMibNotificationObjects"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdMibNotificationGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdIgmpV2RouterMibCompliance = hwMgmdIgmpV2RouterMibCompliance.setStatus('current') if mibBuilder.loadTexts: hwMgmdIgmpV2RouterMibCompliance.setDescription('The version statement for routers running IGMPv2, RFC 2236 [5], and implementing the MGMD Mib. MGMDv2 applies to hosts and routers running IGMPv2 or MLDv1. IGMPv2 routers must support the IPv4 address type ') hwMgmdMldV1RouterMibCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 3, 6)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterBaseMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV2RouterBaseMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV2RouterOptMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV2ProxyMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdMibNotificationObjects"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdMibNotificationGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdMldV1RouterMibCompliance = hwMgmdMldV1RouterMibCompliance.setStatus('current') if mibBuilder.loadTexts: hwMgmdMldV1RouterMibCompliance.setDescription('The version statement for routers running MLDv1, RFC 2710 [7], and implementing the MGMD Mib. MGMDv2 applies to hosts and routers running IGMPv2 or MLDv1. MLDv1 routers must support the IPv6 address type.') hwMgmdIgmpV3RouterMibCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 3, 8)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterBaseMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV2RouterBaseMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV2IgmpRouterMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV3RouterMibGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdIgmpV3RouterMibCompliance = hwMgmdIgmpV3RouterMibCompliance.setStatus('current') if mibBuilder.loadTexts: hwMgmdIgmpV3RouterMibCompliance.setDescription('The version statement for routers running IGMPv3, RFC 3376 [6], and implementing the MGMD Mib. MGMDv3 applies to hosts and routers running IGMPv3 or MLDv2. IGMPv3 routers must support the IPv4 address type.') hwMgmdMldV2RouterMibCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 3, 10)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterBaseMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV2RouterBaseMibGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdV3RouterMibGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdMldV2RouterMibCompliance = hwMgmdMldV2RouterMibCompliance.setStatus('current') if mibBuilder.loadTexts: hwMgmdMldV2RouterMibCompliance.setDescription('The version statement for routers running MLDv2 [8] and implementing the MGMD Mib. MGMDv3 applies to hosts and routers running IGMPv3 or MLDv2. MLDv2 routers must support the IPv6 address type.') hwMgmdRouterBaseMibGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 4, 2)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceStatus"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterCacheUpTime"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterCacheExpiryTime"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceJoins"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceGroups"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterCacheLastReporter"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceQuerierUpTime"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceQuerierExpiryTime"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceQueryInterval")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdRouterBaseMibGroup = hwMgmdRouterBaseMibGroup.setStatus('current') if mibBuilder.loadTexts: hwMgmdRouterBaseMibGroup.setDescription('The basic collection of objects providing management of MGMD version 1, 2 or 3 for Routers.') hwMgmdV2RouterBaseMibGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 4, 6)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceVersion"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceQuerier"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceQueryMaxResponseTime"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceRobustness"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceWrongVersionQueries"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceLastMembQueryIntvl"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceLastMembQueryCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceStartupQueryCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceStartupQueryInterval")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdV2RouterBaseMibGroup = hwMgmdV2RouterBaseMibGroup.setStatus('current') if mibBuilder.loadTexts: hwMgmdV2RouterBaseMibGroup.setDescription('A collection of additional objects for management of MGMD version 2 in routers.') hwMgmdV2IgmpRouterMibGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 4, 7)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterCacheVersion1HostTimer")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdV2IgmpRouterMibGroup = hwMgmdV2IgmpRouterMibGroup.setStatus('current') if mibBuilder.loadTexts: hwMgmdV2IgmpRouterMibGroup.setDescription('A collection of further objects required by IGMPv2 routers for MGMD version 2 compliance. ') hwMgmdV2ProxyMibGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 4, 8)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterInterfaceProxyIfIndex")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdV2ProxyMibGroup = hwMgmdV2ProxyMibGroup.setStatus('current') if mibBuilder.loadTexts: hwMgmdV2ProxyMibGroup.setDescription('A collection of additional objects for management of MGMD proxy devices.') hwMgmdV2RouterOptMibGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 4, 9)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdInverseRouterCacheAddress")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdV2RouterOptMibGroup = hwMgmdV2RouterOptMibGroup.setStatus('current') if mibBuilder.loadTexts: hwMgmdV2RouterOptMibGroup.setDescription('An additional optional object for management of MGMD version 2 in routers.') hwMgmdV3RouterMibGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 4, 11)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterCacheSourceFilterMode"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterCacheVersion2HostTimer"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterCacheExcludeModeExpiryTimer"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterSrcListHostAddress"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdRouterSrcListExpire")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdV3RouterMibGroup = hwMgmdV3RouterMibGroup.setStatus('current') if mibBuilder.loadTexts: hwMgmdV3RouterMibGroup.setDescription('A collection of additional objects for management of MGMD version 3 in routers.') hwMgmdMibNotificationObjects = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 4, 12)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdSource"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdLimitInterfaceIfIndex"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGlobalEntries"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInterfaceEntries"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalEntries"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpJoinGrpAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpJoinSrcAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpJoinSenderIp"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpJoinVersion"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpInterfaceIfIndex"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpInterfaceName"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroupAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitGroup"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLimitSource"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInstanceName"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdNotificationAddressType"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalLimitCurrentCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalLimitThreshold"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGCurrentCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGThreshold"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGTotalCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostNotificationSrcAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostNotificationGrpAddr"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGCurrentCount"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGThreshold"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGTotalCount")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdMibNotificationObjects = hwMgmdMibNotificationObjects.setStatus('current') if mibBuilder.loadTexts: hwMgmdMibNotificationObjects.setDescription('A collection of objects to support notification of MGMD notification network management events.') hwMgmdMibNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 149, 3, 4, 4, 13)).setObjects(("HUAWEI-MGMD-STD-MIB", "hwMgmdGlobalLimit"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdInterfaceLimit"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalLimit"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpJoin"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGmpLeave"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGMPGlobalLimit"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGMPInterfaceLimit"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGMPTotalLimit"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGMPInterfaceLimitClear"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGMPGlobalLimitClear"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdGMPTotalLimitClear"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalLimitThresholdExceed"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdTotalLimitThresholdExceedClear"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGThresholdExceed"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGThresholdExceedClear"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGExceed"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostStarGExceedClear"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGThresholdExceed"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGThresholdExceedClear"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGExceed"), ("HUAWEI-MGMD-STD-MIB", "hwMgmdHostSGExceedClear")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwMgmdMibNotificationGroup = hwMgmdMibNotificationGroup.setStatus('current') if mibBuilder.loadTexts: hwMgmdMibNotificationGroup.setDescription('A collection of notifications for signaling MGMD notification management events.') mibBuilder.exportSymbols("HUAWEI-MGMD-STD-MIB", hwMgmdRouterInterfaceQueryInterval=hwMgmdRouterInterfaceQueryInterval, hwMgmdRouterCacheVersion1HostTimer=hwMgmdRouterCacheVersion1HostTimer, hwMgmdRouterCacheExpiryTime=hwMgmdRouterCacheExpiryTime, hwMgmdHostStarGTotalCount=hwMgmdHostStarGTotalCount, hwMgmdRouterCacheExcludeModeExpiryTimer=hwMgmdRouterCacheExcludeModeExpiryTimer, hwMgmdMldV1RouterMibCompliance=hwMgmdMldV1RouterMibCompliance, hwMgmdMibNotificationObjects=hwMgmdMibNotificationObjects, hwMgmdHostSGExceed=hwMgmdHostSGExceed, hwMgmdRouterInterfaceQueryMaxResponseTime=hwMgmdRouterInterfaceQueryMaxResponseTime, hwMgmdRouterInterfaceRobustness=hwMgmdRouterInterfaceRobustness, hwMgmdRouterSrcListAddress=hwMgmdRouterSrcListAddress, hwMgmdHostSGExceedClear=hwMgmdHostSGExceedClear, hwMgmdGlobalLimit=hwMgmdGlobalLimit, hwMgmdGmpJoinVersion=hwMgmdGmpJoinVersion, hwMgmdNotificationAddressType=hwMgmdNotificationAddressType, hwMgmdTotalLimit=hwMgmdTotalLimit, hwMgmdRouterInterfaceLastMembQueryIntvl=hwMgmdRouterInterfaceLastMembQueryIntvl, hwMgmdInverseRouterCacheTable=hwMgmdInverseRouterCacheTable, hwMgmdRouterCacheAddress=hwMgmdRouterCacheAddress, hwMgmdCtlMsgCountQuerierType=hwMgmdCtlMsgCountQuerierType, hwMgmdGmpJoinSenderIp=hwMgmdGmpJoinSenderIp, hwMgmdGmpLimitGroup=hwMgmdGmpLimitGroup, hwMgmdGMPTotalLimitClear=hwMgmdGMPTotalLimitClear, hwMgmdIgmpV2RouterMibCompliance=hwMgmdIgmpV2RouterMibCompliance, hwMgmdRouterSrcListIfIndex=hwMgmdRouterSrcListIfIndex, hwMgmdV2RouterOptMibGroup=hwMgmdV2RouterOptMibGroup, hwMgmdHostSGThreshold=hwMgmdHostSGThreshold, hwMgmdLimitInterfaceIfIndex=hwMgmdLimitInterfaceIfIndex, hwMgmdGmpJoinGrpAddr=hwMgmdGmpJoinGrpAddr, hwMgmdRouterCacheTable=hwMgmdRouterCacheTable, hwMgmdCtlMsgCountSrcRecTotal=hwMgmdCtlMsgCountSrcRecTotal, hwMgmdRouterInterfaceProxyIfIndex=hwMgmdRouterInterfaceProxyIfIndex, hwMgmdGmpJoin=hwMgmdGmpJoin, hwMgmdHostStarGExceed=hwMgmdHostStarGExceed, hwMgmdRouterCacheIfIndex=hwMgmdRouterCacheIfIndex, hwMgmdCtlMsgCountLeaveSSM=hwMgmdCtlMsgCountLeaveSSM, hwMgmdIgmpV3RouterMibCompliance=hwMgmdIgmpV3RouterMibCompliance, hwMgmdRouterInterfaceQuerier=hwMgmdRouterInterfaceQuerier, hwMgmdMldV2RouterMibCompliance=hwMgmdMldV2RouterMibCompliance, hwMgmdRouterInterfaceQuerierExpiryTime=hwMgmdRouterInterfaceQuerierExpiryTime, hwMgmdRouterSrcListEntry=hwMgmdRouterSrcListEntry, hwMgmdCtlMsgCountTable=hwMgmdCtlMsgCountTable, hwMgmdInverseRouterCacheAddressType=hwMgmdInverseRouterCacheAddressType, hwMgmdRouterInterfaceTable=hwMgmdRouterInterfaceTable, hwMgmdCtlMsgCountTOIN=hwMgmdCtlMsgCountTOIN, hwMgmdTotalLimitCurrentCount=hwMgmdTotalLimitCurrentCount, hwMgmdRouterSrcListHostAddress=hwMgmdRouterSrcListHostAddress, hwMgmdGMPInterfaceLimit=hwMgmdGMPInterfaceLimit, hwMgmdRouterInterfaceQuerierType=hwMgmdRouterInterfaceQuerierType, hwMgmdGMPInterfaceLimitClear=hwMgmdGMPInterfaceLimitClear, hwMgmdRouterInterfaceJoins=hwMgmdRouterInterfaceJoins, hwMgmdRouterInterfaceEntry=hwMgmdRouterInterfaceEntry, PYSNMP_MODULE_ID=hwMgmdStdMib, hwMgmdCtlMsgCountISIN=hwMgmdCtlMsgCountISIN, hwMgmdInverseRouterCacheIfIndex=hwMgmdInverseRouterCacheIfIndex, hwMgmdRouterInterfaceWrongVersionQueries=hwMgmdRouterInterfaceWrongVersionQueries, hwMgmdMibObjects=hwMgmdMibObjects, hwMgmdTotalLimitThreshold=hwMgmdTotalLimitThreshold, hwMgmdV2ProxyMibGroup=hwMgmdV2ProxyMibGroup, hwMgmdInverseRouterCacheAddress=hwMgmdInverseRouterCacheAddress, hwMgmdHostNotificationGrpAddr=hwMgmdHostNotificationGrpAddr, hwMgmdRouterSrcListTable=hwMgmdRouterSrcListTable, hwMgmdGlobalEntries=hwMgmdGlobalEntries, hwMgmdRouterCacheEntry=hwMgmdRouterCacheEntry, hwMgmdCtlMsgCountBLOCK=hwMgmdCtlMsgCountBLOCK, hwMgmdRouterInterfaceVersion=hwMgmdRouterInterfaceVersion, hwMgmdRouterCacheLastReporter=hwMgmdRouterCacheLastReporter, hwMgmdGMPGlobalLimit=hwMgmdGMPGlobalLimit, hwMgmdCtlMsgCountLeaveASM=hwMgmdCtlMsgCountLeaveASM, hwMgmdHostSGThresholdExceedClear=hwMgmdHostSGThresholdExceedClear, hwMgmdSource=hwMgmdSource, hwMgmdHostSGTotalCount=hwMgmdHostSGTotalCount, hwMgmdMibGeneralObjects=hwMgmdMibGeneralObjects, hwMgmdCtlMsgCountQuery=hwMgmdCtlMsgCountQuery, hwMgmdTotalEntries=hwMgmdTotalEntries, hwMgmdCtlMsgCountOthers=hwMgmdCtlMsgCountOthers, hwMgmdV2RouterBaseMibGroup=hwMgmdV2RouterBaseMibGroup, hwMgmdRouterInterfaceGroups=hwMgmdRouterInterfaceGroups, hwMgmdMibNotificationGroup=hwMgmdMibNotificationGroup, hwMgmdTotalLimitThresholdExceedClear=hwMgmdTotalLimitThresholdExceedClear, hwMgmdCtlMsgCountReportSSM=hwMgmdCtlMsgCountReportSSM, hwMgmdRouterSrcListExpire=hwMgmdRouterSrcListExpire, hwMgmdInstanceName=hwMgmdInstanceName, hwMgmdMibNotifications=hwMgmdMibNotifications, hwMgmdCtlMsgCountIfIndex=hwMgmdCtlMsgCountIfIndex, hwMgmdGroup=hwMgmdGroup, hwMgmdCtlMsgCountEntry=hwMgmdCtlMsgCountEntry, hwMgmdRouterSrcListAddressType=hwMgmdRouterSrcListAddressType, hwMgmdRouterCacheVersion2HostTimer=hwMgmdRouterCacheVersion2HostTimer, hwMgmdRouterCacheUpTime=hwMgmdRouterCacheUpTime, hwMgmdCtlMsgCountISEX=hwMgmdCtlMsgCountISEX, hwMgmdCtlMsgCountReportASM=hwMgmdCtlMsgCountReportASM, hwMgmdGMPTotalLimit=hwMgmdGMPTotalLimit, hwMgmdGmpLimitGroupAddressType=hwMgmdGmpLimitGroupAddressType, HWMgmdCtlMsgState=HWMgmdCtlMsgState, hwMgmdMibGroups=hwMgmdMibGroups, hwMgmdRouterInterfaceStartupQueryInterval=hwMgmdRouterInterfaceStartupQueryInterval, hwMgmdHostStarGCurrentCount=hwMgmdHostStarGCurrentCount, hwMgmdHostStarGThreshold=hwMgmdHostStarGThreshold, hwMgmdRouterInterfaceQuerierUpTime=hwMgmdRouterInterfaceQuerierUpTime, hwMgmdRouterInterfaceStartupQueryCount=hwMgmdRouterInterfaceStartupQueryCount, hwMgmdCtlMsgCountTOEX=hwMgmdCtlMsgCountTOEX, hwMgmdRouterInterfaceStatus=hwMgmdRouterInterfaceStatus, hwMgmdRouterCacheSourceFilterMode=hwMgmdRouterCacheSourceFilterMode, hwMgmdV3RouterMibGroup=hwMgmdV3RouterMibGroup, hwMgmdIgmpV1RouterMibCompliance=hwMgmdIgmpV1RouterMibCompliance, hwMgmdInterfaceEntries=hwMgmdInterfaceEntries, hwMgmdGMPGlobalLimitClear=hwMgmdGMPGlobalLimitClear, hwMgmdGmpLimitSource=hwMgmdGmpLimitSource, hwMgmdRouterInterfaceLastMembQueryCount=hwMgmdRouterInterfaceLastMembQueryCount, hwMgmdInterfaceLimit=hwMgmdInterfaceLimit, hwMgmdCtlMsgCountALLOW=hwMgmdCtlMsgCountALLOW, hwMgmdTotalLimitThresholdExceed=hwMgmdTotalLimitThresholdExceed, hwMgmdInverseRouterCacheEntry=hwMgmdInverseRouterCacheEntry, hwMgmdGmpLeave=hwMgmdGmpLeave, hwMcast=hwMcast, hwMgmdGmpInterfaceIfIndex=hwMgmdGmpInterfaceIfIndex, hwMgmdRouterCacheAddressType=hwMgmdRouterCacheAddressType, hwMgmdGmpJoinSrcAddr=hwMgmdGmpJoinSrcAddr, hwMgmdStdMib=hwMgmdStdMib, hwMgmdHostStarGThresholdExceedClear=hwMgmdHostStarGThresholdExceedClear, hwMgmdMibCompliance=hwMgmdMibCompliance, hwMgmdRouterInterfaceIfIndex=hwMgmdRouterInterfaceIfIndex, hwMgmdHostStarGExceedClear=hwMgmdHostStarGExceedClear, hwMgmdHostStarGThresholdExceed=hwMgmdHostStarGThresholdExceed, hwMgmdCtlMsgCountState=hwMgmdCtlMsgCountState, hwMgmdRouterBaseMibGroup=hwMgmdRouterBaseMibGroup, hwMgmdHostSGThresholdExceed=hwMgmdHostSGThresholdExceed, hwMgmdMibConformance=hwMgmdMibConformance, hwMgmdHostNotificationSrcAddr=hwMgmdHostNotificationSrcAddr, hwMgmdGmpInterfaceName=hwMgmdGmpInterfaceName, hwMgmdV2IgmpRouterMibGroup=hwMgmdV2IgmpRouterMibGroup, hwMgmdHostSGCurrentCount=hwMgmdHostSGCurrentCount)
def test_get_cpu_times(device): result = device.cpu_times() assert result is not None def test_get_cpu_percent(device): percent = device.cpu_percent(interval=1) assert percent is not None assert percent != 0 def test_get_cpu_count(device): assert device.cpu_count() == 2
# Normal way def userEntity(item) -> dict: return { "fname":item["fname"], "lname":item["lname"], "email":item["email"], } def usersEntity(entity) -> list: return [userEntity(item) for item in entity]
# Copyright (c) 2013-2018 LG Electronics, Inc. # # 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. # # SPDX-License-Identifier: Apache-2.0 { 'variables' : { 'sysroot%': '' }, "targets": [ { 'target_name': "webos-sysbus", 'include_dirs': [ '<!@(pkg-config --cflags-only-I glib-2.0 | sed s/-I//g)' ], 'sources': [ 'src/node_ls2.cpp', 'src/node_ls2_base.cpp', 'src/node_ls2_call.cpp', 'src/node_ls2_error_wrapper.cpp', 'src/node_ls2_handle.cpp', 'src/node_ls2_message.cpp', 'src/node_ls2_utils.cpp' ], 'link_settings': { 'libraries': [ '<!@(pkg-config --libs glib-2.0)', '-lluna-service2', '-lpthread' ] }, 'cflags!': [ '-fno-exceptions' ], 'cflags': [ '-g' ], 'cflags_cc': [ '-g', '--std=c++11' ], 'cflags_cc!': [ '-fno-exceptions' ], 'ldflags': [ '-pthread' ], 'actions': [ { 'variables': { 'trusted_scripts': [ "$(webos_servicesdir)/jsservicelauncher/bootstrap-node.js", "$(webos_prefix)/nodejs/unified_service_server.js" ] }, 'action_name':'gen_trusted', 'inputs': [ 'tools/gen_list.sh', 'binding.gyp' ], 'outputs': [ 'src/trusted_scripts.inc' ], 'action': [ '/bin/sh', 'tools/gen_list.sh', '<@(_outputs)', '<@(trusted_scripts)' ], 'message':'Generating trusted scripts list' } ] } ] }
"""@package This package enables the document usage for the database. """ class Document: """ This class defines a document (description, pdf file...). """ def __init__(self, document_id, html_content_eng, html_content_nl): """ Document initializer. :param document_id: The ID of the document. :param html_content_eng: If description, the english HTML content. :param html_content_nl: If description, the dutch HTML content. """ self.document_id = document_id self.html_content_eng = html_content_eng self.html_content_nl = html_content_nl def to_dict(self): """ Converts object to a dictionary. :return: Dictionary of the object data. """ return vars(self) class DocumentDataAccess: """ This class interacts with the Document component of the database. """ def __init__(self, dbconnect): """ Initialises the DocumentDataAccess object. :param dbconnect: The database connection. """ self.dbconnect = dbconnect def add_document(self, obj): """ Adds a document to the database. :param obj: The new document object. :raise: Exception if the database has to roll back. """ cursor = self.dbconnect.get_cursor() try: cursor.execute('INSERT INTO document(html_content_eng, html_content_nl) VALUES(%s,%s)', (obj.html_content_eng, obj.html_content_nl)) # get id and return updated object cursor.execute('SELECT LASTVAL()') iden = cursor.fetchone()[0] obj.document_id = iden self.dbconnect.commit() return obj except: self.dbconnect.rollback() raise def update_document(self, obj): """ Updates a document in the database. :param obj: The new document object. :raise: Exception if the database has to roll back. """ cursor = self.dbconnect.get_cursor() try: cursor.execute('UPDATE document SET html_content_nl = %s, html_content_eng = %s WHERE document_id = %s', (obj.html_content_nl, obj.html_content_eng, obj.document_id)) self.dbconnect.commit() except: self.dbconnect.rollback() raise def get_documents(self): """ Fetches all the documents in the database. :return: A list with all the document objects. """ cursor = self.dbconnect.get_cursor() cursor.execute('SELECT document_id, html_content_eng, html_content_nl FROM Document') document_objects = list() for row in cursor: document_obj = Document(row[0], row[1], row[2]) document_objects.append(document_obj) return document_objects def get_document(self, document_id): """ Fetches a specific document from the database. :param document_id: The ID of the document. :return: The document object. """ cursor = self.dbconnect.get_cursor() cursor.execute('SELECT document_id, html_content_eng, html_content_nl FROM Document ' 'WHERE document_id=%s', (document_id,)) row = cursor.fetchone() return Document(row[0], row[1], row[2])
def bool_func(i, w, a): if i == 0: if w == 0: return True else: return False # in case not choosing a[i-1] if bool_func(i-1, w, a): return True # in case choosing a[i-1] if bool_func(i-1, w-a[i-1], a): return True # return False if both cases are False return False def main(): N, W = map(int, input().split()) a = list(map(int, input().split())) if bool_func(N, W, a): print("Yes") else: print("No") ######### memo verson ########## def bool_func_memo(i, w, a, memo): if i == 0: if w == 0: return True else: return False # in case not choosing a[i-1] if memo[i-1][w] == float('inf'): memo[i-1][w] = bool_func(i-1, w, a, memo) if memo[i-1][w]: return True # in case choosing a[i-1] if memo[i-1][w-a[i-1]] == float('inf'): memo[i-1][w-a[i-1]] = bool_func(i-1, w-a[i-1], memo) if memo[i-1][w-a[i-1]]: return True # return False if both cases are False return False def main_memo(): N, W = map(int, input().split()) a = list(map(int, input().split())) memo = [float('inf')]*N*W if bool_func(N, W, a): print("Yes") else: print("No") if __name__=='__main__': #main() main_memo()
nome = input('Qual รฉ o seu nome? ') idade = input('Qual รฉ a sua idade? ') peso = input('Qual รฉ o seu peso? ') print(f'\033[4:31m{nome}\033[m, \033[4:34m{idade}\033[m, \033[4:35m{peso}\033[m')
""" Working on planning a large event (like a wedding or graduation) is often really difficult, and requires a large number of dependant tasks. However, doing all the tasks linearly isn't always the most efficient use of your time. Especially if you have multiple individuals helping, sometimes multiple people could do some tasks in parallel. We are going to define an input set of tasks as follows. The input file will contain a number of lines, where each line has a task name followed by a colon, followed by any number of dependencies on that task. A task is an alphanumeric string with underscores and no whitespace For example, lets say we have to eat dinner. Eating dinner depends on dinner being made and the table being set. Dinner being made depends on having milk, meat and veggies. Having milk depends on going to the fridge, but meat and veggies depend on buying them at the store. buying them at the store depends on having money, which depends on depositing ones paycheck.... this scenario would be described in the following input file. Note task definitions can appear in any order and do not have to be defined before they are used. eat_dinner: make_dinner set_table make_dinner: get_milk get_meat get_veggies get_meat: buy_food buy_food: get_money get_veggies: buy_food get_money: deposit_paycheck Write a program that can read an input file in this syntax and output all the tasks you have to do, in an ordering that no task happens before one of its dependencies. """ class Node: def __init__(self, value, above=None, below=None): self.value = value self.above = set() self.below = set() if above: self.add_above(above) if below: self.add_below(below) def add_above(self, value): self.above.add(value) def remove_above(self, value): self.above.remove(value) def add_below(self, value): self.below.add(value) def work_list(inp): node_list = {} working_list = inp.split('\n') for w in working_list: head, tails = w.split(': ') if head not in node_list: node_list[head] = Node(head) for t in tails.split(' '): if t not in node_list: node_list[t] = Node(t, below=head) else: node_list[t].add_below(head) node_list[head].add_above(t) res = [] while node_list: hold = [n for n in node_list.keys() if not node_list[n].above] res += hold for h in hold: node_list = remove_node(h, node_list) return res def remove_node(node, node_list): node_list.pop(node) for n in node_list: if node in node_list[n].above: node_list[n].remove_above(node) return node_list def main(): inp = ("eat_dinner: make_dinner set_table\n" "make_dinner: get_milk get_meat get_veggies\n" "get_meat: buy_food\n" "buy_food: get_money\n" "get_veggies: buy_food\n" "get_money: deposit_paycheck") print(work_list(inp)) if __name__ == "__main__": main()
def mid(word: str | list | tuple) -> str: return "" if len(word) % 2 == 0 else word[round(len(word) // 2)] def tests() -> None: print(mid("hello")) # "l" print(mid("12345")) # "3" print(mid("hello2")) # "" print(mid("abc")) # "b" # It also works with lists! print(mid(["a", "b", "c", "d", "e"])) # "c" print(mid(("1", "2", "3", "4", "5"))) # "3" if __name__ == "__main__": tests()
def A(): q = int(input()) for i in range(q): n , a , b = map(int , input().split()) if(2*a<b): print(n*a) continue else: print(n//2*b+(n%2)*a) A()
# Archivo: variables_3_booleanas.py # Autor: Javier Garcia Algarra # Fecha: 27 de diciembre de 2017 # Descripciรณn: Variables booleanas # Las variables booleanas son muy รบtiles. Sรณlo pueden tomar dos variables True (Verdadero) o False (Falso) booleana_1 = True booleana_2 = False print("La variable booleana_1 es",booleana_1,"y la variable 2 es",booleana_2) # Espera dummy = input() # Cuando hacemos comparaciones el resultado es una variable booleana a = 6 b = 5 a_mayor_que_b = (a > b) a_menor_que_b = (a < b) print("La variable a vale",a,"y la variable b vale",b) print("Si digo que a es mayor que b, es",a_mayor_que_b) print("Si digo que a es mayor que b, es",a_menor_que_b) # Espera dummy = input() # Para saber si dos valores son iguales usamos el operador == # ยกCuidado! si pones solo = es el operador de asignaciรณn y d = 5 e = 5 f = 7 print("Las variables d, e y f valen",d,",",e,",",f) print("Si digo que d y e valen lo mismo es", d == e) print("Si digo que e y f valen lo mismo es", e == f) # Espera dummy = input() # Con las variables booleanas podemos tomar decisiones usando # la expresiรณn if if (5 > 3): print("La condiciรณn 5 > 3 se cumple") # Espera dummy = input() # ยฟQuรฉ sucede si queremos hacer una cosa si la condiciรณn se cumple y # otra diferente si no se cumple? Para eso usamos la expresiรณn completa if ... else y = 7 x = 9 print("Las variables x, y valen",x,",",y) if (x == y): print("Esto es lo sucede si las variables x e y son iguales") else: print("Y esto es lo que sucede si las variables x e y no son iguales") # Espera dummy = input() # Ahora vamos a ver un ejemplo muy sencillo. Luego lo haremos un poco mรกs divertido con un juego numero_secreto = 7 # OK, no es muy secreto porque ya sabes programar en Python, pero lo es para alguien que solo use el programa num_del_usuario = int(input("He pensado un nรบmero secreto del 1 al 10. A ver si lo adivinas: ")) if (num_del_usuario == numero_secreto): print("ยกImpresionante!, lo adivinaste") else: print("No acertaste, mi nรบmero secreto era el ",numero_secreto)
class AdministrationWarning(Warning): pass class TemporaryDirectoryDeletionWarning(Warning): pass
class TradeRecord: """ๆ•ฐๆฎๅบ“ๅญ—ๆฎตๅๅธธ้‡""" # ID ID = "ID" # ่‚ก็ฅจไปฃ็  STOCK_CODE = "STOCK_CODE" # ่‚ก็ฅจๅๅญ— STOCK_NAME = "STOCK_NAME" # ไบคๆ˜“ๆ—ถ5ๆกฃ่ฏฆๆƒ… DETAIL = "DETAIL" # ไบคๆ˜“็ฑปๅž‹(ไนฐๅ…ฅ:buy ๅ–ๅ‡บ:sell) TRADE_TYPE = "TRADE_TYPE" # ไบคๆ˜“ไปทๆ ผ TRADE_PRICE = "TRADE_PRICE" # ไบคๆ˜“ๆ•ฐ้‡ TRADE_AMOUNT = "TRADE_AMOUNT" # ไบคๆ˜“ๆ—ถ้—ด TIMESTAMP = "TIMESTAMP" """ๆˆๅ‘˜ๅ˜้‡""" id = "" stock_code = "" stock_name = "" detail = "" trade_type = "" trade_price = "" trade_amount = "" timestamp = "" """ๆž„้€ ๆ–นๆณ•""" def __init__(self, stock_code, stock_name=None, detail=None, trade_price=None, trade_type=None, trade_amount=None, timestamp=None): self.stock_code = stock_code self.stock_name = stock_name self.detail = detail self.trade_type = trade_type self.trade_price = trade_price self.trade_amount = trade_amount self.timestamp = timestamp def __str__(self): print(self)
# -*- coding: utf-8 -*- """ Created on Wed Jan 29 20:01:24 2020 @author: Tushar Saxena """ """ Algo: low:= 0 high:= n-1 while low <= high Do mid = (low + high) / 2 if arr[mid] == value: return mid elif arr[mid] < value: low = mid + 1 elif arr[mid] > value: high = mid - 1 return -1 #value not found O(log(n)) """
#input # 13 # 19443 576 # 6001842 911503 # 4067 1248 # 6121885 186 # -410349 4955307 # 5375848 874 # 2770998 256 # 18765 1284 # 5813 1630 # 8212240 77 # 293304 -4580549 # 7956897 3420372 # 6775023 846 n = int(input()) for k in range(0, n): num = None for i in input().split(): if not(num): num = float(i) continue num /= float(i) print(round(num)," ", end="")
# Crie um programa que leia algo e mostre seu tipo pimitivo e todas as informaรงรตes possรญveis sobre ele. print('=-'*7, 'DESAFIO 4', '=-'*7) n = input('Digite algo: ') print('O tipo primitivo desse valor รฉ {}.'.format(type(n))) # Ponto de melhoria! print('Sรณ tem espaรงos? {}'.format(n.isspace())) print('ร‰ um nรบmero? {}'.format(n.isnumeric())) print('ร‰ alfanumรฉrico? {}'.format(n.isalnum())) print('ร‰ alfabรฉtico? {}'.format(n.isalpha())) print('Estรก em minรบsculas? {}'.format(n.islower())) print('Estรก em maiรบsculas? {}'.format(n.isupper())) print('Estรก capitalizada? {}'.format(n.istitle()))
with open("instructions.txt") as f: content = f.readlines() instrL = [] for line in content: if ";" in line: instr = line.split(";")[0] instr = instr.replace(" ", "") instr = instr.replace("()", "") instr = instr.replace("void", "") nr = line.split("/")[2] nr = nr.rstrip("\n") #print("opcodes[%s] = std::bind(&Cpu::%s, this);" % (nr, instr)) #print("%s = %s, " % (instr, nr)) print("{\"%s\", %s}," % (instr, nr)) instrL.append(nr) # missingInstrL = [] # for x in range(0, len(instrL)): # if str(x) not in instrL[x]: # missingInstrL.append(instrL[x]) # print("missing instructions: " + str(len(missingInstrL))) # print(missingInstrL)
""" Tendo como dado de entrada a altura (h) de uma pessoa, construa um algoritmo que calcule seu peso ideal, utilizando as seguintes fรณrmulas: Para homens: (72.7*h) - 58 Para mulheres: (62.1*h) - 44.7 """ h = float(input('Informe sua altura (em metros): ')) sexo = input('Informe seu sexo (M = Mulher / H = Homem) :') if sexo == 'H' or sexo == 'h': peso_ideal = (72.7 * h) - 58 print(f'O seu peso ideal รฉ: {peso_ideal}') elif sexo == 'M' or sexo == 'm': peso_ideal = (65.1 * h) - 44.7 print(f'O seu peso ideal รฉ: {peso_ideal}') else: print('Opรงรฃo invรกlida.')
""" Merge sort uses auxiliary storage """ def merge_sort(A): """Merge Sort implementation using auxiliary storage.""" aux = [None] * len(A) def rsort(lo, hi): if hi <= lo: return mid = (lo+hi) // 2 rsort(lo, mid) rsort(mid+1, hi) merge(lo, mid, hi) def merge(lo, mid, hi): # copy results of sorted sub-problems into auxiliary storage aux[lo:hi+1] = A[lo:hi+1] left = lo # starting index into left sorted sub-array right = mid+1 # starting index into right sorted sub-array for i in range(lo, hi+1): if left > mid: A[i] = aux[right] right += 1 elif right > hi: A[i] = aux[left] left += 1 elif aux[right] < aux[left]: A[i] = aux[right] right += 1 else: A[i] = aux[left] left += 1 rsort(0, len(A)-1) def merge_sort_counting(A): """Perform Merge Sort and return #comparisons.""" aux = [None] * len(A) def rsort(lo, hi): if hi <= lo: return (0,0) mid = (lo+hi) // 2 (lefts, leftc) = rsort(lo, mid) (rights, rightc) = rsort(mid+1, hi) (nswap, ncomp) = merge(lo, mid, hi) return (lefts+rights+nswap, leftc+rightc+ncomp) def merge(lo, mid, hi): # copy results of sorted sub-problems into auxiliary storage aux[lo:hi+1] = A[lo:hi+1] i = lo # starting index into left sorted sub-array j = mid+1 # starting index into right sorted sub-array numc = 0 nums = 0 for k in range(lo, hi+1): if i > mid: if A[k] != aux[j]: nums += 0.5 A[k] = aux[j] j += 1 elif j > hi: if A[k] != aux[i]: nums += 0.5 A[k] = aux[i] i += 1 elif aux[j] < aux[i]: numc += 1 if A[k] != aux[j]: nums += 0.5 A[k] = aux[j] j += 1 else: numc += 1 if A[k] != aux[i]: nums += 0.5 A[k] = aux[i] i += 1 return (nums, numc) return rsort( 0, len(A)-1)
# this is an example trial file # each line in this file is one command # there are two type of commands, phase commands and robot commands #all comamands share the same format: # name_of_command(time_to_run_command, <some number of arguments>) # time_to_run_command is the numver of seconds afte rth trial starts # the command shoudl be sent to the robot # <some number of arguments> are other values taht the command shoudl take, # these vary depending on command. all arguments are seperated by commas # phase commands set the phase of the trial at the time specifed # lines that start with "#" do not send commands and can be used a comments on what you are doing phase(0, '1') # this sets the phase to one skee(3, 9) # executes the command skee 3 seconds after the program starts with input 9 phase(60, '2') phase(60, '3')
#!/usr/bin/python3 ''' Sequencia de Fibonacci com limite de 20mil Utilizando a funcao soma -2: = somara os dois ultimos elmentos da lista ''' # 0, 1, 1, 2, 3, 5, 8, 13, 21... def fibonacci(limite): resultado = [0, 1] while resultado[-1] < limite: resultado.append(sum(resultado[-2:])) return resultado if __name__ == '__main__': for fib in fibonacci(10000): print(fib) # Fontes: # Curso Python 3 - Curso Completo do Bรกsico ao Avanรงado Udemy Aula 87 a 97 # https://github.com/cod3rcursos/curso-python/tree/master/estruturas_controle_projetos
def test_slice_bounds(s): # End out of range assert s[0:100] == s assert s[0:-100] == '' # Start out of range assert s[100:1] == '' # Out of range both sides # This is the behaviour in cpython # assert s[-100:100] == s def expect_index_error(s, index): try: s[index] except IndexError: pass else: assert False unicode_str = "โˆ€โˆ‚" assert unicode_str[0] == "โˆ€" assert unicode_str[1] == "โˆ‚" assert unicode_str[-1] == "โˆ‚" test_slice_bounds(unicode_str) expect_index_error(unicode_str, 100) expect_index_error(unicode_str, -100) ascii_str = "hello world" test_slice_bounds(ascii_str) assert ascii_str[0] == "h" assert ascii_str[1] == "e" assert ascii_str[-1] == "d" # test unicode indexing, made more tricky by hebrew being a right-to-left language hebrew_text = "ื‘ึฐึผืจึตืืฉึดืื™ืช, ื‘ึธึผืจึธื ืึฑืœึนื”ึดื™ื, ืึตืช ื”ึทืฉึธึผืืžึทื™ึดื, ื•ึฐืึตืช ื”ึธืึธืจึถืฅ" assert len(hebrew_text) == 60 assert len(hebrew_text[:]) == 60 assert hebrew_text[0] == 'ื‘' assert hebrew_text[1] == 'ึฐ' assert hebrew_text[2] == 'ึผ' assert hebrew_text[3] == 'ืจ' assert hebrew_text[4] == 'ึต' assert hebrew_text[5] == 'ื' assert hebrew_text[6] == 'ืฉ' assert hebrew_text[5:10] == 'ืืฉึดืื™' assert len(hebrew_text[5:10]) == 5 assert hebrew_text[-20:50] == 'ืžึทื™ึดื, ื•ึฐื' assert len(hebrew_text[-20:50]) == 10 assert hebrew_text[:-30:1] == 'ื‘ึฐึผืจึตืืฉึดืื™ืช, ื‘ึธึผืจึธื ืึฑืœึนื”ึดื™ื, ' assert len(hebrew_text[:-30:1]) == 30 assert hebrew_text[10:-30] == 'ืช, ื‘ึธึผืจึธื ืึฑืœึนื”ึดื™ื, ' assert len(hebrew_text[10:-30]) == 20 assert hebrew_text[10:30:3] == 'ืชื‘ืจ ืœึด,' assert len(hebrew_text[10:30:3]) == 7 assert hebrew_text[10:30:-3] == '' assert hebrew_text[30:10:-3] == 'ืืื”ึฑืึผ ' assert len(hebrew_text[30:10:-3]) == 7 assert hebrew_text[30:10:-1] == 'ื ,ืื™ึดื”ึนืœึฑื ืึธืจึผึธื‘ ,' assert len(hebrew_text[30:10:-1]) == 20
""" Let's use decorators to build a name directory! You are given some information about people. Each person has a first name, last name, age and sex. Print their names in a specific format sorted by their age in ascending order i.e. the youngest person's name should be printed first. For two people of the same age, print them in the order of their input. For Henry Davids, the output should be: Mr. Henry Davids For Mary George, the output should be: Ms. Mary George Input Format The first line contains the integer , the number of people. lines follow each containing the space separated values of the first name, last name, age and sex, respectively. Constraints Output Format Output names on separate lines in the format described above in ascending order of age. Sample Input 3 Mike Thomson 20 M Robert Bustle 32 M Andria Bustle 30 F Sample Output Mr. Mike Thomson Ms. Andria Bustle Mr. Robert Bustle Concept For sorting a nested list based on some parameter, you can use the itemgetter library. You can read more about it here. """ def person_lister(f): def inner(people): # complete the function for ps in sorted(people, key=lambda x: int(x[2])): yield f(ps) return inner @person_lister def name_format(person): return ("Mr. " if person[3] == "M" else "Ms. ") + person[0] + " " + person[1] if __name__ == '__main__': people = [input().split() for i in range(int(input()))] print(*name_format(people), sep='\n')
def mittelwert(liste): return sum(liste)/len(liste) def mittelwert2(*liste): return sum(liste)/len(liste) print(mittelwert([3, 4, 5])) print(mittelwert2(3, 4, 5)) def ausgabe(Liste, ende="\n"): for element in Liste: print(element, end=ende) def ausgabe2(Liste, **kwargs): ende = "\n" if "ende" not in kwargs else kwargs["ende"] erstezeile = " " if "erstezeile" not in kwargs else kwargs["erstezeile"] print(erstezeile) for element in Liste: print(element, end=ende) einkaufsliste = ["Milch", "Eier", "Bier"] ausgabe(einkaufsliste) ausgabe(einkaufsliste, " ") print() ausgabe2(einkaufsliste) print() ausgabe2(einkaufsliste, erstezeile = "asdf" )
class DDSDeliveryPreview(object): """ A class to represent a delivery preview, without persistence. Has many of the same properties as a Delivery, and can be provided to the email generation code """ def __init__(self, from_user_id, to_user_id, project_id, transfer_id, user_message): self.from_user_id = from_user_id self.to_user_id = to_user_id self.project_id = project_id self.transfer_id = transfer_id self.user_message = user_message self.delivery_email_text = '' self.email_template_set = None
# Copyright 2021 The BladeDISC Authors. 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. class UnionSet: def __init__(self, num_elems: int): self._num_elems = num_elems self._num_sets = num_elems self._group_id = dict([(g, g) for g in range(0, num_elems)]) def same_group(self, x: int, y: int): pid_x = self.find(x) pid_y = self.find(x) if (pid_x == pid_y): return True return False def find(self, x: int): assert(x < self._num_elems) assert(x in self._group_id) pid = self._group_id[x] if (pid != self._group_id[pid]): pid = self.find(pid) # path compression self._group_id[x] = pid return pid def num_sets(self): return self._num_sets def union(self, x: int, y: int): pid_x = self.find(x) pid_y = self.find(y) if (pid_x == pid_y): return self._num_sets -= 1 self._group_id[pid_y] = pid_x def get_groups(self): groups_dict = dict() for k in range(0, self._num_elems): pid = self.find(k) if pid not in groups_dict: groups_dict[pid] = list() groups_dict[pid].append(k) keys = sorted(groups_dict.keys()) groups = list() for k in keys: assert(len(groups_dict[k]) > 0) groups.append(groups_dict[k]) assert(self._num_sets == len(groups)) return groups
''' Runtime: 56 ms, faster than 75.06% of Python3 online submissions for Longest Substring Without Repeating Characters. Memory Usage: 12.8 MB, less than 100.00% of Python3 online submissions for Longest Substring Without Repeating Characters. ''' ''' Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: Input: "bbbbb" Output: 1 Explanation: The answer is "b", with the length of 1. Example 3: Input: "pwwkew" Output: 3 Explanation: The answer is "wke", with the length of 3. Note that the answer must be a substring, "pwke" is a subsequence and not a substring. ''' class Solution: def lengthOfLongestSubstring(self, s): #s for the input string #detect new substrings with a sliding window map = {} #stores all the characters found in the substring #{character:position_in_the_input_string} maxlen = 0 #the answer start = 0 #the starting point of the sliding window for i,value in enumerate(s): #'abc' -> 0 a; 1 b; 2 c if value in map: #Repeating character found. #Change the starting position of the sliding window #to the next character of the repeated one. new_start = map[value] + 1 if new_start > start: start = new_start #no repeating character found, #or have renewed the start of the sliding window num = i - start + 1 maxlen=max(maxlen,num) map[value] = i return maxlen
n, m, k = map(int, input().split()) if k < n: print(k + 1, 1) else: k -= n r = n - k // (m - 1) if r & 1: print(r, m - k % (m - 1)) else: print(r, k % (m - 1) + 2)
TASK_NAME = 'ReviewTask' JS_ASSETS = [''] JS_ASSETS_OUTPUT = 'scripts/vulyk-declarations-review.js' JS_ASSETS_FILTERS = 'yui_js' CSS_ASSETS = [''] CSS_ASSETS_OUTPUT = 'styles/vulyk-declarations-review.css' CSS_ASSETS_FILTERS = 'yui_css'
#!/usr/bin/python3 # -*-coding:utf-8-*- __author__ = "Bannings" class Solution: def decodeString(self, s: str) -> str: ans, stack, num = "", [], 0 for char in s: if char.isdigit(): num = num * 10 + int(char) elif char == "[": stack.append((num, ans)) num, ans = 0, "" elif char == "]": last_num, last_chars = stack.pop() ans = last_chars + last_num * ans else: ans += char return ans # def decodeString(self, s: str) -> str: # ans, stack = "", [] # i = 0 # while i < len(s) and s[i].islower(): # ans += s[i] # i += 1 # while i < len(s): # j = i # while s[i].isdigit(): i += 1 # num = int(s[j:i]) # i += 1 # [ # j = i # while i < len(s) and s[i].islower(): i += 1 # stack.append((num, s[j:i])) # while i < len(s) and s[i] == "]": # i += 1 # num, chars = stack.pop() # temp = chars * num # while i < len(s) and s[i].islower(): # temp += s[i] # i += 1 # if stack: # stack[-1] = stack[-1][0], stack[-1][1] + temp # else: # ans += temp # return ans if __name__ == '__main__': # assert Solution().decodeString("3[a]2[bc]") == "aaabcbc" assert Solution().decodeString("3[a2[c]]") == "accaccacc" assert Solution().decodeString("2[abc]3[cd]ef") == "abcabccdcdcdef" assert Solution().decodeString("abc3[cd]xyz") == "abccdcdcdxyz"
''' Given a target A on an infinite number line, i.e. -infinity to +infinity. You are currently at position 0 and you need to reach the target by moving according to the below rule: In ith move you can take i steps forward or backward. Find the minimum number of moves required to reach the target. ''' class Solution: # @param A : integer # @return an integer def solve(self, A): if A == 0: return 0 A = abs(A) i = 1 no = 0 while 1: no += i if no == A: return i if no > A: break i += 1 cur = no-A if(cur % 2 == 0): return i if((cur+i+1) % 2 == 0): return i+1 return i+2
input = """ 3 7 61 146 73 112 115 127 130 0 0 1 146 2 0 155 73 1 155 2 0 146 73 1 148 2 0 150 115 1 150 2 0 148 115 1 148 2 0 152 112 1 152 2 0 148 112 1 152 2 0 158 127 1 158 2 0 152 127 1 155 2 0 157 61 1 157 2 0 155 61 1 158 2 0 160 130 1 160 2 0 158 130 0 0 B+ 0 B- 1 0 1 """ output = """ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} """
def format_name(first_name,last_name): if first_name == "" and last_name == "": return "You didn't provide valid inputs" first_name = first_name.title() last_name = last_name.title() return first_name + " " + last_name name = format_name(input("Enter your first name : "),input("Enter your last name : ")) print(name)
class AnalistaContable(): def sueldo(self, horas, precio, comisiones): print("el sueldo del analista contable es:", (horas*precio)- comisiones) def Datos(self, nombre, apellido, edad): print("el nombre del analista contable es: ", nombre ," ", apellido, "\n su edad es: ", edad) def labores(self, especialilzacion, crear, tipoContrato): print("el analista contable hace", crear, "y esta especializado en: ", especialilzacion, "\n el tipo de contrato que tiene es: ", tipoContrato)
class Person: def __init__(self, first_name: str, last_name: str, age: int) -> None: self.first_name = first_name self.last_name = last_name self.age = age def __repr__(self) -> str: return f"{self.first_name} {self.last_name}, {self.age} y.o."
asdasdasd asdasdasdsa asdasd
dado = dict() partidas = list() galera = list() cont = 0 # Leitura de dados de todos os jogadores while True: print('-=' * 30) #Leitura dos dados de cada jogador dado['nome'] = str(input('Nome do Jogador: ')).title() tot_part = int(input(f'Quantas partidas {dado["nome"]} jogou? ')) for c in range(0, tot_part): partidas.append(int(input(f' Quantos gols na {c + 1}ยช partida: '))) dado['gols'] = partidas[:] partidas.clear() dado['total'] = sum(partidas) # Adicionar os dados de cada jogador na lista 'Galera' galera.append(dado.copy()) dado.clear() #Verificaรงรฃo de finalizaรงรฃo do loop while True: resp = str(input('Deseja continuar: [S/N] ')).upper()[0] if resp in 'NnSs': break else: print('ERRO! Resposta apenas S ou N') if resp in 'Nn': break #Finalizaรงรฃo da leitura de dados de todos os jogadores # Saรญda dos dados print('-=' * 50) print(f'{"No.":<6}{"Nome":<15}{"Total":<4}{"Gols":>8}') print('-' * 40) for p in galera: print(f'{cont:<6}{p["nome"]:<15}{p["total"]:<4} {p["gols"]}') cont += 1 print('-' * 40) # INformaรงรตes de cada jogador op = -1 while op != 999: op = int(input('Mostrar opรงรตes de qual jogador? [999 para parar] ')) if op != 999 and op < len(galera): print('-=' * 20) print(f' -- LEVANTAMENTO DO JOGADOR {galera[op]["nome"]}') for i, j in enumerate(galera[op]["gols"]): print(f' No jogo {i + 1} fez {j} gols.') if op > (len(galera) - 1) and op != 999: print('Cรณdigo Invalido')
''' Archivo de configuraciones del sistema, los siguientes parรกmetros pueden ser modificados para cambiar el funcionamiento y comportamiento de la simulaciรณn. Estos cambios solo se ven aplicados cuando se ejecuta el servidor de manera local. Autores: David Rodrรญguez Fragoso A01748760 Erick Hernรกndez Silva A01750170 Israel Sรกnchez Miranda A01378705 Renata de Luna Flores A1750484 Roberto Valdez Jasso A01746863 01/12/2021 ''' # Probabilidad de que un carro de vuelta del 1 al 100. Usa 0 para desactivar la vuelta. PROBABILIDAD_DE_DAR_VUELTA = 35 # Si el valor es False, todos los autos tendrรกn una velocidad constante. VELOCIDAD_VARIABLE = True # Velocidad mรกxima que puede tener un auto. Solo funciona si VELOCIDAD_VARIABLE estรก activada. VELOCIDAD_MAX = 40 # Velocidad mรญnima que puede tener un auto. Solo funciona si VELOCIDAD_VARIABLE estรก activada. # Si se elige 0, entonces hay probabilidad de que el auto no avance. VELOCIDAD_MIN = 35 # Puerto en el que va a correr el servidor web. IBM Cloud usa el puerto 8080. PUERTO = 8080
class CastLibraryTable: #------------------------------ def __init__(self, castlibs): self.by_nr = {} self.by_assoc_id = {} for cl in castlibs: self.by_nr[cl.nr] = cl if cl.assoc_id>0: self.by_assoc_id[cl.assoc_id] = cl def iter_by_nr(self): return self.by_nr.itervalues() def get_cast_library(self, lib_nr): return self.by_nr[lib_nr] def get_cast_member(self, lib_nr, member_nr): cast_lib = self.by_nr[lib_nr] return cast_lib.get_cast_member(member_nr) if cast_lib != None else None #-------------------------------------------------- class CastLibrary: #------------------------------ def __init__(self, nr, name, path, assoc_id, idx_range, self_idx): self.nr = nr self.name = name self.path = path self.assoc_id = assoc_id self.idx_range = idx_range self.self_idx = self_idx self.castmember_table = None def __repr__(self): return "<CastLibrary #%d name=\"%s\" size=%d>" % (self.nr, self.name, len(self.castmember_table) if self.castmember_table != None else -1) def get_path(self): return self.path def castmember_table_is_set(self): return self.castmember_table != None def get_castmember_table(self): return self.castmember_table def set_castmember_table(self,table): self.castmember_table = table def get_cast_member(self, member_nr): if self.castmember_table == None: return None # TODO: Ensure loaded return self.castmember_table[member_nr-1] #--------------------------------------------------
class TimeRecord: def __init__(self,ID,startHour,endHour,projectID,recordTypeID,description,statusID,minutes,oneNoteLink,km): self.ID = ID self.StartHour = startHour self.EndHour = endHour self.ProjectID = projectID self.RecordTypeID = recordTypeID self.Description = description self.StatusID = statusID self.Minutes = minutes self.OneNoteLink = oneNoteLink self.Km = km def __str__(self): return self.Description
class Multi(object): ITEMS = (1, 3), (5, 8) def __getitem__(self, i): return self.ITEMS[i[0]][i[1]] def __setitem__(self, i, x): self.ITEMS[i[0]][i[1]] = x def __len__(self): return 2, 2
"""Initialization Module""" __version__ = "0.0.1" __version_info__ = tuple(__version__.split("."))
#!/usr/bin/env python3 # # --- Day 12: Passage Pathing --- # # With your submarine's subterranean subsystems subsisting suboptimally, # the only way you're getting out of this cave anytime soon is by finding # a path yourself. Not just a path - the only way to know if you've found # the best path is to find all of them. # # Fortunately, the sensors are still mostly working, and so you build a rough # map of the remaining caves (your puzzle input). For example: # start-A # start-b # A-c # A-b # b-d # A-end # b-end # # This is a list of how all of the caves are connected. You start in the cave # named start, and your destination is the cave named end. An entry like # b-d means that cave b is connected to cave d - that is, you can move # between them. # # So, the above cave system looks roughly like this: # start # / \ # c--A-----b--d # \ / # end # # Your goal is to find the number of distinct paths that start at start, # end at end, and don't visit small caves more than once. There are two types # of caves: big caves (written in uppercase, like A) and small caves (written # in lowercase, like b). It would be a waste of time to visit any small cave # more than once, but big caves are large enough that it might be worth # visiting them multiple times. So, all paths you find should visit small # caves at most once, and can visit big caves any number of times. # # Given these rules, there are 10 paths through this example cave system: # - start,A,b,A,c,A,end # - start,A,b,A,end # - start,A,b,end # - start,A,c,A,b,A,end # - start,A,c,A,b,end # - start,A,c,A,end # - start,A,end # - start,b,A,c,A,end # - start,b,A,end # - start,b,end # # (Each line in the above list corresponds to a single path; the caves # visited by that path are listed in the order they are visited and # separated by commas.) # # Note that in this cave system, cave d is never visited by any path: # to do so, cave b would need to be visited twice (once on the way to cave # d and a second time when returning from cave d), and since cave b is small, # this is not allowed. # # Here is a slightly larger example: # dc-end # HN-start # start-kj # dc-start # dc-HN # LN-dc # HN-end # kj-sa # kj-HN # kj-dc # # The 19 paths through it are as follows: # - start,HN,dc,HN,end # - start,HN,dc,HN,kj,HN,end # - start,HN,dc,end # - start,HN,dc,kj,HN,end # - start,HN,end # - start,HN,kj,HN,dc,HN,end # - start,HN,kj,HN,dc,end # - start,HN,kj,HN,end # - start,HN,kj,dc,HN,end # - start,HN,kj,dc,end # - start,dc,HN,end # - start,dc,HN,kj,HN,end # - start,dc,end # - start,dc,kj,HN,end # - start,kj,HN,dc,HN,end # - start,kj,HN,dc,end # - start,kj,HN,end # - start,kj,dc,HN,end # - start,kj,dc,end # # Finally, this even larger example has 226 paths through it: # fs-end # he-DX # fs-he # start-DX # pj-DX # end-zg # zg-sl # zg-pj # pj-he # RW-he # fs-DX # pj-RW # zg-RW # start-pj # he-WI # zg-he # pj-fs # start-RW # # How many paths through this cave system are there that visit small caves # at most once? # # # --- Solution --- # # We start by reading the list of edges from input file and preparing, # for convenience, a dictionary that will give us list of all possible edges # from a specified cave. Then we aim to check all possible paths from a given # starting point, counting those that take us to the goal (end). So we define # a list of paths with initial entry โ€“ single path with just one element, # the starting location. Then we perform a loop as long as there are still # some paths to consider (our list of paths is not empty). In each iteration, # we take the first path from the list of paths, we look at the last element # in that taken path (i.e. the current cave we reached) and we find all next # caves that are reachable from that point. For each of possible next caves: # - if the next cave is our goal (end), we count we found one possible solution # and do nothing else, # - if the next cave is written with lowercase letters and it was already # visited (there is already such element in our path), we skip this one # as it is forbidden location now (note that the 'start' also fits this # condition, so we have no moving back and forth between A and start), # - otherwise we produce a new path to consider by adding next cave to current # list and we add it to the list of paths we check. # With a rule that visiting some caves twice is forbidden, this look through # all possible paths eventually comes to and end (actually, it is quite fast). # As final result, we just print the counter of solutions we found. # INPUT_FILE = 'input.txt' def main(): edges = [line.strip().split('-') for line in open(INPUT_FILE, 'r')] connections = {} for edge in edges: start, end = edge if start not in connections: connections[start] = set() if end not in connections: connections[end] = set() connections[start].add(end) connections[end].add(start) goal = 'end' paths = [['start']] possible_paths = 0 while paths: path = paths.pop(0) last_cave = path[-1] for next_cave in connections[last_cave]: if next_cave == goal: possible_paths += 1 continue if next_cave.islower() and path.count(next_cave): continue new_path = path + [next_cave] paths.append(new_path) print(possible_paths) if __name__ == '__main__': main()
#!/usr/bin/env python3 def read_val(): return int(input()) def count_three_addend_decompositions(n): # https://www.wolframalpha.com/input/?i=sum_k%3D0%5En+(n+-+k+%2B+1) return (n + 1) * (n + 2) // 2 for _ in range(read_val()): print(count_three_addend_decompositions(read_val()))
class Solution: """ @param n: a non-negative integer @return: the total number of full staircase rows that can be formed """ def arrangeCoins(self, n): start = 0 end = n while start + 1 < end: mid = start + (end - start) // 2 if mid * (mid + 1) // 2 > n: end = mid else: start = mid if end * (end + 1) // 2 <= n: return end return start
ALLOWLIST_ACTIONS = [ "ip_allow_list.enable", "ip_allow_list.disable", "ip_allow_list.enable_for_installed_apps", "ip_allow_list.disable_for_installed_apps", "ip_allow_list_entry.create", "ip_allow_list_entry.update", "ip_allow_list_entry.destroy", ] def rule(event): return ( event.get("action").startswith("ip_allow_list") and event.get("action") in ALLOWLIST_ACTIONS ) def title(event): return f"GitHub Org IP Allow list modified by {event.get('actor')}."
class SolutionTLE: """ Solution with Time Limit Exceeded """ def maxEvents(self, events: List[List[int]]) -> int: queue = [] heapq.heapify(queue) for event in events: start, end = event heapq.heappush(queue, (start, end)) event_cnt = 0 prev_event = 0 while queue: start, end = heapq.heappop(queue) # by default, we do not attend the next event next_event = prev_event # start the next event as early as possible if start > prev_event: next_event = start event_cnt += 1 prev_event = next_event elif prev_event < end: # start <= prev_event next_event = prev_event + 1 new_event = (next_event, end) heapq.heappush(queue, new_event) #else: # cannot squeeze the new event in return event_cnt class Solution: def maxEvents(self, events: List[List[int]]) -> int: events.sort(key = lambda e: e[0]) # sort events by start time event_cnt = 0 event_index = 0 curr_day = 0 queue = [] while event_index < len(events) or queue: if not queue: # attend as soon as possible curr_day = events[event_index][0] # given the current day, add all candidate events while event_index < len(events) and events[event_index][0] <= curr_day: # add the end days of all candidates heapq.heappush(queue, events[event_index][1]) event_index += 1 # pick the one that ends the earliest heapq.heappop(queue) event_cnt += 1 # clean up the candidate queue while queue and queue[0] <= curr_day: heapq.heappop(queue) # move on the next day curr_day += 1 return event_cnt
# https://leetcode-cn.com/problems/lru-cache/ class LRUCache: def __init__(self, capacity: int): self.c = capacity self.l = [] self.d = {} def get(self, key: int) -> int: if key in self.d: self.l.pop(self.l.index(key)) self.l.append(key) return self.d[key] else: return -1 def put(self, key: int, value: int) -> None: if key in self.d: self.l.pop(self.l.index(key)) self.l.append(key) self.d[key] = value else: self.d[key] = value self.l.append(key) if len(self.l) > self.c: del (self.d[self.l.pop(0)])
cost = 14.99 taxperc = 23 tax = taxperc / 100.00 salepr = cost * (1.0 + tax) print("sale price:", salepr)
{ "targets": [ { "target_name": "fortuna", "sources": [ "src/main.cpp", "src/libfortuna.cpp", "src/libfortuna/blf.c", "src/libfortuna/fortuna.c", "src/libfortuna/internal.c", "src/libfortuna/md5.c", "src/libfortuna/px.c", "src/libfortuna/random.c", "src/libfortuna/rijndael.c", "src/libfortuna/sha1.c", "src/libfortuna/sha2.c" ], "include_dirs" : [ "<!(node -e \"require('nan')\")" ] } ], }
a=list() with open('db.txt', 'r') as file: for i in file: a.append(i.strip()) b=input() interval=len(a) shift=0 while interval>=1: t=interval%2 interval//=2 i=interval+t print('1 - ', a[i+shift-1], ' | 2 - ', b) r=input() while r!='1' and r!='2': r=input() if r=='1': shift+=i else: if not t: interval-=1 a.append(b) for i in range(shift+1,len(a))[::-1]: a[i], a[i-1]=a[i-1], a[i] with open('db.txt', 'w') as file: for i in range(len(a)-1): print(a[i], file=file) print(a[len(a)-1], end='', file=file)
# Training and prediction prediction_window = 7 # How many days in single prediction # Window optimization n_optimizer_predictions = 100 # Num of predictions to make during window optimization smallest_possible_training_window = 25 # Smallest training window test in optimization largest_possible_training_window = 2025 # Largest training window test in optimization training_window_test_increase = 25 # The number to increase by between window tests # Network n_reservoir = 200 # Size of Echo State Network (ESN) hidden state spectral_radius = 1.50 # Spectral radius to use for weights in ESNs sparsity = 0.2 # Sparsity to use for weights in ESN noise = 0.03 # Noise to use for training of ESN input_scaling = 1.0 # Scale ESN input to hidden weights using this value # Neuroevolution n_generations = 10 # Number of generations to run genetic algorithm for n_population = 100 mutation_rate = 0.50 # Mutation rate by which to mutate Echo State Networks crossover_rate = 0.25 # *100 = fittest % of population which will crossover n_fitness_predictions = 100 # How many predictions when calculating fitness # HTML plotting (NOTE: keep training/testing false as can severely impact performance) training_html_auto_show = False # If true display training plotly htmls upon creation testing_html_auto_show = False # If true display testing plotly htmls upon creation ohlc_html_auto_show = True # If true display OHLC html upon creation window_html_auto_show = True # If true display window optimization html upon creation results_html_auto_show = True # If true display results html upon creation x_range_factor = 8 # Plot x-range will be n_predicted_days * this value max_test_line_width = 1.5 # The maximum line width which test_line_width_factor = 5000 # Test plot individual prediction line widths will be: # max_line_width - abs(relevant_mse * line_width_factor) # (Higher = more fadeout for bad MSE. # Lower = less fadeout for bad MSE.) # Number of test predictions for each network n_test_predictions = 10 # More will give better representation of effectiveness # Number of iterations to run n_iterations = 100 # How many tests to run
# Given an array a that contains only numbers in the range from 1 to a.length, find the first duplicate number for which the second occurrence has the minimal index. In other words, if there are more than 1 duplicated numbers, return the number for which the second occurrence has a smaller index than the second occurrence of the other number does. If there are no such elements, return -1. # Example # For a = [2, 1, 3, 5, 3, 2], the output should be firstDuplicate(a) = 3. # There are 2 duplicates: numbers 2 and 3. The second occurrence of 3 has a smaller index than the second occurrence of 2 does, so the answer is 3. # For a = [2, 2], the output should be firstDuplicate(a) = 2; # For a = [2, 4, 3, 5, 1], the output should be firstDuplicate(a) = -1. def firstDuplicate(a): new = set() for i in range(len(a)): if a[i] in new: return a[i] else: new.add(a[i]) return -1 a = [2, 1, 3, 5, 3, 2] print(firstDuplicate(a))
testcase = int(input()) for i in range(testcase+1): if i == 0: continue strlist = input() strlen = len(strlist) j = 0 decodestr = "Case {}: ".format(i) while j < strlen: ch = strlist[j] if ch == '\n': break else: cnt = 0 k = j + 1 while(k < strlen and strlist[k].isdigit()): cnt *= 10 cnt += int(strlist[k]) k += 1 decodestr += ch * cnt j = k print(decodestr)
# -*- coding: utf-8 -*- #: Following the versioning system at http://semver.org/ #: See also docs/contributing.rst, section ``Versioning`` #: MAJOR: incremented for incompatible API changes MAJOR = 1 #: MINOR: incremented for adding functionality in a backwards-compatible manner MINOR = 0 #: PATCH: incremented for backward-compatible bug fixes and minor capability improvements PATCH = 0 #: Latest release version of MOE __version__ = "{0:d}.{1:d}.{2:d}".format(MAJOR, MINOR, PATCH)
def logical_calc(array,op): while len(array) > 1: inp1 = array.pop(0) inp2 = array.pop(0) if op == "AND": array.insert(0,a(inp1,inp2)) elif op == "OR": array.insert(0,o(inp1,inp2)) elif op == "XOR": array.insert(0,x(inp1,inp2)) return array[0] def a(a,b): return a == True and b == True def o(a,b): return a == True or b == True def x(a,b): if a == True and b == False: return True elif a == False and b == True: return True else: return False
def add_native_methods(clazz): def getTotalSwapSpaceSize____(a0): raise NotImplementedError() def getFreeSwapSpaceSize____(a0): raise NotImplementedError() def getProcessCpuTime____(a0): raise NotImplementedError() def getFreePhysicalMemorySize____(a0): raise NotImplementedError() def getTotalPhysicalMemorySize____(a0): raise NotImplementedError() def getSystemCpuLoad____(a0): raise NotImplementedError() def getProcessCpuLoad____(a0): raise NotImplementedError() clazz.getTotalSwapSpaceSize____ = getTotalSwapSpaceSize____ clazz.getFreeSwapSpaceSize____ = getFreeSwapSpaceSize____ clazz.getProcessCpuTime____ = getProcessCpuTime____ clazz.getFreePhysicalMemorySize____ = getFreePhysicalMemorySize____ clazz.getTotalPhysicalMemorySize____ = getTotalPhysicalMemorySize____ clazz.getSystemCpuLoad____ = getSystemCpuLoad____ clazz.getProcessCpuLoad____ = getProcessCpuLoad____
dia = input("Em que dia vocรช nasceu? ") mes = input("Em que mรชs vocรช nasceu? ") ano = input("Em que ano vocรช nasceu? ") print("Vocรช nasceu no dia \033[32m", dia, "\033[m no mรชs de \033[34m", mes, "\033[m e no ano de \033[33m", ano, "\033[m๐Ÿ˜†๏ธ๐Ÿ˜†๏ธ๐Ÿ˜†๏ธ")
#!/usr/bin/env python # -*- coding: utf-8 -*- """Custom colorise exceptions.""" class NotSupportedError(Exception): """Raised when functionality is not supported."""
""" imutils/ml/optimizer/__init__.py """
#You Source Code Very Good print("Good") for i in range(1,20+1): print("It works Great!")
# ะกั‚ะฒะพั€ะตะฝะฝั ั–ั‚ะตั€ะฐั‚ะพั€ัƒ ะทะฐ ะดะพะฟะพะผะพะณะพัŽ ั„ัƒะฝะบั†ั–ั— iter() numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9] numbers_iterator = iter(numbers) print(numbers_iterator) print(next(numbers_iterator)) print("before the loop") for number in numbers_iterator: print(number) # ะะฐะฟะธัะฐะฝะฝั ะบะปะฐััƒ ั–ั‚ะตั€ะฐั‚ะพั€ะฐ (ะผะตั‚ะพะดะธ __iter__ ั‚ะฐ __next__ ะพะฑะพะฒ'ัะทะบะพะฒั–) class FileReader: def __init__(self, file_name, lines_in_chunk=2): self.file_name = file_name self.file = open(file_name, "r") self.lines_in_chunk = lines_in_chunk def __iter__(self): return self def __next__(self): chunk = [] for _ in range(self.lines_in_chunk): line = self.file.readline() if not line: if chunk: return chunk self.file.close() raise StopIteration chunk.append(line.replace("\n", "")) return chunk file_reader_iterator = FileReader("temp.txt", 2) print(file_reader_iterator) print(next(file_reader_iterator)) print("before the loop") for lines in file_reader_iterator: print(lines) # ะ”ะžะœะะจะะ„ ะ—ะะ’ะ”ะะะะฏ # ะะฐะฟะธัะฐั‚ะธ ั–ั‚ะตั€ะฐั‚ะพั€ ัะบะธะน ะฑัƒะดะต ะฟะพะฒะตั€ั‚ะฐั‚ะธ N ั‡ะธัะตะป ะฟะพัะปั–ะดะพะฒะฝะพัั‚ั– ะคั–ะฑะพะฝะฐั‡ั‡ั– # N ะฟะตั€ะตะดะฐั”ั‚ัŒัั ัะบ ะฐั€ะณัƒะผะตะฝั‚ ะฟั–ะด ั‡ะฐั ัั‚ะฒะพั€ะตะฝะฝั ะตะบะทะตะผะฟะปัั€ัƒ ั†ัŒะพะณะพ ะบะปะฐััƒ ั–ั‚ะตั€ะฐั‚ะพั€ะฐ
#!/usr/bin/env python class FLVError(Exception): pass class F4VError(Exception): pass class AMFError(Exception): pass __all__ = ["FLVError", "F4VError", "AMFError"]
def check_cnpj(value): if value == '99999999999999': is_valid = False else: # Checks if is in pattern NNNNNNNNNNNNNN is_valid_len = len(value) == 14 is_valid_num = all(char.isnumeric() for char in value) is_valid = is_valid_len and is_valid_num return not is_valid def check_cpf(value): if value == '00000000000': is_valid = False else: # Checks if is in pattern ***NNNNNN** or NNNNNNNNNNN is_valid_len = len(value) == 11 is_valid_num = all((char == '*' or char.isnumeric()) for char in value[:3]) and all(char.isnumeric() for char in value[3:-2]) and all((char == '*' or char.isnumeric()) for char in value[-2:]) is_valid = is_valid_len and is_valid_num return not is_valid def check_identificador_de_socio(value): values = [1, 2, 3] is_valid = value in values return not is_valid def check_nome_socio(nome, identificador_socio): # If it is a juridic person, checks if it is a person name if identificador_socio == 2: return check_name(nome) return False def check_cnpj_cpf_do_socio(value): if len(value) == 11: return check_cpf(value) if len(value) == 14: return check_cnpj(value) return True def check_codigo_qualificacao(value): is_valid = value >= 1 and value <= 79 return not is_valid def check_data(date): day = int(date[:2]) month = int(date[2:4]) year = int(date[4:]) is_day_valid = day >= 1 and day <= 31 is_month_valid = month >= 1 and month <= 12 is_year_valid = year > 0 is_valid = is_day_valid and is_month_valid and is_year_valid return not is_valid def check_ano(year, date): # Checks if year of 'data_entrada_sociedade' is equal 'ano_entrada_sociedade' year_date = int(date[4:]) is_valid = year == year_date return not is_valid def check_name(value): # Checks if name has only alphabetic caracters or spaces is_valid = all(char.isalpha() or char.isspace() for char in value) return not is_valid def check_identificador_matriz_filial(value): values = [1, 2] is_valid = value in values return not is_valid def check_situacao_cadastral(value): values = [1, 2, 3, 4, 8] is_valid = value in values return not is_valid def check_motivo_situacao_cadastral(value): values = [60, 61, 62, 63, 64, 66, 67, 70, 71, 72, 73, 74, 80] is_valid = (value >= 1 and value <= 55) or (value in values) return not is_valid def check_cep(value): is_valid = len(value) == 8 return not is_valid def check_capital_social(value): is_valid = value >= 0 return not is_valid def check_porte(value): values = [0, 1, 3, 5] is_valid = value in values return not is_valid def check_true_or_false(value): values = [0, 1] is_valid = value in values return not is_valid def check_sigla_uf(value): values = [ 'AC', 'AL', 'AP', 'AM', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MT', 'MS', 'MG', 'PA', 'PB', 'PR', 'PE', 'PI', 'RJ', 'RN', 'RS', 'RO', 'RR', 'SC', 'SP', 'SE', 'TO', 'EX' ] is_valid = value in values return not is_valid
class Solution(object): def rotateMatrixCounterClockwise(self, mat): if len(mat) == 0: return # To asses the size of N*M matrix top = 0 bottom = len(mat) - 1 left = 0 right = len(mat[0]) - 1 while left < right and top < bottom: prev = mat[top][right] # Move elements of top row one step left for i in range(right-1, left-1, -1): curr = mat[top][i] mat[top][i] = prev prev = curr top += 1 # Move elements of leftmost column one step downwards for i in range(top, bottom + 1): curr = mat[i][left] mat[i][left] = prev prev = curr left += 1 # Move elements of bottommost row one stop rightwards for i in range(left, right + 1): curr = mat[bottom][i] mat[bottom][i] = prev prev = curr bottom -=1 # Move elements of rightmost column one step upwards for i in range(bottom, top-2, -1): curr = mat[i][right] mat[i][right] = prev prev = curr right -= 1 return mat def rotateMatrixClockwise(self, mat): if not len(mat): return """ top : starting row index bottom : ending row index left : starting column index right : ending column index """ top = 0 bottom = len(mat) - 1 left = 0 right = len(mat[0]) - 1 while left < right and top < bottom: prev = mat[top +1][left] # Move elements of top row one step right for i in range(left, right + 1): curr = mat[top][i] mat[top][i] = prev prev = curr top += 1 # Move elements of rightmost column one step downwards for i in range(top, bottom + 1): curr = mat[i][right] mat[i][right] = prev prev = curr right -= 1 # Move elements of bottom row one step left for i in range(right, left - 1, -1): curr = mat[bottom][i] mat[bottom][i] = prev prev = curr bottom -= 1 # Move elements of leftmost column one step upwards for i in range(bottom, top - 1, -1): curr = mat[i][left] mat[i][left] = prev prev = curr left += 1 return mat # Utility Function def printMatrix(self, mat): print("######") for row in mat: print(row) print("######") if __name__=='__main__': matrix = [ [1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16] ] s = Solution() s.printMatrix(matrix) print("ClockWise Rotation") s.printMatrix(s.rotateMatrixClockwise(matrix)) print("Counter ClockWise Rotation") s.printMatrix(s.rotateMatrixCounterClockwise(matrix))
# 1st solution class Solution: def findLadders(self, beginWord: str, endWord: str, wordList: List[str]) -> List[List[str]]: if endWord not in wordList: return [] wordSet = set(wordList) # faster checks against dictionary layer = {} layer[beginWord] = [[beginWord]] # stores current word and all possible sequences how we got to it while layer: newlayer = collections.defaultdict(list) # returns [] on missing keys, just to simplify code for word in layer: if word == endWord: return layer[word] # return all found sequences for i in range(len(word)): # change every possible letter and check if it's in dictionary for c in 'abcdefghijklmnopqrstuvwxyz': newWord = word[:i] + c + word[i+1:] if newWord in wordSet: newlayer[newWord] += [j + [newWord] for j in layer[word]] # add new word to all sequences and form new layer element wordSet -= set(newlayer.keys()) # remove from dictionary to prevent loops layer = newlayer # move down to new layer return [] # 2nd solution # O(n*26^l) time | O(n + k * p) space # where n is the length of wordList, l is the longest length of words # k is number of paths, p is path length. class Solution: def findLadders(self, beginWord: str, endWord: str, wordList: List[str]) -> List[List[str]]: if endWord not in wordList: return [] wordSet = set(wordList) layer = {} layer[beginWord] = [[beginWord]] alpha = string.ascii_lowercase while layer: newlayer = collections.defaultdict(list) for word in layer: if word == endWord: return layer[word] for i in range(len(word)): for c in alpha: newWord = word[:i] + c + word[i+1:] if newWord in wordSet: newlayer[newWord] += [lst + [newWord] for lst in layer[word]] wordSet -= set(newlayer.keys()) layer = newlayer return []
#!/usr/bin/env python3 # https://abc099.contest.atcoder.jp/tasks/abc099_b a, b = map(int, input().split()) d = b - a k = d * (d - 1) // 2 print(k - a)
class StringUtilities(str): def longest_word(self): word_list = self.split() longest_word_length = 0 for word in word_list: word = StringUtilities.remove_symbols(word) if len(word) > longest_word_length: longest_word_length = len(word) return longest_word_length @staticmethod def remove_symbols(input_str): for char in input_str: if (ord(char) >= 32 and ord(char) <= 64 and not char.isdigit()) or (ord(char) >= 91 and ord(char) <= 96): input_str = input_str.replace(char, "") return input_str
""" Importing modules When we run a statement such as import fractions what is python doing The first thing to note is that Python """
# -*- coding: utf-8 -*- # @File : 13_order_arr_let_odd_before_even.py # @Author: cyker # @Date : 4/3/20 3:55 PM # @Desc : ่พ“ๅ…ฅไธ€ไธชๆ•ดๆ•ฐๆ•ฐ็ป„๏ผŒๅฎž็Žฐไธ€ไธชๅ‡ฝๆ•ฐๆฅ่ฐƒๆ•ด่ฏฅๆ•ฐ็ป„ไธญๆ•ฐๅญ—็š„้กบๅบ # ไฝฟๅพ—ๆ‰€ๆœ‰็š„ๅฅ‡ๆ•ฐไฝไบŽๆ•ฐ็ป„็š„ๅ‰ๅŠ้ƒจๅˆ†๏ผŒๆ‰€ๆœ‰็š„ๅถๆ•ฐไฝไบŽๆ•ฐ็ป„็š„ๅŽๅŠ้ƒจๅˆ†๏ผŒๅนถไฟ่ฏๅฅ‡ๆ•ฐๅ’Œๅฅ‡ๆ•ฐ๏ผŒๅถๆ•ฐๅ’Œๅถๆ•ฐไน‹้—ด็š„็›ธๅฏนไฝ็ฝฎไธๅ˜ใ€‚ class Solution: """ ๆ€่ทฏไธ€๏ผš ๆฏๆฌกๅพช็ŽฏๆŠŠๅฅ‡ๆ•ฐๆ’ๅˆฐๅ‰้ข๏ผŒ็ฌฌไธ€ๆฌกๆ”พๅˆฐ็ฌฌไธ€ไฝ๏ผŒ็ฌฌไบŒๆฌกๆ”พๅˆฐ็ฌฌไบŒไฝ...็›ดๅˆฐๆฒกๆœ‰ๅฅ‡ๆ•ฐ๏ผŒๆ’ๅฎŒๅŽ่ฆๅˆ ้™คๅŽŸๆฅๅœฐๆ–น็š„ๅฅ‡ๆ•ฐ ๆ—ถ้—ดๅคๆ‚ๅบฆ๏ผšO(NlogN) ็ฉบ้—ดๅคๆ‚ๅบฆ๏ผšO(1) """ def reOrderArray(self, array): if not array: return [] # ๅฎšไน‰ๆŒ‡้’ˆi๏ผŒๅฎšไน‰ๆŒ‡้’ˆj=i+1 for i in range(len(array) - 1): # ้‡ๅˆฐๅฅ‡ๆ•ฐ๏ผŒ็›ดๆŽฅ่ฟ›่กŒไธ‹ไธ€ๆฌกๅพช็Žฏ if array[i] % 2 != 0: continue # ้‡ๅˆฐๅถๆ•ฐ๏ผŒ้œ€่ฆๆŠŠ็ฆปๅฎƒๆœ€่ฟ‘็š„ๅฅ‡ๆ•ฐๆ’ๅˆฐ่ฏฅๅถๆ•ฐๅ‰้ข # ๅฎšไน‰ไธ€ไธชๆ ‡ๅฟ—ไฝ๏ผŒ่ฎฐๅฝ•ๆ˜ฏๅฆๅ‘็”Ÿๆ’้˜Ÿ insert = False for j in range(i + 1, len(array)): # ๅ‘็Žฐๆœ€่ฟ‘็š„ๅฅ‡ๆ•ฐ๏ผŒๆ’้˜Ÿ๏ผŒ้€€ๅ‡บ j ๅพช็Žฏ๏ผŒ่ฟ›ๅ…ฅiๅพช็Žฏ if array[j] % 2 != 0: array.insert(i, array[j]) # ๆŠŠ่ฏฅๅฅ‡ๆ•ฐๆ’ๅˆฐๅถๆ•ฐๅ‰ del array[j + 1] # ๅˆ ้™ค่ฏฅไฝ็ฝฎ็š„ๅฅ‡ๆ•ฐ๏ผŒๅ› ไธบinsertๆ“ไฝœ๏ผŒj ้œ€่ฆๅ‘ๅŽ็งปๅŠจ 1 ๆ ผ insert = True # ๅ‘็”Ÿไบ†ๆ’้˜Ÿ๏ผŒi ๅพช็Žฏ้œ€่ฆ็ปง็ปญๅ‘ๅณๆ‰พ break # ๆฒกๆœ‰ๅ‘็”Ÿๆ’้˜Ÿ๏ผŒ่ฏดๆ˜Žๅณ่พนๅทฒ็ปๆฒกๆœ‰ๅฅ‡ๆ•ฐไบ†๏ผŒ้€€ๅ‡บ i ๅพช็Žฏ๏ผŒๆ•ฐ็ป„้‡ๆŽ’ๅบๅฎŒๆˆใ€‚ if not insert: break return array class Solution2: """ ๆ€่ทฏไบŒ๏ผš ๅ€ŸๅŠฉ่พ…ๅŠฉ็ฉบ้—ด ๆ—ถ้—ดๅคๆ‚ๅบฆ๏ผšO(N) ็ฉบ้—ดๅคๆ‚ๅบฆ๏ผšO(N) """ def reOrderArray(self, array): odd, even = [], [] for i in array: odd.append(i) if i % 2 == 1 else even.append(i) return odd + even print(Solution().reOrderArray([1, 2, 3, 4, 5, 6, 7, 8, 9]))
# Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def convertBST(self, root): """ :type root: TreeNode :rtype: TreeNode """ self.pre = None def helper(root): if root is None: return helper(root.right) if self.pre is not None: root.val += self.pre.val self.pre = root helper(root.left) helper(root) return root def inTraverse(self, root): if root is None: return self.inTraverse(root.left) print(root.val) self.inTraverse(root.right) solution = Solution() node1 = TreeNode(2) node2 = TreeNode(1) node3 = TreeNode(3) node1.left = node2 node1.right = node3 solution.convertBST(node1) solution.inTraverse(node1) # dynamic sum
""" Batching support. """ def batched(resources, batch_size, **kwargs): """ Chunk resources into batches with a common type. """ previous = 0 for index, resource in enumerate(resources): different_type = resource.type != resources[previous].type too_many = index - previous >= batch_size if different_type or too_many: yield resources[previous:index] previous = index yield resources[previous:]
def result(G_ab,kmeans,kmeans_cluster_centers_mag,of_idx,of_min_x,of_min_y,n_clusters,knn,dataset): dist = np.ones(n_clusters)*100 valid = np.ones(n_clusters) for i in range(0,n_clusters): # get pixel coordinates of VP point plane cantidate y_idx,x_idx = np.unravel_index(np.argmax(G_ab[:,:,i], axis=None), G_ab[:,:,i].shape) if (y_idx or x_idx): # if vanishing point is not out of image x = int((x_idx+1.5)*side) y = int((y_idx+1.5)*side) dist[i] = math.hypot((int(of_min_y)-y), (int(of_min_x)-x)) else: valid[i] = 100 # select nearest VP to OF cluster center nearest_VP = np.argmin(np.array(np.multiply(dist,valid))) # get pixel coordinates nearest VP to OF cluster center y_idx,x_idx = np.unravel_index(np.argmax(G_ab[:,:,nearest_VP], axis=None), G_ab[:,:,nearest_VP].shape) x = int((x_idx+1.5)*side) y = int((y_idx+1.5)*side) for i in range(0,n_clusters): # get distance of nearest VP to all cluster centers dist[i] = math.hypot((int(kmeans.cluster_centers_[i,1])-y), (int(kmeans.cluster_centers_[i,0])-x)) # get magnitude for VP nearest_VP_mag_idx = knn.kneighbors(np.array(((x+of_min_x)/2, (y+of_min_y)/2)).reshape(-1,2), return_distance=False) nearest_VP_mag = np.mean(dataset[nearest_VP_mag_idx.reshape(-1),3]) if abs(kmeans_cluster_centers_mag[of_idx]-nearest_VP_mag) < 0.05*kmeans_cluster_centers_mag[of_idx]: print("VP valid") else: print("VP not valid")
''' * @Author: csy * @Date: 2019-04-28 13:47:18 * @Last Modified by: csy * @Last Modified time: 2019-04-28 13:47:18 ''' # with open('./pi_digits.txt') as file_object: # contents=file_object.read() # print(contents) # print(contents.rstrip()) #ๅˆ ้™คๆœซๅฐพ็ฉบ็™ฝ # # filename='pi_digits.txt' # with open(filename) as file_object: # for line in file_object: # print(line) # filename = 'pi_digits.txt' with open(filename) as file_object: lines = file_object.readlines() print(lines) for line in lines: print(line)
#!/usr/bin/env python # coding=utf-8 def ClassSchedule(DB, pam): json_data = { "code": 0, "msg": "" } if pam == "": json_data["code"] = "0" json_data["msg"] = "false" return json_data classid = pam["Pam"] # &Schedule.WID, &Schedule.Chapter, &Schedule.CourseName, &Schedule.WSDate, &Schedule.WEDate, &Schedule.CourseID, &Schedule.LessonID, &Schedule.UID, &Schedule.PID, &susername, &Schedule.ID, &Schedule.SSDate, &Schedule.SEDate sql_str = "select * from (SELECT T3.*,T4.ID as tid,T4.`start` as tstart,t4.`end` as tend from(select t1.*,t2.UserName from (select id,chapter,courses,`start`,`end`,courseId,MlessonID,UID,PID FROM `events` WHERE scheduleId = (select scheduleId from tb_class where CID = " + str(classid) + ") and istask = 0 and mlessonId != 0 ORDER BY `end`) as t1 LEFT join tb_userdata as t2 on t1.UID = T2.UID) as T3 inner join `events` AS T4 ON t3.CourseID = t4.CourseID and t3.MLessonID = t4.MLessonID and t3.UID = t4.UID and t3.id = t4.parent_id AND T3.PID = t4.PID AND T4.istask = 1 and T4.mlessonId != 0 and T4.scheduleId = (select scheduleId from tb_class where CID = " + str(classid) + ")) t5 order by `end`" data = DB.fetchall(sql_str,None) _cback = "" if data: list_data = list(data) for minfo in list_data: if _cback != "": _cback = _cback + "*" + str(minfo[0]) + "," + str(minfo[1]) + "," + str(minfo[2]) + "," + str(minfo[3]) + "," + str(minfo[4]) + "," + str(minfo[5]) + "," + str(minfo[6]) + "," + str(minfo[7]) + "," + str(minfo[8]) + "," + str(minfo[9]) + "," + str(minfo[10]) + "," + str(minfo[11]) + "," + str(minfo[12]) else: _cback = str(minfo[0]) + "," + str(minfo[1]) + "," + str(minfo[2]) + "," + str(minfo[3]) + "," + str(minfo[4]) + "," + str(minfo[5]) + "," + str(minfo[6]) + "," + str(minfo[7]) + "," + str(minfo[8]) + "," + str(minfo[9]) + "," + str(minfo[10]) + "," + str(minfo[11]) + "," + str(minfo[12]) _cback = GetClassTeacher(DB,str(classid)) + "`" + _cback + "`" + pam["type"] + "`" + pam["Pam"] json_data["code"] = "1" json_data["msg"] = _cback return json_data def GetClassTeacher(DB, classid): sql_str = "select UID,UserName from tb_userdata where UID = (SELECT TID from tb_class where CID = " + str(classid) + ")" data = DB.fetchall(sql_str,None) _cback = "" if data != None and len(data) > 0: _cback = str(data[0][0]) + "," + str(data[0][1]) return _cback def StudentWork(DB, uid, pam): json_data = { "code": 0, "msg": "" } if pam == "": json_data["code"] = "0" json_data["msg"] = "" return json_data classid = pam["Pam"] sql_str = "select TID,WDATE,PID,SCORE from tb_tasbase_" + str(classid) + " where uid = " + str(uid) # &Schedule.TID, &Schedule.WDATE, &Schedule.PID, &Schedule.SCORE data = DB.fetchall(sql_str,None) _cback = "" if data: list_data = list(data) for minfo in list_data: if _cback != "": _cback = _cback + "*" + str(minfo[0]) + "," + str(minfo[1]) + "," + str(minfo[2]) + "," + str(minfo[3]) else: _cback = str(minfo[0]) + "," + str(minfo[1]) + "," + str(minfo[2]) + "," + str(minfo[3]) _cback = GetClassTeacher(DB,str(classid)) + "`" + _cback + "`" + pam["type"] json_data["code"] = "1" json_data["msg"] = _cback return json_data def ClassStudentData(DB, uid, pam): json_data = { "code": 0, "msg": "" } if pam == "": json_data["code"] = "0" json_data["msg"] = "" return json_data classid = pam["Pam"].split(',')[0] TID = pam["Pam"].split(',')[1] # &Schedule.UID, &Schedule.WDATE, &Schedule.PID, &Schedule.SCORE, &Schedule.UserName sql_str = "select t1.UID,t1.WDATE,t1.PID,t1.SCORE,t2.UserName from tb_tasbase_" + str(classid) + " as t1 inner join tb_userdata as t2 on t1.UID = t2.UID AND t1.TID = '" + str(TID) + "'" data = DB.fetchall(sql_str,None) _cback = "" if data: list_data = list(data) for minfo in list_data: if _cback != "": _cback = _cback + "*" + str(minfo[0]) + "," + str(minfo[1]) + "," + str(minfo[2]) + "," + str(minfo[3]) + "," + str(minfo[4]) else: _cback = str(minfo[0]) + "," + str(minfo[1]) + "," + str(minfo[2]) + "," + str(minfo[3]) + "," + str(minfo[4]) json_data["code"] = "1" json_data["msg"] = _cback return json_data def ClassStudentList(DB, uid, pam): json_data = { "code": 0, "msg": "" } if pam == "": json_data["code"] = "0" json_data["msg"] = "" return json_data classid = pam["Pam"] # &Schedule.UID, &Schedule.UserName sql_str = "select UID,UserName from tb_userdata where find_in_set('" + str(classid) + "',CLASSID)" data = DB.fetchall(sql_str,None) _cback = "" if data: list_data = list(data) for minfo in list_data: if _cback != "": _cback = _cback + "*" + str(minfo[0]) + "," + str(minfo[1]) else: _cback = str(minfo[0]) + "," + str(minfo[1]) json_data["code"] = "1" json_data["msg"] = _cback return json_data
def decor(func): def wrap(): print("============") func() print("============") return wrap def print_text(): print("Hello world!") decorated = decor(print_text) decorated()
for i in range(100, 1000): base9 = '' base10 = i # Convert to base 9 for j in range(0,3): r = base10 % 9 base10 = (base10 - r) / 9 base9 = str(int(r)) + base9 # compare base 10 to reversed base9 if str(i) == str(base9)[::-1]: print('Found: ' + str(i) + '^10 == ' + str(base9) + '^9') break
# # PySNMP MIB module EQLCONTROLLER-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/EQLCONTROLLER-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:05:16 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection") eqlGroupId, = mibBuilder.importSymbols("EQLGROUP-MIB", "eqlGroupId") eqlMemberIndex, = mibBuilder.importSymbols("EQLMEMBER-MIB", "eqlMemberIndex") equalLogic, = mibBuilder.importSymbols("EQUALLOGIC-SMI", "equalLogic") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") IpAddress, enterprises, Gauge32, iso, Unsigned32, TimeTicks, Bits, NotificationType, Integer32, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Counter64, Counter32, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "enterprises", "Gauge32", "iso", "Unsigned32", "TimeTicks", "Bits", "NotificationType", "Integer32", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Counter64", "Counter32", "ModuleIdentity") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") eqlcontrollerModule = ModuleIdentity((1, 3, 6, 1, 4, 1, 12740, 4)) eqlcontrollerModule.setRevisions(('2002-09-06 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: eqlcontrollerModule.setRevisionsDescriptions(('Initial revision',)) if mibBuilder.loadTexts: eqlcontrollerModule.setLastUpdated('201403121459Z') if mibBuilder.loadTexts: eqlcontrollerModule.setOrganization('EqualLogic Inc.') if mibBuilder.loadTexts: eqlcontrollerModule.setContactInfo('Contact: Customer Support Postal: Dell Inc 300 Innovative Way, Suite 301, Nashua, NH 03062 Tel: +1 603-579-9762 E-mail: [email protected] WEB: www.equallogic.com') if mibBuilder.loadTexts: eqlcontrollerModule.setDescription(' Copyright (c) 2004-2009 by Dell, Inc. All rights reserved. This software may not be copied, disclosed, transferred, or used except in accordance with a license granted by Dell, Inc. This software embodies proprietary information and trade secrets of Dell, Inc. ') eqlcontrollerObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 1)) eqlcontrollerNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 2)) eqlcontrollerConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 3)) eqlbackplaneObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 4)) eqlbackplaneNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 5)) eqlbackplaneConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 6)) eqlemmObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 7)) eqlemmNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 8)) eqlemmConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 9)) eqldaughtercardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 10)) eqldaughtercardNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 11)) eqldaughtercardConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 12)) eqlchannelcardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 13)) eqlsfpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 12740, 4, 14)) eqlControllerTable = MibTable((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1), ) if mibBuilder.loadTexts: eqlControllerTable.setStatus('current') if mibBuilder.loadTexts: eqlControllerTable.setDescription('EqualLogic-Dynamic Member Controller Table. This table contains controller status information. One table entry per controller. It is indexed by controller slot number. The number of entries is equal to the number of controllers that are present in the system') eqlControllerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1), ).setIndexNames((0, "EQLGROUP-MIB", "eqlGroupId"), (0, "EQLMEMBER-MIB", "eqlMemberIndex"), (0, "EQLCONTROLLER-MIB", "eqlControllerIndex")) if mibBuilder.loadTexts: eqlControllerEntry.setStatus('current') if mibBuilder.loadTexts: eqlControllerEntry.setDescription('An entry (row) containing controller status information.') eqlControllerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2)).clone(1)) if mibBuilder.loadTexts: eqlControllerIndex.setStatus('current') if mibBuilder.loadTexts: eqlControllerIndex.setDescription('The index value that uniquely identifies the controller. It is equal to the controller slot number. The minimum slot number is 1') eqlControllerModel = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('unknown model')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerModel.setStatus('current') if mibBuilder.loadTexts: eqlControllerModel.setDescription('This variable specifies controller model. Is value of Part=') eqlControllerCMRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 9)).clone('unknown rev')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerCMRevision.setStatus('current') if mibBuilder.loadTexts: eqlControllerCMRevision.setDescription('CM version number; Is value of Rev=') eqlControllerSwRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 96)).clone('unknown sw rev')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerSwRevision.setStatus('current') if mibBuilder.loadTexts: eqlControllerSwRevision.setDescription('This variable specifies the customer visible controller software revision.') eqlControllerBatteryStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("ok", 1), ("failed", 2), ("good-battery-is-charging", 3), ("low-voltage-status", 4), ("low-voltage-is-charging", 5), ("missing-battery", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerBatteryStatus.setStatus('current') if mibBuilder.loadTexts: eqlControllerBatteryStatus.setDescription('This variable specifies controller battery status.') eqlControllerUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 6), Counter32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerUpTime.setStatus('current') if mibBuilder.loadTexts: eqlControllerUpTime.setDescription('This variable specifies time interval since the controller was last booted in seconds. ') eqlControllerProcessorTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerProcessorTemp.setStatus('current') if mibBuilder.loadTexts: eqlControllerProcessorTemp.setDescription('This variable specifies the temperature in Celsius.') eqlControllerChipsetTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerChipsetTemp.setStatus('current') if mibBuilder.loadTexts: eqlControllerChipsetTemp.setDescription('This variable specifies the temperature in Celsius.') eqlControllerPrimaryOrSecondary = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("primary", 1), ("secondary", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerPrimaryOrSecondary.setStatus('current') if mibBuilder.loadTexts: eqlControllerPrimaryOrSecondary.setDescription('This variable specifies if the controller is a primary or secondary controller.') eqlControllerPrimaryFlashImageRev = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 40)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerPrimaryFlashImageRev.setStatus('current') if mibBuilder.loadTexts: eqlControllerPrimaryFlashImageRev.setDescription('The revision of the primary flash image.') eqlControllerSecondaryFlashImageRev = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 40)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerSecondaryFlashImageRev.setStatus('current') if mibBuilder.loadTexts: eqlControllerSecondaryFlashImageRev.setDescription('The revision of the secondary flash image.') eqlControllerSerialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerSerialNumber.setStatus('current') if mibBuilder.loadTexts: eqlControllerSerialNumber.setDescription('This variable specifies controller serial number. Is value of SN=') eqlControllerDate = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerDate.setStatus('current') if mibBuilder.loadTexts: eqlControllerDate.setDescription('This variable specifies date of mfg of the CM. Is value of Date=') eqlControllerECO = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerECO.setStatus('current') if mibBuilder.loadTexts: eqlControllerECO.setDescription('This variable specifies eco level of the CM. Is value of ECO=') eqlControllerEEprom = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 15), OctetString().subtype(subtypeSpec=ValueSizeConstraint(256, 256)).setFixedLength(256).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerEEprom.setStatus('current') if mibBuilder.loadTexts: eqlControllerEEprom.setDescription('The contents of the eeprom.') eqlControllerPLDrev = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 16), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerPLDrev.setStatus('current') if mibBuilder.loadTexts: eqlControllerPLDrev.setDescription('This variable specifies pld version number.') eqlControllerPlatformType = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 17), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerPlatformType.setStatus('current') if mibBuilder.loadTexts: eqlControllerPlatformType.setDescription('This variable specifies the platform type. If the number is negative its a simulator. If zero its an eval platform. If >= 1 is the version of the pss board -- does this mean cm rev?') eqlControllerPlatformVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 18), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerPlatformVersion.setStatus('current') if mibBuilder.loadTexts: eqlControllerPlatformVersion.setDescription('This variable specifies the version of the pss board (ie CM?)') eqlControllerCPUPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 19), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerCPUPass.setStatus('current') if mibBuilder.loadTexts: eqlControllerCPUPass.setDescription('This variable specifies silicon rev.') eqlControllerCPUrev = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 20), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerCPUrev.setStatus('current') if mibBuilder.loadTexts: eqlControllerCPUrev.setDescription('This variable specifies the revision of the cpu.') eqlControllerCPUfreq = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 21), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerCPUfreq.setStatus('current') if mibBuilder.loadTexts: eqlControllerCPUfreq.setDescription('This variable specifies the cpu freq in MHz.') eqlControllerPhysRam = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 22), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerPhysRam.setStatus('current') if mibBuilder.loadTexts: eqlControllerPhysRam.setDescription('This variable specifies the amount of physical memory in MB.') eqlControllerBootRomVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 23), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerBootRomVersion.setStatus('current') if mibBuilder.loadTexts: eqlControllerBootRomVersion.setDescription('This variable specifies the bootrom version number.') eqlControllerBootRomBuildDate = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 24), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(128, 128)).setFixedLength(128).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerBootRomBuildDate.setStatus('current') if mibBuilder.loadTexts: eqlControllerBootRomBuildDate.setDescription('This variable specifies the date and time bootrom image was built.') eqlControllerInfoMsg = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 25), DisplayString().clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerInfoMsg.setStatus('current') if mibBuilder.loadTexts: eqlControllerInfoMsg.setDescription('This variable is basic info on the cpu at bootup.') eqlControllerAthenaSataVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 26), DisplayString().clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerAthenaSataVersion.setStatus('current') if mibBuilder.loadTexts: eqlControllerAthenaSataVersion.setDescription('This variable is the Athena Sata revision for all Athena chips.') eqlControllerMajorVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 27), Unsigned32().clone(1)).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerMajorVersion.setStatus('current') if mibBuilder.loadTexts: eqlControllerMajorVersion.setDescription('This variable specifies the major version number of the software present on the controller module.') eqlControllerMinorVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 28), Unsigned32().clone(1)).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerMinorVersion.setStatus('current') if mibBuilder.loadTexts: eqlControllerMinorVersion.setDescription('This variable specifies the minor version number of the software present on the controller module.') eqlControllerMaintenanceVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 29), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerMaintenanceVersion.setStatus('current') if mibBuilder.loadTexts: eqlControllerMaintenanceVersion.setDescription('This variable specifies the maintenance version number of the software present on the controller module.') eqlControllerSWCompatibilityLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 30), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerSWCompatibilityLevel.setStatus('current') if mibBuilder.loadTexts: eqlControllerSWCompatibilityLevel.setDescription('This variable specifies the compatibility level of the software present on the controller module.') eqlControllerFullSwRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 31), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 96)).clone('unknown sw rev')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerFullSwRevision.setStatus('current') if mibBuilder.loadTexts: eqlControllerFullSwRevision.setDescription('This variable specifies controller software revision. ') eqlControllerNVRAMBattery = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("not-present", 0), ("good", 1), ("bad", 2), ("unknown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerNVRAMBattery.setStatus('current') if mibBuilder.loadTexts: eqlControllerNVRAMBattery.setDescription('This variable represents the NVRAM Battery on CM. Value would be zero if there is no NVRAM Battery( old CM). ') eqlControllerSerialNumber2 = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 33), DisplayString().clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerSerialNumber2.setStatus('current') if mibBuilder.loadTexts: eqlControllerSerialNumber2.setDescription('This variable specifies controller serial number. Is value of SN=.The eqlControllerSerialNumber is deprecated because this value can be upto 15 characters for manhattan.') eqlControllerType = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 34), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerType.setStatus('current') if mibBuilder.loadTexts: eqlControllerType.setDescription('This variable specifies the type of the controller module. Ex: Type II') eqlControllerBootTime = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 1, 1, 1, 35), Counter32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: eqlControllerBootTime.setStatus('current') if mibBuilder.loadTexts: eqlControllerBootTime.setDescription('This variable specifies time at which the controller was booted expressed as seconds since epoch.') eqlBackplaneTable = MibTable((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1), ) if mibBuilder.loadTexts: eqlBackplaneTable.setStatus('current') if mibBuilder.loadTexts: eqlBackplaneTable.setDescription('EqualLogic-Dynamic Backplane Table. This table contains backplane status information. There is only one table entry for the one backplane per PSA.') eqlBackplaneEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1, 1), ).setIndexNames((0, "EQLGROUP-MIB", "eqlGroupId"), (0, "EQLMEMBER-MIB", "eqlMemberIndex"), (0, "EQLCONTROLLER-MIB", "eqlBackplaneIndex")) if mibBuilder.loadTexts: eqlBackplaneEntry.setStatus('current') if mibBuilder.loadTexts: eqlBackplaneEntry.setDescription('An entry (row) containing backplane status information.') eqlBackplaneIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2)).clone(1)) if mibBuilder.loadTexts: eqlBackplaneIndex.setStatus('current') if mibBuilder.loadTexts: eqlBackplaneIndex.setDescription('The index value that uniquely identifies the backplane. A well chosen number for the index is 1. It is in fact the only valid index.') eqlBackplanePartNum = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlBackplanePartNum.setStatus('current') if mibBuilder.loadTexts: eqlBackplanePartNum.setDescription('This variable specifies part number of the backplane.') eqlBackplaneRev = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlBackplaneRev.setStatus('current') if mibBuilder.loadTexts: eqlBackplaneRev.setDescription('This variable specifies revision of the backplane. Is value of Rev=') eqlBackplaneDate = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlBackplaneDate.setStatus('current') if mibBuilder.loadTexts: eqlBackplaneDate.setDescription('This variable specifies date of mfg of the backplane.') eqlBackplaneSN = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlBackplaneSN.setStatus('current') if mibBuilder.loadTexts: eqlBackplaneSN.setDescription('This variable specifies serial number of the backplane.') eqlBackplaneECO = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlBackplaneECO.setStatus('current') if mibBuilder.loadTexts: eqlBackplaneECO.setDescription('This variable specifies eco level of the backplane.') eqlBackplaneEEprom = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(256, 256)).setFixedLength(256).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlBackplaneEEprom.setStatus('current') if mibBuilder.loadTexts: eqlBackplaneEEprom.setDescription('The contents of the eeprom.') eqlBackplaneSN2 = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1, 1, 8), DisplayString().clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlBackplaneSN2.setStatus('current') if mibBuilder.loadTexts: eqlBackplaneSN2.setDescription('This variable specifies the backplane serial number. Is value of SN=.The eqlBackplaneSN is deprecated because this value can be up to 15 characters for manhattan.') eqlBackplaneType = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlBackplaneType.setStatus('current') if mibBuilder.loadTexts: eqlBackplaneType.setDescription('This variable specifies the backplane type.') eqlBackplaneTypeId = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 4, 1, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlBackplaneTypeId.setStatus('current') if mibBuilder.loadTexts: eqlBackplaneTypeId.setDescription('This variable specifies the backplane type as an Id. Used for Globalization.') eqlEMMTable = MibTable((1, 3, 6, 1, 4, 1, 12740, 4, 7, 1), ) if mibBuilder.loadTexts: eqlEMMTable.setStatus('current') if mibBuilder.loadTexts: eqlEMMTable.setDescription('EqualLogic-Dynamic Member EMM Table. This table contains enclosure management status information. One table entry per emm. It is indexed by emm index. The number of entries is equal to the number of emms that are present in the system') eqlEMMEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12740, 4, 7, 1, 1), ).setIndexNames((0, "EQLGROUP-MIB", "eqlGroupId"), (0, "EQLMEMBER-MIB", "eqlMemberIndex"), (0, "EQLCONTROLLER-MIB", "eqlEMMIndex")) if mibBuilder.loadTexts: eqlEMMEntry.setStatus('current') if mibBuilder.loadTexts: eqlEMMEntry.setDescription('An entry (row) containing emm status information.') eqlEMMIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 7, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3)).clone(1)) if mibBuilder.loadTexts: eqlEMMIndex.setStatus('current') if mibBuilder.loadTexts: eqlEMMIndex.setDescription('The index value that uniquely identifies the EMM subsystem. ') eqlEMMModel = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 7, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('unknown model')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlEMMModel.setStatus('current') if mibBuilder.loadTexts: eqlEMMModel.setDescription('This variable specifies controller model. Is value of Part=') eqlEMMPartNum = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 7, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlEMMPartNum.setStatus('current') if mibBuilder.loadTexts: eqlEMMPartNum.setDescription('This variable specifies part number of the CM.') eqlEMMRev = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 7, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlEMMRev.setStatus('current') if mibBuilder.loadTexts: eqlEMMRev.setDescription('This variable specifies revision of the CM.') eqlEMMDate = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 7, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlEMMDate.setStatus('current') if mibBuilder.loadTexts: eqlEMMDate.setDescription('This variable specifies date of mfg of the CM.') eqlEMMSN = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 7, 1, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlEMMSN.setStatus('current') if mibBuilder.loadTexts: eqlEMMSN.setDescription('This variable specifies serial number of the CM.') eqlEMMECO = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 7, 1, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlEMMECO.setStatus('current') if mibBuilder.loadTexts: eqlEMMECO.setDescription('This variable specifies eco level of the CM.') eqlEMMEEprom = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 7, 1, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(256, 256)).setFixedLength(256).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlEMMEEprom.setStatus('current') if mibBuilder.loadTexts: eqlEMMEEprom.setDescription('The contents of the eeprom.') eqlEMMSN2 = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 7, 1, 1, 9), DisplayString().clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlEMMSN2.setStatus('current') if mibBuilder.loadTexts: eqlEMMSN2.setDescription('This variable specifies the serial number. Is value of SN=.The eqlEMMSN is deprecated because this value can be up to 15 characters for manhattan.') eqlDaughterCardTable = MibTable((1, 3, 6, 1, 4, 1, 12740, 4, 10, 1), ) if mibBuilder.loadTexts: eqlDaughterCardTable.setStatus('current') if mibBuilder.loadTexts: eqlDaughterCardTable.setDescription('EqualLogic-Dynamic Member DaughterCard Table. This table contains daughter card information. One table entry per daughter card. It is indexed by daughter card index. The number of entries is equal to the number of daughter cards that are present in the system') eqlDaughterCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12740, 4, 10, 1, 1), ).setIndexNames((0, "EQLGROUP-MIB", "eqlGroupId"), (0, "EQLMEMBER-MIB", "eqlMemberIndex"), (0, "EQLCONTROLLER-MIB", "eqlDaughterCardIndex")) if mibBuilder.loadTexts: eqlDaughterCardEntry.setStatus('current') if mibBuilder.loadTexts: eqlDaughterCardEntry.setDescription('An entry (row) containing daughter card information.') eqlDaughterCardIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 10, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2)).clone(1)) if mibBuilder.loadTexts: eqlDaughterCardIndex.setStatus('current') if mibBuilder.loadTexts: eqlDaughterCardIndex.setDescription('The index value that uniquely identifies the DaughterCard subsystem. 1 based') eqlDaughterCardModel = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 10, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('unknown model')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlDaughterCardModel.setStatus('current') if mibBuilder.loadTexts: eqlDaughterCardModel.setDescription('This variable specifies controller model. Is value of Part=') eqlDaughterCardPartNum = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 10, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlDaughterCardPartNum.setStatus('current') if mibBuilder.loadTexts: eqlDaughterCardPartNum.setDescription('This variable specifies part number of the daughter card.') eqlDaughterCardRev = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 10, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlDaughterCardRev.setStatus('current') if mibBuilder.loadTexts: eqlDaughterCardRev.setDescription('This variable specifies revision of the daughter card.') eqlDaughterCardDate = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 10, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlDaughterCardDate.setStatus('current') if mibBuilder.loadTexts: eqlDaughterCardDate.setDescription('This variable specifies date of mfg of the daughter card.') eqlDaughterCardSN = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 10, 1, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlDaughterCardSN.setStatus('current') if mibBuilder.loadTexts: eqlDaughterCardSN.setDescription('This variable specifies serial number of the daughter card.') eqlDaughterCardECO = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 10, 1, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlDaughterCardECO.setStatus('current') if mibBuilder.loadTexts: eqlDaughterCardECO.setDescription('This variable specifies eco level of the daughter card.') eqlDaughterCardEEprom = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 10, 1, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(256, 256)).setFixedLength(256).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlDaughterCardEEprom.setStatus('current') if mibBuilder.loadTexts: eqlDaughterCardEEprom.setDescription('The contents of the eeprom.') eqlChannelCardTable = MibTable((1, 3, 6, 1, 4, 1, 12740, 4, 13, 1), ) if mibBuilder.loadTexts: eqlChannelCardTable.setStatus('current') if mibBuilder.loadTexts: eqlChannelCardTable.setDescription('EqualLogic-Dynamic Member ChannelCard Table. This table contains channel card information. One table entry per channel card. It is indexed by channel card index. The number of entries is equal to the number of channel cards that are present in the system') eqlChannelCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12740, 4, 13, 1, 1), ).setIndexNames((0, "EQLGROUP-MIB", "eqlGroupId"), (0, "EQLMEMBER-MIB", "eqlMemberIndex"), (0, "EQLCONTROLLER-MIB", "eqlChannelCardIndex")) if mibBuilder.loadTexts: eqlChannelCardEntry.setStatus('current') if mibBuilder.loadTexts: eqlChannelCardEntry.setDescription('An entry (row) containing channel card information.') eqlChannelCardIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 13, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))) if mibBuilder.loadTexts: eqlChannelCardIndex.setStatus('current') if mibBuilder.loadTexts: eqlChannelCardIndex.setDescription('The index value that uniquely identifies the ChannelCard subsystem.') eqlChannelCardSerialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 13, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlChannelCardSerialNumber.setStatus('current') if mibBuilder.loadTexts: eqlChannelCardSerialNumber.setDescription('This variable specifies serial number of the card.') eqlChannelCardFirmwareRev = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 13, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlChannelCardFirmwareRev.setStatus('current') if mibBuilder.loadTexts: eqlChannelCardFirmwareRev.setDescription('This variable specifies firmware revision of the card.') eqlChannelCardInitRev = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 13, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlChannelCardInitRev.setStatus('current') if mibBuilder.loadTexts: eqlChannelCardInitRev.setDescription('This variable specifies revision of the initialization configuration file.') eqlChannelCardStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 13, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("unknown", 0), ("not-present", 1), ("failed", 2), ("good", 3))).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlChannelCardStatus.setStatus('current') if mibBuilder.loadTexts: eqlChannelCardStatus.setDescription('This variable specifies the status of the channel card .') eqlSFPTable = MibTable((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1), ) if mibBuilder.loadTexts: eqlSFPTable.setStatus('current') if mibBuilder.loadTexts: eqlSFPTable.setDescription('EqualLogic-Dynamic Member SFP Table. This table contains SFP information. One table entry per SFP. It is indexed by SFP index. The number of entries is equal to the number of SFPs that are present in the system') eqlSFPEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1), ).setIndexNames((0, "EQLGROUP-MIB", "eqlGroupId"), (0, "EQLMEMBER-MIB", "eqlMemberIndex"), (0, "EQLCONTROLLER-MIB", "eqlSFPIndex")) if mibBuilder.loadTexts: eqlSFPEntry.setStatus('current') if mibBuilder.loadTexts: eqlSFPEntry.setDescription('An entry (row) containing SFP information.') eqlSFPIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))) if mibBuilder.loadTexts: eqlSFPIndex.setStatus('current') if mibBuilder.loadTexts: eqlSFPIndex.setDescription('The index value that uniquely identifies the SFP.') eqlSFPMode = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown", 0), ("single-mode", 1), ("multi-mode", 2), ("copper", 3), ("not-present", 4))).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPMode.setStatus('current') if mibBuilder.loadTexts: eqlSFPMode.setDescription('This variable specifies the mode of the SFP.') eqlSFPIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPIfIndex.setStatus('current') if mibBuilder.loadTexts: eqlSFPIfIndex.setDescription('Index of the interface attached to the SFP.') eqlSFPIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 3))).clone(namedValues=NamedValues(("unknown", 0), ("sfp-transceiver", 3))).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPIdentifier.setStatus('current') if mibBuilder.loadTexts: eqlSFPIdentifier.setDescription('Identifies the SFP.') eqlSFPConnector = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 7, 33))).clone(namedValues=NamedValues(("unknown", 0), ("lc", 7), ("copper", 33))).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPConnector.setStatus('current') if mibBuilder.loadTexts: eqlSFPConnector.setDescription('type of the SFP connector.') eqlSFPBitrate = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPBitrate.setStatus('current') if mibBuilder.loadTexts: eqlSFPBitrate.setDescription('Bit rate of the SFP in units of 100 Mbits/sec. 103 => 10300 => 10 Gbps') eqlSFPLength1 = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPLength1.setStatus('current') if mibBuilder.loadTexts: eqlSFPLength1.setDescription('If Mode is single mode, length in kilometres, Mode is multi mode, length in units of 10metres of 50/125 um fiber.') eqlSFPLength2 = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPLength2.setStatus('current') if mibBuilder.loadTexts: eqlSFPLength2.setDescription('If Mode is single mode, length in units of 100metres, Mode is multi mode, length in units of 10metres of 62/125 um fiber.') eqlSFPVendorName = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPVendorName.setStatus('current') if mibBuilder.loadTexts: eqlSFPVendorName.setDescription('This variable specifies vendor name of the SFP.') eqlSFPPartNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPPartNumber.setStatus('current') if mibBuilder.loadTexts: eqlSFPPartNumber.setDescription('This variable specifies part number of the SFP.') eqlSFPFirmwareRev = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPFirmwareRev.setStatus('current') if mibBuilder.loadTexts: eqlSFPFirmwareRev.setDescription('This variable specifies firmware revision of the SFP.') eqlSFPSerialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPSerialNumber.setStatus('current') if mibBuilder.loadTexts: eqlSFPSerialNumber.setDescription('This variable specifies serial number of the SFP.') eqlSFPDateCode = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16)).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPDateCode.setStatus('current') if mibBuilder.loadTexts: eqlSFPDateCode.setDescription('This variable specifies date of manufacture of the SFP.') eqlSFPStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 12740, 4, 14, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("unknown", 0), ("not-present", 1), ("failed", 2), ("good", 3))).clone('unknown')).setMaxAccess("readonly") if mibBuilder.loadTexts: eqlSFPStatus.setStatus('current') if mibBuilder.loadTexts: eqlSFPStatus.setDescription('This variable specifies the status of the SFP.') mibBuilder.exportSymbols("EQLCONTROLLER-MIB", eqlControllerPhysRam=eqlControllerPhysRam, eqlControllerCPUrev=eqlControllerCPUrev, eqlEMMEntry=eqlEMMEntry, eqlemmConformance=eqlemmConformance, eqlSFPDateCode=eqlSFPDateCode, eqlDaughterCardRev=eqlDaughterCardRev, eqlEMMEEprom=eqlEMMEEprom, eqlSFPConnector=eqlSFPConnector, eqlSFPStatus=eqlSFPStatus, eqlBackplaneECO=eqlBackplaneECO, eqlControllerDate=eqlControllerDate, eqlDaughterCardPartNum=eqlDaughterCardPartNum, eqlControllerPrimaryFlashImageRev=eqlControllerPrimaryFlashImageRev, eqlControllerBootRomBuildDate=eqlControllerBootRomBuildDate, eqlBackplanePartNum=eqlBackplanePartNum, eqlSFPIfIndex=eqlSFPIfIndex, eqlchannelcardObjects=eqlchannelcardObjects, eqlDaughterCardECO=eqlDaughterCardECO, eqlBackplaneRev=eqlBackplaneRev, eqlControllerUpTime=eqlControllerUpTime, eqlemmObjects=eqlemmObjects, eqlChannelCardEntry=eqlChannelCardEntry, eqlControllerPrimaryOrSecondary=eqlControllerPrimaryOrSecondary, eqlEMMSN=eqlEMMSN, eqlControllerChipsetTemp=eqlControllerChipsetTemp, eqlDaughterCardEntry=eqlDaughterCardEntry, eqlControllerSerialNumber2=eqlControllerSerialNumber2, eqlBackplaneTypeId=eqlBackplaneTypeId, eqlDaughterCardSN=eqlDaughterCardSN, eqlcontrollerModule=eqlcontrollerModule, eqlBackplaneSN=eqlBackplaneSN, eqlControllerMajorVersion=eqlControllerMajorVersion, eqlControllerCPUPass=eqlControllerCPUPass, PYSNMP_MODULE_ID=eqlcontrollerModule, eqlControllerMaintenanceVersion=eqlControllerMaintenanceVersion, eqlControllerPLDrev=eqlControllerPLDrev, eqlcontrollerObjects=eqlcontrollerObjects, eqlDaughterCardIndex=eqlDaughterCardIndex, eqlControllerCPUfreq=eqlControllerCPUfreq, eqlControllerBootTime=eqlControllerBootTime, eqlSFPEntry=eqlSFPEntry, eqlDaughterCardModel=eqlDaughterCardModel, eqlSFPIndex=eqlSFPIndex, eqlSFPLength2=eqlSFPLength2, eqlSFPFirmwareRev=eqlSFPFirmwareRev, eqlControllerSWCompatibilityLevel=eqlControllerSWCompatibilityLevel, eqlControllerMinorVersion=eqlControllerMinorVersion, eqlControllerEntry=eqlControllerEntry, eqlBackplaneIndex=eqlBackplaneIndex, eqlSFPBitrate=eqlSFPBitrate, eqlSFPSerialNumber=eqlSFPSerialNumber, eqlChannelCardIndex=eqlChannelCardIndex, eqlEMMSN2=eqlEMMSN2, eqlChannelCardSerialNumber=eqlChannelCardSerialNumber, eqlSFPIdentifier=eqlSFPIdentifier, eqlbackplaneNotifications=eqlbackplaneNotifications, eqlEMMModel=eqlEMMModel, eqlDaughterCardEEprom=eqlDaughterCardEEprom, eqlEMMRev=eqlEMMRev, eqlControllerType=eqlControllerType, eqlBackplaneSN2=eqlBackplaneSN2, eqlControllerIndex=eqlControllerIndex, eqlEMMPartNum=eqlEMMPartNum, eqlEMMTable=eqlEMMTable, eqlDaughterCardTable=eqlDaughterCardTable, eqlChannelCardTable=eqlChannelCardTable, eqlControllerEEprom=eqlControllerEEprom, eqlsfpObjects=eqlsfpObjects, eqlControllerInfoMsg=eqlControllerInfoMsg, eqlEMMIndex=eqlEMMIndex, eqlControllerPlatformType=eqlControllerPlatformType, eqlControllerFullSwRevision=eqlControllerFullSwRevision, eqlControllerNVRAMBattery=eqlControllerNVRAMBattery, eqlControllerBootRomVersion=eqlControllerBootRomVersion, eqlSFPTable=eqlSFPTable, eqlChannelCardStatus=eqlChannelCardStatus, eqlemmNotifications=eqlemmNotifications, eqlControllerAthenaSataVersion=eqlControllerAthenaSataVersion, eqlControllerBatteryStatus=eqlControllerBatteryStatus, eqldaughtercardNotifications=eqldaughtercardNotifications, eqlSFPLength1=eqlSFPLength1, eqlbackplaneConformance=eqlbackplaneConformance, eqldaughtercardConformance=eqldaughtercardConformance, eqlControllerSecondaryFlashImageRev=eqlControllerSecondaryFlashImageRev, eqlcontrollerConformance=eqlcontrollerConformance, eqlControllerModel=eqlControllerModel, eqlSFPMode=eqlSFPMode, eqlSFPPartNumber=eqlSFPPartNumber, eqlChannelCardFirmwareRev=eqlChannelCardFirmwareRev, eqlControllerCMRevision=eqlControllerCMRevision, eqlControllerSerialNumber=eqlControllerSerialNumber, eqlControllerECO=eqlControllerECO, eqlChannelCardInitRev=eqlChannelCardInitRev, eqlBackplaneEntry=eqlBackplaneEntry, eqlControllerSwRevision=eqlControllerSwRevision, eqlEMMECO=eqlEMMECO, eqlEMMDate=eqlEMMDate, eqlDaughterCardDate=eqlDaughterCardDate, eqlBackplaneDate=eqlBackplaneDate, eqlSFPVendorName=eqlSFPVendorName, eqlControllerProcessorTemp=eqlControllerProcessorTemp, eqlbackplaneObjects=eqlbackplaneObjects, eqldaughtercardObjects=eqldaughtercardObjects, eqlControllerPlatformVersion=eqlControllerPlatformVersion, eqlControllerTable=eqlControllerTable, eqlcontrollerNotifications=eqlcontrollerNotifications, eqlBackplaneType=eqlBackplaneType, eqlBackplaneTable=eqlBackplaneTable, eqlBackplaneEEprom=eqlBackplaneEEprom)
#!/bin/python num = int(input()) possibilities = 0 while num >= 0: if num % 4 == 0: possibilities += 1 num -= 5 print(possibilities)
class Mouse(object): def __init__(self, browser): self.browser = browser def left_click( self, element=None, by_id=None, by_xpath=None, by_link=None, by_partial_link=None, by_name=None, by_tag=None, by_css=None, by_class=None, ): self.left_click_by_offset( element, 0, 0, by_id=by_id, by_xpath=by_xpath, by_link=by_link, by_partial_link=by_partial_link, by_name=by_name, by_tag=by_tag, by_css=by_css, by_class=by_class, ) def left_click_by_offset( self, element=None, xoffset=0, yoffset=0, by_id=None, by_xpath=None, by_link=None, by_partial_link=None, by_name=None, by_tag=None, by_css=None, by_class=None, ): actions = self.browser.get_action_chains() element = self.browser._get_element( element=element, by_id=by_id, by_xpath=by_xpath, by_link=by_link, by_partial_link=by_partial_link, by_name=by_name, by_tag=by_tag, by_css=by_css, by_class=by_class, ) self.browser.wait_for_visible( element=element, ) if type(element) == tuple: element = self.browser.find_element( element=element, ) self.browser._safe_log( "Click at '%s' by offset(%s,%s)", element, xoffset, yoffset ) actions.move_to_element(element).move_by_offset( xoffset, yoffset ).click().perform() def hover( self, element=None, by_id=None, by_xpath=None, by_link=None, by_partial_link=None, by_name=None, by_tag=None, by_css=None, by_class=None, ): self.browser._safe_log("Hover at '%s'", element) self.hover_by_offset( element, 0, 0, by_id=by_id, by_xpath=by_xpath, by_link=by_link, by_partial_link=by_partial_link, by_name=by_name, by_tag=by_tag, by_css=by_css, by_class=by_class, ) def hover_by_offset( self, element=None, xoffset=0, yoffset=0, by_id=None, by_xpath=None, by_link=None, by_partial_link=None, by_name=None, by_tag=None, by_css=None, by_class=None, ): actions = self.browser.get_action_chains() element = self.browser._get_element( element=element, by_id=by_id, by_xpath=by_xpath, by_link=by_link, by_partial_link=by_partial_link, by_name=by_name, by_tag=by_tag, by_css=by_css, by_class=by_class, ) self.browser.wait_for_visible( element=element, ) element = self.browser.find_element( element=element, ) self.browser._safe_log( "Mouse over '%s' by offset(%s,%s)", element, xoffset, yoffset ) actions.move_to_element(element).move_by_offset(xoffset, yoffset).perform() def right_click( self, element=None, by_id=None, by_xpath=None, by_link=None, by_partial_link=None, by_name=None, by_tag=None, by_css=None, by_class=None, ): actions = self.browser.get_action_chains() element = self.browser._get_element( element=element, by_id=by_id, by_xpath=by_xpath, by_link=by_link, by_partial_link=by_partial_link, by_name=by_name, by_tag=by_tag, by_css=by_css, by_class=by_class, ) self.browser.wait_for_visible( element=element, ) if type(element) == tuple: element = self.browser.find_element( element=element, ) self.browser._safe_log( "Right click at '%s'", self.browser._to_string( element=element, ), ) actions.context_click(element).perform() def right_click_by_offset( self, element=None, xoffset=0, yoffset=0, by_id=None, by_xpath=None, by_link=None, by_partial_link=None, by_name=None, by_tag=None, by_css=None, by_class=None, ): actions = self.browser.get_action_chains() element = self.browser._get_element( element=element, by_id=by_id, by_xpath=by_xpath, by_link=by_link, by_partial_link=by_partial_link, by_name=by_name, by_tag=by_tag, by_css=by_css, by_class=by_class, ) self.browser.wait_for_visible( element=element, ) if type(element) == tuple: element = self.browser.find_element( element=element, ) self.browser._safe_log( "Right click at '%s' by offset(%s,%s)", element, xoffset, yoffset ) actions.move_to_element(element).move_by_offset( xoffset, yoffset ).context_click().perform()
# Theory: Kwargs # With *args you can create more flexible functions that accept # a varying number of positional arguments. You may now wonder # how to do the same with named arguments. Fortunately, in # Python, you can work with keyword arguments in a similar way. # Multiple keyword arguments # Let's get acquianted with the ** operator used to pass a # varying number of keyword arguments into a function. # **kwargs collects all possible extra values in a dictionary with # keywords as keys. # By convention, people use special names for this kind of # arguments: *args for positional arguments and **kwargs for # keyword arguments, but you can call them whatever you want. # The main thing is that a single asterisk * matches a value by # position and a double asterisk ** associates a value with a # name, or keyword. So, **kwargs differs from *args in that you # will need to assign keywords. # Here is an example: def capital(**kwargs): for key, value in kwargs.items(): print(value, "is the capital city of", key) capital(Canada="Ottawa", Estonia="Tallinn", Venezuela="Caracas", Finland="Helsinki") # Once the function has been invoked, these 4 lines will be # printed: # Ottawa is the capital city of Canada # Tallinn is the capital city of Estonia # Caracas is the capital city of Venezuela # Helsinki is the capital city of Finland # So, everything works just fine! And again, the number of # arguments we pass may differ in the next call. # Note that the names in a call are without quotes. That is # not a mistake. Moreover, the names should be valid, for # example, you cannot start a keyword with a number. # Follow the same naming rules as for variables. # It is also possible to combine *args and **kwargs in one # function definition: def func(positional_args, defaults, *args, **kwargs): pass # The order is crucial here, Just as non-keyword arguments # precede keyword arguments, *args must come before # **kwargs in this case. Otherwise, both when creating and # calling a function with *args and **kwargs in the wrong order, # a SyntaxError will appear: # def func(positional_args, defaults, **kwargs, *args): # SyntaxError: invalid syntax # func(positional_args, defaults, **kwargs, *args) # SyntaxError: iterable argument unpacking follows keyword argument unpacking # 2. Unpacking in function calls # There are two unpacking operators in Python: a single asterisk # * unpacks elements of an iterable object and a double asterisk # ** works with dictionaries. Let's try to get key-value pairs from # a dictioary and pass them as keyword arguments using a # double asterisk **: def say_bye(**names): for name in names: print("Au revior,", name) print("See you on", names[name]["next appointment"]) print() humans = {"Laura": {"next appointment": "Tuesday"}, "Robin": {"next appointment": "Friday"}} say_bye(**humans) # Au revior, Laura # See you on Tuesday # Au revior, Robin # See you on Friday # By default, you iterate over keys in a dictionary, so be careful # with this. You might need this type of unpacking when setting # specific parameters of a function. Saving values in a dictionary # and then unpacking them in this way might be much easier than # list them in each call manually. Also, it will save time when # you choose to fine-tune these parameters. # 3. Summary # Let's go over the main points dicussed in the topic: # - If you want to work with a varying number of keyword # arguments, make use of **kwargs. # - The variable name kwargs in conventional, you can always # choose another one. # - Notice the difference: *args provides access to a tuple of # remaining values, while **kwargs collects remaining key- # value pairs in a dictionary. # - The order of parameters in the function definition is # important, as well as the order of passed arguments. # - In function calls, now you can use both unpacking # operators: a single asterisk * for iterable objects and a # double asterisk ** for dictionaries.
#!/usr/bin/env python3 # Copyright 2009-2017 BHG http://bw.org/ x = 42 y = 73 # Compares the vallue of x and y if x < y: print('x < y: x is {} and y is {}'.format(x, y)) elif x > y: print("x is greater than y") else: print("x and y are equal") if x > y: print('x > y: x is {} and y is {}'.format(x, y)) print("Inside Condition") x = 10 print(x)
''' ์—ฐ์‚ฐ์ž(operator) - ํ• ๋‹น(assignment): = - ์‚ฐ์ˆ  ์—ฐ์‚ฐ : +,-,*,**,/,//,% - ๋ณตํ•ฉ ํ• ๋‹น : +=, -=, *=, /=, ... - ๋…ผ๋ฆฌ ์—ฐ์‚ฐ : and, or ,not - ๋น„๊ต ์—ฐ์‚ฐ : >, >=, <, <=, ==, != - identity ์—ฐ์‚ฐ : is, is not(id() ํ•จ์ˆ˜์˜ ๋ฆฌํ„ด๊ฐ’์ด ๊ฐ™์€์ง€ ๋‹ค๋ฅธ์ง€) ''' x = 1 # ์—ฐ์‚ฐ์ž ์˜ค๋ฅธ์ชฝ์˜ ๊ฐ’์„ ์—ฐ์‚ฐ์ž ์™ผ์ชฝ์˜ ๋ณ€์ˆ˜์— ์ €์žฅ(ํ• ๋‹น) # 1 = x print(2**3) #2 x 2 x 2 print(10/3) print(10//3) # ์ •์ˆ˜ ๋‚˜๋ˆ—์…ˆ ๋ชซ print(10%3) # ์ •์ˆ˜ ๋‚˜๋ˆ—์…ˆ ๋‚˜๋จธ์ง€ x =1 print('x=', x) x += 10 # x = x + 10 print('x=',x) print(1 == 2) print(1 != 2) x = 50 print(x > 0 and x < 100) print(x < 0 or x >10) # Alt+ Enter(๋งˆ๋ฒ•ํ‚ค) print(x is int)
__title__ = 'Generative FSL for Covid Prediction' __version__ = '1.0.0' __author__ = 'Suvarna Kadam' __license__ = 'MIT' __copyright__ = 'Copyright 2021'
# -*- coding: utf-8 -*- class Types: """ ะŸะตั€ะตั‡ะตะฝัŒ compile-time ั‚ะธะฟะพะฒ """ NONE = 0 INT = 1 CHAR = 2 BOOL = 3 STRING = 4 BOXED_ARR = 5 UNBOXED_ARR = 6 OBJECT = 7 DYNAMIC = 9
print('Temperature conversion program') print(' press 1 for convert from celcius to another \n press 2 for convert from faremhit to another \n press 3 for convert from kelvin to another') choice = int(input('enter your choice number : ')) if choice >3: print('invalid choice optino...please enter from 1 to 3') # celcius converter if choice==1: temp = float(input('please enter temparature in celcius : ')) # rounding to 2 decumal places farenhit = round((((9/5)*temp)+32),2) kelvin = round((temp +273.15),2) print('temparature in farenhit is ', farenhit , ' deg F') print('temparature in kelvin is ', kelvin , ' deg K') # farenhit converter elif choice==2: temp = float(input('please enter temparature in farenhit : ')) # rounding to 2 decumal places celcius = round(((5/9)*(temp-32)),2) kelvin = round(((temp +459.67)*(5/9)),2) print('temparature in farenhit is ', celcius , ' deg C') print('temparature in kelvin is ', kelvin , ' deg K') # kelvin converter elif choice==3: temp = float(input('please enter temparature in kelvin : ')) # rounding to 2 decumal places celcius = round((temp-273.15),2) farenhit = round(((temp*(9/5))-459.67),2) print('temparature in farenhit is ', celcius , ' deg C') print('temparature in kelvin is ', farenhit , ' deg F')
# coding: utf-8 """***************************************************************************** * Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your * responsibility to comply with third party license terms applicable to your * use of third party software (including open source software) that may * accompany Microchip software. * * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A * PARTICULAR PURPOSE. * * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. *****************************************************************************""" global fsCounter fsCounter = 0 def enableFileSystemIntegration(symbol, event): symbol.setEnabled(event["value"]) def handleMessage(messageID, args): global fsCounter result_dict = {} if (messageID == "DRV_SDMMC_FS_CONNECTION_COUNTER_INC"): fsCounter = fsCounter + 1 Database.setSymbolValue("drv_sdmmc", "DRV_SDMMC_COMMON_FS_ENABLE", True) if (messageID == "DRV_SDMMC_FS_CONNECTION_COUNTER_DEC"): if (fsCounter != 0): fsCounter = fsCounter - 1 if (fsCounter == 0): Database.setSymbolValue("drv_sdmmc", "DRV_SDMMC_COMMON_FS_ENABLE", False) return result_dict def aSyncFileGen(symbol, event): if(event["value"] == "Asynchronous"): symbol.setEnabled(True) else: symbol.setEnabled(False) def syncFileGen(symbol, event): if(event["value"] == "Synchronous"): symbol.setEnabled(True) else: symbol.setEnabled(False) def setCommonMode(symbol, event): rtos_mode = event["value"] if (rtos_mode != None): if (rtos_mode == "BareMetal"): symbol.setValue("Asynchronous") else: symbol.setValue("Synchronous") def instantiateComponent(sdmmcCommonComponent): res = Database.activateComponents(["HarmonyCore"]) res = Database.activateComponents(["sys_time"]) rtos_mode = Database.getSymbolValue("HarmonyCore", "SELECT_RTOS") sdmmc_default_mode = "Asynchronous" sdmmcCommonMode = sdmmcCommonComponent.createComboSymbol("DRV_SDMMC_COMMON_MODE", None, ["Asynchronous", "Synchronous"]) sdmmcCommonMode.setLabel("Driver Mode") sdmmcCommonMode.setDefaultValue(sdmmc_default_mode) sdmmcCommonMode.setReadOnly(True) sdmmcCommonFsEnable = sdmmcCommonComponent.createBooleanSymbol("DRV_SDMMC_COMMON_FS_ENABLE", None) sdmmcCommonFsEnable.setLabel("Enable Common File system for SDMMC Driver") sdmmcCommonFsEnable.setVisible(False) ############################################################################ #### Code Generation #### ############################################################################ configName = Variables.get("__CONFIGURATION_NAME") sdmmcCommonHeaderFile = sdmmcCommonComponent.createFileSymbol("DRV_SDMMC_H", None) sdmmcCommonHeaderFile.setSourcePath("driver/sdmmc/drv_sdmmc.h") sdmmcCommonHeaderFile.setOutputName("drv_sdmmc.h") sdmmcCommonHeaderFile.setDestPath("/driver/sdmmc/") sdmmcCommonHeaderFile.setProjectPath("config/" + configName + "/driver/sdmmc/") sdmmcCommonHeaderFile.setType("HEADER") sdmmcCommonLocalHeaderFile = sdmmcCommonComponent.createFileSymbol("DRV_SDMMC_LOCAL_H", None) sdmmcCommonLocalHeaderFile.setSourcePath("driver/sdmmc/templates/drv_sdmmc_local.h.ftl") sdmmcCommonLocalHeaderFile.setOutputName("drv_sdmmc_local.h") sdmmcCommonLocalHeaderFile.setDestPath("/driver/sdmmc/src/") sdmmcCommonLocalHeaderFile.setProjectPath("config/" + configName + "/driver/sdmmc/") sdmmcCommonLocalHeaderFile.setType("HEADER") sdmmcCommonLocalHeaderFile.setMarkup(True) sdmmcCommonDefHeaderFile = sdmmcCommonComponent.createFileSymbol("DRV_SDMMC_DEFINITIONS_H", None) sdmmcCommonDefHeaderFile.setSourcePath("driver/sdmmc/src/drv_sdmmc_definitions.h") sdmmcCommonDefHeaderFile.setOutputName("drv_sdmmc_definitions.h") sdmmcCommonDefHeaderFile.setDestPath("/driver/sdmmc/") sdmmcCommonDefHeaderFile.setProjectPath("config/" + configName + "/driver/sdmmc/") sdmmcCommonDefHeaderFile.setType("HEADER") sdmmcCommonFsSourceFile = sdmmcCommonComponent.createFileSymbol("DRV_SDMMC_FS_SOURCE", None) sdmmcCommonFsSourceFile.setSourcePath("driver/sdmmc/templates/drv_sdmmc_file_system.c.ftl") sdmmcCommonFsSourceFile.setOutputName("drv_sdmmc_file_system.c") sdmmcCommonFsSourceFile.setDestPath("driver/sdmmc/src") sdmmcCommonFsSourceFile.setProjectPath("config/" + configName + "/driver/sdmmc/") sdmmcCommonFsSourceFile.setType("SOURCE") sdmmcCommonFsSourceFile.setOverwrite(True) sdmmcCommonFsSourceFile.setMarkup(True) sdmmcCommonFsSourceFile.setEnabled((sdmmcCommonFsEnable.getValue() == True)) sdmmcCommonFsSourceFile.setDependencies(enableFileSystemIntegration, ["DRV_SDMMC_COMMON_FS_ENABLE"]) sdmmcCommonSystemDefFile = sdmmcCommonComponent.createFileSymbol("DRV_SDMMC_SYS_DEF_COMMON", None) sdmmcCommonSystemDefFile.setType("STRING") sdmmcCommonSystemDefFile.setOutputName("core.LIST_SYSTEM_DEFINITIONS_H_INCLUDES") sdmmcCommonSystemDefFile.setSourcePath("driver/sdmmc/templates/system/system_definitions_common.h.ftl") sdmmcCommonSystemDefFile.setMarkup(True) sdmmcCommonSymCommonSysCfgFile = sdmmcCommonComponent.createFileSymbol("DRV_SDMMC_SYS_CFG_COMMON", None) sdmmcCommonSymCommonSysCfgFile.setType("STRING") sdmmcCommonSymCommonSysCfgFile.setOutputName("core.LIST_SYSTEM_CONFIG_H_DRIVER_CONFIGURATION") sdmmcCommonSymCommonSysCfgFile.setSourcePath("driver/sdmmc/templates/system/system_config_common.h.ftl") sdmmcCommonSymCommonSysCfgFile.setMarkup(True)
def cipher(text, shift, encrypt=True): """ Encrypts/decrypts the alphabetical portion of python strings according to a given shift integer value Parameters ---------- text: str A python string that you wish to encrypt/decrypt shift: int A python integer which determines the value of the shift along the alphabetical order encrypt: bool A python boolean which determines whether to apply the positive (encrypt) or negative (decrypt) value of shift to the text Returns ------- str The encrypted/decrypted text Example ------- >>> from cipher_dk3154 import cipher >>> text = "dkow72" >>> shift = 1 >>> cipher_dk3154.cipher(text, shift, encrypt=True) 'elpx72' >>> cipher_dk3154.cipher(cipher_dk3154.cipher(text, shift, encrypt=True), shift, encrypt=False) 'dkow72' """ alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' new_text = '' for c in text: index = alphabet.find(c) if index == -1: new_text += c else: new_index = index + shift if encrypt == True else index - shift new_index %= len(alphabet) new_text += alphabet[new_index:new_index+1] return new_text