content
stringlengths
7
1.05M
""" Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution. Example: Given array nums = [-1, 2, 1, -4], and target = 1. The sum that is closest to the target is 2. (-1 + 2 + 1 = 2). """ class Solution(object): def threeSumClosest(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ nums = sorted(nums) closest_sum = sum(nums[-3:]) for i in range(len(nums)): head, tail = i + 1, len(nums) - 1 while head < tail: total = nums[i] + nums[head] + nums[tail] if abs(closest_sum - target) > abs(total - target): closest_sum = total if total > target: tail -= 1 else: head += 1 return closest_sum nums = [-1, 2, 1, -4] target = 1 s = Solution() r = s.threeSumClosest(nums, target) print(r) nums = [0, 0, 0] target = 1 s = Solution() r = s.threeSumClosest(nums, target) print(r)
__version__ = "0.0.1" def func(a: int, b: int = 0, c: int = 0) -> int: """Test function. Args: a (int): Parameter A. b (int, optional): Parameter B. c (int, optional): Parameter C. Returns: sum: The sum of A, B, and C. """ return a + b + c
class UserInputError( Exception): pass
real_number = int(input()) numbers = [] names = [] def find_closer(): diferences = [] closers = [] global numbers global real_number for i in numbers: diference = real_number - i if diference < 0: diferences.append(-diference) else: diferences.append(diference) minimum = min(diferences) for i in range(diferences.__len__()): if(diferences[i] == minimum): closers.append(i) return closers inp = int(input()) for i in range(inp): aposta = input() space = aposta.find(" ") number = int(aposta[:space]) name = aposta[space+1:] numbers.append(number) names.append(name) to_print = "" for i in find_closer(): to_print += names[i]+" " print(to_print[:to_print.__len__()-1])
NODE_LEFT = "LEFT" NODE_RIGHT = "RIGHT" NODE_ROOT = "ROOT" class BinarySearchTree: def __init__(self, value): self.value = value self.left = None self.right = None self.parent = None self.type = None def insert(self, tree): current = self while 1: if tree.value < current.value: if current.left is None: current.left = tree tree.parent = current tree.type = NODE_LEFT return else: current = current.left else: if current.right is None: tree.parent = current current.right = tree tree.type = NODE_RIGHT return else: current = current.right def dig(self): current = self while 1: if current.left is not None: current = current.left elif current.right is not None: current = current.right else: break return current def post_order_traverse(self, on_visit): to_visit = [self] while len(to_visit) > 0: current = to_visit.pop(0) on_visit(current.value) if current.type == NODE_LEFT: if current.parent.right is not None: to_visit.append(current.parent.right.dig()) else: to_visit.append(current.parent) elif current.type == NODE_RIGHT: to_visit.append(current.parent) root = BinarySearchTree(int(input())) root.type = NODE_ROOT try: while 1: child = BinarySearchTree(int(input())) root.insert(child) except EOFError: pass root.dig().post_order_traverse(print)
load("//apple:string_dict_select_values.bzl", "string_dict_select_values") def _impl(ctx): substitutions = {} for key, value in ctx.attr.items(): substitutions["${" + key + "}"] = value substitutions["$(" + key + ")"] = value output = ctx.outputs.out ctx.actions.expand_template( template = ctx.file.src, output = output, substitutions = substitutions, ) return [ DefaultInfo(files = depset([output])), ] _apple_preprocessed_plist = rule( attrs = { "src": attr.label( mandatory = True, allow_single_file = True, doc = "The property list file that should be processed.", ), "out": attr.output( mandatory = True, doc = "The file reference for the output plist.", ), "keys": attr.string_list( allow_empty = True, mandatory = False, default = [], doc = "The attribute names to be expanded.", ), "values": attr.string_list( allow_empty = True, mandatory = False, default = [], doc = "The attribute values. The order should match the order of keys.", ), }, doc = """ This rule generates the plist given the provided keys and values to be used for the substitution. Note that this does not compile your plist into the binary format. """, fragments = ["apple"], implementation = _impl, ) def apple_preprocessed_plist(name, src, out, substitutions, **kwargs): _apple_preprocessed_plist( name = name, src = src, out = out, keys = substitutions.keys(), values = string_dict_select_values(substitutions.values()), **kwargs )
class Circle: pi = 3.14 def __init__(self, diameter): print("Creating circle with diameter {d}".format(d=diameter)) # Add assignment for self.radius here: self.radius = diameter / 2 def circumference(self): return 2 * self.pi * self.radius medium_pizza = Circle(12) teaching_table = Circle(36) round_room = Circle(11460)
# coding = utf-8 """ create on : 2019/04/06 project name : AtCoder file name : 01_ABC086A problem : https://atcoder.jp/contests/abs/tasks/abc086_a """ def main(): a, b = [int(x) for x in input().split(" ")] ab = a * b ans = "Odd" if ab % 2 else "Even" print(ans) if __name__ == "__main__": main()
# -*- coding: utf-8 -*- def comp_periodicity(self, p=None): """Compute the periodicity factor of the lamination Parameters ---------- self : LamSlotMulti A LamSlotMulti object Returns ------- per_a : int Number of spatial periodicities of the lamination is_antiper_a : bool True if an spatial anti-periodicity is possible after the periodicities per_t : int Number of time periodicities of the lamination is_antiper_t : bool True if an time anti-periodicity is possible after the periodicities """ if self.sym_dict_enforced is not None: self.get_logger().debug("Enforcing symmetry for LamSlotMulti") return ( self.sym_dict_enforced["per_a"], self.sym_dict_enforced["is_antiper_a"], self.sym_dict_enforced["per_t"], self.sym_dict_enforced["is_antiper_t"], ) else: Zs = self.get_Zs() is_aper = False # TODO compute it self.get_logger().debug("Symmetry not available yet for LamSlotMulti") return 1, is_aper, 1, is_aper
# anagram_palindrome # # Write a function which accepts an input word and returns true or false # if there exists an anagram of that input word that is a palindrome. # We are going to try solve this question with a time complexcity of: # O(n) => linear # palindrome : is a string that read the same from front to back # and back to front : noon, eye, # Anagram of "cat" => "tac", "act", "tca"... # to check for palindrome: we compared the first character to the last character # and the second character to second last character and so until we can to the middle # for string that have odd character, we compared all the character until we get # to the single charcter in the middle # aotoa : compare first chart "a" to last character "a", then second character "o" # to second last character "o" and we get to the single character "t" in the middle # "gtgagtg" : or we can rever the string and check if the character match with the # orignal string # now let's write a function that implements the solution concept def anagram_palindrome(word): # this is a brute solution to check if the owrd is a palindrome # using python slicing notation to reverse the string and # assuming the string does not have space bewteen characters return word == word[::-1] # the run time will be O(n) as the slicing methot has to go throught each character # of the string and compare both strings. print(anagram_palindrome("noon")) ## should return true print(anagram_palindrome("carrace")) ## should return true ## "racecar", "carerac", "rcaeacr" print(anagram_palindrome("cutoo")) ## should return false ## "otcuo" print(anagram_palindrome("a")) ## should return true print(anagram_palindrome("aotoa")) ## should return true print(anagram_palindrome("ddaaa")) ## should return false # "daaad" or "adada"
def to_bool(value): value = str(value) if value == "True" or value == "TRUE" or value == "true": return True else: return False
# -*- coding: UTF-8 -*- strings = { u"フライング・スヌーピー" : u"The Flying Snoopy", u"スヌーピーのグレートレース™" : u"Snoopy's Great Race", u"ハローキティのカップケーキ・ドリーム" : u"Hello Kitty's Cupcake Dream", u"ジュラシック・パーク・ザ・ライド®\n※ご利用には整理券が必要です" : u"Jurassic Park: The Ride", u"バック・トゥ・ザ・フューチャー®・ザ・ライド" : u"Back to the Future: The Ride", u"フライト・オブ・ザ・ヒッポグリフ™" : u"Flight of the Hippogriff", u"スペース・ファンタジー・ザ・ライド" : u"Space Fantasy: The Ride", u"アメージング・アドベンチャー・オブ・スパイダーマン・ザ・ライド 4K3D" : u"The Amazing Adventures of Spiderman: 4K3D", u"ハリウッド・ドリーム・ザ・ライド" : u"Hollywood Dream: The Ride", u"ハリー・ポッター・アンド・ザ・フォービドゥン・ジャーニー™" : u"Harry Potter and the Forbidden Journey", u"ハリウッド・ドリーム・ザ・ライド~バックドロップ~" : u"Hollywood Dream: The Ride - Backdrop", u"バックドラフト®" : u"Backdraft", u"ジョーズ®" : u"Jaws", u"エヴァンゲリオン・ザ・リアル 4-D": u"Evangelion-the-Real 4-D", u"セサミストリート 4-D ムービーマジック™": u"Sesame Street 4-D Movie Magic", u"フロッグ・クワイア": u"Frog Choir", u"ウォーターワールド®": u"Waterworld", u"バイオハザード®・ザ・エスケープ\n※専用チケット(有料)が必要です" : u"Resident Evil", u"リアル・アイルー" : u"Real Airou", u"トライウィザード・スピリット・ラリー" : u"Tri-Wizard Spirit Rally", u"ユニバーサル・モンスター・ライブ・ロックンロール・ショー®" : u"Universal Monster Live Rock and Roll Show", u"日本アニメ(ーター)見本市\nIN UNIVERSAL STUDIOS JAPAN" : u"Japanese Animation Fair", u"休止中" : u"Closed", u"ターミネーター 2:3-D®" : u"Terminator 2 3:D", u"モッピーのバルーン・トリップ" : u"Moppy's Balloon Trip", u"エルモのゴーゴー・スケートボード" : u"Elmo's Go-Go Skateboard", u"R&B\"ザ・ミックス\"" : u"R&B The Mix", u"フュージョン・ダンス・ビート" : u"Fusion Dance Beat", u"ミニオン・フィーバー" : u"Minion Fever", u"クッキーモンスターのくいしんぼうクッキング\n※専用のチケット(有料)が必要です" : u"Cookie Monster Slide", u"フラッシュ・バンド・ビート 2015" : u"Flash Band Beat 2015", u"マジカル・スターライト・パレード" : u"Magical Starlight Parade", u"ザ・ヴァイオリン・ジャム・カルテット" : u"The Violin Jam Quartet" }
"""Exceptions""" class ModelException(Exception): pass
nota_trabalhos = float(input()) nota_prova = float(input()) media = (nota_trabalhos + nota_prova) / 2 if media >= 6: print('aprovado') elif nota_trabalhos >= 2: print('talvez com a sub') else: print('reprovado')
# 계속 나아가면서 하나 더하고 하나 빼는 형식으로도 풀어봤지만, 시간초과가 났다. def to_timestamp(timeformat): hour, minute, second = timeformat.split(":") return int(hour) * 3600 + int(minute) * 60 + int(second) def to_timeformat(timestamp): hour, minute, second = timestamp // 3600, timestamp % 3600 // 60, timestamp % 60 return "%02d:%02d:%02d" % (hour, minute, second) def solution(play_time, adv_time, logs): play_timestamp = to_timestamp(play_time) adv_timestamp = to_timestamp(adv_time) timeline = [0] * 360000 for log in logs: start_time, end_time = log.split("-") start_timestamp, end_timestamp = to_timestamp(start_time), to_timestamp(end_time) for i in range(start_timestamp, end_timestamp): timeline[i] += 1 sum_value = 0 for i in range(adv_timestamp): sum_value += timeline[i] maximum = sum_value answer = "00:00:00" for i in range(adv_timestamp, play_timestamp): sum_value += timeline[i] sum_value -= timeline[i - adv_timestamp] if sum_value > maximum: answer = to_timeformat(i - adv_timestamp + 1) maximum = sum_value return answer
def KthLSB(n, k): return (n>>(k-1))&1 if __name__ == '__main__': n = 10 k = 4 print(KthLSB(n, k))
# # PySNMP MIB module ERI-DNX-STM1-OC3-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ERI-DNX-STM1-OC3-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:51:49 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, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint") NestSlotAddress, trapSequence, OneByteField, LinkPortAddress, PortStatus, LinkCmdStatus, devices = mibBuilder.importSymbols("ERI-DNX-SMC-MIB", "NestSlotAddress", "trapSequence", "OneByteField", "LinkPortAddress", "PortStatus", "LinkCmdStatus", "devices") eriMibs, = mibBuilder.importSymbols("ERI-ROOT-SMI", "eriMibs") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") ObjectIdentity, NotificationType, Counter32, TimeTicks, ModuleIdentity, Gauge32, IpAddress, Counter64, Unsigned32, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Integer32, iso, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "NotificationType", "Counter32", "TimeTicks", "ModuleIdentity", "Gauge32", "IpAddress", "Counter64", "Unsigned32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Integer32", "iso", "Bits") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") eriDNXStm1Oc3MIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 644, 3, 9)) eriDNXStm1Oc3MIB.setRevisions(('2003-05-05 00:00', '2003-02-27 00:00', '2002-04-19 00:00', '2002-04-12 00:00', '2002-03-01 00:00', '2002-01-04 00:00', '2001-11-12 00:00', '2001-08-30 00:00',)) if mibBuilder.loadTexts: eriDNXStm1Oc3MIB.setLastUpdated('200305050000Z') if mibBuilder.loadTexts: eriDNXStm1Oc3MIB.setOrganization('Eastern Research, Inc.') dnxStm1Oc3 = MibIdentifier((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7)) opticalConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1)) opticalDiag = MibIdentifier((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2)) class PayLoadGroupType(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1)) namedValues = NamedValues(("e1", 0), ("t1", 1)) opticalDevConfigTable = MibTable((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1), ) if mibBuilder.loadTexts: opticalDevConfigTable.setStatus('current') opticalDevConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1), ).setIndexNames((0, "ERI-DNX-STM1-OC3-MIB", "optDevCfgAddr")) if mibBuilder.loadTexts: opticalDevConfigEntry.setStatus('current') optDevCfgAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1, 1), NestSlotAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: optDevCfgAddr.setStatus('current') optDevCfgResource = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optDevCfgResource.setStatus('current') optDevType = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("stm1", 0), ("oc3", 1), ("stm1X", 2), ("oc3X", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: optDevType.setStatus('current') optDevMultiplexMode = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("au3", 0), ("au4", 1), ("sts-3", 2), ("sts-3c", 3), ("au4-vc3-Seq", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optDevMultiplexMode.setStatus('current') optLineTiming = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("local", 0), ("loop", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optLineTiming.setStatus('current') optDevPayload1 = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1, 6), PayLoadGroupType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: optDevPayload1.setStatus('current') optDevPayload2 = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1, 7), PayLoadGroupType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: optDevPayload2.setStatus('current') optDevPayload3 = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1, 8), PayLoadGroupType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: optDevPayload3.setStatus('current') optDevCmdStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 101, 400, 402, 403, 414, 415, 416, 419, 421, 424, 427, 450, 500, 501, 502))).clone(namedValues=NamedValues(("ready-for-command", 0), ("update-config", 1), ("update-successful", 101), ("err-general-opt-config-error", 400), ("err-au4Seq-cannot-be-mixed-framing", 402), ("err-invalid-opt-dev-command", 403), ("err-device-is-protection-module", 414), ("err-invalid-multiplex-map", 415), ("err-invalid-payload-framing", 416), ("err-invalid-xlink-nest-num", 419), ("err-invalid-line-timing", 421), ("err-ts-alloc-not-applicable", 424), ("err-xlink-pair-not-applicable", 427), ("err-data-locked-by-another-user", 450), ("err-snmp-parse-failed", 500), ("err-invalid-snmp-type", 501), ("err-invalid-snmp-var-size", 502)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optDevCmdStatus.setStatus('current') optDevTsAlloc = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("normal", 0), ("alternate", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optDevTsAlloc.setStatus('current') optDevAssignedToNest = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(2, 8), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optDevAssignedToNest.setStatus('current') optT1E1LinkConfigTable = MibTable((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2), ) if mibBuilder.loadTexts: optT1E1LinkConfigTable.setStatus('current') optT1E1LinkConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1), ).setIndexNames((0, "ERI-DNX-STM1-OC3-MIB", "optT1E1CfgLinkAddr")) if mibBuilder.loadTexts: optT1E1LinkConfigEntry.setStatus('current') optT1E1CfgLinkAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 1), LinkPortAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: optT1E1CfgLinkAddr.setStatus('current') optT1E1CfgResource = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optT1E1CfgResource.setStatus('current') optT1E1CfgLinkName = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optT1E1CfgLinkName.setStatus('current') optT1E1Status = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 4), PortStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: optT1E1Status.setStatus('current') optT1E1Clear = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("disabled", 0), ("framed", 1), ("unframed", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optT1E1Clear.setStatus('current') optT1E1Framing = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("e1", 0), ("e1Crc", 1), ("e1Cas", 2), ("e1CasCrc", 3), ("e1Unframed", 4), ("t1Esf", 5), ("t1D4", 6), ("t1Unframed", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optT1E1Framing.setStatus('current') optT1E1RecoverTime = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 10, 15))).clone(namedValues=NamedValues(("timeout-3-secs", 3), ("timeout-10-secs", 10), ("timeout-15-secs", 15)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optT1E1RecoverTime.setStatus('current') optT1E1EsfFormat = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("att-54016", 0), ("ansi-t1-403", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optT1E1EsfFormat.setStatus('current') optT1E1UnusedTSs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("busy", 0), ("idle", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optT1E1UnusedTSs.setStatus('current') optT1E1CfgCmdStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 10), LinkCmdStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: optT1E1CfgCmdStatus.setStatus('current') optT1E1NationalBits = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 11), OneByteField()).setMaxAccess("readwrite") if mibBuilder.loadTexts: optT1E1NationalBits.setStatus('current') optT1E1InterNational = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 1, 2, 1, 12), OneByteField()).setMaxAccess("readwrite") if mibBuilder.loadTexts: optT1E1InterNational.setStatus('current') opticalTUStatusTable = MibTable((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1), ) if mibBuilder.loadTexts: opticalTUStatusTable.setStatus('current') opticalTUStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1), ).setIndexNames((0, "ERI-DNX-STM1-OC3-MIB", "optTUStatusAddr")) if mibBuilder.loadTexts: opticalTUStatusEntry.setStatus('current') optTUStatusAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1, 1), LinkPortAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTUStatusAddr.setStatus('current') optTUStatusResrcId = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTUStatusResrcId.setStatus('current') optTUStatusLinkState = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 8, 32, 64, 2048, 4096, 65535, 2097152, 4194304, 8388608, 6291456, 1073741824, 2147483647))).clone(namedValues=NamedValues(("ok", 0), ("yel", 2), ("ais", 8), ("lof", 32), ("los", 64), ("red", 2048), ("cfa", 4096), ("oos", 65535), ("txSlip", 2097152), ("rxSlip", 4194304), ("sef", 8388608), ("slip", 6291456), ("underTest", 1073741824), ("errors", 2147483647)))).setMaxAccess("readonly") if mibBuilder.loadTexts: optTUStatusLinkState.setStatus('current') optTUStatusErrSecs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTUStatusErrSecs.setStatus('current') optTUStatusAisErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTUStatusAisErrs.setStatus('current') optTUStatusLopErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTUStatusLopErrs.setStatus('current') optTUStatusRdiTUErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTUStatusRdiTUErrs.setStatus('current') optTUStatusRfiTUErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTUStatusRfiTUErrs.setStatus('current') optTUStatusPSLMErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTUStatusPSLMErrs.setStatus('current') optTUStatusPSLUErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTUStatusPSLUErrs.setStatus('current') optTUStatusErrFreeSecs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTUStatusErrFreeSecs.setStatus('current') opticalMapperStatusTable = MibTable((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2), ) if mibBuilder.loadTexts: opticalMapperStatusTable.setStatus('current') opticalMapperStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2, 1), ).setIndexNames((0, "ERI-DNX-STM1-OC3-MIB", "optMapperStatusAddr")) if mibBuilder.loadTexts: opticalMapperStatusEntry.setStatus('current') optMapperStatusAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2, 1, 1), LinkPortAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: optMapperStatusAddr.setStatus('current') optMapperStatusResrcId = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optMapperStatusResrcId.setStatus('current') optMapperState = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 8, 16, 32, 64, 128, 2048, 4096, 65535, 2097152, 4194304, 8388608, 6291456, 1073741824, 2147483647))).clone(namedValues=NamedValues(("ok", 0), ("yel", 2), ("ais", 8), ("lop", 16), ("lof", 32), ("los", 64), ("rdi", 128), ("red", 2048), ("cfa", 4096), ("oos", 65535), ("txSlip", 2097152), ("rxSlip", 4194304), ("sef", 8388608), ("slip", 6291456), ("underTest", 1073741824), ("errors", 2147483647)))).setMaxAccess("readonly") if mibBuilder.loadTexts: optMapperState.setStatus('current') optMapperErrSecs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optMapperErrSecs.setStatus('current') optMapperErrFreeSecs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optMapperErrFreeSecs.setStatus('current') optMapperLoop = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 3))).clone(namedValues=NamedValues(("off", 0), ("local", 1), ("line", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optMapperLoop.setStatus('current') optMapperPathLOPErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optMapperPathLOPErrs.setStatus('current') optMapperPathAISErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optMapperPathAISErrs.setStatus('current') optMapperPathRDIErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optMapperPathRDIErrs.setStatus('current') optMapperCmdStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 14, 101, 114, 200, 202, 206, 500, 501, 502))).clone(namedValues=NamedValues(("ready-for-command", 0), ("updateTest", 1), ("clearErrors", 14), ("update-successful", 101), ("clear-successful", 114), ("err-general-test-error", 200), ("err-invalid-loop-type", 202), ("err-field-cannot-be-set", 206), ("err-snmp-parse-failed", 500), ("err-invalid-snmp-type", 501), ("err-invalid-snmp-var-size", 502)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optMapperCmdStatus.setStatus('current') opticalTransportStatusTable = MibTable((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3), ) if mibBuilder.loadTexts: opticalTransportStatusTable.setStatus('current') opticalTransportStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1), ).setIndexNames((0, "ERI-DNX-STM1-OC3-MIB", "optTransportStatusAddr")) if mibBuilder.loadTexts: opticalTransportStatusEntry.setStatus('current') optTransportStatusAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 1), NestSlotAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTransportStatusAddr.setStatus('current') optTransportStatusResrcId = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTransportStatusResrcId.setStatus('current') optTransportLaserState = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("off", 0), ("on", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optTransportLaserState.setStatus('current') optTransportErrSecs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTransportErrSecs.setStatus('current') optTransportErrFreeSecs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTransportErrFreeSecs.setStatus('current') optTransportLoop = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("off", 0), ("terminal", 1), ("facility", 2), ("pathFacility", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optTransportLoop.setStatus('current') optTransportLineAISErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTransportLineAISErrs.setStatus('current') optTransportLineRDIErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTransportLineRDIErrs.setStatus('current') optTransportLineOOFErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTransportLineOOFErrs.setStatus('current') optTransportLineLOFErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTransportLineLOFErrs.setStatus('current') optTransportLineLOSErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: optTransportLineLOSErrs.setStatus('current') optTransportCmdStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 2, 3, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 14, 101, 114, 400, 402, 406, 500, 501, 502))).clone(namedValues=NamedValues(("ready-for-command", 0), ("updateTest", 1), ("clearErrors", 14), ("update-successful", 101), ("clear-successful", 114), ("err-general-test-error", 400), ("err-invalid-loop-type", 402), ("err-field-cannot-be-set", 406), ("err-snmp-parse-failed", 500), ("err-invalid-snmp-type", 501), ("err-invalid-snmp-var-size", 502)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: optTransportCmdStatus.setStatus('current') dnxStm1Oc3Enterprise = ObjectIdentity((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 0)) if mibBuilder.loadTexts: dnxStm1Oc3Enterprise.setStatus('current') optDevConfigTrap = NotificationType((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 0, 1)).setObjects(("ERI-DNX-SMC-MIB", "trapSequence"), ("ERI-DNX-STM1-OC3-MIB", "optDevCfgAddr"), ("ERI-DNX-STM1-OC3-MIB", "optDevCmdStatus")) if mibBuilder.loadTexts: optDevConfigTrap.setStatus('current') optT1E1ConfigTrap = NotificationType((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 7, 0, 2)).setObjects(("ERI-DNX-SMC-MIB", "trapSequence"), ("ERI-DNX-STM1-OC3-MIB", "optT1E1CfgLinkAddr"), ("ERI-DNX-STM1-OC3-MIB", "optT1E1CfgCmdStatus")) if mibBuilder.loadTexts: optT1E1ConfigTrap.setStatus('current') mibBuilder.exportSymbols("ERI-DNX-STM1-OC3-MIB", optTransportLineLOFErrs=optTransportLineLOFErrs, dnxStm1Oc3=dnxStm1Oc3, optDevCmdStatus=optDevCmdStatus, optTransportErrSecs=optTransportErrSecs, opticalConfig=opticalConfig, optTUStatusRdiTUErrs=optTUStatusRdiTUErrs, optT1E1CfgLinkAddr=optT1E1CfgLinkAddr, optT1E1CfgLinkName=optT1E1CfgLinkName, optTUStatusLopErrs=optTUStatusLopErrs, optMapperPathAISErrs=optMapperPathAISErrs, opticalTUStatusTable=opticalTUStatusTable, optT1E1Clear=optT1E1Clear, optTransportErrFreeSecs=optTransportErrFreeSecs, optTUStatusErrSecs=optTUStatusErrSecs, optTransportLineAISErrs=optTransportLineAISErrs, optTransportLineOOFErrs=optTransportLineOOFErrs, optTransportLaserState=optTransportLaserState, optT1E1ConfigTrap=optT1E1ConfigTrap, opticalDiag=opticalDiag, optDevPayload1=optDevPayload1, optTUStatusPSLMErrs=optTUStatusPSLMErrs, optDevPayload3=optDevPayload3, optMapperStatusResrcId=optMapperStatusResrcId, optMapperCmdStatus=optMapperCmdStatus, optT1E1CfgCmdStatus=optT1E1CfgCmdStatus, optT1E1Framing=optT1E1Framing, optT1E1EsfFormat=optT1E1EsfFormat, optTUStatusPSLUErrs=optTUStatusPSLUErrs, optDevCfgAddr=optDevCfgAddr, optTUStatusErrFreeSecs=optTUStatusErrFreeSecs, optTransportStatusAddr=optTransportStatusAddr, optTransportLineLOSErrs=optTransportLineLOSErrs, PYSNMP_MODULE_ID=eriDNXStm1Oc3MIB, optDevType=optDevType, optTUStatusResrcId=optTUStatusResrcId, opticalMapperStatusEntry=opticalMapperStatusEntry, optMapperStatusAddr=optMapperStatusAddr, dnxStm1Oc3Enterprise=dnxStm1Oc3Enterprise, optT1E1NationalBits=optT1E1NationalBits, optDevTsAlloc=optDevTsAlloc, optT1E1UnusedTSs=optT1E1UnusedTSs, optT1E1InterNational=optT1E1InterNational, optT1E1LinkConfigTable=optT1E1LinkConfigTable, optTransportStatusResrcId=optTransportStatusResrcId, optLineTiming=optLineTiming, optTUStatusRfiTUErrs=optTUStatusRfiTUErrs, optT1E1Status=optT1E1Status, optTUStatusLinkState=optTUStatusLinkState, optTransportLineRDIErrs=optTransportLineRDIErrs, opticalDevConfigTable=opticalDevConfigTable, optTUStatusAddr=optTUStatusAddr, optDevCfgResource=optDevCfgResource, optTransportCmdStatus=optTransportCmdStatus, optDevPayload2=optDevPayload2, opticalTransportStatusTable=opticalTransportStatusTable, optDevMultiplexMode=optDevMultiplexMode, optDevAssignedToNest=optDevAssignedToNest, optMapperState=optMapperState, eriDNXStm1Oc3MIB=eriDNXStm1Oc3MIB, optMapperPathRDIErrs=optMapperPathRDIErrs, opticalDevConfigEntry=opticalDevConfigEntry, opticalTUStatusEntry=opticalTUStatusEntry, optTUStatusAisErrs=optTUStatusAisErrs, optT1E1RecoverTime=optT1E1RecoverTime, optMapperLoop=optMapperLoop, PayLoadGroupType=PayLoadGroupType, opticalMapperStatusTable=opticalMapperStatusTable, optMapperErrFreeSecs=optMapperErrFreeSecs, optDevConfigTrap=optDevConfigTrap, opticalTransportStatusEntry=opticalTransportStatusEntry, optMapperErrSecs=optMapperErrSecs, optTransportLoop=optTransportLoop, optT1E1CfgResource=optT1E1CfgResource, optMapperPathLOPErrs=optMapperPathLOPErrs, optT1E1LinkConfigEntry=optT1E1LinkConfigEntry)
class User: user = [] ''' this class creates new instance of user data ''' def __init__(self, username, password): ''' init method to define objects Args: username: to ask user a username password: to either generate or ask user for a password ''' self.username = username self.password = password def new_user(self): ''' Method that appends a user ''' User.user.append(self) def save_user(self): ''' Method that saves a new user ''' User.user.append(self) def delete_user(self): ''' Method that deletes a user ''' User.user.remove(self)
def gcd(a,b): if a==0: return b else: return gcd(b%a,a) c = gcd(100,35) # c = 5 print(c)
def debug(ctx,n): print("######### BEGIN DEBUG"+n+"################") print(ctx.getText()) print("######### END DEBUG ################") class ASTException(Exception): pass
class QuadTree: """A class implementing a quadtree.""" def __init__(self, boundary, max_points=4, depth=0): """Initialize this node of the quadtree. boundary is a Rect object defining the region from which points are placed into this node; max_points is the maximum number of points the node can hold before it must divide (branch into four more nodes); depth keeps track of how deep into the quadtree this node lies. """ self.boundary = boundary self.max_points = max_points self.points = [] self.depth = depth # A flag to indicate whether this node has divided (branched) or not. self.divided = False def __str__(self): """Return a string representation of this node, suitably formatted.""" sp = ' ' * self.depth * 2 s = str(self.boundary) + '\n' s += sp + ', '.join(str(point) for point in self.points) if not self.divided: return s return s + '\n' + '\n'.join([ sp + 'nw: ' + str(self.nw), sp + 'ne: ' + str(self.ne), sp + 'se: ' + str(self.se), sp + 'sw: ' + str(self.sw)]) def divide(self): """Divide (branch) this node by spawning four children nodes.""" cx, cy = self.boundary.cx, self.boundary.cy w, h = self.boundary.w / 2, self.boundary.h / 2 # The boundaries of the four children nodes are "northwest", # "northeast", "southeast" and "southwest" quadrants within the # boundary of the current node. self.nw = QuadTree(Rect(cx - w/2, cy - h/2, w, h), self.max_points, self.depth + 1) self.ne = QuadTree(Rect(cx + w/2, cy - h/2, w, h), self.max_points, self.depth + 1) self.se = QuadTree(Rect(cx + w/2, cy + h/2, w, h), self.max_points, self.depth + 1) self.sw = QuadTree(Rect(cx - w/2, cy + h/2, w, h), self.max_points, self.depth + 1) self.divided = True def insert(self, point): """Try to insert Point point into this QuadTree.""" if not self.boundary.contains(point): # The point does not lie inside boundary: bail. return False if len(self.points) < self.max_points: # There's room for our point without dividing the QuadTree. self.points.append(point) return True # No room: divide if necessary, then try the sub-quads. if not self.divided: self.divide() return (self.ne.insert(point) or self.nw.insert(point) or self.se.insert(point) or self.sw.insert(point)) def query(self, boundary, found_points): """Find the points in the quadtree that lie within boundary.""" if not self.boundary.intersects(boundary): # If the domain of this node does not intersect the search # region, we don't need to look in it for points. return False # Search this node's points to see if they lie within boundary ... for point in self.points: if boundary.contains(point): found_points.append(point) # ... and if this node has children, search them too. if self.divided: self.nw.query(boundary, found_points) self.ne.query(boundary, found_points) self.se.query(boundary, found_points) self.sw.query(boundary, found_points) return found_points def query_circle(self, boundary, centre, radius, found_points): """Find the points in the quadtree that lie within radius of centre. boundary is a Rect object (a square) that bounds the search circle. There is no need to call this method directly: use query_radius. """ if not self.boundary.intersects(boundary): # If the domain of this node does not intersect the search # region, we don't need to look in it for points. return False # Search this node's points to see if they lie within boundary # and also lie within a circle of given radius around the centre point. for point in self.points: if (boundary.contains(point) and point.distance_to(centre) <= radius): found_points.append(point) # Recurse the search into this node's children. if self.divided: self.nw.query_circle(boundary, centre, radius, found_points) self.ne.query_circle(boundary, centre, radius, found_points) self.se.query_circle(boundary, centre, radius, found_points) self.sw.query_circle(boundary, centre, radius, found_points) return found_points def query_radius(self, centre, radius, found_points): """Find the points in the quadtree that lie within radius of centre.""" # First find the square that bounds the search circle as a Rect object. boundary = Rect(*centre, 2*radius, 2*radius) return self.query_circle(boundary, centre, radius, found_points) def __len__(self): """Return the number of points in the quadtree.""" npoints = len(self.points) if self.divided: npoints += len(self.nw)+len(self.ne)+len(self.se)+len(self.sw) return npoints def draw(self, ax): """Draw a representation of the quadtree on Matplotlib Axes ax.""" self.boundary.draw(ax) if self.divided: self.nw.draw(ax) self.ne.draw(ax) self.se.draw(ax) self.sw.draw(ax)
defines = { 'base00': '#F7B3DA', 'base01': '#f55050', 'base02': '#488214', 'base03': '#EEB422', 'base04': '#468dd4', 'base05': '#551a8b', 'base06': '#1b9e9e', 'base07': '#75616b', 'base08': '#9e8b95', 'base09': '#e06a26', 'base0A': '#f0dde6', 'base0B': '#b5a3ac', 'base0C': '#8a7680', 'base0D': '#3b2c33', 'base0E': '#d46a84', 'base0F': '#2b1d24', 'basefg': '#F0F0F0' } statements = { 'URxvt*color0': ' base00', 'URxvt*color1': ' base01', 'URxvt*color2': ' base02', 'URxvt*color3': ' base03', 'URxvt*color4': ' base04', 'URxvt*color5': ' base05', 'URxvt*color6': ' base06', 'URxvt*color7': ' base07', 'URxvt*color8': ' base08', 'URxvt*color9': ' base09', 'URxvt*color10': ' base0A', 'URxvt*color11': ' base0B', 'URxvt*color12': ' base0C', 'URxvt*color13': ' base0D', 'URxvt*color14': ' base0E', 'URxvt*color15': ' base0F', '*foreground': 'basefg', 'URxvt*inheritPixmap': 'true', 'URxvt*transparent': 'true', 'URxvt*shading': '20' } statements = {key.strip(): value.strip() for key, value in statements.items()}
# -*- coding: utf-8 -*- """ Created on Sat Mar 13 11:40:13 2021 @author: Mayur """ """ Product class has all functinality related to adding/removing/displaying products """ class Product: name = "" price = 0 def __init__(self): self.all_products = [] def reset(self): self.all_products.clear() def add_product(self,name, price): new_prod = Product() new_prod.name = name new_prod.price = price self.all_products.append(new_prod) def remove_product(self,prod): for item in self.all_products: if(item.name == prod): self.all_products.remove(item) def display_all_products(self): print("List of all available products:\n*********************************") for item in self.all_products: print(item.name) print("******************************") """ Denomination class has all functinality related to adding/removing/displaying products """ class Denomination: def __init__(self): self.all_denomination = [] def add_denomination(self, denom): self.all_denomination.append(denom) def remove_denomination(self, denom): for item in self.all_denomination: if(item==denom): self.all_denomination.remove(item) def reset(self): self.all_denomination.clear() def display_all_denomination(self): print("Below are all Available denominations: \n") for item in self.all_denomination: print (item) print("\n") """ Cart class has all functinality related to adding/removing/displaying products in the cart, paying/placing/caceling order """ class Cart: def __init__(self): self.prod = [] self.cart_value = 0 def add_to_cart(self, item): self.prod.append(item) self.cart_value = self.cart_value + item.price def edit_order(self, remove_prod): for item in self.prod: if(item.name == remove_prod): self.prod.remove(item) self.cart_value = self.cart_value - item.price print("Product removed successfully") break def pay_order(self, denomination): try: print("Below is the Your Cart") cash_collected = 0 if len(self.prod)>0: for i, x in enumerate(self.prod): print(x.name + "\t") print("Total cart value is \t", self.cart_value) else: print("Cart is empty") return False if len(denomination.all_denomination)>0: while True: denomination.display_all_denomination() print("Type denominations you wish to pay cash in \n") selected_denomin = float(input()) for i, x in enumerate(denomination.all_denomination): if selected_denomin == x: if cash_collected < cash_collected + x: cash_collected = cash_collected + x print("Total cash collected is ",cash_collected) if cash_collected == self.cart_value: cancel_place = int(input("1. Cancel order and take refund \n2. Confirm Order\n")) if cancel_place == 1: self.cancel_order() return False elif cancel_place == 2: self.place_order() return False else: return False break else: print("Money paid is more than Cart value, pls select denominations correctly.") else: print("No Denmonations set, contact admin") return False except: print("Some error occured, please retry") def cancel_order(self): print("Your order is cancelled Successfully, please collect your cash of \t", self.cart_value) return False def place_order(self): print("Thanks for placing order with us. Don't forget to collect your Food...........") return False """ VendingMachine class is the main class which consumes all the classes like Product/Cart/Denomination """ class VendingMachine: def __init__(self): self.product = Product() self.denomination = Denomination() self.cart = Cart() while True: try: print("***************Welcome to Awesome Vending Machine****************") user_or_admin = int(input("Select your input:\n 1. Place Order\n 2. Admin Login \n")) if user_or_admin == 1: self.user_flow() pass elif user_or_admin == 2: self.admin_flow() else: print("Invalid input, exiting..") except: print("Some error occured, please retry") def reset_machine(self): self.product.reset() self.denomination.reset() def admin_flow(self): while True: try: admin_inp = int(input("Enter Your Choice\n1. Add Product\n2. Add Denomination \n3. Reset Machine \n4. Remove Denomination \n5. Remove Product \n6. Enter any key to go to main menu\n")) if admin_inp == 1: name = input("Enter Product name\t") price = float(input("Enter Product price \t")) self.product.add_product(name, price) elif admin_inp == 2: denom = float(input("Enter Denomination\t")) self.denomination.add_denomination(denom) elif admin_inp == 3: self.reset() elif admin_inp == 4: self.display_all_denomination() print("Type denomination to be deleted\n") denom = float(input("Enter Denomination\t")) self.denomination.remove_denomination(denom) elif admin_inp == 5: self.display_all_products() print("Type product to be deleted\n") prod = input("Enter Product to be deleted \t") self.product.remove_product(prod) else: return False except: print("Some unexpected error occured, please conatct admin for any quries") def user_flow(self): self.cart = Cart() while True: try: if len(self.product.all_products)==0: print("No products available, contact admin...") return False self.product.display_all_products() selected_prod = input("\n 1. Type Name of product you wish to select\n 2. Type pay to checkout\n 3. Type exit to got to main menu \n 4. Type remove for removing product from cart \n") if selected_prod=="exit": self.in_sub_menu = False return False if selected_prod=="pay": self.cart.pay_order(self.denomination) return False if selected_prod=="remove": remove_prod = input("Type name of product you wish to remove \n") self.cart.edit_order(remove_prod) for i, x in enumerate(self.product.all_products): if selected_prod == x.name: self.cart.add_to_cart(x) else: print("Invalid input\n") except: print("Some unexpected error occured, please conatct admin for any quries") if __name__ == '__main__': v = VendingMachine()
#Daniel Ferreira def absoluto(n:int) -> int: """Essa função verifica primeiramente se o número é positivo. Caso não seja, converte ele para positivo e o retorna. Se a pessoa não escrever um núemro, aparecerá um TypeError e um ValueError, informando o erro.""" try: if n < 0: n * -1 return int(n) except ValueError: print("ValueError para '%s'." %(n)) return None except TypeError: type(object) == type('') print("TypeError para <class '%s '>." %type) return None #2) #a) class loja(): def __init__(self, nome:str, produtos:dict): """função das classes construtores.""" self.nome = nome self.produtos = produtos #b) def adicionarProduto(self, categoria:str, marca:str): """Aqui, adicionamos a marca na categoria do produto e caso ele não exista, nos tratamos esse erro atualizando a categoria.""" try: self.produtos[categoria].add(marca) except: self.produtos[categoria].update(marca) #c) def verCategoria(categoria:str) -> str: """Caso a categoria não exista, será exibida uma mensagem.""" try: return categoria except TypeError: print("Categoria {} não catalogada.".format(categoria)) #d) def removerMarca(self, marca:str): """Removemos o produto que desejamos.""" self.produtos.discard(marca)
""" ScriptList object (and friends). """ __all__ = ["ScriptList", "ScriptRecord", "ScriptCount", "LangSysRecord", "LangSysCount"] class ScriptList(object): __slots__ = ["ScriptCount", "ScriptRecord"] def __init__(self): self.ScriptCount = 0 self.ScriptRecord = None def loadFromFontTools(self, scriptList): self.ScriptCount = scriptList.ScriptCount self.ScriptRecord = [ScriptRecord().loadFromFontTools(record) for record in scriptList.ScriptRecord] return self class ScriptRecord(object): __slots__ = ["ScriptTag", "Script"] def __init__(self): self.ScriptTag = None self.Script = None def loadFromFontTools(self, scriptRecord): self.ScriptTag = scriptRecord.ScriptTag self.Script = Script().loadFromFontTools(scriptRecord.Script) return self class Script(object): __slots__ = ["DefaultLangSys", "LangSysCount", "LangSysRecord"] def __init__(self): self.DefaultLangSys = None self.LangSysCount = 0 self.LangSysRecord = [] def loadFromFontTools(self, script): self.DefaultLangSys = None if script.DefaultLangSys is not None: self.DefaultLangSys = LangSys().loadFromFontTools(script.DefaultLangSys) self.LangSysCount = script.LangSysCount self.LangSysRecord = [LangSysRecord().loadFromFontTools(record) for record in script.LangSysRecord] return self class LangSysRecord(object): __slots__ = ["LangSysTag", "LangSys"] def __init__(self): self.LangSysTag = None self.LangSys = None def loadFromFontTools(self, langSysRecord): self.LangSysTag = langSysRecord.LangSysTag self.LangSys = LangSys().loadFromFontTools(langSysRecord.LangSys) return self class LangSys(object): __slots__ = ["LookupOrder", "ReqFeatureIndex", "FeatureCount", "FeatureIndex"] def __init__(self): self.LookupOrder = None self.ReqFeatureIndex = None self.FeatureCount = 0 self.FeatureIndex = [] def loadFromFontTools(self, langSys): self.LookupOrder = langSys.LookupOrder # XXX? self.ReqFeatureIndex = langSys.ReqFeatureIndex self.FeatureCount = langSys.FeatureCount self.FeatureIndex = list(langSys.FeatureIndex) return self
class Solution(object): def destCity(self, paths): """ :type paths: List[List[str]] :rtype: str """ record = {} all_cities = [] for cities in paths: record[cities[0]] = cities[1] for city in record.values(): if city not in record: return city return False
#MenuTitle: Show Glyphs with this Anchor # -*- coding: utf-8 -*- __doc__=""" New Tab with all Glyphs that have the selected anchor. """ thisFont = Glyphs.font # frontmost font selectedLayer = thisFont.selectedLayers[0] selection = selectedLayer.selection editString = "" for i, anchor in enumerate(selection): if i > 0: editString += "\n\n" if type(anchor) == GSAnchor: anchorName = anchor.name editString += "%s:\n" % anchorName # add anchor name to the text string for glyph in thisFont.glyphs: thisLayer = glyph.layers[selectedLayer.associatedMasterId] if anchorName in thisLayer.anchors.keys(): editString += "/" + glyph.name if len(editString) > 0: thisFont.newTab(editString) ### Open Tab with all Characters
"""715. Range Module https://leetcode.com/problems/range-module/ A Range Module is a module that tracks ranges of numbers. Your task is to design and implement the following interfaces in an efficient manner. addRange(int left, int right) Adds the half-open interval [left, right), tracking every real number in that interval. Adding an interval that partially overlaps with currently tracked numbers should add any numbers in the interval [left, right) that are not already tracked. queryRange(int left, int right) Returns true if and only if every real number in the interval [left, right) is currently being tracked. removeRange(int left, int right) Stops tracking every real number currently being tracked in the interval [left, right). Example 1: addRange(10, 20): null removeRange(14, 16): null queryRange(10, 14): true (Every number in [10, 14) is being tracked) queryRange(13, 15): false (Numbers like 14, 14.03, 14.17 in [13, 15) are not being tracked) queryRange(16, 17): true (The number 16 in [16, 17) is still being tracked, despite the remove operation) Note: A half open interval [left, right) denotes all real numbers left <= x < right. 0 < left < right < 10^9 in all calls to addRange, queryRange, removeRange. The total number of calls to addRange in a single test case is at most 1000. The total number of calls to queryRange in a single test case is at most 5000. The total number of calls to removeRange in a single test case is at most 1000. """ class RangeModule: def __init__(self): pass def add_range(self, left: int, right: int) -> None: pass def query_range(self, left: int, right: int) -> bool: pass def remove_range(self, left: int, right: int) -> None: pass # Your RangeModule object will be instantiated and called as such: # obj = RangeModule() # obj.addRange(left,right) # param_2 = obj.queryRange(left,right) # obj.removeRange(left,right)
a,b = input("Enter A(x1, y1): ").split() c,d = input("Enter B(x2, y2): ").split() distance = pow((pow((int(c)-int(a)),2) + pow((int(d)-int(b)),2)), 0.5) print("Distance between points A and B: ",distance)
class FileReader: def __init__(self): pass def read_text_file(self, path): file = open(path, 'r') return file.read()
''' 如果从第n个数字到最后都是递减的并且第n-1个数字小于第n个,说明从第n个数字开始的这段序列是字典序组合的最后一个, 在下一个组合中他们要倒序变为字典序第一个,然后从这段序列中找出第一个大于第n-1个数字的数和第n-1个数字交换就可以了。 举个栗子,当前组合为12431,可以看出431是递减的,同时4>2,这样我们把431倒序,组合就变为12134, 然后从134中找出第一个大于2的数字和2交换,这样就得到了下一个组合13124。对于完全递减的组合例如4321在倒序之后就可以结束了。 ''' class Solution: def nextPermutation(self, nums): right = len(nums) - 1 # >= is needed since we need to consider the first element. while right >= 0: if nums[right] > nums[right - 1]: nums[right:] = sorted(nums[right:]) for i in range(right, len(nums)): if nums[i] > nums[right - 1]: nums[right - 1], nums[i] = nums[i], nums[right - 1] break break right -= 1 return nums if __name__ == "__main__": nums = [3, 2, 1] s = Solution() print(s.nextPermutation(nums))
# -*- coding:utf-8 -*- BIND_HOST='0.0.0.0' BIND_PORT=9999 USER_HOME = '%s/var/users' %BASE_DIR USER_ACCOUNT={ 'alex':{'password':'123456', 'quotation':1000000,#1GB 'expire':'2017-01-22' } }
# Created by MechAviv # Map ID :: 620100029 # Spaceship : In Front of the Shuttle sm.curNodeEventEnd(True) sm.setTemporarySkillSet(0) sm.setInGameDirectionMode(True, True, False, False) sm.setStandAloneMode(True) sm.forcedInput(0) OBJECT_1 = sm.sendNpcController(9270083, 2415, -134) sm.showNpcSpecialActionByObjectId(OBJECT_1, "summon", 0) sm.sendSessionValue("Ade", OBJECT_1) sm.forcedInput(1) sm.sendDelay(1000) sm.forcedInput(0) sm.showEffect("Effect/DirectionNewPirate.img/newPirate/balloonMsg2/2", 0, 0, -100, 0, OBJECT_1, False, 0) sm.sendDelay(2000) sm.showEffect("Effect/DirectionNewPirate.img/newPirate/balloonMsg2/1", 0, 0, -100, 0, OBJECT_1, False, 0) sm.sendDelay(1000) sm.setSpeakerID(9270083) sm.removeEscapeButton() sm.setPlayerAsSpeaker() sm.setSpeakerType(3) sm.sendNext("#p9270083#. You follow me outta here and then you disappear. They're after me, not you. ") sm.setSpeakerID(9270083) sm.removeEscapeButton() sm.flipSpeaker() sm.setSpeakerType(3) sm.sendSay("What are you talking about? We're... we're family. I won't let you face this on your own.") sm.setSpeakerID(9270083) sm.removeEscapeButton() sm.flipSpeaker() sm.setSpeakerType(3) sm.sendSay("Look, just get on the shuttle!") sm.sendDelay(1000) sm.setSpeakerID(9270083) sm.removeEscapeButton() sm.setPlayerAsSpeaker() sm.setSpeakerType(3) sm.sendNext("Burke... Thank you...") sm.sendDelay(2000) sm.chatScript("Follow the arrows to the portal.") sm.setTemporarySkillSet(0) sm.setInGameDirectionMode(False, True, False, False)
# # PySNMP MIB module WIRELESS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/WIRELESS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:29:45 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint") Timeticks, = mibBuilder.importSymbols("RFC1155-SMI", "Timeticks") MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("RFC1212", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") enterprises, iso, Integer32, TimeTicks, Gauge32, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, Unsigned32, Counter64, MibIdentifier, IpAddress, Bits, NotificationType, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "enterprises", "iso", "Integer32", "TimeTicks", "Gauge32", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "Unsigned32", "Counter64", "MibIdentifier", "IpAddress", "Bits", "NotificationType", "Counter32") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") class MacAddress(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(6, 6) fixedLength = 6 ibm = MibIdentifier((1, 3, 6, 1, 4, 1, 2)) ibmProd = MibIdentifier((1, 3, 6, 1, 4, 1, 2, 6)) ibmwlan = MibIdentifier((1, 3, 6, 1, 4, 1, 2, 6, 10)) wrBase = MibIdentifier((1, 3, 6, 1, 4, 1, 2, 6, 10, 1)) wrRemote = MibIdentifier((1, 3, 6, 1, 4, 1, 2, 6, 10, 2)) baseName = MibScalar((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseName.setStatus('mandatory') baseNetworkName = MibScalar((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseNetworkName.setStatus('mandatory') baseAdminIPAddr = MibScalar((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseAdminIPAddr.setStatus('mandatory') wrBaseTable = MibTable((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4), ) if mibBuilder.loadTexts: wrBaseTable.setStatus('mandatory') wrBaseEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4, 1), ).setIndexNames((0, "WIRELESS-MIB", "baseIfIndex")) if mibBuilder.loadTexts: wrBaseEntry.setStatus('mandatory') baseIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseIfIndex.setStatus('mandatory') baseHDLCaddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseHDLCaddress.setStatus('mandatory') baseNbOFRemote = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseNbOFRemote.setStatus('mandatory') baseCellIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseCellIdentifier.setStatus('mandatory') baseAdapterStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("operational", 1), ("not-operational", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: baseAdapterStatus.setStatus('mandatory') baseEmittedPower = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseEmittedPower.setStatus('mandatory') baseControllerCardDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseControllerCardDesc.setStatus('mandatory') baseUnivAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4, 1, 8), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseUnivAddress.setStatus('mandatory') baseModemDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseModemDesc.setStatus('mandatory') baseTopologyTrapActive = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 4, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("inactive", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: baseTopologyTrapActive.setStatus('mandatory') wrBaseStatsTable = MibTable((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5), ) if mibBuilder.loadTexts: wrBaseStatsTable.setStatus('mandatory') wrBaseStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1), ).setIndexNames((0, "WIRELESS-MIB", "baseStatsIfIndex")) if mibBuilder.loadTexts: wrBaseStatsEntry.setStatus('mandatory') baseStatsIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsIfIndex.setStatus('mandatory') baseStatsXmit = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsXmit.setStatus('mandatory') baseStatsRxmit = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsRxmit.setStatus('mandatory') baseStatsNegAckRcv = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsNegAckRcv.setStatus('mandatory') baseStatsRcv = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsRcv.setStatus('mandatory') baseStatsLineErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsLineErrors.setStatus('mandatory') baseStatsNegAckXmit = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsNegAckXmit.setStatus('mandatory') baseStatsFramePurged = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsFramePurged.setStatus('mandatory') baseStatsFreqDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsFreqDelete.setStatus('mandatory') baseStatsHopAdvance = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsHopAdvance.setStatus('mandatory') baseStatsCLineErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsCLineErrors.setStatus('mandatory') baseStatsRcvICRFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsRcvICRFrame.setStatus('mandatory') baseStatsXmitICRFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsXmitICRFrame.setStatus('mandatory') baseStatsNoICRBufferAvail = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsNoICRBufferAvail.setStatus('mandatory') baseStatsNotRoutedICRFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsNotRoutedICRFrame.setStatus('mandatory') baseStatsNbCUserEst = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 1, 5, 1, 16), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: baseStatsNbCUserEst.setStatus('mandatory') wrRemoteTable = MibTable((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 1), ) if mibBuilder.loadTexts: wrRemoteTable.setStatus('mandatory') wrRemoteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 1, 1), ).setIndexNames((0, "WIRELESS-MIB", "remIfIndex"), (0, "WIRELESS-MIB", "remIndex")) if mibBuilder.loadTexts: wrRemoteEntry.setStatus('mandatory') remIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remIfIndex.setStatus('mandatory') remIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remIndex.setStatus('mandatory') remMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 1, 1, 3), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: remMacAddress.setStatus('mandatory') remName = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: remName.setStatus('mandatory') remControllerCardDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 1, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: remControllerCardDesc.setStatus('mandatory') remUnivAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 1, 1, 6), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: remUnivAddress.setStatus('mandatory') remModemDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 1, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: remModemDesc.setStatus('mandatory') wrRemoteStatsTable = MibTable((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 2), ) if mibBuilder.loadTexts: wrRemoteStatsTable.setStatus('mandatory') wrRemStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 2, 1), ).setIndexNames((0, "WIRELESS-MIB", "remStatsIfIndex"), (0, "WIRELESS-MIB", "remStatsIndex")) if mibBuilder.loadTexts: wrRemStatsEntry.setStatus('mandatory') remStatsIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remStatsIfIndex.setStatus('mandatory') remStatsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remStatsIndex.setStatus('mandatory') remStatsXmit = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 2, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remStatsXmit.setStatus('mandatory') remStatsRxmit = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 2, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remStatsRxmit.setStatus('mandatory') remStatsNegAckRcv = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 2, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remStatsNegAckRcv.setStatus('mandatory') remStatsRcv = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 2, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remStatsRcv.setStatus('mandatory') remStatsLineErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 2, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remStatsLineErrors.setStatus('mandatory') remStatsNegAckXmit = MibTableColumn((1, 3, 6, 1, 4, 1, 2, 6, 10, 2, 2, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remStatsNegAckXmit.setStatus('mandatory') mibBuilder.exportSymbols("WIRELESS-MIB", baseAdapterStatus=baseAdapterStatus, remIfIndex=remIfIndex, wrBaseStatsEntry=wrBaseStatsEntry, baseHDLCaddress=baseHDLCaddress, baseControllerCardDesc=baseControllerCardDesc, remStatsIfIndex=remStatsIfIndex, MacAddress=MacAddress, baseNbOFRemote=baseNbOFRemote, remStatsIndex=remStatsIndex, baseStatsFramePurged=baseStatsFramePurged, wrRemote=wrRemote, baseUnivAddress=baseUnivAddress, wrBaseEntry=wrBaseEntry, baseStatsNoICRBufferAvail=baseStatsNoICRBufferAvail, baseStatsNegAckRcv=baseStatsNegAckRcv, baseStatsHopAdvance=baseStatsHopAdvance, baseStatsNbCUserEst=baseStatsNbCUserEst, remUnivAddress=remUnivAddress, wrRemoteStatsTable=wrRemoteStatsTable, baseStatsXmit=baseStatsXmit, remStatsRxmit=remStatsRxmit, baseStatsCLineErrors=baseStatsCLineErrors, remStatsLineErrors=remStatsLineErrors, baseStatsRcvICRFrame=baseStatsRcvICRFrame, baseNetworkName=baseNetworkName, baseCellIdentifier=baseCellIdentifier, baseStatsRcv=baseStatsRcv, baseIfIndex=baseIfIndex, baseTopologyTrapActive=baseTopologyTrapActive, baseAdminIPAddr=baseAdminIPAddr, baseStatsNegAckXmit=baseStatsNegAckXmit, baseModemDesc=baseModemDesc, baseStatsLineErrors=baseStatsLineErrors, ibmwlan=ibmwlan, wrRemStatsEntry=wrRemStatsEntry, remControllerCardDesc=remControllerCardDesc, wrRemoteEntry=wrRemoteEntry, remIndex=remIndex, baseStatsFreqDelete=baseStatsFreqDelete, remMacAddress=remMacAddress, remName=remName, baseStatsXmitICRFrame=baseStatsXmitICRFrame, baseStatsIfIndex=baseStatsIfIndex, wrRemoteTable=wrRemoteTable, baseName=baseName, wrBaseTable=wrBaseTable, baseStatsNotRoutedICRFrame=baseStatsNotRoutedICRFrame, baseStatsRxmit=baseStatsRxmit, remModemDesc=remModemDesc, baseEmittedPower=baseEmittedPower, remStatsNegAckRcv=remStatsNegAckRcv, ibmProd=ibmProd, ibm=ibm, remStatsXmit=remStatsXmit, remStatsRcv=remStatsRcv, remStatsNegAckXmit=remStatsNegAckXmit, wrBase=wrBase, wrBaseStatsTable=wrBaseStatsTable)
class DisjointSet: def __init__(self, *args): """Initializes the disjoint set :param args: any number of integers """ # the value implies the index of the root node of the index # e.g.: [0, 0, 1]; nodes 0 and 1 are in the same set with root = node 0 # {{0, 1}, 2} self.roots = list(args) self.ranks = [0] * len(args) def find(self, x): while x != self.roots[x]: x = self.roots[x] return x def merge(self, a, b): root_a = self.find(a) root_b = self.find(b) if self.ranks[root_a] > self.ranks[root_b]: self.roots[root_b] = root_a else: self.roots[root_a] = root_b # if they have the same root, they're in the same tree / set if self.ranks[root_a] == self.ranks[root_b]: self.ranks[root_b] += 1 def __len__(self): return len(self.roots) def __repr__(self): string = "" for index, value in enumerate(self.roots): string += "i={}, r={}".format(index, value) string += " | " if index < len(self.roots) - 1 else "\n" string += "ranks = {}".format(self.ranks) return string
def partida(): print(" ") # Solicita ao usuário os valores de n e m: n = int(input("Quantas peças? ")) m = int(input("Limite de peças por jogada?")) # Define uma variável para controlar a vez do computador: is_computer_turn = True # Decide quem iniciará o jogo: if n % (m+1) == 0: is_computer_turn = False # Execute enquanto houver peças no jogo: while n > 0: if is_computer_turn: jogada = computador_escolhe_jogada(n, m) is_computer_turn = False if jogada == 1: print("Computador tirou uma peça.") else: print("Computador retirou {} peças.".format(jogada)) else: jogada = usuario_escolhe_jogada(n, m) is_computer_turn = True if jogada == 1: print("Você tirou uma peça") else: print("Você tirou {} peças.".format(jogada)) # Retira as peças do jogo: n = n - jogada # Mostra o estado atual do jogo: print("Restam apenas {} peças em jogo.\n".format(n)) # Fim de jogo, verifica quem ganhou: if is_computer_turn: print("Você ganhou!") return 1 else: print("O computador ganhou!") return 0 def usuario_escolhe_jogada(n, m): # Vez do usuário: print("\nVocê começa!\n") # Define o número de peças do usuário: jogada = 0 # Enquanto o número não for válido while jogada == 0: # Solicita ao usuário quantas peças irá tirar: jogada = int(input("Quantas peças irá tirar? ")) # Condições: jogada < n, jogada < m, jogada > 0 if jogada > n or jogada < 1 or jogada > m: # Valor inválido, continue solicitando ao usuário: print("Oops! Jogada inválida! Tente de novo.") jogada = 0 # Número de peças válido, então retorne-o: return jogada def computador_escolhe_jogada(n, m): # Vez do computador: print("\nComputador começa!\n") # Pode retirar todas as peças? if n <= m: # Retira todas as peças e ganha o jogo: return n else: # Verifica se é possível deixar uma quantia múltipla de m+1: quantia = n % (m+1) if quantia > 0: return quantia # Não é, então tire m peças: return m def campeonato(): # Pontuações: usuario = 0 computador = 0 rodada = 0 # Executa 3 vezes: while rodada <3: rodada +=1 print(f"**** Rodada {rodada} ****") # Executa a partida: vencedor = partida() # Verifica o resultado, somando a pontuação: if vencedor == 1: # Usuário venceu: usuario = usuario + 1 else: # Computador venceu: computador = computador + 1 # Exibe o placar final: print("**** Final do campeonato! ****") print("Placar: Você {} x {} Computador".format(usuario, computador)) tipo_jogo = 0 # Enquanto não for uma opção válida: while tipo_jogo == 0: # Menu de opções: print("Bem-vindo ao jogo do NIM! Escolha:") print(" ") print("1 - Para jogar uma partida isolada") print("2 - Para jogar um campeonato") # Solicita a opção ao usuário: tipo_jogo = int(input("Sua opção: ")) print(" ") # Decide o tipo de jogo: if tipo_jogo == 1: print("Voce escolheu partida isolada!\n") partida() break elif tipo_jogo == 2: print("Voce escolheu um campeonato!\n") campeonato() break else: print("Opção inválida!") tipo_jogo = 0
class Semester: def __init__(self, season:str, year:int, brother_id:int, amount:float): self.season = season self.year = year self.brother_id = brother_id self.amount = amount
# -*- coding: utf-8 -*- def test_dataset_sizes(test_file): ds = test_file.dataset assert ds.sizes == {"ch": 2, "pixel": 1024, "Time": 50} def test_dataset_variables(test_file): ds = test_file.dataset for var in ["Count", "FilteredCount", "Rough_wavelength"]: assert var in ds def test_config(test_file): print(test_file.config) for key in [ "name", "shotno", "date", "dimno", "dimname", "dimsize", "dimunit", "valno", "valname", "valunit", ]: assert key in test_file.config["Parameters"] def test_description(test_file): assert test_file.description == "SOXMOSTestShot #66642069 @'02/04/2005 21:37'" def test_spectrogram_actually_plots(test_file, tmp_path): test_file.plot_spectrogram().fig.savefig(tmp_path / f"spectrogram.png") test_file.plot_spectrogram(vmax=1000).fig.savefig( tmp_path / f"spectrogram_max1000.png" ) def test_spectrum_actually_plots(test_file, tmp_path): for it in range(5, 45, 10): time = test_file.dataset.isel(Time=it).Time.item() test_file.plot_spectrum(time).fig.savefig(tmp_path / f"spectrum_t_{time}.png") def test_global_timetrace_actually_plots(test_file, tmp_path): test_file.plot_global_timetrace().fig.savefig(tmp_path / f"global_timetrace.png")
def append_node_to_dict(node1, node2, dict_connections): if not node1 in dict_connections: dict_connections[node1] = [node2] else: node_connections = dict_connections[node1] if not node2 in node_connections: node_connections.append(node2) dict_connections[node1] = node_connections return dict_connections def parse_connections(connection, dict_connections): splitted = connection.split('-') node1 = splitted[0] node2 = splitted[1] dict_connections = append_node_to_dict(node1, node2, dict_connections) dict_connections = append_node_to_dict(node2, node1, dict_connections) return dict_connections def find_paths(start, length, dict_connections, paths): for path in paths: last_node = path[-1] def can_visit(node, path): check = False if node.isupper(): check = True elif not node in path: check = True elif node.islower() and node != 'end' and node != 'start': lowercase_nodes = [node for node in path if node.islower()] set_lowercase_nodes = set(lowercase_nodes) if (len(lowercase_nodes) == len(set_lowercase_nodes)): check = True return check def find_paths(graph, start, end, path=[]): path = path + [start] if start == end: return [path] paths = [] for node in graph[start]: if can_visit(node, path): newpaths = find_paths(graph, node, end, path) for newpath in newpaths: paths.append(newpath) return paths if __name__ == '__main__': input = open('./day 12/Martijn - Python/input.txt').readlines() connections = [line.strip() for line in input] dict_connections = {} for x in range(0, len(connections)): dict_connections = parse_connections(connections[x], dict_connections) paths = find_paths(dict_connections, 'start', 'end') print(len(paths))
#!/usr/bin/env python3.8 """ given a string return list of all the possible permutations of the string and count of possible permutations """ count = 0 list = [] def permutation(string,prefix): global count if len(string)==0: count += 1 list.append(prefix) else: for i in range(len(string)): permutation(string[0:i]+string[i+1:], prefix+string[i]) def permutation1(string): out = [] if len(string) == 1: out = [string] else: for i, char in enumerate(string): for perm in permutation1(string[:i]+string[i+1:]): out += [char + perm] return out string = "ABC" permutation(string, "") print(list, count) list = permutation1(string) print(list, len(list))
""" Events, the fundamental message. """ class SpaceEvent(object): def __init__(self, data): self.data = data def __str__(self): return '<%s>: %s' % (self.__class__.__name__, self.data) class KernelEvent(SpaceEvent): """A special event.""" pass
class TrieNode: def __init__(self): self.children: Dict[str, TrieNode] = defaultdict(TrieNode) self.deleted = False class Solution: def deleteDuplicateFolder(self, paths: List[List[str]]) -> List[List[str]]: ans = [] root = TrieNode() subtreeToNodes: Dict[str, List[TrieNode]] = defaultdict(list) # Construct the Trie for path in sorted(paths): node = root for s in path: node = node.children[s] # For each subtree, fill in the {subtree encoding: [root]} hash table def buildSubtreeToRoots(node: TrieNode) -> str: subtree = '(' + ''.join(s + buildSubtreeToRoots(node.children[s]) for s in node.children) + ')' if subtree != '()': subtreeToNodes[subtree].append(node) return subtree buildSubtreeToRoots(root) # Mark nodes that should be deleted for nodes in subtreeToNodes.values(): if len(nodes) > 1: for node in nodes: node.deleted = True # Construct the answer array for nodes that haven't been deleted def constructPath(node: TrieNode, path: List[str]) -> None: for s, child in node.children.items(): if not child.deleted: constructPath(child, path + [s]) if path: ans.append(path) constructPath(root, []) return ans
num_1 = int(input('Insira um número: ')) num_2 = int(input('Insira mais um número: ')) num_3 = int(input('Insira outro número: ')) num_4 = int(input('Insira mais outro número: ')) tupla_numeros = (num_1, num_2, num_3, num_4) indice_3 = 0 if 3 in tupla_numeros: indice_3 = tupla_numeros.index(3) + 1 print(f'A tupla resultante é: {tupla_numeros}') print(f'O número 9 apareceu {tupla_numeros.count(9)} vezes') print(f'O valor 3 aparece na {indice_3}ª posição') print(f'Os valores pares na tupla são: ', end='') for num in tupla_numeros: if num % 2 == 0: print(num, end=' ')
# -*- coding: utf-8 -*- # TODO: doc """feelsbook """ __version__ = (0, 0, 0)
class Type1: def f1_1(): pass def test(t1): t1.f1_1() t2 = t1
total = 0 quantidade = 0 barato = '' valor = 0 while True: produto = input('Qual o nome do produto? ') valor_anterior = valor valor = float(input('Qual o preço do produto? ')) total += valor if valor > 1000: quantidade += 1 if valor < valor_anterior: barato = produto c = input('Deseja continuar? [S/N] ').strip().lower() if c in 'n': print(f'o valor total gasto na compra é de R${total:.2f} \n{quantidade} produtos custaram mais de R$1000,00 ' f'\nO produto mais barato foi {barato}') break
# coding:utf-8 # File Name: strip_test # Author : yifengyou # Date : 2021/07/18 s = " this is a puppy " print(s) print(s.lstrip()) print(s.rstrip()) print(s.strip()) print(s) print(s.lstrip(" this")) print("=========") print(s.startswith(" ")) print(s.find("puppy")) print(s.replace("puppy", "dog")) print("=========") print(s.split()) print(s.split("i")) print("-".join(s.split()))
""" @Author: huuuuusy @GitHub: https://github.com/huuuuusy 系统: Ubuntu 18.04 IDE: VS Code 1.36 工具: python == 3.7.3 """ """ 思路: 先用set将两个数组分别去重 然后合并后的列表中如果某元素数目大于1,说明其来自不同的数组 利用字典保存结果并且判断 结果: 执行用时 : 44 ms, 在所有 Python3 提交中击败了97.64%的用户 内存消耗 : 13.1 MB, 在所有 Python3 提交中击败了81.55%的用户 """ class Solution: def intersection(self, nums1, nums2): d = {} nums1 = list(set(nums1)) nums2 = list(set(nums2)) for num in nums1 + nums2: d[num] = d.get(num, 0) + 1 result = [] for key, value in d.items(): if value > 1: result.append(key) return result if __name__ == "__main__": nums1 = [4,9,5] nums2 = [9,4,9,8,4] answer = Solution().intersection(nums1, nums2) print(answer)
TABLE8 = [0] * 2 ** 8 for index in range(len(TABLE8)): TABLE8[index] = (index & 1) + TABLE8[index >> 1] class Solution: def hammingWeight(self, n: int) -> int: return TABLE8[n & 0xff] + TABLE8[(n >> 8) & 0xff] + TABLE8[(n >> 16) & 0xff] + TABLE8[n >> 24]
class SensorReadError(Exception): pass class CommunicationErrorException(Exception): pass
# @time: 2022/1/10 5:31 PM # Author: pan # @File: study.py # @Software: PyCharm print("study py") name = "pan" age = 10 def study(): print("good good study, day day up!")
class Response(object): def __init__(self, request=None): self.intent_name = request.intent_name if request else '' self.lang = request.lang if request else '' self.data = request.data if request else '' self._speech = '' self._text = '' @property def text(self): if self._text == '': return self._speech return self._text @text.setter def text(self, value): self._text = value @property def speech(self): if self._speech == '': return self._text return self._speech @speech.setter def speech(self, value): self._speech = value
''' math > ad-hoc difficulty: easy date: 09/Jun/2020 problem: how many bishops can be placed on a n x n chessboard without threatening each other? by: @brpapa ''' while (1): try: n = int(input()) ans = n + (n-2 if n > 2 else 0) print(ans) except EOFError: break
ENCRYPTED_MESSAGE = 'MORA EVOCU ECCLESIA TUTIS AUT TIBI NISI OLIM OCIUS NOVEM' DECRYPTED_MESSAGE = 'MEETATNOON' CIPHER_OPTIONS = ['null','caesar','atbash'] cipher_used_in_this_example = CIPHER_OPTIONS[0] # replace with the index of the cipher used in this encryption
x1, x2, y1, y2 = 150, 193, -86, -136 def passes_through(vx, vy): nx, ny = 0, 0 points = [] while nx <= x2 and ny >= y2: nx, ny = nx + vx, ny + vy points += [[nx, ny]] if vx > 0: vx = vx - 1 vy = vy - 1 if x1 <= nx and nx <= x2 and y2 <= ny and ny <= y1: return 1 return 0 def max_y(vy): return sum(range(0, vy+1)) y_min, y_max = -200, 140 result = [[passes_through(x, y) for x in range(16, 200)] for y in range(y_min, y_max)] [print(str(y + y_min) + ' ' + str(result[y])) for y in range(0, abs(y_min) + y_max)] print(passes_through(17, 135)) print('part 1: %i' % max_y(135)) print('part 2: %i' % sum([sum(y) for y in result]))
money = float(input('o quanto de dinheiro que a pessoa tem: ')) print('o dolar vale 3.27, quanto dolar ele podrá comprar?') s = money / 3.27 print('{:.2f} / 3.27 = {:.2f}'.format(money, s)) print('mais ou menos {:.2f} dólares'.format(s)) #acrescentando para ponto flutuante( ":.2f" )
#João Papo-de-Pescador, homem de bem, comprou um microcomputador para controlar # o rendimento diário de seu trabalho. Toda vez que ele traz um peso de peixes maior # que o estabelecido pelo regulamento de pesca do estado de São Paulo (50 quilos) # deve pagar uma multa de R$ 4,00 por quilo excedente. João precisa que você faça # um programa que leia a variável peso (peso de peixes) e calcule o excesso. # Gravar na variável excesso a quantidade de quilos além do limite e na variável multa o valor # da multa que João deverá pagar. Imprima os dados do programa com as mensagens adequadas. peso = int(input("Informe o peso do pescado:")) if peso > 50: peso_exc = peso - 50 multa = peso_exc * 4.00 print("Seu pescado excedeu o limite e você pagará R$",multa,"de multa!") else: print("Seu pescado não excedeu o limite!")
#Practical proof of fact, that numbers 2^x are almost perfect number #END = 30 END = int(input("End of loop")) for i in range(2,END): s = set([1]) n = 2**i for j in range(int(n/2+1),1,-1): if(n % j==0): s.add(j) print(n,end=" - ") print(sum(s)+1==n) #OUTPUT """ 4 - True 8 - True 16 - True 32 - True 64 - True 128 - True ... 2^i - True """
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def buildTree(self, inorder: 'List[int]', postorder: 'List[int]') -> 'TreeNode': if not inorder or not postorder: return root = TreeNode(postorder[-1]) i = 0 while inorder[i] != postorder[-1]: i += 1 root.left = self.buildTree(inorder[:i], postorder[:i]) root.right =self.buildTree(inorder[i+1:], postorder[i:-1]) return root # def buildTree(self, inorder: 'List[int]', postorder: 'List[int]') -> 'TreeNode': # if not inorder or not postorder: # return [] # root = TreeNode(postorder[-1]) # self._buildTree(root,inorder,postorder) # return root # def _buildTree(self, node, inorder, postorder) -> 'TreeNode': # rootIndex_inorder = inorder.index(postorder[-1]) # lenOfLeftSubTree = rootIndex_inorder # lenOfRightSubTree = len(inorder)-lenOfLeftSubTree-1 # if lenOfLeftSubTree > 0: # node.left = TreeNode(postorder[lenOfLeftSubTree-1]) # self._buildTree(node.left,inorder[0:rootIndex_inorder],postorder[0:lenOfLeftSubTree]) # if lenOfRightSubTree > 0: # node.right = TreeNode(postorder[lenOfLeftSubTree+lenOfRightSubTree-1]) # self._buildTree(node.right,inorder[rootIndex_inorder+1:],postorder[lenOfLeftSubTree:lenOfLeftSubTree+lenOfRightSubTree]) # return
expected_output = { "tag": { "1": { "topo_type": "unicast", "topo_name": "base", "tid": 0, "topo_id": "0x0", "flex_algo": { "None": { "prefix": { "4.4.4.4": { "prefix_attr": { "x_flag": False, "r_flag": False, "n_flag": True }, "subnet": "32", "source_router_id": "4.4.4.4", "algo": { 0: {}, 1: {} }, "via_interface": { "GigabitEthernet0/0/8": { "level": { "L2": { "source_ip": { "4.4.4.4": { "lsp": { "next_hop_lsp_index": 4, "rtp_lsp_index": 7, "rtp_lsp_version": 2651, "tpl_lsp_version": 2651 }, "distance": 115, "metric": 35, "via_ip": "23.23.23.1", "tag": "0", "filtered_out": False, "host": "asr1k-23.00-00", "prefix_attr": { "x_flag": False, "r_flag": False, "n_flag": True }, "algo": { 0: { "sid_index": 604, "flags": { "r_flag": False, "n_flag": True, "p_flag": False, "e_flag": False, "v_flag": False, "l_flag": False }, "label": "100604" }, 1: {} } } } } } } } } } } } } } }
"""/** * @author [Jai Miles] * @email [jaimiles23@gmail.com] * @create date 2020-05-05 13:56:45 * @modify date 2020-05-05 13:56:45 * @desc [ Data module for the fallback handler. ] */ """ ########## # Standard Fallback ########## MS_FALLBACK = "I can't help you with that right now." ########## # Did not understand answer ########## "Sorry, I didn't catch your answer. Can you please try again." MT_SORRY = ( "Sorry,", "Sorry,", "I'm sorry,", "", "", ) MT_DID_NOT_REGISTER_SLOT = ( "I didn't catch that.", "I didn't get your answer.", "I didn't quite hear you.", ) MT_TRY_AGAIN = ( "Please try again.", "Please retry.", "Can you please try again?", "Can you please retry?", ) MMT_NOT_UNDERSTAND = ( MT_SORRY, MT_DID_NOT_REGISTER_SLOT, MT_TRY_AGAIN, )
# MIT License # (C) Copyright 2021 Hewlett Packard Enterprise Development LP. # # netFlow : ECOS Netflow configuration def get_net_flow_configuration( self, ne_id: str, cached: bool, ) -> dict: """Get netflow configurations from Edge Connect appliance .. list-table:: :header-rows: 1 * - Swagger Section - Method - Endpoint * - netFlow - GET - /netFlow/{neId} :param ne_id: Appliance id in the format of integer.NE e.g. ``3.NE`` :type ne_id: str :param cached: ``True`` retrieves last known value to Orchestrator, ``False`` retrieves values directly from Appliance :type cached: bool :return: Returns dictionary of netflow configuration information \n * keyword **active_timeout** (`int`): Specify NetFlow timeout (1..30) mins * keyword **ipfix_tmplt_rfrsh_t** (`int`): Specify IPFIX template refresh timeout (1..1440) mins * keyword **port1** (`int`): No description from Swagger * keyword **if_wan_tx** (`bool`): No description from Swagger * keyword **enable** (`bool`): No description from Swagger * keyword **ipaddr1** (`str`): valid ip address * keyword **if_lan_rx** (`bool`): No description from Swagger * keyword **if_lan_tx** (`bool`): No description from Swagger * keyword **ipaddr2** (`str`): valid ip address * keyword **if_wan_rx** (`bool`): No description from Swagger * keyword **port2** (`int`): No description from Swagger * keyword **optional_ies** (`dict, optional`): dictionary of optional IES \n * keyword **app_perf_ies** (`bool, optional`): app performance optional IES * keyword **zbf_ies** (`bool, optional`): zbf optional IES\n * keyword **collector_type1** (`str`): NetFlow or IPFIX collector type * keyword **collector_type2** (`str`): NetFlow or IPFIX collector type :rtype: dict """ return self._get("/netFlow/{}?cached={}".format(ne_id, cached))
#!/usr/bin/env python class Section: def has_item(self, item): return hasattr(self, item) def __getitem__(self, item): return self.__dict__[item] class ConfigReader(object): """ ConfgiReader - An improved config parser. """ def __init__(self): self.sections = [] def __load(self, lines): for line in filter(None, lines): if line.startswith("["): cursec = line.split("[")[-1].split("]")[0] self.sections.append(cursec) section = Section() setattr(self, cursec, section) elif line.startswith(";") or line.startswith("#"): next else: x = line.split("=") if len(x) > 1: delim = "=" else: x = line.split(":") delim = ":" key = x[0] value = delim.join(x[1:]) setattr(section, key.strip(), value.strip() % section) def read(self, cfg): """ read(configfile) -> This loads a configfile into the object """ try: f = open(cfg, 'rb') self.__load(map(lambda x: x.strip(), f.readlines())) f.close() except IOError: raise StandardError("Couldn't find config file: %s" % (cfg)) def get_sections(self): """ get_sections() -> Returns a list of the sections from the loaded config file. """ return self.sections def has_section(self, section='DEFAULT'): """ has_section(section_name) -> Returns a boolean for the presence of a section. If no section name is passed, it defaults to 'DEFAULT' as the section name. """ return section.strip() in self.sections def get_items(self, section='DEFAULT'): """ get_items(section_name) -> Returns the dictionary of items found with in the specified section. If no section name is passed, it defaults to 'DEFAULT' as the section name. """ return self.__dict__[section].__dict__ def __getitem__(self, item): return self.__dict__[item] if __name__ == "__main__": C = ConfigReader() #C.read("test.cfg") #print(C.get_items('TYPES')) #print(C.debug.level) C.read("OMQS.cfg") print(C.Global.MQURL) print (C.debug.level) # print(C.DEFAULT.name) # print(C.get_sections()) # print(C.DEFAULT['fname']) # print(C.testnames.t2) # print(C.get_items('test')) # print(C.test[';this']) # print(C.test.this) # print(C.DEFAULT.fname) # print(C['DEFAULT'].fname) # print(C['DEFAULT']['fname']) # defs = C.DEFAULT # print(getattr(defs, 'lname'))
class AccidentData: """Clase base que tiene por objetivo darle contexto a los datos de accidentes""" def __init__(self): self.client = 0 self.client_name = "" self.client_contact = "" self.client_phone = "" self.data_origin = ""
{ "targets": [ { "target_name": "baseJump", "sources": [ "cc/baseJump.cc", "cc/BigInteger.cc", "cc/BigIntegerAlgorithms.cc", "cc/BigIntegerUtils.cc", "cc/BigUnsigned.cc", "cc/BigUnsignedInABase.cc" ], "include_dirs": [ "<!(node -e \"require('nan')\")" ], "cflags!": [ "-fno-exceptions" ], "cflags_cc!": [ "-fno-exceptions" ], "conditions": [ [ "OS==\"mac\"", { "xcode_settings": { "GCC_ENABLE_CPP_EXCEPTIONS": "YES" } } ] ] } ] }
# 48. Rotate Image # ttungl@gmail.com # You are given an n x n 2D matrix representing an image. # Rotate the image by 90 degrees (clockwise). # Note: # You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation. # Example 1: # Given input matrix = # [ # [1,2,3], # [4,5,6], # [7,8,9] # ], # rotate the input matrix in-place such that it becomes: # [ # [7,4,1], # [8,5,2], # [9,6,3] # ] # Example 2: # Given input matrix = # [ # [ 5, 1, 9,11], # [ 2, 4, 8,10], # [13, 3, 6, 7], # [15,14,12,16] # ], # rotate the input matrix in-place such that it becomes: # [ # [15,13, 2, 5], # [14, 3, 4, 1], # [12, 6, 8, 9], # [16, 7,10,11] # ] class Solution(object): def rotate(self, matrix): """ :type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead. """ # sol 1 # use zip(*). # runtime: 40ms matrix[:] = zip(*matrix[::-1]) # sol 2: # runtime: 39ms matrix.reverse() for i in range(len(matrix)): for j in range(i): matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j] # sol 3: # use flip-flop # runtime: 37ms for i in range(len(matrix)): # flip left-right for j in range(i): matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j] for r in matrix: for c in range(len(matrix)/2): r[c], r[~c] = r[~c], r[c]
i = 0 while i < 3: print("i: ", i) j = 0 while j < 3: print("j: ", j) j += 1 i += 1
#!/usr/bin/env python3 # # Author: Vishwas K Singh # Email: vishwasks32@gmail.com # # Script to Program to find Sum, Diff, Prod, Avg, Div num1 = input("Enter the first Number: ") num2 = input("Enter the second Number: ") # Check if the user has entered the number itself try: # Convert the numbers to double always, which would handle integers # and also floating point numbers num1 = float(num1) num2 = float(num2) except ValueError: print("The entered input is not a number") exit(0) except TypeError: print("The entered input is not a number") exit(0) # Perform operation on numbers # Sum print("Sum of the two Numbers is: %.2f"%(num1+num2)) # Difference - always will positive print("Difference of two numbers is: %.2f"%(abs(num1-num2))) # average print("Average of two numbers is: %.2f"%((num1+num2)/2)) # product print("Product of the two numbers is %.2f"%(num1*num2)) # division if num2 == 0: print("Cannot perform division as second number is zero") else: print("Division of the two numbers is %.2f"%(num1/num2))
class Bands: all_bands = [] def __init__(self, band_name, members): self.band_name = 'band_name' self.members = members self.__class__.all_bands.append(self) def to_list(self): return self.all_bands def __str__(self): return f'the band name is {self.band_name}' def __repr__(self): return f'band: {self.band_name}' class Musician: def __init__(self, name, insturment): self.name = name self.insturment = insturment def __str__(self): return f'I am the {self.insturment}' def __repr__(self): return f'band member is: {self.insturment}' class Guitarist(Musician): def __init__(self, name): super().__init__(name, 'guitarist') class Singer(Musician): def __init__(self, name): super().__init__(name, 'singer') class Drummer(Musician): def __init__(self, name): super().__init__(name, 'drummer')
# Author: btjanaka (Bryon Tjanaka) # Problem: (Leetcode) 1 # Title: Two Sum # Link: https://leetcode.com/problems/two-sum/ # Idea: The easy solution is to check every pair of elements, but this is # O(n^2). To achieve O(n), the basic idea is to use a set that keeps track of # which elements we have seen so far while iterating through the list. Then, for # the value x, we can check if we have (target - x) in the set. This is # efficient since lookups for a hash set are O(1). In this solution, we have to # use a dict / hash map instead of a set because we need to store the indices of # the numbers. # Difficulty: easy # Tags: set class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: prev_nums_with_indices = dict() for i in range(len(nums)): x = nums[i] if (target - x) in prev_nums_with_indices: prev_num_index = prev_nums_with_indices[target - x] return [prev_num_index, i] prev_nums_with_indices[x] = i # Technically not necessary, since the problem guarantees exactly one solution. return [-1, -1]
a = list(map(lambda i: ord(i) - 97, list(input()))) idx_array = [-1 for _ in range(26)] for i in range(len(a)): if idx_array[a[i]] == -1: idx_array[a[i]] = i for idx in idx_array: print(idx, end=' ')
# https://leetcode.com/problems/kth-smallest-element-in-a-bst/ # # algorithms # Medium (49.79%) # Total Accepted: 199,308 # Total Submissions: 400,327 # beats 100.0% of python submissions # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def kthSmallest(self, root, k): """ :type root: TreeNode :type k: int :rtype: int """ self.k = k self.res = None self.recursive(root) return self.res def recursive(self, node): if not node or self.res: return self.recursive(node.left) self.k -= 1 if self.k == 0: self.res = node.val return self.recursive(node.right)
# Complete the compareTriplets function below. def compareTriplets(a, b): al =0 bo=0 for i in range(3): if(a[i]>b[i]): al+=1 elif(b[i]>a[i]): bo+=1 return(al,bo) if __name__ == '__main__': fptr = open(os.environ['OUTPUT_PATH'], 'w') a = list(map(int, input().rstrip().split())) b = list(map(int, input().rstrip().split())) result = compareTriplets(a, b) fptr.write(' '.join(map(str, result))) fptr.write('\n') fptr.close()
def partition(top, end, array): pivot_index = top pivot = array[pivot_index] while top < end: while top < len(array) and array[top] <= pivot: top += 1 while array[end] > pivot: end -= 1 if(top < end): array[top], array[end] = array[end], array[top] array[end], array[pivot_index] = array[pivot_index], array[end] return end def quick_sort(top, end, array): if (top < end): p = partition(top, end, array) quick_sort(top, p - 1, array) quick_sort(p + 1, end, array) array = [ 10, 7, 8, 9, 1, 5 ] quick_sort(0, len(array) - 1, array) print(f'Sorted array: {array}')
def find_coordinates(x, y): # Get coordinates of mouse click return (x- x%10, y - y%10) def get_all_neighbours(cell): # get neighbours along with current cell (x,y) = cell return [(x-i,y-j) for i in range(-10,20,10) for j in range(-10,20,10)] def get_next_generation(cells): # Get next generation next_gen = {} which_cells_to_check = set() for curr_cell,_ in cells.items(): for xy in get_all_neighbours(curr_cell): which_cells_to_check.add(xy) for curr_cell in which_cells_to_check: curr_live_neighbours = 0 for xy in get_all_neighbours(curr_cell): curr_live_neighbours += 1 if (curr_cell != xy) and (cells.get(xy,None) is not None) else 0 if cells.get(curr_cell,None) is not None and ((curr_live_neighbours == 2) or (curr_live_neighbours == 3)): next_gen[curr_cell]=True if cells.get(curr_cell,None) is None and (curr_live_neighbours == 3): next_gen[curr_cell]=True return next_gen
# # PySNMP MIB module BIANCA-BRICK-PPP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BIANCA-BRICK-PPP-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:37: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) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Gauge32, MibIdentifier, iso, ObjectIdentity, Unsigned32, ModuleIdentity, Integer32, NotificationType, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, IpAddress, TimeTicks, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "MibIdentifier", "iso", "ObjectIdentity", "Unsigned32", "ModuleIdentity", "Integer32", "NotificationType", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "IpAddress", "TimeTicks", "Counter32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") org = MibIdentifier((1, 3)) dod = MibIdentifier((1, 3, 6)) internet = MibIdentifier((1, 3, 6, 1)) private = MibIdentifier((1, 3, 6, 1, 4)) enterprises = MibIdentifier((1, 3, 6, 1, 4, 1)) bintec = MibIdentifier((1, 3, 6, 1, 4, 1, 272)) bibo = MibIdentifier((1, 3, 6, 1, 4, 1, 272, 4)) ppp = MibIdentifier((1, 3, 6, 1, 4, 1, 272, 4, 3)) dialmap = MibIdentifier((1, 3, 6, 1, 4, 1, 272, 4, 4)) class BitValue(Integer32): pass class Date(Integer32): pass biboPPPTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 3, 1), ) if mibBuilder.loadTexts: biboPPPTable.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPTable.setDescription("The biboPPPTable contains configuration information for the PPP interfaces. Each time a new entry is made here, a corresponding entry is made in the ifTable. Creating entries: Entries are created by assigning a value to the biboPPPType object. Deleting entries: Entries are removed by setting an entry's biboPPPEncapsulation object to 'delete'.") biboPPPEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1), ).setIndexNames((0, "BIANCA-BRICK-PPP-MIB", "biboPPPType")) if mibBuilder.loadTexts: biboPPPEntry.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPEntry.setDescription('') biboPPPIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPIfIndex.setDescription('Correlating PPP interface index. This value is assigned automatically by the system.') biboPPPType = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5))).clone(namedValues=NamedValues(("isdn-dialup", 1), ("leased", 2), ("isdn-dialin-only", 3), ("multiuser", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPType.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPType.setDescription("The type of link. A new dialup link is created when this field is set to the value isdn-dialup(1), dialin-only(3) or multiuser(5). The maximum number of dialup links is limited by system memory. Each dialup link should have at least one corresponding entry in the biboDialTable to configure the remote ISDN telephone number(s). A leased line link, can not be created by setting this field to leased(2), but is automatically established when the IsdnChType field is set to either 'leased-dte' or 'leased-dce' (which doesn't make a difference for PPP, but must be set correctly for other encapsulation methods). Naturally, when the IsdnChType field is set to any other value, the biboPPPTable entry is removed. In both cases, a new entry in the biboPPPTable creates corre- corresponding entries in the ifTable (a new interface) and in the biboPPPStatTable (PPP statistics). Setting this object to multiuser(5), up to biboPPPMaxConn matching incoming connections (see biboPPPAuthentication, biboPPPAuthSecret, biboPPPAuthIdent) from different dialin partners will be accepted.") biboPPPEncapsulation = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17))).clone(namedValues=NamedValues(("ppp", 1), ("x25", 2), ("x25-ppp", 3), ("ip-lapb", 4), ("delete", 5), ("ip-hdlc", 6), ("mpr-lapb", 7), ("mpr-hdlc", 8), ("frame-relay", 9), ("x31-bchan", 10), ("x75-ppp", 11), ("x75btx-ppp", 12), ("x25-nosig", 13), ("x25-ppp-opt", 14), ("x25-pad", 15), ("x25-noconfig", 16), ("x25-noconfig-nosig", 17)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPEncapsulation.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPEncapsulation.setDescription("The layer 2 encapsulation of the link. The use of ppp(1) as described in RFC 1661 is the preferred encapsulation for point-to-point links. The encapsulation is set to x25(2) for X.25-only links and to x25-ppp(3) for concurrent use of X.25 and PPP. Mpr-lapb(7) and mpr-hdlc(8) are popular proprietary encapsulations. They both use the ethertype number for protocol multiplexing. The former is used when error correction or data compression (v42bis) is desired. The latter (mpr-hdlc) is compatible to Cisco's HDLC encapsulation. On IP-only links it is also possible to use the ISO LAPB protocol (ip-lapb(4)), also known as X.75, or raw hdlc framing (ip-hdlc(6)). The x75-ppp encapsulation provides a proprietary solution for using PPP encapsulation over X.75 (LAPB) framing, x75btx-ppp provides PPP over T.70 and LAPB framing including a BTX protocol header to access BTX services over ISDN links. The x25-nosig(13) encapsulation is used to establish X.25 connections over dialup links without specific signalling on the D-channel (pure data call). The x25-ppp-opt encapsulation provides a special kind of the x25-ppp encapsulation. Dialin partner will be authenticated either outband to establish an X.25 connection via ISDN or optional inband by using the point-to-point protocol (PPP). Concurrent use of X.25 and PPP encapsulation is excluded. The x25-noconfig(16) and x25-noconfig-nosig(17) encapsulations provide a solution fr establishing X.25 connections via ISDN. The dial number will be derived from X.25 destination address by using special rules. V42bis data compression can be enabled on LAPB links only, because v42bis requires an error free connection. Dialup links can be removed by setting this field to delete(5). This has no effect on permanent links.") biboPPPKeepalive = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPKeepalive.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPKeepalive.setDescription('When set to on(1), keepalive packets are sent in regular intervals during the connection. Keepalive packets can not be sent using the ip-lapb or x25 encapsulation.') biboPPPTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(500, 10000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPTimeout.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPTimeout.setDescription('The number of milliseconds waiting before retransmitting a PPP configure packet.') biboPPPCompression = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 1), ("v42bis", 2), ("stac", 3), ("ms-stac", 4), ("mppc", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPCompression.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPCompression.setDescription('The throughput can be enhanced up to factor three using the V42bis compression method or the Stac LZS compression algorithm. V42bis is currently supported with the ip-lapb and mpr-lapb encapsulation. Stac LZS compression algorithm is provided using PPP encapsulated links, stac(3) indicates support of Sequence checking, ms-stac(4) indicates support of Extended mode which is prefered by Microsoft. Both check modes are implemented according RFC 1974. When set to mppc(5), the Microsoft Point-to-Point Compression (MPPC) Protocol according RFC 2118 is negotiated. MPPC uses an LZ based algorithm with a sliding window history buffer.') biboPPPAuthentication = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("none", 1), ("pap", 2), ("chap", 3), ("both", 4), ("radius", 5), ("ms-chap", 6), ("all", 7), ("ms-chapv2", 8)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPAuthentication.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPAuthentication.setDescription("The type of authentication used on the point-to-point link as described in RFC 1334. The authentication protocol supports pap(2) (Password Authentication Protocol), chap(3) (Challenge Handshake Authentication Protocol), or both(4). When set to both(4), the link must be successfully authenticated by either CHAP or PAP. The type ms-chap(6) and ms-chapv2(8) are Microsofts proprietary CHAP authentication procedures (using MD4 and DES encryption instead of MD5 encryption algorithm), all(7) includes PAP, CHAP and MS-CHAP. Another way to authenticate dial-in users is by using RADIUS (remote authentication dial in user service). Users can authenticate themselves either using PAP or CHAP (excluding MS-CHAP). In general the system creates PPP interfaces with this authentication itself, but it's also possible to take advance of the RADIUS dial-in services with pre-configured interfaces. See biboAdmRadiusServer for further details.") biboPPPAuthIdent = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPAuthIdent.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPAuthIdent.setDescription("The remote authentication identification string. The local authentication identification string is taken from the contents of the sysName field, up to the appearance of the first dot (e.g., the remote name would be `brick' if the content of the sysName field was `brick.bintec.de').") biboPPPAuthSecret = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPAuthSecret.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPAuthSecret.setDescription('The authentication secret, which is used symmetrically for both local and remote sides of the PPP link.') biboPPPIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("static", 1), ("dynamic-server", 2), ("dynamic-client", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPIpAddress.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPIpAddress.setDescription('The IP control protocol as described in RFC1332 has a means of negotiating IP-addresses. When this option is set to dynamic-server(2), an available IP-address found in biboPPPIpAddrTable is assigned as the remote IP-address and a temporary route is created during the uptime of the interface. When set to dynamic-client(3), the remote system is asked to tell us our own IP-address. A host route will be created during the uptime of the interface. In most cases this option will be set automatically by the network address translation option. In static(1) mode, address-negotiation is not forced.') biboPPPRetryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3600))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPRetryTime.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPRetryTime.setDescription('Time in seconds to wait before retrying a call; currently not used.') biboPPPBlockTime = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 12), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPBlockTime.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPBlockTime.setDescription('Time in seconds to wait after a connection failure (e.g. the number of biboPPPMaxRetries calls failed). When set to zero, the interface state is never set to blocked.') biboPPPMaxRetries = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPMaxRetries.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPMaxRetries.setDescription('The number of dialup retries before changing to the blocked state.') biboPPPShortHold = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 3600))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPShortHold.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPShortHold.setDescription('The time in seconds to wait, once the channel is silent, (that is, no data is being received or transmitted) before terminating the link. When set to zero the short hold mode is disabled, when set to -1 the short hold mode is disabled and the link will be reconnected when connection was lost.') biboPPPInitConn = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 250))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPInitConn.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPInitConn.setDescription(' The number of channels to initially set up for this interface.') biboPPPMaxConn = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 250))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPMaxConn.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPMaxConn.setDescription('The maximum number of channels bundled for this interface.') biboPPPMinConn = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 250))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPMinConn.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPMinConn.setDescription('The minimum number of channels bundled for this interface.') biboPPPCallback = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ("expected", 3), ("ppp-offered", 4), ("delayed", 5), ("ppp-callback-optional", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPCallback.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPCallback.setDescription("If this object is enabled(1), and the call is recognized by the dialed number then calls are never accepted, and a callback is forced for incoming calls at once. The callback can be delayed for biboPPPRetryTime seconds by setting this entry to delayed(5). If the call is recognized by inband authentication (PAP or CHAP) then the actual connection is closed and a callback is performed at once. Setting this value to ppp-offered(4) allows a called peer to call back the calling site if offered by PPP negotiation. For PABX dialout a dialprefix is added to the number, if offered by the calling site (see isdnStkTable). If this object is set to expected(3), only one initial outgoing call is made expecting a callback. If this object is set to ppp-callback-optional(6), the CBCP option 'no callback' is also offered to the Windows client so that the user can decide wether he wants to be called back or not.") biboPPPLayer1Protocol = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23))).clone(namedValues=NamedValues(("data-64k", 1), ("data-56k", 2), ("modem", 3), ("dovb", 4), ("v110-1200", 5), ("v110-2400", 6), ("v110-4800", 7), ("v110-9600", 8), ("v110-14400", 9), ("v110-19200", 10), ("v110-38400", 11), ("modem-profile-1", 12), ("modem-profile-2", 13), ("modem-profile-3", 14), ("modem-profile-4", 15), ("modem-profile-5", 16), ("modem-profile-6", 17), ("modem-profile-7", 18), ("modem-profile-8", 19), ("pptp-pns", 20), ("pppoe", 21), ("aodi", 22), ("pptp-pac", 23)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPLayer1Protocol.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLayer1Protocol.setDescription('This entry is used to select the layer 1 protocol settings for this partner. Normally the correct entry is hdlc-64.') biboPPPLoginString = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 20), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPLoginString.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLoginString.setDescription('A textual string containing a login sequence (script) composed of fields in the format [expect send], comparable to chat scripts commonly used on other sytems. This script is required i.e. to establish an asynchronus PPP dialup connection to CompuServe.') biboPPPVJHeaderComp = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPVJHeaderComp.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPVJHeaderComp.setDescription('This entry is used to enable Van Jacobsen TCP/IP header compression, which reduces the size of TCP/IP packet headers and increases the efficiency of line utilization.') biboPPPLayer2Mode = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("auto", 1), ("dte", 2), ("dce", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPLayer2Mode.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLayer2Mode.setDescription('This object specifies the layer 2 mode to be used for a connection. It is only relevant, if the Encapsulation involves an LAPB protocol. This is the case for x25, x25-ppp, ip-lapb, lapb, x31-bchan, x75-ppp, x75btx-ppp, x25-nosig. The Default value of this object is auto. For dialup connection, the layer 2 mode will than be DTE, on the calling side and DCE on the called side. For permanent connections, the layer 2 mode is set at lower layers (for example isdnChType in the isdnChTable). When this object is set to dte or dce, the layer 2 mode will always be DTE or DCE, regardless of the call direction or the settings at the lower layer.') biboPPPDynShortHold = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 23), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPDynShortHold.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPDynShortHold.setDescription("Optimizes idle time disconnects depending on the charging information received during the connection. This value specifies the minimum inactivity time (channel is silent) in percents of the current charging interval length and is only used for outgoing connections. Incoming connections are disconnected after idle time according to the value biboPPPShortHold. Please note that this only works if your ISDN port has the AOCD service enabled (advice of charging during the call). For instance in Germany this is an extra paid service. (Even the 'Komfortanschluss' does only include AOCE [advice of charge at the end of the call], so AOCD has to be ordered and paid extra.)") biboPPPLocalIdent = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 24), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPLocalIdent.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLocalIdent.setDescription('This is the local identification string used for PPP authentication(PAP/CHAP). If this entry is empty the variable biboAdmLocalPPPIdent will be used.') biboPPPDNSNegotiation = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("dynamic-client", 3), ("dynamic-server", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPDNSNegotiation.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPDNSNegotiation.setDescription('The IP control protocol extensions as described in RFC 1877 has a means of negotiating primary and secondary Domain Name System (DNS) server addresses. When this option is disabled(1), no DNS negotiation will be performed. If enabled(2), DNS negotiation behavier depends on biboPPPIpAddress switch (client or server mode). Setting to dynamic-client(3), the remote system is asked to tell us the IP-address(es) of primary and/or secondary DNS. Setting to dynamic_server(4), primary and/or secondary DNS IP-address(es) found in biboAdmNameServer or biboAdmNameServ2, if asked, will be send to remote.') biboPPPEncryption = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("none", 1), ("mppe-40", 2), ("mppe-128", 3), ("des-56", 4), ("triple-des-168", 5), ("blowfish-168", 6), ("mppe-56", 7), ("mppev2-40", 8), ("mppev2-56", 9), ("mppev2-128", 10), ("blowfish-56", 11)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPEncryption.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPEncryption.setDescription("This field specifies the data encryption scheme for en(de)crypting PPP encapsulated multi-protocol datagrams. Setting to mppe-40(2), mppe-128(3) or mppe-56(7) the Microsoft Point to Point Encryption Protocol (MPPE) will be enabled, using a 40 bit, 128 bit respectively 56 bit session key for initializing encryption tables. Setting to mppev2-40(8), mppev2-56(9) or mppev2-128(10) the Microsoft Point to Point Encryption Protocol (MPPE) 'stateless mode' will be enabled, using a 40 bit, 56 bit respectively 128 bit session key.") biboPPPLQMonitoring = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPLQMonitoring.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLQMonitoring.setDescription('This parameter enables (2) or disables (1) PPP Link Quality Monitoring (LQM) according RFC 1989. When set to on(2) LQM is added to the list of parameters used in LCP negotiation. If LQM is acknowledged by peer link quality reports will be generated and send periodically.') biboPPPIpPoolId = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 28), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPIpPoolId.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPIpPoolId.setDescription('Pool ID value to select an IP address pool for dynamic IP address assignment via IPCP. See also PPPIpAssignTable for further details.') biboPPPSessionTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 1, 1, 29), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPSessionTimeout.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPSessionTimeout.setDescription('Maximum number of seconds before termination the established PPP session, regardless there is any data throughput on the corresponding link(s). When set to 0, there no limit for the duration of the PPP session.') biboPPPStatTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 3, 2), ) if mibBuilder.loadTexts: biboPPPStatTable.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPStatTable.setDescription('The biboPPPStatTable contains statistical connection- specific information. Only the system can add or delete entries to this table. Creating entries: Entries are created by the system each time a new PPP interface is created in the biboPPPTable. Deleting entries: Entries are removed by the system when the corresponding PPP interface is removed.') biboPPPStatEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1), ).setIndexNames((0, "BIANCA-BRICK-PPP-MIB", "biboPPPConnIfIndex")) if mibBuilder.loadTexts: biboPPPStatEntry.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPStatEntry.setDescription('') biboPPPConnIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnIfIndex.setDescription('Correlating PPP interface index.') biboPPPConnActive = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 250))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnActive.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnActive.setDescription('The actual number of bundled channels.') biboPPPConnProtocols = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnProtocols.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnProtocols.setDescription('The bitwise ORed protocols successfully negotiated on this connection; currently the following protocols are supported: tcp/ip(1), ipx(2), bridge(4), bpdu(8), x25(16). These protocol values are most likely to change in future software releases.') biboPPPConnState = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("idle", 1), ("incoming", 2), ("outgoing", 3), ("connected", 4), ("dataxfer", 5), ("disconnect", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnState.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnState.setDescription('The physical state of the link. This field is obsolete and will not be supported in a future release.') biboPPPConnDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnDuration.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnDuration.setDescription('The current link duration on this interface in seconds.') biboPPPConnUnits = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnUnits.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnUnits.setDescription('The current costs on this interface for all member links.') biboPPPConnTransmitOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnTransmitOctets.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnTransmitOctets.setDescription("The octets transmitted on this interface since its last change to the 'up' state.") biboPPPConnReceivedOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnReceivedOctets.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnReceivedOctets.setDescription("The octets received since its last change to the `up' state.") biboPPPConnOutgoingCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnOutgoingCalls.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnOutgoingCalls.setDescription("The number of outgoing calls on this interface since its last change to the 'up' state.") biboPPPConnOutgoingFails = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnOutgoingFails.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnOutgoingFails.setDescription("The number of outgoing call failures on this interface since its last change to the 'up' state.") biboPPPConnIncomingCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnIncomingCalls.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnIncomingCalls.setDescription('The number of incoming calls on this interface since its last change to the up state.') biboPPPConnIncomingFails = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnIncomingFails.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnIncomingFails.setDescription('The number of incoming call failures on this interface since its last change to the up state.') biboPPPTotalDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPTotalDuration.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPTotalDuration.setDescription('The total link duration in seconds.') biboPPPTotalUnits = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPTotalUnits.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPTotalUnits.setDescription('The total costs on this interface for all member links.') biboPPPTotalTransmitOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPTotalTransmitOctets.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPTotalTransmitOctets.setDescription('The total amount of octets transmitted.') biboPPPTotalReceivedOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPTotalReceivedOctets.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPTotalReceivedOctets.setDescription('The total amount of octets received.') biboPPPTotalOutgoingCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPTotalOutgoingCalls.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPTotalOutgoingCalls.setDescription('The total number of outgoing calls.') biboPPPTotalOutgoingFails = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPTotalOutgoingFails.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPTotalOutgoingFails.setDescription('The total number of outgoing call failures.') biboPPPTotalIncomingCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPTotalIncomingCalls.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPTotalIncomingCalls.setDescription('The total number of incoming calls.') biboPPPTotalIncomingFails = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPTotalIncomingFails.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPTotalIncomingFails.setDescription('The total number of incoming call failures.') biboPPPThroughput = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPThroughput.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPThroughput.setDescription('The actual thoughput of the interface; updated every 5 seconds.') biboPPPCompressionMode = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("inactive", 1), ("active", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPCompressionMode.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPCompressionMode.setDescription('This object describes wether data compression is active for this interface. 42bis or Stac LZS compression algorithm can be enabled in the biboPPPTable.') biboPPPChargeInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 23), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3600))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPChargeInterval.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPChargeInterval.setDescription('Describes the measured interval between charging info elements received from the ISDN network.') biboPPPIdleTime = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 24), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3600))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPIdleTime.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPIdleTime.setDescription('The currently measured connection inactivity time (channel is silent).') biboPPPConnCharge = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPConnCharge.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPConnCharge.setDescription('The current charge on this interface as 1/1000 of the respective currency.') biboPPPTotalCharge = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 2, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPTotalCharge.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPTotalCharge.setDescription('The total charge on this interface as 1/1000 of the respective currency.') pppSessionTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 3, 10), ) if mibBuilder.loadTexts: pppSessionTable.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionTable.setDescription('The pppSessionTable contains statistical information for the PPP protocol. Only the system can add or delete entries to this table. Creating entries: Entries are created by the system each time a new PPP connection is created. Deleting entries: Entries are removed by the system when the corresponding PPP connection is terminated.') pppSessionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1), ).setIndexNames((0, "BIANCA-BRICK-PPP-MIB", "pppSessionIfIndex")) if mibBuilder.loadTexts: pppSessionEntry.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionEntry.setDescription('') pppSessionIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionIfIndex.setDescription('Correlating PPP interface index.') pppSessionMlp = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("negotiated", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionMlp.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionMlp.setDescription('Indicates negotiation of Multilink PPP.') pppSessionMru = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionMru.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionMru.setDescription("Peer's MRU/MRRU LCP option.") pppSessionLcpCallback = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("lcp", 2), ("cbcp", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionLcpCallback.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionLcpCallback.setDescription('Callback option inside LCP negotiation.') pppSessionAuthProt = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 1), ("pap", 2), ("chap", 3), ("ms-chapv1", 4), ("ms-chapv2", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionAuthProt.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionAuthProt.setDescription('The negotiated PPP authentication protocol.') pppSessionCompression = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("stac", 2), ("ms-stac", 3), ("mppc", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionCompression.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionCompression.setDescription('The negotiated CCP compression mode.') pppSessionEncryption = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("none", 1), ("mppe-40", 2), ("mppe-128", 3), ("des-56", 4), ("triple-des-168", 5), ("blowfish-168", 6), ("mppe-56", 7), ("mppev2-40", 8), ("mppev2-56", 9), ("mppev2-128", 10), ("blowfish-56", 11)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionEncryption.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionEncryption.setDescription('The negotiated CCP encryption mode.') pppSessionCbcpMode = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("no-callback", 2), ("user-specified", 3), ("pre-specified", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionCbcpMode.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionCbcpMode.setDescription('The negotiated Callback Control Protocol (CBCP) mode.') pppSessionCbcpDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 60))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionCbcpDelay.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionCbcpDelay.setDescription('The negotiated (CBCP) callback delay in seconds.') pppSessionLocIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 10), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionLocIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionLocIpAddr.setDescription('The negotiated local IP Address.') pppSessionRemIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 11), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionRemIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionRemIpAddr.setDescription('The negotiated remote IP Address.') pppSessionDNS1 = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 12), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionDNS1.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionDNS1.setDescription('The negotiated first name server IP address.') pppSessionDNS2 = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 13), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionDNS2.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionDNS2.setDescription('The negotiated second name server IP address.') pppSessionWINS1 = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 14), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionWINS1.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionWINS1.setDescription('The negotiated first NetBIOS name server (WINS) IP address.') pppSessionWINS2 = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 15), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionWINS2.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionWINS2.setDescription('The negotiated second NetBIOS name server (WINS) IP address.') pppSessionVJHeaderComp = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("negotiated", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionVJHeaderComp.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionVJHeaderComp.setDescription('The negotiation of Van Jacobsen TCP/IP header compression option (IPCP).') pppSessionIpxcpNodeNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 17), OctetString().subtype(subtypeSpec=ValueSizeConstraint(6, 6)).setFixedLength(6)).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionIpxcpNodeNumber.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionIpxcpNodeNumber.setDescription('Unique IPX Node Id dynamically assigned the client.') pppSessionBacpFavoredPeer = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 10, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("local", 2), ("remote", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppSessionBacpFavoredPeer.setStatus('mandatory') if mibBuilder.loadTexts: pppSessionBacpFavoredPeer.setDescription('The result of the BACP Favored-Peer negotiation.') biboPPPLinkTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 3, 3), ) if mibBuilder.loadTexts: biboPPPLinkTable.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkTable.setDescription('The biboPPPLinkTable contains statistical information for each current PPP link on the system. Only the system can add or delete entries to this table. Creating entries: Entries are created by the system each time a new PPP interface is created in the biboPPPTable. Deleting entries: Entries are removed by the system when the corresponding PPP interface is removed.') biboPPPLinkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1), ).setIndexNames((0, "BIANCA-BRICK-PPP-MIB", "biboPPPLinkIfIndex")) if mibBuilder.loadTexts: biboPPPLinkEntry.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkEntry.setDescription('') biboPPPLinkIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkIfIndex.setDescription('Correlating PPP interface index.') biboPPPLinkEstablished = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 2), Date()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkEstablished.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkEstablished.setDescription('Time when the link was established.') biboPPPLinkDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("incoming-dce", 1), ("outgoing-dte", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkDirection.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkDirection.setDescription('Direction of link, incoming(1) or outgoing(2). In case of permanent links, the meaning is dce(1) or dte(2).') biboPPPLinkProtocols = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkProtocols.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkProtocols.setDescription('The bitwise ORed protocols successfully negotiated on this link; currently the following protocols are supported: tcp/ip(1), ipx(2), bridge(4), bpdu(8), x25(16). These protocol values are most likely to change in future software releases.') biboPPPLinkState = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("starting", 3), ("loopbacked", 4), ("dialing", 5), ("retry-wait", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkState.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkState.setDescription('The actual state of each link in a bundle. The link is fully operational in the up(1) state, and not operational in the down(2) state. The starting(3) state is an inter- mediate state when the link is physically established but PPP or other link negotation has not finished yet. The loopbacked(4) state is entered when the PPP keepalive mechanism detects a loopbacked link. The dialing(5) state shows that a dialup link is in its link establishment phase, dialing. If there is no answer to the call, the link enters the retry-wait(6) state for biboPPPRetryTime seconds. After waiting that time either a call retry will occur, or the ifOperStatus will enter the blocked state, depending on the amount of retries already done (biboPPPLinkRetries) and the value of the biboPPPMaxRetries field.') biboPPPLinkUnits = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkUnits.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkUnits.setDescription('The costs for this link in units.') biboPPPLinkRetries = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkRetries.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkRetries.setDescription('The amount of retries taken to establish the link.') biboPPPLinkKeepaliveSent = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkKeepaliveSent.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkKeepaliveSent.setDescription('The amount of keepalive packets sent on the link.') biboPPPLinkKeepalivePending = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkKeepalivePending.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkKeepalivePending.setDescription('The amount of keepalive answer packets waiting for since the last occurance of an echo reply packet.') biboPPPLinkDeviceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkDeviceIndex.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkDeviceIndex.setDescription('The underlying link device index.') biboPPPLinkSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkSpeed.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkSpeed.setDescription('The speed of the link.') biboPPPLinkStkNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkStkNumber.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkStkNumber.setDescription('The stack number of the dialup link, correlating to the isdnStkNumber field in the isdnCallTable.') biboPPPLinkCallType = MibScalar((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("incoming", 1), ("outgoing", 2), ("undef", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkCallType.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkCallType.setDescription('The call type of the dialup link, correlating to the isdnCallType field in the isdnCallTable.') biboPPPLinkCallReference = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkCallReference.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkCallReference.setDescription('The call reference of the dialup link, correlating to the isdnCallReference field in the isdnCallTable.') biboPPPLinkCharge = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkCharge.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkCharge.setDescription('The costs for this link as 1/1000 of the respective currency.') biboPPPLinkAccm = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 17), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkAccm.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkAccm.setDescription('.') biboPPPLinkLqm = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("negotiated", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkLqm.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkLqm.setDescription('Indicates the successful negotiation of the Link Quality Protocol (LQM).') biboPPPLinkLcpComp = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("addr", 2), ("prot", 3), ("both", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkLcpComp.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkLcpComp.setDescription('Address- and Protocol-Field compression.') biboPPPLinkLocDiscr = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 20), OctetString().subtype(subtypeSpec=ValueSizeConstraint(6, 6)).setFixedLength(6)).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkLocDiscr.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkLocDiscr.setDescription('Local LCP multilink endpoint discriminator.') biboPPPLinkRemDiscr = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 3, 1, 21), OctetString().subtype(subtypeSpec=ValueSizeConstraint(6, 6)).setFixedLength(6)).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPLinkRemDiscr.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPLinkRemDiscr.setDescription("Peer's LCP multilink endpoint discriminator.") pppLqmTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 3, 6), ) if mibBuilder.loadTexts: pppLqmTable.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmTable.setDescription('The pppLqmTable contains statistical information for each current PPP link on the system. Only the system can add or delete entries to this table. Creating entries: Entries are created by the system each time a new PPP link was established and LQM negotiated successful. Deleting entries: Entries are removed by the system when the corresponding PPP link is disconnected.') pppLqmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1), ).setIndexNames((0, "BIANCA-BRICK-PPP-MIB", "pppLqmIfIndex")) if mibBuilder.loadTexts: pppLqmEntry.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmEntry.setDescription('') pppLqmIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmIfIndex.setDescription('Correlating PPP interface index.') pppLqmCallReference = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmCallReference.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmCallReference.setDescription('The call reference of the dialup link, correlating to the isdnCallReference field in the isdnCallTable.') pppLqmReportingPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmReportingPeriod.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmReportingPeriod.setDescription('The LQMReportingPeriod field indicates the maximum time in hundredths of seconds between transmission of Link Quality Reports (LQR). The peer may transmit packets at a faster rate than that which was negotiated.') pppLqmOutLQRs = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmOutLQRs.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmOutLQRs.setDescription('Number of transmitted Link Quality Reports (LQR) on this link.') pppLqmOutPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmOutPackets.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmOutPackets.setDescription('Number of transmitted Packets on this link.') pppLqmOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmOutOctets.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmOutOctets.setDescription('Number of transmitted Octets on this link, including framing data.') pppLqmInLQRs = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmInLQRs.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmInLQRs.setDescription('Number of Link Quality Reports (LQR) received on this link.') pppLqmInPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmInPackets.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmInPackets.setDescription('Number of Packets reveived on this link.') pppLqmInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmInOctets.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmInOctets.setDescription('Number of Octets reveived on this link, including framing data.') pppLqmInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmInDiscards.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmInDiscards.setDescription('Number of Packets received on this link, but discarded.') pppLqmInErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmInErrors.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmInErrors.setDescription('Number of errorneous Packets received on this link.') pppLqmPeerOutLQRs = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmPeerOutLQRs.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmPeerOutLQRs.setDescription('Number of Link Quality Reports (LQR) transmitted by remote on this link.') pppLqmPeerOutPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmPeerOutPackets.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmPeerOutPackets.setDescription('Number of Packets transmitted by remote on this link.') pppLqmPeerOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmPeerOutOctets.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmPeerOutOctets.setDescription('Number of Octets transmitted by remote on this link, including framing data.') pppLqmPeerInLQRs = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmPeerInLQRs.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmPeerInLQRs.setDescription('Number of Link Quality Reports (LQR) received by remote on this link.') pppLqmPeerInPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmPeerInPackets.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmPeerInPackets.setDescription('Number of Packets reveived by remote on this link.') pppLqmPeerInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmPeerInOctets.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmPeerInOctets.setDescription('Number of Octets reveived by remote on this link, including framing data.') pppLqmPeerInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmPeerInDiscards.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmPeerInDiscards.setDescription('Number of Packets received by remote on this link, but discarded.') pppLqmPeerInErrors = MibScalar((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmPeerInErrors.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmPeerInErrors.setDescription('Number of errorneous Packets received by remote on this link.') pppLqmLostOutLQRs = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmLostOutLQRs.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmLostOutLQRs.setDescription('Number of lost Link Quality Reports (LQR) transmitted on this link.') pppLqmLostOutPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmLostOutPackets.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmLostOutPackets.setDescription('Number of lost Packets transmitted on this link.') pppLqmLostOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmLostOutOctets.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmLostOutOctets.setDescription('Number of lost Octets transmitted on this link.') pppLqmLostPeerOutLQRs = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmLostPeerOutLQRs.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmLostPeerOutLQRs.setDescription('Number of lost Link Quality Reports (LQR) transmitted by remote on this link.') pppLqmLostPeerOutPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmLostPeerOutPkts.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmLostPeerOutPkts.setDescription('Number of lost Packets transmitted by remote on this link.') pppLqmLostPeerOutOcts = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 6, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppLqmLostPeerOutOcts.setStatus('mandatory') if mibBuilder.loadTexts: pppLqmLostPeerOutOcts.setDescription('Number of lost Octets transmitted by remote on this link.') biboPPPIpAssignTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 3, 4), ) if mibBuilder.loadTexts: biboPPPIpAssignTable.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPIpAssignTable.setDescription("The biboPPPIpAssignTable contains IP addresses used when dynamically assigning IP addresses; i.e. when the biboPPPIpAddress field is set to `dynamic'. Creating entries: Entries are created by assigning a value (IP address) to the biboPPPIpAssignAddress object. Deleting entries: An entry (address) can be removed by assigning the value `delete' to its biboPPPIpAssignState.") biboPPPIpAssignEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 3, 4, 1), ).setIndexNames((0, "BIANCA-BRICK-PPP-MIB", "biboPPPIpAssignAddress")) if mibBuilder.loadTexts: biboPPPIpAssignEntry.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPIpAssignEntry.setDescription('Pool of IP addresses for dynamic IP address assignment via IPCP. See the biboPPPIpAddress field for further explanation.') biboPPPIpAssignAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 4, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPIpAssignAddress.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPIpAssignAddress.setDescription('First IP address of this range.') biboPPPIpAssignState = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unused", 1), ("assigned", 2), ("delete", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPIpAssignState.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPIpAssignState.setDescription('If an entry is currently in use, the state is set to as- signed(1). Otherwise it is set to unused(2). You may also delete this entry by changing it to delete(3).') biboPPPIpAssignPoolId = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 4, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPIpAssignPoolId.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPIpAssignPoolId.setDescription('Pool ID value.') biboPPPIpAssignRange = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 4, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPIpAssignRange.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPIpAssignRange.setDescription('Number of IP addresses that will be assigned starting from biboPPPIpAssignAddress. A range of 0 will disable this entry') pppIpInUseTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 3, 7), ) if mibBuilder.loadTexts: pppIpInUseTable.setStatus('mandatory') if mibBuilder.loadTexts: pppIpInUseTable.setDescription('The pppIpUseTable contains dynamically assigned IP addresses.') pppIpInUseEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 3, 7, 1), ).setIndexNames((0, "BIANCA-BRICK-PPP-MIB", "pppIpInUseAddress")) if mibBuilder.loadTexts: pppIpInUseEntry.setStatus('mandatory') if mibBuilder.loadTexts: pppIpInUseEntry.setDescription('') pppIpInUseAddress = MibScalar((1, 3, 6, 1, 4, 1, 272, 4, 3, 7, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppIpInUseAddress.setStatus('mandatory') if mibBuilder.loadTexts: pppIpInUseAddress.setDescription('assigned IP address') pppIpInUsePoolId = MibScalar((1, 3, 6, 1, 4, 1, 272, 4, 3, 7, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppIpInUsePoolId.setStatus('mandatory') if mibBuilder.loadTexts: pppIpInUsePoolId.setDescription('Unique IP address pool ID') pppIpInUseIfIndex = MibScalar((1, 3, 6, 1, 4, 1, 272, 4, 3, 7, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppIpInUseIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: pppIpInUseIfIndex.setDescription('Unique interface index') pppIpInUseIdent = MibScalar((1, 3, 6, 1, 4, 1, 272, 4, 3, 7, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppIpInUseIdent.setStatus('mandatory') if mibBuilder.loadTexts: pppIpInUseIdent.setDescription('The remote authentication identification string.') pppIpInUseState = MibScalar((1, 3, 6, 1, 4, 1, 272, 4, 3, 7, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("assigned", 1), ("reserved", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppIpInUseState.setStatus('mandatory') if mibBuilder.loadTexts: pppIpInUseState.setDescription('If an IP address is currently assigned, the state of this entry is set to assigned(1). Otherwise, after disconnect, it is set to reserved(2) until the same peer reconnects or this entry expires (see pppIpInUseAge).') pppIpInUseAge = MibScalar((1, 3, 6, 1, 4, 1, 272, 4, 3, 7, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pppIpInUseAge.setStatus('mandatory') if mibBuilder.loadTexts: pppIpInUseAge.setDescription('This object specifies the age of the entry after creation or after changing into state reserved(2). After expiration the IP address (see pppIpInUseAddress) is no longer reserved for peer specified by pppIpInUseIdent and this entry will be deleted.') biboPPPProfileTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 3, 5), ) if mibBuilder.loadTexts: biboPPPProfileTable.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPProfileTable.setDescription('The biboPPPProfileTable contains PPP default parameters used for PPP negotiation with unknown dialin partners. For PPP connections, PPP profiles are asigned to incoming connections via the isdnDispatchTable. Currently no entries can be created or deleted by user.') biboPPPProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 3, 5, 1), ).setIndexNames((0, "BIANCA-BRICK-PPP-MIB", "biboPPPProfileName")) if mibBuilder.loadTexts: biboPPPProfileEntry.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPProfileEntry.setDescription('') biboPPPProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 5, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("profile-1", 1), ("profile-2", 2), ("profile-3", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: biboPPPProfileName.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPProfileName.setDescription('The name of the PPP profile. Three profiles are available.') biboPPPProfileAuthProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 5, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 6, 7, 8))).clone(namedValues=NamedValues(("none", 1), ("pap", 2), ("chap", 3), ("both", 4), ("ms-chap", 6), ("all", 7), ("ms-chapv2", 8)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPProfileAuthProtocol.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPProfileAuthProtocol.setDescription('The type of authentication used on the point-to-point link as described in RFC 1334. See biboPPPAuthentication for further details.') biboPPPProfileAuthRadius = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 1), ("inband", 2), ("outband", 3), ("both", 4), ("radius-only", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPProfileAuthRadius.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPProfileAuthRadius.setDescription('This entry is used to configure possible RADIUS authentication on incoming calls. The default value is inband(2), only inband RADIUS requests (PAP, CHAP) are sent to the defined RADIUS server. Outband requests (CALLERID) are sent in outband(3) mode. If set to both(3), both requests are sent. To disable RADIUS requests in the profile set this value to none(1). To disable authentication attempts via the local data base set this value to radius-only(5).') biboPPPProfileLQMonitoring = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPProfileLQMonitoring.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPProfileLQMonitoring.setDescription('This parameter enables (2) or disables (1) PPP Link Quality Monitoring (LQM) according RFC 1989. When set to on(2) LQM is added to the list of parameters acknowledged in LCP negotiation. Link quality reports (LQR) will be generated and send periodically.') biboPPPProfilePPPoEDevIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 5, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPProfilePPPoEDevIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPProfilePPPoEDevIfIndex.setDescription('Specifies the device to be used for PPP over Ethernet (PPPoE) according RFC 2516.') biboPPPProfileCallbackNegotiation = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 5, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2), ("cbcp-optional", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboPPPProfileCallbackNegotiation.setStatus('mandatory') if mibBuilder.loadTexts: biboPPPProfileCallbackNegotiation.setDescription("Specifies wether callback negotiation (LCP/CBCP) is allowed or not. If set to disabled(1), no callback negotiation will be performed or accepted. If set to enabled(2), PPP callback negotation will be accepted on demand. If this object is set to cbcp-optional(3), the CBCP option 'no callback' is also offered to the Windows client so that the user can decide wether he wants to be called back or not.") pppExtIfTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 3, 9), ) if mibBuilder.loadTexts: pppExtIfTable.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfTable.setDescription("The pppExtIfTable contains extended configuration and information related to the PPP interfaces on the system. Entries are optional for each interface and can be added or deleted by the user. Deleting entries: Entries are removed by setting an entry's pppExtIfBodMode object to 'delete'.") pppExtIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1), ).setIndexNames((0, "BIANCA-BRICK-PPP-MIB", "pppExtIfIndex")) if mibBuilder.loadTexts: pppExtIfEntry.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfEntry.setDescription('') pppExtIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfIndex.setDescription('Correlating PPP interface index.') pppExtIfBodMode = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("disabled", 1), ("backup", 2), ("bod-active", 3), ("bod-passive", 4), ("bap-active", 5), ("bap-passive", 6), ("delete", 7), ("bap-both", 8), ("bap-first", 9)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfBodMode.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfBodMode.setDescription('Enables bandwidth on demand (BOD) mode for leased line and dialup interfaces when setting to bod-active (3) respectively bod-passive (4) or backup only mode for leased line connections like X.21. When set to disabled (1), neither bandwidth on demand (as specified by the pppExtIfTable) or backup mode is enabled. Four modes (bap-active (5), bap-passive (6), bap-both(7) and bap-first (8)) are available for BAP (Bandwidth Allocation Protocol) support to specify wether BAP Call-Requests and BAP Callback-Requests should be initiated and/or accepted.') pppExtIfAlgorithm = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("equal", 1), ("proportional", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfAlgorithm.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfAlgorithm.setDescription('The algorithm to use for weighting line utilization. Line utilization is determined by calculating the average load for each interface. When set to equal (1) all samples taken over the time interval (defined in pppExtIfInterval) will be given equal weight, when set to proportional (2) the weighting disproportional to the age of the sample.') pppExtIfInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(5, 300))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfInterval.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfInterval.setDescription('The time interval (in seconds) to use for sampling and calculating of the average throughput of the interface. See also: pppExtIfLoad.') pppExtIfLoad = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: pppExtIfLoad.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfLoad.setDescription('The actual throughput (in percent) of the total bandwidth of this interface (load). This value is updated once every second.') pppExtIfMlpFragmentation = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("proportional", 1), ("equal", 2), ("interleave", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfMlpFragmentation.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfMlpFragmentation.setDescription('The multilink PPP fragmentation mode. When set to proportional (1) packets will be divided into fragments proportional to the transmission rate of each link, when set to equal (2) packets will be divided into multiple equal fragments (equal to MlpFragSize) such that the number sent on each link is proportional to the transmission rate. When set to interleave (3), large datagrams will be fragmentated (maximum size determined by MlpFragSize) to reduce transmission delay of high-priority traffic on slower links.') pppExtIfMlpFragSize = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(30, 1500))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfMlpFragSize.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfMlpFragSize.setDescription('The multilink PPP fragment size. If MlpFragmentation is set to proportional (1) this value specifies the minimum size of the fragment in bytes. If MlpFragmentation is set to equal (2) this value specifies the maximum fragment size in bytes.') pppExtIfPPPoEService = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfPPPoEService.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfPPPoEService.setDescription('The PPPoE (PPP over Ethernet, RFC 2516) service name which indicates the requested service during PPPoE discovery stage. Examples of the use of the service name are to indicate an ISP name or a class or a quality of service.') pppExtIfPPPoEAcServer = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfPPPoEAcServer.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfPPPoEAcServer.setDescription('The PPPoE (PPP over Ethernet, RFC 2516) AC-Server name which determines the access concentrator during PPPoE discovery stage.') pppExtIfEncKeyNegotiation = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("static", 1), ("authentication", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfEncKeyNegotiation.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfEncKeyNegotiation.setDescription("This variable defines the specification of shared secrets (encryption keys) between the sender and receiver of encrypted data. If set to static (1), the keys specified in 'pppExtIfEncTxKey' and 'pppExtIfEncRxKey' will be used, if set to authentication (2), the key derivation is based on PPP authentication via CHAP or MS-CHAP.") pppExtIfEncTxKey = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 11), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfEncTxKey.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfEncTxKey.setDescription("Static (encryption) key used for transmission of encrypted data via PPP. It's size depends on the used encryption algorithm and the corresponding key length, e.g. 'des_56' or 'blowfish_168'.") pppExtIfEncRxKey = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 12), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfEncRxKey.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfEncRxKey.setDescription("Static (decryption) key used for decryption of encrypted data received on PPP connections. It's size depends on the used encryption algorithm and the corresponding key length, e.g. 'des_56' or 'blowfish_168'.") pppExtIfGearUpThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfGearUpThreshold.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfGearUpThreshold.setDescription('Gear up threshold for invoking current bandwidth. The measured throughput (in percent of the total bandwidth) of this interface (see pppExtIfLoad) is compared with this value once per second. If exceeded longer than 5 seconds an additional B-channel will be requested.') pppExtIfGearDownThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfGearDownThreshold.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfGearDownThreshold.setDescription('Gear down threshold for decreasing current bandwidth. The expected throughput (in percent of the total bandwidth) of this interface (see pppExtIfLoad) after dropping a B-channel is compared with this threshold value once per second. If the needed bandwidth falls below this threshold longer than 10 seconds, exactly one B-channel will be dropped.') pppExtIfAodiDChanQlen = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 15), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfAodiDChanQlen.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfAodiDChanQlen.setDescription('Upper threshold for the amount of data (in octets) waiting to be sent across the 9.6Kbit/sec D-channel. If exceeded, additional bandwidth will be invoked at once.') pppExtIfAodiGearDownTxRate = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 16), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfAodiGearDownTxRate.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfAodiGearDownTxRate.setDescription('Lower threshold for the amount of data in bits per second to be sent across the 64Kbit/sec B-channel. If the measured throughput becomes smaller than this value over a period of pppExtIfGearDownPersistance seconds, the remaining B-channel will be dropped.') pppExtIfGearUpPersistance = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfGearUpPersistance.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfGearUpPersistance.setDescription('Gear up persistence interval for invoking current bandwidth. The measured throughput (in percent of the total bandwidth) of this interface (see pppExtIfLoad) is compared with the current value of the variable pppExtIfGearUpThreshold once per second. If exceeded longer than pppExtIfGearUpPersistance seconds an additional B-channel will be requested.') pppExtIfGearDownPersistance = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfGearDownPersistance.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfGearDownPersistance.setDescription('Gear down persistence interval for decreasing current bandwidth. The measured throughput (in percent of the total bandwidth) of this interface (see pppExtIfLoad) is compared with the current value of pppExtIfGearDownThreshold once per second. If exceeded longer than pppExtIfGearDownPersistance seconds, exactly one B-channel will be dropped.') pppExtIfL1Speed = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 19), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfL1Speed.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfL1Speed.setDescription("This object contains the interface's nominal bandwidth in bits per second. Please note that this parameter may not represent the real available transmission rate. The current purpose is only informational for example for PPTP or PPPoE interfaces where no accurate information from the underlaying network is available.") pppExtIfCurrentRetryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 36000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfCurrentRetryTime.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfCurrentRetryTime.setDescription('Current time in seconds to wait before retrying a call when the smart retry algorithm is implemented.') pppExtIfMaxRetryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 36000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfMaxRetryTime.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfMaxRetryTime.setDescription('Maximum time in seconds to wait before retrying a call when the smart retry algorithm is implemented. When set to zero this algorithm is disabled.') pppExtIfMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 22), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 8192))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfMtu.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfMtu.setDescription('Determines size of the largest datagram which can be sent on the interface, specified in octets (see ifMtu). When set to zero (default), the value of the variable ifMtu depends on the received LCP MRU/MRRU option.') pppExtIfMru = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 23), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 8192))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfMru.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfMru.setDescription('The maximum length for the PPP information field, including padding, but not including the protocol field, is termed the Maximum Receive Unit (MRU).') pppExtIfAuthMutual = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 3, 9, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: pppExtIfAuthMutual.setStatus('mandatory') if mibBuilder.loadTexts: pppExtIfAuthMutual.setDescription('This object enables mutual PPP authentication between the peers.') biboDialTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 4, 1), ) if mibBuilder.loadTexts: biboDialTable.setStatus('mandatory') if mibBuilder.loadTexts: biboDialTable.setDescription("The biboDialTable contains configuration information for incoming and outgoing ISDN telephone numbers. Creating entries: Entries are created by assigning a value to the biboDialIfIndex object. Deleting entries: An entry can be removed by assigning the value `delete' to its biboDialType object.") biboDialEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1), ).setIndexNames((0, "BIANCA-BRICK-PPP-MIB", "biboDialIfIndex")) if mibBuilder.loadTexts: biboDialEntry.setStatus('mandatory') if mibBuilder.loadTexts: biboDialEntry.setDescription('') biboDialIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboDialIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: biboDialIfIndex.setDescription('The correlating PPP interface index.') biboDialType = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("isdn", 1), ("isdn-spv", 2), ("delete", 3), ("ppp-callback", 4), ("ppp-negotiated", 5), ("x25-dialout", 6), ("ip", 7), ("x25", 8)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboDialType.setStatus('mandatory') if mibBuilder.loadTexts: biboDialType.setDescription('The dialup type can be set to plain isdn(1), isdn-spv(2) semi-permanent links used by the German 1TR6 D-channel protocol, or to delete(3) to delete a biboDialTable entry. The types ppp-callback(4) and ppp-negotiated(5) are used for the LCP callback option.') biboDialDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("incoming", 1), ("outgoing", 2), ("both", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboDialDirection.setStatus('mandatory') if mibBuilder.loadTexts: biboDialDirection.setDescription('The allowed dial direction is either incoming(1), outgoing(2), or both(3) calls. No call is ever set up when set to incoming(1). Incoming calls will not be identified when set to outoing(2). Furthermore, once PPP authentication succeeds and there is at least one incoming number defined but for which none matches, the call will not be accepted for security reasons.') biboDialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboDialNumber.setStatus('mandatory') if mibBuilder.loadTexts: biboDialNumber.setDescription("The defined dialing number. Used for either dialing or comparing to incoming calls or both, depending on the content of the biboDialDirection field. The wildcards '*', '?', '[', ']', '{', '}' may be used.") biboDialSubaddress = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1, 5), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboDialSubaddress.setStatus('mandatory') if mibBuilder.loadTexts: biboDialSubaddress.setDescription('The defined dial subaddress, if any. Also, see the biboDialNumber field.') biboDialClosedUserGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 9999))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboDialClosedUserGroup.setStatus('mandatory') if mibBuilder.loadTexts: biboDialClosedUserGroup.setDescription('The defined closed user group, if any. Also, see the biboDialNumber field.') biboDialStkMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1, 7), BitValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboDialStkMask.setStatus('mandatory') if mibBuilder.loadTexts: biboDialStkMask.setDescription('The defined stack mask. Each value of IsdnStkNumber represents a bit in this bitmask. A mask of 0 disables dialup completely, while a mask of -1 enables dialup on all available ISDN stacks.') biboDialScreening = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("user", 1), ("user-verified", 2), ("user-failed", 3), ("network", 4), ("dont-care", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboDialScreening.setStatus('mandatory') if mibBuilder.loadTexts: biboDialScreening.setDescription("The screening indicator of the biboDialNumber. The biboDialScreening field can be used to gauge the `trustworthiness' of the biboDialNumber field. (See isdnCallScreening) Indicators are ordered from highest to lowest as follows: indicator: CPN assigned: verification: `network' by network none `user-verified' by user verification successful `user' by user none `user-failed' by user verification failed Set this field to `dont-care' to accept all calls. Otherwise calls are accepted only if the screening indicator matches or is higher than the set value.") biboDialCallingSubaddress = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1, 9), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboDialCallingSubaddress.setStatus('mandatory') if mibBuilder.loadTexts: biboDialCallingSubaddress.setDescription('The defined calling dial subaddress, if any. Also, see the biboDialNumber field.') biboDialTypeOfCallingSubAdd = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("nsap", 1), ("user-specified", 2), ("reserved", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboDialTypeOfCallingSubAdd.setStatus('mandatory') if mibBuilder.loadTexts: biboDialTypeOfCallingSubAdd.setDescription('The type of calling party subaddress.') biboDialTypeOfCalledSubAdd = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 4, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("nsap", 1), ("user-specified", 2), ("reserved", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: biboDialTypeOfCalledSubAdd.setStatus('mandatory') if mibBuilder.loadTexts: biboDialTypeOfCalledSubAdd.setDescription('The type of called party subaddress.') mibBuilder.exportSymbols("BIANCA-BRICK-PPP-MIB", pppExtIfAodiDChanQlen=pppExtIfAodiDChanQlen, biboDialTable=biboDialTable, pppSessionDNS1=pppSessionDNS1, biboPPPLinkTable=biboPPPLinkTable, pppLqmLostOutOctets=pppLqmLostOutOctets, biboPPPIpAssignPoolId=biboPPPIpAssignPoolId, bintec=bintec, pppSessionLocIpAddr=pppSessionLocIpAddr, biboPPPConnIfIndex=biboPPPConnIfIndex, biboPPPConnIncomingCalls=biboPPPConnIncomingCalls, biboPPPLinkEntry=biboPPPLinkEntry, biboPPPIfIndex=biboPPPIfIndex, biboPPPMinConn=biboPPPMinConn, pppLqmPeerInLQRs=pppLqmPeerInLQRs, pppLqmLostOutLQRs=pppLqmLostOutLQRs, pppSessionCompression=pppSessionCompression, pppExtIfLoad=pppExtIfLoad, biboPPPLinkKeepalivePending=biboPPPLinkKeepalivePending, biboPPPVJHeaderComp=biboPPPVJHeaderComp, biboPPPProfileCallbackNegotiation=biboPPPProfileCallbackNegotiation, dialmap=dialmap, biboPPPTotalIncomingCalls=biboPPPTotalIncomingCalls, biboDialCallingSubaddress=biboDialCallingSubaddress, biboPPPConnOutgoingFails=biboPPPConnOutgoingFails, biboPPPEncapsulation=biboPPPEncapsulation, biboDialNumber=biboDialNumber, biboPPPLinkKeepaliveSent=biboPPPLinkKeepaliveSent, biboPPPRetryTime=biboPPPRetryTime, dod=dod, pppLqmPeerInOctets=pppLqmPeerInOctets, pppExtIfPPPoEService=pppExtIfPPPoEService, biboPPPConnReceivedOctets=biboPPPConnReceivedOctets, biboPPPMaxRetries=biboPPPMaxRetries, biboPPPLinkState=biboPPPLinkState, biboPPPTotalTransmitOctets=biboPPPTotalTransmitOctets, biboPPPLinkIfIndex=biboPPPLinkIfIndex, pppLqmOutLQRs=pppLqmOutLQRs, pppLqmPeerInErrors=pppLqmPeerInErrors, pppIpInUseTable=pppIpInUseTable, biboPPPType=biboPPPType, pppLqmInOctets=pppLqmInOctets, pppSessionEntry=pppSessionEntry, pppIpInUseIfIndex=pppIpInUseIfIndex, biboPPPCallback=biboPPPCallback, biboPPPProfileAuthRadius=biboPPPProfileAuthRadius, biboDialScreening=biboDialScreening, pppSessionRemIpAddr=pppSessionRemIpAddr, ppp=ppp, biboPPPTotalCharge=biboPPPTotalCharge, biboPPPConnOutgoingCalls=biboPPPConnOutgoingCalls, biboPPPLinkLqm=biboPPPLinkLqm, biboPPPLinkCallType=biboPPPLinkCallType, biboPPPStatEntry=biboPPPStatEntry, private=private, pppSessionCbcpMode=pppSessionCbcpMode, biboDialDirection=biboDialDirection, biboPPPProfileAuthProtocol=biboPPPProfileAuthProtocol, pppLqmEntry=pppLqmEntry, pppExtIfEncTxKey=pppExtIfEncTxKey, biboPPPLinkCallReference=biboPPPLinkCallReference, biboPPPProfileEntry=biboPPPProfileEntry, biboPPPIpAddress=biboPPPIpAddress, biboPPPLinkLocDiscr=biboPPPLinkLocDiscr, pppSessionVJHeaderComp=pppSessionVJHeaderComp, pppExtIfTable=pppExtIfTable, pppExtIfGearUpThreshold=pppExtIfGearUpThreshold, biboPPPLinkLcpComp=biboPPPLinkLcpComp, biboPPPIpAssignEntry=biboPPPIpAssignEntry, internet=internet, pppIpInUseState=pppIpInUseState, biboPPPMaxConn=biboPPPMaxConn, pppLqmLostPeerOutOcts=pppLqmLostPeerOutOcts, pppLqmInErrors=pppLqmInErrors, biboPPPTotalUnits=biboPPPTotalUnits, pppExtIfAodiGearDownTxRate=pppExtIfAodiGearDownTxRate, pppExtIfAlgorithm=pppExtIfAlgorithm, pppLqmInPackets=pppLqmInPackets, pppLqmPeerOutLQRs=pppLqmPeerOutLQRs, biboPPPTotalReceivedOctets=biboPPPTotalReceivedOctets, biboPPPLocalIdent=biboPPPLocalIdent, biboPPPSessionTimeout=biboPPPSessionTimeout, pppSessionMlp=pppSessionMlp, biboPPPLinkCharge=biboPPPLinkCharge, pppSessionIfIndex=pppSessionIfIndex, biboPPPLinkSpeed=biboPPPLinkSpeed, pppLqmPeerOutOctets=pppLqmPeerOutOctets, biboPPPStatTable=biboPPPStatTable, pppSessionLcpCallback=pppSessionLcpCallback, pppLqmInDiscards=pppLqmInDiscards, pppLqmLostPeerOutLQRs=pppLqmLostPeerOutLQRs, pppIpInUseAge=pppIpInUseAge, pppExtIfAuthMutual=pppExtIfAuthMutual, biboDialStkMask=biboDialStkMask, biboPPPIpAssignRange=biboPPPIpAssignRange, pppLqmReportingPeriod=pppLqmReportingPeriod, pppExtIfIndex=pppExtIfIndex, pppExtIfBodMode=pppExtIfBodMode, pppLqmIfIndex=pppLqmIfIndex, biboDialClosedUserGroup=biboDialClosedUserGroup, biboPPPLayer2Mode=biboPPPLayer2Mode, pppSessionWINS2=pppSessionWINS2, biboPPPLinkRetries=biboPPPLinkRetries, biboPPPConnActive=biboPPPConnActive, enterprises=enterprises, pppExtIfEncKeyNegotiation=pppExtIfEncKeyNegotiation, pppLqmCallReference=pppLqmCallReference, pppExtIfEntry=pppExtIfEntry, pppExtIfMlpFragmentation=pppExtIfMlpFragmentation, pppExtIfMlpFragSize=pppExtIfMlpFragSize, pppLqmPeerInDiscards=pppLqmPeerInDiscards, biboPPPConnCharge=biboPPPConnCharge, pppLqmLostOutPackets=pppLqmLostOutPackets, pppLqmPeerInPackets=pppLqmPeerInPackets, pppLqmOutOctets=pppLqmOutOctets, pppIpInUsePoolId=pppIpInUsePoolId, biboPPPConnUnits=biboPPPConnUnits, biboDialIfIndex=biboDialIfIndex, pppExtIfGearDownPersistance=pppExtIfGearDownPersistance, biboPPPConnDuration=biboPPPConnDuration, pppLqmOutPackets=pppLqmOutPackets, pppSessionIpxcpNodeNumber=pppSessionIpxcpNodeNumber, biboPPPEntry=biboPPPEntry, pppLqmPeerOutPackets=pppLqmPeerOutPackets, biboPPPAuthentication=biboPPPAuthentication, biboPPPIdleTime=biboPPPIdleTime, pppExtIfGearUpPersistance=pppExtIfGearUpPersistance, pppExtIfEncRxKey=pppExtIfEncRxKey, biboPPPLinkEstablished=biboPPPLinkEstablished, pppExtIfMru=pppExtIfMru, biboPPPEncryption=biboPPPEncryption, pppSessionDNS2=pppSessionDNS2, bibo=bibo, biboPPPLinkAccm=biboPPPLinkAccm, biboPPPProfilePPPoEDevIfIndex=biboPPPProfilePPPoEDevIfIndex, biboPPPIpAssignTable=biboPPPIpAssignTable, pppSessionBacpFavoredPeer=pppSessionBacpFavoredPeer, biboPPPConnProtocols=biboPPPConnProtocols, Date=Date, biboPPPTotalDuration=biboPPPTotalDuration, pppSessionMru=pppSessionMru, biboPPPLinkProtocols=biboPPPLinkProtocols, biboPPPTable=biboPPPTable, biboPPPInitConn=biboPPPInitConn, biboPPPDynShortHold=biboPPPDynShortHold, pppLqmInLQRs=pppLqmInLQRs, pppExtIfL1Speed=pppExtIfL1Speed, pppSessionCbcpDelay=pppSessionCbcpDelay, pppIpInUseEntry=pppIpInUseEntry, biboPPPConnState=biboPPPConnState, biboPPPTotalOutgoingFails=biboPPPTotalOutgoingFails, biboPPPLinkDirection=biboPPPLinkDirection, biboPPPIpAssignAddress=biboPPPIpAssignAddress, biboPPPKeepalive=biboPPPKeepalive, biboPPPLinkUnits=biboPPPLinkUnits, biboPPPTotalOutgoingCalls=biboPPPTotalOutgoingCalls, biboPPPCompressionMode=biboPPPCompressionMode, pppExtIfCurrentRetryTime=pppExtIfCurrentRetryTime, biboPPPThroughput=biboPPPThroughput, biboPPPCompression=biboPPPCompression, pppExtIfGearDownThreshold=pppExtIfGearDownThreshold, biboPPPProfileName=biboPPPProfileName, BitValue=BitValue, biboPPPLinkDeviceIndex=biboPPPLinkDeviceIndex, biboPPPLoginString=biboPPPLoginString, biboPPPConnTransmitOctets=biboPPPConnTransmitOctets, biboPPPIpPoolId=biboPPPIpPoolId, biboPPPTimeout=biboPPPTimeout, biboPPPAuthIdent=biboPPPAuthIdent, biboDialEntry=biboDialEntry, biboPPPLQMonitoring=biboPPPLQMonitoring, biboDialSubaddress=biboDialSubaddress, pppExtIfMaxRetryTime=pppExtIfMaxRetryTime, biboDialTypeOfCalledSubAdd=biboDialTypeOfCalledSubAdd, biboDialTypeOfCallingSubAdd=biboDialTypeOfCallingSubAdd, biboPPPDNSNegotiation=biboPPPDNSNegotiation, pppIpInUseIdent=pppIpInUseIdent, pppSessionEncryption=pppSessionEncryption, biboPPPShortHold=biboPPPShortHold, biboPPPConnIncomingFails=biboPPPConnIncomingFails, pppLqmTable=pppLqmTable, biboPPPChargeInterval=biboPPPChargeInterval, biboPPPLinkStkNumber=biboPPPLinkStkNumber, biboPPPLayer1Protocol=biboPPPLayer1Protocol, biboPPPAuthSecret=biboPPPAuthSecret, pppIpInUseAddress=pppIpInUseAddress, pppExtIfMtu=pppExtIfMtu, pppExtIfInterval=pppExtIfInterval, biboPPPProfileLQMonitoring=biboPPPProfileLQMonitoring, pppExtIfPPPoEAcServer=pppExtIfPPPoEAcServer, pppSessionAuthProt=pppSessionAuthProt, biboPPPLinkRemDiscr=biboPPPLinkRemDiscr, org=org, pppLqmLostPeerOutPkts=pppLqmLostPeerOutPkts, pppSessionWINS1=pppSessionWINS1, pppSessionTable=pppSessionTable, biboPPPIpAssignState=biboPPPIpAssignState, biboDialType=biboDialType, biboPPPProfileTable=biboPPPProfileTable, biboPPPTotalIncomingFails=biboPPPTotalIncomingFails, biboPPPBlockTime=biboPPPBlockTime)
def gcd(a,b): res = 1 for i in range(1, min(a,b)+1): if a % i == 0 and b % i == 0: res = i return res def solution(w,h): return w * h - (w + h - gcd(w,h))
def markov_tweet(): #Created a nested dictionary with the 1st Key = a word second key = possible words that come after and value = counter words_dic = {} with open("prunedLyrics.txt", 'r', encoding="utf-8") as f: for line in f: line = line.replace("\n"," \n") words_list = line.split(" ") for index, word in enumerate(words_list): temp_kv_dic = {} #if we encounter a new line, move on to next line if word == "\n": break #check if a word exists in the dictionary, if not intialize with the {currentword: {the next word:1}} elif word not in words_dic: temp_kv_dic.update({words_list[index+1]:1}) words_dic.update({word:temp_kv_dic}) #if word is in dictionary, check if the following word is a key, if not intialize it, if it is update value elif word in words_dic: if words_list[index+1] in words_dic[word]: words_dic[word][words_list[index+1]] += 1 else: temp_kv_dic.update({words_list[index+1]:1}) words_dic[word].update(temp_kv_dic) print(words_dic) #words_dic contains a dictionary with the following format #{word:{nextword:appearances, anotherwordthatcomesafter:appearances}} markov_tweet()
class Person: @property def full_name(self): return f"{self.first_name} {self.last_name}"
""" Setting for project """ logfile = "demo_project.log"
chassis_900 = '192.168.65.36' chassis_910 = '192.168.65.21' linux_900 = '192.168.65.34:443' linux_910 = '192.168.65.23:443' windows_900 = 'localhost:11009' windows_910 = 'localhost:11009' cm_900 = '172.40.0.204:443' server_properties = {'linux_900': {'server': linux_900, 'locations': [f'{chassis_900}/1/1', f'{chassis_900}/1/2'], 'auth': ('admin', 'admin')}, 'linux_910': {'server': linux_910, 'locations': [f'{chassis_910}/1/1', f'{chassis_910}/1/2'], 'auth': ('admin', 'admin')}, 'windows_900': {'server': windows_900, 'locations': [f'{chassis_900}/1/1', f'{chassis_900}/1/2'], 'auth': None, 'install_dir': 'C:/Program Files (x86)/Ixia/IxNetwork/9.00.1915.16'}, 'windows_910': {'server': windows_910, 'locations': [f'{chassis_910}/1/1', f'{chassis_910}/1/2'], 'auth': None, 'install_dir': 'C:/Program Files (x86)/Ixia/IxNetwork/9.10.2007.7'}, 'cm_900': {'server': cm_900, 'locations': [f'{chassis_900}/1/1', f'{chassis_900}/1/2'], 'auth': None, 'install_dir': 'C:/Program Files (x86)/Ixia/IxNetwork/9.00.1915.16'}} license_servers = ['192.168.42.61'] # Default for options. api = ['rest'] server = ['linux_910']
n=int(input()) arr=list(map(int,input().split())) a=0 p=0 for k in range(0,n): a=a+arr[k] for j in range(0,n): d=(arr[j] - (a/n))**2 p=p+d sigma=float ((p/n)**(1/2)) print(sigma)
class Port: def __init__(self, path, vendor_id, product_id, serial_number): self.path = path self.vendor_id = vendor_id self.product_id = product_id self.serial_number = serial_number def __repr__(self): return f'<Port ' \ f'path={self.path} ' \ f'vendor_id={self.vendor_id} ' \ f'product_id={self.product_id} ' \ f'serial_number={self.serial_number} ' \ f'>'
def less_or_equal(value): if value : # Change this line return "25 or less" elif value : # Change this line return "75 or less" else: return "More than 75" # Change the value 1 below to experiment with different values print(less_or_equal(1))
# # @lc app=leetcode id=2 lang=python3 # # [2] Add Two Numbers # # https://leetcode.com/problems/add-two-numbers/description/ # # algorithms # Medium (30.66%) # Likes: 5024 # Dislikes: 1280 # Total Accepted: 848.6K # Total Submissions: 2.7M # Testcase Example: '[2,4,3]\n[5,6,4]' # # You are given two non-empty linked lists representing two non-negative # integers. The digits are stored in reverse order and each of their nodes # contain a single digit. Add the two numbers and return it as a linked list. # # You may assume the two numbers do not contain any leading zero, except the # number 0 itself. # # Example: # # # Input: (2 -> 4 -> 3) + (5 -> 6 -> 4) # Output: 7 -> 0 -> 8 # Explanation: 342 + 465 = 807. # # # # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: if not l1.next and l1.val == 0: return l2 if not l2.next and l2.val == 0: return l1 p1, p2 = l1, l2 sol = ListNode(0) head = sol head.next = None plus, sol.val = (p1.val + p2.val) // 10, (p1.val + p2.val) % 10 p1, p2 = p1.next, p2.next while p1 or p2: temp = ListNode(0) val1 = p1.val if p1 else 0 p1 = p1.next if p1 else p1 val2 = p2.val if p2 else 0 p2 = p2.next if p2 else p2 temp.next, temp.val = None, val1+val2+plus plus = temp.val // 10 temp.val %= 10 sol.next = temp sol = sol.next if plus != 0: temp = ListNode(0) temp.next, temp.val, sol.next = None, 1, temp return head
n = float(input('Digite o valor do produto: ' )) print('digite 1 para > À vista dinheiro/cheque 10 % de desconto: ') print() print('digite 2 para > À vista no cartão - 5 % de desconto : ' ) print() print('digite 3 para > Em até 2x nos cartão Preço normal : ' ) print() print('digite 4 para > 3x ou mais no cartão - 20% de juros: ') print() forma = int(input('Qual a forma de pagamento? (1) (2) (3) ou (4) :' )) #opção 1 calc1 = (n * 10) / 100 op1 = n - calc1 #opção 2 calc2 = (n * 5) / 100 op2 = n - calc2 #opção 3 calc3 = n op3 = calc3 #opção 4 calc4 = (n * 20) / 100 op4 = n + calc4 #>>> if forma == 1: print('valor final do produto {}'.format(op1)) elif forma == 2: print('valor final do produto {}'.format(op2)) elif forma == 3: print('valor final do produto {}'.format(op3)) elif forma ==4: print('valor final do produto {}'.format(op4)) else: print('ERRO ! >Tente novamente digitando apenas 1,2,3 ou 4 ') input('pressione a tecla ENTER para sair: ') '''> À vista dinheiro/cheque: - 10 % de desconto > À vista no cartão: - 5 % de desconto > Em até 2x nos cartão: - Preço normal > 3x ou mais no cartão: - 20% de juros'''
""" Tickle. The word "tickle" jitters when the cursor hovers over. Sometimes, it can be tickled off the screen. """ message = "tickle" # X and Y coordinates of text x = 0 y = 0 # horizontal and vertical radius of the text hr = 0 vr = 0 def setup(): global x, y, hr, vr size(640, 360) # Create the font textFont(createFont("Georgia", 36)) textAlign(CENTER, CENTER) hr = textWidth(message) / 2 vr = (textAscent() + textDescent()) / 2 noStroke() x = width / 2 y = height / 2 def draw(): global x, y # Instead of clearing the background, fade it by drawing # a semi-transparent rectangle on top fill(204, 120) rect(0, 0, width, height) # If the cursor is over the text, change the position if abs(mouseX - x) < hr and abs(mouseY - y) < vr: x += random(-5, 5) y += random(-5, 5) fill(0) text("tickle", x, y)
# coding=utf-8 """ Package to manage Sentry for ESST """
class Solution(object): def partitionDisjoint(self, nums): """ :type nums: List[int] :rtype: int """ now_min= 10^6 nearly_max= nums[0] last_time_max_value = nums[0] last_time_max= -1 record_list = [] for i, v in enumerate(nums): nearly_max= max(nearly_max, v) if v <= now_min: if v != now_min: record_list = [] last_time_max= -1 now_min= v record_list.append((i,v,nearly_max)) last_time_max_value= nearly_max elif v < last_time_max_value: last_time_max= i last_time_max_value= nearly_max if len(record_list) == 1: return max(record_list[0][0]+1, last_time_max+1) elif len(record_list) == 0: return max(1, last_time_max+1) elif record_list[0][1] == record_list[0][2]: return record_list[0][0]+1 else: return max(record_list[-1][0] + 1, last_time_max+1)
""" Given a non-empty list of words, return the k most frequent elements. Your answer should be sorted by frequency from highest to lowest. If two words have the same frequency, then the word with the lower alphabetical order comes first. Example 1: Input: ["i", "love", "leetcode", "i", "love", "coding"], k = 2 Output: ["i", "love"] Explanation: "i" and "love" are the two most frequent words. Note that "i" comes before "love" due to a lower alphabetical order. Example 2: Input: ["the", "day", "is", "sunny", "the", "the", "the", "sunny", "is", "is"], k = 4 Output: ["the", "is", "sunny", "day"] Explanation: "the", "is", "sunny" and "day" are the four most frequent words, with the number of occurrence being 4, 3, 2 and 1 respectively. Note: You may assume k is always valid, 1 ≤ k ≤ number of unique elements. Input words contain only lowercase letters. Follow up: Try to solve it in O(n log k) time and O(n) extra space. """ class Solution(object): def topKFrequent(self, words, k): """ :type words: List[str] :type k: int :rtype: List[str] """ if not words or not k: return [] if len(words) < k: return [] count = {} for word in words: count[word] = count.get(word, 0) + 1 freq = [] heapq.heapify(freq) for w, c in count.items(): heapq.heappush(freq, (-c, w)) soln = [] for i in range(k): soln.append(heapq.heappop(freq)[1]) return soln
class ValueBlend: def _init_corners(self, **kwargs): # Corners is list of tuples: # [bottomleft, bottomright, topleft, topright] if 'corners' in kwargs: self.corners = kwargs['corners'] if len(self.corners) != 4 or \ any(len(v) != 2 for v in self.corners): raise ValueError("corner should be a list of four tuples, " "set either option 'corners' " "or options 'u_range' and 'v_range'") elif 'u_range' in kwargs and 'v_range' in kwargs: self.corners = [[kwargs['u_range'][0], kwargs['v_range'][0]], [kwargs['u_range'][1], kwargs['v_range'][0]], [kwargs['u_range'][0], kwargs['v_range'][1]], [kwargs['u_range'][1], kwargs['v_range'][1]]] else: raise ValueError("Must set either option " "'corners' or options 'u_range' and 'v_range'") def _blend_tuples(self, tuple1, tuple2, ratio): out = [None, None] for i in range(2): out[i] = (1 - ratio) * tuple1[i] + ratio * tuple2[i] return out def blend(self, ratio_u, ratio_v): uv0 = self._blend_tuples(self.corners[0], self.corners[1], ratio_u) uv1 = self._blend_tuples(self.corners[2], self.corners[3], ratio_u) return self._blend_tuples(uv0, uv1, ratio_v)
class Solution(object): def bulbSwitch(self, n): """ :type n: int :rtype: int """ num_of_facs = [1 for i in range(n)] for j in range(2, n + 1): for k in range(1, n / j + 1): num_of_facs[j * k - 1] += 1 res = 0 for num in num_of_facs: res += num % 2 return res
str_1 = input() str_2 = input() str_3 = input() print([str_1, [str_2], [[str_3]]])
class Dataset(object): def __init__(self, name=None): self.name = name def __str__(self): return self.name def get_instance_name(self, filepath, id): raise NotImplementedError("Abstract class") def import_model(self, filepath): raise NotImplementedError("Abstract class") def get_camera_position(self, filepath): raise NotImplementedError("Abstract class") def get_camera_position_generator(self, folder): raise NotImplementedError("Abstract class") def get_camera_rotation(self, degrees = 0): raise NotImplementedError("Abstract class") def get_camera_offset(self, direction, distance, degrees): raise NotImplementedError("Abstract class") def get_depth_output(self, output_path, base_filename, nodes, links, compositor): raise NotImplementedError("Abstract class") def get_color_output(self, output_path, base_filename, nodes, links, compositor): raise NotImplementedError("Abstract class") def get_emission_output(self, output_path, base_filename, nodes, links, compositor): raise NotImplementedError("Abstract class") def get_normals_output(self, output_path, base_filename, nodes, links, compositor): raise NotImplementedError("Abstract class") def get_normal_map_output(self, output_path, base_filename, nodes, links, compositor): raise NotImplementedError("Abstract class") def get_flow_map_output(self, output_path, base_filename, nodes, links, compositor): raise NotImplementedError("Abstract class") def get_semantic_map_output(self, labels_path, output_path, base_filename, nodes, links, compositor): raise NotImplementedError("Abstract class") def get_pretty_semantic_map_output(self, labels_path, output_path, base_filename, nodes, links, compositor): raise NotImplementedError("Abstract class") def set_render_settings(self): raise NotImplementedError("Abstract class")
def isValid(s: str) -> bool: open_to_close = { '(': ')', '{': '}', '[': ']' } close_to_open = {v: k for k, v in open_to_close.items()} stack = [] for i in s: if i in open_to_close: stack.append(i) elif i in close_to_open: if len(stack) <= 0: return False last_open = stack.pop() if open_to_close[last_open] != i: return False return len(stack) == 0
Numero = int(input('Insira um número: ')) Unidade = Numero//1%10 Dezena = Numero//10%10 Centena = Numero//100%10 Milhar = Numero//1000%10 print(f'Analisando o número {Numero}...') print(f'Unidade: {Unidade}') print(f'Dezena: {Dezena}') print(f'Centena: {Centena}') print(f'Milhar: {Milhar}')
client_id = 'Ch8pNOBOAYzASwSmKClKZJKts8VnKDsj' # your bot's client ID token = 'Mzc3MDU4MTc2MzUwMDI3Nzc3.DQ8csA.YRTHtBKENVulI8bk17-6gzGnScU' # your bot's token carbon_key = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOiIyMjA5NTkxNzg3NzkyNjI5ODYiLCJyYW5kIjozOTksImlhdCI6MTUxMjkzNTQ5NH0.1Al7nXx5HmvA7Lyc_ddc6V_czVxvD5K7dxPdrW0D1yE' # your bot's key on carbon's site bots_key = 'https://discordapp.com/oauth2/authorize?client_id=377058176350027777&scope=bot&permissions=268954750&response_type=code&redirect_uri=discord.gg' # your key on bots.discord.pw postgresql = 'postgres://sflxeqaxuvrkro:d9df02d2b497e0f23c6663de06cbf5a17a7f1a867e7a9a6208484d292cb57f61@ec2-54-195-248-0.eu-west-1.compute.amazonaws.com:5432/d4a6dsf7p8cp8e' # your postgresql info from above challonge_api_key = 'bU7HgqNbDQhVysppOgPp8zoRqGE82cWf2iM0Q2Ep' # for tournament cog
"""Device module handling /device/ API calls.""" class Device(object): """Device class with /device/ API calls.""" def __init__(self, opensprinkler): """Device class initializer.""" self._opensprinkler = opensprinkler def _getOption(self, option): """Retrieve option""" (resp, content) = self._opensprinkler._request('jo') return content[option] def _getVariable(self, option): """Retrieve option""" (resp, content) = self._opensprinkler._request('jc') return content[option] def _setVariable(self, option, value): """Retrieve option""" params = {} params[option] = value (resp, content) = self._opensprinkler._request('cv', params) return content['result'] def getFirmwareVersion(self): """Retrieve firmware version""" return self._getOption('fwv') def getHardwareVersion(self): """Retrieve hardware version""" return self._getOption('hwv') def getLastRun(self): """Retrieve hardware version""" return self._getVariable('lrun')[3] def getRainDelay(self): """Retrieve rain delay""" return self._getVariable('rd') def getRainDelayStopTime(self): """Retrieve rain delay stop time""" return self._getVariable('rdst') def getRainSensor1(self): """Retrieve hardware version""" return self._getVariable('sn1') def getRainSensor2(self): """Retrieve hardware version""" return self._getVariable('sn2') def getRainSensorLegacy(self): """Retrieve hardware version""" return self._getVariable('rs') def getOperationEnabled(self): """Retrieve operation enabled""" return self._getVariable('en') def getWaterLevel(self): """Retrieve water level""" return self._getOption('wl') def enable(self): """Enable operation""" return self._setVariable('en', 1) def disable(self): """Disable operation""" return self._setVariable('en', 0)
def generate_concept_HTML(concept_title, concept_description): html_text_1 = ''' <div class="concept"> <div class="concept-title"> ''' + concept_title html_text_2 = ''' </div> <div class="concept-description"> ''' + concept_description html_text_3 = ''' </div> </div>''' full_html_text = html_text_1 + html_text_2 + html_text_3 return full_html_text def get_title(concept): start_location = concept.find('TITLE:') end_location = concept.find('DESCRIPTION:') title = concept[start_location+7 : end_location-1] return title def get_description(concept): start_location = concept.find('DESCRIPTION:') description = concept[start_location+13 :] return description def get_concept_by_number(text, concept_number): counter = 0 while counter < concept_number: counter = counter + 1 next_concept_start = text.find('TITLE:') next_concept_end = text.find('TITLE:', next_concept_start + 1) if next_concept_end >= 0: concept = text[next_concept_start:next_concept_end] else: next_concept_end = len(text) concept = text[next_concept_start:] text = text[next_concept_end:] return concept def generate_concept_HTML(concept_title, concept_description): html_text_1 = ''' <div class="concept"> <div class="concept-title"> ''' + concept_title html_text_2 = ''' </div> <div class="concept-description"> ''' + concept_description html_text_3 = ''' </div> </div>''' full_html_text = html_text_1 + html_text_2 + html_text_3 return full_html_text def make_HTML(concept): concept_title = concept[0] concept_description = concept[1] return generate_concept_HTML(concept_title, concept_description) # This is an example. EXAMPLE_LIST_OF_CONCEPTS = [ ['Python', 'Python is a Programming Language'], ['For Loop', 'For Loops allow you to iterate over lists'], ['Lists', 'Lists are sequences of data'] ] # This is the function you will write. def make_HTML_for_many_concepts(list_of_concepts): for concept in list_of_concepts: all_concepts = make_HTML(concept) all_concepts = all_concepts + make_HTML(concept) return all_concepts
nop = b'\x00\x00' brk = b'\x00\xA0' ld1 = b'\x63\x25' # Load 0x25 into register V3 ld2 = b'\x64\x26' # Load 0x26 into register V4 sne = b'\x93\x40' # Skip next instruction if V3 != V4 with open("snevxvytest.bin", 'wb') as f: f.write(ld1) # 0x0200 <-- Load the byte 0x25 into register V3 f.write(ld2) # 0x0202 <-- Load the byte 0x25 into register V4 f.write(sne) # 0x0204 <-- Skip next instruction if V3 != V4 f.write(brk) # 0x0206 <-- If it worked, we should skip here. If it didn't, we'll break here. f.write(nop) # 0x0208 f.write(nop) # 0x020A f.write(brk) # 0x020C <-- If it worked, we should end up here after a few NOPs f.write(nop) # 0x020E