content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
## https://leetcode.com/problems/implement-strstr/ ## problem is to find where the needle occurs in the haystack. ## do this in O(n) by looping over the characters in the haystack ## and checking if the string started by that index (and as long ## as the needle) is equal to the needle. ## return -1 if we get to the end cause it's not in there. ## comes in at 99.46th percentile for runtime, but only 10th ## for memory class Solution: def strStr(self, haystack: str, needle: str) -> int: nlen = len(needle) if not nlen: return 0 if not len(haystack): return -1 for ii in range(len(haystack)-nlen+1): if haystack[ii:ii+nlen] == needle: return ii return -1
class Solution: def str_str(self, haystack: str, needle: str) -> int: nlen = len(needle) if not nlen: return 0 if not len(haystack): return -1 for ii in range(len(haystack) - nlen + 1): if haystack[ii:ii + nlen] == needle: return ii return -1
text = """ //------------------------------------------------------------------------------ // Explicit instantiation. //------------------------------------------------------------------------------ #include "Geometry/Dimension.hh" #include "FSISPH/FSISpecificThermalEnergyPolicy.cc" namespace Spheral { template class FSISpecificThermalEnergyPolicy<Dim< %(ndim)s > >; } """
text = '\n//------------------------------------------------------------------------------\n// Explicit instantiation.\n//------------------------------------------------------------------------------\n#include "Geometry/Dimension.hh"\n#include "FSISPH/FSISpecificThermalEnergyPolicy.cc"\n\nnamespace Spheral {\n template class FSISpecificThermalEnergyPolicy<Dim< %(ndim)s > >;\n}\n'
value = '16b87ecc17e3568c83d2d55d8c0d7260' # https://md5.gromweb.com/?md5=16b87ecc17e3568c83d2d55d8c0d7260 print('flippit')
value = '16b87ecc17e3568c83d2d55d8c0d7260' print('flippit')
class Storage(dict): """ A Storage object is like a dictionary except `obj.foo` can be used in addition to `obj['foo']`, and setting obj.foo = None deletes item foo. >>> o = Storage(a=1) >>> print o.a 1 >>> o['a'] 1 >>> o.a = 2 >>> print o['a'] 2 >>> del o.a >>> print o.a None """ __slots__ = () __setattr__ = dict.__setitem__ __delattr__ = dict.__delitem__ __getitem__ = dict.get __getattr__ = dict.get __repr__ = lambda self: '<Storage %s>' % dict.__repr__(self) # http://stackoverflow.com/questions/5247250/why-does-pickle-getstate-accept-as-a-return-value-the-very-instance-it-requi __getstate__ = lambda self: None __copy__ = lambda self: Storage(self) def getlist(self, key): """ Return a Storage value as a list. If the value is a list it will be returned as-is. If object is None, an empty list will be returned. Otherwise, [value] will be returned. Example output for a query string of ?x=abc&y=abc&y=def >>> request = Storage() >>> request.vars = Storage() >>> request.vars.x = 'abc' >>> request.vars.y = ['abc', 'def'] >>> request.vars.getlist('x') ['abc'] >>> request.vars.getlist('y') ['abc', 'def'] >>> request.vars.getlist('z') [] """ value = self.get(key, []) if value is None or isinstance(value, (list, tuple)): return value else: return [value] def getfirst(self, key, default=None): """ Return the first or only value when given a request.vars-style key. If the value is a list, its first item will be returned; otherwise, the value will be returned as-is. Example output for a query string of ?x=abc&y=abc&y=def >>> request = Storage() >>> request.vars = Storage() >>> request.vars.x = 'abc' >>> request.vars.y = ['abc', 'def'] >>> request.vars.getfirst('x') 'abc' >>> request.vars.getfirst('y') 'abc' >>> request.vars.getfirst('z') """ values = self.getlist(key) return values[0] if values else default def getlast(self, key, default=None): """ Returns the last or only single value when given a request.vars-style key. If the value is a list, the last item will be returned; otherwise, the value will be returned as-is. Simulated output with a query string of ?x=abc&y=abc&y=def >>> request = Storage() >>> request.vars = Storage() >>> request.vars.x = 'abc' >>> request.vars.y = ['abc', 'def'] >>> request.vars.getlast('x') 'abc' >>> request.vars.getlast('y') 'def' >>> request.vars.getlast('z') """ values = self.getlist(key) return values[-1] if values else default
class Storage(dict): """ A Storage object is like a dictionary except `obj.foo` can be used in addition to `obj['foo']`, and setting obj.foo = None deletes item foo. >>> o = Storage(a=1) >>> print o.a 1 >>> o['a'] 1 >>> o.a = 2 >>> print o['a'] 2 >>> del o.a >>> print o.a None """ __slots__ = () __setattr__ = dict.__setitem__ __delattr__ = dict.__delitem__ __getitem__ = dict.get __getattr__ = dict.get __repr__ = lambda self: '<Storage %s>' % dict.__repr__(self) __getstate__ = lambda self: None __copy__ = lambda self: storage(self) def getlist(self, key): """ Return a Storage value as a list. If the value is a list it will be returned as-is. If object is None, an empty list will be returned. Otherwise, [value] will be returned. Example output for a query string of ?x=abc&y=abc&y=def >>> request = Storage() >>> request.vars = Storage() >>> request.vars.x = 'abc' >>> request.vars.y = ['abc', 'def'] >>> request.vars.getlist('x') ['abc'] >>> request.vars.getlist('y') ['abc', 'def'] >>> request.vars.getlist('z') [] """ value = self.get(key, []) if value is None or isinstance(value, (list, tuple)): return value else: return [value] def getfirst(self, key, default=None): """ Return the first or only value when given a request.vars-style key. If the value is a list, its first item will be returned; otherwise, the value will be returned as-is. Example output for a query string of ?x=abc&y=abc&y=def >>> request = Storage() >>> request.vars = Storage() >>> request.vars.x = 'abc' >>> request.vars.y = ['abc', 'def'] >>> request.vars.getfirst('x') 'abc' >>> request.vars.getfirst('y') 'abc' >>> request.vars.getfirst('z') """ values = self.getlist(key) return values[0] if values else default def getlast(self, key, default=None): """ Returns the last or only single value when given a request.vars-style key. If the value is a list, the last item will be returned; otherwise, the value will be returned as-is. Simulated output with a query string of ?x=abc&y=abc&y=def >>> request = Storage() >>> request.vars = Storage() >>> request.vars.x = 'abc' >>> request.vars.y = ['abc', 'def'] >>> request.vars.getlast('x') 'abc' >>> request.vars.getlast('y') 'def' >>> request.vars.getlast('z') """ values = self.getlist(key) return values[-1] if values else default
def paint(x, y): global a global pic if not (0 <= x < a and 0 <= y < a): return if pic[x][y] == '+': return pic[x][y] = '+' paint(x+1, y) paint(x-1, y) paint(x, y+1) paint(x, y-1) output = [] a = int(input()) pic = [] for i in range(a): pic.append(list(input())) pos_x, pos_y = [int(x) for x in input().split()] paint(pos_x, pos_y) for lines in pic: output.append(''.join(lines)) print('\n'.join(output))
def paint(x, y): global a global pic if not (0 <= x < a and 0 <= y < a): return if pic[x][y] == '+': return pic[x][y] = '+' paint(x + 1, y) paint(x - 1, y) paint(x, y + 1) paint(x, y - 1) output = [] a = int(input()) pic = [] for i in range(a): pic.append(list(input())) (pos_x, pos_y) = [int(x) for x in input().split()] paint(pos_x, pos_y) for lines in pic: output.append(''.join(lines)) print('\n'.join(output))
""" TODO: - QualifiedName visitability.. somewhere - CreateOrReplaceTable (w/ prefixes) - batching for snowflake... - helper against sqla inserts with nonexisting columns :/ """
""" TODO: - QualifiedName visitability.. somewhere - CreateOrReplaceTable (w/ prefixes) - batching for snowflake... - helper against sqla inserts with nonexisting columns :/ """
OCTICON_MARK_GITHUB = """ <svg class="octicon octicon-mark-github" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg> """
octicon_mark_github = '\n<svg class="octicon octicon-mark-github" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>\n'
COMMANDS = [ # OP Level 0-2 "placefeature" "advancement", "attribute", "bossbar", "clear", "clone", "data", "datapack", "debug", "defaultgamemode", "difficulty", "effect", "enchant", "execute", "experience", "fill", "forceload", "function", "gamemode", "gamerule", "give", "help", "item", "kill", "list", "locate", "locatebiome", "loot", "me", "msg", "particle", "playsound", "recipe", "reload", "say", "schedule", "scoreboard", "seed", "setblock", "setworldspawn", "spawnpoint", "spectate", "spreadplayers", "stopsound", "summon", "tag", "team", "teammsg", "teleport", "tell", "tellraw", "time", "title", "tm", "tp", "trigger", "w", "weather", "whitelist", "worldborder", "xp" # OP Level 3-4 "jfr", "perf", "publish", "save-all", "save-off", "save-on", "stop", "ban", "ban-ip", "banlist", "debug", "deop", "kick", "op", "pardon", "pardon-ip", "setidletimeout", "whitelist" ] """All vanilla command (first argument only)"""
commands = ['placefeatureadvancement', 'attribute', 'bossbar', 'clear', 'clone', 'data', 'datapack', 'debug', 'defaultgamemode', 'difficulty', 'effect', 'enchant', 'execute', 'experience', 'fill', 'forceload', 'function', 'gamemode', 'gamerule', 'give', 'help', 'item', 'kill', 'list', 'locate', 'locatebiome', 'loot', 'me', 'msg', 'particle', 'playsound', 'recipe', 'reload', 'say', 'schedule', 'scoreboard', 'seed', 'setblock', 'setworldspawn', 'spawnpoint', 'spectate', 'spreadplayers', 'stopsound', 'summon', 'tag', 'team', 'teammsg', 'teleport', 'tell', 'tellraw', 'time', 'title', 'tm', 'tp', 'trigger', 'w', 'weather', 'whitelist', 'worldborder', 'xpjfr', 'perf', 'publish', 'save-all', 'save-off', 'save-on', 'stop', 'ban', 'ban-ip', 'banlist', 'debug', 'deop', 'kick', 'op', 'pardon', 'pardon-ip', 'setidletimeout', 'whitelist'] 'All vanilla command (first argument only)'
str1 = input("Enter the postfix expression:") list1 = str1.split() stack = list() print(list1) # 2 3 1 * + 9 - here the ans is -4 def isOperator(a): if a == '+' or a == '-' or a == '/' or a == '*': return 1 else: return 0 def evaluate(a, b, c): if a == '+': return b + c elif a == '-': return b - c elif a == '*': return b * c else: return b / c for i in range(len(list1)): if (isOperator(list1[i])) == 1: d = int(stack.pop()) c = int(stack.pop()) x = evaluate(list1[i], c, d) stack.append(x) else: stack.append(list1[i]) print(stack.pop())
str1 = input('Enter the postfix expression:') list1 = str1.split() stack = list() print(list1) def is_operator(a): if a == '+' or a == '-' or a == '/' or (a == '*'): return 1 else: return 0 def evaluate(a, b, c): if a == '+': return b + c elif a == '-': return b - c elif a == '*': return b * c else: return b / c for i in range(len(list1)): if is_operator(list1[i]) == 1: d = int(stack.pop()) c = int(stack.pop()) x = evaluate(list1[i], c, d) stack.append(x) else: stack.append(list1[i]) print(stack.pop())
# fruits = {} # # fruits["apple"] = "A sweet red fruit" # # fruits["mango"] = "King of all" # # print(fruits["apple"]) line = input() letter = {} for ch in line: if ch in letter: letter[ch] += 1 else: letter[ch] = 1 print(letter) print(letter.keys())
line = input() letter = {} for ch in line: if ch in letter: letter[ch] += 1 else: letter[ch] = 1 print(letter) print(letter.keys())
# from .initial_values import initial_values #----------STATE VARIABLE Genesis DICTIONARY--------------------------- genesis_states = { 'player_200' : False, 'player_250' : False, 'player_300' : False, 'player_350' : False, 'player_400' : False, 'game_200' : False, 'game_250' : False, 'game_300' : False, 'game_350' : False, 'game_400' : False, 'timestamp': '2018-10-01 15:16:24', #es5 }
genesis_states = {'player_200': False, 'player_250': False, 'player_300': False, 'player_350': False, 'player_400': False, 'game_200': False, 'game_250': False, 'game_300': False, 'game_350': False, 'game_400': False, 'timestamp': '2018-10-01 15:16:24'}
#!/usr/bin/env vpython3 def onefile(fname): data = open(fname, 'rt').read() data = data.replace('FPDF_EXPORT', 'extern') data = data.replace('FPDF_CALLCONV', '') open(fname, 'wt').write(data) onefile('pdfium/include/fpdf_annot.h') onefile('pdfium/include/fpdf_attachment.h') onefile('pdfium/include/fpdf_catalog.h') onefile('pdfium/include/fpdf_dataavail.h') onefile('pdfium/include/fpdf_doc.h') onefile('pdfium/include/fpdf_edit.h') onefile('pdfium/include/fpdf_ext.h') onefile('pdfium/include/fpdf_flatten.h') onefile('pdfium/include/fpdf_formfill.h') onefile('pdfium/include/fpdf_fwlevent.h') onefile('pdfium/include/fpdf_javascript.h') onefile('pdfium/include/fpdf_ppo.h') onefile('pdfium/include/fpdf_progressive.h') onefile('pdfium/include/fpdf_save.h') onefile('pdfium/include/fpdf_searchex.h') onefile('pdfium/include/fpdf_signature.h') onefile('pdfium/include/fpdf_structtree.h') onefile('pdfium/include/fpdf_sysfontinfo.h') onefile('pdfium/include/fpdf_text.h') onefile('pdfium/include/fpdf_thumbnail.h') onefile('pdfium/include/fpdf_transformpage.h') onefile('pdfium/include/fpdfview.h')
def onefile(fname): data = open(fname, 'rt').read() data = data.replace('FPDF_EXPORT', 'extern') data = data.replace('FPDF_CALLCONV', '') open(fname, 'wt').write(data) onefile('pdfium/include/fpdf_annot.h') onefile('pdfium/include/fpdf_attachment.h') onefile('pdfium/include/fpdf_catalog.h') onefile('pdfium/include/fpdf_dataavail.h') onefile('pdfium/include/fpdf_doc.h') onefile('pdfium/include/fpdf_edit.h') onefile('pdfium/include/fpdf_ext.h') onefile('pdfium/include/fpdf_flatten.h') onefile('pdfium/include/fpdf_formfill.h') onefile('pdfium/include/fpdf_fwlevent.h') onefile('pdfium/include/fpdf_javascript.h') onefile('pdfium/include/fpdf_ppo.h') onefile('pdfium/include/fpdf_progressive.h') onefile('pdfium/include/fpdf_save.h') onefile('pdfium/include/fpdf_searchex.h') onefile('pdfium/include/fpdf_signature.h') onefile('pdfium/include/fpdf_structtree.h') onefile('pdfium/include/fpdf_sysfontinfo.h') onefile('pdfium/include/fpdf_text.h') onefile('pdfium/include/fpdf_thumbnail.h') onefile('pdfium/include/fpdf_transformpage.h') onefile('pdfium/include/fpdfview.h')
def inequality(value): # Complete the if statement on the next line using value, the inequality operator (!=), and the number 13. if value != 13: ### Your code goes above this line ### return "Not Equal to 13" else: return "Equal to 13" print(inequality(100))
def inequality(value): if value != 13: return 'Not Equal to 13' else: return 'Equal to 13' print(inequality(100))
# -*- Mode: Python; test-case-name: test.test_pychecker_CodeChecks -*- # vi:si:et:sw=4:sts=4:ts=4 # trigger opcode 99, DUP_TOPX def duptopx(): d = {} for i in range(0, 9): d[i] = i for k in d: # the += on a dict member triggers DUP_TOPX d[k] += 1
def duptopx(): d = {} for i in range(0, 9): d[i] = i for k in d: d[k] += 1
####################################################### # # track.py # Python implementation of the Class track # Generated by Enterprise Architect # Created on: 11-Feb-2020 11:08:09 AM # Original author: Corvo # ####################################################### class track: # default constructor def __init__(self): speed = "0.00000000" # speed getter def getspeed(self): return self.speed # speed setter def setspeed(self, speed=0): self.speed=speed __course = "0.00000000" # course getter def getcourse(self): return self.course # course setter def setcourse(self, course=0): self.course=course
class Track: speed = '0.00000000' def getspeed(self): return self.speed def setspeed(self, speed=0): self.speed = speed __course = '0.00000000' def getcourse(self): return self.course def setcourse(self, course=0): self.course = course
mylist=['hello',[2,3,4],[40,50,60],['hi'],'how',"bye"] print(mylist) print(mylist[1][1]) mylist=['hello',[2,3,4]] print(mylist[1][0]) num1=[0,32,444,4453,[23,43,54,12,3]] print(num1) num2=[0,32,444,4453] num2.extend([23,43,54,12,3]) print(num2)
mylist = ['hello', [2, 3, 4], [40, 50, 60], ['hi'], 'how', 'bye'] print(mylist) print(mylist[1][1]) mylist = ['hello', [2, 3, 4]] print(mylist[1][0]) num1 = [0, 32, 444, 4453, [23, 43, 54, 12, 3]] print(num1) num2 = [0, 32, 444, 4453] num2.extend([23, 43, 54, 12, 3]) print(num2)
def test(x, y): x + y test( 11111111, test(11111111, 1111111), test(11111111, 1111111), 222, 222, test(11111111, 1111111), test(11111111, 1111111), 222, test(11111111, 1111111), test(11111111, 1111111), test(11111111, 1111111), test(11111111, 1111111), test(11111111, 1111111), )
def test(x, y): x + y test(11111111, test(11111111, 1111111), test(11111111, 1111111), 222, 222, test(11111111, 1111111), test(11111111, 1111111), 222, test(11111111, 1111111), test(11111111, 1111111), test(11111111, 1111111), test(11111111, 1111111), test(11111111, 1111111))
"""Define library wise constants""" __version__: str = '0.0.7' __author__: str = 'Igor Morgado' __author_email__: str = 'morgado.igor@gmail.com'
"""Define library wise constants""" __version__: str = '0.0.7' __author__: str = 'Igor Morgado' __author_email__: str = 'morgado.igor@gmail.com'
# # PySNMP MIB module CISCOTRAP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCOTRAP-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:24:33 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") SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection") cisco, = mibBuilder.importSymbols("CISCO-SMI", "cisco") ifType, ifIndex, ifDescr = mibBuilder.importSymbols("IF-MIB", "ifType", "ifIndex", "ifDescr") locIfReason, = mibBuilder.importSymbols("OLD-CISCO-INTERFACES-MIB", "locIfReason") authAddr, whyReload = mibBuilder.importSymbols("OLD-CISCO-SYSTEM-MIB", "authAddr", "whyReload") loctcpConnInBytes, loctcpConnOutBytes, loctcpConnElapsed = mibBuilder.importSymbols("OLD-CISCO-TCP-MIB", "loctcpConnInBytes", "loctcpConnOutBytes", "loctcpConnElapsed") tsLineUser, tslineSesType = mibBuilder.importSymbols("OLD-CISCO-TS-MIB", "tsLineUser", "tslineSesType") egpNeighAddr, = mibBuilder.importSymbols("RFC1213-MIB", "egpNeighAddr") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") sysUpTime, snmp = mibBuilder.importSymbols("SNMPv2-MIB", "sysUpTime", "snmp") ObjectIdentity, iso, Gauge32, ModuleIdentity, Counter64, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, IpAddress, Unsigned32, Integer32, Bits, NotificationType, Counter32, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "iso", "Gauge32", "ModuleIdentity", "Counter64", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "IpAddress", "Unsigned32", "Integer32", "Bits", "NotificationType", "Counter32", "TimeTicks") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") tcpConnState, = mibBuilder.importSymbols("TCP-MIB", "tcpConnState") coldStart = NotificationType((1, 3, 6, 1, 2, 1, 11) + (0,0)).setObjects(("SNMPv2-MIB", "sysUpTime"), ("OLD-CISCO-SYSTEM-MIB", "whyReload")) if mibBuilder.loadTexts: coldStart.setDescription("A coldStart trap signifies that the sending protocol entity is reinitializing itself such that the agent's configuration or the protocol entity implementation may be altered.") linkDown = NotificationType((1, 3, 6, 1, 2, 1, 11) + (0,2)).setObjects(("IF-MIB", "ifIndex"), ("IF-MIB", "ifDescr"), ("IF-MIB", "ifType"), ("OLD-CISCO-INTERFACES-MIB", "locIfReason")) if mibBuilder.loadTexts: linkDown.setDescription("A linkDown trap signifies that the sending protocol entity recognizes a failure in one of the communication links represented in the agent's configuration.") linkUp = NotificationType((1, 3, 6, 1, 2, 1, 11) + (0,3)).setObjects(("IF-MIB", "ifIndex"), ("IF-MIB", "ifDescr"), ("IF-MIB", "ifType"), ("OLD-CISCO-INTERFACES-MIB", "locIfReason")) if mibBuilder.loadTexts: linkUp.setDescription("A linkUp trap signifies that the sending protocol entity recognizes that one of the communication links represented in the agent's configuration has come up.") authenticationFailure = NotificationType((1, 3, 6, 1, 2, 1, 11) + (0,4)).setObjects(("OLD-CISCO-SYSTEM-MIB", "authAddr")) if mibBuilder.loadTexts: authenticationFailure.setDescription('An authenticationFailure trap signifies that the sending protocol entity is the addressee of a protocol message that is not properly authenticated. While implementations of the SNMP must be capable of generating this trap, they must also be capable of suppressing the emission of such traps via an implementation- specific mechanism.') egpNeighborLoss = NotificationType((1, 3, 6, 1, 2, 1, 11) + (0,5)).setObjects(("RFC1213-MIB", "egpNeighAddr")) if mibBuilder.loadTexts: egpNeighborLoss.setDescription('An egpNeighborLoss trap signifies that an EGP neighbor for whom the sending protocol entity was an EGP peer has been marked down and the peer relationship no longer obtains.') reload = NotificationType((1, 3, 6, 1, 4, 1, 9) + (0,0)).setObjects(("SNMPv2-MIB", "sysUpTime"), ("OLD-CISCO-SYSTEM-MIB", "whyReload")) if mibBuilder.loadTexts: reload.setDescription("A reload trap signifies that the sending protocol entity is reinitializing itself such that the agent's configuration or the protocol entity implementation may be altered.") tcpConnectionClose = NotificationType((1, 3, 6, 1, 4, 1, 9) + (0,1)).setObjects(("OLD-CISCO-TS-MIB", "tslineSesType"), ("TCP-MIB", "tcpConnState"), ("OLD-CISCO-TCP-MIB", "loctcpConnElapsed"), ("OLD-CISCO-TCP-MIB", "loctcpConnInBytes"), ("OLD-CISCO-TCP-MIB", "loctcpConnOutBytes"), ("OLD-CISCO-TS-MIB", "tsLineUser")) if mibBuilder.loadTexts: tcpConnectionClose.setDescription('A tty trap signifies that a TCP connection, previously established with the sending protocol entity for the purposes of a tty session, has been terminated.') mibBuilder.exportSymbols("CISCOTRAP-MIB", linkDown=linkDown, linkUp=linkUp, tcpConnectionClose=tcpConnectionClose, reload=reload, authenticationFailure=authenticationFailure, egpNeighborLoss=egpNeighborLoss, coldStart=coldStart)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_size_constraint, constraints_union, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'ConstraintsIntersection') (cisco,) = mibBuilder.importSymbols('CISCO-SMI', 'cisco') (if_type, if_index, if_descr) = mibBuilder.importSymbols('IF-MIB', 'ifType', 'ifIndex', 'ifDescr') (loc_if_reason,) = mibBuilder.importSymbols('OLD-CISCO-INTERFACES-MIB', 'locIfReason') (auth_addr, why_reload) = mibBuilder.importSymbols('OLD-CISCO-SYSTEM-MIB', 'authAddr', 'whyReload') (loctcp_conn_in_bytes, loctcp_conn_out_bytes, loctcp_conn_elapsed) = mibBuilder.importSymbols('OLD-CISCO-TCP-MIB', 'loctcpConnInBytes', 'loctcpConnOutBytes', 'loctcpConnElapsed') (ts_line_user, tsline_ses_type) = mibBuilder.importSymbols('OLD-CISCO-TS-MIB', 'tsLineUser', 'tslineSesType') (egp_neigh_addr,) = mibBuilder.importSymbols('RFC1213-MIB', 'egpNeighAddr') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (sys_up_time, snmp) = mibBuilder.importSymbols('SNMPv2-MIB', 'sysUpTime', 'snmp') (object_identity, iso, gauge32, module_identity, counter64, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, ip_address, unsigned32, integer32, bits, notification_type, counter32, time_ticks) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'iso', 'Gauge32', 'ModuleIdentity', 'Counter64', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'IpAddress', 'Unsigned32', 'Integer32', 'Bits', 'NotificationType', 'Counter32', 'TimeTicks') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') (tcp_conn_state,) = mibBuilder.importSymbols('TCP-MIB', 'tcpConnState') cold_start = notification_type((1, 3, 6, 1, 2, 1, 11) + (0, 0)).setObjects(('SNMPv2-MIB', 'sysUpTime'), ('OLD-CISCO-SYSTEM-MIB', 'whyReload')) if mibBuilder.loadTexts: coldStart.setDescription("A coldStart trap signifies that the sending protocol entity is reinitializing itself such that the agent's configuration or the protocol entity implementation may be altered.") link_down = notification_type((1, 3, 6, 1, 2, 1, 11) + (0, 2)).setObjects(('IF-MIB', 'ifIndex'), ('IF-MIB', 'ifDescr'), ('IF-MIB', 'ifType'), ('OLD-CISCO-INTERFACES-MIB', 'locIfReason')) if mibBuilder.loadTexts: linkDown.setDescription("A linkDown trap signifies that the sending protocol entity recognizes a failure in one of the communication links represented in the agent's configuration.") link_up = notification_type((1, 3, 6, 1, 2, 1, 11) + (0, 3)).setObjects(('IF-MIB', 'ifIndex'), ('IF-MIB', 'ifDescr'), ('IF-MIB', 'ifType'), ('OLD-CISCO-INTERFACES-MIB', 'locIfReason')) if mibBuilder.loadTexts: linkUp.setDescription("A linkUp trap signifies that the sending protocol entity recognizes that one of the communication links represented in the agent's configuration has come up.") authentication_failure = notification_type((1, 3, 6, 1, 2, 1, 11) + (0, 4)).setObjects(('OLD-CISCO-SYSTEM-MIB', 'authAddr')) if mibBuilder.loadTexts: authenticationFailure.setDescription('An authenticationFailure trap signifies that the sending protocol entity is the addressee of a protocol message that is not properly authenticated. While implementations of the SNMP must be capable of generating this trap, they must also be capable of suppressing the emission of such traps via an implementation- specific mechanism.') egp_neighbor_loss = notification_type((1, 3, 6, 1, 2, 1, 11) + (0, 5)).setObjects(('RFC1213-MIB', 'egpNeighAddr')) if mibBuilder.loadTexts: egpNeighborLoss.setDescription('An egpNeighborLoss trap signifies that an EGP neighbor for whom the sending protocol entity was an EGP peer has been marked down and the peer relationship no longer obtains.') reload = notification_type((1, 3, 6, 1, 4, 1, 9) + (0, 0)).setObjects(('SNMPv2-MIB', 'sysUpTime'), ('OLD-CISCO-SYSTEM-MIB', 'whyReload')) if mibBuilder.loadTexts: reload.setDescription("A reload trap signifies that the sending protocol entity is reinitializing itself such that the agent's configuration or the protocol entity implementation may be altered.") tcp_connection_close = notification_type((1, 3, 6, 1, 4, 1, 9) + (0, 1)).setObjects(('OLD-CISCO-TS-MIB', 'tslineSesType'), ('TCP-MIB', 'tcpConnState'), ('OLD-CISCO-TCP-MIB', 'loctcpConnElapsed'), ('OLD-CISCO-TCP-MIB', 'loctcpConnInBytes'), ('OLD-CISCO-TCP-MIB', 'loctcpConnOutBytes'), ('OLD-CISCO-TS-MIB', 'tsLineUser')) if mibBuilder.loadTexts: tcpConnectionClose.setDescription('A tty trap signifies that a TCP connection, previously established with the sending protocol entity for the purposes of a tty session, has been terminated.') mibBuilder.exportSymbols('CISCOTRAP-MIB', linkDown=linkDown, linkUp=linkUp, tcpConnectionClose=tcpConnectionClose, reload=reload, authenticationFailure=authenticationFailure, egpNeighborLoss=egpNeighborLoss, coldStart=coldStart)
data_s3_path = "riskified-research-files/research analysts/DO/representment/win_rate_prediction/exploration" data_file_name = "disputed_chbs_targil_6.csv" cat_features = [ # 'dispute_status', 'domestic_international', 'order_submission_type', 'bill_ship_mismatch', 'is_proxy', 'order_external_status', 'cvv_result', 'avs_result', 'mapped_source', 'formatted_credit_card_company' ] cont_features = [ 'ip_proxy_score_current', 'mean_risk_percentile', 'customer_age', 'effective_customer_age', 'effective_chargeback_score', 'effective_email_age', 'order_total_spent', ]
data_s3_path = 'riskified-research-files/research analysts/DO/representment/win_rate_prediction/exploration' data_file_name = 'disputed_chbs_targil_6.csv' cat_features = ['domestic_international', 'order_submission_type', 'bill_ship_mismatch', 'is_proxy', 'order_external_status', 'cvv_result', 'avs_result', 'mapped_source', 'formatted_credit_card_company'] cont_features = ['ip_proxy_score_current', 'mean_risk_percentile', 'customer_age', 'effective_customer_age', 'effective_chargeback_score', 'effective_email_age', 'order_total_spent']
# # PySNMP MIB module GMS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/GMS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:06:21 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint") applIndex, = mibBuilder.importSymbols("NETWORK-SERVICES-MIB", "applIndex") ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup") iso, mib_2, ObjectIdentity, Unsigned32, Integer32, TimeTicks, Counter32, IpAddress, enterprises, Counter64, ModuleIdentity, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, snmpModules, MibIdentifier, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "mib-2", "ObjectIdentity", "Unsigned32", "Integer32", "TimeTicks", "Counter32", "IpAddress", "enterprises", "Counter64", "ModuleIdentity", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "snmpModules", "MibIdentifier", "Gauge32") DisplayString, TimeInterval, TextualConvention, TimeStamp, TestAndIncr = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TimeInterval", "TextualConvention", "TimeStamp", "TestAndIncr") gordano = ModuleIdentity((1, 3, 6, 1, 4, 1, 24534)) gordano.setRevisions(('1916-11-05 00:00',)) if mibBuilder.loadTexts: gordano.setLastUpdated('0909050000Z') if mibBuilder.loadTexts: gordano.setOrganization('Gordano Ltd') gmsAV = MibIdentifier((1, 3, 6, 1, 4, 1, 24534, 2)) gmsAS = MibIdentifier((1, 3, 6, 1, 4, 1, 24534, 3)) gmsSMTP = MibIdentifier((1, 3, 6, 1, 4, 1, 24534, 4)) gmsPOST = MibIdentifier((1, 3, 6, 1, 4, 1, 24534, 5)) gmsPOP = MibIdentifier((1, 3, 6, 1, 4, 1, 24534, 6)) gmsIMAP = MibIdentifier((1, 3, 6, 1, 4, 1, 24534, 7)) gmsWWW = MibIdentifier((1, 3, 6, 1, 4, 1, 24534, 8)) gmsApplTable = MibTable((1, 3, 6, 1, 4, 1, 24534, 1), ) if mibBuilder.loadTexts: gmsApplTable.setStatus('current') gmsApplEntry = MibTableRow((1, 3, 6, 1, 4, 1, 24534, 1, 1), ).setIndexNames((0, "NETWORK-SERVICES-MIB", "applIndex")) if mibBuilder.loadTexts: gmsApplEntry.setStatus('current') applHandleCount = MibTableColumn((1, 3, 6, 1, 4, 1, 24534, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: applHandleCount.setStatus('current') applPercentCPU = MibTableColumn((1, 3, 6, 1, 4, 1, 24534, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: applPercentCPU.setStatus('current') applRssKB = MibTableColumn((1, 3, 6, 1, 4, 1, 24534, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: applRssKB.setStatus('current') avEngineVersion = MibScalar((1, 3, 6, 1, 4, 1, 24534, 2, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: avEngineVersion.setStatus('current') avLastUpdate = MibScalar((1, 3, 6, 1, 4, 1, 24534, 2, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: avLastUpdate.setStatus('current') avMessagesScanned = MibScalar((1, 3, 6, 1, 4, 1, 24534, 2, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: avMessagesScanned.setStatus('current') avMessagesScannedLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 2, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: avMessagesScannedLow.setStatus('current') avVirusesFound = MibScalar((1, 3, 6, 1, 4, 1, 24534, 2, 5), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: avVirusesFound.setStatus('current') avVirusesFoundLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 2, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: avVirusesFoundLow.setStatus('current') asLastUpdate = MibScalar((1, 3, 6, 1, 4, 1, 24534, 3, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: asLastUpdate.setStatus('current') asMessagesChecked = MibScalar((1, 3, 6, 1, 4, 1, 24534, 3, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: asMessagesChecked.setStatus('current') asMessagesCheckedLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 3, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: asMessagesCheckedLow.setStatus('current') asMessagesRejected = MibScalar((1, 3, 6, 1, 4, 1, 24534, 3, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: asMessagesRejected.setStatus('current') asMessagesRejectedLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 3, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: asMessagesRejectedLow.setStatus('current') smtpThreadsTotal = MibScalar((1, 3, 6, 1, 4, 1, 24534, 4, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: smtpThreadsTotal.setStatus('current') smtpThreadsActive = MibScalar((1, 3, 6, 1, 4, 1, 24534, 4, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: smtpThreadsActive.setStatus('current') smtpSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 4, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: smtpSessions.setStatus('current') smtpSSLSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 4, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: smtpSSLSessions.setStatus('current') smtpOutOfThreads = MibScalar((1, 3, 6, 1, 4, 1, 24534, 4, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: smtpOutOfThreads.setStatus('current') smtpSuccessfulAuthentications = MibScalar((1, 3, 6, 1, 4, 1, 24534, 4, 6), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: smtpSuccessfulAuthentications.setStatus('current') smtpSuccessfulAuthenticationsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 4, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: smtpSuccessfulAuthenticationsLow.setStatus('current') smtpFailedAuthentications = MibScalar((1, 3, 6, 1, 4, 1, 24534, 4, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: smtpFailedAuthentications.setStatus('current') smtpFailedAuthenticationsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 4, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: smtpFailedAuthenticationsLow.setStatus('current') postThreadsTotal = MibScalar((1, 3, 6, 1, 4, 1, 24534, 5, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: postThreadsTotal.setStatus('current') postThreadsActive = MibScalar((1, 3, 6, 1, 4, 1, 24534, 5, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: postThreadsActive.setStatus('current') postSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 5, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: postSessions.setStatus('current') postSSLSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 5, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: postSSLSessions.setStatus('current') postSuccessfulAuthentications = MibScalar((1, 3, 6, 1, 4, 1, 24534, 5, 5), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: postSuccessfulAuthentications.setStatus('current') postSuccessfulAuthenticationsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 5, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: postSuccessfulAuthenticationsLow.setStatus('current') postFailedAuthentications = MibScalar((1, 3, 6, 1, 4, 1, 24534, 5, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: postFailedAuthentications.setStatus('current') postFailedAuthenticationsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 5, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: postFailedAuthenticationsLow.setStatus('current') postQueues = MibScalar((1, 3, 6, 1, 4, 1, 24534, 5, 9), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: postQueues.setStatus('current') popThreadsTotal = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popThreadsTotal.setStatus('current') popThreadsActive = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popThreadsActive.setStatus('current') popSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popSessions.setStatus('current') popSSLSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popSSLSessions.setStatus('current') popLoggedOnUsers = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popLoggedOnUsers.setStatus('current') popOutOfThreads = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popOutOfThreads.setStatus('current') popSuccessfulAuthentications = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: popSuccessfulAuthentications.setStatus('current') popSuccessfulAuthenticationsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popSuccessfulAuthenticationsLow.setStatus('current') popFailedAuthentications = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: popFailedAuthentications.setStatus('current') popFailedAuthenticationsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popFailedAuthenticationsLow.setStatus('current') popRetrievedVolume = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: popRetrievedVolume.setStatus('current') popRetrievedVolumeLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popRetrievedVolumeLow.setStatus('current') popToppedVolume = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: popToppedVolume.setStatus('current') popToppedVolumeLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popToppedVolumeLow.setStatus('current') popXmitVolume = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: popXmitVolume.setStatus('current') popXmitVolumeLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popXmitVolumeLow.setStatus('current') popDeletedMessages = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 17), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: popDeletedMessages.setStatus('current') popDeletedMessagesLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popDeletedMessagesLow.setStatus('current') popRetrievedMessages = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 19), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: popRetrievedMessages.setStatus('current') popRetrievedMessagesLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popRetrievedMessagesLow.setStatus('current') popToppedMessages = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 21), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: popToppedMessages.setStatus('current') popToppedMessagesLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popToppedMessagesLow.setStatus('current') popXmitedMessages = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 23), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: popXmitedMessages.setStatus('current') popXmitedMessagesLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: popXmitedMessagesLow.setStatus('current') popLastInboundActivity = MibScalar((1, 3, 6, 1, 4, 1, 24534, 6, 25), TimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: popLastInboundActivity.setStatus('current') imapThreadsTotal = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapThreadsTotal.setStatus('current') imapThreadsActive = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapThreadsActive.setStatus('current') imapSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapSessions.setStatus('current') imapSSLSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapSSLSessions.setStatus('current') imapIdleSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapIdleSessions.setStatus('current') imapLoggedOnUsers = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapLoggedOnUsers.setStatus('current') imapOutOfThreads = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapOutOfThreads.setStatus('current') imapSuccessfulAuthentications = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapSuccessfulAuthentications.setStatus('current') imapSuccessfulAuthenticationsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapSuccessfulAuthenticationsLow.setStatus('current') imapFailedAuthentications = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapFailedAuthentications.setStatus('current') imapFailedAuthenticationsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapFailedAuthenticationsLow.setStatus('current') imapDeletedMessages = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapDeletedMessages.setStatus('current') imapDeletedMessagesLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapDeletedMessagesLow.setStatus('current') imapStoredMessages = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapStoredMessages.setStatus('current') imapStoredMessagesLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapStoredMessagesLow.setStatus('current') imapAppendedMessages = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapAppendedMessages.setStatus('current') imapAppendedMessagesLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapAppendedMessagesLow.setStatus('current') imapAppendedVolume = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 18), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapAppendedVolume.setStatus('current') imapAppendedVolumeLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapAppendedVolumeLow.setStatus('current') imapFetchedMessages = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 20), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapFetchedMessages.setStatus('current') imapFetchedMessagesLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapFetchedMessagesLow.setStatus('current') imapFetchedVolume = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 22), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapFetchedVolume.setStatus('current') imapFetchedVolumeLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapFetchedVolumeLow.setStatus('current') imapCopiedMessages = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 24), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapCopiedMessages.setStatus('current') imapCopiedMessagesLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapCopiedMessagesLow.setStatus('current') imapSearchedMessages = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 26), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapSearchedMessages.setStatus('current') imapSearchedMessagesLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapSearchedMessagesLow.setStatus('current') imapLastInboundActivity = MibScalar((1, 3, 6, 1, 4, 1, 24534, 7, 28), TimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: imapLastInboundActivity.setStatus('current') wwwThreadsTotal = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwThreadsTotal.setStatus('current') wwwThreadsActive = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwThreadsActive.setStatus('current') wwwSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSessions.setStatus('current') wwwProxySessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwProxySessions.setStatus('current') wwwScriptSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwScriptSessions.setStatus('current') wwwConnections = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwConnections.setStatus('current') wwwSSLConnections = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSSLConnections.setStatus('current') wwwProxyConnections = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwProxyConnections.setStatus('current') wwwProxySSLConnections = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwProxySSLConnections.setStatus('current') wwwScriptConnections = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwScriptConnections.setStatus('current') wwwLoggedOnUsers = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwLoggedOnUsers.setStatus('current') wwwOutOfThreads = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwOutOfThreads.setStatus('current') wwwOutOfSessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwOutOfSessions.setStatus('current') wwwOutOfProxySessions = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwOutOfProxySessions.setStatus('current') wwwSessionTimeouts = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSessionTimeouts.setStatus('current') wwwSessionTimeoutsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSessionTimeoutsLow.setStatus('current') wwwProxySessionTimeouts = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 17), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwProxySessionTimeouts.setStatus('current') wwwProxySessionTimeoutsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwProxySessionTimeoutsLow.setStatus('current') wwwScriptSessionTimeouts = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 19), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwScriptSessionTimeouts.setStatus('current') wwwScriptSessionTimeoutsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwScriptSessionTimeoutsLow.setStatus('current') wwwSuccessfulAuthentications = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 21), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulAuthentications.setStatus('current') wwwSuccessfulAuthenticationsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulAuthenticationsLow.setStatus('current') wwwFailedAuthentications = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 23), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedAuthentications.setStatus('current') wwwFailedAuthenticationsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedAuthenticationsLow.setStatus('current') wwwReceivedVolume = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 25), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwReceivedVolume.setStatus('current') wwwReceivedVolumeLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwReceivedVolumeLow.setStatus('current') wwwTransmittedVolume = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 27), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwTransmittedVolume.setStatus('current') wwwTransmittedVolumeLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 28), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwTransmittedVolumeLow.setStatus('current') wwwProxyReceivedVolume = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 29), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwProxyReceivedVolume.setStatus('current') wwwProxyReceivedVolumeLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 30), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwProxyReceivedVolumeLow.setStatus('current') wwwProxyTransmittedVolume = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 31), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwProxyTransmittedVolume.setStatus('current') wwwProxyTransmittedVolumeLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 32), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwProxyTransmittedVolumeLow.setStatus('current') wwwReverseProxyReceivedVolume = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 33), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwReverseProxyReceivedVolume.setStatus('current') wwwReverseProxyReceivedVolumeLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 34), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwReverseProxyReceivedVolumeLow.setStatus('current') wwwReverseProxyTransmittedVolume = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 35), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwReverseProxyTransmittedVolume.setStatus('current') wwwReverseProxyTransmittedVolumeLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 36), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwReverseProxyTransmittedVolumeLow.setStatus('current') wwwSuccessfulRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 37), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulRequests.setStatus('current') wwwSuccessfulRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 38), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulRequestsLow.setStatus('current') wwwFailedRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 39), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedRequests.setStatus('current') wwwFailedRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 40), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedRequestsLow.setStatus('current') wwwSuccessfulAdminRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 41), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulAdminRequests.setStatus('current') wwwSuccessfulAdminRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 42), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulAdminRequestsLow.setStatus('current') wwwFailedAdminRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 43), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedAdminRequests.setStatus('current') wwwFailedAdminRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 44), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedAdminRequestsLow.setStatus('current') wwwSuccessfulWebmailRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 45), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulWebmailRequests.setStatus('current') wwwSuccessfulWebmailRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 46), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulWebmailRequestsLow.setStatus('current') wwwFailedWebmailRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 47), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedWebmailRequests.setStatus('current') wwwFailedWebmailRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 48), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedWebmailRequestsLow.setStatus('current') wwwSuccessfulUserRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 49), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulUserRequests.setStatus('current') wwwSuccessfulUserRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 50), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulUserRequestsLow.setStatus('current') wwwFailedUserRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 51), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedUserRequests.setStatus('current') wwwFailedUserRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 52), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedUserRequestsLow.setStatus('current') wwwSuccessfulProxyRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 53), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulProxyRequests.setStatus('current') wwwSuccessfulProxyRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 54), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulProxyRequestsLow.setStatus('current') wwwFailedProxyRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 55), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedProxyRequests.setStatus('current') wwwFailedProxyRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 56), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedProxyRequestsLow.setStatus('current') wwwSuccessfulReverseProxyRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 57), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulReverseProxyRequests.setStatus('current') wwwSuccessfulReverseProxyRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 58), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulReverseProxyRequestsLow.setStatus('current') wwwFailedReverseProxyRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 59), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedReverseProxyRequests.setStatus('current') wwwFailedReverseProxyRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 60), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedReverseProxyRequestsLow.setStatus('current') wwwSuccessfulScriptRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 61), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulScriptRequests.setStatus('current') wwwSuccessfulScriptRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 62), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulScriptRequestsLow.setStatus('current') wwwFailedScriptRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 63), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedScriptRequests.setStatus('current') wwwFailedScriptRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 64), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedScriptRequestsLow.setStatus('current') wwwSuccessfulTimedRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 65), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulTimedRequests.setStatus('current') wwwSuccessfulTimedRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 66), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwSuccessfulTimedRequestsLow.setStatus('current') wwwFailedTimedRequests = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 67), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedTimedRequests.setStatus('current') wwwFailedTimedRequestsLow = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 68), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwFailedTimedRequestsLow.setStatus('current') wwwMMLErrors = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 69), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwMMLErrors.setStatus('current') wwwMessagesRead = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 70), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwMessagesRead.setStatus('current') wwwMessagesSent = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 71), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwMessagesSent.setStatus('current') wwwLastInboundActivity = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 72), TimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwLastInboundActivity.setStatus('current') wwwLastOutboundActivity = MibScalar((1, 3, 6, 1, 4, 1, 24534, 8, 73), TimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwwLastOutboundActivity.setStatus('current') mibBuilder.exportSymbols("GMS-MIB", imapThreadsTotal=imapThreadsTotal, wwwReceivedVolume=wwwReceivedVolume, postQueues=postQueues, smtpThreadsActive=smtpThreadsActive, wwwFailedAuthenticationsLow=wwwFailedAuthenticationsLow, gmsAV=gmsAV, wwwFailedRequests=wwwFailedRequests, imapThreadsActive=imapThreadsActive, wwwSessionTimeouts=wwwSessionTimeouts, smtpThreadsTotal=smtpThreadsTotal, popToppedVolume=popToppedVolume, wwwFailedAdminRequests=wwwFailedAdminRequests, wwwProxyReceivedVolumeLow=wwwProxyReceivedVolumeLow, gmsApplEntry=gmsApplEntry, wwwSuccessfulAuthenticationsLow=wwwSuccessfulAuthenticationsLow, wwwFailedReverseProxyRequestsLow=wwwFailedReverseProxyRequestsLow, avMessagesScannedLow=avMessagesScannedLow, wwwFailedScriptRequests=wwwFailedScriptRequests, popRetrievedMessagesLow=popRetrievedMessagesLow, postFailedAuthentications=postFailedAuthentications, popSessions=popSessions, wwwFailedAuthentications=wwwFailedAuthentications, imapFetchedMessagesLow=imapFetchedMessagesLow, popXmitVolumeLow=popXmitVolumeLow, smtpSuccessfulAuthentications=smtpSuccessfulAuthentications, postSuccessfulAuthentications=postSuccessfulAuthentications, popThreadsActive=popThreadsActive, smtpFailedAuthentications=smtpFailedAuthentications, wwwProxyConnections=wwwProxyConnections, wwwFailedUserRequestsLow=wwwFailedUserRequestsLow, imapFailedAuthenticationsLow=imapFailedAuthenticationsLow, imapDeletedMessages=imapDeletedMessages, popOutOfThreads=popOutOfThreads, imapFetchedMessages=imapFetchedMessages, popFailedAuthentications=popFailedAuthentications, gmsAS=gmsAS, avVirusesFoundLow=avVirusesFoundLow, wwwFailedScriptRequestsLow=wwwFailedScriptRequestsLow, postFailedAuthenticationsLow=postFailedAuthenticationsLow, wwwSuccessfulUserRequests=wwwSuccessfulUserRequests, wwwFailedTimedRequestsLow=wwwFailedTimedRequestsLow, asMessagesRejectedLow=asMessagesRejectedLow, gmsPOP=gmsPOP, wwwFailedAdminRequestsLow=wwwFailedAdminRequestsLow, wwwReverseProxyReceivedVolumeLow=wwwReverseProxyReceivedVolumeLow, postSSLSessions=postSSLSessions, wwwSuccessfulAdminRequests=wwwSuccessfulAdminRequests, wwwFailedProxyRequests=wwwFailedProxyRequests, wwwMessagesSent=wwwMessagesSent, wwwOutOfThreads=wwwOutOfThreads, wwwScriptSessions=wwwScriptSessions, imapSSLSessions=imapSSLSessions, imapFetchedVolume=imapFetchedVolume, avMessagesScanned=avMessagesScanned, wwwSessions=wwwSessions, imapSearchedMessages=imapSearchedMessages, wwwOutOfProxySessions=wwwOutOfProxySessions, wwwProxySessionTimeoutsLow=wwwProxySessionTimeoutsLow, imapAppendedMessages=imapAppendedMessages, wwwScriptSessionTimeouts=wwwScriptSessionTimeouts, wwwSuccessfulWebmailRequestsLow=wwwSuccessfulWebmailRequestsLow, popLoggedOnUsers=popLoggedOnUsers, wwwFailedProxyRequestsLow=wwwFailedProxyRequestsLow, wwwProxyTransmittedVolumeLow=wwwProxyTransmittedVolumeLow, popXmitedMessagesLow=popXmitedMessagesLow, smtpSessions=smtpSessions, imapFetchedVolumeLow=imapFetchedVolumeLow, asMessagesRejected=asMessagesRejected, wwwScriptSessionTimeoutsLow=wwwScriptSessionTimeoutsLow, popDeletedMessagesLow=popDeletedMessagesLow, wwwSuccessfulTimedRequestsLow=wwwSuccessfulTimedRequestsLow, wwwTransmittedVolume=wwwTransmittedVolume, wwwFailedTimedRequests=wwwFailedTimedRequests, wwwSuccessfulUserRequestsLow=wwwSuccessfulUserRequestsLow, imapSuccessfulAuthentications=imapSuccessfulAuthentications, popFailedAuthenticationsLow=popFailedAuthenticationsLow, wwwLastOutboundActivity=wwwLastOutboundActivity, popSuccessfulAuthentications=popSuccessfulAuthentications, imapStoredMessages=imapStoredMessages, wwwFailedRequestsLow=wwwFailedRequestsLow, popSuccessfulAuthenticationsLow=popSuccessfulAuthenticationsLow, popXmitedMessages=popXmitedMessages, wwwTransmittedVolumeLow=wwwTransmittedVolumeLow, wwwProxyTransmittedVolume=wwwProxyTransmittedVolume, smtpSuccessfulAuthenticationsLow=smtpSuccessfulAuthenticationsLow, wwwThreadsActive=wwwThreadsActive, wwwSuccessfulAdminRequestsLow=wwwSuccessfulAdminRequestsLow, wwwFailedWebmailRequests=wwwFailedWebmailRequests, popRetrievedMessages=popRetrievedMessages, wwwSuccessfulWebmailRequests=wwwSuccessfulWebmailRequests, wwwLoggedOnUsers=wwwLoggedOnUsers, imapLoggedOnUsers=imapLoggedOnUsers, imapAppendedVolumeLow=imapAppendedVolumeLow, imapLastInboundActivity=imapLastInboundActivity, applRssKB=applRssKB, imapAppendedMessagesLow=imapAppendedMessagesLow, imapSuccessfulAuthenticationsLow=imapSuccessfulAuthenticationsLow, wwwSuccessfulProxyRequestsLow=wwwSuccessfulProxyRequestsLow, wwwSuccessfulReverseProxyRequests=wwwSuccessfulReverseProxyRequests, popLastInboundActivity=popLastInboundActivity, imapStoredMessagesLow=imapStoredMessagesLow, wwwProxySessions=wwwProxySessions, wwwReverseProxyReceivedVolume=wwwReverseProxyReceivedVolume, gmsIMAP=gmsIMAP, popThreadsTotal=popThreadsTotal, applHandleCount=applHandleCount, wwwMessagesRead=wwwMessagesRead, imapFailedAuthentications=imapFailedAuthentications, wwwSuccessfulAuthentications=wwwSuccessfulAuthentications, postThreadsTotal=postThreadsTotal, popToppedMessages=popToppedMessages, wwwThreadsTotal=wwwThreadsTotal, wwwMMLErrors=wwwMMLErrors, avVirusesFound=avVirusesFound, popSSLSessions=popSSLSessions, asMessagesChecked=asMessagesChecked, applPercentCPU=applPercentCPU, wwwFailedWebmailRequestsLow=wwwFailedWebmailRequestsLow, wwwFailedUserRequests=wwwFailedUserRequests, gmsWWW=gmsWWW, PYSNMP_MODULE_ID=gordano, wwwSuccessfulScriptRequests=wwwSuccessfulScriptRequests, wwwProxySSLConnections=wwwProxySSLConnections, wwwSessionTimeoutsLow=wwwSessionTimeoutsLow, gordano=gordano, wwwSuccessfulRequests=wwwSuccessfulRequests, imapDeletedMessagesLow=imapDeletedMessagesLow, imapCopiedMessagesLow=imapCopiedMessagesLow, popRetrievedVolumeLow=popRetrievedVolumeLow, popXmitVolume=popXmitVolume, wwwFailedReverseProxyRequests=wwwFailedReverseProxyRequests, wwwSuccessfulTimedRequests=wwwSuccessfulTimedRequests, popToppedMessagesLow=popToppedMessagesLow, gmsPOST=gmsPOST, wwwReceivedVolumeLow=wwwReceivedVolumeLow, popDeletedMessages=popDeletedMessages, imapSessions=imapSessions, wwwSSLConnections=wwwSSLConnections, gmsApplTable=gmsApplTable, imapOutOfThreads=imapOutOfThreads, imapIdleSessions=imapIdleSessions, imapAppendedVolume=imapAppendedVolume, wwwProxyReceivedVolume=wwwProxyReceivedVolume, wwwReverseProxyTransmittedVolume=wwwReverseProxyTransmittedVolume, postSessions=postSessions, wwwLastInboundActivity=wwwLastInboundActivity, wwwSuccessfulProxyRequests=wwwSuccessfulProxyRequests, popRetrievedVolume=popRetrievedVolume, popToppedVolumeLow=popToppedVolumeLow, wwwProxySessionTimeouts=wwwProxySessionTimeouts, wwwOutOfSessions=wwwOutOfSessions, wwwReverseProxyTransmittedVolumeLow=wwwReverseProxyTransmittedVolumeLow, postSuccessfulAuthenticationsLow=postSuccessfulAuthenticationsLow, imapSearchedMessagesLow=imapSearchedMessagesLow, gmsSMTP=gmsSMTP, wwwConnections=wwwConnections, wwwSuccessfulScriptRequestsLow=wwwSuccessfulScriptRequestsLow, avLastUpdate=avLastUpdate, wwwSuccessfulReverseProxyRequestsLow=wwwSuccessfulReverseProxyRequestsLow, asMessagesCheckedLow=asMessagesCheckedLow, asLastUpdate=asLastUpdate, wwwScriptConnections=wwwScriptConnections, smtpFailedAuthenticationsLow=smtpFailedAuthenticationsLow, postThreadsActive=postThreadsActive, avEngineVersion=avEngineVersion, wwwSuccessfulRequestsLow=wwwSuccessfulRequestsLow, smtpSSLSessions=smtpSSLSessions, smtpOutOfThreads=smtpOutOfThreads, imapCopiedMessages=imapCopiedMessages)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_union, value_size_constraint, constraints_intersection, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint') (appl_index,) = mibBuilder.importSymbols('NETWORK-SERVICES-MIB', 'applIndex') (module_compliance, object_group, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'ObjectGroup', 'NotificationGroup') (iso, mib_2, object_identity, unsigned32, integer32, time_ticks, counter32, ip_address, enterprises, counter64, module_identity, notification_type, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, snmp_modules, mib_identifier, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'mib-2', 'ObjectIdentity', 'Unsigned32', 'Integer32', 'TimeTicks', 'Counter32', 'IpAddress', 'enterprises', 'Counter64', 'ModuleIdentity', 'NotificationType', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'snmpModules', 'MibIdentifier', 'Gauge32') (display_string, time_interval, textual_convention, time_stamp, test_and_incr) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TimeInterval', 'TextualConvention', 'TimeStamp', 'TestAndIncr') gordano = module_identity((1, 3, 6, 1, 4, 1, 24534)) gordano.setRevisions(('1916-11-05 00:00',)) if mibBuilder.loadTexts: gordano.setLastUpdated('0909050000Z') if mibBuilder.loadTexts: gordano.setOrganization('Gordano Ltd') gms_av = mib_identifier((1, 3, 6, 1, 4, 1, 24534, 2)) gms_as = mib_identifier((1, 3, 6, 1, 4, 1, 24534, 3)) gms_smtp = mib_identifier((1, 3, 6, 1, 4, 1, 24534, 4)) gms_post = mib_identifier((1, 3, 6, 1, 4, 1, 24534, 5)) gms_pop = mib_identifier((1, 3, 6, 1, 4, 1, 24534, 6)) gms_imap = mib_identifier((1, 3, 6, 1, 4, 1, 24534, 7)) gms_www = mib_identifier((1, 3, 6, 1, 4, 1, 24534, 8)) gms_appl_table = mib_table((1, 3, 6, 1, 4, 1, 24534, 1)) if mibBuilder.loadTexts: gmsApplTable.setStatus('current') gms_appl_entry = mib_table_row((1, 3, 6, 1, 4, 1, 24534, 1, 1)).setIndexNames((0, 'NETWORK-SERVICES-MIB', 'applIndex')) if mibBuilder.loadTexts: gmsApplEntry.setStatus('current') appl_handle_count = mib_table_column((1, 3, 6, 1, 4, 1, 24534, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: applHandleCount.setStatus('current') appl_percent_cpu = mib_table_column((1, 3, 6, 1, 4, 1, 24534, 1, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: applPercentCPU.setStatus('current') appl_rss_kb = mib_table_column((1, 3, 6, 1, 4, 1, 24534, 1, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: applRssKB.setStatus('current') av_engine_version = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 2, 1), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: avEngineVersion.setStatus('current') av_last_update = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 2, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: avLastUpdate.setStatus('current') av_messages_scanned = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 2, 3), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: avMessagesScanned.setStatus('current') av_messages_scanned_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 2, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: avMessagesScannedLow.setStatus('current') av_viruses_found = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 2, 5), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: avVirusesFound.setStatus('current') av_viruses_found_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 2, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: avVirusesFoundLow.setStatus('current') as_last_update = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 3, 1), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: asLastUpdate.setStatus('current') as_messages_checked = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 3, 2), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: asMessagesChecked.setStatus('current') as_messages_checked_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 3, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: asMessagesCheckedLow.setStatus('current') as_messages_rejected = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 3, 4), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: asMessagesRejected.setStatus('current') as_messages_rejected_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 3, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: asMessagesRejectedLow.setStatus('current') smtp_threads_total = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 4, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: smtpThreadsTotal.setStatus('current') smtp_threads_active = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 4, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: smtpThreadsActive.setStatus('current') smtp_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 4, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: smtpSessions.setStatus('current') smtp_ssl_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 4, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: smtpSSLSessions.setStatus('current') smtp_out_of_threads = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 4, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: smtpOutOfThreads.setStatus('current') smtp_successful_authentications = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 4, 6), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: smtpSuccessfulAuthentications.setStatus('current') smtp_successful_authentications_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 4, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: smtpSuccessfulAuthenticationsLow.setStatus('current') smtp_failed_authentications = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 4, 8), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: smtpFailedAuthentications.setStatus('current') smtp_failed_authentications_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 4, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: smtpFailedAuthenticationsLow.setStatus('current') post_threads_total = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 5, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: postThreadsTotal.setStatus('current') post_threads_active = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 5, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: postThreadsActive.setStatus('current') post_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 5, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: postSessions.setStatus('current') post_ssl_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 5, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: postSSLSessions.setStatus('current') post_successful_authentications = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 5, 5), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: postSuccessfulAuthentications.setStatus('current') post_successful_authentications_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 5, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: postSuccessfulAuthenticationsLow.setStatus('current') post_failed_authentications = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 5, 7), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: postFailedAuthentications.setStatus('current') post_failed_authentications_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 5, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: postFailedAuthenticationsLow.setStatus('current') post_queues = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 5, 9), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: postQueues.setStatus('current') pop_threads_total = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popThreadsTotal.setStatus('current') pop_threads_active = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popThreadsActive.setStatus('current') pop_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popSessions.setStatus('current') pop_ssl_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popSSLSessions.setStatus('current') pop_logged_on_users = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popLoggedOnUsers.setStatus('current') pop_out_of_threads = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popOutOfThreads.setStatus('current') pop_successful_authentications = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 7), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: popSuccessfulAuthentications.setStatus('current') pop_successful_authentications_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popSuccessfulAuthenticationsLow.setStatus('current') pop_failed_authentications = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 9), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: popFailedAuthentications.setStatus('current') pop_failed_authentications_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popFailedAuthenticationsLow.setStatus('current') pop_retrieved_volume = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 11), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: popRetrievedVolume.setStatus('current') pop_retrieved_volume_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popRetrievedVolumeLow.setStatus('current') pop_topped_volume = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 13), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: popToppedVolume.setStatus('current') pop_topped_volume_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popToppedVolumeLow.setStatus('current') pop_xmit_volume = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 15), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: popXmitVolume.setStatus('current') pop_xmit_volume_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popXmitVolumeLow.setStatus('current') pop_deleted_messages = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 17), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: popDeletedMessages.setStatus('current') pop_deleted_messages_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popDeletedMessagesLow.setStatus('current') pop_retrieved_messages = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 19), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: popRetrievedMessages.setStatus('current') pop_retrieved_messages_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popRetrievedMessagesLow.setStatus('current') pop_topped_messages = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 21), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: popToppedMessages.setStatus('current') pop_topped_messages_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popToppedMessagesLow.setStatus('current') pop_xmited_messages = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 23), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: popXmitedMessages.setStatus('current') pop_xmited_messages_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 24), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: popXmitedMessagesLow.setStatus('current') pop_last_inbound_activity = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 6, 25), time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: popLastInboundActivity.setStatus('current') imap_threads_total = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapThreadsTotal.setStatus('current') imap_threads_active = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapThreadsActive.setStatus('current') imap_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapSessions.setStatus('current') imap_ssl_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapSSLSessions.setStatus('current') imap_idle_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapIdleSessions.setStatus('current') imap_logged_on_users = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapLoggedOnUsers.setStatus('current') imap_out_of_threads = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapOutOfThreads.setStatus('current') imap_successful_authentications = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 8), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapSuccessfulAuthentications.setStatus('current') imap_successful_authentications_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapSuccessfulAuthenticationsLow.setStatus('current') imap_failed_authentications = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 10), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapFailedAuthentications.setStatus('current') imap_failed_authentications_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapFailedAuthenticationsLow.setStatus('current') imap_deleted_messages = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 12), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapDeletedMessages.setStatus('current') imap_deleted_messages_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapDeletedMessagesLow.setStatus('current') imap_stored_messages = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 14), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapStoredMessages.setStatus('current') imap_stored_messages_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapStoredMessagesLow.setStatus('current') imap_appended_messages = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 16), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapAppendedMessages.setStatus('current') imap_appended_messages_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapAppendedMessagesLow.setStatus('current') imap_appended_volume = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 18), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapAppendedVolume.setStatus('current') imap_appended_volume_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapAppendedVolumeLow.setStatus('current') imap_fetched_messages = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 20), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapFetchedMessages.setStatus('current') imap_fetched_messages_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapFetchedMessagesLow.setStatus('current') imap_fetched_volume = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 22), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapFetchedVolume.setStatus('current') imap_fetched_volume_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 23), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapFetchedVolumeLow.setStatus('current') imap_copied_messages = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 24), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapCopiedMessages.setStatus('current') imap_copied_messages_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 25), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapCopiedMessagesLow.setStatus('current') imap_searched_messages = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 26), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapSearchedMessages.setStatus('current') imap_searched_messages_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 27), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapSearchedMessagesLow.setStatus('current') imap_last_inbound_activity = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 7, 28), time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: imapLastInboundActivity.setStatus('current') www_threads_total = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwThreadsTotal.setStatus('current') www_threads_active = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwThreadsActive.setStatus('current') www_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSessions.setStatus('current') www_proxy_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwProxySessions.setStatus('current') www_script_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwScriptSessions.setStatus('current') www_connections = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwConnections.setStatus('current') www_ssl_connections = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSSLConnections.setStatus('current') www_proxy_connections = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwProxyConnections.setStatus('current') www_proxy_ssl_connections = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 9), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwProxySSLConnections.setStatus('current') www_script_connections = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 10), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwScriptConnections.setStatus('current') www_logged_on_users = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 11), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwLoggedOnUsers.setStatus('current') www_out_of_threads = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 12), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwOutOfThreads.setStatus('current') www_out_of_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 13), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwOutOfSessions.setStatus('current') www_out_of_proxy_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 14), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwOutOfProxySessions.setStatus('current') www_session_timeouts = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 15), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSessionTimeouts.setStatus('current') www_session_timeouts_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSessionTimeoutsLow.setStatus('current') www_proxy_session_timeouts = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 17), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwProxySessionTimeouts.setStatus('current') www_proxy_session_timeouts_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwProxySessionTimeoutsLow.setStatus('current') www_script_session_timeouts = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 19), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwScriptSessionTimeouts.setStatus('current') www_script_session_timeouts_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwScriptSessionTimeoutsLow.setStatus('current') www_successful_authentications = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 21), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulAuthentications.setStatus('current') www_successful_authentications_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulAuthenticationsLow.setStatus('current') www_failed_authentications = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 23), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedAuthentications.setStatus('current') www_failed_authentications_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 24), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedAuthenticationsLow.setStatus('current') www_received_volume = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 25), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwReceivedVolume.setStatus('current') www_received_volume_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 26), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwReceivedVolumeLow.setStatus('current') www_transmitted_volume = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 27), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwTransmittedVolume.setStatus('current') www_transmitted_volume_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 28), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwTransmittedVolumeLow.setStatus('current') www_proxy_received_volume = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 29), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwProxyReceivedVolume.setStatus('current') www_proxy_received_volume_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 30), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwProxyReceivedVolumeLow.setStatus('current') www_proxy_transmitted_volume = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 31), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwProxyTransmittedVolume.setStatus('current') www_proxy_transmitted_volume_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 32), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwProxyTransmittedVolumeLow.setStatus('current') www_reverse_proxy_received_volume = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 33), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwReverseProxyReceivedVolume.setStatus('current') www_reverse_proxy_received_volume_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 34), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwReverseProxyReceivedVolumeLow.setStatus('current') www_reverse_proxy_transmitted_volume = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 35), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwReverseProxyTransmittedVolume.setStatus('current') www_reverse_proxy_transmitted_volume_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 36), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwReverseProxyTransmittedVolumeLow.setStatus('current') www_successful_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 37), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulRequests.setStatus('current') www_successful_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 38), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulRequestsLow.setStatus('current') www_failed_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 39), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedRequests.setStatus('current') www_failed_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 40), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedRequestsLow.setStatus('current') www_successful_admin_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 41), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulAdminRequests.setStatus('current') www_successful_admin_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 42), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulAdminRequestsLow.setStatus('current') www_failed_admin_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 43), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedAdminRequests.setStatus('current') www_failed_admin_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 44), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedAdminRequestsLow.setStatus('current') www_successful_webmail_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 45), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulWebmailRequests.setStatus('current') www_successful_webmail_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 46), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulWebmailRequestsLow.setStatus('current') www_failed_webmail_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 47), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedWebmailRequests.setStatus('current') www_failed_webmail_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 48), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedWebmailRequestsLow.setStatus('current') www_successful_user_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 49), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulUserRequests.setStatus('current') www_successful_user_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 50), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulUserRequestsLow.setStatus('current') www_failed_user_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 51), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedUserRequests.setStatus('current') www_failed_user_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 52), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedUserRequestsLow.setStatus('current') www_successful_proxy_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 53), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulProxyRequests.setStatus('current') www_successful_proxy_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 54), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulProxyRequestsLow.setStatus('current') www_failed_proxy_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 55), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedProxyRequests.setStatus('current') www_failed_proxy_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 56), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedProxyRequestsLow.setStatus('current') www_successful_reverse_proxy_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 57), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulReverseProxyRequests.setStatus('current') www_successful_reverse_proxy_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 58), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulReverseProxyRequestsLow.setStatus('current') www_failed_reverse_proxy_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 59), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedReverseProxyRequests.setStatus('current') www_failed_reverse_proxy_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 60), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedReverseProxyRequestsLow.setStatus('current') www_successful_script_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 61), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulScriptRequests.setStatus('current') www_successful_script_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 62), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulScriptRequestsLow.setStatus('current') www_failed_script_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 63), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedScriptRequests.setStatus('current') www_failed_script_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 64), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedScriptRequestsLow.setStatus('current') www_successful_timed_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 65), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulTimedRequests.setStatus('current') www_successful_timed_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 66), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwSuccessfulTimedRequestsLow.setStatus('current') www_failed_timed_requests = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 67), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedTimedRequests.setStatus('current') www_failed_timed_requests_low = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 68), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwFailedTimedRequestsLow.setStatus('current') www_mml_errors = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 69), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwMMLErrors.setStatus('current') www_messages_read = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 70), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwMessagesRead.setStatus('current') www_messages_sent = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 71), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwMessagesSent.setStatus('current') www_last_inbound_activity = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 72), time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwLastInboundActivity.setStatus('current') www_last_outbound_activity = mib_scalar((1, 3, 6, 1, 4, 1, 24534, 8, 73), time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwwLastOutboundActivity.setStatus('current') mibBuilder.exportSymbols('GMS-MIB', imapThreadsTotal=imapThreadsTotal, wwwReceivedVolume=wwwReceivedVolume, postQueues=postQueues, smtpThreadsActive=smtpThreadsActive, wwwFailedAuthenticationsLow=wwwFailedAuthenticationsLow, gmsAV=gmsAV, wwwFailedRequests=wwwFailedRequests, imapThreadsActive=imapThreadsActive, wwwSessionTimeouts=wwwSessionTimeouts, smtpThreadsTotal=smtpThreadsTotal, popToppedVolume=popToppedVolume, wwwFailedAdminRequests=wwwFailedAdminRequests, wwwProxyReceivedVolumeLow=wwwProxyReceivedVolumeLow, gmsApplEntry=gmsApplEntry, wwwSuccessfulAuthenticationsLow=wwwSuccessfulAuthenticationsLow, wwwFailedReverseProxyRequestsLow=wwwFailedReverseProxyRequestsLow, avMessagesScannedLow=avMessagesScannedLow, wwwFailedScriptRequests=wwwFailedScriptRequests, popRetrievedMessagesLow=popRetrievedMessagesLow, postFailedAuthentications=postFailedAuthentications, popSessions=popSessions, wwwFailedAuthentications=wwwFailedAuthentications, imapFetchedMessagesLow=imapFetchedMessagesLow, popXmitVolumeLow=popXmitVolumeLow, smtpSuccessfulAuthentications=smtpSuccessfulAuthentications, postSuccessfulAuthentications=postSuccessfulAuthentications, popThreadsActive=popThreadsActive, smtpFailedAuthentications=smtpFailedAuthentications, wwwProxyConnections=wwwProxyConnections, wwwFailedUserRequestsLow=wwwFailedUserRequestsLow, imapFailedAuthenticationsLow=imapFailedAuthenticationsLow, imapDeletedMessages=imapDeletedMessages, popOutOfThreads=popOutOfThreads, imapFetchedMessages=imapFetchedMessages, popFailedAuthentications=popFailedAuthentications, gmsAS=gmsAS, avVirusesFoundLow=avVirusesFoundLow, wwwFailedScriptRequestsLow=wwwFailedScriptRequestsLow, postFailedAuthenticationsLow=postFailedAuthenticationsLow, wwwSuccessfulUserRequests=wwwSuccessfulUserRequests, wwwFailedTimedRequestsLow=wwwFailedTimedRequestsLow, asMessagesRejectedLow=asMessagesRejectedLow, gmsPOP=gmsPOP, wwwFailedAdminRequestsLow=wwwFailedAdminRequestsLow, wwwReverseProxyReceivedVolumeLow=wwwReverseProxyReceivedVolumeLow, postSSLSessions=postSSLSessions, wwwSuccessfulAdminRequests=wwwSuccessfulAdminRequests, wwwFailedProxyRequests=wwwFailedProxyRequests, wwwMessagesSent=wwwMessagesSent, wwwOutOfThreads=wwwOutOfThreads, wwwScriptSessions=wwwScriptSessions, imapSSLSessions=imapSSLSessions, imapFetchedVolume=imapFetchedVolume, avMessagesScanned=avMessagesScanned, wwwSessions=wwwSessions, imapSearchedMessages=imapSearchedMessages, wwwOutOfProxySessions=wwwOutOfProxySessions, wwwProxySessionTimeoutsLow=wwwProxySessionTimeoutsLow, imapAppendedMessages=imapAppendedMessages, wwwScriptSessionTimeouts=wwwScriptSessionTimeouts, wwwSuccessfulWebmailRequestsLow=wwwSuccessfulWebmailRequestsLow, popLoggedOnUsers=popLoggedOnUsers, wwwFailedProxyRequestsLow=wwwFailedProxyRequestsLow, wwwProxyTransmittedVolumeLow=wwwProxyTransmittedVolumeLow, popXmitedMessagesLow=popXmitedMessagesLow, smtpSessions=smtpSessions, imapFetchedVolumeLow=imapFetchedVolumeLow, asMessagesRejected=asMessagesRejected, wwwScriptSessionTimeoutsLow=wwwScriptSessionTimeoutsLow, popDeletedMessagesLow=popDeletedMessagesLow, wwwSuccessfulTimedRequestsLow=wwwSuccessfulTimedRequestsLow, wwwTransmittedVolume=wwwTransmittedVolume, wwwFailedTimedRequests=wwwFailedTimedRequests, wwwSuccessfulUserRequestsLow=wwwSuccessfulUserRequestsLow, imapSuccessfulAuthentications=imapSuccessfulAuthentications, popFailedAuthenticationsLow=popFailedAuthenticationsLow, wwwLastOutboundActivity=wwwLastOutboundActivity, popSuccessfulAuthentications=popSuccessfulAuthentications, imapStoredMessages=imapStoredMessages, wwwFailedRequestsLow=wwwFailedRequestsLow, popSuccessfulAuthenticationsLow=popSuccessfulAuthenticationsLow, popXmitedMessages=popXmitedMessages, wwwTransmittedVolumeLow=wwwTransmittedVolumeLow, wwwProxyTransmittedVolume=wwwProxyTransmittedVolume, smtpSuccessfulAuthenticationsLow=smtpSuccessfulAuthenticationsLow, wwwThreadsActive=wwwThreadsActive, wwwSuccessfulAdminRequestsLow=wwwSuccessfulAdminRequestsLow, wwwFailedWebmailRequests=wwwFailedWebmailRequests, popRetrievedMessages=popRetrievedMessages, wwwSuccessfulWebmailRequests=wwwSuccessfulWebmailRequests, wwwLoggedOnUsers=wwwLoggedOnUsers, imapLoggedOnUsers=imapLoggedOnUsers, imapAppendedVolumeLow=imapAppendedVolumeLow, imapLastInboundActivity=imapLastInboundActivity, applRssKB=applRssKB, imapAppendedMessagesLow=imapAppendedMessagesLow, imapSuccessfulAuthenticationsLow=imapSuccessfulAuthenticationsLow, wwwSuccessfulProxyRequestsLow=wwwSuccessfulProxyRequestsLow, wwwSuccessfulReverseProxyRequests=wwwSuccessfulReverseProxyRequests, popLastInboundActivity=popLastInboundActivity, imapStoredMessagesLow=imapStoredMessagesLow, wwwProxySessions=wwwProxySessions, wwwReverseProxyReceivedVolume=wwwReverseProxyReceivedVolume, gmsIMAP=gmsIMAP, popThreadsTotal=popThreadsTotal, applHandleCount=applHandleCount, wwwMessagesRead=wwwMessagesRead, imapFailedAuthentications=imapFailedAuthentications, wwwSuccessfulAuthentications=wwwSuccessfulAuthentications, postThreadsTotal=postThreadsTotal, popToppedMessages=popToppedMessages, wwwThreadsTotal=wwwThreadsTotal, wwwMMLErrors=wwwMMLErrors, avVirusesFound=avVirusesFound, popSSLSessions=popSSLSessions, asMessagesChecked=asMessagesChecked, applPercentCPU=applPercentCPU, wwwFailedWebmailRequestsLow=wwwFailedWebmailRequestsLow, wwwFailedUserRequests=wwwFailedUserRequests, gmsWWW=gmsWWW, PYSNMP_MODULE_ID=gordano, wwwSuccessfulScriptRequests=wwwSuccessfulScriptRequests, wwwProxySSLConnections=wwwProxySSLConnections, wwwSessionTimeoutsLow=wwwSessionTimeoutsLow, gordano=gordano, wwwSuccessfulRequests=wwwSuccessfulRequests, imapDeletedMessagesLow=imapDeletedMessagesLow, imapCopiedMessagesLow=imapCopiedMessagesLow, popRetrievedVolumeLow=popRetrievedVolumeLow, popXmitVolume=popXmitVolume, wwwFailedReverseProxyRequests=wwwFailedReverseProxyRequests, wwwSuccessfulTimedRequests=wwwSuccessfulTimedRequests, popToppedMessagesLow=popToppedMessagesLow, gmsPOST=gmsPOST, wwwReceivedVolumeLow=wwwReceivedVolumeLow, popDeletedMessages=popDeletedMessages, imapSessions=imapSessions, wwwSSLConnections=wwwSSLConnections, gmsApplTable=gmsApplTable, imapOutOfThreads=imapOutOfThreads, imapIdleSessions=imapIdleSessions, imapAppendedVolume=imapAppendedVolume, wwwProxyReceivedVolume=wwwProxyReceivedVolume, wwwReverseProxyTransmittedVolume=wwwReverseProxyTransmittedVolume, postSessions=postSessions, wwwLastInboundActivity=wwwLastInboundActivity, wwwSuccessfulProxyRequests=wwwSuccessfulProxyRequests, popRetrievedVolume=popRetrievedVolume, popToppedVolumeLow=popToppedVolumeLow, wwwProxySessionTimeouts=wwwProxySessionTimeouts, wwwOutOfSessions=wwwOutOfSessions, wwwReverseProxyTransmittedVolumeLow=wwwReverseProxyTransmittedVolumeLow, postSuccessfulAuthenticationsLow=postSuccessfulAuthenticationsLow, imapSearchedMessagesLow=imapSearchedMessagesLow, gmsSMTP=gmsSMTP, wwwConnections=wwwConnections, wwwSuccessfulScriptRequestsLow=wwwSuccessfulScriptRequestsLow, avLastUpdate=avLastUpdate, wwwSuccessfulReverseProxyRequestsLow=wwwSuccessfulReverseProxyRequestsLow, asMessagesCheckedLow=asMessagesCheckedLow, asLastUpdate=asLastUpdate, wwwScriptConnections=wwwScriptConnections, smtpFailedAuthenticationsLow=smtpFailedAuthenticationsLow, postThreadsActive=postThreadsActive, avEngineVersion=avEngineVersion, wwwSuccessfulRequestsLow=wwwSuccessfulRequestsLow, smtpSSLSessions=smtpSSLSessions, smtpOutOfThreads=smtpOutOfThreads, imapCopiedMessages=imapCopiedMessages)
# Copyright (c) 2015 Vivaldi Technologies AS. All rights reserved { 'targets': [ { 'target_name': 'vivaldi_api_registration', 'type': 'static_library', 'msvs_disabled_warnings': [ 4267 ], 'includes': [ '../../chromium/build/json_schema_bundle_registration_compile.gypi', '../schema/vivaldi_schemas.gypi', ], 'dependencies': [ '../schema/vivaldi_api.gyp:vivaldi_chrome_api', # Different APIs include headers from these targets. "<(DEPTH)/content/content.gyp:content_browser", ], }, ], }
{'targets': [{'target_name': 'vivaldi_api_registration', 'type': 'static_library', 'msvs_disabled_warnings': [4267], 'includes': ['../../chromium/build/json_schema_bundle_registration_compile.gypi', '../schema/vivaldi_schemas.gypi'], 'dependencies': ['../schema/vivaldi_api.gyp:vivaldi_chrome_api', '<(DEPTH)/content/content.gyp:content_browser']}]}
class Solution: def solve(self, nums, a, b, c): q = lambda x: a*(x**2)+b*x+c if not nums: return [] if len(nums) == 1: return list(map(q,nums)) if a == 0: if b > 0: return list(map(q,nums)) else: return list(map(q,reversed(nums))) if a > 0: i = bisect_left(nums, -b/(2*a)) j = i-1 else: i = 0 j = len(nums)-1 ans = [] while (i < len(nums) or j >= 0) and (a > 0 or i <= j): if i == len(nums): ans.append(q(nums[j])) j -= 1 elif j == -1: ans.append(q(nums[i])) i += 1 else: if q(nums[i]) < q(nums[j]): ans.append(q(nums[i])) i += 1 else: ans.append(q(nums[j])) j -= 1 return ans
class Solution: def solve(self, nums, a, b, c): q = lambda x: a * x ** 2 + b * x + c if not nums: return [] if len(nums) == 1: return list(map(q, nums)) if a == 0: if b > 0: return list(map(q, nums)) else: return list(map(q, reversed(nums))) if a > 0: i = bisect_left(nums, -b / (2 * a)) j = i - 1 else: i = 0 j = len(nums) - 1 ans = [] while (i < len(nums) or j >= 0) and (a > 0 or i <= j): if i == len(nums): ans.append(q(nums[j])) j -= 1 elif j == -1: ans.append(q(nums[i])) i += 1 elif q(nums[i]) < q(nums[j]): ans.append(q(nums[i])) i += 1 else: ans.append(q(nums[j])) j -= 1 return ans
# -*- coding: utf-8 -*- """ Created on Sat Mar 21 12:03:38 2020 @author: Ravi """ def CountSort(arr,n): count = [0]*100 for i in arr: count[i]+=1 i=0 for a in range(100): for c in range(count[a]): arr[i] = a i+=1 return arr
""" Created on Sat Mar 21 12:03:38 2020 @author: Ravi """ def count_sort(arr, n): count = [0] * 100 for i in arr: count[i] += 1 i = 0 for a in range(100): for c in range(count[a]): arr[i] = a i += 1 return arr
def Vertical_Concatenation(Test_list): Result = [] n = 0 while n != len(Test_list): temp = '' for indexes in Test_list: try: temp += indexes[n] except IndexError: pass n += 1 Result.append(temp) return Result Test_list = [["Gfg", "good"], ["is", "for"], ["Best"]] print(Vertical_Concatenation(Test_list))
def vertical__concatenation(Test_list): result = [] n = 0 while n != len(Test_list): temp = '' for indexes in Test_list: try: temp += indexes[n] except IndexError: pass n += 1 Result.append(temp) return Result test_list = [['Gfg', 'good'], ['is', 'for'], ['Best']] print(vertical__concatenation(Test_list))
#!/usr/bin/env python3 class UserError(Exception): pass
class Usererror(Exception): pass
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def createList(self, list): h = head = ListNode(None) for l in list: head.next = ListNode(l) head = head.next return h.next def showList(self, head): while head is not None: print(head.val) head = head.next def sortList(self, head): """ :type head: ListNode :rtype: ListNode """ if not head or not head.next: return head slow = fast = head while fast.next and fast.next.next: fast = fast.next.next slow = slow.next fast = slow.next slow.next = None p1 = self.sortList(head) p2 = self.sortList(fast) return self.merge(p1, p2) def merge(self, list1, list2): h = p = ListNode(None) while list1 and list2: if list1.val <= list2.val: p.next = list1 list1 = list1.next else: p.next = list2 list2 = list2.next p = p.next if list1: p.next = list1 if list2: p.next = list2 return h.next s = Solution() head = s.createList(list=[3,2,1,4,5]) head2 = s.createList(list=[6,7,8]) head1 = s.sortList(head) s.showList(head1)
class Listnode: def __init__(self, x): self.val = x self.next = None class Solution: def create_list(self, list): h = head = list_node(None) for l in list: head.next = list_node(l) head = head.next return h.next def show_list(self, head): while head is not None: print(head.val) head = head.next def sort_list(self, head): """ :type head: ListNode :rtype: ListNode """ if not head or not head.next: return head slow = fast = head while fast.next and fast.next.next: fast = fast.next.next slow = slow.next fast = slow.next slow.next = None p1 = self.sortList(head) p2 = self.sortList(fast) return self.merge(p1, p2) def merge(self, list1, list2): h = p = list_node(None) while list1 and list2: if list1.val <= list2.val: p.next = list1 list1 = list1.next else: p.next = list2 list2 = list2.next p = p.next if list1: p.next = list1 if list2: p.next = list2 return h.next s = solution() head = s.createList(list=[3, 2, 1, 4, 5]) head2 = s.createList(list=[6, 7, 8]) head1 = s.sortList(head) s.showList(head1)
self.description = "check file type without mtree" self.filesystem = [ "bar/", "foo -> bar/" ] pkg = pmpkg("dummy") pkg.files = [ "foo/" ] self.addpkg2db("local",pkg) self.args = "-Qk" self.addrule("PACMAN_RETCODE=1") self.addrule("PACMAN_OUTPUT=warning.*(File type mismatch)")
self.description = 'check file type without mtree' self.filesystem = ['bar/', 'foo -> bar/'] pkg = pmpkg('dummy') pkg.files = ['foo/'] self.addpkg2db('local', pkg) self.args = '-Qk' self.addrule('PACMAN_RETCODE=1') self.addrule('PACMAN_OUTPUT=warning.*(File type mismatch)')
#Solution-7 Lisa Murray # User needs to input number that they want to calculate the square root of: num = float(input("Please enter a positive number: ")) #square root is found by raising the number to the power of a half sqroot = num**(1/2) # round the square root number to one decimal place and cast as a string ans = str(round(sqroot, 1)) #print the answer in a formatted sentence print (f"The square root of {num} is approx. {ans}.")
num = float(input('Please enter a positive number: ')) sqroot = num ** (1 / 2) ans = str(round(sqroot, 1)) print(f'The square root of {num} is approx. {ans}.')
# MadLib.py adjective = input("Please enter an adjective: ") noun = input("Please enter a noun: ") verb = input("Please enter a verb ending in -ed: ") print("Your MadLib:") print("The", adjective, noun, verb, "over the lazy brown dog.")
adjective = input('Please enter an adjective: ') noun = input('Please enter a noun: ') verb = input('Please enter a verb ending in -ed: ') print('Your MadLib:') print('The', adjective, noun, verb, 'over the lazy brown dog.')
""" None """ class SnakeGame: def __init__(self, width: int, height: int, food: List[List[int]]): """ Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is at [1,0]. """ self.width = width self.height = height self.food = food self.food_index = 0 self.shape = [(0, 0)] self.positions = set([(0, 0)]) def move(self, direction: str) -> int: """ Moves the snake. @param direction - 'U' = Up, 'L' = Left, 'R' = Right, 'D' = Down @return The game's score after the move. Return -1 if game over. Game over when snake crosses the screen boundary or bites its body. """ curr = self.shape[-1] mapping = { 'U': (-1, 0), 'L': (0, -1), 'R': (0, 1), 'D': (1, 0), } delta = mapping[direction] next_pos = (curr[0] + delta[0], curr[1] + delta[1]) if next_pos[0] < 0 or next_pos[0] >= self.height or next_pos[1] < 0 or next_pos[1] >= self.width: return -1 food_taken = False if self.food_index < len(self.food): if next_pos == tuple(self.food[self.food_index]): food_taken = True self.food_index += 1 if not food_taken: tail = self.shape[0] self.shape.pop(0) self.positions.remove(tail) if next_pos in self.positions: return -1 self.shape.append(next_pos) self.positions.add(next_pos) return len(self.shape) - 1 # Your SnakeGame object will be instantiated and called as such: # obj = SnakeGame(width, height, food) # param_1 = obj.move(direction)
""" None """ class Snakegame: def __init__(self, width: int, height: int, food: List[List[int]]): """ Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is at [1,0]. """ self.width = width self.height = height self.food = food self.food_index = 0 self.shape = [(0, 0)] self.positions = set([(0, 0)]) def move(self, direction: str) -> int: """ Moves the snake. @param direction - 'U' = Up, 'L' = Left, 'R' = Right, 'D' = Down @return The game's score after the move. Return -1 if game over. Game over when snake crosses the screen boundary or bites its body. """ curr = self.shape[-1] mapping = {'U': (-1, 0), 'L': (0, -1), 'R': (0, 1), 'D': (1, 0)} delta = mapping[direction] next_pos = (curr[0] + delta[0], curr[1] + delta[1]) if next_pos[0] < 0 or next_pos[0] >= self.height or next_pos[1] < 0 or (next_pos[1] >= self.width): return -1 food_taken = False if self.food_index < len(self.food): if next_pos == tuple(self.food[self.food_index]): food_taken = True self.food_index += 1 if not food_taken: tail = self.shape[0] self.shape.pop(0) self.positions.remove(tail) if next_pos in self.positions: return -1 self.shape.append(next_pos) self.positions.add(next_pos) return len(self.shape) - 1
""" Handling of options passed to the decorator to generate more rows of data. """ def _copy_rows(data, num_rows, base_row_index=0): """ Copies one list from a list of lists and adds it to the same list n times. Parameters ---------- data: [][] Dataset to apply the function to. This will be mutated. base_row_index: int The index of the row to copy num_rows: int The number of times to copy the base row. Returns ------- [][] List of lists, containing the additional copied data. """ copies = [data[base_row_index] for _ in range(num_rows)] return data + copies def _apply_func(data, func, num_rows, base_row_index=0, increment=False): """ Apply the function to the base row which returns a new row. This is then added to the dataset n times. Parameters ---------- data: [][] List to apply the function to. func: function The function to apply to the row. This won't alter the initial row it is applied to. base_row_index: int The index of the row to first apply the function to. num_rows: int The number of times this function should be applied. Will result in this many new rows added to the dataset. increment: boolean If true, the function will be applied to the newly created rows rather than the base row on further iterations. Returns ------- [][] The mutated list with the new rows added. """ row = list(data[base_row_index]) curr_index = base_row_index for _ in range(num_rows): data.append(func(row)) if increment: curr_index += 1 row = list(data[curr_index]) return data def apply_options(data, opts): """ Applies the passed options to the dataset. Parameters ---------- data: [][] List of lists containing the mock csv data. opts: dict Dictionary of options used to determine how to mutate the data. Options are as follows: add_rows: int The number of rows to add onto the mock dataset. row_pattern: str or function if str, should be 'copy' to apply the copy function. if function, will be used to create the new rows. base_row_index: int The index of the base row to apply the row pattern to. increment: boolean, If true and row_pattern is a function, the function will be applied incrementally on the dataset, rather than just on the base row over and over again. Returns ------- [][] The dataset with the new rows added. """ if not opts: return data if opts['row_pattern'] == 'copy': data = _copy_rows( data=data, num_rows=opts['add_rows'], base_row_index=opts.get('base_row_index') or 0 ) else: data = _apply_func( data=data, func=opts['row_pattern'], num_rows=opts['add_rows'], base_row_index=opts.get('base_row_index') or 0, increment=opts.get('increment') or False ) return data
""" Handling of options passed to the decorator to generate more rows of data. """ def _copy_rows(data, num_rows, base_row_index=0): """ Copies one list from a list of lists and adds it to the same list n times. Parameters ---------- data: [][] Dataset to apply the function to. This will be mutated. base_row_index: int The index of the row to copy num_rows: int The number of times to copy the base row. Returns ------- [][] List of lists, containing the additional copied data. """ copies = [data[base_row_index] for _ in range(num_rows)] return data + copies def _apply_func(data, func, num_rows, base_row_index=0, increment=False): """ Apply the function to the base row which returns a new row. This is then added to the dataset n times. Parameters ---------- data: [][] List to apply the function to. func: function The function to apply to the row. This won't alter the initial row it is applied to. base_row_index: int The index of the row to first apply the function to. num_rows: int The number of times this function should be applied. Will result in this many new rows added to the dataset. increment: boolean If true, the function will be applied to the newly created rows rather than the base row on further iterations. Returns ------- [][] The mutated list with the new rows added. """ row = list(data[base_row_index]) curr_index = base_row_index for _ in range(num_rows): data.append(func(row)) if increment: curr_index += 1 row = list(data[curr_index]) return data def apply_options(data, opts): """ Applies the passed options to the dataset. Parameters ---------- data: [][] List of lists containing the mock csv data. opts: dict Dictionary of options used to determine how to mutate the data. Options are as follows: add_rows: int The number of rows to add onto the mock dataset. row_pattern: str or function if str, should be 'copy' to apply the copy function. if function, will be used to create the new rows. base_row_index: int The index of the base row to apply the row pattern to. increment: boolean, If true and row_pattern is a function, the function will be applied incrementally on the dataset, rather than just on the base row over and over again. Returns ------- [][] The dataset with the new rows added. """ if not opts: return data if opts['row_pattern'] == 'copy': data = _copy_rows(data=data, num_rows=opts['add_rows'], base_row_index=opts.get('base_row_index') or 0) else: data = _apply_func(data=data, func=opts['row_pattern'], num_rows=opts['add_rows'], base_row_index=opts.get('base_row_index') or 0, increment=opts.get('increment') or False) return data
class Node: def __init__(self,cargo,left=None,right=None): self.cargo = cargo self.left = left self.right = right def __str__(self) -> str: return str(self.cargo) def insert(root,key): if root is None: return Node(key) if root.cargo>key: if root.left is None: root.left = Node(key) else: insert(root.left,key) else: if root.right is None: root.right = Node(key) else: insert(root.right,key) def inorder(root): if root is not None: inorder(root.left) print(root,end=' ') inorder(root.right) if __name__ =='__main__': tree = Node(5) insert(tree,2) insert(tree,8) insert(tree,9) insert(tree,6) insert(tree,4) insert(tree,3) inorder(tree)
class Node: def __init__(self, cargo, left=None, right=None): self.cargo = cargo self.left = left self.right = right def __str__(self) -> str: return str(self.cargo) def insert(root, key): if root is None: return node(key) if root.cargo > key: if root.left is None: root.left = node(key) else: insert(root.left, key) elif root.right is None: root.right = node(key) else: insert(root.right, key) def inorder(root): if root is not None: inorder(root.left) print(root, end=' ') inorder(root.right) if __name__ == '__main__': tree = node(5) insert(tree, 2) insert(tree, 8) insert(tree, 9) insert(tree, 6) insert(tree, 4) insert(tree, 3) inorder(tree)
num1 = 1 num2 = 2 num3 = 3 num4 = 33 num6 = 66
num1 = 1 num2 = 2 num3 = 3 num4 = 33 num6 = 66
class input_format(): def __init__(self,format_tag): self.tag = format_tag def print_sample_input(self): if self.tag =='FCC_BCC_Edge_Ternary': print(''' Sample JSON for using pseudo-ternary predictions of solid solution strength by Curtin edge dislocation model. ------------------------------------------------------------ { "material":"MnFeCoNiAl", "structure":"FCC", "pseudo-ternary":{ "increment": 1, "psA": {"grouped_elements":["Mn","Co"], "ratio": [1,1], "range":[0,100]}, "psB": {"grouped_elements":["Fe","Ni"], "ratio": [1,1], "range":[0,100]}, "psC": {"grouped_elements":["Al"], "ratio": [1], "range":[0,100]} }, "elements":{ "Co": {"Vn":11.12,"E":262.9,"G":101.7,"nu":0.292}, "Ni": {"Vn":10.94,"E":199.1,"G":76.0,"nu":0.309}, "Al": {"Vn":16.472,"E":65.5,"G":23.9,"nu":0.369}, "Mn": {"Vn":12.60,"E":197.7,"G":73.4,"nu":0.347}, "Fe": {"Vn":12.09,"E":194.3,"G":73.4} }, "uncertainty_level":{ "on/off":"on", "a":0.01, "elastic_constants":0.05 }, "conditions":{"temperature":300,"strain_r":0.001}, "model":{ "name":"FCC_Varvenne-Curtin-2016" }, "savefile":"MnFeCoNiAl_out" } ------------------------------------------------------------ Nesessary tags: "material": material name -- "structure": "FCC" or "BCC" -- "pseudo-ternary": containing "psA" "psB" 'psC' for pseudo-ternary components "psA": pseudo-ternary component, can be a single element or grouped element. "grouped_elements": # group specific elements in psA # eg. "grouped_elements":["Ni","Co"], Mn and Co are grouped "ratio": # specify the ratio between elements in A # eg. "ratio": [1,1], represent Co:Ni=1:1 "range": # specify the concentration range for "psA" # eg. "range":[0,100], range from 0 to 100 at.% -- "elements": input data for elements: "Co": element symbol for Co "Vn": atomic volume "a": lattice constant "b": Burgers vector # NOTE, just need to specify one of "Vn", "a" or "b" "E": Young's modulus "G": shear modulus "nu": Poisson's ratio # NOTE, in Voigt notation, as indicated in the paper. # Need to specify 2 of the "E", "G", and "nu" for isotropic. -- "conditions": experimental conditions "temperature": Kelvin "strain_r": experiment strain rate, typical tensile tests: 0.001 /s -- "model": IMPORTANT!!! "name": name of the model, use "FCC_Varvenne-Curtin-2016" for FCC and use "BCC_edge_Maresca-Curtin-2019" for BCC The following are adjustable parameters for the model "f1": # dimensionless pressure field parameter for athermal yield stress "f2": # dimensionless pressure field parameter for energy barrier "alpha": # dislocation line tension parameter IMPORTANT: If you don't know f1, f2, and alpha for your material, DO NOT change f1, f2 and alpha. The default values were optimized for FCC HEAs and BCC HEAs. Read Curtin's papers. ------- Optional tags: "uncertainty_level": allow uncertainty evaluation on input data. "on/off":"on" # turn on/off the uncertainty calculation # if off, no need to set the following tags # if on, specify the standard deviations for lattice constants and elastic constants "a": 0.01 # applied 1% standard deviation to lattice constants # 1000 data points were generated to evaluate the average and standar deviation # this means for each element, # a new lattice constant will be generated using normal distribution, # centered at the value "a" (lattice constants) in "elements" # with a standard deviation 0.01a. "elastic_constants": 0.05 # applied 5% standard deviation to elastic constants # 1000 data points were generated to evaluate the average and standar deviation # this means for each element, # new elastic constants will be generated using normal distribution, # centered at the values "E", "G", "nu" (elastic constants) in "elements" # with a standard deviation 0.01a. "savefile": output filename, CSV file. END ''') elif self.tag =='FCC_BCC_Edge_Composition_Temperature': print(''' Sample JSON for composition-temperature predictions of solid solution strength by Curtin edge dislocation model. ------------------------------------------------------------ { "material":"MnFeCoNi", "structure":"FCC", "elements":{ "Co": {"Vn":11.12,"E":262.9,"G":101.7,"nu":0.292}, "Ni": {"Vn":10.94,"E":199.1,"G":76.0,"nu":0.309}, "Mn": {"Vn":12.60,"E":197.7,"G":73.4,"nu":0.347}, "Fe": {"Vn":12.09,"E":194.3,"G":73.4} }, "compositions":{ "element_order": ["Co","Ni","Fe","Mn"], "concentrations": [ [25,25,25,25], [20,20,30,30], [30,30,20,20] ] }, "uncertainty_level":{ "on/off":"on", "a":0.01, "elastic_constants":0.05 }, "conditions":{ "temperature":{ "min": 300, "max": 600, "inc": 10 }, "strain_r":0.001 }, "model":{ "name":"FCC_Varvenne-Curtin-2016" }, "savefile":"MnFeCoNi_out" } ------------------------------------------------------------ Nesessary tags: "material": material name -- "structure": "FCC" or "BCC" -- "compositions": containing element symbols and concentrations for calculation. "element_order": a list of element symbols in order, be consistent with the "concentrations" "concentrations": a list of concentrations in at.% for elements in the "element_order", add up to 100. -- "elements": input data for elements: "Co": element symbol for Co "Vn": atomic volume "a": lattice constant "b": Burgers vector # NOTE, just need to specify one of "Vn", "a" or "b" "E": Young's modulus "G": shear modulus "nu": Poisson's ratio # NOTE, in Voigt notation, as indicated in the paper. # Need to specify 2 of the "E", "G", and "nu" for isotropic. -- "conditions": experimental conditions "temperature": specify temperature (Kelvin) range and increment for the calculations. "max": max T "min": min T "inc": increment. "strain_r": experiment strain rate, typical tensile tests: 0.001 /s -- "model": IMPORTANT!!! "name": name of the model, use "FCC_Varvenne-Curtin-2016" for FCC and use "BCC_edge_Maresca-Curtin-2019" for BCC The following are adjustable parameters for the model "f1": # dimensionless pressure field parameter for athermal yield stress "f2": # dimensionless pressure field parameter for energy barrier "alpha": # dislocation line tension parameter IMPORTANT: If you don't know f1, f2, and alpha for your material, DO NOT change f1, f2 and alpha. The default values were optimized for FCC HEAs and BCC HEAs. Read Curtin's papers. ------- Optional tags: "uncertainty_level": allow uncertainty evaluation on input data. "on/off":"on" # turn on/off the uncertainty calculation # if off, no need to set the following tags # if on, specify the standard deviations for lattice constants and elastic constants "a": 0.01 # applied 1% standard deviation to lattice constants # 1000 data points were generated to evaluate the average and standar deviation # this means for each element, # a new lattice constant will be generated using normal distribution, # centered at the value "a" (lattice constants) in "elements" # with a standard deviation 0.01a. "elastic_constants": 0.05 # applied 5% standard deviation to elastic constants # 1000 data points were generated to evaluate the average and standar deviation # this means for each element, # new elastic constants will be generated using normal distribution, # centered at the values "E", "G", "nu" (elastic constants) in "elements" # with a standard deviation 0.05*value. "savefile": output filename, CSV file. END ''') elif self.tag =='BCC_Screw_Curtin_Ternary': print(''' Sample JSON for predictions of solid solution strength for pseudo-ternary BCC by Curtin screw dislocation model. Screw dislocation in BCC. ------------------------------------------------------------ { "material":"NbMoW", "pseudo-ternary":{ "increment": 1, "psA": {"grouped_elements":["Nb"], "ratio": [1], "range":[0,100]}, "psB": {"grouped_elements":["Mo"], "ratio": [1], "range":[0,100]}, "psC": {"grouped_elements":["W"], "ratio": [1], "range":[0,100]} }, "elements":{ "Nb": {"a":3.30,"Delta_E_p":0.0345,"E_k":0.6400,"E_v":2.9899,"E_si":5.2563,"Delta_V_p":0.020}, "Mo": {"a":3.14,"Delta_E_p":0.1579,"E_k":0.5251,"E_v":2.9607,"E_si":7.3792,"Delta_V_p":0.020}, "W": {"a":3.16,"Delta_E_p":0.1493,"E_k":0.9057,"E_v":3.5655,"E_si":9.5417,"Delta_V_p":0.020} }, "adjustables":{ "kink_width":10, "Delta_V_p_scaler":1, "Delta_E_p_scaler":1 }, "conditions":{"temperature":300,"strain_r":0.001}, "model":{ "name":"BCC_screw_Maresca-Curtin-2019" }, "savefile":"NbMoW_out" } ------------------------------------------------------------ Nesessary tags: "material": material name -- "pseudo-ternary": containing "psA" "psB" 'psC' for pseudo-ternary components "psA": pseudo-ternary component, can be a single element or grouped elements. "grouped_elements": # group specific elements in psA # eg. "grouped_elements":["W","Ta"], Mn and Co are grouped "ratio": # specify the ratio between elements in A # eg. "ratio": [1,1], represent W:Ta=1:1 "range": # specify the concentration range for "psA" # eg. "range":[0,100], range from 0 to 100 at.% -- "elements": input data for elements: "W": element symbol for W below are necessary inputs. "a": lattice constant "E_k": screw dislocation kink formation energy (usually by DFT or MD calculations) "E_v": vacancy formation energy (usually by DFT or MD) "E_si": self-interstitial formation energy (usually by DFT or MD) "Delta_E_p": solute-dislocation interaction energy (usually by DFT or MD) "Delta_V_p": Peierls barrier (usually by DFT or MD) -- "adjustables": adjustable parameters for the model. Be VERY careful to change the values. "kink_width":10 kink width, default is 10, (unit: burgers vector), usually between 10b to 20b. "Delta_V_p_scaler":1, Peierls barrier scaler, DFT values are usually very high compared to experiments. So rescaling was taken to fit the experimental yield strengths. "Delta_E_p_scaler":1 Solute-dislocation interaction energy scaler. This is also rescaled for DFT/MD values. -- "conditions": experimental conditions "temperature": specify temperature (Kelvin) the calculations. "strain_r": experiment strain rate, typical tensile tests: 0.001 /s -- "model": "BCC_screw_Maresca-Curtin-2019", ------- Optional tags: "savefile": output filename, CSV file. END ''') elif self.tag =='BCC_Screw_Curtin_Composition_Temperature': print(''' Sample JSON for composition-temperature predictions of BCC solid solution strength by Curtin screw dislocation model. Screw dislocation in BCC. ------------------------------------------------------------ { "material":"Nb95Mo5", "model":"BCC_screw_Maresca-Curtin-2019", "properties":{ "a": 3.289, "E_k": 0.6342, "E_v": 2.989, "E_si": 5.361, "Delta_E_p": 0.0488, "Delta_V_p": 0.020 }, "conditions":{ "temperature":{ "max":500, "min":0, "inc":10 }, "strain_r":0.001 }, "adjustables":{ "kink_width":10, "Delta_V_p_scaler":1, "Delta_E_p_scaler":1 }, "savefile":"Nb95Mo5_out" } ------------------------------------------------------------ Nesessary tags: "material": material name -- "properties": input data for the material: "a": lattice constant "E_k": screw dislocation kink formation energy (usually by DFT or MD calculations) "E_v": vacancy formation energy (usually by DFT or MD) "E_si": self-interstitial formation energy (usually by DFT or MD) "Delta_E_p": solute-dislocation interaction energy (usually by DFT or MD) "Delta_V_p": Peierls barrier (usually by DFT or MD) -- "conditions": experimental conditions "temperature": specify temperature (Kelvin) range and increment for the calculations. "max": max T "min": min T "inc": increment. "strain_r": experiment strain rate, typical tensile tests: 0.001 /s -- "adjustables": adjustable parameters for the model. Be VERY careful to change the values. "kink_width":10 kink width, default is 10, (unit: burgers vector), usually between 10b to 20b. "Delta_V_p_scaler":1, Peierls barrier scaler, DFT values are usually very high compared to experiments. So rescaling was taken to fit the experimental yield strengths. "Delta_E_p_scaler":1 Solute-dislocation interaction energy scaler. This is also rescaled for DFT/MD values. -- "model": "BCC_screw_Maresca-Curtin-2019", ------- Optional tags: "savefile": output filename, CSV file. END ''') elif self.tag =='BCC_Screw_Suzuki_Temperature': print(''' Sample JSON for predictions of solid solution strength vs. temperature for BCC by Suzuki screw dislocation model. Screw dislocation in BCC. ------------------------------------------------------------ { "material":"Ti33Nb33Zr33", "model":"BCC_screw_Suzuki_RWASM-2020", "elements":{ "Nb": {"c":0.34,"a":3.30,"G":38,"nu":0.40,"E_w":0.054 ,"E_f_v":2.99,"E_f_si":5.25}, "Ti": {"c":0.33,"a":3.31,"G":44,"nu":0.32,"E_w":-0.028,"E_f_v":2.22,"E_f_si":2.4}, "Zr": {"c":0.33,"a":3.58,"G":33,"nu":0.34,"E_w":-0.053,"E_f_v":1.80,"E_f_si":3.5} }, "conditions":{ "temperature":{ "max":1400, "min":300, "inc":200 }, "strain_r":0.001 }, "adjustables":{ "kink_width":10, "tau_i_exponent":1, "dislocation_density":4e13, "trial_kappa":{ "min":1, "max":4, "inc":0.05 }, "trial_tau_k":5 }, "savefile":"TiNbZr_Suzuki_out" } ------------------------------------------------------------ Nesessary tags: "material": material name -- "elements": input data for elements: "Nb": element symbol for Nb below are necessary inputs. "c": concentration in at.% "a": lattice constant "E_w": solute-dislocation interaction (usually by DFT or MD calculations) "E_f_v": vacancy formation energy (usually by DFT or MD) "E_f_si": self-interstitial formation energy (usually by DFT or MD) "G": shear modulus "nu": Poisson ratio -- "adjustables": adjustable parameters for the model. Be VERY careful to change the values. "kink_width":10 kink width, default is 10, (unit: burgers vector), usually between 10b to 20b. "dislocation_density": mobile dislocation density default is 4e13, usually between 1e12 to 1e14 "tau_i_exponent": exponent for contributions of tau_y from different elements phenomenological equation for tau_y: q = tau_i_exponent tau_y = sum( tau_y_i^(1/q) )^q i for element_i for refractory metals, a safe value is 0.95-1. # same as the reference. "trial_kappa": The value of tau_y is obtained by minimizing tau_y over this kappa parameter. A range of kappa values are supplied to obtain tau_y vs. kappa curve. Then tau_y is found for minimum of the curve. Be careful to try different kappa range for convergence test. "trial_tau_k": Also needed for tau_y minimization. A fourth order equation must be solved for tau_k, before tau_y minimization. tau_k^4 + S * tau_k -R = 0 This trial_tau_k value provides the initial guess for scipy.optimize.root. Default value is 5, unit is MPa. -- "conditions": experimental conditions "temperature": specify temperature (Kelvin) range and increment for the calculations. "max": max T "min": min T "inc": increment. "strain_r": experiment strain rate, typical tensile tests: 0.001 /s -- "model": "BCC_screw_Suzuki_RWASM-2020" name of the Suzuki model # Paper: Rao, S.I., Woodward, C., Akdim, B., Senkov, O.N. and Miracle, D., 2021. # Theory of solid solution strengthening of BCC Chemically Complex Alloys. Acta Materialia, 209, p.116758. ------- Optional tags: "savefile": output filename, CSV file. END ''') elif self.tag =='BCC_Screw_Suzuki_Ternary': print(''' Sample JSON for predictions of solid solution strength for ternary/pseudo-ternary BCC by Suzuki screw dislocation model. ------------------------------------------------------------ { "material":"TiNbZr", "model":"BCC_screw_Suzuki_RWASM-2020", "pseudo-ternary":{ "increment": 5, "psA": {"grouped_elements":["Nb"], "ratio": [1], "range":[0,100]}, "psB": {"grouped_elements":["Ti"], "ratio": [1], "range":[0,100]}, "psC": {"grouped_elements":["Zr"], "ratio": [1], "range":[0,100]} }, "elements":{ "Nb": {"a":3.30,"G":38,"nu":0.40,"E_w":0.054 ,"E_f_v":2.99,"E_f_si":5.25}, "Ti": {"a":3.31,"G":44,"nu":0.32,"E_w":-0.028,"E_f_v":2.22,"E_f_si":2.4}, "Zr": {"a":3.58,"G":33,"nu":0.34,"E_w":-0.053,"E_f_v":1.80,"E_f_si":3.5} }, "conditions":{ "temperature":300, "strain_r":0.001 }, "adjustables":{ "kink_width":10, "tau_i_exponent":1, "dislocation_density":4e13, "trial_kappa":{ "min":1, "max":4, "inc":0.05 }, "trial_tau_k":5 }, "savefile":"TiNbZr_Suzuki_Ternary_out" } ------------------------------------------------------------ Nesessary tags: "material": material name -- "pseudo-ternary": containing "psA" "psB" 'psC' for pseudo-ternary components "psA": pseudo-ternary component, can be a single element or grouped elements. "grouped_elements": # group specific elements in psA # eg. "grouped_elements":["W","Ta"], Mn and Co are grouped "ratio": # specify the ratio between elements in A # eg. "ratio": [1,1], represent W:Ta=1:1 "range": # specify the concentration range for "psA" # eg. "range":[0,100], range from 0 to 100 at.% -- "elements": input data for elements: "Nb": element symbol for Nb below are necessary inputs. "a": lattice constant "E_w": solute-dislocation interaction (usually by DFT or MD calculations) "E_f_v": vacancy formation energy (usually by DFT or MD) "E_f_si": self-interstitial formation energy (usually by DFT or MD) "G": shear modulus "nu": Poisson ratio -- "adjustables": adjustable parameters for the model. Be VERY careful to change the values. "kink_width":10 kink width, default is 10, (unit: burgers vector), usually between 10b to 20b. "dislocation_density": mobile dislocation density default is 4e13, usually between 1e12 to 1e14 "tau_i_exponent": exponent for contributions of tau_y from different elements phenomenological equation for tau_y: q = tau_i_exponent tau_y = sum( tau_y_i^(1/q) )^q i for element_i for refractory metals, a safe value is 0.95-1. # same as the reference. "trial_kappa": The value of tau_y is obtained by minimizing tau_y over this kappa parameter. A range of kappa values are supplied to obtain tau_y vs. kappa curve. Then tau_y is found for minimum of the curve. Be careful to try different kappa range for convergence test. "trial_tau_k": Also needed for tau_y minimization. A fourth order equation must be solved for tau_k, before tau_y minimization. tau_k^4 + S * tau_k -R = 0 This trial_tau_k value provides the initial guess for scipy.optimize.root. Default value is 5, unit is MPa. -- "conditions": experimental conditions "temperature": specify temperature (Kelvin) the calculations. "strain_r": experiment strain rate, typical tensile tests: 0.001 /s -- "model": "BCC_screw_Suzuki_RWASM-2020" name of the Suzuki model # Paper: Rao, S.I., Woodward, C., Akdim, B., Senkov, O.N. and Miracle, D., 2021. # Theory of solid solution strengthening of BCC Chemically Complex Alloys. Acta Materialia, 209, p.116758. ------- Optional tags: "savefile": output filename, CSV file. END ''') else: print('NOT a valid name. Available input formats: \n' 'FCC_BCC_Edge_Ternary\n' 'FCC_BCC_Edge_Composition_Temperature\n' 'BCC_Screw_Curtin_Ternary\n' 'BCC_Screw_Curtin_Composition_Temperature\n' 'BCC_Screw_Suzuki_Temperature\n' 'BCC_Screw_Suzuki_Ternary\n')
class Input_Format: def __init__(self, format_tag): self.tag = format_tag def print_sample_input(self): if self.tag == 'FCC_BCC_Edge_Ternary': print('\nSample JSON for using pseudo-ternary predictions of solid solution strength by Curtin edge dislocation model. \n------------------------------------------------------------\n{\n "material":"MnFeCoNiAl",\n "structure":"FCC",\n "pseudo-ternary":{\n "increment": 1,\n "psA": {"grouped_elements":["Mn","Co"],\n "ratio": [1,1],\n "range":[0,100]},\n "psB": {"grouped_elements":["Fe","Ni"],\n "ratio": [1,1],\n "range":[0,100]},\n "psC": {"grouped_elements":["Al"],\n "ratio": [1],\n "range":[0,100]}\n },\n "elements":{\n "Co": {"Vn":11.12,"E":262.9,"G":101.7,"nu":0.292},\n "Ni": {"Vn":10.94,"E":199.1,"G":76.0,"nu":0.309},\n "Al": {"Vn":16.472,"E":65.5,"G":23.9,"nu":0.369},\n "Mn": {"Vn":12.60,"E":197.7,"G":73.4,"nu":0.347},\n "Fe": {"Vn":12.09,"E":194.3,"G":73.4}\n },\n "uncertainty_level":{\n "on/off":"on",\n "a":0.01, \n "elastic_constants":0.05\n },\n "conditions":{"temperature":300,"strain_r":0.001},\n "model":{\n "name":"FCC_Varvenne-Curtin-2016"\n },\n "savefile":"MnFeCoNiAl_out"\n}\n------------------------------------------------------------\nNesessary tags: \n"material": material name\n--\n"structure": "FCC" or "BCC"\n--\n"pseudo-ternary": containing "psA" "psB" \'psC\' for pseudo-ternary components\n "psA": pseudo-ternary component, can be a single element or grouped element. \n "grouped_elements": # group specific elements in psA \n # eg. "grouped_elements":["Ni","Co"], Mn and Co are grouped\n "ratio": # specify the ratio between elements in A\n # eg. "ratio": [1,1], represent Co:Ni=1:1\n "range": # specify the concentration range for "psA"\n # eg. "range":[0,100], range from 0 to 100 at.% \n--\n"elements": input data for elements: \n "Co": element symbol for Co\n "Vn": atomic volume \n "a": lattice constant\n "b": Burgers vector\n # NOTE, just need to specify one of "Vn", "a" or "b"\n "E": Young\'s modulus\n "G": shear modulus \n "nu": Poisson\'s ratio\n # NOTE, in Voigt notation, as indicated in the paper. \n # Need to specify 2 of the "E", "G", and "nu" for isotropic.\n--\n"conditions": experimental conditions\n "temperature": Kelvin\n "strain_r": experiment strain rate, \n typical tensile tests: 0.001 /s\n--\n"model": \n IMPORTANT!!!\n "name": name of the model, \n use "FCC_Varvenne-Curtin-2016" for FCC and \n use "BCC_edge_Maresca-Curtin-2019" for BCC\n \n The following are adjustable parameters for the model \n "f1": # dimensionless pressure field parameter for athermal yield stress \n "f2": # dimensionless pressure field parameter for energy barrier\n "alpha": # dislocation line tension parameter\n IMPORTANT: \n If you don\'t know f1, f2, and alpha for your material,\n DO NOT change f1, f2 and alpha. \n The default values were optimized for FCC HEAs and BCC HEAs.\n Read Curtin\'s papers. \n \n-------\nOptional tags:\n"uncertainty_level": allow uncertainty evaluation on input data. \n\n "on/off":"on" # turn on/off the uncertainty calculation\n # if off, no need to set the following tags\n # if on, specify the standard deviations \n for lattice constants and elastic constants\n \n "a": 0.01 # applied 1% standard deviation to lattice constants\n # 1000 data points were generated to evaluate the average and standar deviation\n # this means for each element, \n # a new lattice constant will be generated using normal distribution,\n # centered at the value "a" (lattice constants) in "elements"\n # with a standard deviation 0.01a. \n \n "elastic_constants": 0.05 # applied 5% standard deviation to elastic constants \n # 1000 data points were generated to evaluate the average and standar deviation\n # this means for each element, \n # new elastic constants will be generated using normal distribution,\n # centered at the values "E", "G", "nu" (elastic constants) in "elements"\n # with a standard deviation 0.01a. \n\n\n"savefile": output filename, CSV file. \n \nEND\n') elif self.tag == 'FCC_BCC_Edge_Composition_Temperature': print('\nSample JSON for composition-temperature predictions of solid solution strength by Curtin edge dislocation model. \n------------------------------------------------------------\n{\n "material":"MnFeCoNi",\n "structure":"FCC",\n "elements":{\n "Co": {"Vn":11.12,"E":262.9,"G":101.7,"nu":0.292},\n "Ni": {"Vn":10.94,"E":199.1,"G":76.0,"nu":0.309},\n "Mn": {"Vn":12.60,"E":197.7,"G":73.4,"nu":0.347},\n "Fe": {"Vn":12.09,"E":194.3,"G":73.4}\n },\n "compositions":{\n "element_order": ["Co","Ni","Fe","Mn"],\n "concentrations": [\n [25,25,25,25],\n [20,20,30,30],\n [30,30,20,20]\n ]\n\n },\n "uncertainty_level":{\n "on/off":"on",\n "a":0.01, \n "elastic_constants":0.05\n },\n "conditions":{\n "temperature":{\n "min": 300,\n "max": 600,\n "inc": 10\n },\n "strain_r":0.001\n },\n "model":{\n "name":"FCC_Varvenne-Curtin-2016"\n },\n "savefile":"MnFeCoNi_out"\n}\n------------------------------------------------------------\nNesessary tags: \n"material": material name\n--\n"structure": "FCC" or "BCC"\n--\n"compositions": containing element symbols and concentrations for calculation. \n "element_order": a list of element symbols in order, be consistent with the "concentrations"\n "concentrations": a list of concentrations in at.% for elements in the "element_order", \n add up to 100.\n--\n"elements": input data for elements: \n "Co": element symbol for Co\n "Vn": atomic volume \n "a": lattice constant\n "b": Burgers vector\n # NOTE, just need to specify one of "Vn", "a" or "b"\n "E": Young\'s modulus\n "G": shear modulus \n "nu": Poisson\'s ratio\n # NOTE, in Voigt notation, as indicated in the paper. \n # Need to specify 2 of the "E", "G", and "nu" for isotropic.\n--\n"conditions": experimental conditions\n "temperature": specify temperature (Kelvin) range and increment for the calculations.\n "max": max T\n "min": min T\n "inc": increment. \n "strain_r": experiment strain rate, \n typical tensile tests: 0.001 /s\n--\n"model": \n IMPORTANT!!!\n "name": name of the model, \n use "FCC_Varvenne-Curtin-2016" for FCC and \n use "BCC_edge_Maresca-Curtin-2019" for BCC\n \n The following are adjustable parameters for the model \n "f1": # dimensionless pressure field parameter for athermal yield stress \n "f2": # dimensionless pressure field parameter for energy barrier\n "alpha": # dislocation line tension parameter\n IMPORTANT: \n If you don\'t know f1, f2, and alpha for your material,\n DO NOT change f1, f2 and alpha. \n The default values were optimized for FCC HEAs and BCC HEAs.\n Read Curtin\'s papers. \n \n-------\nOptional tags:\n"uncertainty_level": allow uncertainty evaluation on input data. \n\n "on/off":"on" # turn on/off the uncertainty calculation\n # if off, no need to set the following tags\n # if on, specify the standard deviations \n for lattice constants and elastic constants\n \n "a": 0.01 # applied 1% standard deviation to lattice constants\n # 1000 data points were generated to evaluate the average and standar deviation\n # this means for each element, \n # a new lattice constant will be generated using normal distribution,\n # centered at the value "a" (lattice constants) in "elements"\n # with a standard deviation 0.01a. \n \n "elastic_constants": 0.05 # applied 5% standard deviation to elastic constants \n # 1000 data points were generated to evaluate the average and standar deviation\n # this means for each element, \n # new elastic constants will be generated using normal distribution,\n # centered at the values "E", "G", "nu" (elastic constants) in "elements"\n # with a standard deviation 0.05*value. \n \n"savefile": output filename, CSV file. \n \nEND\n') elif self.tag == 'BCC_Screw_Curtin_Ternary': print('\nSample JSON for predictions of solid solution strength for pseudo-ternary BCC by Curtin screw dislocation model. \nScrew dislocation in BCC. \n------------------------------------------------------------\n{\n "material":"NbMoW",\n "pseudo-ternary":{\n "increment": 1,\n "psA": {"grouped_elements":["Nb"],\n "ratio": [1],\n "range":[0,100]},\n "psB": {"grouped_elements":["Mo"],\n "ratio": [1],\n "range":[0,100]},\n "psC": {"grouped_elements":["W"],\n "ratio": [1],\n "range":[0,100]}\n },\n "elements":{\n "Nb": {"a":3.30,"Delta_E_p":0.0345,"E_k":0.6400,"E_v":2.9899,"E_si":5.2563,"Delta_V_p":0.020},\n "Mo": {"a":3.14,"Delta_E_p":0.1579,"E_k":0.5251,"E_v":2.9607,"E_si":7.3792,"Delta_V_p":0.020},\n "W": {"a":3.16,"Delta_E_p":0.1493,"E_k":0.9057,"E_v":3.5655,"E_si":9.5417,"Delta_V_p":0.020}\n },\n "adjustables":{\n "kink_width":10,\n "Delta_V_p_scaler":1,\n "Delta_E_p_scaler":1\n },\n "conditions":{"temperature":300,"strain_r":0.001},\n "model":{\n "name":"BCC_screw_Maresca-Curtin-2019"\n },\n "savefile":"NbMoW_out"\n}\n------------------------------------------------------------\nNesessary tags: \n"material": material name\n--\n"pseudo-ternary": containing "psA" "psB" \'psC\' for pseudo-ternary components\n "psA": pseudo-ternary component, can be a single element or grouped elements. \n "grouped_elements": # group specific elements in psA \n # eg. "grouped_elements":["W","Ta"], Mn and Co are grouped\n "ratio": # specify the ratio between elements in A\n # eg. "ratio": [1,1], represent W:Ta=1:1\n "range": # specify the concentration range for "psA"\n # eg. "range":[0,100], range from 0 to 100 at.% \n--\n"elements": input data for elements: \n "W": element symbol for W\n below are necessary inputs. \n "a": lattice constant\n "E_k": screw dislocation kink formation energy (usually by DFT or MD calculations)\n "E_v": vacancy formation energy (usually by DFT or MD)\n "E_si": self-interstitial formation energy (usually by DFT or MD)\n "Delta_E_p": solute-dislocation interaction energy (usually by DFT or MD)\n "Delta_V_p": Peierls barrier (usually by DFT or MD)\n--\n"adjustables": adjustable parameters for the model. Be VERY careful to change the values.\n "kink_width":10 kink width, default is 10, (unit: burgers vector), usually between 10b to 20b. \n "Delta_V_p_scaler":1, Peierls barrier scaler, DFT values are usually very high compared to experiments.\n So rescaling was taken to fit the experimental yield strengths.\n "Delta_E_p_scaler":1 Solute-dislocation interaction energy scaler.\n This is also rescaled for DFT/MD values. \n--\n"conditions": experimental conditions\n "temperature": specify temperature (Kelvin) the calculations.\n "strain_r": experiment strain rate, \n typical tensile tests: 0.001 /s\n--\n"model": "BCC_screw_Maresca-Curtin-2019", \n-------\nOptional tags:\n"savefile": output filename, CSV file. \n\nEND\n') elif self.tag == 'BCC_Screw_Curtin_Composition_Temperature': print('\nSample JSON for composition-temperature predictions of BCC solid solution strength by Curtin screw dislocation model. \nScrew dislocation in BCC. \n------------------------------------------------------------\n{\n "material":"Nb95Mo5",\n "model":"BCC_screw_Maresca-Curtin-2019",\n "properties":{\n "a": 3.289,\n "E_k": 0.6342, \n "E_v": 2.989,\n "E_si": 5.361,\n "Delta_E_p": 0.0488, \n "Delta_V_p": 0.020\n },\n "conditions":{\n "temperature":{\n "max":500,\n "min":0,\n "inc":10\n },\n "strain_r":0.001\n },\n "adjustables":{\n "kink_width":10,\n "Delta_V_p_scaler":1,\n "Delta_E_p_scaler":1\n },\n "savefile":"Nb95Mo5_out"\n}\n------------------------------------------------------------\nNesessary tags: \n"material": material name\n--\n"properties": input data for the material: \n\n "a": lattice constant\n "E_k": screw dislocation kink formation energy (usually by DFT or MD calculations)\n "E_v": vacancy formation energy (usually by DFT or MD)\n "E_si": self-interstitial formation energy (usually by DFT or MD)\n "Delta_E_p": solute-dislocation interaction energy (usually by DFT or MD)\n "Delta_V_p": Peierls barrier (usually by DFT or MD)\n--\n"conditions": experimental conditions\n "temperature": specify temperature (Kelvin) range and increment for the calculations.\n "max": max T\n "min": min T\n "inc": increment. \n "strain_r": experiment strain rate, \n typical tensile tests: 0.001 /s\n--\n"adjustables": adjustable parameters for the model. Be VERY careful to change the values.\n "kink_width":10 kink width, default is 10, (unit: burgers vector), usually between 10b to 20b. \n "Delta_V_p_scaler":1, Peierls barrier scaler, DFT values are usually very high compared to experiments.\n So rescaling was taken to fit the experimental yield strengths.\n "Delta_E_p_scaler":1 Solute-dislocation interaction energy scaler.\n This is also rescaled for DFT/MD values. \n--\n"model": "BCC_screw_Maresca-Curtin-2019", \n-------\nOptional tags:\n"savefile": output filename, CSV file. \n\nEND\n') elif self.tag == 'BCC_Screw_Suzuki_Temperature': print('\nSample JSON for predictions of solid solution strength vs. temperature for BCC by Suzuki screw dislocation model. \nScrew dislocation in BCC. \n------------------------------------------------------------\n{\n "material":"Ti33Nb33Zr33",\n "model":"BCC_screw_Suzuki_RWASM-2020",\n "elements":{\n "Nb": {"c":0.34,"a":3.30,"G":38,"nu":0.40,"E_w":0.054 ,"E_f_v":2.99,"E_f_si":5.25},\n "Ti": {"c":0.33,"a":3.31,"G":44,"nu":0.32,"E_w":-0.028,"E_f_v":2.22,"E_f_si":2.4},\n "Zr": {"c":0.33,"a":3.58,"G":33,"nu":0.34,"E_w":-0.053,"E_f_v":1.80,"E_f_si":3.5}\n },\n "conditions":{\n "temperature":{\n "max":1400,\n "min":300,\n "inc":200\n },\n "strain_r":0.001\n },\n "adjustables":{\n "kink_width":10,\n "tau_i_exponent":1,\n "dislocation_density":4e13,\n "trial_kappa":{\n "min":1,\n "max":4,\n "inc":0.05 \n },\n "trial_tau_k":5\n },\n "savefile":"TiNbZr_Suzuki_out"\n}\n------------------------------------------------------------\nNesessary tags: \n"material": material name\n--\n"elements": input data for elements: \n "Nb": element symbol for Nb\n below are necessary inputs. \n "c": concentration in at.%\n "a": lattice constant\n "E_w": solute-dislocation interaction (usually by DFT or MD calculations)\n "E_f_v": vacancy formation energy (usually by DFT or MD)\n "E_f_si": self-interstitial formation energy (usually by DFT or MD)\n "G": shear modulus\n "nu": Poisson ratio\n--\n"adjustables": adjustable parameters for the model. Be VERY careful to change the values.\n "kink_width":10 kink width, default is 10, (unit: burgers vector), \n usually between 10b to 20b. \n "dislocation_density": mobile dislocation density\n default is 4e13, usually between 1e12 to 1e14\n "tau_i_exponent": exponent for contributions of tau_y from different elements\n phenomenological equation for tau_y:\n q = tau_i_exponent\n tau_y = sum( tau_y_i^(1/q) )^q \n i for element_i \n for refractory metals, a safe value is 0.95-1. # same as the reference.\n "trial_kappa": The value of tau_y is obtained by minimizing tau_y over this kappa parameter.\n A range of kappa values are supplied to obtain tau_y vs. kappa curve.\n Then tau_y is found for minimum of the curve. \n Be careful to try different kappa range for convergence test.\n "trial_tau_k": Also needed for tau_y minimization.\n A fourth order equation must be solved for tau_k, before tau_y minimization.\n tau_k^4 + S * tau_k -R = 0 \n This trial_tau_k value provides the initial guess for scipy.optimize.root. \n Default value is 5, unit is MPa. \n--\n"conditions": experimental conditions\n "temperature": specify temperature (Kelvin) range and increment for the calculations.\n "max": max T\n "min": min T\n "inc": increment. \n "strain_r": experiment strain rate, \n typical tensile tests: 0.001 /s\n--\n"model": "BCC_screw_Suzuki_RWASM-2020"\n name of the Suzuki model\n # Paper: Rao, S.I., Woodward, C., Akdim, B., Senkov, O.N. and Miracle, D., 2021. \n # Theory of solid solution strengthening of BCC Chemically Complex Alloys. Acta Materialia, 209, p.116758.\n-------\nOptional tags:\n"savefile": output filename, CSV file. \n\nEND\n') elif self.tag == 'BCC_Screw_Suzuki_Ternary': print('\nSample JSON for predictions of solid solution strength for ternary/pseudo-ternary BCC \nby Suzuki screw dislocation model. \n------------------------------------------------------------\n{\n "material":"TiNbZr",\n "model":"BCC_screw_Suzuki_RWASM-2020",\n "pseudo-ternary":{\n "increment": 5,\n "psA": {"grouped_elements":["Nb"],\n "ratio": [1],\n "range":[0,100]},\n "psB": {"grouped_elements":["Ti"],\n "ratio": [1],\n "range":[0,100]},\n "psC": {"grouped_elements":["Zr"],\n "ratio": [1],\n "range":[0,100]}\n },\n "elements":{\n "Nb": {"a":3.30,"G":38,"nu":0.40,"E_w":0.054 ,"E_f_v":2.99,"E_f_si":5.25},\n "Ti": {"a":3.31,"G":44,"nu":0.32,"E_w":-0.028,"E_f_v":2.22,"E_f_si":2.4},\n "Zr": {"a":3.58,"G":33,"nu":0.34,"E_w":-0.053,"E_f_v":1.80,"E_f_si":3.5}\n },\n "conditions":{\n "temperature":300,\n "strain_r":0.001\n },\n "adjustables":{\n "kink_width":10,\n "tau_i_exponent":1,\n "dislocation_density":4e13,\n "trial_kappa":{\n "min":1,\n "max":4,\n "inc":0.05 \n },\n "trial_tau_k":5\n },\n "savefile":"TiNbZr_Suzuki_Ternary_out"\n}\n------------------------------------------------------------\nNesessary tags: \n"material": material name\n--\n"pseudo-ternary": containing "psA" "psB" \'psC\' for pseudo-ternary components\n "psA": pseudo-ternary component, can be a single element or grouped elements. \n "grouped_elements": # group specific elements in psA \n # eg. "grouped_elements":["W","Ta"], Mn and Co are grouped\n "ratio": # specify the ratio between elements in A\n # eg. "ratio": [1,1], represent W:Ta=1:1\n "range": # specify the concentration range for "psA"\n # eg. "range":[0,100], range from 0 to 100 at.% \n--\n"elements": input data for elements: \n "Nb": element symbol for Nb\n below are necessary inputs. \n "a": lattice constant\n "E_w": solute-dislocation interaction (usually by DFT or MD calculations)\n "E_f_v": vacancy formation energy (usually by DFT or MD)\n "E_f_si": self-interstitial formation energy (usually by DFT or MD)\n "G": shear modulus\n "nu": Poisson ratio\n--\n"adjustables": adjustable parameters for the model. Be VERY careful to change the values.\n "kink_width":10 kink width, default is 10, (unit: burgers vector), \n usually between 10b to 20b. \n "dislocation_density": mobile dislocation density\n default is 4e13, usually between 1e12 to 1e14\n "tau_i_exponent": exponent for contributions of tau_y from different elements\n phenomenological equation for tau_y:\n q = tau_i_exponent\n tau_y = sum( tau_y_i^(1/q) )^q \n i for element_i \n for refractory metals, a safe value is 0.95-1. # same as the reference.\n "trial_kappa": The value of tau_y is obtained by minimizing tau_y over this kappa parameter.\n A range of kappa values are supplied to obtain tau_y vs. kappa curve.\n Then tau_y is found for minimum of the curve. \n Be careful to try different kappa range for convergence test.\n "trial_tau_k": Also needed for tau_y minimization.\n A fourth order equation must be solved for tau_k, before tau_y minimization.\n tau_k^4 + S * tau_k -R = 0 \n This trial_tau_k value provides the initial guess for scipy.optimize.root. \n Default value is 5, unit is MPa. \n--\n"conditions": experimental conditions\n "temperature": specify temperature (Kelvin) the calculations.\n "strain_r": experiment strain rate, \n typical tensile tests: 0.001 /s\n--\n"model": "BCC_screw_Suzuki_RWASM-2020"\n name of the Suzuki model\n # Paper: Rao, S.I., Woodward, C., Akdim, B., Senkov, O.N. and Miracle, D., 2021. \n # Theory of solid solution strengthening of BCC Chemically Complex Alloys. Acta Materialia, 209, p.116758.\n-------\nOptional tags:\n"savefile": output filename, CSV file. \n\nEND\n') else: print('NOT a valid name. Available input formats: \nFCC_BCC_Edge_Ternary\nFCC_BCC_Edge_Composition_Temperature\nBCC_Screw_Curtin_Ternary\nBCC_Screw_Curtin_Composition_Temperature\nBCC_Screw_Suzuki_Temperature\nBCC_Screw_Suzuki_Ternary\n')
def main(): a = float(input("Number a: ")) b = float(input("Number b: ")) if a > b: print("A > b") elif a < b: print("A < B") else: print("A = B") if __name__ == '__main__': main()
def main(): a = float(input('Number a: ')) b = float(input('Number b: ')) if a > b: print('A > b') elif a < b: print('A < B') else: print('A = B') if __name__ == '__main__': main()
class AuthSigner(object): """Signer for use with authenticated ADB, introduced in 4.4.x/KitKat.""" def sign(self, data): """Signs given data using a private key.""" raise NotImplementedError() def get_public_key(self): """Returns the public key in PEM format without headers or newlines.""" raise NotImplementedError() class AdbClient(object): def connect(self): raise NotImplementedError() def auth(self, message): raise NotImplementedError() def open(self, local_id, destination): pass def send(self, message): raise NotImplementedError() def send_okay(self, message): raise NotImplementedError() def read(self): raise NotImplementedError() class Handler(object): def __init__(self): self.handle = None def open(self): raise NotImplementedError() def read(self, length): raise NotImplementedError() def write(self, data): raise NotImplementedError() def close(self): raise NotImplementedError()
class Authsigner(object): """Signer for use with authenticated ADB, introduced in 4.4.x/KitKat.""" def sign(self, data): """Signs given data using a private key.""" raise not_implemented_error() def get_public_key(self): """Returns the public key in PEM format without headers or newlines.""" raise not_implemented_error() class Adbclient(object): def connect(self): raise not_implemented_error() def auth(self, message): raise not_implemented_error() def open(self, local_id, destination): pass def send(self, message): raise not_implemented_error() def send_okay(self, message): raise not_implemented_error() def read(self): raise not_implemented_error() class Handler(object): def __init__(self): self.handle = None def open(self): raise not_implemented_error() def read(self, length): raise not_implemented_error() def write(self, data): raise not_implemented_error() def close(self): raise not_implemented_error()
# MYSQL CREDENTIALS mysql_user = "root" mysql_pass = "clickhouse" # MYSQL8 CREDENTIALS mysql8_user = "root" mysql8_pass = "clickhouse" # POSTGRES CREDENTIALS pg_user = "postgres" pg_pass = "mysecretpassword" pg_db = "postgres" # MINIO CREDENTIALS minio_access_key = "minio" minio_secret_key = "minio123" # MONGODB CREDENTIALS mongo_user = "root" mongo_pass = "clickhouse" # ODBC CREDENTIALS odbc_mysql_uid = "root" odbc_mysql_pass = "clickhouse" odbc_mysql_db = "clickhouse" odbc_psql_db = "postgres" odbc_psql_user = "postgres" odbc_psql_pass = "mysecretpassword"
mysql_user = 'root' mysql_pass = 'clickhouse' mysql8_user = 'root' mysql8_pass = 'clickhouse' pg_user = 'postgres' pg_pass = 'mysecretpassword' pg_db = 'postgres' minio_access_key = 'minio' minio_secret_key = 'minio123' mongo_user = 'root' mongo_pass = 'clickhouse' odbc_mysql_uid = 'root' odbc_mysql_pass = 'clickhouse' odbc_mysql_db = 'clickhouse' odbc_psql_db = 'postgres' odbc_psql_user = 'postgres' odbc_psql_pass = 'mysecretpassword'
# Find cure root using bisection search num = 43 eps = 1e-6 iteration = 0 croot = num/2 _high = num _low = 1 while abs(croot**3-num)>eps: iteration+=1 cube = croot**3 if cube==num: print(f'At Iteration {iteration} : Found It!, the cube root for {num} is {croot}') break elif cube>num: _high = croot elif cube<num: _low = croot print(f'At Iteration {iteration} : the cube root aproximation for {num} is {croot}') croot=(_high+_low)/2
num = 43 eps = 1e-06 iteration = 0 croot = num / 2 _high = num _low = 1 while abs(croot ** 3 - num) > eps: iteration += 1 cube = croot ** 3 if cube == num: print(f'At Iteration {iteration} : Found It!, the cube root for {num} is {croot}') break elif cube > num: _high = croot elif cube < num: _low = croot print(f'At Iteration {iteration} : the cube root aproximation for {num} is {croot}') croot = (_high + _low) / 2
level = 3 name = 'Kertasari' capital = 'Cibeureum' area = 152.07
level = 3 name = 'Kertasari' capital = 'Cibeureum' area = 152.07
#!/bin/python3 """ If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. """ def multiples_of_3_5(stop): """Compute sum numbers in range(1, stop) if numbers are divided by 3 or 5.""" # numbers divided by 3 or 5 make cycle length 15. frames = (stop - 1) // 15 # multiples for the first frame: 1-15 multiples = [i for i in range(1, 15 + 1) if i % 3 == 0 or i % 5 == 0] frame_sum = sum(multiples) # every next frame has sum increase 15 for every sum element frame_increase = 15 * len(multiples) # compute 0*frame_increase + 1*frame_increase + .... + (frames - 1) * frame_increase # use equation for sum integers from 1 to n-1 which is n * (n - 1) /2 s = frames * frame_sum + (frames - 1) * frames // 2 * frame_increase # add sum for ending part which is not full frame for k in range(frames * 15 + 1, stop): if k % 3 == 0 or k % 5 == 0: s += k return s if __name__ == "__main__": # print(multiples_of_3_5(1000)) t = int(input().strip()) for _ in range(t): n = int(input().strip()) print(multiples_of_3_5(n))
""" If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. """ def multiples_of_3_5(stop): """Compute sum numbers in range(1, stop) if numbers are divided by 3 or 5.""" frames = (stop - 1) // 15 multiples = [i for i in range(1, 15 + 1) if i % 3 == 0 or i % 5 == 0] frame_sum = sum(multiples) frame_increase = 15 * len(multiples) s = frames * frame_sum + (frames - 1) * frames // 2 * frame_increase for k in range(frames * 15 + 1, stop): if k % 3 == 0 or k % 5 == 0: s += k return s if __name__ == '__main__': t = int(input().strip()) for _ in range(t): n = int(input().strip()) print(multiples_of_3_5(n))
class IllegalValueException(Exception): def __init__(self, message): super().__init__(message) class IllegalCurrencyException(Exception): def __init__(self, message): super().__init__(message) class IllegalCoinException(Exception): def __init__(self, message): super().__init__(message) class IllegalNumberOfProductsException(Exception): def __init__(self, message): super().__init__(message) class IllegalAmountOfProductsException(Exception): def __init__(self, message): super().__init__(message)
class Illegalvalueexception(Exception): def __init__(self, message): super().__init__(message) class Illegalcurrencyexception(Exception): def __init__(self, message): super().__init__(message) class Illegalcoinexception(Exception): def __init__(self, message): super().__init__(message) class Illegalnumberofproductsexception(Exception): def __init__(self, message): super().__init__(message) class Illegalamountofproductsexception(Exception): def __init__(self, message): super().__init__(message)
class Solution(object): def maxProfit(self, k, prices): """ :type k: int :type prices: List[int] :rtype: int """ n = len(prices) if k >= n/2: ret = 0 for i in xrange(1, n): ret += max(prices[i]-prices[i-1], 0) return ret local_table = [0] * (k+1) global_table = [0] * (k+1) for i in xrange(1, n): diff = prices[i]-prices[i-1] for j in xrange(k, 0, -1): local_table[j] = max(global_table[j-1]+max(diff, 0), local_table[j]+diff) global_table[j] = max(global_table[j], local_table[j]) return global_table[-1]
class Solution(object): def max_profit(self, k, prices): """ :type k: int :type prices: List[int] :rtype: int """ n = len(prices) if k >= n / 2: ret = 0 for i in xrange(1, n): ret += max(prices[i] - prices[i - 1], 0) return ret local_table = [0] * (k + 1) global_table = [0] * (k + 1) for i in xrange(1, n): diff = prices[i] - prices[i - 1] for j in xrange(k, 0, -1): local_table[j] = max(global_table[j - 1] + max(diff, 0), local_table[j] + diff) global_table[j] = max(global_table[j], local_table[j]) return global_table[-1]
class Solution: @lru_cache(None) def numRollsToTarget(self, d: int, f: int, target: int) -> int: if d==1: if f>=target:return 1 return 0 count=0 for i in range(1,f+1): if i<target: count += self.numRollsToTarget(d-1,f,target-i) return count%(10**9 + 7)
class Solution: @lru_cache(None) def num_rolls_to_target(self, d: int, f: int, target: int) -> int: if d == 1: if f >= target: return 1 return 0 count = 0 for i in range(1, f + 1): if i < target: count += self.numRollsToTarget(d - 1, f, target - i) return count % (10 ** 9 + 7)
# Tags: Implementation # Difficulty: 1.5 # Priority: 5 # Date: 08-06-2017 hh, mm = map(int, input().split(':')) a = int( input() ) % ( 60 * 24 ) mm += a hh += mm // 60 mm %= 60 hh %= 24 print('%0.2d:%0.2d' %(hh, mm))
(hh, mm) = map(int, input().split(':')) a = int(input()) % (60 * 24) mm += a hh += mm // 60 mm %= 60 hh %= 24 print('%0.2d:%0.2d' % (hh, mm))
# # PySNMP MIB module HUAWEI-BRAS-SRVCFG-DEVICE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-BRAS-SRVCFG-DEVICE-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:43:28 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion") hwBRASMib, = mibBuilder.importSymbols("HUAWEI-MIB", "hwBRASMib") InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex") mplsVpnVrfName, = mibBuilder.importSymbols("MPLS-VPN-MIB", "mplsVpnVrfName") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") iso, Counter32, NotificationType, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, Gauge32, Unsigned32, ObjectIdentity, MibIdentifier, IpAddress, Integer32, Counter64, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "Counter32", "NotificationType", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "Gauge32", "Unsigned32", "ObjectIdentity", "MibIdentifier", "IpAddress", "Integer32", "Counter64", "Bits") MacAddress, TruthValue, TextualConvention, RowStatus, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "TruthValue", "TextualConvention", "RowStatus", "DisplayString") hwBRASSrvcfgDevice = ModuleIdentity((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6)) if mibBuilder.loadTexts: hwBRASSrvcfgDevice.setLastUpdated('200403041608Z') if mibBuilder.loadTexts: hwBRASSrvcfgDevice.setOrganization('Huawei Technologies Co., Ltd. ') if mibBuilder.loadTexts: hwBRASSrvcfgDevice.setContactInfo(' NanJing Institute,Huawei Technologies Co.,Ltd. HuiHong Mansion,No.91 BaiXia Rd. NanJing, P.R. of China Zipcode:210001 Http://www.huawei.com E-mail:support@huawei.com ') if mibBuilder.loadTexts: hwBRASSrvcfgDevice.setDescription('The MIB contains objects of module SRVCFG.') hwSrvcfgDeviceMibObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1)) hwDeviceUserTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1), ) if mibBuilder.loadTexts: hwDeviceUserTable.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserTable.setDescription('The table of device user.') hwDeviceUserEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1), ).setIndexNames((0, "MPLS-VPN-MIB", "mplsVpnVrfName"), (0, "HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserStartIpAddr")) if mibBuilder.loadTexts: hwDeviceUserEntry.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserEntry.setDescription('Description.') hwDeviceUserStartIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwDeviceUserStartIpAddr.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserStartIpAddr.setDescription('The start ip address of device user.') hwDeviceUserEndIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 2), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserEndIpAddr.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserEndIpAddr.setDescription('The end ip address of device user.') hwDeviceUserIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 3), InterfaceIndex()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserIfIndex.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserIfIndex.setDescription('The index of interface which device user was in.') hwDeviceUserIfName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 47))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwDeviceUserIfName.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserIfName.setDescription('The name of interface.') hwDeviceUserVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserVlan.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVlan.setDescription('The vlan of device user.') hwDeviceUserVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserVpi.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVpi.setDescription('The vpi of device user.') hwDeviceUserVci = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65534))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserVci.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVci.setDescription('The vci of device user.') hwDeviceUserMac = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 8), MacAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserMac.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserMac.setDescription('The MAC address of device user.') hwDeviceUserDomain = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 200))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserDomain.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserDomain.setDescription('The domain which device user was part of.') hwDeviceUserStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("ready", 0), ("detecting", 1), ("deleting", 2), ("online", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwDeviceUserStatus.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserStatus.setDescription('The status of device user.') hwDeviceUserRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 11), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwDeviceUserRowStatus.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserRowStatus.setDescription('The row status of device user.') hwDeviceQinQUserVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceQinQUserVlan.setStatus('current') if mibBuilder.loadTexts: hwDeviceQinQUserVlan.setDescription('The QinQ vlan of device user.') hwDeviceUserTableV2 = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2), ) if mibBuilder.loadTexts: hwDeviceUserTableV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserTableV2.setDescription('The table of device user.(V2)') hwDeviceUserEntryV2 = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1), ).setIndexNames((0, "HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserVrfNameV2"), (0, "HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserStartIpAddrV2")) if mibBuilder.loadTexts: hwDeviceUserEntryV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserEntryV2.setDescription('Description.(V2)') hwDeviceUserStartIpAddrV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwDeviceUserStartIpAddrV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserStartIpAddrV2.setDescription('The start ip address of device user.(V2)') hwDeviceUserEndIpAddrV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 2), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserEndIpAddrV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserEndIpAddrV2.setDescription('The end ip address of device user.(V2)') hwDeviceUserIfIndexV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 3), InterfaceIndex()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserIfIndexV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserIfIndexV2.setDescription('The index of interface which device user was in.(V2)') hwDeviceUserIfNameV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 47))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwDeviceUserIfNameV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserIfNameV2.setDescription('The name of interface.(V2)') hwDeviceUserVlanV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserVlanV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVlanV2.setDescription('The vlan of device user.(V2)') hwDeviceUserVpiV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserVpiV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVpiV2.setDescription('The vpi of device user.(V2)') hwDeviceUserVciV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65534))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserVciV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVciV2.setDescription('The vci of device user.(V2)') hwDeviceUserMacV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 8), MacAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserMacV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserMacV2.setDescription('The MAC address of device user.(V2)') hwDeviceUserDomainV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceUserDomainV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserDomainV2.setDescription('The domain which device user was part of.(V2)') hwDeviceUserStatusV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("ready", 0), ("detecting", 1), ("deleting", 2), ("online", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwDeviceUserStatusV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserStatusV2.setDescription('The status of device user.(V2)') hwDeviceUserRowStatusV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 11), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwDeviceUserRowStatusV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserRowStatusV2.setDescription('The row status of device user.(V2)') hwDeviceQinQUserVlanV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwDeviceQinQUserVlanV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceQinQUserVlanV2.setDescription('The QinQ vlan of device user.(V2)') hwDeviceUserVrfNameV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwDeviceUserVrfNameV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVrfNameV2.setDescription('The vpn instance of device user.(V2)') hwSrvcfgDeviceConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2)) hwSrvcfgDeviceCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2, 1)) hwSrvcfgDeviceCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2, 1, 1)).setObjects(("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserGroup"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserV2Group")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwSrvcfgDeviceCompliance = hwSrvcfgDeviceCompliance.setStatus('current') if mibBuilder.loadTexts: hwSrvcfgDeviceCompliance.setDescription('The compliance statement for systems supporting the this module.') hwDeviceUserGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2, 2)) hwDeviceUserGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2, 2, 1)).setObjects(("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserStartIpAddr"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserEndIpAddr"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserIfIndex"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserIfName"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserVlan"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserVpi"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserVci"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserMac"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserDomain"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserStatus"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserRowStatus"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceQinQUserVlan")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwDeviceUserGroup = hwDeviceUserGroup.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserGroup.setDescription('The Device User group.') hwDeviceUserV2Group = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2, 2, 2)).setObjects(("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserStartIpAddrV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserEndIpAddrV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserIfIndexV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserIfNameV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserVlanV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserVpiV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserVciV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserMacV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserDomainV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserStatusV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserRowStatusV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceQinQUserVlanV2"), ("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", "hwDeviceUserVrfNameV2")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwDeviceUserV2Group = hwDeviceUserV2Group.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserV2Group.setDescription('The Device User group.(V2)') mibBuilder.exportSymbols("HUAWEI-BRAS-SRVCFG-DEVICE-MIB", hwDeviceUserIfIndexV2=hwDeviceUserIfIndexV2, hwDeviceUserMac=hwDeviceUserMac, hwDeviceUserStatusV2=hwDeviceUserStatusV2, hwDeviceUserVlanV2=hwDeviceUserVlanV2, hwDeviceUserStartIpAddrV2=hwDeviceUserStartIpAddrV2, hwDeviceUserGroup=hwDeviceUserGroup, hwDeviceUserTableV2=hwDeviceUserTableV2, hwDeviceUserEntry=hwDeviceUserEntry, hwDeviceUserTable=hwDeviceUserTable, hwDeviceUserVci=hwDeviceUserVci, hwDeviceQinQUserVlanV2=hwDeviceQinQUserVlanV2, hwDeviceUserVlan=hwDeviceUserVlan, hwDeviceUserVrfNameV2=hwDeviceUserVrfNameV2, hwDeviceUserMacV2=hwDeviceUserMacV2, hwDeviceUserIfNameV2=hwDeviceUserIfNameV2, hwDeviceUserStartIpAddr=hwDeviceUserStartIpAddr, hwSrvcfgDeviceConformance=hwSrvcfgDeviceConformance, hwDeviceUserRowStatusV2=hwDeviceUserRowStatusV2, hwDeviceUserEndIpAddr=hwDeviceUserEndIpAddr, hwSrvcfgDeviceCompliances=hwSrvcfgDeviceCompliances, hwSrvcfgDeviceCompliance=hwSrvcfgDeviceCompliance, hwDeviceUserEntryV2=hwDeviceUserEntryV2, hwDeviceUserVpiV2=hwDeviceUserVpiV2, hwDeviceUserVciV2=hwDeviceUserVciV2, hwDeviceUserDomain=hwDeviceUserDomain, hwDeviceUserStatus=hwDeviceUserStatus, hwDeviceUserGroups=hwDeviceUserGroups, hwBRASSrvcfgDevice=hwBRASSrvcfgDevice, hwDeviceUserDomainV2=hwDeviceUserDomainV2, hwSrvcfgDeviceMibObjects=hwSrvcfgDeviceMibObjects, hwDeviceUserIfIndex=hwDeviceUserIfIndex, hwDeviceUserIfName=hwDeviceUserIfName, hwDeviceUserRowStatus=hwDeviceUserRowStatus, hwDeviceUserEndIpAddrV2=hwDeviceUserEndIpAddrV2, hwDeviceUserVpi=hwDeviceUserVpi, PYSNMP_MODULE_ID=hwBRASSrvcfgDevice, hwDeviceQinQUserVlan=hwDeviceQinQUserVlan, hwDeviceUserV2Group=hwDeviceUserV2Group)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, constraints_intersection, single_value_constraint, value_size_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsUnion') (hw_bras_mib,) = mibBuilder.importSymbols('HUAWEI-MIB', 'hwBRASMib') (interface_index,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex') (mpls_vpn_vrf_name,) = mibBuilder.importSymbols('MPLS-VPN-MIB', 'mplsVpnVrfName') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (iso, counter32, notification_type, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, gauge32, unsigned32, object_identity, mib_identifier, ip_address, integer32, counter64, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'Counter32', 'NotificationType', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'Gauge32', 'Unsigned32', 'ObjectIdentity', 'MibIdentifier', 'IpAddress', 'Integer32', 'Counter64', 'Bits') (mac_address, truth_value, textual_convention, row_status, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'MacAddress', 'TruthValue', 'TextualConvention', 'RowStatus', 'DisplayString') hw_bras_srvcfg_device = module_identity((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6)) if mibBuilder.loadTexts: hwBRASSrvcfgDevice.setLastUpdated('200403041608Z') if mibBuilder.loadTexts: hwBRASSrvcfgDevice.setOrganization('Huawei Technologies Co., Ltd. ') if mibBuilder.loadTexts: hwBRASSrvcfgDevice.setContactInfo(' NanJing Institute,Huawei Technologies Co.,Ltd. HuiHong Mansion,No.91 BaiXia Rd. NanJing, P.R. of China Zipcode:210001 Http://www.huawei.com E-mail:support@huawei.com ') if mibBuilder.loadTexts: hwBRASSrvcfgDevice.setDescription('The MIB contains objects of module SRVCFG.') hw_srvcfg_device_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1)) hw_device_user_table = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1)) if mibBuilder.loadTexts: hwDeviceUserTable.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserTable.setDescription('The table of device user.') hw_device_user_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1)).setIndexNames((0, 'MPLS-VPN-MIB', 'mplsVpnVrfName'), (0, 'HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserStartIpAddr')) if mibBuilder.loadTexts: hwDeviceUserEntry.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserEntry.setDescription('Description.') hw_device_user_start_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: hwDeviceUserStartIpAddr.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserStartIpAddr.setDescription('The start ip address of device user.') hw_device_user_end_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 2), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserEndIpAddr.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserEndIpAddr.setDescription('The end ip address of device user.') hw_device_user_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 3), interface_index()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserIfIndex.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserIfIndex.setDescription('The index of interface which device user was in.') hw_device_user_if_name = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(1, 47))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwDeviceUserIfName.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserIfName.setDescription('The name of interface.') hw_device_user_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 4094))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserVlan.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVlan.setDescription('The vlan of device user.') hw_device_user_vpi = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserVpi.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVpi.setDescription('The vpi of device user.') hw_device_user_vci = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 65534))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserVci.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVci.setDescription('The vci of device user.') hw_device_user_mac = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 8), mac_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserMac.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserMac.setDescription('The MAC address of device user.') hw_device_user_domain = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 9), display_string().subtype(subtypeSpec=value_size_constraint(1, 200))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserDomain.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserDomain.setDescription('The domain which device user was part of.') hw_device_user_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('ready', 0), ('detecting', 1), ('deleting', 2), ('online', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwDeviceUserStatus.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserStatus.setDescription('The status of device user.') hw_device_user_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 11), row_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwDeviceUserRowStatus.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserRowStatus.setDescription('The row status of device user.') hw_device_qin_q_user_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 1, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 4094))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceQinQUserVlan.setStatus('current') if mibBuilder.loadTexts: hwDeviceQinQUserVlan.setDescription('The QinQ vlan of device user.') hw_device_user_table_v2 = mib_table((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2)) if mibBuilder.loadTexts: hwDeviceUserTableV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserTableV2.setDescription('The table of device user.(V2)') hw_device_user_entry_v2 = mib_table_row((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1)).setIndexNames((0, 'HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserVrfNameV2'), (0, 'HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserStartIpAddrV2')) if mibBuilder.loadTexts: hwDeviceUserEntryV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserEntryV2.setDescription('Description.(V2)') hw_device_user_start_ip_addr_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: hwDeviceUserStartIpAddrV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserStartIpAddrV2.setDescription('The start ip address of device user.(V2)') hw_device_user_end_ip_addr_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 2), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserEndIpAddrV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserEndIpAddrV2.setDescription('The end ip address of device user.(V2)') hw_device_user_if_index_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 3), interface_index()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserIfIndexV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserIfIndexV2.setDescription('The index of interface which device user was in.(V2)') hw_device_user_if_name_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(1, 47))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwDeviceUserIfNameV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserIfNameV2.setDescription('The name of interface.(V2)') hw_device_user_vlan_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 4094))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserVlanV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVlanV2.setDescription('The vlan of device user.(V2)') hw_device_user_vpi_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserVpiV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVpiV2.setDescription('The vpi of device user.(V2)') hw_device_user_vci_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 65534))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserVciV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVciV2.setDescription('The vci of device user.(V2)') hw_device_user_mac_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 8), mac_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserMacV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserMacV2.setDescription('The MAC address of device user.(V2)') hw_device_user_domain_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 9), display_string().subtype(subtypeSpec=value_size_constraint(1, 64))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceUserDomainV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserDomainV2.setDescription('The domain which device user was part of.(V2)') hw_device_user_status_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('ready', 0), ('detecting', 1), ('deleting', 2), ('online', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwDeviceUserStatusV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserStatusV2.setDescription('The status of device user.(V2)') hw_device_user_row_status_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 11), row_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hwDeviceUserRowStatusV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserRowStatusV2.setDescription('The row status of device user.(V2)') hw_device_qin_q_user_vlan_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 4094))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hwDeviceQinQUserVlanV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceQinQUserVlanV2.setDescription('The QinQ vlan of device user.(V2)') hw_device_user_vrf_name_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 1, 2, 1, 13), display_string().subtype(subtypeSpec=value_size_constraint(1, 31))).setMaxAccess('readonly') if mibBuilder.loadTexts: hwDeviceUserVrfNameV2.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserVrfNameV2.setDescription('The vpn instance of device user.(V2)') hw_srvcfg_device_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2)) hw_srvcfg_device_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2, 1)) hw_srvcfg_device_compliance = module_compliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2, 1, 1)).setObjects(('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserGroup'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserV2Group')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hw_srvcfg_device_compliance = hwSrvcfgDeviceCompliance.setStatus('current') if mibBuilder.loadTexts: hwSrvcfgDeviceCompliance.setDescription('The compliance statement for systems supporting the this module.') hw_device_user_groups = mib_identifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2, 2)) hw_device_user_group = object_group((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2, 2, 1)).setObjects(('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserStartIpAddr'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserEndIpAddr'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserIfIndex'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserIfName'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserVlan'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserVpi'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserVci'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserMac'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserDomain'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserStatus'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserRowStatus'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceQinQUserVlan')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hw_device_user_group = hwDeviceUserGroup.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserGroup.setDescription('The Device User group.') hw_device_user_v2_group = object_group((1, 3, 6, 1, 4, 1, 2011, 5, 25, 40, 6, 2, 2, 2)).setObjects(('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserStartIpAddrV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserEndIpAddrV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserIfIndexV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserIfNameV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserVlanV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserVpiV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserVciV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserMacV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserDomainV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserStatusV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserRowStatusV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceQinQUserVlanV2'), ('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', 'hwDeviceUserVrfNameV2')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hw_device_user_v2_group = hwDeviceUserV2Group.setStatus('current') if mibBuilder.loadTexts: hwDeviceUserV2Group.setDescription('The Device User group.(V2)') mibBuilder.exportSymbols('HUAWEI-BRAS-SRVCFG-DEVICE-MIB', hwDeviceUserIfIndexV2=hwDeviceUserIfIndexV2, hwDeviceUserMac=hwDeviceUserMac, hwDeviceUserStatusV2=hwDeviceUserStatusV2, hwDeviceUserVlanV2=hwDeviceUserVlanV2, hwDeviceUserStartIpAddrV2=hwDeviceUserStartIpAddrV2, hwDeviceUserGroup=hwDeviceUserGroup, hwDeviceUserTableV2=hwDeviceUserTableV2, hwDeviceUserEntry=hwDeviceUserEntry, hwDeviceUserTable=hwDeviceUserTable, hwDeviceUserVci=hwDeviceUserVci, hwDeviceQinQUserVlanV2=hwDeviceQinQUserVlanV2, hwDeviceUserVlan=hwDeviceUserVlan, hwDeviceUserVrfNameV2=hwDeviceUserVrfNameV2, hwDeviceUserMacV2=hwDeviceUserMacV2, hwDeviceUserIfNameV2=hwDeviceUserIfNameV2, hwDeviceUserStartIpAddr=hwDeviceUserStartIpAddr, hwSrvcfgDeviceConformance=hwSrvcfgDeviceConformance, hwDeviceUserRowStatusV2=hwDeviceUserRowStatusV2, hwDeviceUserEndIpAddr=hwDeviceUserEndIpAddr, hwSrvcfgDeviceCompliances=hwSrvcfgDeviceCompliances, hwSrvcfgDeviceCompliance=hwSrvcfgDeviceCompliance, hwDeviceUserEntryV2=hwDeviceUserEntryV2, hwDeviceUserVpiV2=hwDeviceUserVpiV2, hwDeviceUserVciV2=hwDeviceUserVciV2, hwDeviceUserDomain=hwDeviceUserDomain, hwDeviceUserStatus=hwDeviceUserStatus, hwDeviceUserGroups=hwDeviceUserGroups, hwBRASSrvcfgDevice=hwBRASSrvcfgDevice, hwDeviceUserDomainV2=hwDeviceUserDomainV2, hwSrvcfgDeviceMibObjects=hwSrvcfgDeviceMibObjects, hwDeviceUserIfIndex=hwDeviceUserIfIndex, hwDeviceUserIfName=hwDeviceUserIfName, hwDeviceUserRowStatus=hwDeviceUserRowStatus, hwDeviceUserEndIpAddrV2=hwDeviceUserEndIpAddrV2, hwDeviceUserVpi=hwDeviceUserVpi, PYSNMP_MODULE_ID=hwBRASSrvcfgDevice, hwDeviceQinQUserVlan=hwDeviceQinQUserVlan, hwDeviceUserV2Group=hwDeviceUserV2Group)
class Solution: def findOrder(self, numCourses: int, prerequisites: List[List[int]]) -> List[int]: child = collections.defaultdict(set) parent = collections.defaultdict(int) for c, p in prerequisites: child[p].add(c) parent[c] +=1 q = collections.deque() for i in range(numCourses): if parent[i] == 0: q.append(i) del parent[i] res = [] while q: course = q.popleft() res.append(course) for ch in child[course]: parent[ch] -= 1 if parent[ch] == 0: q.append(ch) del parent[ch] return res if len(res) == numCourses else []
class Solution: def find_order(self, numCourses: int, prerequisites: List[List[int]]) -> List[int]: child = collections.defaultdict(set) parent = collections.defaultdict(int) for (c, p) in prerequisites: child[p].add(c) parent[c] += 1 q = collections.deque() for i in range(numCourses): if parent[i] == 0: q.append(i) del parent[i] res = [] while q: course = q.popleft() res.append(course) for ch in child[course]: parent[ch] -= 1 if parent[ch] == 0: q.append(ch) del parent[ch] return res if len(res) == numCourses else []
''' URL: https://leetcode.com/problems/monotonic-array/ Difficulty: Easy Title: Monotonic Array ''' ################### Code ################### class Solution: def isMonotonic(self, A: List[int]) -> bool: if len(A) in [1, 2]: return True cmp = None for i in range(len(A) - 1): diff = A[i+1] - A[i] if diff != 0: if cmp is None: cmp = diff else: if not cmp * diff > 0: return False return True
""" URL: https://leetcode.com/problems/monotonic-array/ Difficulty: Easy Title: Monotonic Array """ class Solution: def is_monotonic(self, A: List[int]) -> bool: if len(A) in [1, 2]: return True cmp = None for i in range(len(A) - 1): diff = A[i + 1] - A[i] if diff != 0: if cmp is None: cmp = diff elif not cmp * diff > 0: return False return True
#NUMBERS 10 #Numero Entero (integer) 10.4 #Numero Flotante (float) print(type(10)) print(type(10.4)) #INPUT age = input('Coloque su edad: ') print(type(age)) new_age = int(age) + 5 print(new_age)
10 10.4 print(type(10)) print(type(10.4)) age = input('Coloque su edad: ') print(type(age)) new_age = int(age) + 5 print(new_age)
''' In this problem, we should define dummy and cur as a listNode(0). Let dummy points to the start of cur. Everytime when we update cur.next, cur will move to cur.next. And if the length of l1 and l2 is not equal, cur.next points to the left list l1 or l2. Tips: It is like two pointers. But it is done with node. ''' # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def mergeTwoLists(self, l1, l2): """ :type l1: ListNode :type l2: ListNode :rtype: ListNode """ head1 = l1 head2 = l2 cur = dummy= ListNode(0) while head1 and head2: if head1.val > head2.val: cur.next = head2 head2 = head2.next else: cur.next = head1 head1 = head1.next cur = cur.next cur.next = head1 or head2 return dummy.next
""" In this problem, we should define dummy and cur as a listNode(0). Let dummy points to the start of cur. Everytime when we update cur.next, cur will move to cur.next. And if the length of l1 and l2 is not equal, cur.next points to the left list l1 or l2. Tips: It is like two pointers. But it is done with node. """ class Solution: def merge_two_lists(self, l1, l2): """ :type l1: ListNode :type l2: ListNode :rtype: ListNode """ head1 = l1 head2 = l2 cur = dummy = list_node(0) while head1 and head2: if head1.val > head2.val: cur.next = head2 head2 = head2.next else: cur.next = head1 head1 = head1.next cur = cur.next cur.next = head1 or head2 return dummy.next
transactions_count = int(input('Enter number of transactions: ')) total = 0 while True: if transactions_count <= 0: break transactions_cash = float(input('Enter transactions amount: ')) if transactions_cash >= 1: total += transactions_cash transactions_count -= 1 continue print('Invalid operation!') break print(f'Total: {total:.2f}')
transactions_count = int(input('Enter number of transactions: ')) total = 0 while True: if transactions_count <= 0: break transactions_cash = float(input('Enter transactions amount: ')) if transactions_cash >= 1: total += transactions_cash transactions_count -= 1 continue print('Invalid operation!') break print(f'Total: {total:.2f}')
class dotRebarSplice_t(object): # no doc BarPositions=None Clearance=None LapLength=None ModelObject=None Offset=None Reinforcement1=None Reinforcement2=None Type=None
class Dotrebarsplice_T(object): bar_positions = None clearance = None lap_length = None model_object = None offset = None reinforcement1 = None reinforcement2 = None type = None
# coding: utf-8 MAX_INT = 2147483647 MIN_INT = -2147483648 class Solution(object): def myAtoi(self, input_string): """ :type input_string: str :rtype: int """ number = 0 sign = 1 i = 0 length = len(input_string) while i < length and input_string[i].isspace(): i += 1 if i < length and input_string[i] in ('-', '+'): sign = -1 if input_string[i] == '-' else 1 i += 1 while i < length and input_string[i].isdigit(): number = number * 10 + ord(input_string[i]) - ord('0') if sign * number > MAX_INT: return MAX_INT if sign * number < MIN_INT: return MIN_INT i += 1 return sign * number if __name__ == '__main__': assert Solution().myAtoi('') == 0 assert Solution().myAtoi(' ') == 0 assert Solution().myAtoi(' asdfas ') == 0 assert Solution().myAtoi(' asdfas12341') == 0 assert Solution().myAtoi(' asdfas+12341') == 0 assert Solution().myAtoi(' +asdfas+12341') == 0 assert Solution().myAtoi(' -asdfas+12341') == 0 assert Solution().myAtoi('0') == 0 assert Solution().myAtoi('0number') == 0 assert Solution().myAtoi('+0number') == 0 assert Solution().myAtoi('1234') == 1234 assert Solution().myAtoi('+1234') == 1234 assert Solution().myAtoi('-1234asdf') == -1234 assert Solution().myAtoi('123412341234123413241234') == MAX_INT assert Solution().myAtoi('-123412341234123413241234asdfasfasdfsa') == MIN_INT
max_int = 2147483647 min_int = -2147483648 class Solution(object): def my_atoi(self, input_string): """ :type input_string: str :rtype: int """ number = 0 sign = 1 i = 0 length = len(input_string) while i < length and input_string[i].isspace(): i += 1 if i < length and input_string[i] in ('-', '+'): sign = -1 if input_string[i] == '-' else 1 i += 1 while i < length and input_string[i].isdigit(): number = number * 10 + ord(input_string[i]) - ord('0') if sign * number > MAX_INT: return MAX_INT if sign * number < MIN_INT: return MIN_INT i += 1 return sign * number if __name__ == '__main__': assert solution().myAtoi('') == 0 assert solution().myAtoi(' ') == 0 assert solution().myAtoi(' asdfas ') == 0 assert solution().myAtoi(' asdfas12341') == 0 assert solution().myAtoi(' asdfas+12341') == 0 assert solution().myAtoi(' +asdfas+12341') == 0 assert solution().myAtoi(' -asdfas+12341') == 0 assert solution().myAtoi('0') == 0 assert solution().myAtoi('0number') == 0 assert solution().myAtoi('+0number') == 0 assert solution().myAtoi('1234') == 1234 assert solution().myAtoi('+1234') == 1234 assert solution().myAtoi('-1234asdf') == -1234 assert solution().myAtoi('123412341234123413241234') == MAX_INT assert solution().myAtoi('-123412341234123413241234asdfasfasdfsa') == MIN_INT
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode: dummy = l3 = ListNode(0) while l1 and l2: if l1.val > l2.val: l3.next = ListNode(l2.val) l3 = l3.next l2 = l2.next else: l3.next = ListNode(l1.val) l3 = l3.next l1 = l1.next while l1: l3.next = ListNode(l1.val) l3 = l3.next l1 = l1.next while l2: l3.next = ListNode(l2.val) l3 = l3.next l2 = l2.next return dummy.next # Slightly More Optimized # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode: head = l3 = ListNode() while l1 and l2: if l1.val < l2.val: l3.next = ListNode(l1.val) l1 = l1.next l3 = l3.next else: l3.next = ListNode(l2.val) l2 = l2.next l3 = l3.next l3.next = l1 or l2 return head.next
class Solution: def merge_two_lists(self, l1: ListNode, l2: ListNode) -> ListNode: dummy = l3 = list_node(0) while l1 and l2: if l1.val > l2.val: l3.next = list_node(l2.val) l3 = l3.next l2 = l2.next else: l3.next = list_node(l1.val) l3 = l3.next l1 = l1.next while l1: l3.next = list_node(l1.val) l3 = l3.next l1 = l1.next while l2: l3.next = list_node(l2.val) l3 = l3.next l2 = l2.next return dummy.next class Solution: def merge_two_lists(self, l1: ListNode, l2: ListNode) -> ListNode: head = l3 = list_node() while l1 and l2: if l1.val < l2.val: l3.next = list_node(l1.val) l1 = l1.next l3 = l3.next else: l3.next = list_node(l2.val) l2 = l2.next l3 = l3.next l3.next = l1 or l2 return head.next
'''https://leetcode.com/problems/remove-duplicates-from-sorted-array/''' # class Solution: # def removeDuplicates(self, nums: List[int]) -> int: # l = len(nums) # ans = 0 # for i in range(1, l): # if nums[i]!=nums[ans]: # ans+=1 # nums[i], nums[ans] = nums[ans], nums[i] # return ans+1 class Solution: def removeDuplicates(self, nums: List[int]) -> int: if len(nums)<2: return len(nums) p1, p2 = 0, 1 while p2<len(nums): if nums[p2]!=nums[p1]: p1+=1 nums[p1] = nums[p2] p2+=1 return p1+1
"""https://leetcode.com/problems/remove-duplicates-from-sorted-array/""" class Solution: def remove_duplicates(self, nums: List[int]) -> int: if len(nums) < 2: return len(nums) (p1, p2) = (0, 1) while p2 < len(nums): if nums[p2] != nums[p1]: p1 += 1 nums[p1] = nums[p2] p2 += 1 return p1 + 1
#!/usr/bin/env python3 def lst_intersection(lst1:list, lst2:list): ''' Source: https://www.geeksforgeeks.org/python-intersection-two-lists/ ''' return [value for value in lst1 if value in set(lst2)] def main(): return lst_intersection(lst1, lst2) if __name__ == "__main__": main()
def lst_intersection(lst1: list, lst2: list): """ Source: https://www.geeksforgeeks.org/python-intersection-two-lists/ """ return [value for value in lst1 if value in set(lst2)] def main(): return lst_intersection(lst1, lst2) if __name__ == '__main__': main()
__author__ = 'huanpc' ######################################################################################################################## HOST = "25.22.28.94" PORT = 3307 USER = "root" PASSWORD = "root" DB = "opencart" TABLE_ADDRESS = 'oc_address' TABLE_CUSTOMER= 'oc_customer' ######################################################################################################################## DIR_OUTPUT_PATH = './Test_plan' # So ban ghi can tao NUM_OF_THREADS = 10 OPENCART_PORT = 10000 RAM_UP = 10 CONFIG_FILE_PATH = DIR_OUTPUT_PATH+'/config.csv' TEST_PLAN_FILE_PATH_1 = DIR_OUTPUT_PATH+'/plan/Opencart_register_'+str(NUM_OF_THREADS)+'.jmx' TEST_PLAN_FILE_PATH_2 = DIR_OUTPUT_PATH+'/plan/Opencart_order_'+str(NUM_OF_THREADS)+'.jmx' CSV_FILE_PATH_1 = DIR_OUTPUT_PATH+'/register_infor.csv' CSV_FILE_PATH_2 = DIR_OUTPUT_PATH+'/order_infor.csv' RESULT_FILE_PATH_1 = './Test_plan/result1.jtl' RESULT_FILE_PATH_2 = './Test_plan/result2.jtl' RUN_JMETER_1 = 'sh ../bin/jmeter -n -t '+TEST_PLAN_FILE_PATH_1+' -l '+RESULT_FILE_PATH_1 RUN_JMETER_2 = 'sh ../bin/jmeter -n -t '+TEST_PLAN_FILE_PATH_2+' -l '+RESULT_FILE_PATH_2 TIME_DELAY = 5 ########################################################################################################################
__author__ = 'huanpc' host = '25.22.28.94' port = 3307 user = 'root' password = 'root' db = 'opencart' table_address = 'oc_address' table_customer = 'oc_customer' dir_output_path = './Test_plan' num_of_threads = 10 opencart_port = 10000 ram_up = 10 config_file_path = DIR_OUTPUT_PATH + '/config.csv' test_plan_file_path_1 = DIR_OUTPUT_PATH + '/plan/Opencart_register_' + str(NUM_OF_THREADS) + '.jmx' test_plan_file_path_2 = DIR_OUTPUT_PATH + '/plan/Opencart_order_' + str(NUM_OF_THREADS) + '.jmx' csv_file_path_1 = DIR_OUTPUT_PATH + '/register_infor.csv' csv_file_path_2 = DIR_OUTPUT_PATH + '/order_infor.csv' result_file_path_1 = './Test_plan/result1.jtl' result_file_path_2 = './Test_plan/result2.jtl' run_jmeter_1 = 'sh ../bin/jmeter -n -t ' + TEST_PLAN_FILE_PATH_1 + ' -l ' + RESULT_FILE_PATH_1 run_jmeter_2 = 'sh ../bin/jmeter -n -t ' + TEST_PLAN_FILE_PATH_2 + ' -l ' + RESULT_FILE_PATH_2 time_delay = 5
def abort_if_false(ctx, param, value): if not value: ctx.abort()
def abort_if_false(ctx, param, value): if not value: ctx.abort()
HOST = "irc.twitch.tv" PORT = 6667 OAUTH = "" # generate from http://www.twitchapps.com/tmi/ IDENT = "" # twitch account for which you used the oauth CHANNEL = ""
host = 'irc.twitch.tv' port = 6667 oauth = '' ident = '' channel = ''
# you can write to stdout for debugging purposes, e.g. # print("this is a debug message") def solution(A): # write your code in Python 3.6 capacity = 5000-A[0] apples = sorted(A[1:]) sum = 0 total = 0 for idx,a in enumerate(apples): if a+sum > capacity: total = idx break else: sum+=a return total if __name__=="__main__": print(solution([4650,150,150,150])==2) print(solution([4850,100,30,30,100,50,100]) == 3)
def solution(A): capacity = 5000 - A[0] apples = sorted(A[1:]) sum = 0 total = 0 for (idx, a) in enumerate(apples): if a + sum > capacity: total = idx break else: sum += a return total if __name__ == '__main__': print(solution([4650, 150, 150, 150]) == 2) print(solution([4850, 100, 30, 30, 100, 50, 100]) == 3)
whole_clinit = [ '\n' '.method static constructor <clinit>()V\n' ' .locals 1\n' '\n' ' :try_start_0\n' ' const-string v0, "nc"\n' '\n' ' invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V\n' ' :try_end_0\n' ' .catch Ljava/lang/UnsatisfiedLinkError; {:try_start_0 .. :try_end_0} :catch_0\n' '\n' ' goto :goto_0\n' '\n' ' :catch_0\n' ' move-exception v0\n' '\n' ' .local v0, "e":Ljava/lang/UnsatisfiedLinkError;\n' ' invoke-virtual {v0}, Ljava/lang/UnsatisfiedLinkError;->printStackTrace()V\n' '\n' ' .end local v0 # "e":Ljava/lang/UnsatisfiedLinkError;\n' ' :goto_0\n' ' return-void\n' '.end method\n' ] insert_clinit = [ '\n' ' :try_start_ab\n' ' const-string v0, "nc"\n' '\n' ' invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V\n' ' :try_end_ab\n' ' .catch Ljava/lang/UnsatisfiedLinkError; {:try_start_ab .. :try_end_ab} :catch_ab\n' '\n' ' goto :goto_ab\n' '\n' ' :catch_ab\n' ' move-exception v0\n' '\n' ' .local v0, "e":Ljava/lang/UnsatisfiedLinkError;\n' ' invoke-virtual {v0}, Ljava/lang/UnsatisfiedLinkError;->printStackTrace()V\n' '\n' ' .end local v0 # "e":Ljava/lang/UnsatisfiedLinkError;\n' ' :goto_ab\n' ]
whole_clinit = ['\n.method static constructor <clinit>()V\n .locals 1\n\n :try_start_0\n const-string v0, "nc"\n\n invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V\n :try_end_0\n .catch Ljava/lang/UnsatisfiedLinkError; {:try_start_0 .. :try_end_0} :catch_0\n\n goto :goto_0\n\n :catch_0\n move-exception v0\n\n .local v0, "e":Ljava/lang/UnsatisfiedLinkError;\n invoke-virtual {v0}, Ljava/lang/UnsatisfiedLinkError;->printStackTrace()V\n\n .end local v0 # "e":Ljava/lang/UnsatisfiedLinkError;\n :goto_0\n return-void\n.end method\n'] insert_clinit = ['\n :try_start_ab\n const-string v0, "nc"\n\n invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V\n :try_end_ab\n .catch Ljava/lang/UnsatisfiedLinkError; {:try_start_ab .. :try_end_ab} :catch_ab\n\n goto :goto_ab\n\n :catch_ab\n move-exception v0\n\n .local v0, "e":Ljava/lang/UnsatisfiedLinkError;\n invoke-virtual {v0}, Ljava/lang/UnsatisfiedLinkError;->printStackTrace()V\n\n .end local v0 # "e":Ljava/lang/UnsatisfiedLinkError;\n :goto_ab\n']
class ValidBlockNetException(Exception): pass
class Validblocknetexception(Exception): pass
''' Given two integer arrays startTime and endTime and given an integer queryTime. The ith student started doing their homework at the time startTime[i] and finished it at time endTime[i]. Return the number of students doing their homework at time queryTime. More formally, return the number of students where queryTime lays in the interval [startTime[i], endTime[i]] inclusive. ''' class Solution: def busyStudent(self, startTime: List[int], endTime: List[int], queryTime: int) -> int: intervals = list(zip(startTime, endTime)) counter = 0 for i in range(len(intervals)): if queryTime >= intervals[i][0] and queryTime <= intervals[i][1]: counter+=1 return counter
""" Given two integer arrays startTime and endTime and given an integer queryTime. The ith student started doing their homework at the time startTime[i] and finished it at time endTime[i]. Return the number of students doing their homework at time queryTime. More formally, return the number of students where queryTime lays in the interval [startTime[i], endTime[i]] inclusive. """ class Solution: def busy_student(self, startTime: List[int], endTime: List[int], queryTime: int) -> int: intervals = list(zip(startTime, endTime)) counter = 0 for i in range(len(intervals)): if queryTime >= intervals[i][0] and queryTime <= intervals[i][1]: counter += 1 return counter
# -*- coding:utf-8 -*- """ @author:SiriYang @file: __init__.py @time: 2019.12.24 20:33 """
""" @author:SiriYang @file: __init__.py @time: 2019.12.24 20:33 """
def as_div(form): """This formatter arranges label, widget, help text and error messages by using divs. Apply to custom form classes, or use to monkey patch form classes not under our direct control.""" # Yes, evil but the easiest way to set this property for all forms. form.required_css_class = 'required' return form._html_output( normal_row=u'<div class="field"><div %(html_class_attr)s>%(label)s %(errors)s <div class="helptext">%(help_text)s</div> %(field)s</div></div>', error_row=u'%s', row_ender='</div>', help_text_html=u'%s', errors_on_separate_row=False )
def as_div(form): """This formatter arranges label, widget, help text and error messages by using divs. Apply to custom form classes, or use to monkey patch form classes not under our direct control.""" form.required_css_class = 'required' return form._html_output(normal_row=u'<div class="field"><div %(html_class_attr)s>%(label)s %(errors)s <div class="helptext">%(help_text)s</div> %(field)s</div></div>', error_row=u'%s', row_ender='</div>', help_text_html=u'%s', errors_on_separate_row=False)
numbers = input('Enter a list of numbers (csv): ').replace(' ','').split(',') numbers = [int(i) for i in numbers] def sum_of_three(numbers): summ = 0 for i in numbers: summ += i return summ print('Sum:', sum_of_three(numbers))
numbers = input('Enter a list of numbers (csv): ').replace(' ', '').split(',') numbers = [int(i) for i in numbers] def sum_of_three(numbers): summ = 0 for i in numbers: summ += i return summ print('Sum:', sum_of_three(numbers))
{ "targets": [{ "target_name" : "test", "defines": [ "V8_DEPRECATION_WARNINGS=1" ], "sources" : [ "test.cpp" ], "include_dirs": ["<!(node -e \"require('..')\")"] }] }
{'targets': [{'target_name': 'test', 'defines': ['V8_DEPRECATION_WARNINGS=1'], 'sources': ['test.cpp'], 'include_dirs': ['<!(node -e "require(\'..\')")']}]}
class QualifierList: def __init__(self, qualifiers): self.qualifiers = qualifiers def insert_qualifier(self, qualifier): self.qualifiers.insert(0, qualifier) def __len__(self): return len(self.qualifiers) def __iter__(self): return self.qualifiers def __str__(self): return " ".join([str(obs) for obs in self.qualifiers])
class Qualifierlist: def __init__(self, qualifiers): self.qualifiers = qualifiers def insert_qualifier(self, qualifier): self.qualifiers.insert(0, qualifier) def __len__(self): return len(self.qualifiers) def __iter__(self): return self.qualifiers def __str__(self): return ' '.join([str(obs) for obs in self.qualifiers])
st = input("enter the string") upCount=0 lowCount=0 vowels=0 # for i in range (0,len(st)): # print(st[i]) for i in range (0,len(st)): # print(st[i]) if(st[i].isupper()): upCount+=1 else: lowCount+=1 for i in range(0,len(st)): if(st[i]=='a') or (st[i]=='A') or (st[i]=='e') or (st[i]=='E') or (st[i]=='i') or (st[i]=='I') or (st[i]=='o') or (st[i]=='O') or (st[i]=='u') or (st[i]=='U'): vowels+=1 print("upper case", upCount) print("lower case", lowCount) print("vowels", vowels)
st = input('enter the string') up_count = 0 low_count = 0 vowels = 0 for i in range(0, len(st)): if st[i].isupper(): up_count += 1 else: low_count += 1 for i in range(0, len(st)): if st[i] == 'a' or st[i] == 'A' or st[i] == 'e' or (st[i] == 'E') or (st[i] == 'i') or (st[i] == 'I') or (st[i] == 'o') or (st[i] == 'O') or (st[i] == 'u') or (st[i] == 'U'): vowels += 1 print('upper case', upCount) print('lower case', lowCount) print('vowels', vowels)
class Solution: def scoreOfParentheses(self, S): """ :type S: str :rtype: int """ cnt, layer = 0, 0 for a, b in zip(S, S[1:]): layer += (1 if a == '(' else -1) if a + b == '()': cnt += 2 ** (layer - 1) return cnt
class Solution: def score_of_parentheses(self, S): """ :type S: str :rtype: int """ (cnt, layer) = (0, 0) for (a, b) in zip(S, S[1:]): layer += 1 if a == '(' else -1 if a + b == '()': cnt += 2 ** (layer - 1) return cnt
def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Gender, obj[4]: Age, obj[5]: Children, obj[6]: Education, obj[7]: Occupation, obj[8]: Income, obj[9]: Bar, obj[10]: Coffeehouse, obj[11]: Restaurant20to50, obj[12]: Direction_same, obj[13]: Distance # {"feature": "Income", "instances": 34, "metric_value": 0.9774, "depth": 1} if obj[8]<=5: # {"feature": "Education", "instances": 22, "metric_value": 0.994, "depth": 2} if obj[6]<=3: # {"feature": "Occupation", "instances": 19, "metric_value": 0.9495, "depth": 3} if obj[7]>2: # {"feature": "Age", "instances": 17, "metric_value": 0.9774, "depth": 4} if obj[4]<=5: # {"feature": "Restaurant20to50", "instances": 15, "metric_value": 0.9183, "depth": 5} if obj[11]>0.0: # {"feature": "Coffeehouse", "instances": 12, "metric_value": 0.9799, "depth": 6} if obj[10]>0.0: # {"feature": "Coupon", "instances": 10, "metric_value": 0.8813, "depth": 7} if obj[2]>2: # {"feature": "Bar", "instances": 6, "metric_value": 0.65, "depth": 8} if obj[9]<=2.0: return 'False' elif obj[9]>2.0: # {"feature": "Passanger", "instances": 2, "metric_value": 1.0, "depth": 9} if obj[0]<=1: return 'False' elif obj[0]>1: return 'True' else: return 'True' else: return 'False' elif obj[2]<=2: # {"feature": "Time", "instances": 4, "metric_value": 1.0, "depth": 8} if obj[1]<=3: # {"feature": "Passanger", "instances": 3, "metric_value": 0.9183, "depth": 9} if obj[0]>0: # {"feature": "Gender", "instances": 2, "metric_value": 1.0, "depth": 10} if obj[3]<=1: # {"feature": "Children", "instances": 2, "metric_value": 1.0, "depth": 11} if obj[5]<=1: # {"feature": "Bar", "instances": 2, "metric_value": 1.0, "depth": 12} if obj[9]<=0.0: # {"feature": "Direction_same", "instances": 2, "metric_value": 1.0, "depth": 13} if obj[12]<=0: # {"feature": "Distance", "instances": 2, "metric_value": 1.0, "depth": 14} if obj[13]<=3: return 'True' else: return 'True' else: return 'True' else: return 'True' else: return 'True' else: return 'True' elif obj[0]<=0: return 'False' else: return 'False' elif obj[1]>3: return 'True' else: return 'True' else: return 'True' elif obj[10]<=0.0: return 'True' else: return 'True' elif obj[11]<=0.0: return 'False' else: return 'False' elif obj[4]>5: return 'True' else: return 'True' elif obj[7]<=2: return 'False' else: return 'False' elif obj[6]>3: return 'True' else: return 'True' elif obj[8]>5: # {"feature": "Occupation", "instances": 12, "metric_value": 0.65, "depth": 2} if obj[7]<=8: return 'True' elif obj[7]>8: # {"feature": "Age", "instances": 4, "metric_value": 1.0, "depth": 3} if obj[4]>3: return 'True' elif obj[4]<=3: return 'False' else: return 'False' else: return 'True' else: return 'True'
def find_decision(obj): if obj[8] <= 5: if obj[6] <= 3: if obj[7] > 2: if obj[4] <= 5: if obj[11] > 0.0: if obj[10] > 0.0: if obj[2] > 2: if obj[9] <= 2.0: return 'False' elif obj[9] > 2.0: if obj[0] <= 1: return 'False' elif obj[0] > 1: return 'True' else: return 'True' else: return 'False' elif obj[2] <= 2: if obj[1] <= 3: if obj[0] > 0: if obj[3] <= 1: if obj[5] <= 1: if obj[9] <= 0.0: if obj[12] <= 0: if obj[13] <= 3: return 'True' else: return 'True' else: return 'True' else: return 'True' else: return 'True' else: return 'True' elif obj[0] <= 0: return 'False' else: return 'False' elif obj[1] > 3: return 'True' else: return 'True' else: return 'True' elif obj[10] <= 0.0: return 'True' else: return 'True' elif obj[11] <= 0.0: return 'False' else: return 'False' elif obj[4] > 5: return 'True' else: return 'True' elif obj[7] <= 2: return 'False' else: return 'False' elif obj[6] > 3: return 'True' else: return 'True' elif obj[8] > 5: if obj[7] <= 8: return 'True' elif obj[7] > 8: if obj[4] > 3: return 'True' elif obj[4] <= 3: return 'False' else: return 'False' else: return 'True' else: return 'True'
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright (c) 2013 ASMlover. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this list ofconditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materialsprovided with the # distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. class SingleList(object): """ single list module for mini-stl(Python) it just same as std::slist<T> in C++ sgi stl """ class ListNode(object): def __init__(self): self.next = None self.data = None def __del__(self): self.next = None self.data = None def __init__(self): self.front_ = None self.rear_ = None self.size_ = 0 self.iter_ = None def __del__(self): self.clear() self.iter_ = None def __iter__(self): self.iter_ = self.front_ return self def next(self): if self.iter_ == None: raise StopIteration else: data = self.iter_.data self.iter_ = self.iter_.next return data def clear(self): while self.front_ != None: node = self.front_ self.front_ = self.front_.next del node self.front_ = None self.rear_ = None self.size_ = 0 def empty(self): return self.front_ == None def size(self): return self.size_ def push_back(self, x): node = self.ListNode() node.next = None node.data = x if self.front_ == None: self.front_ = node self.rear_ = node else: self.rear_.next = node self.rear_ = node self.size_ += 1 def push_front(self, x): node = self.ListNode() node.next = self.front_ node.data = x if self.front_ == None: self.rear_ = node self.front_ = node self.size_ += 1 def pop_front(self): if self.front_ == None: return node = self.front_ self.front_ = self.front_.next del node self.size_ -= 1 def front(self): if self.front_ == None: return None return self.front_.data def back(self): if self.rear_ == None: return None return self.rear_.data def for_each(self, visit): assert visit node = self.front_ while node != None: visit(node.data) node = node.next
class Singlelist(object): """ single list module for mini-stl(Python) it just same as std::slist<T> in C++ sgi stl """ class Listnode(object): def __init__(self): self.next = None self.data = None def __del__(self): self.next = None self.data = None def __init__(self): self.front_ = None self.rear_ = None self.size_ = 0 self.iter_ = None def __del__(self): self.clear() self.iter_ = None def __iter__(self): self.iter_ = self.front_ return self def next(self): if self.iter_ == None: raise StopIteration else: data = self.iter_.data self.iter_ = self.iter_.next return data def clear(self): while self.front_ != None: node = self.front_ self.front_ = self.front_.next del node self.front_ = None self.rear_ = None self.size_ = 0 def empty(self): return self.front_ == None def size(self): return self.size_ def push_back(self, x): node = self.ListNode() node.next = None node.data = x if self.front_ == None: self.front_ = node self.rear_ = node else: self.rear_.next = node self.rear_ = node self.size_ += 1 def push_front(self, x): node = self.ListNode() node.next = self.front_ node.data = x if self.front_ == None: self.rear_ = node self.front_ = node self.size_ += 1 def pop_front(self): if self.front_ == None: return node = self.front_ self.front_ = self.front_.next del node self.size_ -= 1 def front(self): if self.front_ == None: return None return self.front_.data def back(self): if self.rear_ == None: return None return self.rear_.data def for_each(self, visit): assert visit node = self.front_ while node != None: visit(node.data) node = node.next
# (c) Copyright IBM Corp. 2010, 2020. All Rights Reserved. # Validate that incident name does not contain 'X' if 'X' in incident.name: helper.fail("The name must not contain 'X'.") # Validate length of the incident name if len(incident.name) > 100: helper.fail("The name must be less than 100 characters.")
if 'X' in incident.name: helper.fail("The name must not contain 'X'.") if len(incident.name) > 100: helper.fail('The name must be less than 100 characters.')
class VerifierError(Exception): pass class VerifierTranslatorError(Exception): pass __all__ = ["VerifierError", "VerifierTranslatorError"]
class Verifiererror(Exception): pass class Verifiertranslatorerror(Exception): pass __all__ = ['VerifierError', 'VerifierTranslatorError']
a = input() a = int(a) b = input() set1 = set() b.lower() for x in b: set1.add(x.lower()) if len(set1) == 26: print("YES") else: print("NO")
a = input() a = int(a) b = input() set1 = set() b.lower() for x in b: set1.add(x.lower()) if len(set1) == 26: print('YES') else: print('NO')
""" def elevator_distance(array): return sum(abs(array[i+1] - array[i]) for i in range(len(array)-1)) """ def elevator_distance(array): d = 0 for i in range(0, len(array) -1): d += abs(array[i] - array[i+1]) return d
""" def elevator_distance(array): return sum(abs(array[i+1] - array[i]) for i in range(len(array)-1)) """ def elevator_distance(array): d = 0 for i in range(0, len(array) - 1): d += abs(array[i] - array[i + 1]) return d
# https://leetcode.com/problems/counting-bits/ #Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1's in the binary representation of i. class Solution(object): def countBits(self, n): """ :type n: int :rtype: List[int] """ ans = [0] * (n + 1) for i in range(1, n + 1): ans[i] = ans[i >> 1] + (i & 1) return ans
class Solution(object): def count_bits(self, n): """ :type n: int :rtype: List[int] """ ans = [0] * (n + 1) for i in range(1, n + 1): ans[i] = ans[i >> 1] + (i & 1) return ans
vfx = None ## # Init midi module # # @param: vfx object # @return: void ## def init(vfx_obj): global vfx vfx = vfx_obj def debug(): global vfx if(vfx.usb_midi_connected == False): print('Midi not connected') pass print("Midi trig: %s | id: %s | name: %s |active ch: %s | midi new: %s | clock: %s | pgm: %s | cc: %s | note: %s " % (str(vfx.usb_midi_trig), str(vfx.default_input_id), str(vfx.usb_midi_name), str(vfx.midi_channel), str(vfx.midi_new), str(vfx.midi_clk), str(vfx.midi_pgm), str(vfx.midi_cc), str(vfx.midi_notes) ) )
vfx = None def init(vfx_obj): global vfx vfx = vfx_obj def debug(): global vfx if vfx.usb_midi_connected == False: print('Midi not connected') pass print('Midi trig: %s | id: %s | name: %s |active ch: %s | midi new: %s | clock: %s | pgm: %s | cc: %s | note: %s ' % (str(vfx.usb_midi_trig), str(vfx.default_input_id), str(vfx.usb_midi_name), str(vfx.midi_channel), str(vfx.midi_new), str(vfx.midi_clk), str(vfx.midi_pgm), str(vfx.midi_cc), str(vfx.midi_notes)))
"""Preset GridWorlds module Are used by the :obj:`~smartexploration.environments.gridworld.GridWorld` to generate the gridworld. """ def easy(): """Easy GridWorld Returns ------- :obj:`str` name double :obj:`list` of `int` layout :obj:`int` scale """ name = "Easy" layout = [[3, 0, 0], [1, 1, 0], [1, 1, 0], [2, 0, 0]] scale = 5 return name, layout, scale def medium(): """Medium GridWorld Returns ------- :obj:`str` name double :obj:`list` of `int` layout :obj:`int` scale """ name = "Medium" layout = [[3, 0, 0, 0, 0], [1, 1, 1, 1, 0], [0, 0, 0, 0, 0], [0, 1, 1, 1, 1], [0, 0, 0, 0, 2]] scale = 5 return name, layout, scale def hard(): """Hard GridWorld Returns ------- :obj:`str` name double :obj:`list` of `int` layout :obj:`int` scale """ name = "Hard" layout = [[3, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 0], [2, 0, 0, 0, 0, 0, 0]] scale = 5 return name, layout, scale def extreme(): """Extreme GridWorld Returns ------- :obj:`str` name double :obj:`list` of `int` layout :obj:`int` scale """ name = "Extreme" layout = [[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3], [1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], [1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0], [0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0], [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0], [1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0], [0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1], [0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0], [2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0]] scale = 3 return name, layout, scale
"""Preset GridWorlds module Are used by the :obj:`~smartexploration.environments.gridworld.GridWorld` to generate the gridworld. """ def easy(): """Easy GridWorld Returns ------- :obj:`str` name double :obj:`list` of `int` layout :obj:`int` scale """ name = 'Easy' layout = [[3, 0, 0], [1, 1, 0], [1, 1, 0], [2, 0, 0]] scale = 5 return (name, layout, scale) def medium(): """Medium GridWorld Returns ------- :obj:`str` name double :obj:`list` of `int` layout :obj:`int` scale """ name = 'Medium' layout = [[3, 0, 0, 0, 0], [1, 1, 1, 1, 0], [0, 0, 0, 0, 0], [0, 1, 1, 1, 1], [0, 0, 0, 0, 2]] scale = 5 return (name, layout, scale) def hard(): """Hard GridWorld Returns ------- :obj:`str` name double :obj:`list` of `int` layout :obj:`int` scale """ name = 'Hard' layout = [[3, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 0], [2, 0, 0, 0, 0, 0, 0]] scale = 5 return (name, layout, scale) def extreme(): """Extreme GridWorld Returns ------- :obj:`str` name double :obj:`list` of `int` layout :obj:`int` scale """ name = 'Extreme' layout = [[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3], [1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], [1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0], [0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0], [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0], [1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0], [0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1], [0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0], [2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0]] scale = 3 return (name, layout, scale)
def mail_send(to, subject, content): print(to) print(subject) print(content)
def mail_send(to, subject, content): print(to) print(subject) print(content)
SAFE_METHODS = ("GET", "HEAD", "OPTIONS") class BasePermission(object): """ A base class from which all permission classes should inherit. """ def has_permission(self, request, view): """ Return `True` if permission is granted, `False` otherwise. """ return True def has_object_permission(self, request, view, obj): """ Return `True` if permission is granted, `False` otherwise. """ return True class AllowAny(BasePermission): """ Allow any access. This isn't strictly required, since you could use an empty permission_classes list, but it's useful because it makes the intention more explicit. """ def has_permission(self, request, view): return True class IsAuthenticated(BasePermission): """ Allows access only to authenticated users. """ def has_permission(self, request, view): return request.user and request.user.is_authenticated class IsAdminUser(BasePermission): """ Allows access only to admin users. """ def has_permission(self, request, view): return request.user and request.user.is_staff class IsAuthenticatedOrReadOnly(BasePermission): """ The request is authenticated as a user, or is a read-only request. """ def has_permission(self, request, view): return ( request.method in SAFE_METHODS or request.user and request.user.is_authenticated )
safe_methods = ('GET', 'HEAD', 'OPTIONS') class Basepermission(object): """ A base class from which all permission classes should inherit. """ def has_permission(self, request, view): """ Return `True` if permission is granted, `False` otherwise. """ return True def has_object_permission(self, request, view, obj): """ Return `True` if permission is granted, `False` otherwise. """ return True class Allowany(BasePermission): """ Allow any access. This isn't strictly required, since you could use an empty permission_classes list, but it's useful because it makes the intention more explicit. """ def has_permission(self, request, view): return True class Isauthenticated(BasePermission): """ Allows access only to authenticated users. """ def has_permission(self, request, view): return request.user and request.user.is_authenticated class Isadminuser(BasePermission): """ Allows access only to admin users. """ def has_permission(self, request, view): return request.user and request.user.is_staff class Isauthenticatedorreadonly(BasePermission): """ The request is authenticated as a user, or is a read-only request. """ def has_permission(self, request, view): return request.method in SAFE_METHODS or (request.user and request.user.is_authenticated)
a = 1 b = 0 c = 0 i = 0 while True: c = a + b b = a a = c if i % 100000 == 0: print(c) i += 1
a = 1 b = 0 c = 0 i = 0 while True: c = a + b b = a a = c if i % 100000 == 0: print(c) i += 1
def create_sensorinfo_file(directory): pass def create_metadata_file(directory): pass def create_delivery_note_file(directory): pass def create_data_delivery(directory): pass
def create_sensorinfo_file(directory): pass def create_metadata_file(directory): pass def create_delivery_note_file(directory): pass def create_data_delivery(directory): pass
class Plugin_OBJ(): def __init__(self, plugin_utils): self.plugin_utils = plugin_utils self.channels_json_url = "https://iptv-org.github.io/iptv/channels.json" self.filter_dict = {} self.setup_filters() self.unfiltered_chan_json = None self.filtered_chan_json = None @property def tuners(self): return self.plugin_utils.config.dict["iptvorg"]["tuners"] @property def stream_method(self): return self.plugin_utils.config.dict["iptvorg"]["stream_method"] @property def filtered_chan_list(self): if not self.filtered_chan_json: self.filtered_chan_json = self.filterlist() return self.filtered_chan_json @property def unfiltered_chan_list(self): if not self.unfiltered_chan_json: self.unfiltered_chan_json = self.get_unfiltered_chan_json() return self.unfiltered_chan_json def setup_filters(self): for x in ["countries", "languages", "category"]: self.filter_dict[x] = [] for filter in list(self.filter_dict.keys()): filterconf = self.plugin_utils.config.dict["iptvorg"]["filter_%s" % filter] if filterconf: if isinstance(filterconf, str): filterconf = [filterconf] self.plugin_utils.logger.info("Found %s Enabled %s Filters" % (len(filterconf), filter)) self.filter_dict[filter].extend(filterconf) else: self.plugin_utils.logger.info("Found No Enabled %s Filters" % (filter)) def get_channels(self): channel_list = [] self.plugin_utils.logger.info("Pulling Unfiltered Channels: %s" % self.channels_json_url) self.unfiltered_chan_json = self.get_unfiltered_chan_json() self.plugin_utils.logger.info("Found %s Total Channels" % len(self.unfiltered_chan_json)) self.filtered_chan_json = self.filterlist() self.plugin_utils.logger.info("Found %s Channels after applying filters and Deduping." % len(self.filtered_chan_list)) for channel_dict in self.filtered_chan_list: clean_station_item = { "name": channel_dict["name"], "id": channel_dict["name"], "thumbnail": channel_dict["logo"], } channel_list.append(clean_station_item) return channel_list def get_channel_stream(self, chandict, stream_args): streamdict = self.get_channel_dict(self.filtered_chan_list, "name", chandict["origin_name"]) streamurl = streamdict["url"] stream_info = {"url": streamurl} return stream_info def get_unfiltered_chan_json(self): urlopn = self.plugin_utils.web.session.get(self.channels_json_url) return urlopn.json() def filterlist(self): filtered_chan_list = [] for channels_item in self.unfiltered_chan_list: filters_passed = [] for filter_key in list(self.filter_dict.keys()): if not len(self.filter_dict[filter_key]): filters_passed.append(True) else: if filter_key in list(channels_item.keys()): if filter_key in ["countries", "languages"]: if isinstance(channels_item[filter_key], list): if len(channels_item[filter_key]): chan_values = [] chan_values.extend([x["name"] for x in channels_item[filter_key]]) chan_values.extend([x["code"] for x in channels_item[filter_key]]) else: chan_values = [] else: chan_values = [] chan_values.append(channels_item[filter_key]["name"]) chan_values.append(channels_item[filter_key]["code"]) elif filter_key in ["category"]: chan_values = [channels_item[filter_key]] else: chan_values = [] if not len(chan_values): filter_passed = False else: values_passed = [] for chan_value in chan_values: if str(chan_value).lower() in [x.lower() for x in self.filter_dict[filter_key]]: values_passed.append(True) else: values_passed.append(False) if True in values_passed: filter_passed = True else: filter_passed = False filters_passed.append(filter_passed) if False not in filters_passed: if channels_item["name"] not in [x["name"] for x in filtered_chan_list]: filtered_chan_list.append(channels_item) return filtered_chan_list def get_channel_dict(self, chanlist, keyfind, valfind): return next(item for item in chanlist if item[keyfind] == valfind) or None
class Plugin_Obj: def __init__(self, plugin_utils): self.plugin_utils = plugin_utils self.channels_json_url = 'https://iptv-org.github.io/iptv/channels.json' self.filter_dict = {} self.setup_filters() self.unfiltered_chan_json = None self.filtered_chan_json = None @property def tuners(self): return self.plugin_utils.config.dict['iptvorg']['tuners'] @property def stream_method(self): return self.plugin_utils.config.dict['iptvorg']['stream_method'] @property def filtered_chan_list(self): if not self.filtered_chan_json: self.filtered_chan_json = self.filterlist() return self.filtered_chan_json @property def unfiltered_chan_list(self): if not self.unfiltered_chan_json: self.unfiltered_chan_json = self.get_unfiltered_chan_json() return self.unfiltered_chan_json def setup_filters(self): for x in ['countries', 'languages', 'category']: self.filter_dict[x] = [] for filter in list(self.filter_dict.keys()): filterconf = self.plugin_utils.config.dict['iptvorg']['filter_%s' % filter] if filterconf: if isinstance(filterconf, str): filterconf = [filterconf] self.plugin_utils.logger.info('Found %s Enabled %s Filters' % (len(filterconf), filter)) self.filter_dict[filter].extend(filterconf) else: self.plugin_utils.logger.info('Found No Enabled %s Filters' % filter) def get_channels(self): channel_list = [] self.plugin_utils.logger.info('Pulling Unfiltered Channels: %s' % self.channels_json_url) self.unfiltered_chan_json = self.get_unfiltered_chan_json() self.plugin_utils.logger.info('Found %s Total Channels' % len(self.unfiltered_chan_json)) self.filtered_chan_json = self.filterlist() self.plugin_utils.logger.info('Found %s Channels after applying filters and Deduping.' % len(self.filtered_chan_list)) for channel_dict in self.filtered_chan_list: clean_station_item = {'name': channel_dict['name'], 'id': channel_dict['name'], 'thumbnail': channel_dict['logo']} channel_list.append(clean_station_item) return channel_list def get_channel_stream(self, chandict, stream_args): streamdict = self.get_channel_dict(self.filtered_chan_list, 'name', chandict['origin_name']) streamurl = streamdict['url'] stream_info = {'url': streamurl} return stream_info def get_unfiltered_chan_json(self): urlopn = self.plugin_utils.web.session.get(self.channels_json_url) return urlopn.json() def filterlist(self): filtered_chan_list = [] for channels_item in self.unfiltered_chan_list: filters_passed = [] for filter_key in list(self.filter_dict.keys()): if not len(self.filter_dict[filter_key]): filters_passed.append(True) else: if filter_key in list(channels_item.keys()): if filter_key in ['countries', 'languages']: if isinstance(channels_item[filter_key], list): if len(channels_item[filter_key]): chan_values = [] chan_values.extend([x['name'] for x in channels_item[filter_key]]) chan_values.extend([x['code'] for x in channels_item[filter_key]]) else: chan_values = [] else: chan_values = [] chan_values.append(channels_item[filter_key]['name']) chan_values.append(channels_item[filter_key]['code']) elif filter_key in ['category']: chan_values = [channels_item[filter_key]] else: chan_values = [] if not len(chan_values): filter_passed = False else: values_passed = [] for chan_value in chan_values: if str(chan_value).lower() in [x.lower() for x in self.filter_dict[filter_key]]: values_passed.append(True) else: values_passed.append(False) if True in values_passed: filter_passed = True else: filter_passed = False filters_passed.append(filter_passed) if False not in filters_passed: if channels_item['name'] not in [x['name'] for x in filtered_chan_list]: filtered_chan_list.append(channels_item) return filtered_chan_list def get_channel_dict(self, chanlist, keyfind, valfind): return next((item for item in chanlist if item[keyfind] == valfind)) or None
# Chicago 106 problem # try https://e-maxx.ru/algo/levit_algorithm places, streets = list(map(int, input().split())) graph = dict() # dynamic = [-1 for i in range(places)] for i in range(streets): start, end, prob = list(map(int, input().split())) if start not in graph: graph[start] = list() if end not in graph: graph[end] = list() graph[start].append(end) graph[end].append(start)
(places, streets) = list(map(int, input().split())) graph = dict() for i in range(streets): (start, end, prob) = list(map(int, input().split())) if start not in graph: graph[start] = list() if end not in graph: graph[end] = list() graph[start].append(end) graph[end].append(start)
line = input() while line != "0 0 0 0": line = list(map(int, line.split())) starting = line[0] for i in range(4): line[i] = ((line[i] + 40 - starting) % 40) * 9 res = 360 * 3 + (360 - line[1]) % 360 + (360 + line[2] - line[1]) % 360 + (360 + line[2] - line[3]) % 360 print(res) line = input()
line = input() while line != '0 0 0 0': line = list(map(int, line.split())) starting = line[0] for i in range(4): line[i] = (line[i] + 40 - starting) % 40 * 9 res = 360 * 3 + (360 - line[1]) % 360 + (360 + line[2] - line[1]) % 360 + (360 + line[2] - line[3]) % 360 print(res) line = input()
# # PySNMP MIB module CISCO-DOT11-WIDS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-DOT11-WIDS-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:55:58 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") ObjectIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Integer32, Counter32, Unsigned32, TimeTicks, Counter64, IpAddress, NotificationType, Bits, ModuleIdentity, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Integer32", "Counter32", "Unsigned32", "TimeTicks", "Counter64", "IpAddress", "NotificationType", "Bits", "ModuleIdentity", "Gauge32") MacAddress, TruthValue, TimeStamp, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "TruthValue", "TimeStamp", "DisplayString", "TextualConvention") ciscoDot11WidsMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 456)) ciscoDot11WidsMIB.setRevisions(('2004-11-30 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoDot11WidsMIB.setRevisionsDescriptions(('Initial version of this MIB module. ',)) if mibBuilder.loadTexts: ciscoDot11WidsMIB.setLastUpdated('200411300000Z') if mibBuilder.loadTexts: ciscoDot11WidsMIB.setOrganization('Cisco System Inc.') if mibBuilder.loadTexts: ciscoDot11WidsMIB.setContactInfo(' Cisco Systems, Customer Service Postal: 170 West Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-dot11@cisco.com') if mibBuilder.loadTexts: ciscoDot11WidsMIB.setDescription('This MIB is intended to be implemented on the following IOS based network entities for the purpose of providing network management stations information about the various attempts to compromise the security in the 802.11-based wireless networks. (i) 802.11 Access Points that accept wireless client associations. The MIB reports the information about the following attacks that can happen either at the initial authentication phase or during normal data communication between the client and the AP. EAPOL flooding - This is an attempt made by an invalid 802.11 client to send too many EAPOL-Start messages and bring the authentication services on the Authenticator, typically the AP, down. BlackListing - This is the process of marking a client as invalid when its authentication attempts fail. The client is put in a list when its authentication attempt fails for the first time. If the number of consecutive failed authentication attempts reach a threshold, any subsequent authentication requests made by the client will be rejected from that point for a configurable period of time. Protection Failures - These kind of failures happen when the attacker injects invalid packets onto the wireless network thereby corrupting the 802.11 data traffic between an AP and its associated wireless clients. The administrator, through the NMS, can configure the thresholds on the AP using this MIB to enable the AP detect the EAPOL flood attacks and provide related statistics to the NMS. To detect protection failures, the AP provides the relevant statistics about the protection errors in the form of MIB objects, which are compared against the thresholds configured on the NMS and appropriate events are raised by the NMS, if thresholds are found to be exceeded. The hierarchy of the AP and MNs is as follows. +~-~-~+ +~-~-~+ +~-~-~+ +~-~-~+ + + + + + + + + + AP + + AP + + AP + + AP + + + + + + + + + +~-~-~+ +~-~-~+ +~-~-~+ +~-~-~+ .. . . . .. . . . . . . . . . . . . . . . . . . . . . . . \\/ \\/ \\/ \\/ \\/ +.....+ +.....+ +-.-.-.+ +~-~-~+ +......+ + + + + + + + + + + + MN + + MN + + MN + + MN + + MN + + + + + + + + + + + +.....+ +.....+ +-.-.-.+ +~-~-~+ +......+ The wireless connections are represented as dotted lines in the above diagram. GLOSSARY Access Point ( AP ) An entity that contains an 802.11 medium access control ( MAC ) and physical layer ( PHY ) interface and provides access to the distribution services via the wireless medium for associated clients. Mobile Node ( MN ) A roaming 802.11 wireless device in a wireless network associated with an access point. Service Set Identifier (SSID) The Radio Service Set ID that is used by the mobile wireless clients for identification during the association with the APs. Temporal Key Integrity Protocol (TKIP) A security protocol defined to enhance the limitations of WEP. Message Integrity Check and per-packet keying on all WEP-encrypted frames are two significant enhancements provided by TKIP to WEP. Counter mode with CBC-MAC Protocol (CCMP) A security protocol that uses the counter mode in conjunction with cipher block chaining. This method divides the data into blocks, encrypts the first block, XORs the results with the second block, encrypts the result, XORs the result with the next block and continues till all the blocks are processed. This way, this protocol derives a 64-bit MIC which is appended to the plaintext data which is again encrypted using the counter mode. Message Integrity Check (MIC) The Message Integrity Check is an improvement over the Integrity Check Function (ICV) of the 802.11 standard. MIC adds two new fields to the wireless frames - a sequence number field for detecting out-of-order frames and a MIC field to provide a frame integrity check to overcome the mathematical shortcomings of the ICV. 802.1x The IEEE ratified standard for enforcing port based access control. This was originally intended for use on wired LANs and later extended for use in 802.11 WLAN environments. This defines an architecture with three main parts - a supplicant (Ex. an 802.11 wireless client), an authenticator (the AP) and an authentication server(a Radius server). The authenticator passes messages back and forth between the supplicant and the authentication server to enable the supplicant get authenticated to the network. Extensible Authentication Protocol Over LAN (EAPOL) This is an encapsulation method defined by 802.1x passing EAP packets over Ethernet frames. ') ciscoDot11WidsMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 0)) ciscoDot11WidsMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 1)) ciscoDot11WidsAuthFailures = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1)) ciscoDot11WidsProtectFailures = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2)) ciscoDot11WidsMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 2)) ciscoDot11WidsMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 2, 1)) ciscoDot11WidsMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 2, 2)) cDot11WidsFloodDetectEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 1), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cDot11WidsFloodDetectEnable.setStatus('current') if mibBuilder.loadTexts: cDot11WidsFloodDetectEnable.setDescription("This object is used to enable or disable the WIDS flood detection feature. Set this MIB object to 'true' to enable the flood detection and 'false' to disable it. Note that the values configured through cDot11WidsFloodThreshold and cDot11WidsEapolFloodInterval take effect only if flood detection is enabled through this MIB object. ") cDot11WidsEapolFloodThreshold = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 512)).clone(3)).setUnits('attempts').setMaxAccess("readwrite") if mibBuilder.loadTexts: cDot11WidsEapolFloodThreshold.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodThreshold.setDescription('This object specifies the maximum number of authentication attempts allowed for all the clients taken together in the interval specified by cDot11WidsEapolFloodInterval. The attempts include both the successful as well as failed attempts. ') cDot11WidsEapolFloodInterval = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 300)).clone(60)).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: cDot11WidsEapolFloodInterval.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodInterval.setDescription('This object specifies the time duration for which the client authentication attempts have to be monitored for detecting the flood attack. ') cDot11WidsBlackListThreshold = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 512)).clone(3)).setUnits('attempts').setMaxAccess("readwrite") if mibBuilder.loadTexts: cDot11WidsBlackListThreshold.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListThreshold.setDescription('This object configures the maximum threshold on the number of unsuccessful authentication attempts, that can be made by a particular client. Once the threshold is reached, the client is retained in the list for a period of time equal to the value configured through cDot11WidsBlackListDuration, during which its attempts to get authenticated are blocked. ') cDot11WidsBlackListDuration = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 300)).clone(60)).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: cDot11WidsBlackListDuration.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListDuration.setDescription('This object indicates the time duration for which a particular client has to be kept in the black list after the number of unsuccessful attempts reach the threshold given by cDot11WidsBlackListThreshold. ') cDot11WidsFloodMaxEntriesPerIntf = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cDot11WidsFloodMaxEntriesPerIntf.setStatus('current') if mibBuilder.loadTexts: cDot11WidsFloodMaxEntriesPerIntf.setDescription('This object indicates the maximum number of entries that can be held for a particular 802.11 radio interface identified by ifIndex. ') cDot11WidsEapolFloodTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7), ) if mibBuilder.loadTexts: cDot11WidsEapolFloodTable.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodTable.setDescription("This table gives the statistics on the EAPOL flood attacks observed at this radio interface. An entry in this table is created by the agent when this 802.11 station detects an EAPOL flood attack. All the columns in the entries except the cDot11WidsEapolFloodStopTime are populated when the attack is observed first. The object cDot11WidsEapolFloodStopTime is populated when no flood conditions are observed following the initial observation at the time indicated by cDot11WidsEapolFloodStartTime. This can be illustrated by the following example. Assume that the monitoring interval is configured to 1 minute through the cDot11WidsEapolFloodInterval object and the number of attempts is set to 5. At the end of the first minute after this configuration is made, client c1 is found to have made 4 attempts and another client c2 have made 3. Hence, in total, the attempt count exceeds 7 and the agent adds a new row to this table. The cDot11WidsFloodStopTime carries a value of 0 at this point in the newly added row. The MIB object cDot11WidsEapolFloodClientMac at this point holds the MAC address of c1 and cDot11WidsEapolFloodClientCount holds the value of 4. At the end of the second interval, assume that the clients are found to have made only 4 attempts in total with c1 and c2 making 3 and 1 attempt(s) respectively. Now the total count is not found to exceed the threshold. Hence the flood is observed to be stopped. The object cDot11WidsEapolFloodStopTime is now populated with this time at which the flood is observed to be stopped. The MIB object cDot11WidsEapolFloodClientMac at this point holds c1's MAC address and cDot11WidsEapolFloodClientCount would hold a value of 7. If the count is found to exceed in the next interval, it will be treated as a beginning of a new flood event and hence a new entry will be created for the same. Assume the case where, at the end of the second interval, the total count continues at the rate above the threshold, with c1 making 5 and c2 making 2 attempts respectively. Since the flood is not observed to be stopped, the object cDot11WidsFloodStopTime continues to hold a value of zero. The agent at anytime will retain only the most recent and maximum number of entries, as given by cDot11WidsFloodMaxEntriesPerIntf, for a particular value of ifIndex. The older entries are purged automatically when the number of entries for a particular ifIndex reaches its maximum. This table has a expansion dependent relationship with ifTable defined in IF-MIB. There exists a row in this table corresponding to the row for each interface of iftype ieee80211(71) found in ifTable. cDot11WidsEapolFloodIndex acts as the expansion index. ") cDot11WidsEapolFloodEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CISCO-DOT11-WIDS-MIB", "cDot11WidsEapolFloodIndex")) if mibBuilder.loadTexts: cDot11WidsEapolFloodEntry.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodEntry.setDescription('An entry holds the statistics about one instance of EAPOL flood attack observed at this particular radio interface. ') cDot11WidsEapolFloodIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))) if mibBuilder.loadTexts: cDot11WidsEapolFloodIndex.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodIndex.setDescription('This object identifies the set of information about one instance of an EAPOL flood event observed at this radio interface between the start and stop times indicated by cDot11WidsEapolFloodStartTime and cDot11WidsEapolFloodStopTime. ') cDot11WidsEapolFloodClientMac = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 2), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsEapolFloodClientMac.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodClientMac.setDescription('This object identifies the MAC address of the wireless client that has made the maximum number of authentication attempts in the duration specified by the cDot11WidsEapolFloodInterval object. At the end of each interval time indicated by cDot11WidsFloodInterval, the 802.11 station checks whether the total count of the number of authentication attempts made by all the clients exceed the threshold configured through the object cDot11WidsEapolFloodThreshold. If yes, then the agent populates this MIB object with the MAC of the wireless client that has made the maximum number of authentication attempts in that interval. When the flood event is observed to be stopped, as indicated by a non-zero value for the cDot11WidsEapolFloodStopTime object, this object indicates the MAC of the wireless client that has made the maximum number of attempts for the entire duration of the flood observed between the times indicated by the objects cDot11WidsEapolFloodStartTime and cDot11WidsEapolFloodStopTime respectively. ') cDot11WidsEapolFloodClientCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsEapolFloodClientCount.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodClientCount.setDescription('This object provides the count associated with the client with largest number of attempts in the last interval. When the flood event is observed to be stopped, as indicated by a non-zero value for the cDot11WidsEapolFloodStopTime object, this object gives the count associated with the client with the largest number of attempts, for the entire duration of the flood observed between the times indicated by the objects cDot11WidsEapolFloodStartTime and cDot11WidsEapolFloodStopTime respectively. ') cDot11WidsEapolFloodStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 4), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsEapolFloodStartTime.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodStartTime.setDescription('This object indicates the time at which the EAPOL flood event identified by one entry of this table was observed first at this radio interface. ') cDot11WidsEapolFloodStopTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 5), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsEapolFloodStopTime.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodStopTime.setDescription('This object indicates the time at which the the EAPOL flood event observed first at the time indicated by cDot11WidsEapolFloodStartTime has stopped. If this 802.11 station finds that the flood conditions observed in the one or more prior intervals has ceased, it marks the flood event as stopped at the time indicated by this object. That the flood has ceased is indicated by the number of authentication attempts dropping below the value specified by the cDot11WidsEapolFloodThreshold object. A value of 0 for this object indicates that the number of authentication attempts continue to exceed the value specified by the cDot11WidsEapolFloodThreshold object. ') cDot11WidsEapolFloodTotalCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsEapolFloodTotalCount.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodTotalCount.setDescription('This object gives the accumulated count of the number of authentication attempts made by all the clients at the time of query. ') cDot11WidsBlackListTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 8), ) if mibBuilder.loadTexts: cDot11WidsBlackListTable.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListTable.setDescription('This table gives the information about the 802.11 wireless clients that have been blacklisted while attempting to get authenticated with this 802.11 station at this radio interface. An entry is added to this table when the number of consecutive failed authentication attempts made by a client equals the value configured through cDot11WidsBlackListThreshold. The client will then be blocked from getting authenticated for a time period equal to the value configured through cDot11WidsBlackListDuration. After this time elapses, the client is taken off from the list and the agent automatically removes the entry corresponding to that client from this table. This table has a expansion dependent relationship on the ifTable. For each entry in this table, there exists at least an entry in the ifTable of ifType ieee80211(71). cDot11BlackListIndex acts as the expansion index. ') cDot11WidsBlackListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 8, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CISCO-DOT11-WIDS-MIB", "cDot11WidsBlackListClientMac")) if mibBuilder.loadTexts: cDot11WidsBlackListEntry.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListEntry.setDescription('Each entry holds the information about one 802.11 wireless client that has been blacklisted when attempting to get authenticated with this 802.11 station at this radio interface. ') cDot11WidsBlackListClientMac = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 8, 1, 1), MacAddress()) if mibBuilder.loadTexts: cDot11WidsBlackListClientMac.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListClientMac.setDescription('This object indicates the Mac Address of the blacklisted client. ') cDot11WidsBlackListAttemptCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 8, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsBlackListAttemptCount.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListAttemptCount.setDescription('This object counts the total number of attempts made by the client identified by cDot11WidsBlackListClientMac to get authenticated with the 802.11 station through this radio interface. ') cDot11WidsBlackListTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 8, 1, 3), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsBlackListTime.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListTime.setDescription('This object indicates the time at which the client was blacklisted after failing in its attempt to get authenticated with this 802.11 station at this radio interface. ') cDot11WidsProtectFailClientTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1), ) if mibBuilder.loadTexts: cDot11WidsProtectFailClientTable.setStatus('current') if mibBuilder.loadTexts: cDot11WidsProtectFailClientTable.setDescription('This table gives the statistics on the various protection failures occurred during the data communication of this 802.11 station with a particular client currently associated at this dot11 interface. Note that the agent populates this table with an entry for an associated client if and only if at least one of the error statistics, as reported by the counter-type objects of this table, has a non-zero value. This table has a expansion dependent relationship on the ifTable. For each entry in this table, there exists at least an entry in the ifTable of ifType ieee80211(71). cDot11WidsSsid and cDot11WidsClientMacAddress act as the expansion indices. ') cDot11WidsProtectFailClientEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CISCO-DOT11-WIDS-MIB", "cDot11WidsSsid"), (0, "CISCO-DOT11-WIDS-MIB", "cDot11WidsClientMacAddress")) if mibBuilder.loadTexts: cDot11WidsProtectFailClientEntry.setStatus('current') if mibBuilder.loadTexts: cDot11WidsProtectFailClientEntry.setDescription('Each entry holds the information about the protection failures observed at this radio interface when this 802.11 station communicates with its associated client identified by cDot11WidsClientMacAddress at the interface identified by ifIndex. The clients are grouped according to the SSIDs they use for their association with the dot11 interface. ') cDot11WidsSsid = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))) if mibBuilder.loadTexts: cDot11WidsSsid.setStatus('current') if mibBuilder.loadTexts: cDot11WidsSsid.setDescription('This object specifies one of the SSIDs of this radio interface using which the client has associated with the 802.11 station. ') cDot11WidsClientMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 2), MacAddress()) if mibBuilder.loadTexts: cDot11WidsClientMacAddress.setStatus('current') if mibBuilder.loadTexts: cDot11WidsClientMacAddress.setDescription('This object identifies the MAC address of the associated client to which this set of statistics are applicable. ') cDot11WidsSelPairWiseCipher = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsSelPairWiseCipher.setReference('Section 7.3.2.25.1, 802.11i Amendment 6: Medium Access Control(MAC) Security Enhancements. ') if mibBuilder.loadTexts: cDot11WidsSelPairWiseCipher.setStatus('current') if mibBuilder.loadTexts: cDot11WidsSelPairWiseCipher.setDescription('This object identifies the pairwise cipher used by the client identified by cDot11WidsClientMacAddress during its association with this 802.11 station at the interface identified by ifIndex. ') cDot11WidsTkipIcvErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsTkipIcvErrors.setStatus('current') if mibBuilder.loadTexts: cDot11WidsTkipIcvErrors.setDescription("This object counts the total number of TKIP ICV Errors observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") cDot11WidsTkipLocalMicFailures = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsTkipLocalMicFailures.setStatus('current') if mibBuilder.loadTexts: cDot11WidsTkipLocalMicFailures.setDescription("This object counts the total number of TKIP local MIC failures observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") cDot11WidsTkipRemoteMicFailures = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsTkipRemoteMicFailures.setStatus('current') if mibBuilder.loadTexts: cDot11WidsTkipRemoteMicFailures.setDescription("This object counts the total number of TKIP remote MIC failures observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") cDot11WidsCcmpReplays = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsCcmpReplays.setStatus('current') if mibBuilder.loadTexts: cDot11WidsCcmpReplays.setDescription("This object counts the total number of CCMP replay failures observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") cDot11WidsCcmpDecryptErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsCcmpDecryptErrors.setStatus('current') if mibBuilder.loadTexts: cDot11WidsCcmpDecryptErrors.setDescription("This object counts the total number of CCMP decryption failures observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") cDot11WidsTkipReplays = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsTkipReplays.setStatus('current') if mibBuilder.loadTexts: cDot11WidsTkipReplays.setDescription("This object counts the total number of TKIP replay failures observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") cDot11WidsWepReplays = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsWepReplays.setStatus('current') if mibBuilder.loadTexts: cDot11WidsWepReplays.setDescription("This object counts the total number of WEP Replay errors observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") cDot11WidsWepIcvErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsWepIcvErrors.setStatus('current') if mibBuilder.loadTexts: cDot11WidsWepIcvErrors.setDescription("This object counts the total number of WEP ICV errors observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") cDot11WidsCkipReplays = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsCkipReplays.setStatus('current') if mibBuilder.loadTexts: cDot11WidsCkipReplays.setDescription("This object counts the total number of CKIP replay errors observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") cDot11WidsCkipCmicErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cDot11WidsCkipCmicErrors.setStatus('current') if mibBuilder.loadTexts: cDot11WidsCkipCmicErrors.setDescription("This object counts the total number of CKIP-CMIC errors observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") ciscoDot11WidsMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 456, 2, 1, 1)).setObjects(("CISCO-DOT11-WIDS-MIB", "ciscoDot11WidsAuthFailGroup"), ("CISCO-DOT11-WIDS-MIB", "ciscoDot11WidsProtectFailGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoDot11WidsMIBCompliance = ciscoDot11WidsMIBCompliance.setStatus('current') if mibBuilder.loadTexts: ciscoDot11WidsMIBCompliance.setDescription('The compliance statement for the SNMP entities that implement the ciscoDot11WidsMIB module.') ciscoDot11WidsAuthFailGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 456, 2, 2, 1)).setObjects(("CISCO-DOT11-WIDS-MIB", "cDot11WidsFloodDetectEnable"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsEapolFloodThreshold"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsEapolFloodInterval"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsBlackListThreshold"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsBlackListDuration"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsFloodMaxEntriesPerIntf"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsEapolFloodTotalCount"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsEapolFloodClientMac"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsEapolFloodClientCount"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsEapolFloodStartTime"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsEapolFloodStopTime"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsBlackListAttemptCount"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsBlackListTime")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoDot11WidsAuthFailGroup = ciscoDot11WidsAuthFailGroup.setStatus('current') if mibBuilder.loadTexts: ciscoDot11WidsAuthFailGroup.setDescription('This collection of objects provide information about configuration needed on the 802.11 station to detect the EAPOL flood attacks and black-list clients, the general statistics about the detected flood flood attacks and the information about the blacklisted clients. ') ciscoDot11WidsProtectFailGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 456, 2, 2, 2)).setObjects(("CISCO-DOT11-WIDS-MIB", "cDot11WidsSelPairWiseCipher"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsTkipIcvErrors"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsTkipLocalMicFailures"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsTkipRemoteMicFailures"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsCcmpReplays"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsCcmpDecryptErrors"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsTkipReplays"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsWepReplays"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsWepIcvErrors"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsCkipReplays"), ("CISCO-DOT11-WIDS-MIB", "cDot11WidsCkipCmicErrors")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoDot11WidsProtectFailGroup = ciscoDot11WidsProtectFailGroup.setStatus('current') if mibBuilder.loadTexts: ciscoDot11WidsProtectFailGroup.setDescription("This collection of objects provide information about the various protection failures observed during the associated clients' data communications with this 802.11 station. ") mibBuilder.exportSymbols("CISCO-DOT11-WIDS-MIB", cDot11WidsCkipReplays=cDot11WidsCkipReplays, cDot11WidsEapolFloodStopTime=cDot11WidsEapolFloodStopTime, ciscoDot11WidsProtectFailures=ciscoDot11WidsProtectFailures, cDot11WidsClientMacAddress=cDot11WidsClientMacAddress, cDot11WidsEapolFloodInterval=cDot11WidsEapolFloodInterval, cDot11WidsTkipReplays=cDot11WidsTkipReplays, cDot11WidsTkipRemoteMicFailures=cDot11WidsTkipRemoteMicFailures, cDot11WidsEapolFloodThreshold=cDot11WidsEapolFloodThreshold, ciscoDot11WidsMIBCompliance=ciscoDot11WidsMIBCompliance, cDot11WidsProtectFailClientTable=cDot11WidsProtectFailClientTable, cDot11WidsBlackListTable=cDot11WidsBlackListTable, ciscoDot11WidsAuthFailGroup=ciscoDot11WidsAuthFailGroup, ciscoDot11WidsMIBNotifs=ciscoDot11WidsMIBNotifs, cDot11WidsBlackListAttemptCount=cDot11WidsBlackListAttemptCount, cDot11WidsBlackListThreshold=cDot11WidsBlackListThreshold, cDot11WidsWepReplays=cDot11WidsWepReplays, ciscoDot11WidsMIBCompliances=ciscoDot11WidsMIBCompliances, cDot11WidsBlackListTime=cDot11WidsBlackListTime, ciscoDot11WidsMIB=ciscoDot11WidsMIB, cDot11WidsSsid=cDot11WidsSsid, cDot11WidsEapolFloodStartTime=cDot11WidsEapolFloodStartTime, cDot11WidsEapolFloodTable=cDot11WidsEapolFloodTable, ciscoDot11WidsMIBObjects=ciscoDot11WidsMIBObjects, ciscoDot11WidsProtectFailGroup=ciscoDot11WidsProtectFailGroup, cDot11WidsEapolFloodClientMac=cDot11WidsEapolFloodClientMac, cDot11WidsEapolFloodClientCount=cDot11WidsEapolFloodClientCount, cDot11WidsFloodMaxEntriesPerIntf=cDot11WidsFloodMaxEntriesPerIntf, cDot11WidsEapolFloodIndex=cDot11WidsEapolFloodIndex, ciscoDot11WidsAuthFailures=ciscoDot11WidsAuthFailures, cDot11WidsCcmpDecryptErrors=cDot11WidsCcmpDecryptErrors, cDot11WidsCkipCmicErrors=cDot11WidsCkipCmicErrors, cDot11WidsTkipIcvErrors=cDot11WidsTkipIcvErrors, cDot11WidsTkipLocalMicFailures=cDot11WidsTkipLocalMicFailures, cDot11WidsEapolFloodEntry=cDot11WidsEapolFloodEntry, cDot11WidsEapolFloodTotalCount=cDot11WidsEapolFloodTotalCount, cDot11WidsCcmpReplays=cDot11WidsCcmpReplays, cDot11WidsWepIcvErrors=cDot11WidsWepIcvErrors, ciscoDot11WidsMIBGroups=ciscoDot11WidsMIBGroups, cDot11WidsSelPairWiseCipher=cDot11WidsSelPairWiseCipher, cDot11WidsBlackListEntry=cDot11WidsBlackListEntry, PYSNMP_MODULE_ID=ciscoDot11WidsMIB, cDot11WidsBlackListDuration=cDot11WidsBlackListDuration, cDot11WidsProtectFailClientEntry=cDot11WidsProtectFailClientEntry, cDot11WidsFloodDetectEnable=cDot11WidsFloodDetectEnable, cDot11WidsBlackListClientMac=cDot11WidsBlackListClientMac, ciscoDot11WidsMIBConform=ciscoDot11WidsMIBConform)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_size_constraint, constraints_intersection, value_range_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ConstraintsUnion') (cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt') (if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex') (notification_group, object_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ObjectGroup', 'ModuleCompliance') (object_identity, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, integer32, counter32, unsigned32, time_ticks, counter64, ip_address, notification_type, bits, module_identity, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'Integer32', 'Counter32', 'Unsigned32', 'TimeTicks', 'Counter64', 'IpAddress', 'NotificationType', 'Bits', 'ModuleIdentity', 'Gauge32') (mac_address, truth_value, time_stamp, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'MacAddress', 'TruthValue', 'TimeStamp', 'DisplayString', 'TextualConvention') cisco_dot11_wids_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 456)) ciscoDot11WidsMIB.setRevisions(('2004-11-30 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoDot11WidsMIB.setRevisionsDescriptions(('Initial version of this MIB module. ',)) if mibBuilder.loadTexts: ciscoDot11WidsMIB.setLastUpdated('200411300000Z') if mibBuilder.loadTexts: ciscoDot11WidsMIB.setOrganization('Cisco System Inc.') if mibBuilder.loadTexts: ciscoDot11WidsMIB.setContactInfo(' Cisco Systems, Customer Service Postal: 170 West Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-dot11@cisco.com') if mibBuilder.loadTexts: ciscoDot11WidsMIB.setDescription('This MIB is intended to be implemented on the following IOS based network entities for the purpose of providing network management stations information about the various attempts to compromise the security in the 802.11-based wireless networks. (i) 802.11 Access Points that accept wireless client associations. The MIB reports the information about the following attacks that can happen either at the initial authentication phase or during normal data communication between the client and the AP. EAPOL flooding - This is an attempt made by an invalid 802.11 client to send too many EAPOL-Start messages and bring the authentication services on the Authenticator, typically the AP, down. BlackListing - This is the process of marking a client as invalid when its authentication attempts fail. The client is put in a list when its authentication attempt fails for the first time. If the number of consecutive failed authentication attempts reach a threshold, any subsequent authentication requests made by the client will be rejected from that point for a configurable period of time. Protection Failures - These kind of failures happen when the attacker injects invalid packets onto the wireless network thereby corrupting the 802.11 data traffic between an AP and its associated wireless clients. The administrator, through the NMS, can configure the thresholds on the AP using this MIB to enable the AP detect the EAPOL flood attacks and provide related statistics to the NMS. To detect protection failures, the AP provides the relevant statistics about the protection errors in the form of MIB objects, which are compared against the thresholds configured on the NMS and appropriate events are raised by the NMS, if thresholds are found to be exceeded. The hierarchy of the AP and MNs is as follows. +~-~-~+ +~-~-~+ +~-~-~+ +~-~-~+ + + + + + + + + + AP + + AP + + AP + + AP + + + + + + + + + +~-~-~+ +~-~-~+ +~-~-~+ +~-~-~+ .. . . . .. . . . . . . . . . . . . . . . . . . . . . . . \\/ \\/ \\/ \\/ \\/ +.....+ +.....+ +-.-.-.+ +~-~-~+ +......+ + + + + + + + + + + + MN + + MN + + MN + + MN + + MN + + + + + + + + + + + +.....+ +.....+ +-.-.-.+ +~-~-~+ +......+ The wireless connections are represented as dotted lines in the above diagram. GLOSSARY Access Point ( AP ) An entity that contains an 802.11 medium access control ( MAC ) and physical layer ( PHY ) interface and provides access to the distribution services via the wireless medium for associated clients. Mobile Node ( MN ) A roaming 802.11 wireless device in a wireless network associated with an access point. Service Set Identifier (SSID) The Radio Service Set ID that is used by the mobile wireless clients for identification during the association with the APs. Temporal Key Integrity Protocol (TKIP) A security protocol defined to enhance the limitations of WEP. Message Integrity Check and per-packet keying on all WEP-encrypted frames are two significant enhancements provided by TKIP to WEP. Counter mode with CBC-MAC Protocol (CCMP) A security protocol that uses the counter mode in conjunction with cipher block chaining. This method divides the data into blocks, encrypts the first block, XORs the results with the second block, encrypts the result, XORs the result with the next block and continues till all the blocks are processed. This way, this protocol derives a 64-bit MIC which is appended to the plaintext data which is again encrypted using the counter mode. Message Integrity Check (MIC) The Message Integrity Check is an improvement over the Integrity Check Function (ICV) of the 802.11 standard. MIC adds two new fields to the wireless frames - a sequence number field for detecting out-of-order frames and a MIC field to provide a frame integrity check to overcome the mathematical shortcomings of the ICV. 802.1x The IEEE ratified standard for enforcing port based access control. This was originally intended for use on wired LANs and later extended for use in 802.11 WLAN environments. This defines an architecture with three main parts - a supplicant (Ex. an 802.11 wireless client), an authenticator (the AP) and an authentication server(a Radius server). The authenticator passes messages back and forth between the supplicant and the authentication server to enable the supplicant get authenticated to the network. Extensible Authentication Protocol Over LAN (EAPOL) This is an encapsulation method defined by 802.1x passing EAP packets over Ethernet frames. ') cisco_dot11_wids_mib_notifs = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 0)) cisco_dot11_wids_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 1)) cisco_dot11_wids_auth_failures = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1)) cisco_dot11_wids_protect_failures = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2)) cisco_dot11_wids_mib_conform = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 2)) cisco_dot11_wids_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 2, 1)) cisco_dot11_wids_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 456, 2, 2)) c_dot11_wids_flood_detect_enable = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 1), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: cDot11WidsFloodDetectEnable.setStatus('current') if mibBuilder.loadTexts: cDot11WidsFloodDetectEnable.setDescription("This object is used to enable or disable the WIDS flood detection feature. Set this MIB object to 'true' to enable the flood detection and 'false' to disable it. Note that the values configured through cDot11WidsFloodThreshold and cDot11WidsEapolFloodInterval take effect only if flood detection is enabled through this MIB object. ") c_dot11_wids_eapol_flood_threshold = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 512)).clone(3)).setUnits('attempts').setMaxAccess('readwrite') if mibBuilder.loadTexts: cDot11WidsEapolFloodThreshold.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodThreshold.setDescription('This object specifies the maximum number of authentication attempts allowed for all the clients taken together in the interval specified by cDot11WidsEapolFloodInterval. The attempts include both the successful as well as failed attempts. ') c_dot11_wids_eapol_flood_interval = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 300)).clone(60)).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: cDot11WidsEapolFloodInterval.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodInterval.setDescription('This object specifies the time duration for which the client authentication attempts have to be monitored for detecting the flood attack. ') c_dot11_wids_black_list_threshold = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 512)).clone(3)).setUnits('attempts').setMaxAccess('readwrite') if mibBuilder.loadTexts: cDot11WidsBlackListThreshold.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListThreshold.setDescription('This object configures the maximum threshold on the number of unsuccessful authentication attempts, that can be made by a particular client. Once the threshold is reached, the client is retained in the list for a period of time equal to the value configured through cDot11WidsBlackListDuration, during which its attempts to get authenticated are blocked. ') c_dot11_wids_black_list_duration = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 5), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 300)).clone(60)).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: cDot11WidsBlackListDuration.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListDuration.setDescription('This object indicates the time duration for which a particular client has to be kept in the black list after the number of unsuccessful attempts reach the threshold given by cDot11WidsBlackListThreshold. ') c_dot11_wids_flood_max_entries_per_intf = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: cDot11WidsFloodMaxEntriesPerIntf.setStatus('current') if mibBuilder.loadTexts: cDot11WidsFloodMaxEntriesPerIntf.setDescription('This object indicates the maximum number of entries that can be held for a particular 802.11 radio interface identified by ifIndex. ') c_dot11_wids_eapol_flood_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7)) if mibBuilder.loadTexts: cDot11WidsEapolFloodTable.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodTable.setDescription("This table gives the statistics on the EAPOL flood attacks observed at this radio interface. An entry in this table is created by the agent when this 802.11 station detects an EAPOL flood attack. All the columns in the entries except the cDot11WidsEapolFloodStopTime are populated when the attack is observed first. The object cDot11WidsEapolFloodStopTime is populated when no flood conditions are observed following the initial observation at the time indicated by cDot11WidsEapolFloodStartTime. This can be illustrated by the following example. Assume that the monitoring interval is configured to 1 minute through the cDot11WidsEapolFloodInterval object and the number of attempts is set to 5. At the end of the first minute after this configuration is made, client c1 is found to have made 4 attempts and another client c2 have made 3. Hence, in total, the attempt count exceeds 7 and the agent adds a new row to this table. The cDot11WidsFloodStopTime carries a value of 0 at this point in the newly added row. The MIB object cDot11WidsEapolFloodClientMac at this point holds the MAC address of c1 and cDot11WidsEapolFloodClientCount holds the value of 4. At the end of the second interval, assume that the clients are found to have made only 4 attempts in total with c1 and c2 making 3 and 1 attempt(s) respectively. Now the total count is not found to exceed the threshold. Hence the flood is observed to be stopped. The object cDot11WidsEapolFloodStopTime is now populated with this time at which the flood is observed to be stopped. The MIB object cDot11WidsEapolFloodClientMac at this point holds c1's MAC address and cDot11WidsEapolFloodClientCount would hold a value of 7. If the count is found to exceed in the next interval, it will be treated as a beginning of a new flood event and hence a new entry will be created for the same. Assume the case where, at the end of the second interval, the total count continues at the rate above the threshold, with c1 making 5 and c2 making 2 attempts respectively. Since the flood is not observed to be stopped, the object cDot11WidsFloodStopTime continues to hold a value of zero. The agent at anytime will retain only the most recent and maximum number of entries, as given by cDot11WidsFloodMaxEntriesPerIntf, for a particular value of ifIndex. The older entries are purged automatically when the number of entries for a particular ifIndex reaches its maximum. This table has a expansion dependent relationship with ifTable defined in IF-MIB. There exists a row in this table corresponding to the row for each interface of iftype ieee80211(71) found in ifTable. cDot11WidsEapolFloodIndex acts as the expansion index. ") c_dot11_wids_eapol_flood_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'CISCO-DOT11-WIDS-MIB', 'cDot11WidsEapolFloodIndex')) if mibBuilder.loadTexts: cDot11WidsEapolFloodEntry.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodEntry.setDescription('An entry holds the statistics about one instance of EAPOL flood attack observed at this particular radio interface. ') c_dot11_wids_eapol_flood_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 100))) if mibBuilder.loadTexts: cDot11WidsEapolFloodIndex.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodIndex.setDescription('This object identifies the set of information about one instance of an EAPOL flood event observed at this radio interface between the start and stop times indicated by cDot11WidsEapolFloodStartTime and cDot11WidsEapolFloodStopTime. ') c_dot11_wids_eapol_flood_client_mac = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 2), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsEapolFloodClientMac.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodClientMac.setDescription('This object identifies the MAC address of the wireless client that has made the maximum number of authentication attempts in the duration specified by the cDot11WidsEapolFloodInterval object. At the end of each interval time indicated by cDot11WidsFloodInterval, the 802.11 station checks whether the total count of the number of authentication attempts made by all the clients exceed the threshold configured through the object cDot11WidsEapolFloodThreshold. If yes, then the agent populates this MIB object with the MAC of the wireless client that has made the maximum number of authentication attempts in that interval. When the flood event is observed to be stopped, as indicated by a non-zero value for the cDot11WidsEapolFloodStopTime object, this object indicates the MAC of the wireless client that has made the maximum number of attempts for the entire duration of the flood observed between the times indicated by the objects cDot11WidsEapolFloodStartTime and cDot11WidsEapolFloodStopTime respectively. ') c_dot11_wids_eapol_flood_client_count = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 3), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsEapolFloodClientCount.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodClientCount.setDescription('This object provides the count associated with the client with largest number of attempts in the last interval. When the flood event is observed to be stopped, as indicated by a non-zero value for the cDot11WidsEapolFloodStopTime object, this object gives the count associated with the client with the largest number of attempts, for the entire duration of the flood observed between the times indicated by the objects cDot11WidsEapolFloodStartTime and cDot11WidsEapolFloodStopTime respectively. ') c_dot11_wids_eapol_flood_start_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 4), time_stamp()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsEapolFloodStartTime.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodStartTime.setDescription('This object indicates the time at which the EAPOL flood event identified by one entry of this table was observed first at this radio interface. ') c_dot11_wids_eapol_flood_stop_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 5), time_stamp()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsEapolFloodStopTime.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodStopTime.setDescription('This object indicates the time at which the the EAPOL flood event observed first at the time indicated by cDot11WidsEapolFloodStartTime has stopped. If this 802.11 station finds that the flood conditions observed in the one or more prior intervals has ceased, it marks the flood event as stopped at the time indicated by this object. That the flood has ceased is indicated by the number of authentication attempts dropping below the value specified by the cDot11WidsEapolFloodThreshold object. A value of 0 for this object indicates that the number of authentication attempts continue to exceed the value specified by the cDot11WidsEapolFloodThreshold object. ') c_dot11_wids_eapol_flood_total_count = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 7, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsEapolFloodTotalCount.setStatus('current') if mibBuilder.loadTexts: cDot11WidsEapolFloodTotalCount.setDescription('This object gives the accumulated count of the number of authentication attempts made by all the clients at the time of query. ') c_dot11_wids_black_list_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 8)) if mibBuilder.loadTexts: cDot11WidsBlackListTable.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListTable.setDescription('This table gives the information about the 802.11 wireless clients that have been blacklisted while attempting to get authenticated with this 802.11 station at this radio interface. An entry is added to this table when the number of consecutive failed authentication attempts made by a client equals the value configured through cDot11WidsBlackListThreshold. The client will then be blocked from getting authenticated for a time period equal to the value configured through cDot11WidsBlackListDuration. After this time elapses, the client is taken off from the list and the agent automatically removes the entry corresponding to that client from this table. This table has a expansion dependent relationship on the ifTable. For each entry in this table, there exists at least an entry in the ifTable of ifType ieee80211(71). cDot11BlackListIndex acts as the expansion index. ') c_dot11_wids_black_list_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 8, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'CISCO-DOT11-WIDS-MIB', 'cDot11WidsBlackListClientMac')) if mibBuilder.loadTexts: cDot11WidsBlackListEntry.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListEntry.setDescription('Each entry holds the information about one 802.11 wireless client that has been blacklisted when attempting to get authenticated with this 802.11 station at this radio interface. ') c_dot11_wids_black_list_client_mac = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 8, 1, 1), mac_address()) if mibBuilder.loadTexts: cDot11WidsBlackListClientMac.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListClientMac.setDescription('This object indicates the Mac Address of the blacklisted client. ') c_dot11_wids_black_list_attempt_count = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 8, 1, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsBlackListAttemptCount.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListAttemptCount.setDescription('This object counts the total number of attempts made by the client identified by cDot11WidsBlackListClientMac to get authenticated with the 802.11 station through this radio interface. ') c_dot11_wids_black_list_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 1, 8, 1, 3), time_stamp()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsBlackListTime.setStatus('current') if mibBuilder.loadTexts: cDot11WidsBlackListTime.setDescription('This object indicates the time at which the client was blacklisted after failing in its attempt to get authenticated with this 802.11 station at this radio interface. ') c_dot11_wids_protect_fail_client_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1)) if mibBuilder.loadTexts: cDot11WidsProtectFailClientTable.setStatus('current') if mibBuilder.loadTexts: cDot11WidsProtectFailClientTable.setDescription('This table gives the statistics on the various protection failures occurred during the data communication of this 802.11 station with a particular client currently associated at this dot11 interface. Note that the agent populates this table with an entry for an associated client if and only if at least one of the error statistics, as reported by the counter-type objects of this table, has a non-zero value. This table has a expansion dependent relationship on the ifTable. For each entry in this table, there exists at least an entry in the ifTable of ifType ieee80211(71). cDot11WidsSsid and cDot11WidsClientMacAddress act as the expansion indices. ') c_dot11_wids_protect_fail_client_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'CISCO-DOT11-WIDS-MIB', 'cDot11WidsSsid'), (0, 'CISCO-DOT11-WIDS-MIB', 'cDot11WidsClientMacAddress')) if mibBuilder.loadTexts: cDot11WidsProtectFailClientEntry.setStatus('current') if mibBuilder.loadTexts: cDot11WidsProtectFailClientEntry.setDescription('Each entry holds the information about the protection failures observed at this radio interface when this 802.11 station communicates with its associated client identified by cDot11WidsClientMacAddress at the interface identified by ifIndex. The clients are grouped according to the SSIDs they use for their association with the dot11 interface. ') c_dot11_wids_ssid = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(1, 32))) if mibBuilder.loadTexts: cDot11WidsSsid.setStatus('current') if mibBuilder.loadTexts: cDot11WidsSsid.setDescription('This object specifies one of the SSIDs of this radio interface using which the client has associated with the 802.11 station. ') c_dot11_wids_client_mac_address = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 2), mac_address()) if mibBuilder.loadTexts: cDot11WidsClientMacAddress.setStatus('current') if mibBuilder.loadTexts: cDot11WidsClientMacAddress.setDescription('This object identifies the MAC address of the associated client to which this set of statistics are applicable. ') c_dot11_wids_sel_pair_wise_cipher = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsSelPairWiseCipher.setReference('Section 7.3.2.25.1, 802.11i Amendment 6: Medium Access Control(MAC) Security Enhancements. ') if mibBuilder.loadTexts: cDot11WidsSelPairWiseCipher.setStatus('current') if mibBuilder.loadTexts: cDot11WidsSelPairWiseCipher.setDescription('This object identifies the pairwise cipher used by the client identified by cDot11WidsClientMacAddress during its association with this 802.11 station at the interface identified by ifIndex. ') c_dot11_wids_tkip_icv_errors = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsTkipIcvErrors.setStatus('current') if mibBuilder.loadTexts: cDot11WidsTkipIcvErrors.setDescription("This object counts the total number of TKIP ICV Errors observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") c_dot11_wids_tkip_local_mic_failures = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsTkipLocalMicFailures.setStatus('current') if mibBuilder.loadTexts: cDot11WidsTkipLocalMicFailures.setDescription("This object counts the total number of TKIP local MIC failures observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") c_dot11_wids_tkip_remote_mic_failures = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsTkipRemoteMicFailures.setStatus('current') if mibBuilder.loadTexts: cDot11WidsTkipRemoteMicFailures.setDescription("This object counts the total number of TKIP remote MIC failures observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") c_dot11_wids_ccmp_replays = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsCcmpReplays.setStatus('current') if mibBuilder.loadTexts: cDot11WidsCcmpReplays.setDescription("This object counts the total number of CCMP replay failures observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") c_dot11_wids_ccmp_decrypt_errors = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsCcmpDecryptErrors.setStatus('current') if mibBuilder.loadTexts: cDot11WidsCcmpDecryptErrors.setDescription("This object counts the total number of CCMP decryption failures observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") c_dot11_wids_tkip_replays = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsTkipReplays.setStatus('current') if mibBuilder.loadTexts: cDot11WidsTkipReplays.setDescription("This object counts the total number of TKIP replay failures observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") c_dot11_wids_wep_replays = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsWepReplays.setStatus('current') if mibBuilder.loadTexts: cDot11WidsWepReplays.setDescription("This object counts the total number of WEP Replay errors observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") c_dot11_wids_wep_icv_errors = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsWepIcvErrors.setStatus('current') if mibBuilder.loadTexts: cDot11WidsWepIcvErrors.setDescription("This object counts the total number of WEP ICV errors observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") c_dot11_wids_ckip_replays = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsCkipReplays.setStatus('current') if mibBuilder.loadTexts: cDot11WidsCkipReplays.setDescription("This object counts the total number of CKIP replay errors observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") c_dot11_wids_ckip_cmic_errors = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 456, 1, 2, 1, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cDot11WidsCkipCmicErrors.setStatus('current') if mibBuilder.loadTexts: cDot11WidsCkipCmicErrors.setDescription("This object counts the total number of CKIP-CMIC errors observed in the data communication between this 802.11 station and the client indicated by cDot11WidsClientMacAddress since the client's association with this 802.11 station at the radio interface identified by ifIndex. ") cisco_dot11_wids_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 456, 2, 1, 1)).setObjects(('CISCO-DOT11-WIDS-MIB', 'ciscoDot11WidsAuthFailGroup'), ('CISCO-DOT11-WIDS-MIB', 'ciscoDot11WidsProtectFailGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_dot11_wids_mib_compliance = ciscoDot11WidsMIBCompliance.setStatus('current') if mibBuilder.loadTexts: ciscoDot11WidsMIBCompliance.setDescription('The compliance statement for the SNMP entities that implement the ciscoDot11WidsMIB module.') cisco_dot11_wids_auth_fail_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 456, 2, 2, 1)).setObjects(('CISCO-DOT11-WIDS-MIB', 'cDot11WidsFloodDetectEnable'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsEapolFloodThreshold'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsEapolFloodInterval'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsBlackListThreshold'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsBlackListDuration'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsFloodMaxEntriesPerIntf'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsEapolFloodTotalCount'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsEapolFloodClientMac'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsEapolFloodClientCount'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsEapolFloodStartTime'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsEapolFloodStopTime'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsBlackListAttemptCount'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsBlackListTime')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_dot11_wids_auth_fail_group = ciscoDot11WidsAuthFailGroup.setStatus('current') if mibBuilder.loadTexts: ciscoDot11WidsAuthFailGroup.setDescription('This collection of objects provide information about configuration needed on the 802.11 station to detect the EAPOL flood attacks and black-list clients, the general statistics about the detected flood flood attacks and the information about the blacklisted clients. ') cisco_dot11_wids_protect_fail_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 456, 2, 2, 2)).setObjects(('CISCO-DOT11-WIDS-MIB', 'cDot11WidsSelPairWiseCipher'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsTkipIcvErrors'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsTkipLocalMicFailures'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsTkipRemoteMicFailures'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsCcmpReplays'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsCcmpDecryptErrors'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsTkipReplays'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsWepReplays'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsWepIcvErrors'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsCkipReplays'), ('CISCO-DOT11-WIDS-MIB', 'cDot11WidsCkipCmicErrors')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_dot11_wids_protect_fail_group = ciscoDot11WidsProtectFailGroup.setStatus('current') if mibBuilder.loadTexts: ciscoDot11WidsProtectFailGroup.setDescription("This collection of objects provide information about the various protection failures observed during the associated clients' data communications with this 802.11 station. ") mibBuilder.exportSymbols('CISCO-DOT11-WIDS-MIB', cDot11WidsCkipReplays=cDot11WidsCkipReplays, cDot11WidsEapolFloodStopTime=cDot11WidsEapolFloodStopTime, ciscoDot11WidsProtectFailures=ciscoDot11WidsProtectFailures, cDot11WidsClientMacAddress=cDot11WidsClientMacAddress, cDot11WidsEapolFloodInterval=cDot11WidsEapolFloodInterval, cDot11WidsTkipReplays=cDot11WidsTkipReplays, cDot11WidsTkipRemoteMicFailures=cDot11WidsTkipRemoteMicFailures, cDot11WidsEapolFloodThreshold=cDot11WidsEapolFloodThreshold, ciscoDot11WidsMIBCompliance=ciscoDot11WidsMIBCompliance, cDot11WidsProtectFailClientTable=cDot11WidsProtectFailClientTable, cDot11WidsBlackListTable=cDot11WidsBlackListTable, ciscoDot11WidsAuthFailGroup=ciscoDot11WidsAuthFailGroup, ciscoDot11WidsMIBNotifs=ciscoDot11WidsMIBNotifs, cDot11WidsBlackListAttemptCount=cDot11WidsBlackListAttemptCount, cDot11WidsBlackListThreshold=cDot11WidsBlackListThreshold, cDot11WidsWepReplays=cDot11WidsWepReplays, ciscoDot11WidsMIBCompliances=ciscoDot11WidsMIBCompliances, cDot11WidsBlackListTime=cDot11WidsBlackListTime, ciscoDot11WidsMIB=ciscoDot11WidsMIB, cDot11WidsSsid=cDot11WidsSsid, cDot11WidsEapolFloodStartTime=cDot11WidsEapolFloodStartTime, cDot11WidsEapolFloodTable=cDot11WidsEapolFloodTable, ciscoDot11WidsMIBObjects=ciscoDot11WidsMIBObjects, ciscoDot11WidsProtectFailGroup=ciscoDot11WidsProtectFailGroup, cDot11WidsEapolFloodClientMac=cDot11WidsEapolFloodClientMac, cDot11WidsEapolFloodClientCount=cDot11WidsEapolFloodClientCount, cDot11WidsFloodMaxEntriesPerIntf=cDot11WidsFloodMaxEntriesPerIntf, cDot11WidsEapolFloodIndex=cDot11WidsEapolFloodIndex, ciscoDot11WidsAuthFailures=ciscoDot11WidsAuthFailures, cDot11WidsCcmpDecryptErrors=cDot11WidsCcmpDecryptErrors, cDot11WidsCkipCmicErrors=cDot11WidsCkipCmicErrors, cDot11WidsTkipIcvErrors=cDot11WidsTkipIcvErrors, cDot11WidsTkipLocalMicFailures=cDot11WidsTkipLocalMicFailures, cDot11WidsEapolFloodEntry=cDot11WidsEapolFloodEntry, cDot11WidsEapolFloodTotalCount=cDot11WidsEapolFloodTotalCount, cDot11WidsCcmpReplays=cDot11WidsCcmpReplays, cDot11WidsWepIcvErrors=cDot11WidsWepIcvErrors, ciscoDot11WidsMIBGroups=ciscoDot11WidsMIBGroups, cDot11WidsSelPairWiseCipher=cDot11WidsSelPairWiseCipher, cDot11WidsBlackListEntry=cDot11WidsBlackListEntry, PYSNMP_MODULE_ID=ciscoDot11WidsMIB, cDot11WidsBlackListDuration=cDot11WidsBlackListDuration, cDot11WidsProtectFailClientEntry=cDot11WidsProtectFailClientEntry, cDot11WidsFloodDetectEnable=cDot11WidsFloodDetectEnable, cDot11WidsBlackListClientMac=cDot11WidsBlackListClientMac, ciscoDot11WidsMIBConform=ciscoDot11WidsMIBConform)
SETTING_SERVER_CLOCK = "RAZBERRY_CLOCK" SETTING_SERVER_TIME = "RAZBERRY_TIME" SETTING_LAST_UPDATE = "LAST_UPDATED" SETTING_SERVER_ADDRRESS = "RAZBERRY_SERVER" SETTING_SERVICE_TIMEOUT = "SERVICE_TIMEOUT"
setting_server_clock = 'RAZBERRY_CLOCK' setting_server_time = 'RAZBERRY_TIME' setting_last_update = 'LAST_UPDATED' setting_server_addrress = 'RAZBERRY_SERVER' setting_service_timeout = 'SERVICE_TIMEOUT'
# Example 1 i = 0 while i <= 10: print(i) i += 1 # Example 2 available_fruits = ["Apple", "Pearl", "Banana", "Grapes"] chosen_fruit = '' print("We have the following available fruits: Apple, Pearl, Banana, Grapes") while chosen_fruit not in available_fruits: chosen_fruit = input("Please choose one of the options above: ") if chosen_fruit == "exit": print("Good bye!") break else: print("Enjoy your fruit!")
i = 0 while i <= 10: print(i) i += 1 available_fruits = ['Apple', 'Pearl', 'Banana', 'Grapes'] chosen_fruit = '' print('We have the following available fruits: Apple, Pearl, Banana, Grapes') while chosen_fruit not in available_fruits: chosen_fruit = input('Please choose one of the options above: ') if chosen_fruit == 'exit': print('Good bye!') break else: print('Enjoy your fruit!')
class PaymentError(Exception): pass class MpesaError(PaymentError): pass class InvalidTransactionAmount(MpesaError): pass
class Paymenterror(Exception): pass class Mpesaerror(PaymentError): pass class Invalidtransactionamount(MpesaError): pass
def balancedStringSplit(self, s: str) -> int: l, r = 0, 0 c = 0 for i in range(len(s)): if s[i] == "L": l += 1 if s[i] == "R": r+=1 if l == r: c+=1 return c
def balanced_string_split(self, s: str) -> int: (l, r) = (0, 0) c = 0 for i in range(len(s)): if s[i] == 'L': l += 1 if s[i] == 'R': r += 1 if l == r: c += 1 return c
def fail(): raise Exception("Ooops") def main(): fail() print("We will never reach here") try: main() except Exception as exc: print("Some kind of exception happened") print(exc)
def fail(): raise exception('Ooops') def main(): fail() print('We will never reach here') try: main() except Exception as exc: print('Some kind of exception happened') print(exc)
PREPROD_ENV = 'UAT' PROD_ENV = 'PROD' PREPROD_URL = "https://mercury-uat.phonepe.com" PROD_URL = "https://mercury.phonepe.com" URLS = {PREPROD_ENV:PREPROD_URL,PROD_ENV:PROD_URL}
preprod_env = 'UAT' prod_env = 'PROD' preprod_url = 'https://mercury-uat.phonepe.com' prod_url = 'https://mercury.phonepe.com' urls = {PREPROD_ENV: PREPROD_URL, PROD_ENV: PROD_URL}
"""\ Bunch.py: Generic collection that can be accessed as a class. This can be easily overrided and used as container for a variety of objects. This program is part of the PyQuante quantum chemistry program suite Copyright (c) 2004, Richard P. Muller. All Rights Reserved. PyQuante version 1.2 and later is covered by the modified BSD license. Please see the file LICENSE that is part of this distribution. """ # Bunch is a generic object that can hold data. You can access it # using object syntax: b.attr1, b.attr2, etc., which makes it simpler # than a dictionary class Bunch: def __init__(self,**keyw): for key in keyw.keys(): self.__dict__[key] = keyw[key] return
""" Bunch.py: Generic collection that can be accessed as a class. This can be easily overrided and used as container for a variety of objects. This program is part of the PyQuante quantum chemistry program suite Copyright (c) 2004, Richard P. Muller. All Rights Reserved. PyQuante version 1.2 and later is covered by the modified BSD license. Please see the file LICENSE that is part of this distribution. """ class Bunch: def __init__(self, **keyw): for key in keyw.keys(): self.__dict__[key] = keyw[key] return
class FanHealthStatus(object): def read_get(self, name, idx_name, unity_client): return unity_client.get_fan_health_status(idx_name) class FanHealthStatusColumn(object): def get_idx(self, name, idx, unity_client): return unity_client.get_fans()
class Fanhealthstatus(object): def read_get(self, name, idx_name, unity_client): return unity_client.get_fan_health_status(idx_name) class Fanhealthstatuscolumn(object): def get_idx(self, name, idx, unity_client): return unity_client.get_fans()
# Time: O(26 * n) # Space: O(26 * n) class UnionFind(object): # Time: O(n * alpha(n)), Space: O(n) def __init__(self, n): self.set = range(n) self.rank = [0]*n self.size = [1]*n self.total = n def find_set(self, x): stk = [] while self.set[x] != x: # path compression stk.append(x) x = self.set[x] while stk: self.set[stk.pop()] = x return x def union_set(self, x, y): x, y = self.find_set(x), self.find_set(y) if x == y: return False if self.rank[x] > self.rank[y]: # union by rank x, y = y, x self.set[x] = self.set[y] if self.rank[x] == self.rank[y]: self.rank[y] += 1 self.size[y] += self.size[x] self.total -= 1 return True # bitmasks, union find class Solution(object): def groupStrings(self, words): """ :type words: List[str] :rtype: List[int] """ uf = UnionFind(len(words)) lookup = {} for i, x in enumerate(words): mask = reduce(lambda x, y: x|(1<<(ord(y)-ord('a'))), x, 0) if mask not in lookup: lookup[mask] = i uf.union_set(i, lookup[mask]) bit = 1 while bit <= mask: if mask&bit: if mask^bit not in lookup: lookup[mask^bit] = i uf.union_set(i, lookup[mask^bit]) bit <<= 1 return [uf.total, max(uf.size)]
class Unionfind(object): def __init__(self, n): self.set = range(n) self.rank = [0] * n self.size = [1] * n self.total = n def find_set(self, x): stk = [] while self.set[x] != x: stk.append(x) x = self.set[x] while stk: self.set[stk.pop()] = x return x def union_set(self, x, y): (x, y) = (self.find_set(x), self.find_set(y)) if x == y: return False if self.rank[x] > self.rank[y]: (x, y) = (y, x) self.set[x] = self.set[y] if self.rank[x] == self.rank[y]: self.rank[y] += 1 self.size[y] += self.size[x] self.total -= 1 return True class Solution(object): def group_strings(self, words): """ :type words: List[str] :rtype: List[int] """ uf = union_find(len(words)) lookup = {} for (i, x) in enumerate(words): mask = reduce(lambda x, y: x | 1 << ord(y) - ord('a'), x, 0) if mask not in lookup: lookup[mask] = i uf.union_set(i, lookup[mask]) bit = 1 while bit <= mask: if mask & bit: if mask ^ bit not in lookup: lookup[mask ^ bit] = i uf.union_set(i, lookup[mask ^ bit]) bit <<= 1 return [uf.total, max(uf.size)]
__all__ = ['authorize', 'config', 'interactive', 'process']
__all__ = ['authorize', 'config', 'interactive', 'process']
XM_OFF = 649.900675 YM_OFF = -25400.296854 ZM_OFF = 15786.311942 MM_00 = 0.990902 MM_01 = 0.006561 MM_02 = 0.006433 MM_10 = 0.006561 MM_11 = 0.978122 MM_12 = 0.006076 MM_20 = 0.006433 MM_21 = 0.006076 MM_22 = 0.914589 XA_OFF = 0.141424 YA_OFF = 0.380157 ZA_OFF = -0.192037 AC_00 = 100.154822 AC_01 = 0.327635 AC_02 = -0.321495 AC_10 = 0.327635 AC_11 = 102.504150 AC_12 = -1.708150 AC_20 = -0.321495 AC_21 = -1.708150 AC_22 = 103.199592 MFSTR = +43.33
xm_off = 649.900675 ym_off = -25400.296854 zm_off = 15786.311942 mm_00 = 0.990902 mm_01 = 0.006561 mm_02 = 0.006433 mm_10 = 0.006561 mm_11 = 0.978122 mm_12 = 0.006076 mm_20 = 0.006433 mm_21 = 0.006076 mm_22 = 0.914589 xa_off = 0.141424 ya_off = 0.380157 za_off = -0.192037 ac_00 = 100.154822 ac_01 = 0.327635 ac_02 = -0.321495 ac_10 = 0.327635 ac_11 = 102.50415 ac_12 = -1.70815 ac_20 = -0.321495 ac_21 = -1.70815 ac_22 = 103.199592 mfstr = +43.33
# The mathematical modulo is used to calculate the remainder of the # integer division. As an example, 102%25 is 2. # Write a function that takes two values as parameters and returns # the calculation of a modulo from the two values. def mathematical_modulo(a, b): ''' divide a by b, return the remainder ''' return a % b print('Divide 100 by 25, remainder is: ', mathematical_modulo(100, 25)) print('Divide 102 by 25, remainder is: ', mathematical_modulo(102, 25))
def mathematical_modulo(a, b): """ divide a by b, return the remainder """ return a % b print('Divide 100 by 25, remainder is: ', mathematical_modulo(100, 25)) print('Divide 102 by 25, remainder is: ', mathematical_modulo(102, 25))
class CohereError(Exception): def __init__( self, message=None, http_status=None, headers=None, ) -> None: super(CohereError, self).__init__(message) self.message = message self.http_status = http_status self.headers = headers or {} def __str__(self) -> str: msg = self.message or '<empty message>' return msg def __repr__(self) -> str: return '%s(message=%r, http_status=%r, request_id=%r)' % ( self.__class__.__name__, self.message, self.http_status, )
class Cohereerror(Exception): def __init__(self, message=None, http_status=None, headers=None) -> None: super(CohereError, self).__init__(message) self.message = message self.http_status = http_status self.headers = headers or {} def __str__(self) -> str: msg = self.message or '<empty message>' return msg def __repr__(self) -> str: return '%s(message=%r, http_status=%r, request_id=%r)' % (self.__class__.__name__, self.message, self.http_status)