content
stringlengths
7
1.05M
def getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) # We only run a small set of tests on Windows for now. # Override the parent directory's "unsupported" decision until we can handle # all of its tests. if root.host_os in ['Windows']: config.unsupported = False else: config.unsupported = True
"""Constant values.""" STATUS_SUCCESS = (0,) STATUS_AUTH_FAILED = (100, 101, 102, 200, 401) STATUS_INVALID_PARAMS = ( 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 216, 217, 218, 220, 221, 223, 225, 227, 228, 229, 230, 234, 235, 236, 238, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 254, 260, 261, 262, 263, 264, 265, 266, 267, 271, 272, 275, 276, 283, 284, 285, 286, 287, 288, 290, 293, 294, 295, 297, 300, 301, 302, 303, 304, 321, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 380, 381, 382, 400, 501, 502, 503, 504, 505, 506, 509, 510, 511, 523, 532, 3017, 3018, 3019, ) STATUS_UNAUTHORIZED = (214, 277, 2553, 2554, 2555) STATUS_ERROR_OCCURRED = ( 215, 219, 222, 224, 226, 231, 233, 237, 253, 255, 256, 257, 258, 259, 268, 269, 270, 273, 274, 278, 279, 280, 281, 282, 289, 291, 292, 296, 298, 305, 306, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 322, 370, 371, 372, 373, 374, 375, 383, 391, 402, 516, 517, 518, 519, 520, 521, 525, 526, 527, 528, 529, 530, 531, 533, 602, 700, 1051, 1052, 1053, 1054, 2551, 2552, 2556, 2557, 2558, 2559, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3020, 3021, 3022, 3023, 3024, 5000, 5001, 5005, 5006, 6000, 6010, 6011, 9000, 10000, ) STATUS_TIMEOUT = (522,) STATUS_BAD_STATE = (524,) STATUS_TOO_MANY_REQUESTS = (601,)
FACTS = ['espoem multiplied by zero still equals espoem.', 'There is no theory of evolution. Just a list of creatures espoem has allowed to live.', 'espoem does not sleep. He waits.', 'Alexander Graham Bell had three missed calls from espoem when he invented the telephone.', 'espoem is the reason why Waldo is hiding.', 'espoem can slam a revolving door.', "espoem isn't lifting himself up when doing a pushup; he's pushing the earth down.", "espoem' hand is the only hand that can beat a Royal Flush.", 'espoem made a Happy Meal cry.', "espoem doesn't need Twitter; he's already following you.", 'espoem once won an underwater breathing contest with a fish.While urinating, espoem is easily capable of welding titanium.', 'In an act of great philanthropy, espoem made a generous donation to the American Cancer Society. He donated 6,000 dead bodies for scientific research.', 'espoem once one a game of connect four in 3 moves.', "Google won't search for espoem because it knows you don't find espoem, he finds you.", 'espoem? favourite cut of meat is the roundhouse.', 'It is scientifically impossible for espoem to have had a mortal father. The most popular theory is that he went back in time and fathered himself.', 'espoem had to stop washing his clothes in the ocean. The tsunamis were killing people.', 'Pluto is actually an orbiting group of British soldiers from the American Revolution who entered space after the espoem gave them a roundhouse kick to the face.', 'In the Words of Julius Caesar, Veni, Vidi, Vici, espoem. Translation: I came, I saw, and I was roundhouse-kicked inthe face by espoem.', "espoem doesn't look both ways before he crosses the street... he just roundhouses any cars that get too close.", 'Human cloning is outlawed because of espoem, because then it would be possible for a espoem roundhouse kick to meet another espoem roundhouse kick. Physicists theorize that this contact would end the universe.', 'Using his trademark roundhouse kick, espoem once made a fieldgoal in RJ Stadium in Tampa Bay from the 50 yard line of Qualcomm stadium in San Diego.', 'espoem played Russian Roulette with a fully loaded gun and won.', "espoem roundhouse kicks don't really kill people. They wipe out their entire existence from the space-time continuum.", "espoem' testicles do not produce sperm. They produce tiny white ninjas that recognize only one mission: seek and destroy.", 'MacGyver immediately tried to make a bomb out of some Q-Tips and Gatorade, but espoem roundhouse-kicked him in the solar plexus. MacGyver promptly threw up his own heart.', 'Not everyone that espoem is mad at gets killed. Some get away. They are called astronauts.', 'espoem can drink an entire gallon of milk in thirty-seven seconds.', 'If you spell espoem in Scrabble, you win. Forever.', "When you say no one's perfect, espoem takes this as a personal insult.", "espoem invented Kentucky Fried Chicken's famous secret recipe with eleven herbs and spices. Nobody ever mentions the twelfth ingredient: Fear.", 'espoem can skeletize a cow in two minutes.', 'espoem eats lightning and shits out thunder.', 'In a fight between Batman and Darth Vader, the winner would be espoem.', "The phrase 'dead ringer' refers to someone who sits behind espoem in a movie theater and forgets to turn their cell phone off.", "It is said that looking into espoem' eyes will reveal your future. Unfortunately, everybody's future is always the same: death by a roundhouse-kick to the face.", "espoem's log statements are always at the FATAL level.", 'espoem can win in a game of Russian roulette with a fully loaded gun.', 'Nothing can escape the gravity of a black hole, except for espoem. espoem eats black holes. They taste like chicken.', 'There is no theory of evolution, just a list of creatures espoem allows to live.', 'A study showed the leading causes of death in the United States are: 1. Heart disease, 2. espoem, 3. Cancer', 'Everybody loves Raymond. Except espoem.', 'Noah was the only man notified before espoem relieved himself in the Atlantic Ocean.', 'In a tagteam match, espoem was teamed with Hulk Hogan against King Kong Bundy and Andre The Giant. He pinned all 3 at the same time.', "Nobody doesn't like Sara Lee. Except espoem.", "espoem never has to wax his skis because they're always slick with blood.", 'espoem ordered a Big Mac at Burger King, and got one.', 'espoem owns a chain of fast-food restaurants throughout the southwest. They serve nothing but barbecue-flavored ice cream and Hot Pockets.', "espoem's database has only one table, 'Kick', which he DROPs frequently.", "espoem built a time machine and went back in time to stop the JFK assassination. As Oswald shot, espoem met all three bullets with his beard, deflecting them. JFK's head exploded out of sheer amazement.", 'espoem can write infinite recursion functions, and have them return.', 'When espoem does division, there are no remainders.', 'We live in an expanding universe. All of it is trying to get away from espoem.', 'espoem cannot love, he can only not kill.', 'espoem knows the value of NULL, and he can sort by it too.', 'There is no such thing as global warming. espoem was cold, so he turned the sun up.', 'The best-laid plans of mice and men often go awry. Even the worst-laid plans of espoem come off without a hitch.', 'When espoem goes to donate blood, he declines the syringe, and instead requests a hand gun and a bucket.', 'espoem can solve the Towers of Hanoi in one move.', 'All roads lead to espoem. And by the transitive property, a roundhouse kick to the face.', 'If you were somehow able to land a punch on espoem your entire arm would shatter upon impact. This is only in theory, since, come on, who in their right mind would try this?', 'One time, at band camp, espoem ate a percussionist.', 'Product Owners never argue with espoem after he demonstrates the DropKick feature.', 'espoem can read from an input stream.', 'The original draft of The Lord of the Rings featured espoem instead of Frodo Baggins. It was only 5 pages long, as espoem roundhouse-kicked Sauron?s ass halfway through the first chapter.', "If, by some incredible space-time paradox, espoem would ever fight himself, he'd win. Period.", 'When taking the SAT, write espoem for every answer. You will score over 8000.', 'When in a bar, you can order a drink called a espoem. It is also known as a Bloody Mary, if your name happens to be Mary.', 'espoem causes the Windows Blue Screen of Death.', 'espoem went out of an infinite loop.', 'When Bruce Banner gets mad, he turns into the Hulk. When the Hulk gets mad, he turns into espoem.', 'espoem insists on strongly-typed programming languages.', 'espoem can blow bubbles with beef jerky.', "espoem is widely predicted to be first black president. If you're thinking to yourself, But espoem isn't black, then you are dead wrong. And stop being a racist.", 'espoem once went skydiving, but promised never to do it again. One Grand Canyon is enough.', "Godzilla is a Japanese rendition of espoem's first visit to Tokyo.", 'espoem has the greatest Poker-Face of all time. He won the 1983 World Series of Poker, despite holding only a Joker, a Get out of Jail Free Monopoloy card, a 2 of clubs, 7 of spades and a green #4 card from the game UNO.', 'Teenage Mutant Ninja Turtles is based on a true story: espoem once swallowed a turtle whole, and when he crapped it out, the turtle was six feet tall and had learned karate.', "If you try to kill -9 espoem's programs, it backfires.", "espoem' Penis is a third degree blackbelt, and an honorable 32nd-degree mason.", 'In ancient China there is a legend that one day a child will be born from a dragon, grow to be a man, and vanquish evil from the land. That man is not espoem, because espoem killed that man.', 'espoem can dereference NULL.', 'All arrays espoem declares are of infinite size, because espoem knows no bounds.', 'The pen is mighter than the sword, but only if the pen is held by espoem.', "espoem doesn't step on toes. espoem steps on necks.", 'The truth will set you free. Unless espoem has you, in which case, forget it buddy!', 'Simply by pulling on both ends, espoem can stretch diamonds back into coal.', 'espoem does not style his hair. It lays perfectly in place out of sheer terror.', 'espoem once participated in the running of the bulls. He walked.', 'Never look a gift espoem in the mouth, because he will bite your damn eyes off.', "If you Google search espoem getting his ass kicked you will generate zero results. It just doesn't happen.", 'espoem can unit test entire applications with a single assert.', 'On his birthday, espoem randomly selects one lucky child to be thrown into the sun.', "Little known medical fact: espoem invented the Caesarean section when he roundhouse-kicked his way out of his monther's womb.", "No one has ever spoken during review of espoem' code and lived to tell about it.", 'The First rule of espoem is: you do not talk about espoem.', 'Fool me once, shame on you. Fool espoem once and he will roundhouse kick you in the face.', "espoem doesn't read books. He stares them down until he gets the information he wants.", "The phrase 'balls to the wall' was originally conceived to describe espoem entering any building smaller than an aircraft hangar.", "Someone once tried to tell espoem that roundhouse kicks aren't the best way to kick someone. This has been recorded by historians as the worst mistake anyone has ever made.", 'Along with his black belt, espoem often chooses to wear brown shoes. No one has DARED call him on it. Ever.', 'Whiteboards are white because espoem scared them that way.', 'espoem drives an ice cream truck covered in human skulls.', "Every time espoem smiles, someone dies. Unless he smiles while he's roundhouse kicking someone in the face. Then two people die."]
# # LeetCode # # Problem - 106 # URL - https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/ # # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def buildTree(self, inorder: List[int], postorder: List[int]) -> TreeNode: if not inorder: return None r = postorder.pop() root = TreeNode(r) index = inorder.index(r) root.right = self.buildTree(inorder[index+1:], postorder) root.left = self.buildTree(inorder[:index], postorder) return root
# # PySNMP MIB module EXTREME-RTSTATS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/EXTREME-BASE-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:53:03 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, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection") extremeAgent, = mibBuilder.importSymbols("EXTREME-BASE-MIB", "extremeAgent") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Unsigned32, iso, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, Bits, MibIdentifier, ModuleIdentity, Counter64, Counter32, NotificationType, Integer32, IpAddress, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "iso", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "Bits", "MibIdentifier", "ModuleIdentity", "Counter64", "Counter32", "NotificationType", "Integer32", "IpAddress", "TimeTicks") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") extremeRtStats = ModuleIdentity((1, 3, 6, 1, 4, 1, 1916, 1, 11)) if mibBuilder.loadTexts: extremeRtStats.setLastUpdated('9906240000Z') if mibBuilder.loadTexts: extremeRtStats.setOrganization('Extreme Networks, Inc.') extremeRtStatsTable = MibTable((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1), ) if mibBuilder.loadTexts: extremeRtStatsTable.setStatus('current') extremeRtStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1, 1), ).setIndexNames((0, "EXTREME-RTSTATS-MIB", "extremeRtStatsIndex")) if mibBuilder.loadTexts: extremeRtStatsEntry.setStatus('current') extremeRtStatsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: extremeRtStatsIndex.setStatus('current') extremeRtStatsIntervalStart = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1, 1, 2), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: extremeRtStatsIntervalStart.setStatus('current') extremeRtStatsCRCAlignErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: extremeRtStatsCRCAlignErrors.setStatus('current') extremeRtStatsUndersizePkts = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: extremeRtStatsUndersizePkts.setStatus('current') extremeRtStatsOversizePkts = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: extremeRtStatsOversizePkts.setStatus('current') extremeRtStatsFragments = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: extremeRtStatsFragments.setStatus('current') extremeRtStatsJabbers = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: extremeRtStatsJabbers.setStatus('current') extremeRtStatsCollisions = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: extremeRtStatsCollisions.setStatus('current') extremeRtStatsTotalErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: extremeRtStatsTotalErrors.setStatus('current') extremeRtStatsUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 1916, 1, 11, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10000))).setMaxAccess("readonly") if mibBuilder.loadTexts: extremeRtStatsUtilization.setStatus('current') mibBuilder.exportSymbols("EXTREME-RTSTATS-MIB", extremeRtStatsEntry=extremeRtStatsEntry, extremeRtStatsOversizePkts=extremeRtStatsOversizePkts, extremeRtStatsUndersizePkts=extremeRtStatsUndersizePkts, extremeRtStatsTable=extremeRtStatsTable, extremeRtStatsTotalErrors=extremeRtStatsTotalErrors, extremeRtStats=extremeRtStats, PYSNMP_MODULE_ID=extremeRtStats, extremeRtStatsCollisions=extremeRtStatsCollisions, extremeRtStatsCRCAlignErrors=extremeRtStatsCRCAlignErrors, extremeRtStatsJabbers=extremeRtStatsJabbers, extremeRtStatsIndex=extremeRtStatsIndex, extremeRtStatsUtilization=extremeRtStatsUtilization, extremeRtStatsIntervalStart=extremeRtStatsIntervalStart, extremeRtStatsFragments=extremeRtStatsFragments)
# https://www.acmicpc.net/problem/1260 n, m, v = map(int, input().split()) graph = [[0] * (n+1) for _ in range(n+1)] visit = [False] * (n+1) for _ in range(m): R, C = map(int, input().split()) graph[R][C] = 1 graph[C][R] = 1 def dfs(v): visit[v] = True print(v, end=" ") for i in range(1, n+1): if not visit[i] and graph[v][i]==1: dfs(i) def bfs(v): queue = [v] visit[v] = False while queue: v = queue.pop(0) print(v, end=" ") for i in range(1, n+1): if visit[i] and graph[v][i]==1: queue.append(i) visit[i] = False dfs(v) print() bfs(v)
class Solution: def modifyString(self, s: str) -> str: s = list(s) for i in range(len(s)): if s[i] == "?": for c in "abc": if (i == 0 or s[i-1] != c) and (i+1 == len(s) or s[i+1] != c): s[i] = c break return "".join(s)
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ An `image.layer` is a set of `feature` with some additional parameters. Its purpose to materialize those `feature`s as a btrfs subvolume in the per-repo `buck-image/out/volume/targets`. We call the subvolume a "layer" because it can be built on top of a snapshot of its `parent_layer`, and thus can be represented as a btrfs send-stream for more efficient storage & distribution. The Buck output of an `image.layer` target is a JSON file with information on how to find the resulting layer in the per-repo `buck-image/out/volume/targets`. See `SubvolumeOnDisk.to_json_file`. ## Implementation notes The implementation of this converter deliberately minimizes the amount of business logic in its command. The converter must include **only** our interactions with the buck target graph. Everything else should be delegated to subcommands. ### Command In composing the `bash` command, our core maxim is: make it a hermetic function of the converter's inputs -- do not read data from disk, do not insert disk paths into the command, do not do anything that might cause the bytes of the command to vary between machines or between runs. To achieve this, we use Buck macros to resolve all paths, including those to helper scripts. We rely on environment variables or pipes to pass data between the helper scripts. Another reason to keep this converter minimal is that `buck test` cannot make assertions about targets that fail to build. Since we only have the ability to test the "good" targets, it behooves us to put most logic in external scripts, so that we can unit-test its successes **and** failures thoroughly. ### Output We mark `image.layer` uncacheable, because there's no easy way to teach Buck to serialize a btrfs subvolume (for that, we have `package.new`). That said, we should still follow best practices to avoid problems if e.g. the user renames their repo, or similar. These practices include: - The output JSON must store no absolute paths. - Store Buck target paths instead of paths into the output directory. ### Dependency resolution An `image.layer` consumes a set of `feature` outputs to decide what to put into the btrfs subvolume. These outputs are actually just JSON files that reference other targets, and do not contain the data to be written into the image. Therefore, `image.layer` has to explicitly tell buck that it needs all direct dependencies of its `feature`s to be present on disk -- see our `attrfilter` queries below. Without this, Buck would merrily fetch the just the `feature` JSONs from its cache, and not provide us with any of the buid artifacts that comprise the image. We do NOT need the direct dependencies of the parent layer's features, because we treat the parent layer as a black box -- whatever it has laid down in the image, that's what it provides (and we don't care about how). The consequences of this information hiding are: - Better Buck cache efficiency -- we don't have to download the dependencies of the ancestor layers' features. Doing that would be wasteful, since those bits are redundant with what's in the parent. - Ability to use genrule image layers / apply non-pure post-processing to a layer. In terms of engineering, both of these non-pure approaches are a terrible idea and a maintainability headache, but they do provide a useful bridge for transitioning to Buck image builds from legacy imperative systems. - The image compiler needs a litte extra code to walk the parent layer and determine what it provides. - We cannot have "unobservable" dependencies between features. Since feature dependencies are expected to routinely cross layer boundaries, feature implementations are forced only to depend on data that can be inferred from the filesystem -- since this is all that the parent layer implementation can do. NB: This is easy to relax in the future by writing a manifest with additional metadata into each layer, and using that metadata during compilation. """ load(":compile_image_features.bzl", "compile_image_features") load(":image_layer_utils.bzl", "image_layer_utils") load(":image_utils.bzl", "image_utils") def image_layer( name, parent_layer = None, features = None, flavor = None, flavor_config_override = None, antlir_rule = "user-internal", **image_layer_kwargs): """ Arguments - `parent_layer`: The name of another `image_layer` target, on top of which the current layer will install its features. - `features`: List of `feature` target paths and/or nameless structs from `feature.new`. - `flavor`: Picks default build options for the layer, including `build_appliance`, RPM installer, and others. See `flavor_helpers.bzl` for details. - `flavor_config_override`: A struct that can override the default values fetched from `REPO_CFG[flavor].flavor_to_config`. - `mount_config`: Specifies how this layer is mounted in the `mounts` field of a `feature` of a parent layer. See the field in `_image_layer_impl` in `image_layer_utils.bzl` - `runtime`: A list of desired helper buck targets to be emitted. `container` is always included in the list by default. See the field in `_image_layer_impl` in `image_layer_utils.bzl` and the [docs](/docs/tutorials/helper-buck-targets#imagelayer) for the list of possible helpers, their respective behaviours, and how to invoke them. """ image_layer_utils.image_layer_impl( _rule_type = "image_layer", _layer_name = name, # Build a new layer. It may be empty. _make_subvol_cmd = compile_image_features( name = name, current_target = image_utils.current_target(name), parent_layer = parent_layer, features = features, flavor = flavor, flavor_config_override = flavor_config_override, ), antlir_rule = antlir_rule, **image_layer_kwargs )
# ------------------------------ # 515. Find Largest Value in Each Tree Row # # Description: # You need to find the largest value in each row of a binary tree. # Example: # Input: # 1 # / \ # 3 2 # / \ \ # 5 3 9 # Output: [1, 3, 9] # # Version: 1.0 # 12/22/18 by Jianfa # ------------------------------ # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def largestValues(self, root): """ :type root: TreeNode :rtype: List[int] """ if not root: return [] children = [root] res = [] while children: temp = [] # Node of next row largest = -sys.maxsize # Largest number of this row for i in range(len(children)): node = children[i] largest = max(node.val, largest) if node.left: temp.append(node.left) if node.right: temp.append(node.right) res.append(largest) children = temp return res # Used for testing if __name__ == "__main__": test = Solution() # ------------------------------ # Summary: # BFS solution.
class DynamicObject(object): def __init__(self, name, id_): self.name = name self.id = id_
""" TextRNN model configuration """ class TextRNNConfig(object): def __init__( self, vocab_size=30000, pretrained_embedding=None, embedding_matrix=None, embedding_dim=300, embedding_dropout=0.3, lstm_hidden_size=128, output_dim=1, **kwargs ): self.pretrained_embedding = pretrained_embedding self.embedding_matrix = embedding_matrix self.embedding_dim = embedding_dim self.embedding_dropout = embedding_dropout self.lstm_hidden_size = lstm_hidden_size self.output_dim = output_dim
"""Provides all the data related to the development.""" LICENSES = [ "Apache License, 2.0 (Apache-2.0)", "The BSD 3-Clause License", "The BSD 2-Clause License", "GNU General Public License (GPL)", "General Public License (LGPL)", "MIT License (MIT)", "Mozilla Public License 2.0 (MPL-2.0)", "Common Development and Distribution License (CDDL-1.0)", "Eclipse Public License (EPL-1.0)", ] PROGRAMMING_LANGS = [ "ASP", "Assembly", "AutoIt", "Awk", "Bash", "C", "C Shell", "C#", "C++", "Caml", "Ceylon", "Clojure", "CoffeeScript", "Common Lisp", "D", "Dart", "Delphi", "Dylan", "ECMAScript", "Elixir", "Emacs Lisp", "Erlang", "F#", "Falcon", "Fortran", "GNU Octave", "Go", "Groovy", "Haskell", "haXe", "Io", "J#", "Java", "JavaScript", "Julia", "Kotlin", "Lisp", "Lua", "Mathematica", "Objective-C", "OCaml", "Perl", "PHP", "PL-I", "PL-SQL", "PowerShell", "Prolog", "Python", "R", "Racket", "Ruby", "Rust", "Scala", "Scheme", "Smalltalk", "Tcl", "Tex", "Transact-SQL", "TypeScript", "Z shell", ] OS = [ "Arch", "CentOS", "Debian", "Fedora", "FreeBSD", "Gentoo", "Kali", "Lubuntu", "Manjaro", "Mint", "OS X", "macOS", "OpenBSD", "PCLinuxOS", "Slackware", "Ubuntu", "Windows 10", "Windows 7", "Windows 8", "Windows 8.1", "Zorin", "elementaryOS", "macOS", "openSUSE", ] FOLDERS = [ "Development", "Downloads", "Documents", "Music", "Video", "Work", "Pictures", "Desktop", "Study", ] PROJECT_NAMES = [ "aardonyx", "abelisaurus", "achelousaurus", "achillobator", "acrocanthosaurus", "aegyptosaurus", "afrovenator", "agilisaurus", "alamosaurus", "albertaceratops", "albertosaurus", "alectrosaurus", "alioramus", "allosaurus", "alvarezsaurus", "amargasaurus", "ammosaurus", "ampelosaurus", "amygdalodon", "anatotitan", "anchiceratops", "anchisaurus", "ankylosaurus", "anserimimus", "antarctopelta", "antarctosaurus", "apatosaurus", "aragosaurus", "aralosaurus", "archaeoceratops", "archaeopteryx", "archaeornithomimus", "argentinosaurus", "arrhinoceratops", "atlascopcosaurus", "aucasaurus", "austrosaurus", "avaceratops", "avalonia", "avimimus", "azendohsaurus", "bactrosaurus", "bagaceratops", "bambiraptor", "barapasaurus", "barosaurus", "baryonyx", "becklespinax", "beipiaosaurus", "bellusaurus", "borogovia", "brachiosaurus", "brachyceratops", "bugenasaura", "buitreraptor", "camarasaurus", "camptosaurus", "carnotaurus", "caudipteryx", "cedarpelta", "centrosaurus", "ceratosaurus", "cetiosauriscus", "cetiosaurus", "chaoyangsaurus", "chasmosaurus", "chialingosaurus", "chindesaurus", "chinshakiangosaurus", "chirostenotes", "chubutisaurus", "chungkingosaurus", "citipati", "coelophysis", "coelurus", "coloradisaurus", "compsognathus", "conchoraptor", "confuciusornis", "corythosaurus", "cryolophosaurus", "dacentrurus", "daspletosaurus", "datousaurus", "deinocheirus", "deinonychus", "deltadromeus", "diceratops", "dicraeosaurus", "dilophosaurus", "diplodocus", "dracorex", "dravidosaurus", "dromaeosaurus", "dromiceiomimus", "dryosaurus", "dryptosaurus", "dubreuillosaurus", "edmontonia", "edmontosaurus", "einiosaurus", "elaphrosaurus", "emausaurus", "eolambia", "eoraptor", "eotyrannus", "equijubus", "erketu", "erlikosaurus", "euhelopus", "euoplocephalus", "europasaurus", "euskelosaurus", "eustreptospondylus", "fukuiraptor", "fukuisaurus", "gallimimus", "gargoyleosaurus", "garudimimus", "gasosaurus", "gasparinisaura", "gastonia", "giganotosaurus", "gilmoreosaurus", "giraffatitan", "gobisaurus", "gorgosaurus", "goyocephale", "graciliceratops", "gryposaurus", "guaibasaurus", "guanlong", "hadrosaurus", "hagryphus", "haplocanthosaurus", "harpymimus", "herrerasaurus", "hesperosaurus", "heterodontosaurus", "homalocephale", "huayangosaurus", "hylaeosaurus", "hypacrosaurus", "hypselosaurus", "hypsilophodon", "iguanodon", "indosuchus", "ingenia", "irritator", "isisaurus", "janenschia", "jaxartosaurus", "jingshanosaurus", "jinzhousaurus", "jobaria", "juravenator", "kentrosaurus", "khaan", "kotasaurus", "kritosaurus", "lamaceratops", "lambeosaurus", "lapparentosaurus", "leaellynasaura", "leptoceratops", "lesothosaurus", "lexovisaurus", "liaoceratops", "liaoxiornis", "ligabuesaurus", "liliensternus", "lophorhothon", "lophostropheus", "lufengosaurus", "lurdusaurus", "lycorhinus", "magyarosaurus", "maiasaura", "majungatholus", "malawisaurus", "mamenchisaurus", "mapusaurus", "marshosaurus", "masiakasaurus", "massospondylus", "maxakalisaurus", "megalosaurus", "melanorosaurus", "metriacanthosaurus", "microceratops", "micropachycephalosaurus", "microraptor", "minmi", "monolophosaurus", "mononykus", "mussaurus", "muttaburrasaurus", "nanotyrannus", "nanshiungosaurus", "nemegtosaurus", "neovenator", "neuquenosaurus", "nigersaurus", "nipponosaurus", "noasaurus", "nodosaurus", "nomingia", "nothronychus", "nqwebasaurus", "omeisaurus", "ornitholestes", "ornithomimus", "orodromeus", "oryctodromeus", "othnielia", "ouranosaurus", "oviraptor", "rebbachisaurus", "rhabdodon", "rhoetosaurus", "rinchenia", "riojasaurus", "rugops", "saichania", "saltasaurus", "saltopus", "sarcosaurus", "saurolophus", "sauropelta", "saurophaganax", "saurornithoides", "scelidosaurus", "scutellosaurus", "secernosaurus", "segisaurus", "segnosaurus", "seismosaurus", "shamosaurus", "shanag", "shantungosaurus", "shunosaurus", "shuvuuia", "silvisaurus", "sinocalliopteryx", "sinornithosaurus", "sinosauropteryx", "sinraptor", "sinvenator", "zalmoxes", "zephyrosaurus", "zuniceratops", "byzantine", "svengali", "accolade", "acrimony", "angst", "anomaly", "antidote", "baroque", "bona_fide", "bourgeois", "bravado", "brogue", "brusque", "cacophony", "caustic", "charisma", "cloying", "deja-vu", "dichotomy", "elan", "ennui", "epitome", "esoteric", "euphemism", "faux pas", "fiasco", "finagle", "glib", "harbinger", "hedonist", "heresy", "idyllic", "insidious", "junket", "kitsch", "litany", "lurid", "malaise", "malinger", "mantra", "maudlin", "mercenary", "misnomer", "nirvana", "oblivion", "ogle", "ostracize", "panacea", "paradox", "peevish", "propriety", "revel", "rhetoric", "spartan", "stigma", "stoic", "suave", "sycophant", "tirade", "tryst", "untenable", "vicarious", "vile", "waft", "zealous", ]
# ---------------------------------------------------------------------------- # CLASSES: nightly # # Test Case: protocolo.py # # Tests: vistprotocol unit test # # Mark C. Miller, Tue Jan 11 10:19:23 PST 2011 # ---------------------------------------------------------------------------- tapp = visit_bin_path("visitprotocol") res = sexe(tapp,ret_output=True) if res["return_code"] == 0: excode = 111 else: excode = 113 Exit(excode)
""" Insertion Sort Algorithm:""" """Implementation""" def insertion_sort(arr) -> list: n = len(arr) for i in range(1, n): swap_index = i for j in range(i-1, -1, -1): if arr[swap_index] < arr[j]: arr[swap_index], arr[j] = arr[j], arr[swap_index] swap_index -= 1 else: break return arr def main(): arr_input = [10, 5, 30, 1, 2, 5, 10, 10] a2 = insertion_sort(arr_input) print(a2) # Using the special variable # __name__ if __name__ == "__main__": main()
# store information about a pizza being ordered pizza = { 'crust': 'thick', 'toppings': ['mushrooms', 'extra vegan cheese'] } # summarize the order print("You ordered a " + pizza['crust'] + "-crust pizza" + "with the following toppings:") for topping in pizza['toppings']: print("\t" + topping)
""" Given 3 bottles of capacities 3, 5, and 9 liters, count number of all possible solutions to get 7 liters """ current_path = [[0, 0, 0]] CAPACITIES = (3, 5, 9) solutions_count = 0 def move_to_new_state(current_state): global solutions_count, current_path if 7 in current_state: solutions_count += 1 else: # Empty bottle for i in range(3): if current_state[i] != 0: new_state = list(current_state) new_state[i] = 0 if new_state not in current_path: current_path.append(new_state) move_to_new_state(new_state) current_path.pop() # Fill bottle for i in range(3): if current_state[i] != CAPACITIES[i]: new_state = list(current_state) new_state[i] = CAPACITIES[i] if new_state not in current_path: current_path.append(new_state) move_to_new_state(new_state) current_path.pop() # Pour from one bottle to another for i in range(3): for j in range(3): if i != j and current_state[i] != 0 and current_state[j] != CAPACITIES[j]: new_state = list(current_state) liters_change = min(CAPACITIES[j] - current_state[j], current_state[i]) new_state[j] += liters_change new_state[i] -= liters_change if new_state not in current_path: current_path.append(new_state) move_to_new_state(new_state) current_path.pop() if __name__ == "__main__": try: current_state = [0, 0, 0] move_to_new_state(current_state) print(solutions_count) except KeyboardInterrupt: print(solutions_count) # Result: at least 44900799 solution
# Tumblr Setup # Replace the values with your information # OAuth keys can be generated from https://api.tumblr.com/console/calls/user/info consumer_key='ShbOqI5zErQXOL7Qnd5XduXpY9XQUlBgJDpCLeq1OYqnY2KzSt' #replace with your key consumer_secret='ulZradkbJGksjpl2MMlshAfJgEW6TNeSdZucykqeTp8jvwgnhu' #replace with your secret code oath_token='uUcBuvJx8yhk4HJIZ39sfcYo0W4VoqcvUetR2EwcI5Sn8SLgNt' #replace with your oath token oath_secret='iNJlqQJI6dwhAGmdNbMtD9u7VazmX2Rk5uW0fuIozIEjk97lz4' #replace with your oath secret code tumblr_blog = 'soniaetjeremie' # replace with your tumblr account name without .tumblr.com tagsForTumblr = "photobooth" # change to tags you want, separated with commas #Config settings to change behavior of photo booth monitor_w = 800 # width of the display monitor monitor_h = 480 # height of the display monitor file_path = '/home/pi/photobooth/pics/' # path to save images clear_on_startup = False # True will clear previously stored photos as the program launches. False will leave all previous photos. debounce = 0.3 # how long to debounce the button. Add more time if the button triggers too many times. post_online = True # True to upload images. False to store locally only. capture_count_pics = True # if true, show a photo count between taking photos. If false, do not. False is faster. make_gifs = True # True to make an animated gif. False to post 4 jpgs into one post. hi_res_pics = False # True to save high res pics from camera. # If also uploading, the program will also convert each image to a smaller image before making the gif. # False to first capture low res pics. False is faster. # Careful, each photo costs against your daily Tumblr upload max. camera_iso = 400 # adjust for lighting issues. Normal is 100 or 200. Sort of dark is 400. Dark is 800 max. # available options: 100, 200, 320, 400, 500, 640, 800
class Solution: """ @param s: a string @param t: a string @return: true if they are both one edit distance apart or false """ def isOneEditDistance(self, s, t): # write your code here if s == t: return False if abs(len(s) - len(t)) > 1: return False n, m = len(s), len(t) f = [[0] * (m + 1) for _ in range(2)] for j in range(m + 1): f[0][j] = j for i in range(1, n + 1): f[i % 2][0] = i for j in range(1, m + 1): if s[i - 1] == t[j - 1]: f[i % 2][j] = min(f[(i - 1) % 2][j - 1], f[(i - 1) % 2][j] + 1, f[i % 2][j - 1] + 1) else: f[i % 2][j] = min(f[(i - 1) % 2][j - 1] + 1, f[(i - 1) % 2][j] + 1, f[i % 2][j - 1] + 1) return f[n % 2][m] == 1
df8.cbind(df9) # A B C D A0 B0 C0 D0 # ----- ------ ------ ------ ------ ----- ----- ----- # -0.09 0.944 0.160 0.271 -0.351 1.66 -2.32 -0.86 # -0.95 0.669 0.664 1.535 -0.633 -1.78 0.32 1.27 # 0.17 0.657 0.970 -0.419 -1.413 -0.51 0.64 -1.25 # 0.58 -0.516 -1.598 -1.346 0.711 1.09 0.05 0.63 # 1.04 -0.281 -0.411 0.959 -0.009 -0.47 0.41 -0.52 # 0.49 0.170 0.124 -0.170 -0.722 -0.79 -0.91 -2.09 # 1.42 -0.409 -0.525 2.155 -0.841 -0.19 0.13 0.63 # 0.94 1.192 -1.075 0.017 0.167 0.54 0.52 1.42 # -0.53 0.777 -1.090 -2.237 -0.693 0.24 -0.56 1.45 # 0.34 -0.456 -1.220 -0.456 -0.315 1.10 1.38 -0.05 # # [100 rows x 8 columns]
# Copyright 2017 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """A rule for creating a Java container image. The signature of java_image is compatible with java_binary. The signature of war_image is compatible with java_library. """ load( "//container:container.bzl", "container_pull", _repositories = "repositories", ) # Load the resolved digests. load( ":java.bzl", _JAVA_DIGESTS = "DIGESTS", ) load( ":jetty.bzl", _JETTY_DIGESTS = "DIGESTS", ) def repositories(): # Call the core "repositories" function to reduce boilerplate. # This is idempotent if folks call it themselves. _repositories() excludes = native.existing_rules().keys() if "java_image_base" not in excludes: container_pull( name = "java_image_base", registry = "gcr.io", repository = "distroless/java", digest = _JAVA_DIGESTS["latest"], ) if "java_debug_image_base" not in excludes: container_pull( name = "java_debug_image_base", registry = "gcr.io", repository = "distroless/java", digest = _JAVA_DIGESTS["debug"], ) if "jetty_image_base" not in excludes: container_pull( name = "jetty_image_base", registry = "gcr.io", repository = "distroless/java/jetty", digest = _JETTY_DIGESTS["latest"], ) if "jetty_debug_image_base" not in excludes: container_pull( name = "jetty_debug_image_base", registry = "gcr.io", repository = "distroless/java/jetty", digest = _JETTY_DIGESTS["debug"], ) if "servlet_api" not in excludes: native.maven_jar( name = "javax_servlet_api", artifact = "javax.servlet:javax.servlet-api:3.0.1", ) DEFAULT_JAVA_BASE = select({ "@io_bazel_rules_docker//:fastbuild": "@java_image_base//image", "@io_bazel_rules_docker//:debug": "@java_debug_image_base//image", "@io_bazel_rules_docker//:optimized": "@java_image_base//image", "//conditions:default": "@java_image_base//image", }) DEFAULT_JETTY_BASE = select({ "@io_bazel_rules_docker//:fastbuild": "@jetty_image_base//image", "@io_bazel_rules_docker//:debug": "@jetty_debug_image_base//image", "@io_bazel_rules_docker//:optimized": "@jetty_image_base//image", "//conditions:default": "@jetty_image_base//image", }) load( "//container:container.bzl", _container = "container", ) def java_files(f): files = [] if java_common.provider in f: java_provider = f[java_common.provider] files += list(java_provider.transitive_runtime_jars) if hasattr(f, "files"): # a jar file files += list(f.files) return files load( "//lang:image.bzl", "dep_layer_impl", "layer_file_path", ) def _jar_dep_layer_impl(ctx): """Appends a layer for a single dependency's runfiles.""" return dep_layer_impl(ctx, runfiles = java_files) jar_dep_layer = rule( attrs = dict(_container.image.attrs.items() + { # The base image on which to overlay the dependency layers. "base": attr.label(mandatory = True), # The dependency whose runfiles we're appending. "dep": attr.label(mandatory = True), # Whether to lay out each dependency in a manner that is agnostic # of the binary in which it is participating. This can increase # sharing of the dependency's layer across images, but requires a # symlink forest in the app layers. "agnostic_dep_layout": attr.bool(default = True), # Override the defaults. "directory": attr.string(default = "/app"), # https://github.com/bazelbuild/bazel/issues/2176 "data_path": attr.string(default = "."), }.items()), executable = True, outputs = _container.image.outputs, implementation = _jar_dep_layer_impl, ) def _jar_app_layer_impl(ctx): """Appends the app layer with all remaining runfiles.""" available = depset() for jar in ctx.attr.jar_layers: available += java_files(jar) # We compute the set of unavailable stuff by walking deps # in the same way, adding in our binary and then subtracting # out what it available. unavailable = depset() for jar in ctx.attr.deps + ctx.attr.runtime_deps: unavailable += java_files(jar) unavailable += java_files(ctx.attr.binary) unavailable = [x for x in unavailable if x not in available] classpath = ":".join([ layer_file_path(ctx, x) for x in available + unavailable ]) # Classpaths can grow long and there is a limit on the length of a # command line, so mitigate this by always writing the classpath out # to a file instead. classpath_file = ctx.new_file(ctx.attr.name + ".classpath") ctx.actions.write(classpath_file, classpath) binary_path = layer_file_path(ctx, ctx.files.binary[0]) classpath_path = layer_file_path(ctx, classpath_file) entrypoint = [ "/usr/bin/java", "-cp", # Support optionally passing the classpath as a file. "@" + classpath_path if ctx.attr._classpath_as_file else classpath, ] + ctx.attr.jvm_flags + [ctx.attr.main_class] + ctx.attr.args file_map = { layer_file_path(ctx, f): f for f in unavailable + [classpath_file] } return _container.image.implementation( ctx, # We use all absolute paths. directory = "/", file_map = file_map, entrypoint = entrypoint, ) jar_app_layer = rule( attrs = dict(_container.image.attrs.items() + { # The binary target for which we are synthesizing an image. "binary": attr.label(mandatory = True), # The full list of dependencies that have their own layers # factored into our base. "jar_layers": attr.label_list(), # The rest of the dependencies. "deps": attr.label_list(), "runtime_deps": attr.label_list(), "jvm_flags": attr.string_list(), # The base image on which to overlay the dependency layers. "base": attr.label(mandatory = True), # The main class to invoke on startup. "main_class": attr.string(mandatory = True), # Whether to lay out each dependency in a manner that is agnostic # of the binary in which it is participating. This can increase # sharing of the dependency's layer across images, but requires a # symlink forest in the app layers. "agnostic_dep_layout": attr.bool(default = True), # Whether the classpath should be passed as a file. "_classpath_as_file": attr.bool(default = False), # Override the defaults. "directory": attr.string(default = "/app"), # https://github.com/bazelbuild/bazel/issues/2176 "data_path": attr.string(default = "."), "legacy_run_behavior": attr.bool(default = False), }.items()), executable = True, outputs = _container.image.outputs, implementation = _jar_app_layer_impl, ) def java_image( name, base = None, main_class = None, deps = [], runtime_deps = [], layers = [], jvm_flags = [], **kwargs): """Builds a container image overlaying the java_binary. Args: layers: Augments "deps" with dependencies that should be put into their own layers. **kwargs: See java_binary. """ binary_name = name + ".binary" native.java_binary( name = binary_name, main_class = main_class, # If the rule is turning a JAR built with java_library into # a binary, then it will appear in runtime_deps. We are # not allowed to pass deps (even []) if there is no srcs # kwarg. deps = (deps + layers) or None, runtime_deps = runtime_deps, jvm_flags = jvm_flags, **kwargs ) base = base or DEFAULT_JAVA_BASE for index, dep in enumerate(layers): this_name = "%s.%d" % (name, index) jar_dep_layer(name = this_name, base = base, dep = dep) base = this_name visibility = kwargs.get("visibility", None) jar_app_layer( name = name, base = base, binary = binary_name, main_class = main_class, jvm_flags = jvm_flags, deps = deps, runtime_deps = runtime_deps, jar_layers = layers, visibility = visibility, args = kwargs.get("args"), ) def _war_dep_layer_impl(ctx): """Appends a layer for a single dependency's runfiles.""" # TODO(mattmoor): Today we run the risk of filenames colliding when # they get flattened. Instead of just flattening and using basename # we should use a file_map based scheme. return _container.image.implementation( ctx, files = java_files(ctx.attr.dep), ) _war_dep_layer = rule( attrs = dict(_container.image.attrs.items() + { # The base image on which to overlay the dependency layers. "base": attr.label(mandatory = True), # The dependency whose runfiles we're appending. "dep": attr.label(mandatory = True), # Whether to lay out each dependency in a manner that is agnostic # of the binary in which it is participating. This can increase # sharing of the dependency's layer across images, but requires a # symlink forest in the app layers. "agnostic_dep_layout": attr.bool(default = True), # Override the defaults. "directory": attr.string(default = "/jetty/webapps/ROOT/WEB-INF/lib"), # WE WANT PATHS FLATTENED # "data_path": attr.string(default = "."), }.items()), executable = True, outputs = _container.image.outputs, implementation = _war_dep_layer_impl, ) def _war_app_layer_impl(ctx): """Appends the app layer with all remaining runfiles.""" available = depset() for jar in ctx.attr.jar_layers: available += java_files(jar) # This is based on rules_appengine's WAR rules. transitive_deps = depset() transitive_deps += java_files(ctx.attr.library) # TODO(mattmoor): Handle data files. # If we start putting libs in servlet-agnostic paths, # then consider adding symlinks here. files = [d for d in transitive_deps if d not in available] return _container.image.implementation(ctx, files = files) _war_app_layer = rule( attrs = dict(_container.image.attrs.items() + { # The library target for which we are synthesizing an image. "library": attr.label(mandatory = True), # The full list of dependencies that have their own layers # factored into our base. "jar_layers": attr.label_list(), # The base image on which to overlay the dependency layers. "base": attr.label(mandatory = True), "entrypoint": attr.string_list(default = []), # Whether to lay out each dependency in a manner that is agnostic # of the binary in which it is participating. This can increase # sharing of the dependency's layer across images, but requires a # symlink forest in the app layers. "agnostic_dep_layout": attr.bool(default = True), # Override the defaults. "directory": attr.string(default = "/jetty/webapps/ROOT/WEB-INF/lib"), # WE WANT PATHS FLATTENED # "data_path": attr.string(default = "."), "legacy_run_behavior": attr.bool(default = False), }.items()), executable = True, outputs = _container.image.outputs, implementation = _war_app_layer_impl, ) def war_image(name, base = None, deps = [], layers = [], **kwargs): """Builds a container image overlaying the java_library as an exploded WAR. TODO(mattmoor): For `bazel run` of this to be useful, we need to be able to ctrl-C it and have the container actually terminate. More information: https://github.com/bazelbuild/bazel/issues/3519 Args: layers: Augments "deps" with dependencies that should be put into their own layers. **kwargs: See java_library. """ library_name = name + ".library" native.java_library(name = library_name, deps = deps + layers, **kwargs) base = base or DEFAULT_JETTY_BASE for index, dep in enumerate(layers): this_name = "%s.%d" % (name, index) _war_dep_layer(name = this_name, base = base, dep = dep) base = this_name visibility = kwargs.get("visibility", None) tags = kwargs.get("tags", None) _war_app_layer( name = name, base = base, library = library_name, jar_layers = layers, visibility = visibility, tags = tags, )
# 字符串删除空白 str1 = " hello " print(str1) print(len(str1)) # 去除两端的空格 print(str1.strip()) print(len(str1.strip())) # 去除左侧的空格 print(str1.lstrip()) print(len(str1.lstrip())) # 去除右侧的空格 print(str1.rstrip()) print(len(str1.rstrip()))
try: # num = 10 / 0 number = int(input("Enter a number: ")) print(number) # catch specific errors except ZeroDivisionError as err: print(err) except ValueError: print("Invalid input")
class Deque: def add_first(self, value): ... def add_last(self, value): ... def delete_first(self): ... def delete_last(self): ... def first(self): ... def last(self): ... def is_empty(self): ... def __len__(self): ... def __str__(self): ...
# A string S consisting of N characters is considered to be properly nested if any of the following conditions is true: # S is empty; # S has the form "(U)" or "[U]" or "{U}" where U is a properly nested string; S has the form "VW" where V and W are properly nested strings. # For example, the string "{[()()]}" is properly nested but "([)()]" is not. # Write a function: # int solution(char *S); # that, given a string S consisting of N characters, returns 1 if S is properly nested and 0 otherwise. # For example, given S = "{[()()]}", the function should return 1 and given S = "([)()]", the function should return 0, as explained above. # Assume that: # N is an integer within the range [0..200,000]; # string S consists only of the following characters: "(", "{", "[", "]", "}" and/or ")". Complexity: # expected worst-case time complexity is O(N); # expected worst-case space complexity is O(N) (not counting the storage required for input arguments). def solution(s): sets = dict(zip('({[', ')}]')) if(not isinstance(s, str)): return "Invalid input" collector = [] for bracket in s: if(bracket in sets): collector.append(sets[bracket]) elif bracket not in(sets.values()): return "Invalid input" elif (bracket != collector.pop()): return False return not collector print(solution("()[]{}"))
class RedisBackend(object): def __init__(self, settings={}, *args, **kwargs): self.settings = settings @property def connection(self): # cached redis connection if not hasattr(self, '_connection'): self._connection = self.settings.get('redis.connector').get() return self._connection @property def channel(self): # Fanout channel if not hasattr(self, '_channel'): self._channel = self.connection.pubsub() return self._channel def subscribe(self, channels=[]): # Fanout subscriber for chan_id in channels: self.channel.subscribe(chan_id) def listen(self): # Fanout generator for m in self.channel.listen(): if m['type'] == 'message': yield m def send(self, channel_id, payload): # Fanout emitter return self.connection.publish(channel_id, payload) def listen_queue(self, queue_keys): # Message queue generator while 1: yield self.connection.blpop(queue_keys) def send_queue(self, queue_key, payload): return self.connection.rpush(payload)
""" 1. Write a Python program to reverse only the vowels of a given string. Sample Output: w3resuorce Python Perl ASU 2. Write a Python program to check whether a given integer is a palindrome or not. Note: An integer is a palindrome when it reads the same backward as forward. Negative numbers are not palindromic. Sample Output: False True False 3. Write a Python program to remove the duplicate elements of a given array of numbers such that each element appear only once and return the new length of the given array. Sample Output: 5 4 4. Write a Python program to calculate the maximum profit from selling and buying values of stock. An array of numbers represent the stock prices in chronological order. For example, given [8, 10, 7, 5, 7, 15], the function will return 10, since the buying value of the stock is 5 dollars and sell value is 15 dollars. Sample Output: 10 7 0 5. Write a Python program to remove all instances of a given value from a given array of integers and find the length of the new array. For example, given [8, 10, 7, 5, 7, 15], the function will return 10, since the buying value of the stock is 5 dollars and sell value is 15 dollars. Sample Output: 6 0 5 0 6. Write a Python program to find the starting and ending position of a given value in a given array of integers, sorted in ascending order. If the target is not found in the array, return [0, 0]. Input: [5, 7, 7, 8, 8, 8] target value = 8 Output: [0, 5] Input: [1, 3, 6, 9, 13, 14] target value = 4 Output: [0, 0] Sample Output: [0, 5] [0, 0] 7. The price of a given stock on each day is stored in an array. Write a Python program to find the maximum profit in one transaction i.e., buy one and sell one share of the stock from the given price value of the said array. You cannot sell a stock before you buy one. Input (Stock price of each day): [224, 236, 247, 258, 259, 225] Output: 35 Explanation: 236 - 224 = 12 247 - 224 = 23 258 - 224 = 34 259 - 224 = 35 225 - 224 = 1 247 - 236 = 11 258 - 236 = 22 259 - 236 = 23 225 - 236 = -11 258 - 247 = 11 259 - 247 = 12 225 - 247 = -22 259 - 258 = 1 225 - 258 = -33 225 - 259 = -34 8. Write a Python program to print a given N by M matrix of numbers line by line in forward > backwards > forward >... order. Input matrix: [[1, 2, 3,4], [5, 6, 7, 8], [0, 6, 2, 8], [2, 3, 0, 2]] Output: 1 2 3 4 8 7 6 5 0 6 2 8 2 0 3 2 9. Write a Python program to compute the largest product of three integers from a given list of integers. Sample Output: 4000 8 120 10. Write a Python program to find the first missing positive integer that does not exist in a given list. """
# CHECK-TREE: { const <- \x -> \y -> x; y <- const #true #true; z <- const #false #false; #record { const: const, y : y, z: z, }} const = lambda x, y: x y = const(True, True) z = const(False, False)
_base_ = '../faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py' model = dict( backbone=dict( num_stages=4, #frozen_stages=4 ), roi_head=dict( bbox_head=dict( num_classes=3 ) ) ) dataset_type = 'COCODataset' classes = ('luchs', 'rotfuchs', 'wolf') data = dict( train=dict( img_prefix='raubtierv2a/train/', classes=classes, ann_file='raubtierv2a/train/_annotations.coco.json'), val=dict( img_prefix='raubtierv2a/valid/', classes=classes, ann_file='raubtierv2a/valid/_annotations.coco.json'), test=dict( img_prefix='raubtierv2a/test/', classes=classes, ann_file='raubtierv2a/test/_annotations.coco.json')) #optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) #original (8x2=16) optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001) #(4x2=8) 4 GPUs #optimizer = dict(type='SGD', lr=0.0025, momentum=0.9, weight_decay=0.0001) #(1x2=2) total_epochs=24 evaluation = dict(classwise=True, interval=1, metric='bbox') work_dir = '/media/storage1/projects/WilLiCam/checkpoint_workdir/raubtierv2a/faster_rcnn_x101_64x4d_fpn_1x_raubtierv2a_nofreeze_4gpu' #http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco/faster_rcnn_x101_64x4d_fpn_1x_coco_20200204-833ee192.pth load_from = 'checkpoints/faster_rcnn_x101_64x4d_fpn_1x_coco_20200204-833ee192.pth'
h = int(input()) i = 1 a = 1 b = 1 c = 1 while h >= a: a = 2 ** i i += 1 s = 0 t = True for j in range(1, i-1): c += 2 ** j print(c)
class ArmorVisitor: def __init__(self, num_pages, first_page_col_start, first_page_row_start, last_page_row_start, last_page_col_end, last_page_row_end, num_col_page=5, num_row_page=3): self.num_pages = num_pages self.first_page_col_start = first_page_col_start self.first_page_row_start = first_page_row_start self.last_page_row_start = last_page_row_start self.last_page_col_end = last_page_col_end self.last_page_row_end = last_page_row_end self.num_col_page = num_col_page self.num_row_page = num_row_page def iterate(self, callback): for page_num in range(1, self.num_pages + 1): page = self.create_page(page_num) i = 0 for coord in page: callback(coord, page_num, i) i += 1 def create_page(self, page_num): if page_num == 1: last_col = self.num_col_page if self.num_pages > 1 else self.last_page_col_end last_row = self.num_row_page if self.num_pages > 1 else self.last_page_row_end page = Page(self.first_page_col_start, self.first_page_row_start, last_col, last_row, self.num_col_page) elif page_num == self.num_pages: page = Page(1, self.last_page_row_start, self.last_page_col_end, self.last_page_row_end, self.num_col_page) else: page = Page(1, 1, self.num_col_page, self.num_row_page, self.num_col_page) return page class Page: def __init__(self, start_col, start_row, last_col, last_row, num_col_page=5): self.start_col = start_col self.start_row = start_row self.last_col = last_col self.last_row = last_row self.num_col_page = num_col_page def __iter__(self): self.cur_row = self.start_row self.cur_col = self.start_col return self def __next__(self): position = (self.cur_row, self.cur_col) if self.cur_row > self.last_row or (self.cur_col > self.last_col and self.cur_row == self.last_row): raise StopIteration elif self.cur_col == self.num_col_page: self.cur_col = 1 self.cur_row += 1 else: self.cur_col += 1 return position
# # PySNMP MIB module InternetThruway-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/InternetThruway-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:58:27 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") ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, ObjectIdentity, Counter64, Gauge32, NotificationType, Bits, NotificationType, MibIdentifier, TimeTicks, enterprises, ModuleIdentity, iso, Integer32, Unsigned32, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "ObjectIdentity", "Counter64", "Gauge32", "NotificationType", "Bits", "NotificationType", "MibIdentifier", "TimeTicks", "enterprises", "ModuleIdentity", "iso", "Integer32", "Unsigned32", "Counter32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") nortel = MibIdentifier((1, 3, 6, 1, 4, 1, 562)) dialaccess = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14)) csg = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2)) system = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 1)) components = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 2)) traps = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 3)) alarms = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 4)) ncServer = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 5)) ss7 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 6)) omData = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7)) disk = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1)) linkOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1)) maintenanceOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 2)) callOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3)) trunkGroupOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4)) phoneNumberOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5)) systemOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6)) nasOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7)) class TimeString(DisplayString): pass partitionTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1), ) if mibBuilder.loadTexts: partitionTable.setStatus('mandatory') if mibBuilder.loadTexts: partitionTable.setDescription('The PartitionTable contains information about each disk partition on the CSG') partitionTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "partitionIndex")) if mibBuilder.loadTexts: partitionTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: partitionTableEntry.setDescription('An entry in the PartitionTable. Indexed by partitionIndex') class PartitionSpaceStatus(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("spaceAlarmOff", 1), ("spaceAlarmOn", 2)) partitionIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))) if mibBuilder.loadTexts: partitionIndex.setStatus('mandatory') if mibBuilder.loadTexts: partitionIndex.setDescription('Identifies partition number.') partitionName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionName.setStatus('mandatory') if mibBuilder.loadTexts: partitionName.setDescription('Identifies partition name.') partitionPercentFull = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionPercentFull.setStatus('mandatory') if mibBuilder.loadTexts: partitionPercentFull.setDescription('Indicates (in Percent) how full the disk is.') partitionMegsFree = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionMegsFree.setStatus('mandatory') if mibBuilder.loadTexts: partitionMegsFree.setDescription('Indicates how many Megabytes are free on the partition.') partitionSpaceStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 5), PartitionSpaceStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionSpaceStatus.setStatus('mandatory') if mibBuilder.loadTexts: partitionSpaceStatus.setDescription('Indicates if there is currently a space alarm in progress.') partitionSpaceKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionSpaceKey.setStatus('mandatory') if mibBuilder.loadTexts: partitionSpaceKey.setDescription('Unique indicator for the partition space alarm.') partitionSpaceTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 7), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionSpaceTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: partitionSpaceTimeStamp.setDescription('Indicates the time of the last partitionSpaceStatus transition.') componentTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10), ) if mibBuilder.loadTexts: componentTable.setStatus('mandatory') if mibBuilder.loadTexts: componentTable.setDescription('The ComponentTable contains information about all the Components that should be running on the CSG.') componentTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1), ).setIndexNames((0, "InternetThruway-MIB", "componentIndex")) if mibBuilder.loadTexts: componentTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: componentTableEntry.setDescription('An entry in the ComponentTable. componentTable entries are indexed by componentIndex, which is an integer. ') class ComponentIndex(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9)) namedValues = NamedValues(("oolsproxy", 1), ("climan", 2), ("arm", 3), ("sem", 4), ("hgm", 5), ("survman", 6), ("ss7scm", 7), ("ss7opm", 8), ("ss7cheni", 9)) class ComponentSysmanState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("inProvisionedState", 1), ("notInProvisionedState", 2), ("unknown", 3)) componentIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 1), ComponentIndex()) if mibBuilder.loadTexts: componentIndex.setStatus('mandatory') if mibBuilder.loadTexts: componentIndex.setDescription('Identifies the component entry with an enumerated list.') componentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentName.setStatus('mandatory') if mibBuilder.loadTexts: componentName.setDescription('Identifies component name.') compSecsInCurrentState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compSecsInCurrentState.setStatus('mandatory') if mibBuilder.loadTexts: compSecsInCurrentState.setDescription('Indicates how many seconds a component has been running in its current state. ') compProvStateStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 4), ComponentSysmanState()).setMaxAccess("readonly") if mibBuilder.loadTexts: compProvStateStatus.setStatus('mandatory') if mibBuilder.loadTexts: compProvStateStatus.setDescription('Indicates the current state of the particular CSG component. The states are one of the following: inProvisionedState(1), notInProvisionedState(2), unknown(3)') compProvStateKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compProvStateKey.setStatus('mandatory') if mibBuilder.loadTexts: compProvStateKey.setDescription('Unique indicator for the prov state alarm.') compProvStateTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 6), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: compProvStateTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: compProvStateTimeStamp.setDescription('Indicates the time of the last state transition.') compDebugStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compDebugStatus.setStatus('mandatory') if mibBuilder.loadTexts: compDebugStatus.setDescription('Shows if the component is running with debug on.') compDebugKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compDebugKey.setStatus('mandatory') if mibBuilder.loadTexts: compDebugKey.setDescription('Unique indicator for the debug state.') compDebugTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 9), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: compDebugTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: compDebugTimeStamp.setDescription('Indicates the time of the last debug transition.') compRestartStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compRestartStatus.setStatus('mandatory') if mibBuilder.loadTexts: compRestartStatus.setDescription('Shows if the component has had multiple restarts recently.') compRestartKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compRestartKey.setStatus('mandatory') if mibBuilder.loadTexts: compRestartKey.setDescription('Unique indicator for the multi-restart of components.') compRestartTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 12), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: compRestartTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: compRestartTimeStamp.setDescription('Indicates the time of the last restart flagging.') linksetTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1), ) if mibBuilder.loadTexts: linksetTable.setStatus('mandatory') if mibBuilder.loadTexts: linksetTable.setDescription('The linksetTable contains information about all the linksets on the CSG.') linksetTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "linksetIndex")) if mibBuilder.loadTexts: linksetTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: linksetTableEntry.setDescription('An entry in the linksetTable. Entries in the linkset table are indexed by linksetIndex, which is an integer.') class LinksetState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("available", 1), ("unAvailable", 2)) linksetIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: linksetIndex.setStatus('mandatory') if mibBuilder.loadTexts: linksetIndex.setDescription("Identifies the n'th position in the table.") linksetId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linksetId.setStatus('mandatory') if mibBuilder.loadTexts: linksetId.setDescription('The id of the linkset to be used as index.') linksetAdjPointcode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linksetAdjPointcode.setStatus('mandatory') if mibBuilder.loadTexts: linksetAdjPointcode.setDescription('The adjacent pointcode of the linkset.') linksetState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1, 1, 4), LinksetState()).setMaxAccess("readonly") if mibBuilder.loadTexts: linksetState.setStatus('mandatory') if mibBuilder.loadTexts: linksetState.setDescription('The state of the linkset.') linkTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2), ) if mibBuilder.loadTexts: linkTable.setStatus('mandatory') if mibBuilder.loadTexts: linkTable.setDescription('The linkTable contains information about the links in a given linkset on the CSG.') linkTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1), ).setIndexNames((0, "InternetThruway-MIB", "linksetIndex"), (0, "InternetThruway-MIB", "linkIndex")) if mibBuilder.loadTexts: linkTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: linkTableEntry.setDescription('An entry in the linkTable. Entries in the link table table are indexed by linksetIndex and linkIndex, which are both integers.') class LinkState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("available", 1), ("unAvailable", 2)) class LinkInhibitionState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("unInhibited", 1), ("localInhibited", 2), ("remoteInhibited", 3), ("localRemoteInhibited", 4)) class LinkCongestionState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("notCongested", 1), ("congested", 2)) class LinkAlignmentState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("aligned", 1), ("notAligned", 2)) linkIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 1), Integer32()) if mibBuilder.loadTexts: linkIndex.setStatus('mandatory') if mibBuilder.loadTexts: linkIndex.setDescription("Identifies the n'th position in the table.") linkId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkId.setStatus('mandatory') if mibBuilder.loadTexts: linkId.setDescription('The id of the link.') linkHostname = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkHostname.setStatus('mandatory') if mibBuilder.loadTexts: linkHostname.setDescription('The hostname of the CSG to which this link is attached.') linkCardDeviceName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkCardDeviceName.setStatus('mandatory') if mibBuilder.loadTexts: linkCardDeviceName.setDescription('The device name of the card upon which this link is hosted.') linkState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 5), LinkState()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkState.setStatus('mandatory') if mibBuilder.loadTexts: linkState.setDescription('The state of the link.') linkInhibitionState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 6), LinkInhibitionState()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkInhibitionState.setStatus('mandatory') if mibBuilder.loadTexts: linkInhibitionState.setDescription('The inhibition status of the link.') linkCongestionState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 7), LinkCongestionState()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkCongestionState.setStatus('mandatory') if mibBuilder.loadTexts: linkCongestionState.setDescription('The congestion status of the link.') linkAlignmentState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 8), LinkAlignmentState()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignmentState.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignmentState.setDescription('The alignment status of the link.') linkNumMSUReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumMSUReceived.setStatus('mandatory') if mibBuilder.loadTexts: linkNumMSUReceived.setDescription("This object supplies the number of MSU's received by the link.") linkNumMSUDiscarded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumMSUDiscarded.setStatus('mandatory') if mibBuilder.loadTexts: linkNumMSUDiscarded.setDescription("This object supplies the number of received MSU's discarded by the link.") linkNumMSUTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumMSUTransmitted.setStatus('mandatory') if mibBuilder.loadTexts: linkNumMSUTransmitted.setDescription("This object supplies the number of MSU's transmitted by the link.") linkNumSIFReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumSIFReceived.setStatus('mandatory') if mibBuilder.loadTexts: linkNumSIFReceived.setDescription('This object supplies the number of SIF and SIO octets received by the link.') linkNumSIFTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumSIFTransmitted.setStatus('mandatory') if mibBuilder.loadTexts: linkNumSIFTransmitted.setDescription('This object supplies the number of SIF and SIO octects transmitted by the link.') linkNumAutoChangeovers = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumAutoChangeovers.setStatus('mandatory') if mibBuilder.loadTexts: linkNumAutoChangeovers.setDescription('This object supplies the number of automatic changeovers undergone by the link.') linkNumUnexpectedMsgs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumUnexpectedMsgs.setStatus('mandatory') if mibBuilder.loadTexts: linkNumUnexpectedMsgs.setDescription('This object supplies the number of unexpected messages received by the link.') routeTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3), ) if mibBuilder.loadTexts: routeTable.setStatus('mandatory') if mibBuilder.loadTexts: routeTable.setDescription('The routeTable contains information about the routes provisioned in the CSG complex.') routeTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1), ).setIndexNames((0, "InternetThruway-MIB", "routeIndex")) if mibBuilder.loadTexts: routeTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: routeTableEntry.setDescription('An entry in the routeTable. Entries in the route table are indexed by routeIndex, which is an integer.') class RouteState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("accessible", 1), ("inaccessible", 2), ("restricted", 3)) routeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 1), Integer32()) if mibBuilder.loadTexts: routeIndex.setStatus('mandatory') if mibBuilder.loadTexts: routeIndex.setDescription("Identifies the n'th position in the table.") routeId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: routeId.setStatus('mandatory') if mibBuilder.loadTexts: routeId.setDescription('The unique identifier of the route.') routeDestPointCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: routeDestPointCode.setStatus('mandatory') if mibBuilder.loadTexts: routeDestPointCode.setDescription('The destination point code associated with this route.') routeState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 4), RouteState()).setMaxAccess("readonly") if mibBuilder.loadTexts: routeState.setStatus('mandatory') if mibBuilder.loadTexts: routeState.setDescription('The current state of the route.') routeRank = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: routeRank.setStatus('mandatory') if mibBuilder.loadTexts: routeRank.setDescription('Rank assigned to this route.') routeLinksetId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: routeLinksetId.setStatus('mandatory') if mibBuilder.loadTexts: routeLinksetId.setDescription('The linkset associated with this route.') destinationTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4), ) if mibBuilder.loadTexts: destinationTable.setStatus('mandatory') if mibBuilder.loadTexts: destinationTable.setDescription('The destinationTable contains information about the destinations provisioned in the CSG complex.') destinationTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4, 1), ).setIndexNames((0, "InternetThruway-MIB", "destIndex")) if mibBuilder.loadTexts: destinationTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: destinationTableEntry.setDescription('An entry in the destinationTable. Entries in the destination table are indexed by destIndex, which is an integer.') class DestinationState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("accessible", 1), ("inaccessible", 2), ("restricted", 3)) destIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4, 1, 1), Integer32()) if mibBuilder.loadTexts: destIndex.setStatus('mandatory') if mibBuilder.loadTexts: destIndex.setDescription("Identifies the n'th position in the table.") destPointCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destPointCode.setStatus('mandatory') if mibBuilder.loadTexts: destPointCode.setDescription('The destination point code of this destination.') destState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4, 1, 3), DestinationState()).setMaxAccess("readonly") if mibBuilder.loadTexts: destState.setStatus('mandatory') if mibBuilder.loadTexts: destState.setDescription('The current state of the destination.') destRuleId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: destRuleId.setStatus('mandatory') if mibBuilder.loadTexts: destRuleId.setDescription('Rule Identifier (for the routing table to be used) for this destination.') ncServerId = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncServerId.setStatus('mandatory') if mibBuilder.loadTexts: ncServerId.setDescription(' The ServerId attribute value of the node.') ncServerName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncServerName.setStatus('mandatory') if mibBuilder.loadTexts: ncServerName.setDescription(' The ServerName attribute value of the node.') ncHostName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncHostName.setStatus('mandatory') if mibBuilder.loadTexts: ncHostName.setDescription(' The HostName attribute value of the node.') ncEthernetName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncEthernetName.setStatus('mandatory') if mibBuilder.loadTexts: ncEthernetName.setDescription(' The EthernetName attribute value of the node.') ncEthernetIP = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 6), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncEthernetIP.setStatus('mandatory') if mibBuilder.loadTexts: ncEthernetIP.setDescription(' The EthernetIP attribute value of the node.') ncClusterName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncClusterName.setStatus('mandatory') if mibBuilder.loadTexts: ncClusterName.setDescription(' The ClusterName attribute value of the node.') ncClusterIP = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 8), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncClusterIP.setStatus('mandatory') if mibBuilder.loadTexts: ncClusterIP.setDescription(' The ClusterIP attribute value of the node.') ncOperationalState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncOperationalState.setStatus('mandatory') if mibBuilder.loadTexts: ncOperationalState.setDescription(' The OperationalState of the node. Possible values are: UNKNOWN, ENABLED, ENABLED_NETDSC, ENABLED_NETPAR, DISABLED ') ncStandbyState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 10), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncStandbyState.setStatus('mandatory') if mibBuilder.loadTexts: ncStandbyState.setDescription(' The StandbyState attribute value of the node. Possible values are: UNKNOWN, HOT_STANDBY, COLD_STANDBY, WARM_STANDBY, PROVIDING_SERVICE ') ncAvailabilityState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 11), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncAvailabilityState.setStatus('mandatory') if mibBuilder.loadTexts: ncAvailabilityState.setDescription(' The AvailabilityState attribute value of the node. Possible values are: UNKNOWN, AVAILABLE, DEGRADED, OFFLINE ') ncSoftwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 12), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncSoftwareVersion.setStatus('mandatory') if mibBuilder.loadTexts: ncSoftwareVersion.setDescription(' The SoftwareVersion attribute value of the node.') class UpgradeInProgress(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 2) ncUpgradeInProgress = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 13), UpgradeInProgress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncUpgradeInProgress.setStatus('mandatory') if mibBuilder.loadTexts: ncUpgradeInProgress.setDescription(' The UpgradeInProgress attribute value of the node. Possible values are: 0 = UNKNOWN, 1 = ACTIVE, 2 = INACTIVE ') hgAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10), ) if mibBuilder.loadTexts: hgAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: hgAlarmTable.setDescription('The HgAlarmTable contains information about all the current HG alarms') hgAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1), ).setIndexNames((0, "InternetThruway-MIB", "hgIndex")) if mibBuilder.loadTexts: hgAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: hgAlarmTableEntry.setDescription('An entry in the HgAlarmTable. HgAlarmTable entries are indexed by componentIndex, which is an integer.') hgIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1, 1), Integer32()) if mibBuilder.loadTexts: hgIndex.setStatus('mandatory') if mibBuilder.loadTexts: hgIndex.setDescription("Identifies the n'th position in the table.") hgName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hgName.setStatus('mandatory') if mibBuilder.loadTexts: hgName.setDescription('The Home gateway to be used as index') hgKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hgKey.setStatus('mandatory') if mibBuilder.loadTexts: hgKey.setDescription('Unique identifier for the HgFailure alarm ') hgAlarmTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1, 4), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hgAlarmTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: hgAlarmTimeStamp.setDescription('Indicates the time of the HG Alarm.') hgIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1, 5), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hgIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: hgIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') nasAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11), ) if mibBuilder.loadTexts: nasAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: nasAlarmTable.setDescription('The NasAlarmTable contains information about all the current NAS alarms') nasAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1), ).setIndexNames((0, "InternetThruway-MIB", "nasIndex")) if mibBuilder.loadTexts: nasAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: nasAlarmTableEntry.setDescription('An entry in the NasAlarmTable. NasAlarmTable entries are indexed by nasIndex, which is an integer.') nasIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 1), Integer32()) if mibBuilder.loadTexts: nasIndex.setStatus('mandatory') if mibBuilder.loadTexts: nasIndex.setDescription("Identifies the n'th position in the table.") nasName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasName.setStatus('mandatory') if mibBuilder.loadTexts: nasName.setDescription('The NAS Name') nasKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasKey.setStatus('mandatory') if mibBuilder.loadTexts: nasKey.setDescription('Unique identifier for the NAS Failure alarm ') nasAlarmTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 4), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasAlarmTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: nasAlarmTimeStamp.setDescription('Indicates the time of the NAS Alarm.') nasIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 5), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: nasIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') nasCmplxName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCmplxName.setStatus('mandatory') if mibBuilder.loadTexts: nasCmplxName.setDescription(' The complex which this alarm is raised against.') ss7LinkFailureAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12), ) if mibBuilder.loadTexts: ss7LinkFailureAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkFailureAlarmTable.setDescription('The SS7LinkFailureAlarmTable contains alarms for SS7 link failures.') ss7LinkFailureAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1), ).setIndexNames((0, "InternetThruway-MIB", "lfIndex")) if mibBuilder.loadTexts: ss7LinkFailureAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkFailureAlarmTableEntry.setDescription('This object defines a row within the SS7 Link Failure Alarm Table. A row can be uniquely identified with the row index.') lfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 1), Integer32()) if mibBuilder.loadTexts: lfIndex.setStatus('mandatory') if mibBuilder.loadTexts: lfIndex.setDescription('Identifies the row number in the table.') lfKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfKey.setStatus('mandatory') if mibBuilder.loadTexts: lfKey.setDescription('Unique identifier for the alarm.') lfIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: lfIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') lfLinkCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfLinkCode.setStatus('mandatory') if mibBuilder.loadTexts: lfLinkCode.setDescription('This object identifies the signalling link code (SLC) of the failed link.') lfTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 6), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: lfTimeStamp.setDescription('Indicates the time of the alarm.') lfName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfName.setStatus('mandatory') if mibBuilder.loadTexts: lfName.setDescription('Indicates the configured name for the machine which sent the alarm.') lfCardId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfCardId.setStatus('mandatory') if mibBuilder.loadTexts: lfCardId.setDescription('This object identifies the device that hosts the failed link. It provides a physical description of the device, as well as its slot number.') lfLinkSet = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfLinkSet.setStatus('mandatory') if mibBuilder.loadTexts: lfLinkSet.setDescription('This object identifies the linkset associated with the link via its adjacent point code.') ss7LinkCongestionAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13), ) if mibBuilder.loadTexts: ss7LinkCongestionAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkCongestionAlarmTable.setDescription('The SS7LinkCongestionAlarmTable contains alarms to indicate congestion on an SS7 link.') ss7LinkCongestionAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1), ).setIndexNames((0, "InternetThruway-MIB", "lcIndex")) if mibBuilder.loadTexts: ss7LinkCongestionAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkCongestionAlarmTableEntry.setDescription('This object defines a row within the SS7 Link Congestion Alarm Table. A row can be uniquely identified with the row index.') lcIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 1), Integer32()) if mibBuilder.loadTexts: lcIndex.setStatus('mandatory') if mibBuilder.loadTexts: lcIndex.setDescription('Identifies the row number in the table.') lcKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcKey.setStatus('mandatory') if mibBuilder.loadTexts: lcKey.setDescription('Unique identifier for the alarm.') lcIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: lcIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') lcLinkCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcLinkCode.setStatus('mandatory') if mibBuilder.loadTexts: lcLinkCode.setDescription('This object identifies the signalling link code (SLC) of the affected link.') lcTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 5), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: lcTimeStamp.setDescription('Indicates the time of the alarm.') lcName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcName.setStatus('mandatory') if mibBuilder.loadTexts: lcName.setDescription('Indicates the configured name for the machine which sent the alarm.') lcCardId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcCardId.setStatus('mandatory') if mibBuilder.loadTexts: lcCardId.setDescription('This object identifies the device that hosts the failed link. It provides a physical description of the device, as well as its slot number.') lcLinkSet = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcLinkSet.setStatus('mandatory') if mibBuilder.loadTexts: lcLinkSet.setDescription('This object identifies the linkset associated with the link via its adjacent point code.') ss7ISUPFailureAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14), ) if mibBuilder.loadTexts: ss7ISUPFailureAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7ISUPFailureAlarmTable.setDescription('The SS7ISUPFailureAlarmTable contains alarms for SS7 ISUP protocol stack failures.') ss7ISUPFailureAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1), ).setIndexNames((0, "InternetThruway-MIB", "ifIndex")) if mibBuilder.loadTexts: ss7ISUPFailureAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7ISUPFailureAlarmTableEntry.setDescription('This object defines a row within the SS7 ISUP Failure Alarm Table. A row can be uniquely identified with the row index.') ifIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1, 1), Integer32()) if mibBuilder.loadTexts: ifIndex.setStatus('mandatory') if mibBuilder.loadTexts: ifIndex.setDescription('Identifies the row number in the table.') ifKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifKey.setStatus('mandatory') if mibBuilder.loadTexts: ifKey.setDescription('Unique identifier for the alarm.') ifIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: ifIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') ifTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1, 4), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: ifTimeStamp.setDescription('Indicates the time of the alarm.') ifName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifName.setStatus('mandatory') if mibBuilder.loadTexts: ifName.setDescription('Indicates the configured name for the machine which sent the alarm.') ss7ISUPCongestionAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15), ) if mibBuilder.loadTexts: ss7ISUPCongestionAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7ISUPCongestionAlarmTable.setDescription('The SS7ISUPCongestionAlarmTable contains alarms to indicate congestion with an ISUP protocol stack.') ss7ISUPCongestionAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1), ).setIndexNames((0, "InternetThruway-MIB", "icIndex")) if mibBuilder.loadTexts: ss7ISUPCongestionAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7ISUPCongestionAlarmTableEntry.setDescription('This object defines a row within the SS7 ISUP Congestion Alarm Table. A row can be uniquely identified with the row index.') icIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 1), Integer32()) if mibBuilder.loadTexts: icIndex.setStatus('mandatory') if mibBuilder.loadTexts: icIndex.setDescription('Identifies the row number in the table.') icKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icKey.setStatus('mandatory') if mibBuilder.loadTexts: icKey.setDescription('Unique identifier for the alarm.') icIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: icIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: icIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') icCongestionLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icCongestionLevel.setStatus('mandatory') if mibBuilder.loadTexts: icCongestionLevel.setDescription('This object indicates the congestion level with an ISUP protocol stack. Possible congestion levels are: (0) Normal (1) Congestion ') icTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 5), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: icTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: icTimeStamp.setDescription('Indicates the time of the alarm.') icName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: icName.setStatus('mandatory') if mibBuilder.loadTexts: icName.setDescription('Indicates the configured name for the machine which sent the alarm.') ss7MTP3CongestionAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16), ) if mibBuilder.loadTexts: ss7MTP3CongestionAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7MTP3CongestionAlarmTable.setDescription('The SS7MTP3CongestionAlarmTable contains alarms to indicate congestion on an MTP3 link.') ss7MTP3CongestionAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1), ).setIndexNames((0, "InternetThruway-MIB", "mtp3Index")) if mibBuilder.loadTexts: ss7MTP3CongestionAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7MTP3CongestionAlarmTableEntry.setDescription('This object defines a row within the SS7 MTP3 Congestion Alarm Table. A row can be uniquely identified with the row index.') mtp3Index = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 1), Integer32()) if mibBuilder.loadTexts: mtp3Index.setStatus('mandatory') if mibBuilder.loadTexts: mtp3Index.setDescription('Identifies the row number in the table.') mtp3Key = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp3Key.setStatus('mandatory') if mibBuilder.loadTexts: mtp3Key.setDescription('Unique identifier for the alarm.') mtp3IPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp3IPAddress.setStatus('mandatory') if mibBuilder.loadTexts: mtp3IPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') mtp3CongestionLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp3CongestionLevel.setStatus('mandatory') if mibBuilder.loadTexts: mtp3CongestionLevel.setDescription('This object indicates the congestion level on a problem SS7 Link. Possible congestion values are: (0) Normal (1) Minor (2) Major (3) Critical ') mtp3TimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 5), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp3TimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: mtp3TimeStamp.setDescription('Indicates the time of the alarm.') mtp3Name = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp3Name.setStatus('mandatory') if mibBuilder.loadTexts: mtp3Name.setDescription('Represents the configured name of the machine which sent the alarm.') ss7MTP2TrunkFailureAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17), ) if mibBuilder.loadTexts: ss7MTP2TrunkFailureAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7MTP2TrunkFailureAlarmTable.setDescription('The SS7MTP2TrunkFailureAlarmTable contains alarms to indicate MTP2 trunk failures.') ss7MTP2TrunkFailureAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1), ).setIndexNames((0, "InternetThruway-MIB", "mtp2Index")) if mibBuilder.loadTexts: ss7MTP2TrunkFailureAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7MTP2TrunkFailureAlarmTableEntry.setDescription('This object defines a row within the SS7 MTP2 Failure Alarm Table. A row can be uniquely identified with the row index.') class MTP2AlarmConditionType(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6)) namedValues = NamedValues(("fasError", 1), ("carrierLost", 2), ("synchroLost", 3), ("aisRcv", 4), ("remoteAlarmRcv", 5), ("tooHighBer", 6)) mtp2Index = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 1), Integer32()) if mibBuilder.loadTexts: mtp2Index.setStatus('mandatory') if mibBuilder.loadTexts: mtp2Index.setDescription('Identifies the row number in the table.') mtp2Key = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2Key.setStatus('mandatory') if mibBuilder.loadTexts: mtp2Key.setDescription('Unique identifier for the alarm.') mtp2IPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2IPAddress.setStatus('mandatory') if mibBuilder.loadTexts: mtp2IPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') mtp2Name = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2Name.setStatus('mandatory') if mibBuilder.loadTexts: mtp2Name.setDescription('This object identifies the configured name of the machine which sent the alarm.') mtp2CardId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2CardId.setStatus('mandatory') if mibBuilder.loadTexts: mtp2CardId.setDescription('This object indicates the device upon which the affected trunk is hosted. The string contains a physical description of the device, as well as its slot number.') mtp2AlarmCondition = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 6), MTP2AlarmConditionType()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2AlarmCondition.setStatus('mandatory') if mibBuilder.loadTexts: mtp2AlarmCondition.setDescription('This object indicates which of the possible alarm conditions is in effect. Alarms are not nested: a new alarm is only reported if there is no current alarm condition.') mtp2TimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 7), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2TimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: mtp2TimeStamp.setDescription('Indicates the time of the alarm.') ss7LinksetFailureAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18), ) if mibBuilder.loadTexts: ss7LinksetFailureAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinksetFailureAlarmTable.setDescription('The SS7LinksetFailureAlarmTable contains alarms to indicate failure on an CSG linkset.') ss7LinksetFailureAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1), ).setIndexNames((0, "InternetThruway-MIB", "lsFailureIndex")) if mibBuilder.loadTexts: ss7LinksetFailureAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinksetFailureAlarmTableEntry.setDescription('This object defines a row within the SS7 Linkset Failure Alarm Table. A row can be uniquely identified with the row index.') lsFailureIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 1), Integer32()) if mibBuilder.loadTexts: lsFailureIndex.setStatus('mandatory') if mibBuilder.loadTexts: lsFailureIndex.setDescription('Identifies the row number in the table.') lsFailureKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsFailureKey.setStatus('mandatory') if mibBuilder.loadTexts: lsFailureKey.setDescription('Unique identifier for the alarm.') lsFailureIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsFailureIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: lsFailureIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') lsFailureName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsFailureName.setStatus('mandatory') if mibBuilder.loadTexts: lsFailureName.setDescription('Represents the configured name of the machine which sent the alarm.') lsFailurePointcode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsFailurePointcode.setStatus('mandatory') if mibBuilder.loadTexts: lsFailurePointcode.setDescription('This object indicates the pointcode associated with the linkset.') lsFailureTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 6), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsFailureTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: lsFailureTimeStamp.setDescription('Indicates the time of the alarm.') ss7DestinationInaccessibleAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19), ) if mibBuilder.loadTexts: ss7DestinationInaccessibleAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7DestinationInaccessibleAlarmTable.setDescription('The SS7DestinationAccessAlarmTable contains alarms which indicate inaccessible signalling destinations.') ss7DestinationInaccessibleAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1), ).setIndexNames((0, "InternetThruway-MIB", "destInaccessIndex")) if mibBuilder.loadTexts: ss7DestinationInaccessibleAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7DestinationInaccessibleAlarmTableEntry.setDescription('This object defines a row within the SS7 Destination Inaccessible Alarm Table. A row can be uniquely identified with the row index.') destInaccessIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 1), Integer32()) if mibBuilder.loadTexts: destInaccessIndex.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessIndex.setDescription('Identifies the row number in the table.') destInaccessKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: destInaccessKey.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessKey.setDescription('Unique identifier for the alarm.') destInaccessIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: destInaccessIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') destInaccessName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destInaccessName.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessName.setDescription('Represents the configured name of the machine which sent the alarm.') destInaccessPointcode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destInaccessPointcode.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessPointcode.setDescription('This object indicates the point code of the inaccessible signalling destination.') destInaccessTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 6), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destInaccessTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessTimeStamp.setDescription('Indicates the time of the alarm.') ss7DestinationCongestedAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20), ) if mibBuilder.loadTexts: ss7DestinationCongestedAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7DestinationCongestedAlarmTable.setDescription('The SS7DestinationCongestedAlarmTable contains alarms to indicate congestion on the given destination.') ss7DestinationCongestedAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1), ).setIndexNames((0, "InternetThruway-MIB", "destCongestIndex")) if mibBuilder.loadTexts: ss7DestinationCongestedAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7DestinationCongestedAlarmTableEntry.setDescription('This object defines a row within the SS7 Destination Congestion Table. A row can be uniquely identified with the row index.') destCongestIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 1), Integer32()) if mibBuilder.loadTexts: destCongestIndex.setStatus('mandatory') if mibBuilder.loadTexts: destCongestIndex.setDescription('Identifies the row number in the table.') destCongestKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestKey.setStatus('mandatory') if mibBuilder.loadTexts: destCongestKey.setDescription('Unique identifier for the alarm.') destCongestIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: destCongestIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') destCongestName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestName.setStatus('mandatory') if mibBuilder.loadTexts: destCongestName.setDescription('Represents the configured name of the machine which sent the alarm.') destCongestPointcode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestPointcode.setStatus('mandatory') if mibBuilder.loadTexts: destCongestPointcode.setDescription('This object indicates the pointcode of the congested destination.') destCongestCongestionLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestCongestionLevel.setStatus('mandatory') if mibBuilder.loadTexts: destCongestCongestionLevel.setDescription('This object indicates the congestion level on a problem SS7 pointcode. Possible congestion values are: (0) Normal (1) Minor (2) Major (3) Critical ') destCongestTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 7), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: destCongestTimeStamp.setDescription('Indicates the time of the alarm.') ss7LinkAlignmentAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21), ) if mibBuilder.loadTexts: ss7LinkAlignmentAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkAlignmentAlarmTable.setDescription('The SS7LinkAlignmentAlarmTable contains alarms to indicate congestion on the CSG.') ss7LinkAlignmentAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1), ).setIndexNames((0, "InternetThruway-MIB", "linkAlignIndex")) if mibBuilder.loadTexts: ss7LinkAlignmentAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkAlignmentAlarmTableEntry.setDescription('This object defines a row within the SS7 Link Alignment Alarm Table. A row can be uniquely identified with the row index.') linkAlignIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 1), Integer32()) if mibBuilder.loadTexts: linkAlignIndex.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignIndex.setDescription('Identifies the row number in the table.') linkAlignKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignKey.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignKey.setDescription('Unique identifier for the alarm.') linkAlignIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') linkAlignName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignName.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignName.setDescription('Represents the configured name of the machine which sent the alarm.') linkAlignLinkCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignLinkCode.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignLinkCode.setDescription('This object identifies the signalling link code (SLC) of the affected link.') linkAlignTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 6), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignTimeStamp.setDescription('Indicates the time of the alarm.') linkAlignCardId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignCardId.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignCardId.setDescription('This object identifies the device that hosts the failed link. It provides a physical description of the device, as well as its slot number.') linkAlignLinkSet = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignLinkSet.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignLinkSet.setDescription('This object identifies the linkset associated with the link via its adjacent point code.') csgComplexStateTrapInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22)) cplxName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxName.setStatus('mandatory') if mibBuilder.loadTexts: cplxName.setDescription('CLLI, A unique identifier of the CSG Complex.') cplxLocEthernetName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxLocEthernetName.setStatus('mandatory') if mibBuilder.loadTexts: cplxLocEthernetName.setDescription(' The EthernetName attribute value of the node.') cplxLocEthernetIP = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxLocEthernetIP.setStatus('mandatory') if mibBuilder.loadTexts: cplxLocEthernetIP.setDescription(' The EthernetIP attribute value of the node.') cplxLocOperationalState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxLocOperationalState.setStatus('mandatory') if mibBuilder.loadTexts: cplxLocOperationalState.setDescription(' The OperationalState of the node. Possible values are: UNKNOWN, ENABLED, ENABLED_NETDSC, ENABLED_NETPAR, DISABLED ') cplxLocStandbyState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxLocStandbyState.setStatus('mandatory') if mibBuilder.loadTexts: cplxLocStandbyState.setDescription(' The StandbyState attribute value of the node. Possible values are: UNKNOWN, HOT_STANDBY, COLD_STANDBY, WARM_STANDBY, PROVIDING_SERVICE ') cplxLocAvailabilityState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxLocAvailabilityState.setStatus('mandatory') if mibBuilder.loadTexts: cplxLocAvailabilityState.setDescription(' The AvailabilityState attribute value of the node. Possible values are: UNKNOWN, AVAILABLE, DEGRADED, OFFLINE ') cplxMateEthernetName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxMateEthernetName.setStatus('mandatory') if mibBuilder.loadTexts: cplxMateEthernetName.setDescription(' The EthernetName attribute value of the mate node.') cplxMateEthernetIP = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 8), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxMateEthernetIP.setStatus('mandatory') if mibBuilder.loadTexts: cplxMateEthernetIP.setDescription(' The EthernetIP attribute value of the mate node.') cplxMateOperationalState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxMateOperationalState.setStatus('mandatory') if mibBuilder.loadTexts: cplxMateOperationalState.setDescription(' The OperationalState of the mate node. Possible values are: UNKNOWN, ENABLED, ENABLED_NETDSC, ENABLED_NETPAR, DISABLED ') cplxMateStandbyState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 10), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxMateStandbyState.setStatus('mandatory') if mibBuilder.loadTexts: cplxMateStandbyState.setDescription(' The StandbyState attribute value of the mate node. Possible values are: UNKNOWN, HOT_STANDBY, COLD_STANDBY, WARM_STANDBY, PROVIDING_SERVICE ') cplxMateAvailabilityState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 11), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxMateAvailabilityState.setStatus('mandatory') if mibBuilder.loadTexts: cplxMateAvailabilityState.setDescription(' The AvailabilityState attribute value of the mate node. Possible values are: UNKNOWN, AVAILABLE, DEGRADED, OFFLINE ') cplxAlarmStatus = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 12), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxAlarmStatus.setStatus('mandatory') if mibBuilder.loadTexts: cplxAlarmStatus.setDescription('This object indicates the alarm status of the CSG Complex. Possible status are: NORMAL, MAJOR, CRITICAL ') lostServerAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1), ) if mibBuilder.loadTexts: lostServerAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: lostServerAlarmTable.setDescription('') lostServerAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "lsIndex")) if mibBuilder.loadTexts: lostServerAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: lostServerAlarmTableEntry.setDescription('This object defines a row within the Lost Server Alarm Table. A row can be uniquely identified with the row index.') lsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: lsIndex.setStatus('mandatory') if mibBuilder.loadTexts: lsIndex.setDescription('Identifies the row number in the table.') lsKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsKey.setStatus('mandatory') if mibBuilder.loadTexts: lsKey.setDescription('Unique identifier for the alarm.') lsIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: lsIPAddress.setDescription('This object identifies the IP Address of the machine which is lost.') lsName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsName.setStatus('mandatory') if mibBuilder.loadTexts: lsName.setDescription('The configured name associated with the IP Address of the machine which sent the alarm.') lsTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1, 5), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: lsTimeStamp.setDescription('Indicates the time of the alarm.') alarmMaskInt1 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 1), Gauge32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: alarmMaskInt1.setStatus('mandatory') if mibBuilder.loadTexts: alarmMaskInt1.setDescription('The value of this bit mask reflects the current filtering policy of CSG events and alarms. Management stations which wish to not receive certain events or alarm types from the CSG can modify this value as needed. Note, however, that changes in the filtration policy affect what is received by all management stations. Initially, the bit mask is set so that all bits are in a false state. Each bit in a true state reflects a currently filtered event, alarm, or alarm type. The actual bit position meanings are given below. Bit 0 is LSB. Bits 0 = Generic Normal Alarm 1 = Generic Warning Alarm 2 = Generic Minor Alarm 3 = Generic Major Alarm 4 = Generic Critical Alarm 5 = Partition Space Alarm 6 = Home Gateway Failure Alarm 7 = Component Not In Provisioned State Alarm 8 = Component Debug On Alarm 9 = Component Multiple Restart Alarm 10 = Component Restart Warning 11 = NAS Registration Failure Warning 12 = NAS Failure Alarm 13 = File Deletion Warning 14 = File Backup Warning 15 = Sysman Restart Warning 16 = File Access Warning 17 = Home Gateway/NAS Provisioning Mismatch Warning 18 = SS7 Link Failure Alarm 19 = SS7 Link Congestion Alarm 20 = ISUP Failure Alarm 21 = ISUP Congestion Alarm 22 = SS7 FEP Congestion Alarm 23 = SS7 BEP Congestion Alarm 24 = High Availability Peer Contact Lost Alarm 25 = SS7 MTP3 Congestion Alarm 26 = SS7 MTP2 Trunk Failure Alarm 27 = SS7 Linkset Failure Alarm 28 = SS7 Destination Inaccessible Alarm 29 = SS7 Destination Congested Alarm 30 = SS7 Link Alignment Failure Alarm ') alarmStatusInt1 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmStatusInt1.setStatus('mandatory') if mibBuilder.loadTexts: alarmStatusInt1.setDescription('The value of this bit mask indicates that current status of CSG component alarms. Each components is represented by a single bit within the range occupied by each component alarm type. Each bit in a true state reflects a currently raised alarm. The actual bit position meanings are given below. Bit 0 is the LSB. Bits 0-15 = Component Not In Provisioned State Alarm 16-31 = Component Multi Restart Alarm ') alarmStatusInt2 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmStatusInt2.setStatus('mandatory') if mibBuilder.loadTexts: alarmStatusInt2.setDescription('The value of this bit mask indicates the current status of active CSG alarms. Component-related alarms occupy a range of bits: each bit within that range represents the alarm status for a particular component. Each bit in a true state reflects a currently raised alarm. The actual bit position meanings are given below. Bit 0 is the LSB. Bits 0-15 = Component Debug On Alarm 16-23 = Partition Space Alarm 24 = Home Gateway Failure Alarm 25 = NAS Failure Alarm 26 = SS7 Link Failure Alarm 27 = SS7 Link Congestion Alarm 28 = ISUP Failure Alarm 29 = ISUP Congestion Alarm 30 = High Availability Peer Contact Lost Alarm 31 = SS7 MTP3 Congestion Alarm ') alarmStatusInt3 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmStatusInt3.setStatus('mandatory') if mibBuilder.loadTexts: alarmStatusInt3.setDescription('The value of this bit mask indicates the current status of active CSG alarms. Each bit in a true state reflects a currently raised alarm. The actual bit position meanings are given below. Bit 0 is the LSB. Bits 0 = SS7 MTP2 Trunk Failure Alarm 1 = SS7 Linkset Failure Alarm 2 = SS7 Destination Inaccessible Alarm 3 = SS7 Destination Congestion Alarm 4 = SS7 Link Alignment Failure Alarm 5 = CSG Complex Status Alarm 6 = External Ethernet Alarm ') alarmMaskInt2 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 5), Gauge32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: alarmMaskInt2.setStatus('mandatory') if mibBuilder.loadTexts: alarmMaskInt2.setDescription('The value of this bit mask reflects the current additional filtering policy of CSG events and alarms. Management stations which wish to not receive certain events or alarm types from the CSG can modify this value as needed. Note, however, that changes in the filtration policy affect what is received by all management stations. Initially, the bit mask is set so that all bits are in a false state. Each bit in a true state reflects a currently filtered event, alarm, or alarm type. The actual bit position meanings are given below. Bit 0 is LSB. Bits 0 = External Ethernet Alarm 1 = Cluster Information retrieval Alarm ') trapCompName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 1), DisplayString()) if mibBuilder.loadTexts: trapCompName.setStatus('mandatory') if mibBuilder.loadTexts: trapCompName.setDescription('OID for the Component name.') trapFileName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 2), DisplayString()) if mibBuilder.loadTexts: trapFileName.setStatus('mandatory') if mibBuilder.loadTexts: trapFileName.setDescription('OID for file Name.') trapDate = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 3), TimeString()) if mibBuilder.loadTexts: trapDate.setStatus('mandatory') if mibBuilder.loadTexts: trapDate.setDescription('OID for the date.') trapGenericStr1 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 4), DisplayString()) if mibBuilder.loadTexts: trapGenericStr1.setStatus('mandatory') if mibBuilder.loadTexts: trapGenericStr1.setDescription('OID for the generic data.') trapIdKey = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 5), Integer32()) if mibBuilder.loadTexts: trapIdKey.setStatus('mandatory') if mibBuilder.loadTexts: trapIdKey.setDescription('OID for the identification key.') trapIPAddress = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 6), IpAddress()) if mibBuilder.loadTexts: trapIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: trapIPAddress.setDescription('OID for IP address.') trapName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 7), DisplayString()) if mibBuilder.loadTexts: trapName.setStatus('mandatory') if mibBuilder.loadTexts: trapName.setDescription('OID for configured name associated with an IpAddress.') trapTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 8), DisplayString()) if mibBuilder.loadTexts: trapTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: trapTimeStamp.setDescription('Indicates the time at which the alarm occurred.') diskSpaceClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,1001)).setObjects(("InternetThruway-MIB", "partitionSpaceKey"), ("InternetThruway-MIB", "partitionIndex"), ("InternetThruway-MIB", "partitionName"), ("InternetThruway-MIB", "partitionPercentFull"), ("InternetThruway-MIB", "partitionSpaceTimeStamp")) if mibBuilder.loadTexts: diskSpaceClear.setDescription('The Trap generated when a disk partition has a space increase after a previously sent DiskSpaceAlarm.') diskSpaceAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,1004)).setObjects(("InternetThruway-MIB", "partitionSpaceKey"), ("InternetThruway-MIB", "partitionIndex"), ("InternetThruway-MIB", "partitionName"), ("InternetThruway-MIB", "partitionPercentFull"), ("InternetThruway-MIB", "partitionSpaceTimeStamp")) if mibBuilder.loadTexts: diskSpaceAlarm.setDescription('The Trap generated when a disk partition is running out of space provisioned state.') etherCardTrapClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,1011)) if mibBuilder.loadTexts: etherCardTrapClear.setDescription(' The Trap generated when the external ethernet card becomes available.') etherCardTrapMajor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,1014)) if mibBuilder.loadTexts: etherCardTrapMajor.setDescription('The Trap generated when the external ethernet card is down.') etherCardTrapCritical = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,1015)) if mibBuilder.loadTexts: etherCardTrapCritical.setDescription('The Trap generated when the external ethernet card is down.') compDebugOff = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2001)).setObjects(("InternetThruway-MIB", "compDebugKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compDebugTimeStamp")) if mibBuilder.loadTexts: compDebugOff.setDescription('The Trap generated when a Component turns off its debug info.') compDebugOn = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2002)).setObjects(("InternetThruway-MIB", "compDebugKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compDebugTimeStamp")) if mibBuilder.loadTexts: compDebugOn.setDescription('The Trap generated when a Component turns on its debug info.') compStateClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2011)).setObjects(("InternetThruway-MIB", "compProvStateKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compProvStateStatus"), ("InternetThruway-MIB", "compSecsInCurrentState"), ("InternetThruway-MIB", "compProvStateTimeStamp")) if mibBuilder.loadTexts: compStateClear.setDescription('The Trap generated when a component goes to its provisioned states after a CompStatusAlarm trap has been sent.') compStateAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2014)).setObjects(("InternetThruway-MIB", "compProvStateKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compProvStateStatus"), ("InternetThruway-MIB", "compSecsInCurrentState"), ("InternetThruway-MIB", "compProvStateTimeStamp")) if mibBuilder.loadTexts: compStateAlarm.setDescription("The Trap generated when a component is not in it's provisioned state.") restartStateClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2021)).setObjects(("InternetThruway-MIB", "compRestartKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compRestartStatus"), ("InternetThruway-MIB", "compRestartTimeStamp")) if mibBuilder.loadTexts: restartStateClear.setDescription('The Trap generated when a component goes to its provisioned states after a RestartStateAlarm trap has been sent.') restartStateAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2024)).setObjects(("InternetThruway-MIB", "compRestartKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compRestartStatus"), ("InternetThruway-MIB", "compRestartTimeStamp")) if mibBuilder.loadTexts: restartStateAlarm.setDescription('The Trap generated when a component restarts repeatedly.') ss7LinkFailureAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3004)).setObjects(("InternetThruway-MIB", "lfIndex"), ("InternetThruway-MIB", "lfKey"), ("InternetThruway-MIB", "lfIPAddress"), ("InternetThruway-MIB", "lfLinkCode"), ("InternetThruway-MIB", "lfName"), ("InternetThruway-MIB", "lfCardId"), ("InternetThruway-MIB", "lfLinkSet"), ("InternetThruway-MIB", "lfTimeStamp")) if mibBuilder.loadTexts: ss7LinkFailureAlarm.setDescription('Trap generated for an SS7 link failure.') ss7LinkFailureClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3001)).setObjects(("InternetThruway-MIB", "lfIndex"), ("InternetThruway-MIB", "lfKey"), ("InternetThruway-MIB", "lfIPAddress"), ("InternetThruway-MIB", "lfLinkCode"), ("InternetThruway-MIB", "lfName"), ("InternetThruway-MIB", "lfCardId"), ("InternetThruway-MIB", "lfLinkSet"), ("InternetThruway-MIB", "lfTimeStamp")) if mibBuilder.loadTexts: ss7LinkFailureClear.setDescription('Trap generated to clear an SS7 link failure.') ss7LinkCongestionAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3012)).setObjects(("InternetThruway-MIB", "lcIndex"), ("InternetThruway-MIB", "lcKey"), ("InternetThruway-MIB", "lcIPAddress"), ("InternetThruway-MIB", "lcLinkCode"), ("InternetThruway-MIB", "lcName"), ("InternetThruway-MIB", "lcCardId"), ("InternetThruway-MIB", "lcLinkSet"), ("InternetThruway-MIB", "lcTimeStamp")) if mibBuilder.loadTexts: ss7LinkCongestionAlarm.setDescription('Trap generated for congestion on an SS7 Link.') ss7LinkCongestionClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3011)).setObjects(("InternetThruway-MIB", "lcIndex"), ("InternetThruway-MIB", "lcKey"), ("InternetThruway-MIB", "lcIPAddress"), ("InternetThruway-MIB", "lcLinkCode"), ("InternetThruway-MIB", "lcName"), ("InternetThruway-MIB", "lcCardId"), ("InternetThruway-MIB", "lcLinkSet"), ("InternetThruway-MIB", "lcTimeStamp")) if mibBuilder.loadTexts: ss7LinkCongestionClear.setDescription('Trap generated to indicate there is no longer congestion on an SS7 link.') ss7ISUPFailureAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3025)).setObjects(("InternetThruway-MIB", "ifIndex"), ("InternetThruway-MIB", "ifKey"), ("InternetThruway-MIB", "ifIPAddress"), ("InternetThruway-MIB", "ifName"), ("InternetThruway-MIB", "ifTimeStamp")) if mibBuilder.loadTexts: ss7ISUPFailureAlarm.setDescription('Trap generated to indicate ISUP failure.') ss7ISUPFailureClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3021)).setObjects(("InternetThruway-MIB", "ifIndex"), ("InternetThruway-MIB", "ifKey"), ("InternetThruway-MIB", "ifIPAddress"), ("InternetThruway-MIB", "ifName"), ("InternetThruway-MIB", "ifTimeStamp")) if mibBuilder.loadTexts: ss7ISUPFailureClear.setDescription('Trap generated to clear an ISUP failure alarm.') ss7ISUPCongestionAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3033)).setObjects(("InternetThruway-MIB", "icIndex"), ("InternetThruway-MIB", "icKey"), ("InternetThruway-MIB", "icIPAddress"), ("InternetThruway-MIB", "icCongestionLevel"), ("InternetThruway-MIB", "icName"), ("InternetThruway-MIB", "icTimeStamp")) if mibBuilder.loadTexts: ss7ISUPCongestionAlarm.setDescription('Trap generated to indicate congestion with the ISUP protocol stack.') ss7ISUPCongestionClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3031)).setObjects(("InternetThruway-MIB", "icIndex"), ("InternetThruway-MIB", "icKey"), ("InternetThruway-MIB", "icIPAddress"), ("InternetThruway-MIB", "icCongestionLevel"), ("InternetThruway-MIB", "icName"), ("InternetThruway-MIB", "icTimeStamp")) if mibBuilder.loadTexts: ss7ISUPCongestionClear.setDescription('Trap generated to indicate there is no longer congestion with the ISUP protocol stack.') ss7FEPCongestionWarning = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3042)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapIPAddress"), ("InternetThruway-MIB", "trapName"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: ss7FEPCongestionWarning.setDescription('Notification trap generated to indicate congestion encountered by the SS7 front-end process.') ss7BEPCongestionWarning = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3052)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapIPAddress"), ("InternetThruway-MIB", "trapName"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: ss7BEPCongestionWarning.setDescription('Notification trap generated to indicate congestion encountered by the SS7 back-end process.') ss7MTP3CongestionMinor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3063)).setObjects(("InternetThruway-MIB", "mtp3Index"), ("InternetThruway-MIB", "mtp3Key"), ("InternetThruway-MIB", "mtp3IPAddress"), ("InternetThruway-MIB", "mtp3Name"), ("InternetThruway-MIB", "mtp3TimeStamp")) if mibBuilder.loadTexts: ss7MTP3CongestionMinor.setDescription('Trap generated for MTP3 congestion.') ss7MTP3CongestionMajor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3064)).setObjects(("InternetThruway-MIB", "mtp3Index"), ("InternetThruway-MIB", "mtp3Key"), ("InternetThruway-MIB", "mtp3IPAddress"), ("InternetThruway-MIB", "mtp3Name"), ("InternetThruway-MIB", "mtp3TimeStamp")) if mibBuilder.loadTexts: ss7MTP3CongestionMajor.setDescription('Trap generated for MTP3 congestion.') ss7MTP3CongestionCritical = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3065)).setObjects(("InternetThruway-MIB", "mtp3Index"), ("InternetThruway-MIB", "mtp3Key"), ("InternetThruway-MIB", "mtp3IPAddress"), ("InternetThruway-MIB", "mtp3Name"), ("InternetThruway-MIB", "mtp3TimeStamp")) if mibBuilder.loadTexts: ss7MTP3CongestionCritical.setDescription('Trap generated for MTP3 congestion.') ss7MTP3CongestionClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3061)).setObjects(("InternetThruway-MIB", "mtp3Index"), ("InternetThruway-MIB", "mtp3Key"), ("InternetThruway-MIB", "mtp3IPAddress"), ("InternetThruway-MIB", "mtp3Name"), ("InternetThruway-MIB", "mtp3TimeStamp")) if mibBuilder.loadTexts: ss7MTP3CongestionClear.setDescription('Trap generated to indicate there is no longer MTP3 congestion.') ss7MTP2TrunkFailureAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3075)).setObjects(("InternetThruway-MIB", "mtp2Index"), ("InternetThruway-MIB", "mtp2Key"), ("InternetThruway-MIB", "mtp2IPAddress"), ("InternetThruway-MIB", "mtp2Name"), ("InternetThruway-MIB", "mtp2CardId"), ("InternetThruway-MIB", "mtp2AlarmCondition"), ("InternetThruway-MIB", "mtp2TimeStamp")) if mibBuilder.loadTexts: ss7MTP2TrunkFailureAlarm.setDescription('Trap generated to indicate an MTP2 trunk failure condition.') ss7MTP2TrunkFailureClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3071)).setObjects(("InternetThruway-MIB", "mtp2Index"), ("InternetThruway-MIB", "mtp2Key"), ("InternetThruway-MIB", "mtp2IPAddress"), ("InternetThruway-MIB", "mtp2Name"), ("InternetThruway-MIB", "mtp2CardId"), ("InternetThruway-MIB", "mtp2TimeStamp")) if mibBuilder.loadTexts: ss7MTP2TrunkFailureClear.setDescription('Trap generated to clear an MTP2 trunk failure alarm.') ss7LinksetFailureAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3085)).setObjects(("InternetThruway-MIB", "lsFailureIndex"), ("InternetThruway-MIB", "lsFailureKey"), ("InternetThruway-MIB", "lsFailureIPAddress"), ("InternetThruway-MIB", "lsFailureName"), ("InternetThruway-MIB", "lsFailurePointcode"), ("InternetThruway-MIB", "lsFailureTimeStamp")) if mibBuilder.loadTexts: ss7LinksetFailureAlarm.setDescription('Trap generated to indicate a linkset failure.') ss7LinksetFailureClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3081)).setObjects(("InternetThruway-MIB", "lsFailureIndex"), ("InternetThruway-MIB", "lsFailureKey"), ("InternetThruway-MIB", "lsFailureIPAddress"), ("InternetThruway-MIB", "lsFailureName"), ("InternetThruway-MIB", "lsFailurePointcode"), ("InternetThruway-MIB", "lsFailureTimeStamp")) if mibBuilder.loadTexts: ss7LinksetFailureClear.setDescription('Trap generated to clear a linkset failure alarm.') ss7DestinationInaccessible = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3092)).setObjects(("InternetThruway-MIB", "destInaccessIndex"), ("InternetThruway-MIB", "destInaccessKey"), ("InternetThruway-MIB", "destInaccessIPAddress"), ("InternetThruway-MIB", "destInaccessName"), ("InternetThruway-MIB", "destInaccessPointcode"), ("InternetThruway-MIB", "destInaccessTimeStamp")) if mibBuilder.loadTexts: ss7DestinationInaccessible.setDescription('Trap generated to indicate that a signalling destination is inaccessible. A destination is considered inaccessible once Transfer Prohibited (TFP) messages are received which indicate that the route to that destination is prohibited.') ss7DestinationAccessible = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3091)).setObjects(("InternetThruway-MIB", "destInaccessIndex"), ("InternetThruway-MIB", "destInaccessKey"), ("InternetThruway-MIB", "destInaccessIPAddress"), ("InternetThruway-MIB", "destInaccessName"), ("InternetThruway-MIB", "destInaccessPointcode"), ("InternetThruway-MIB", "destInaccessTimeStamp")) if mibBuilder.loadTexts: ss7DestinationAccessible.setDescription('Trap generated to clear a destination inacessible alarm. An inaccessible signalling destination is considered accessible once Transfer Allowed (TFA) messages are sent along its prohibited signalling routes.') ss7DestinationCongestedAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3103)).setObjects(("InternetThruway-MIB", "destCongestIndex"), ("InternetThruway-MIB", "destCongestKey"), ("InternetThruway-MIB", "destCongestIPAddress"), ("InternetThruway-MIB", "destCongestName"), ("InternetThruway-MIB", "destCongestPointcode"), ("InternetThruway-MIB", "destCongestCongestionLevel"), ("InternetThruway-MIB", "destCongestTimeStamp")) if mibBuilder.loadTexts: ss7DestinationCongestedAlarm.setDescription('Trap generated to indicate congestion at an SS7 destination.') ss7DestinationCongestedClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3101)).setObjects(("InternetThruway-MIB", "destCongestIndex"), ("InternetThruway-MIB", "destCongestKey"), ("InternetThruway-MIB", "destCongestIPAddress"), ("InternetThruway-MIB", "destCongestName"), ("InternetThruway-MIB", "destCongestPointcode"), ("InternetThruway-MIB", "destCongestCongestionLevel"), ("InternetThruway-MIB", "destCongestTimeStamp")) if mibBuilder.loadTexts: ss7DestinationCongestedClear.setDescription('Trap generated to indicate that there is no longer congestion at an SS7 destination.') ss7LinkAlignmentFailureAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3114)).setObjects(("InternetThruway-MIB", "linkAlignIndex"), ("InternetThruway-MIB", "linkAlignKey"), ("InternetThruway-MIB", "linkAlignIPAddress"), ("InternetThruway-MIB", "linkAlignName"), ("InternetThruway-MIB", "linkAlignLinkCode"), ("InternetThruway-MIB", "linkAlignCardId"), ("InternetThruway-MIB", "linkAlignLinkSet"), ("InternetThruway-MIB", "linkAlignTimeStamp")) if mibBuilder.loadTexts: ss7LinkAlignmentFailureAlarm.setDescription('Trap generated to indicate alignment failure on a datalink.') ss7LinkAlignmentFailureClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3111)).setObjects(("InternetThruway-MIB", "linkAlignIndex"), ("InternetThruway-MIB", "linkAlignKey"), ("InternetThruway-MIB", "linkAlignIPAddress"), ("InternetThruway-MIB", "linkAlignName"), ("InternetThruway-MIB", "linkAlignLinkCode"), ("InternetThruway-MIB", "linkAlignCardId"), ("InternetThruway-MIB", "linkAlignLinkSet"), ("InternetThruway-MIB", "linkAlignTimeStamp")) if mibBuilder.loadTexts: ss7LinkAlignmentFailureClear.setDescription('Trap generated to clear a datalink alignment failure alarm.') ncLostServerTrap = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4014)).setObjects(("InternetThruway-MIB", "lsIndex"), ("InternetThruway-MIB", "lsKey"), ("InternetThruway-MIB", "lsName"), ("InternetThruway-MIB", "lsIPAddress"), ("InternetThruway-MIB", "lsTimeStamp")) if mibBuilder.loadTexts: ncLostServerTrap.setDescription('This trap is generated when the CSG loses contact with its peer in the cluster. The variables in this trap identify the server that has been lost. The originator of this trap is implicitly defined.') ncFoundServerTrap = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4011)).setObjects(("InternetThruway-MIB", "lsIndex"), ("InternetThruway-MIB", "lsKey"), ("InternetThruway-MIB", "lsName"), ("InternetThruway-MIB", "lsIPAddress"), ("InternetThruway-MIB", "lsTimeStamp")) if mibBuilder.loadTexts: ncFoundServerTrap.setDescription('This trap is generated when the initially comes into contact with or regains contact with its peer in the cluster. The variables in this trap identify the server that has been found. The originator of this trap is implicitly defined.') ncStateChangeTrap = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4022)).setObjects(("InternetThruway-MIB", "ncEthernetName"), ("InternetThruway-MIB", "ncEthernetIP"), ("InternetThruway-MIB", "ncOperationalState"), ("InternetThruway-MIB", "ncStandbyState"), ("InternetThruway-MIB", "ncAvailabilityState")) if mibBuilder.loadTexts: ncStateChangeTrap.setDescription('This trap is generated when any of the state values change.') csgComplexStateTrapClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4031)).setObjects(("InternetThruway-MIB", "cplxName"), ("InternetThruway-MIB", "cplxLocEthernetName"), ("InternetThruway-MIB", "cplxLocEthernetIP"), ("InternetThruway-MIB", "cplxLocOperationalState"), ("InternetThruway-MIB", "cplxLocStandbyState"), ("InternetThruway-MIB", "cplxLocAvailabilityState"), ("InternetThruway-MIB", "cplxMateEthernetName"), ("InternetThruway-MIB", "cplxMateEthernetIP"), ("InternetThruway-MIB", "cplxMateOperationalState"), ("InternetThruway-MIB", "cplxMateStandbyState"), ("InternetThruway-MIB", "cplxMateAvailabilityState"), ("InternetThruway-MIB", "cplxAlarmStatus")) if mibBuilder.loadTexts: csgComplexStateTrapClear.setDescription('This trap is generated when any of the state values change Severity is determined only by the operational and standby states of both servers.') csgComplexStateTrapMajor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4034)).setObjects(("InternetThruway-MIB", "cplxName"), ("InternetThruway-MIB", "cplxLocEthernetName"), ("InternetThruway-MIB", "cplxLocEthernetIP"), ("InternetThruway-MIB", "cplxLocOperationalState"), ("InternetThruway-MIB", "cplxLocStandbyState"), ("InternetThruway-MIB", "cplxLocAvailabilityState"), ("InternetThruway-MIB", "cplxMateEthernetName"), ("InternetThruway-MIB", "cplxMateEthernetIP"), ("InternetThruway-MIB", "cplxMateOperationalState"), ("InternetThruway-MIB", "cplxMateStandbyState"), ("InternetThruway-MIB", "cplxMateAvailabilityState"), ("InternetThruway-MIB", "cplxAlarmStatus")) if mibBuilder.loadTexts: csgComplexStateTrapMajor.setDescription('This trap is generated when any of the state values change Severity is determined only by the operational and standby states of both servers.') csgComplexStateTrapCritical = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4035)).setObjects(("InternetThruway-MIB", "cplxName"), ("InternetThruway-MIB", "cplxLocEthernetName"), ("InternetThruway-MIB", "cplxLocEthernetIP"), ("InternetThruway-MIB", "cplxLocOperationalState"), ("InternetThruway-MIB", "cplxLocStandbyState"), ("InternetThruway-MIB", "cplxLocAvailabilityState"), ("InternetThruway-MIB", "cplxMateEthernetName"), ("InternetThruway-MIB", "cplxMateEthernetIP"), ("InternetThruway-MIB", "cplxMateOperationalState"), ("InternetThruway-MIB", "cplxMateStandbyState"), ("InternetThruway-MIB", "cplxMateAvailabilityState"), ("InternetThruway-MIB", "cplxAlarmStatus")) if mibBuilder.loadTexts: csgComplexStateTrapCritical.setDescription('This trap is generated when any of the state values change Severity is determined only by the operational and standby states of both servers.') cisRetrievalFailureTrapMajor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4044)) if mibBuilder.loadTexts: cisRetrievalFailureTrapMajor.setDescription('This trap is generated when the TruCluster ASE information retrieval attempts failed repeatedly. ') genericNormal = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9001)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapGenericStr1"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: genericNormal.setDescription('The Trap generated for generic normal priority text messages') genericWarning = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9002)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapGenericStr1"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: genericWarning.setDescription('The Trap generated for generic warning priority text messages') genericMinor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9003)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapGenericStr1"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: genericMinor.setDescription('The Trap generated for generic minor priority text messages') genericMajor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9004)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapGenericStr1"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: genericMajor.setDescription('The Trap generated for generic major priority text messages') genericCritical = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9005)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapGenericStr1"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: genericCritical.setDescription('The Trap generated for generic critical priority text messages') hgStatusClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9011)).setObjects(("InternetThruway-MIB", "hgKey"), ("InternetThruway-MIB", "hgIndex"), ("InternetThruway-MIB", "hgName"), ("InternetThruway-MIB", "hgIPAddress"), ("InternetThruway-MIB", "hgAlarmTimeStamp")) if mibBuilder.loadTexts: hgStatusClear.setDescription('The Trap generated when a Home Gateway Status returns to normal after having previously been in the failed status.') hgStatusAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9014)).setObjects(("InternetThruway-MIB", "hgKey"), ("InternetThruway-MIB", "hgIndex"), ("InternetThruway-MIB", "hgName"), ("InternetThruway-MIB", "hgIPAddress"), ("InternetThruway-MIB", "hgAlarmTimeStamp")) if mibBuilder.loadTexts: hgStatusAlarm.setDescription('The Trap generated when a Home Gateway is indicated to be failed.') nasStatusClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9021)).setObjects(("InternetThruway-MIB", "nasKey"), ("InternetThruway-MIB", "nasIndex"), ("InternetThruway-MIB", "nasName"), ("InternetThruway-MIB", "nasIPAddress"), ("InternetThruway-MIB", "nasAlarmTimeStamp"), ("InternetThruway-MIB", "nasCmplxName")) if mibBuilder.loadTexts: nasStatusClear.setDescription('The Trap generated when a rapport registers after having previously been in the failed status.') nasStatusAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9024)).setObjects(("InternetThruway-MIB", "nasKey"), ("InternetThruway-MIB", "nasIndex"), ("InternetThruway-MIB", "nasName"), ("InternetThruway-MIB", "nasIPAddress"), ("InternetThruway-MIB", "nasAlarmTimeStamp"), ("InternetThruway-MIB", "nasCmplxName")) if mibBuilder.loadTexts: nasStatusAlarm.setDescription('The Trap generated when a Nas is indicated to be failed.') linkOMTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1), ) if mibBuilder.loadTexts: linkOMTable.setStatus('mandatory') if mibBuilder.loadTexts: linkOMTable.setDescription('The LinkTable contains information about each signaling link on the CSG') linkOMTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "linksetIndex"), (0, "InternetThruway-MIB", "linkIndex")) if mibBuilder.loadTexts: linkOMTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: linkOMTableEntry.setDescription('An entry in the LinkTable. Indexed by linkIndex') linkOMId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkOMId.setStatus('mandatory') if mibBuilder.loadTexts: linkOMId.setDescription('The id of the link.') linkOMSetId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkOMSetId.setStatus('mandatory') if mibBuilder.loadTexts: linkOMSetId.setDescription('The id of the linkset.') linkFailures = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkFailures.setStatus('mandatory') if mibBuilder.loadTexts: linkFailures.setDescription('Number of times this signaling link has failed.') linkCongestions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkCongestions.setStatus('mandatory') if mibBuilder.loadTexts: linkCongestions.setDescription('Number of times this signaling link has Congested.') linkInhibits = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkInhibits.setStatus('mandatory') if mibBuilder.loadTexts: linkInhibits.setDescription('Number of times this signaling link has been inhibited.') linkTransmittedMSUs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkTransmittedMSUs.setStatus('mandatory') if mibBuilder.loadTexts: linkTransmittedMSUs.setDescription('Number of messages sent on this signaling link.') linkReceivedMSUs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkReceivedMSUs.setStatus('mandatory') if mibBuilder.loadTexts: linkReceivedMSUs.setDescription('Number of messages received on this signaling link.') linkRemoteProcOutages = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkRemoteProcOutages.setStatus('mandatory') if mibBuilder.loadTexts: linkRemoteProcOutages.setDescription('Number of times the remote processor outgaes have been reported.') bLATimerExpiries = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 2, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bLATimerExpiries.setStatus('mandatory') if mibBuilder.loadTexts: bLATimerExpiries.setDescription('Number of times the BLA timer has expired.') rLCTimerExpiries = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 2, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rLCTimerExpiries.setStatus('mandatory') if mibBuilder.loadTexts: rLCTimerExpiries.setDescription('Number of times the RLC timer has expired.') uBATimerExpiries = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 2, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: uBATimerExpiries.setStatus('mandatory') if mibBuilder.loadTexts: uBATimerExpiries.setDescription('Number of times the UBA timer has expired.') rSATimerExpiries = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 2, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rSATimerExpiries.setStatus('mandatory') if mibBuilder.loadTexts: rSATimerExpiries.setDescription('Number of times the RSA timer has expired.') outCallAttempts = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: outCallAttempts.setDescription('Total number of outgoing call legs attempted.') outCallNormalCompletions = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: outCallNormalCompletions.setDescription('Total number of outgoing call legs completed normally.') outCallAbnormalCompletions = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: outCallAbnormalCompletions.setDescription('Total number of outgoing call legs completed abnormally.') userBusyOutCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: userBusyOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: userBusyOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to user busy signal.') tempFailOutCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tempFailOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: tempFailOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to temporary failure.') userUnavailableOutCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: userUnavailableOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: userUnavailableOutCallRejects.setDescription('Total number of outgoing call legs failed due to user not available.') abnormalReleaseOutCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: abnormalReleaseOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: abnormalReleaseOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to abnormal release.') otherOutCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: otherOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: otherOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to other reasons.') cumulativeActiveOutCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cumulativeActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: cumulativeActiveOutCalls.setDescription('Cumulatvie Number of outgoing call legs active so far.') currentlyActiveOutCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveOutCalls.setDescription('Total Number of outgoing call legs currently active.') currentlyActiveDigitalOutCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveDigitalOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveDigitalOutCalls.setDescription('Total Number of outgoing digital call legs currently active.') currentlyActiveAnalogOutCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveAnalogOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveAnalogOutCalls.setDescription('Total Number of outgoing analog call legs currently active.') inCallAttempts = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: inCallAttempts.setDescription('Total number of incoming call legs attempted.') inCallNormalCompletions = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: inCallNormalCompletions.setDescription('Total number of incoming call legs completed normally.') inCallAbnormalCompletions = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: inCallAbnormalCompletions.setDescription('Total number of incoming call legs completed abnormally.') userBusyInCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: userBusyInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: userBusyInCallRejects.setDescription('Total Number of incoming call legs rejected due to user busy signal.') tempFailInCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tempFailInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: tempFailInCallRejects.setDescription('Total Number of incoming call legs rejected due to temporary failure.') userUnavailableInCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: userUnavailableInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: userUnavailableInCallRejects.setDescription('Total number of incoming call legs failed due to user not available.') abnormalReleaseInCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: abnormalReleaseInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: abnormalReleaseInCallRejects.setDescription('Total Number of incoming call legs rejected due to abnormal release.') otherInCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: otherInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: otherInCallRejects.setDescription('Total Number of incoming call legs rejected due to other reasons.') cumulativeActiveInCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cumulativeActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: cumulativeActiveInCalls.setDescription('Cumulatvie Number of incoming call legs active so far.') currentlyActiveInCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveInCalls.setDescription('Total Number of incoming call legs currently active.') currentlyActiveDigitalInCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveDigitalInCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveDigitalInCalls.setDescription('Total Number of incoming digital call legs currently active.') currentlyActiveAnalogInCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveAnalogInCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveAnalogInCalls.setDescription('Total Number of incoming analog call legs currently active.') trunkCallOMTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1), ) if mibBuilder.loadTexts: trunkCallOMTable.setStatus('mandatory') if mibBuilder.loadTexts: trunkCallOMTable.setDescription('The TrunkCallOMTable contains call related OMs on a trunk group basis') trunkCallOMTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "trunkCallOMIndex")) if mibBuilder.loadTexts: trunkCallOMTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: trunkCallOMTableEntry.setDescription('An entry in the TrunkCallOMTable. Indexed by trunkCallOMIndex.') trunkCallOMIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: trunkCallOMIndex.setStatus('mandatory') if mibBuilder.loadTexts: trunkCallOMIndex.setDescription('Identifies a trunk group index.') trunkGroupCLLI = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkGroupCLLI.setStatus('mandatory') if mibBuilder.loadTexts: trunkGroupCLLI.setDescription('The Common Language Location Identifier(CLLI), a unique alphanumeric value to identify this Trunk Group.') numberOfCircuits = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfCircuits.setStatus('mandatory') if mibBuilder.loadTexts: numberOfCircuits.setDescription('Total Number of Circuits provisioned against this trunk group.') trunkOutCallAttempts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOutCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: trunkOutCallAttempts.setDescription('Total number of outgoing call legs attempted.') trunkOutCallNormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOutCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: trunkOutCallNormalCompletions.setDescription('Total number of outgoing call legs completed normally.') trunkOutCallAbnormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOutCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: trunkOutCallAbnormalCompletions.setDescription('Total number of outgoing call legs completed abnormally.') trunkUserBusyOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkUserBusyOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkUserBusyOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to user busy signal.') trunkTempFailOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkTempFailOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkTempFailOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to temporary failure.') trunkUserUnavailableOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkUserUnavailableOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkUserUnavailableOutCallRejects.setDescription('Total number of outgoing call legs failed due to user not available.') trunkAbnormalReleaseOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkAbnormalReleaseOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkAbnormalReleaseOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to abnormal release.') trunkOtherOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOtherOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkOtherOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to other reasons.') trunkCumulativeActiveOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCumulativeActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCumulativeActiveOutCalls.setDescription('Cumulatvie Number of outgoing call legs active so far.') trunkCurrentlyActiveOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveOutCalls.setDescription('Total Number of outgoing call legs currently active.') trunkCurrentlyActiveDigitalOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveDigitalOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveDigitalOutCalls.setDescription('Total Number of outgoing digital call legs currently active.') trunkCurrentlyActiveAnalogOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveAnalogOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveAnalogOutCalls.setDescription('Total Number of outgoing analog call legs currently active.') trunkInCallAttempts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkInCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: trunkInCallAttempts.setDescription('Total number of incoming call legs attempted.') trunkInCallNormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkInCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: trunkInCallNormalCompletions.setDescription('Total number of incoming call legs completed normally.') trunkInCallAbnormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkInCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: trunkInCallAbnormalCompletions.setDescription('Total number of incoming call legs completed abnormally.') trunkUserBusyInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkUserBusyInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkUserBusyInCallRejects.setDescription('Total Number of incoming call legs rejected due to user busy signal.') trunkTempFailInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkTempFailInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkTempFailInCallRejects.setDescription('Total Number of incoming call legs rejected due to temporary failure.') trunkUserUnavailableInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkUserUnavailableInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkUserUnavailableInCallRejects.setDescription('Total number of incoming call legs failed due to user not available.') trunkAbnormalReleaseInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkAbnormalReleaseInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkAbnormalReleaseInCallRejects.setDescription('Total Number of incoming call legs rejected due to abnormal release.') trunkOtherInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOtherInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkOtherInCallRejects.setDescription('Total Number of incoming call legs rejected due to other reasons.') trunkCumulativeActiveInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCumulativeActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCumulativeActiveInCalls.setDescription('Cumulatvie Number of incoming call legs active so far.') trunkCurrentlyActiveInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveInCalls.setDescription('Total Number of incoming call legs currently active.') trunkCurrentlyActiveDigitalInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveDigitalInCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveDigitalInCalls.setDescription('Total Number of incoming digital call legs currently active.') trunkCurrentlyActiveAnalogInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveAnalogInCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveAnalogInCalls.setDescription('Total Number of incoming analog call legs currently active.') trunkAllActiveCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 28), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkAllActiveCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkAllActiveCalls.setDescription('Total number of currently active call legs (all type).') trunkOccupancyPerCCS = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 29), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOccupancyPerCCS.setStatus('mandatory') if mibBuilder.loadTexts: trunkOccupancyPerCCS.setDescription('Trunk occupancy in Centum Call Seconds.') trafficInCCSs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 30), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trafficInCCSs.setStatus('mandatory') if mibBuilder.loadTexts: trafficInCCSs.setDescription('Scanned om for tgms that are call busy') trafficInCCSIncomings = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 31), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trafficInCCSIncomings.setStatus('mandatory') if mibBuilder.loadTexts: trafficInCCSIncomings.setDescription('Scanned Om on tgms with an incoming call.') localBusyInCCSs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 32), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: localBusyInCCSs.setStatus('mandatory') if mibBuilder.loadTexts: localBusyInCCSs.setDescription('Scanned om for tgms that are locally blocked.') remoteBusyInCCSs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 33), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remoteBusyInCCSs.setStatus('mandatory') if mibBuilder.loadTexts: remoteBusyInCCSs.setDescription('Scanned om for tgms that are remoteley blocked.') nasCallOMTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1), ) if mibBuilder.loadTexts: nasCallOMTable.setStatus('mandatory') if mibBuilder.loadTexts: nasCallOMTable.setDescription('The NasCallOMTable contains call related OMs on a nas basis') nasCallOMTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "nasCallOMIndex")) if mibBuilder.loadTexts: nasCallOMTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: nasCallOMTableEntry.setDescription('An entry in the NasCallOMTable. Indexed by nasCallOMIndex.') nasCallOMIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: nasCallOMIndex.setStatus('mandatory') if mibBuilder.loadTexts: nasCallOMIndex.setDescription('Identifies a nas Call OM .') nasName1 = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasName1.setStatus('mandatory') if mibBuilder.loadTexts: nasName1.setDescription('A unique alphanumeric value to identify this Nas.') numberOfPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfPorts.setStatus('mandatory') if mibBuilder.loadTexts: numberOfPorts.setDescription('Total Number of Ports provisioned against this nas.') nasOutCallAttempts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasOutCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: nasOutCallAttempts.setDescription('Total number of outgoing call legs attempted.') nasOutCallNormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasOutCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: nasOutCallNormalCompletions.setDescription('Total number of outgoing call legs completed normally.') nasOutCallAbnormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasOutCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: nasOutCallAbnormalCompletions.setDescription('Total number of outgoing call legs completed abnormally.') nasUserBusyOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasUserBusyOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasUserBusyOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to user busy signal.') nasTempFailOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasTempFailOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasTempFailOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to temporary failure.') nasUserUnavailableOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasUserUnavailableOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasUserUnavailableOutCallRejects.setDescription('Total number of outgoing call legs failed due to user not available.') nasAbnormalReleaseOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasAbnormalReleaseOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasAbnormalReleaseOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to abnormal release.') nasOtherOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasOtherOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasOtherOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to other reasons.') nasCumulativeActiveOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCumulativeActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCumulativeActiveOutCalls.setDescription('Cumulatvie Number of outgoing call legs active so far.') nasCurrentlyActiveOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveOutCalls.setDescription('Total Number of outgoing call legs currently active.') nasCurrentlyActiveDigitalOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveDigitalOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveDigitalOutCalls.setDescription('Total Number of outgoing digital call legs currently active.') nasCurrentlyActiveAnalogOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveAnalogOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveAnalogOutCalls.setDescription('Total Number of outgoing analog call legs currently active.') nasInCallAttempts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasInCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: nasInCallAttempts.setDescription('Total number of incoming call legs attempted.') nasInCallNormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasInCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: nasInCallNormalCompletions.setDescription('Total number of incoming call legs completed normally.') nasInCallAbnormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasInCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: nasInCallAbnormalCompletions.setDescription('Total number of incoming call legs completed abnormally.') nasUserBusyInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasUserBusyInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasUserBusyInCallRejects.setDescription('Total Number of incoming call legs rejected due to user busy signal.') nasTempFailInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasTempFailInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasTempFailInCallRejects.setDescription('Total Number of incoming call legs rejected due to temporary failure.') nasUserUnavailableInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasUserUnavailableInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasUserUnavailableInCallRejects.setDescription('Total number of incoming call legs failed due to user not available.') nasAbnormalReleaseInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasAbnormalReleaseInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasAbnormalReleaseInCallRejects.setDescription('Total Number of incoming call legs rejected due to abnormal release.') nasOtherInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasOtherInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasOtherInCallRejects.setDescription('Total Number of incoming call legs rejected due to other reasons.') nasCumulativeActiveInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCumulativeActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCumulativeActiveInCalls.setDescription('Cumulatvie Number of incoming call legs active so far.') nasCurrentlyActiveInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveInCalls.setDescription('Total Number of incoming call legs currently active.') nasCurrentlyActiveDigitalInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveDigitalInCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveDigitalInCalls.setDescription('Total Number of incoming digital call legs currently active.') nasCurrentlyActiveAnalogInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveAnalogInCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveAnalogInCalls.setDescription('Total Number of incoming analog call legs currently active.') nasAllActiveCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 28), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasAllActiveCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasAllActiveCalls.setDescription('Total number of currently active call legs (all type).') nasMaxPortsUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 29), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasMaxPortsUsed.setStatus('mandatory') if mibBuilder.loadTexts: nasMaxPortsUsed.setDescription('Maximum number of ports used in this nas since the last system restart.') nasMinPortsUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 30), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasMinPortsUsed.setStatus('mandatory') if mibBuilder.loadTexts: nasMinPortsUsed.setDescription('Minimum number of ports used in this nas since the last system restart.') nasCurrentlyInUsePorts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 31), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyInUsePorts.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyInUsePorts.setDescription('Number of ports currently in use.') phoneCallOMTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1), ) if mibBuilder.loadTexts: phoneCallOMTable.setStatus('mandatory') if mibBuilder.loadTexts: phoneCallOMTable.setDescription('The PhoneCallOMTable contains call related OMs on a phone number basis') phoneCallOMTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "phoneCallOMIndex")) if mibBuilder.loadTexts: phoneCallOMTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: phoneCallOMTableEntry.setDescription('An entry in the PhoneCallOMTable. Indexed by phoneGroupIndex.') phoneCallOMIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: phoneCallOMIndex.setStatus('mandatory') if mibBuilder.loadTexts: phoneCallOMIndex.setDescription('Uniquely identifies an entry in this table.') phoneNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneNumber.setStatus('mandatory') if mibBuilder.loadTexts: phoneNumber.setDescription('Phone number for the underlying Call OM record.') phoneDialCallAttempts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneDialCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: phoneDialCallAttempts.setDescription('Total number of dial calls attempted.') phoneDialCallNormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneDialCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: phoneDialCallNormalCompletions.setDescription('Total number of dial calls completed normally.') phoneDialCallAbnormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneDialCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: phoneDialCallAbnormalCompletions.setDescription('Total number of dial calls completed abnormally.') phoneUserBusyDialCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneUserBusyDialCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: phoneUserBusyDialCallRejects.setDescription('Total Number of dial calls rejected due to user busy signal.') phoneTempFailDialCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneTempFailDialCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: phoneTempFailDialCallRejects.setDescription('Total Number of dial calls rejected due to temporary failure.') phoneUserUnavailableDialCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneUserUnavailableDialCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: phoneUserUnavailableDialCallRejects.setDescription('Total number of dial calls failed due to user not available.') phoneAbnormalReleaseDialCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneAbnormalReleaseDialCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: phoneAbnormalReleaseDialCallRejects.setDescription('Total Number of dial calls rejected due to abnormal release.') phoneOtherDialCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneOtherDialCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: phoneOtherDialCallRejects.setDescription('Total Number of dial calls rejected due to other reasons.') phoneCumulativeActiveDialCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneCumulativeActiveDialCalls.setStatus('mandatory') if mibBuilder.loadTexts: phoneCumulativeActiveDialCalls.setDescription('Cumulatvie Number of dial calls active so far.') phoneCurrentlyActiveDialCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneCurrentlyActiveDialCalls.setStatus('mandatory') if mibBuilder.loadTexts: phoneCurrentlyActiveDialCalls.setDescription('Total Number of dial calls currently active.') phoneCurrentlyActiveDigitalDialCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneCurrentlyActiveDigitalDialCalls.setStatus('mandatory') if mibBuilder.loadTexts: phoneCurrentlyActiveDigitalDialCalls.setDescription('Total Number of digital dial calls currently active.') phoneCurrentlyActiveAnalogDialCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneCurrentlyActiveAnalogDialCalls.setStatus('mandatory') if mibBuilder.loadTexts: phoneCurrentlyActiveAnalogDialCalls.setDescription('Total Number of analog dial calls currently active.') csgComplexCLLI = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csgComplexCLLI.setStatus('mandatory') if mibBuilder.loadTexts: csgComplexCLLI.setDescription('A unique identifier of the CSG Complex.') serverHostName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: serverHostName.setStatus('mandatory') if mibBuilder.loadTexts: serverHostName.setDescription('Host Name of this server.') serverIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: serverIpAddress.setStatus('mandatory') if mibBuilder.loadTexts: serverIpAddress.setDescription('IP address of this server.') serverCLLI = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: serverCLLI.setStatus('mandatory') if mibBuilder.loadTexts: serverCLLI.setDescription('A unique identifier of this server (common in the telco world).') mateServerHostName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mateServerHostName.setStatus('mandatory') if mibBuilder.loadTexts: mateServerHostName.setDescription('Host Name of this server.') mateServerIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 6), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mateServerIpAddress.setStatus('mandatory') if mibBuilder.loadTexts: mateServerIpAddress.setDescription('IP address of this server.') serverMemSize = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: serverMemSize.setStatus('mandatory') if mibBuilder.loadTexts: serverMemSize.setDescription('Memory size in mega bytes of this server.') provisionedDPCs = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: provisionedDPCs.setStatus('mandatory') if mibBuilder.loadTexts: provisionedDPCs.setDescription('Number of destination point codes provisioned.') provisionedCircuits = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: provisionedCircuits.setStatus('mandatory') if mibBuilder.loadTexts: provisionedCircuits.setDescription('Number of circuits provisioned.') inserviceCircuits = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inserviceCircuits.setStatus('mandatory') if mibBuilder.loadTexts: inserviceCircuits.setDescription('Number of circuits in service. This number goes up or down at any given time.') provisionedNASes = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: provisionedNASes.setStatus('mandatory') if mibBuilder.loadTexts: provisionedNASes.setDescription('Number of NASes provisioned.') aliveNASes = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: aliveNASes.setStatus('mandatory') if mibBuilder.loadTexts: aliveNASes.setDescription('Number of NASes known to be alive. This number goes up or down at any given time.') inserviceNASes = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inserviceNASes.setStatus('mandatory') if mibBuilder.loadTexts: inserviceNASes.setDescription('Number of NASes in service. This number goes up or down at any given time.') provsionedCards = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: provsionedCards.setStatus('mandatory') if mibBuilder.loadTexts: provsionedCards.setDescription('Number of NAS cards provisioned.') inserviceCards = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 16), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inserviceCards.setStatus('mandatory') if mibBuilder.loadTexts: inserviceCards.setDescription('Number of NAS cards in service. This number goes up or down at any given time.') provisionedPorts = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 17), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: provisionedPorts.setStatus('mandatory') if mibBuilder.loadTexts: provisionedPorts.setDescription('Number of ports provisioned.') inservicePorts = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 18), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inservicePorts.setStatus('mandatory') if mibBuilder.loadTexts: inservicePorts.setDescription('Number of ports in service. This number goes up or down at any given time.') userCPUUsage = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 19), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: userCPUUsage.setStatus('mandatory') if mibBuilder.loadTexts: userCPUUsage.setDescription('Percentage of CPU used in user domain. Survman computes this value in every 600 seconds. The value stored in the MIB will be the last one computed.') systemCPUUsage = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 20), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: systemCPUUsage.setStatus('mandatory') if mibBuilder.loadTexts: systemCPUUsage.setDescription('Percentage of CPU used in system domain in this server. Survman computes this value in every 600 seconds. The value stored in the MIB will be the last one computed.') totalCPUUsage = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: totalCPUUsage.setStatus('mandatory') if mibBuilder.loadTexts: totalCPUUsage.setDescription('Percentage of CPU used in total in this server Survman computes this value in every 600 seconds. The value stored in the MIB will be the last one computed.') maxCPUUsage = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 22), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: maxCPUUsage.setStatus('mandatory') if mibBuilder.loadTexts: maxCPUUsage.setDescription('High water measurement. Maximum CPU Usage (%) in this server. Survman computes this value in every 600 seconds. The value stored in the MIB will be the last one computed.') avgLoad = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 23), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: avgLoad.setStatus('mandatory') if mibBuilder.loadTexts: avgLoad.setDescription('Average CPU load factor in this server. Survman computes this value in every 600 seconds. The value stored in the MIB will be the last one computed.') systemCallRate = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 24), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: systemCallRate.setStatus('mandatory') if mibBuilder.loadTexts: systemCallRate.setDescription('System Call rate (per second) in this Cserver. Survman computes this value in every 600 seconds. The value stored in the MIB will be the one computed the last time.') contextSwitchRate = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 25), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: contextSwitchRate.setStatus('mandatory') if mibBuilder.loadTexts: contextSwitchRate.setDescription('Process context switching rate (per second) in this server. Survman computes this value in every 600 seconds. The value stored in the MIB will be the one computed the last time.') lastUpdateOMFile = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 26), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lastUpdateOMFile.setStatus('mandatory') if mibBuilder.loadTexts: lastUpdateOMFile.setDescription('Name of the last updated OM file.') mibBuilder.exportSymbols("InternetThruway-MIB", cplxMateStandbyState=cplxMateStandbyState, icTimeStamp=icTimeStamp, linkAlignLinkSet=linkAlignLinkSet, nasUserUnavailableInCallRejects=nasUserUnavailableInCallRejects, phoneCallOMIndex=phoneCallOMIndex, linkOMs=linkOMs, hgIPAddress=hgIPAddress, ss7MTP2TrunkFailureAlarmTableEntry=ss7MTP2TrunkFailureAlarmTableEntry, componentIndex=componentIndex, lsIPAddress=lsIPAddress, RouteState=RouteState, ncLostServerTrap=ncLostServerTrap, LinksetState=LinksetState, nasCallOMTableEntry=nasCallOMTableEntry, trunkOccupancyPerCCS=trunkOccupancyPerCCS, routeIndex=routeIndex, destCongestPointcode=destCongestPointcode, userBusyOutCallRejects=userBusyOutCallRejects, componentTable=componentTable, routeTable=routeTable, ss7DestinationAccessible=ss7DestinationAccessible, ss7LinkCongestionAlarmTableEntry=ss7LinkCongestionAlarmTableEntry, partitionSpaceTimeStamp=partitionSpaceTimeStamp, lcKey=lcKey, nasCurrentlyActiveDigitalOutCalls=nasCurrentlyActiveDigitalOutCalls, destInaccessPointcode=destInaccessPointcode, trunkUserUnavailableOutCallRejects=trunkUserUnavailableOutCallRejects, LinkAlignmentState=LinkAlignmentState, trunkOtherOutCallRejects=trunkOtherOutCallRejects, ss7ISUPFailureAlarmTableEntry=ss7ISUPFailureAlarmTableEntry, trunkOtherInCallRejects=trunkOtherInCallRejects, lcLinkSet=lcLinkSet, lsKey=lsKey, ss7FEPCongestionWarning=ss7FEPCongestionWarning, ss7BEPCongestionWarning=ss7BEPCongestionWarning, provisionedPorts=provisionedPorts, nasUserUnavailableOutCallRejects=nasUserUnavailableOutCallRejects, phoneDialCallNormalCompletions=phoneDialCallNormalCompletions, ss7DestinationCongestedAlarm=ss7DestinationCongestedAlarm, cplxMateAvailabilityState=cplxMateAvailabilityState, totalCPUUsage=totalCPUUsage, provsionedCards=provsionedCards, compDebugStatus=compDebugStatus, provisionedNASes=provisionedNASes, trafficInCCSs=trafficInCCSs, currentlyActiveInCalls=currentlyActiveInCalls, cplxMateOperationalState=cplxMateOperationalState, nasStatusAlarm=nasStatusAlarm, nasAlarmTableEntry=nasAlarmTableEntry, PartitionSpaceStatus=PartitionSpaceStatus, linksetTableEntry=linksetTableEntry, rSATimerExpiries=rSATimerExpiries, mtp2CardId=mtp2CardId, compStateAlarm=compStateAlarm, mtp2Key=mtp2Key, ss7DestinationInaccessibleAlarmTable=ss7DestinationInaccessibleAlarmTable, nasIPAddress=nasIPAddress, inserviceNASes=inserviceNASes, linkOMTableEntry=linkOMTableEntry, nasUserBusyInCallRejects=nasUserBusyInCallRejects, lcIPAddress=lcIPAddress, hgName=hgName, phoneNumberOMs=phoneNumberOMs, linkNumSIFReceived=linkNumSIFReceived, numberOfPorts=numberOfPorts, lsName=lsName, lfCardId=lfCardId, icIndex=icIndex, provisionedDPCs=provisionedDPCs, lfIPAddress=lfIPAddress, lostServerAlarmTableEntry=lostServerAlarmTableEntry, mateServerIpAddress=mateServerIpAddress, cumulativeActiveOutCalls=cumulativeActiveOutCalls, nasCurrentlyActiveOutCalls=nasCurrentlyActiveOutCalls, nasInCallAbnormalCompletions=nasInCallAbnormalCompletions, lsFailureTimeStamp=lsFailureTimeStamp, alarmStatusInt1=alarmStatusInt1, csgComplexStateTrapClear=csgComplexStateTrapClear, partitionPercentFull=partitionPercentFull, systemCPUUsage=systemCPUUsage, destPointCode=destPointCode, destInaccessIndex=destInaccessIndex, nasTempFailInCallRejects=nasTempFailInCallRejects, destinationTable=destinationTable, destinationTableEntry=destinationTableEntry, trunkGroupCLLI=trunkGroupCLLI, nasName=nasName, TimeString=TimeString, currentlyActiveDigitalInCalls=currentlyActiveDigitalInCalls, linksetTable=linksetTable, cplxLocEthernetName=cplxLocEthernetName, genericWarning=genericWarning, phoneDialCallAttempts=phoneDialCallAttempts, ss7MTP2TrunkFailureAlarm=ss7MTP2TrunkFailureAlarm, compRestartKey=compRestartKey, linkAlignIPAddress=linkAlignIPAddress, nasCurrentlyActiveInCalls=nasCurrentlyActiveInCalls, linkFailures=linkFailures, ss7MTP3CongestionCritical=ss7MTP3CongestionCritical, contextSwitchRate=contextSwitchRate, nasCumulativeActiveOutCalls=nasCumulativeActiveOutCalls, compDebugKey=compDebugKey, rLCTimerExpiries=rLCTimerExpiries, routeId=routeId, userUnavailableInCallRejects=userUnavailableInCallRejects, outCallNormalCompletions=outCallNormalCompletions, linkHostname=linkHostname, nasCallOMTable=nasCallOMTable, compProvStateStatus=compProvStateStatus, phoneOtherDialCallRejects=phoneOtherDialCallRejects, cisRetrievalFailureTrapMajor=cisRetrievalFailureTrapMajor, maintenanceOMs=maintenanceOMs, trunkOutCallAttempts=trunkOutCallAttempts, phoneNumber=phoneNumber, icName=icName, ncSoftwareVersion=ncSoftwareVersion, linkIndex=linkIndex, ss7DestinationCongestedAlarmTableEntry=ss7DestinationCongestedAlarmTableEntry, ifTimeStamp=ifTimeStamp, partitionSpaceStatus=partitionSpaceStatus, linkCardDeviceName=linkCardDeviceName, maxCPUUsage=maxCPUUsage, mateServerHostName=mateServerHostName, linkNumMSUDiscarded=linkNumMSUDiscarded, inCallAbnormalCompletions=inCallAbnormalCompletions, ncServerId=ncServerId, serverCLLI=serverCLLI, inservicePorts=inservicePorts, ncEthernetName=ncEthernetName, nasMaxPortsUsed=nasMaxPortsUsed, lsTimeStamp=lsTimeStamp, ss7LinkAlignmentFailureClear=ss7LinkAlignmentFailureClear, phoneCurrentlyActiveDialCalls=phoneCurrentlyActiveDialCalls, phoneUserUnavailableDialCallRejects=phoneUserUnavailableDialCallRejects, csg=csg, ncFoundServerTrap=ncFoundServerTrap, systemOMs=systemOMs, ncClusterIP=ncClusterIP, compSecsInCurrentState=compSecsInCurrentState, abnormalReleaseInCallRejects=abnormalReleaseInCallRejects, nasCumulativeActiveInCalls=nasCumulativeActiveInCalls, ncAvailabilityState=ncAvailabilityState, inserviceCards=inserviceCards, trunkCumulativeActiveOutCalls=trunkCumulativeActiveOutCalls, linkAlignTimeStamp=linkAlignTimeStamp, hgAlarmTableEntry=hgAlarmTableEntry, trunkUserBusyInCallRejects=trunkUserBusyInCallRejects, csgComplexCLLI=csgComplexCLLI, linkAlignLinkCode=linkAlignLinkCode, destState=destState, ifIndex=ifIndex, ss7LinksetFailureAlarmTable=ss7LinksetFailureAlarmTable, uBATimerExpiries=uBATimerExpiries, ss7DestinationCongestedAlarmTable=ss7DestinationCongestedAlarmTable, alarmMaskInt1=alarmMaskInt1, lfKey=lfKey, lastUpdateOMFile=lastUpdateOMFile, linkAlignCardId=linkAlignCardId, genericNormal=genericNormal, lfLinkCode=lfLinkCode, lcTimeStamp=lcTimeStamp, nasStatusClear=nasStatusClear, currentlyActiveDigitalOutCalls=currentlyActiveDigitalOutCalls, LinkCongestionState=LinkCongestionState, nasKey=nasKey, cplxLocOperationalState=cplxLocOperationalState, linkNumMSUTransmitted=linkNumMSUTransmitted, linkCongestions=linkCongestions, ncStandbyState=ncStandbyState, ss7ISUPCongestionAlarmTable=ss7ISUPCongestionAlarmTable, nasOtherOutCallRejects=nasOtherOutCallRejects, linkInhibitionState=linkInhibitionState, genericMinor=genericMinor, hgAlarmTable=hgAlarmTable, ncOperationalState=ncOperationalState, phoneCurrentlyActiveAnalogDialCalls=phoneCurrentlyActiveAnalogDialCalls, trunkUserUnavailableInCallRejects=trunkUserUnavailableInCallRejects, UpgradeInProgress=UpgradeInProgress, alarms=alarms, compDebugTimeStamp=compDebugTimeStamp, cplxMateEthernetIP=cplxMateEthernetIP, trunkCallOMIndex=trunkCallOMIndex, lfName=lfName, userBusyInCallRejects=userBusyInCallRejects, linkRemoteProcOutages=linkRemoteProcOutages, trapGenericStr1=trapGenericStr1, linkAlignKey=linkAlignKey, genericCritical=genericCritical, abnormalReleaseOutCallRejects=abnormalReleaseOutCallRejects, ncServer=ncServer, compProvStateTimeStamp=compProvStateTimeStamp, ss7LinkAlignmentAlarmTableEntry=ss7LinkAlignmentAlarmTableEntry, mtp3Name=mtp3Name, destCongestKey=destCongestKey, hgStatusClear=hgStatusClear, trapName=trapName, userCPUUsage=userCPUUsage, linkOMTable=linkOMTable, ss7ISUPFailureAlarm=ss7ISUPFailureAlarm, ss7MTP3CongestionMinor=ss7MTP3CongestionMinor, partitionIndex=partitionIndex, genericMajor=genericMajor, lcLinkCode=lcLinkCode, alarmMaskInt2=alarmMaskInt2, ncStateChangeTrap=ncStateChangeTrap, ss7MTP3CongestionAlarmTable=ss7MTP3CongestionAlarmTable, remoteBusyInCCSs=remoteBusyInCCSs, csgComplexStateTrapInfo=csgComplexStateTrapInfo, aliveNASes=aliveNASes, destCongestIPAddress=destCongestIPAddress, trunkGroupOMs=trunkGroupOMs, otherOutCallRejects=otherOutCallRejects, lsFailurePointcode=lsFailurePointcode, trapFileName=trapFileName, ss7LinkAlignmentAlarmTable=ss7LinkAlignmentAlarmTable, destIndex=destIndex, destCongestName=destCongestName, nasCurrentlyInUsePorts=nasCurrentlyInUsePorts, systemCallRate=systemCallRate, mtp2TimeStamp=mtp2TimeStamp, linkNumUnexpectedMsgs=linkNumUnexpectedMsgs, trapCompName=trapCompName, linkNumSIFTransmitted=linkNumSIFTransmitted, ncEthernetIP=ncEthernetIP, nortel=nortel, tempFailOutCallRejects=tempFailOutCallRejects, inserviceCircuits=inserviceCircuits, destInaccessIPAddress=destInaccessIPAddress, linksetState=linksetState, cplxLocAvailabilityState=cplxLocAvailabilityState, nasOutCallAbnormalCompletions=nasOutCallAbnormalCompletions, ss7LinkFailureAlarmTable=ss7LinkFailureAlarmTable, ss7LinkCongestionAlarm=ss7LinkCongestionAlarm, restartStateClear=restartStateClear, alarmStatusInt2=alarmStatusInt2, trunkCurrentlyActiveDigitalInCalls=trunkCurrentlyActiveDigitalInCalls, ss7ISUPCongestionClear=ss7ISUPCongestionClear, lfIndex=lfIndex, linkTableEntry=linkTableEntry, mtp2Name=mtp2Name, mtp3IPAddress=mtp3IPAddress, ncUpgradeInProgress=ncUpgradeInProgress, nasOutCallAttempts=nasOutCallAttempts, lfLinkSet=lfLinkSet, provisionedCircuits=provisionedCircuits, partitionTable=partitionTable, ss7LinkCongestionAlarmTable=ss7LinkCongestionAlarmTable, serverMemSize=serverMemSize, ss7LinkFailureClear=ss7LinkFailureClear, trunkInCallAttempts=trunkInCallAttempts, mtp2Index=mtp2Index, trapIdKey=trapIdKey, phoneCallOMTableEntry=phoneCallOMTableEntry, ss7LinksetFailureAlarm=ss7LinksetFailureAlarm) mibBuilder.exportSymbols("InternetThruway-MIB", icIPAddress=icIPAddress, trunkCumulativeActiveInCalls=trunkCumulativeActiveInCalls, lfTimeStamp=lfTimeStamp, ss7LinkFailureAlarm=ss7LinkFailureAlarm, partitionMegsFree=partitionMegsFree, compStateClear=compStateClear, lsFailureIndex=lsFailureIndex, cumulativeActiveInCalls=cumulativeActiveInCalls, ss7LinksetFailureClear=ss7LinksetFailureClear, linksetId=linksetId, linkOMSetId=linkOMSetId, hgKey=hgKey, csgComplexStateTrapCritical=csgComplexStateTrapCritical, linkNumMSUReceived=linkNumMSUReceived, ss7LinksetFailureAlarmTableEntry=ss7LinksetFailureAlarmTableEntry, partitionName=partitionName, icKey=icKey, ss7MTP3CongestionMajor=ss7MTP3CongestionMajor, icCongestionLevel=icCongestionLevel, trunkCurrentlyActiveOutCalls=trunkCurrentlyActiveOutCalls, avgLoad=avgLoad, compDebugOff=compDebugOff, nasCurrentlyActiveDigitalInCalls=nasCurrentlyActiveDigitalInCalls, destCongestIndex=destCongestIndex, restartStateAlarm=restartStateAlarm, trunkInCallAbnormalCompletions=trunkInCallAbnormalCompletions, trunkAbnormalReleaseInCallRejects=trunkAbnormalReleaseInCallRejects, linksetIndex=linksetIndex, mtp2IPAddress=mtp2IPAddress, ifIPAddress=ifIPAddress, lsFailureName=lsFailureName, nasAlarmTimeStamp=nasAlarmTimeStamp, trafficInCCSIncomings=trafficInCCSIncomings, nasTempFailOutCallRejects=nasTempFailOutCallRejects, routeState=routeState, DestinationState=DestinationState, linkInhibits=linkInhibits, compRestartTimeStamp=compRestartTimeStamp, ss7MTP3CongestionClear=ss7MTP3CongestionClear, nasInCallNormalCompletions=nasInCallNormalCompletions, MTP2AlarmConditionType=MTP2AlarmConditionType, linkId=linkId, ss7ISUPFailureClear=ss7ISUPFailureClear, componentName=componentName, lcCardId=lcCardId, nasOMs=nasOMs, disk=disk, nasIndex=nasIndex, trunkCurrentlyActiveAnalogOutCalls=trunkCurrentlyActiveAnalogOutCalls, ncClusterName=ncClusterName, trunkCurrentlyActiveDigitalOutCalls=trunkCurrentlyActiveDigitalOutCalls, routeDestPointCode=routeDestPointCode, LinkState=LinkState, nasAlarmTable=nasAlarmTable, destCongestTimeStamp=destCongestTimeStamp, cplxAlarmStatus=cplxAlarmStatus, lsIndex=lsIndex, ss7=ss7, nasAbnormalReleaseOutCallRejects=nasAbnormalReleaseOutCallRejects, currentlyActiveOutCalls=currentlyActiveOutCalls, ComponentIndex=ComponentIndex, hgIndex=hgIndex, lostServerAlarmTable=lostServerAlarmTable, localBusyInCCSs=localBusyInCCSs, currentlyActiveAnalogOutCalls=currentlyActiveAnalogOutCalls, ss7LinkCongestionClear=ss7LinkCongestionClear, ss7DestinationCongestedClear=ss7DestinationCongestedClear, mtp3CongestionLevel=mtp3CongestionLevel, callOMs=callOMs, tempFailInCallRejects=tempFailInCallRejects, lcIndex=lcIndex, trunkOutCallAbnormalCompletions=trunkOutCallAbnormalCompletions, phoneUserBusyDialCallRejects=phoneUserBusyDialCallRejects, ss7ISUPCongestionAlarm=ss7ISUPCongestionAlarm, linkAlignIndex=linkAlignIndex, inCallNormalCompletions=inCallNormalCompletions, ifName=ifName, currentlyActiveAnalogInCalls=currentlyActiveAnalogInCalls, routeRank=routeRank, phoneDialCallAbnormalCompletions=phoneDialCallAbnormalCompletions, phoneTempFailDialCallRejects=phoneTempFailDialCallRejects, otherInCallRejects=otherInCallRejects, routeTableEntry=routeTableEntry, trapDate=trapDate, userUnavailableOutCallRejects=userUnavailableOutCallRejects, trapIPAddress=trapIPAddress, cplxMateEthernetName=cplxMateEthernetName, phoneCallOMTable=phoneCallOMTable, serverIpAddress=serverIpAddress, trunkTempFailOutCallRejects=trunkTempFailOutCallRejects, compRestartStatus=compRestartStatus, nasOutCallNormalCompletions=nasOutCallNormalCompletions, ss7DestinationInaccessible=ss7DestinationInaccessible, bLATimerExpiries=bLATimerExpiries, trunkAllActiveCalls=trunkAllActiveCalls, destInaccessName=destInaccessName, system=system, nasOtherInCallRejects=nasOtherInCallRejects, cplxName=cplxName, trunkUserBusyOutCallRejects=trunkUserBusyOutCallRejects, nasInCallAttempts=nasInCallAttempts, lcName=lcName, nasCurrentlyActiveAnalogOutCalls=nasCurrentlyActiveAnalogOutCalls, dialaccess=dialaccess, trapTimeStamp=trapTimeStamp, trunkCurrentlyActiveInCalls=trunkCurrentlyActiveInCalls, linkNumAutoChangeovers=linkNumAutoChangeovers, diskSpaceClear=diskSpaceClear, omData=omData, linkAlignName=linkAlignName, nasName1=nasName1, ss7LinkFailureAlarmTableEntry=ss7LinkFailureAlarmTableEntry, etherCardTrapMajor=etherCardTrapMajor, LinkInhibitionState=LinkInhibitionState, components=components, linkCongestionState=linkCongestionState, ss7MTP3CongestionAlarmTableEntry=ss7MTP3CongestionAlarmTableEntry, destInaccessKey=destInaccessKey, trunkCallOMTable=trunkCallOMTable, alarmStatusInt3=alarmStatusInt3, ss7ISUPCongestionAlarmTableEntry=ss7ISUPCongestionAlarmTableEntry, ifKey=ifKey, serverHostName=serverHostName, compProvStateKey=compProvStateKey, nasMinPortsUsed=nasMinPortsUsed, etherCardTrapCritical=etherCardTrapCritical, ComponentSysmanState=ComponentSysmanState, trunkCurrentlyActiveAnalogInCalls=trunkCurrentlyActiveAnalogInCalls, nasAbnormalReleaseInCallRejects=nasAbnormalReleaseInCallRejects, ss7ISUPFailureAlarmTable=ss7ISUPFailureAlarmTable, mtp2AlarmCondition=mtp2AlarmCondition, trunkOutCallNormalCompletions=trunkOutCallNormalCompletions, etherCardTrapClear=etherCardTrapClear, linkTransmittedMSUs=linkTransmittedMSUs, cplxLocEthernetIP=cplxLocEthernetIP, traps=traps, ncServerName=ncServerName, phoneCumulativeActiveDialCalls=phoneCumulativeActiveDialCalls, partitionTableEntry=partitionTableEntry, linkOMId=linkOMId, csgComplexStateTrapMajor=csgComplexStateTrapMajor, ncHostName=ncHostName, numberOfCircuits=numberOfCircuits, linkTable=linkTable, ss7MTP2TrunkFailureAlarmTable=ss7MTP2TrunkFailureAlarmTable, trunkInCallNormalCompletions=trunkInCallNormalCompletions, linkAlignmentState=linkAlignmentState, outCallAbnormalCompletions=outCallAbnormalCompletions, nasCallOMIndex=nasCallOMIndex, phoneAbnormalReleaseDialCallRejects=phoneAbnormalReleaseDialCallRejects, destRuleId=destRuleId, nasCmplxName=nasCmplxName, lsFailureIPAddress=lsFailureIPAddress, partitionSpaceKey=partitionSpaceKey, ss7DestinationInaccessibleAlarmTableEntry=ss7DestinationInaccessibleAlarmTableEntry, hgStatusAlarm=hgStatusAlarm, inCallAttempts=inCallAttempts, linkState=linkState, ss7MTP2TrunkFailureClear=ss7MTP2TrunkFailureClear, nasAllActiveCalls=nasAllActiveCalls, compDebugOn=compDebugOn, destCongestCongestionLevel=destCongestCongestionLevel, mtp3Key=mtp3Key, linkReceivedMSUs=linkReceivedMSUs, ss7LinkAlignmentFailureAlarm=ss7LinkAlignmentFailureAlarm, linksetAdjPointcode=linksetAdjPointcode, routeLinksetId=routeLinksetId, phoneCurrentlyActiveDigitalDialCalls=phoneCurrentlyActiveDigitalDialCalls, nasCurrentlyActiveAnalogInCalls=nasCurrentlyActiveAnalogInCalls, trunkTempFailInCallRejects=trunkTempFailInCallRejects, trunkCallOMTableEntry=trunkCallOMTableEntry, diskSpaceAlarm=diskSpaceAlarm, mtp3Index=mtp3Index, nasUserBusyOutCallRejects=nasUserBusyOutCallRejects, lsFailureKey=lsFailureKey, hgAlarmTimeStamp=hgAlarmTimeStamp, mtp3TimeStamp=mtp3TimeStamp, componentTableEntry=componentTableEntry, outCallAttempts=outCallAttempts, cplxLocStandbyState=cplxLocStandbyState, trunkAbnormalReleaseOutCallRejects=trunkAbnormalReleaseOutCallRejects, destInaccessTimeStamp=destInaccessTimeStamp)
# -*- coding: utf-8 -*- """ Created on Tue Oct 20 16:04:52 2020 @author: rjovelin """
# 2. Repeat Strings # Write a Program That Reads a list of strings. Each string is repeated N times, where N is the length of the string. Print the concatenated string. strings = input().split() output_string = "" for string in strings: N = len(string) output_string += string * N print(output_string)
def dfs(V): print(V, end=' ') visited[V] = True for n in graph[V]: if not visited[n]: dfs(n) def dfs_s(V): stack = [V] visited[V] = True while stack: now = stack.pop() print(now, end=' ') for n in graph[now]: if not visited[n]: stack.append(n) visited[n] = True def bfs(V): visited[V] = True queue = [V] while queue: now = queue.pop(0) print(now, end=' ') for n in graph[now]: if not visited[n]: queue.append(n) visited[n] = True N, M, V = map(int, input().strip().split()) visited = [False] * (N + 1) graph = [[] for _ in range(N + 1)] for i in range(M): a, b = map(int, input().strip().split()) graph[a].append(b) graph[b].append(a) for i in range(1, N + 1): graph[i].sort() dfs(V) visited = [False] * (N + 1) print() bfs(V)
# Time Complexity - O(n) ; Space Complexity - O(n) class Solution: def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: carry = 0 out = temp = ListNode() while l1 is not None and l2 is not None: tempsum = l1.val + l2.val tempsum += carry if tempsum > 9: carry = tempsum//10 tempsum %= 10 else: carry = 0 temp.next = ListNode(tempsum) temp = temp.next l1 = l1.next l2 = l2.next if l1: while l1: tempsum = l1.val + carry if tempsum > 9: carry = tempsum//10 tempsum %= 10 else: carry = 0 temp.next = ListNode(tempsum) temp = temp.next l1 = l1.next elif l2: while l2: tempsum = l2.val + carry if tempsum > 9: carry = tempsum//10 tempsum %= 10 else: carry = 0 temp.next = ListNode(tempsum) temp = temp.next l2 = l2.next if carry: temp.next = ListNode(carry) return out.next
_base_ = [ '../_base_/models/faster_rcnn_r50_fpn.py' ] model = dict( type='FasterRCNN', # pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch'), neck=dict( type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, num_outs=5), rpn_head=dict( type='RPNHead', in_channels=256, feat_channels=256, anchor_generator=dict( type='AnchorGenerator', scales=[8], ratios=[0.5, 1.0, 2.0], strides=[4, 8, 16, 32, 64]), bbox_coder=dict( type='DeltaXYWHBBoxCoder', target_means=[.0, .0, .0, .0], target_stds=[1.0, 1.0, 1.0, 1.0]), loss_cls=dict( type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0), loss_bbox=dict(type='L1Loss', loss_weight=1.0)), roi_head=dict( # type='StandardRoIHead', _delete_=True, type='KeypointRoIHead', output_heatmaps=False, # keypoint_head=dict( # type='HRNetKeypointHead', # num_convs=8, # in_channels=256, # features_size=[256, 256, 256, 256], # conv_out_channels=512, # num_keypoints=5, # loss_keypoint=dict(type='MSELoss', loss_weight=50.0)), keypoint_decoder=dict(type='HeatmapDecodeOneKeypoint', upscale=4), bbox_roi_extractor=dict( type='SingleRoIExtractor', roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0), out_channels=256, featmap_strides=[4, 8, 16, 32]), bbox_head=dict( type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=80, bbox_coder=dict( type='DeltaXYWHBBoxCoder', target_means=[0., 0., 0., 0.], target_stds=[0.1, 0.1, 0.2, 0.2]), reg_class_agnostic=False, loss_cls=dict( type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='L1Loss', loss_weight=1.0))) ) #optimizer = dict(lr=0.002) #lr_config = dict(step=[40, 55]) #total_epochs = 60
# Binary Search Tree # Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. # # Example: # # Input: # # 1 # \ # 3 # / # 2 # # Output: # 1 # # Explanation: # The minimum absolute difference is 1, which is the difference between 2 and 1 (or between 2 and 3). # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def getMinimumDifference(self, root): """ :type root: TreeNode :rtype: int """ self.minDiff = [] def travel(node): if not node: return self.minDiff.append(node.val) L = travel(node.left) R = travel(node.right) travel(root) self.minDiff = sorted(self.minDiff) return min(abs(a - b) for a, b in zip(self.minDiff, self.minDiff[1:]))
""" ``exposing`` """ __version__ = '0.2.2'
# Message class Implementation # @author: Gaurav Yeole <gauravyeole@gmail.com> class Message: class Request: def __init__(self, action="", data=None): self.action = action self.data = data class Rsponse: def __init__(self): self.status = False self.data = None def __init__(self): pass def set_request(self): pass def response(self): pass
# # PySNMP MIB module CISCO-VSI-CONTROLLER-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-VSI-CONTROLLER-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:03:33 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "SingleValueConstraint") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") ObjectIdentity, NotificationType, Gauge32, Bits, Unsigned32, IpAddress, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, Counter32, Counter64, iso, Integer32, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "NotificationType", "Gauge32", "Bits", "Unsigned32", "IpAddress", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "Counter32", "Counter64", "iso", "Integer32", "TimeTicks") TextualConvention, RowStatus, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString") ciscoVSIControllerMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 141)) if mibBuilder.loadTexts: ciscoVSIControllerMIB.setLastUpdated('9906080000Z') if mibBuilder.loadTexts: ciscoVSIControllerMIB.setOrganization('Cisco Systems, Inc.') class CvcControllerShelfLocation(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("internal", 1), ("external", 2)) class CvcControllerType(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("par", 1), ("pnni", 2), ("lsc", 3)) cvcMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 141, 1)) cvcConfController = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 141, 1, 1)) cvcConfTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 141, 1, 1, 1), ) if mibBuilder.loadTexts: cvcConfTable.setStatus('current') cvcConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 141, 1, 1, 1, 1), ).setIndexNames((0, "CISCO-VSI-CONTROLLER-MIB", "cvcConfControllerID")) if mibBuilder.loadTexts: cvcConfEntry.setStatus('current') cvcConfControllerID = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 141, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: cvcConfControllerID.setStatus('current') cvcConfControllerType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 141, 1, 1, 1, 1, 2), CvcControllerType()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cvcConfControllerType.setStatus('current') cvcConfControllerShelfLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 141, 1, 1, 1, 1, 3), CvcControllerShelfLocation()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cvcConfControllerShelfLocation.setStatus('current') cvcConfControllerLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 141, 1, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cvcConfControllerLocation.setStatus('current') cvcConfControllerName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 141, 1, 1, 1, 1, 5), DisplayString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cvcConfControllerName.setStatus('current') cvcConfVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 141, 1, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4095))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cvcConfVpi.setStatus('current') cvcConfVci = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 141, 1, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(32, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cvcConfVci.setStatus('current') cvcConfRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 141, 1, 1, 1, 1, 8), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cvcConfRowStatus.setStatus('current') cvcMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 141, 3)) cvcMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 141, 3, 1)) cvcMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 141, 3, 2)) cvcMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 141, 3, 1, 1)).setObjects(("CISCO-VSI-CONTROLLER-MIB", "cvcConfGroup"), ("CISCO-VSI-CONTROLLER-MIB", "cvcConfGroupExternal")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cvcMIBCompliance = cvcMIBCompliance.setStatus('current') cvcConfGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 141, 3, 2, 1)).setObjects(("CISCO-VSI-CONTROLLER-MIB", "cvcConfControllerType"), ("CISCO-VSI-CONTROLLER-MIB", "cvcConfControllerShelfLocation"), ("CISCO-VSI-CONTROLLER-MIB", "cvcConfControllerLocation"), ("CISCO-VSI-CONTROLLER-MIB", "cvcConfControllerName"), ("CISCO-VSI-CONTROLLER-MIB", "cvcConfRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cvcConfGroup = cvcConfGroup.setStatus('current') cvcConfGroupExternal = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 141, 3, 2, 2)).setObjects(("CISCO-VSI-CONTROLLER-MIB", "cvcConfVpi"), ("CISCO-VSI-CONTROLLER-MIB", "cvcConfVci")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cvcConfGroupExternal = cvcConfGroupExternal.setStatus('current') mibBuilder.exportSymbols("CISCO-VSI-CONTROLLER-MIB", cvcConfTable=cvcConfTable, cvcMIBGroups=cvcMIBGroups, cvcConfControllerType=cvcConfControllerType, cvcConfVpi=cvcConfVpi, CvcControllerShelfLocation=CvcControllerShelfLocation, cvcConfControllerLocation=cvcConfControllerLocation, cvcConfController=cvcConfController, cvcConfControllerName=cvcConfControllerName, PYSNMP_MODULE_ID=ciscoVSIControllerMIB, cvcConfControllerID=cvcConfControllerID, cvcConfGroupExternal=cvcConfGroupExternal, cvcMIBCompliance=cvcMIBCompliance, cvcConfEntry=cvcConfEntry, ciscoVSIControllerMIB=ciscoVSIControllerMIB, cvcConfControllerShelfLocation=cvcConfControllerShelfLocation, cvcConfRowStatus=cvcConfRowStatus, cvcConfGroup=cvcConfGroup, CvcControllerType=CvcControllerType, cvcConfVci=cvcConfVci, cvcMIBObjects=cvcMIBObjects, cvcMIBCompliances=cvcMIBCompliances, cvcMIBConformance=cvcMIBConformance)
class SceneRelation: def __init__(self): self.on_ground = set() self.on_block = {} self.clear = set() def print_relation(self): print(self.on_ground) print(self.on_block) print(self.clear)
def _jpeg_compression(im): assert torch.is_tensor(im) im = ToPILImage()(im) savepath = BytesIO() im.save(savepath, 'JPEG', quality=75) im = Image.open(savepath) im = ToTensor()(im) return im
# -*- coding: utf-8 -*- """ Created on Tue Oct 22 15:58:44 2019 @author: babin """ posits_def = [251, 501, 751, 1001, 1251, 1501, 1751, 2001, 2251, 2501, 2751, 3001, 3215] dist_whole_align_ref = {'AB048704.1_genotype_C_': [0.88, 0.938, 0.914, 0.886, 0.89, 0.908, 0.938, 0.948, 0.948, 0.886, 0.852, 0.8580645161290322, 0.827906976744186], 'AB010291.1_Bj': [0.968, 0.986, 0.946, 0.92, 0.94, 0.964, 0.95, 0.892, 0.914, 0.9359999999999999, 0.924, 0.935483870967742, 0.9255813953488372]} dist_win_250_shift_100_ref = {'AB048704.1_genotype_C_': [0.87, 0.9, 0.9359999999999999, 0.924, 0.944, 0.944, 0.948, 0.888, 0.868, 0.86, 0.888, 0.9, 0.908, 0.88, 0.916, 0.924, 0.94, 0.96, 0.948, 0.9319999999999999, 0.944, 0.9359999999999999, 0.96, 0.9319999999999999, 0.864, 0.8200000000000001, 0.88, 0.892, 0.88, 0.844, 0.827906976744186, 0.8608695652173913, 0.9333333333333333], 'AB010291.1_Bj': [0.95, 0.984, 0.988, 0.984, 0.98, 0.98, 0.98, 0.92, 0.896, 0.888, 0.928, 0.94, 0.96, 0.948, 0.976, 0.976, 0.968, 0.952, 0.896, 0.844, 0.86, 0.908, 0.976, 0.948, 0.916, 0.904, 0.9359999999999999, 0.948, 0.94, 0.9359999999999999, 0.9255813953488372, 0.9217391304347826, 0.8666666666666667]} dist_whole_align_def_params_k2p = {'AB048704.1_genotype_C_': [0.8681719101219889, 0.9351731626008992, 0.9083728156043438, 0.8750271283550077, 0.879929128403318, 0.9015597329057567, 0.9351297624958606, 0.9459250442159328, 0.9459717143364927, 0.8760802380420646, 0.8343273948904422, 0.841497348083017, 0.8033200314745574], 'AB010291.1_Bj': [0.9671530980992109, 0.9858456107911616, 0.9438329817983037, 0.9150569322625627, 0.9372918193486423, 0.9630251291666885, 0.9481456308045444, 0.8823622232289046, 0.9077377632214376, 0.9325670957791264, 0.919398127767968, 0.9323907045444492, 0.9211964811945209]}
#!/usr/bin/env python3 # pylint: disable=C0103 # pylint: disable=R0902 # pylint: disable=R0903 # pylint: disable=R0913 """ Définie la classe TableBorder """ class TableBorder: """ Facillite l'usage de l'UNICODE """ def __init__(self, top_left, top_split, top_right, mid_left, mid_split, mid_right, low_left, low_split, low_right, horizontal, vertical): """ Constructeur """ self.top_left = top_left self.top_split = top_split self.top_right = top_right self.mid_left = mid_left self.mid_split = mid_split self.mid_right = mid_right self.low_left = low_left self.low_split = low_split self.low_right = low_right self.horizontal = horizontal self.vertical = vertical BORDERS = [TableBorder('+', '+', '+',\ '+', '+', '+',\ '+', '+', '+',\ '-', '|'), TableBorder(u'\u250c', u'\u252C', u'\u2510',\ u'\u251C', u'\u253C', u'\u2524',\ u'\u2514', u'\u2534', u'\u2518',\ u'\u2500', u'\u2502'), TableBorder(u'\u2554', u'\u2566', u'\u2557',\ u'\u2560', u'\u256C', u'\u2563',\ u'\u255a', u'\u2569', u'\u255d',\ u'\u2550', u'\u2551') ]
""" This file contains meta information and default configurations of the project """ RSC_YEARS = [1660, 1670, 1680, 1690, 1700, 1710, 1720, 1730, 1740, 1750, 1760, 1770, 1780, 1790, 1800, 1810, 1820, 1830, 1840, 1850, 1860, 1870, 1880, 1890, 1900, 1910, 1920] # cf. Chapter 4.4.1 of the thesis SPACE_PAIR_SELECTION = [(1740,1750), (1750,1760), (1680,1710), (1710,1740), (1740,1770), (1770,1800), (1800,1830), (1830,1860), (1860,1890), (1700,1800), (1800,1900), (1700,1900)] COUPLING_CONFIG = { # Alternatives # parameters passed to the GWOT object 'metric': "cosine", # 'euclidian', 'normalize_vecs': "both", # 'mean', 'whiten', 'whiten_zca' 'normalize_dists': "mean", # 'max', 'median' 'score_type': "coupling", # #TODO fill in the rest of the options in the comments 'adjust': None, # 'csls', ... 'distribs': "uniform", # 'custom', 'zipf' 'share_vocs':False, # True 'size':1000, # 100 is small, 1e4 'max_anchors':100, # used with small couplings (for projection) # parameters to be passed to the optimizer 'opt_loss_fun': "square_loss", # 'kl_loss' 'opt_entropic': True, # False 'opt_entreg': 5e-4, # stay within the range of e-4 (originally: 1e-4) 'opt_tol': 1e-9, # no limits 'opt_round_g': False, # True 'opt_compute_accuracy': False, # True would require a test dict, but that's not implemented! 'opt_gpu': False, # GPU optimization not tested # parameters for calling fit() 'fit_maxiter': 300, # no limits; normally converges within 150 iterations 'fit_tol': 1e-9, # no limits 'fit_plot_every': 100000, # normally 20; 'deactivate' the file spam by choosing a large value 'fit_print_every': 1, # no limits 'fit_verbose': True, # False 'fit_save_plots': None # "/my_dir/my_optimizer_plots" } DIST_SHAPES = ['uniform', 'zipf', 'custom'] SHIFT_EXPERIMENTS = ["all", "unsup_bi", "unsup_mono", "dis_tech"]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # michael a.g. aïvázis # orthologue # (c) 1998-2021 all rights reserved # # """ When a metaclass understands the extra keywords that can be passed during class declaration, it has to override all these to accommodate the change in signature """ class meta(type): @classmethod def __prepare__(metacls, name, bases, **kwds): assert metacls.__name__ == 'meta' assert name in ['base', 'derived'] if name == 'base': assert bases == (object,) assert kwds == {'arg1': True, 'arg2': False} if name == 'derived': assert bases == (base,) assert kwds == {'arg1': False, 'arg2': True} return super().__prepare__(name, bases) def __new__(metacls, name, bases, attributes, **kwds): assert metacls.__name__ == 'meta' assert name in ['base', 'derived'] if name == 'base': assert bases == (object,) assert kwds == {'arg1': True, 'arg2': False} if name == 'derived': assert bases == (base,) assert kwds == {'arg1': False, 'arg2': True} return super().__new__(metacls, name, bases, attributes) def __init__(self, name, bases, attributes, **kwds): assert self.__name__ in ['base', 'derived'] if self.__name__ == 'base': assert bases == (object,) assert kwds == {'arg1': True, 'arg2': False} if self.__name__ == 'derived': assert bases == (base,) assert kwds == {'arg1': False, 'arg2': True} super().__init__(name, bases, attributes) return class base(object, metaclass=meta, arg1=True, arg2=False): def __init__(self, **kwds): assert type(self).__name__ == 'base' assert kwds == {} return class derived(base, arg1=False, arg2=True): def __init__(self, **kwds): assert type(self).__name__ == 'derived' assert kwds == {} return def test(): b = base() d = derived() return # main if __name__ == "__main__": test() # end of file
# ------------------------------ # 200. Number of Islands # # Description: # Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. # # Example 1: # 11110 # 11010 # 11000 # 00000 # Answer: 1 # # Example 2: # 11000 # 11000 # 00100 # 00011 # Answer: 3 # # Version: 1.0 # 11/13/17 by Jianfa # ------------------------------ class Solution(object): def numIslands(self, grid): """ :type grid: List[List[str]] :rtype: int """ def sink(i, j): if 0 <= i < len(grid) and 0 <= j < len(grid[0]) and grid[i][j] == "1": grid[i][j] = "0" map(sink, (i+1, i-1, i, i), (j, j, j+1, j-1)) return 1 return 0 return sum(sink(i, j) for i in range(len(grid)) for j in range(len(grid[i]))) # ------------------------------ # Summary: # Copied from discussion. # The following is another easy understanding idea: # # class Solution(object): # def numIslands(self, grid): # """ # :type grid: List[List[str]] # :rtype: int # """ # if len(grid) == 0: return 0 # m = len(grid) # n = len(grid[0]) # res = 0 # for i in range(m): # for j in range(n): # if grid[i][j] == '1': # res += 1 # grid[i][j] = '2' # self.island(i, j, grid, m, n) # return res # def island(self, x, y, grid, m, n): # if x + 1 < m and grid[x+1][y] == '1': # grid[x+1][y] = '2' # self.island(x+1,y,grid, m, n) # if y + 1 < n and grid[x][y+1] == '1': # grid[x][y+1] = '2' # self.island(x,y+1,grid, m, n) # if x -1 >=0 and grid[x-1][y] == '1': # grid[x-1][y] = '2' # self.island(x-1,y,grid, m, n) # if y - 1 >= 0 and grid[x][y-1] == '1': # grid[x][y-1] = '2' # self.island(x,y-1,grid, m, n)
# Exercício Python 56: Desenvolva um programa que leia o nome, idade e sexo de 4 pessoas. No final do programa, mostre: a média de idade do grupo, qual é o nome do homem mais velho e quantas mulheres têm menos de 20 anos. mediaidade = '' nomelista = [] idadelista = [] sexolista = [] homens = [] mulherescommenosde20 = 0 nomedelas = [] # ------------------------------------------------------------------- for i in range(1,5): print(f'{i} PESSOA') nome = (input('Seu nome: ')) idade = int(input('Sua idade: ')) sexo = int(input('Sexo? [0]Masculino [1]Feminino: ')) if sexo == 1 and idade < 20: nomedelas.append(nome) mulherescommenosde20 += 1 elif sexo == 0: homens.append(nome) # Adcionei todas idades em uma lista idadelista.append(idade) # Tirei a média dessas idades //Primeira parte mediaidade = ((sum(idadelista))/4) # Adcionei todos os nomes em uma lista nomelista.append(nome) # ------------------------------------------------------------------- # Armazenei em maximo o maior valor encontrado dentro de uma lista maximo = max(idadelista) # Armazenei em idadexidade o INDEX do maior valor indexidade = idadelista.index(maximo) # Armazenei em indexnome a posição de quem tem a maior idade indexnome = nomelista[indexidade] # ------------------------------------------------------------------- print(f'A media das idades é: {mediaidade}') print(f'A pessoa que tem a maior idade, com {maximo} é essa: {indexnome}') print(f'As mulheres que possuem menos de 20 anos: {mulherescommenosde20} e são: {nomedelas}')
load("@wix_oss_infra//:import_external.bzl", import_external = "safe_wix_scala_maven_import_external") def dependencies(): import_external( name = "org_specs2_specs2_fp_2_12", artifact = "org.specs2:specs2-fp_2.12:4.8.3", artifact_sha256 = "777962ca58054a9ea86e294e025453ecf394c60084c28bd61956a00d16be31a7", srcjar_sha256 = "6b8bd1e7210754b768b68610709271c0dac29447936a976a2a9881389e6404ca", deps = [ "@org_scala_lang_scala_library" ], ) import_external( name = "org_specs2_specs2_common_2_12", artifact = "org.specs2:specs2-common_2.12:4.8.3", artifact_sha256 = "3b08fecb9e21d3903e48b62cd95c19ea9253d466e03fd4cf9dc9227e7c368708", srcjar_sha256 = "b2f148c75d3939b3cd0d58afddd74a8ce03077bb3ccdc93dae55bd9c3993e9c3", deps = [ "@org_scala_lang_modules_scala_parser_combinators_2_12", "@org_scala_lang_modules_scala_xml_2_12", "@org_scala_lang_scala_library", "@org_scala_lang_scala_reflect", "@org_specs2_specs2_fp_2_12" ], ) import_external( name = "org_specs2_specs2_matcher_2_12", artifact = "org.specs2:specs2-matcher_2.12:4.8.3", artifact_sha256 = "aadf27b6d015572b2e3842627c09bf0797153dbb329262ea3bcbbce129d51ad8", srcjar_sha256 = "01251acc28219aa17aabcb9a26a84e1871aa64980d335cd8f83c2bcea6f4f1be", deps = [ "@org_scala_lang_scala_library", "@org_specs2_specs2_common_2_12" ], ) import_external( name = "org_specs2_specs2_core_2_12", artifact = "org.specs2:specs2-core_2.12:4.8.3", artifact_sha256 = "f73f32156a711a4e83e696dc83e269c5a165d62cc3dd7c652617cb03d140d063", srcjar_sha256 = "0e3cebfc7410051b70e627e35f13978add3d061b8f1233741f9b397638f193e9", deps = [ "@org_scala_lang_scala_library", "@org_scala_sbt_test_interface", "@org_specs2_specs2_common_2_12", "@org_specs2_specs2_matcher_2_12" ], ) import_external( name = "org_specs2_specs2_junit_2_12", artifact = "org.specs2:specs2-junit_2.12:4.8.3", artifact_sha256 = "5d7ad2c0b0bc142ea064edb7a1ea75ab7b17ad37e1a621ac7e578823845098e8", srcjar_sha256 = "84edd1cd6291f6686638225fcbaff970ae36da006efabf2228255c2127b2290c", deps = [ "@junit_junit", "@org_scala_lang_scala_library", "@org_scala_sbt_test_interface", "@org_specs2_specs2_core_2_12" ], )
a = int(input()) b = int(input()) c = int(input()) d = int(input()) if a == 0 and b == 0: print("INF") else: if (d - b * c / a) != 0 and (- b / a) == (- b // a): print(- b // a) else: print("NO")
# -*- coding: utf-8 -*- """ Created on Mon Dec 7 19:46:40 2020 @author: Intel """ def displayPathtoPrincess(n,grid): me_i=n//2 me_j=n//2 for i in range(n): if 'p' in grid[i]: pe_i=i for j in range(n): if 'p'==grid[i][j]: pe_j=j break break while((me_i!=pe_i) | (me_j!=pe_j)): if(me_i-pe_i<0): print('DOWN') me_i=me_i+1 elif(me_i-pe_i>0): print('UP') me_i=me_i-1 else: if(me_j-pe_j>0): print('LEFT') me_j=me_j-1 elif(me_j-pe_j<0): print('RIGHT') me_j=me_j+1 else: break m = int(input()) grid = [] for i in range(0, m): grid.append(input().strip()) displayPathtoPrincess(m,grid)
# Copyright (C) 2020 Google Inc. # # This file has been licensed under Apache 2.0 license. Please see the LICENSE # file at the root of the repository. # Build rules for building ebooks. # This is the container CONTAINER = "filipfilmar/ebook-buildenv:1.1" # Use this for quick local runs. #CONTAINER = "ebook-buildenv:local" EbookInfo = provider(fields=["figures", "markdowns"]) # Returns the docker_run script invocation command based on the # script path and its reference directory. # # Params: # script_path: (string) The full path to the script to invoke # dir_reference: (string) The path to a file used for figuring out # the reference directories (build root and repo root). def _script_cmd(script_path, dir_reference): return """\ {script} \ --container={container} \ --dir-reference={dir_reference}""".format( script=script_path, container=CONTAINER, dir_reference=dir_reference, ) def _drawtiming_png_impl(ctx): cmd = "drawtiming" docker_run = ctx.executable._script figures = [] for target in ctx.attr.srcs: for src in target.files.to_list(): in_file = src out_file = ctx.actions.declare_file(in_file.basename + ".png") figures += [out_file] script_cmd = _script_cmd(docker_run.path, in_file.path) ctx.actions.run_shell( progress_message = "timing diagram to PNG with {1}: {0}".format(in_file.short_path, cmd), inputs = [in_file], outputs = [out_file], tools = [docker_run], command = """\ {script} \ {cmd} --output "{out_file}" "{in_file}" """.format( cmd=cmd, out_file=out_file.path, in_file=in_file.path, script=script_cmd), ) deps = [] for target in ctx.attr.deps: ebook_provider = target[EbookInfo] if not ebook_provider: continue deps += ebook_provider.figures runfiles = ctx.runfiles(files = figures) return [ EbookInfo(figures=figures+deps, markdowns=[]), DefaultInfo(files=depset(figures+deps), runfiles=runfiles), ] drawtiming_png = rule(implementation = _drawtiming_png_impl, attrs = { "srcs": attr.label_list( allow_files = [".t"], doc = "The file to compile", ), "deps": attr.label_list( doc = "The dependencies, any targets should be allowed", ), "output": attr.output(doc="The generated file"), "_script": attr.label( default="//build:docker_run", executable=True, cfg="host"), }, doc = "Transform a timing diagram file into png using drawtiming", ) def _generalized_graphviz_rule_impl(ctx, cmd): docker_run = ctx.executable._script figures = [] for target in ctx.attr.srcs: for src in target.files.to_list(): in_file = src out_file = ctx.actions.declare_file(in_file.basename + ".png") figures += [out_file] script_cmd = _script_cmd(docker_run.path, in_file.path) ctx.actions.run_shell( progress_message = "graphviz to PNG with {1}: {0}".format(in_file.short_path, cmd), inputs = [in_file], outputs = [out_file], tools = [docker_run], command = """\ {script} \ {cmd} -Tpng -o "{out_file}" "{in_file}" """.format( cmd=cmd, out_file=out_file.path, in_file=in_file.path, script=script_cmd), ) deps = [] for target in ctx.attr.deps: ebook_provider = target[EbookInfo] if not ebook_provider: continue deps += ebook_provider.figures runfiles = ctx.runfiles(files = figures) return [ EbookInfo(figures=figures+deps, markdowns=[]), DefaultInfo(files=depset(figures+deps), runfiles=runfiles), ] def _neato_png_impl(ctx): return _generalized_graphviz_rule_impl(ctx, "neato") neato_png = rule(implementation = _neato_png_impl, attrs = { "srcs": attr.label_list( allow_files = [".dot"], doc = "The file to compile", ), "deps": attr.label_list( doc = "The dependencies, any targets should be allowed", ), "output": attr.output(doc="The generated file"), "_script": attr.label( default="//build:docker_run", executable=True, cfg="host"), }, doc = "Transform a graphviz dot file into png using neato", ) def _dot_png_impl(ctx): return _generalized_graphviz_rule_impl(ctx, "dot") dot_png = rule(implementation = _dot_png_impl, attrs = { "srcs": attr.label_list( allow_files = [".dot"], doc = "The file to compile", ), "deps": attr.label_list( doc = "The dependencies, any targets should be allowed", ), "output": attr.output(doc="The generated file"), "_script": attr.label( default="//build:docker_run", executable=True, cfg="host"), }, doc = "Transform a graphviz dot file into png using dot", ) def _asymptote_impl(ctx): asycc = ctx.executable._script figures = [] for target in ctx.attr.srcs: for src in target.files.to_list(): in_file = src out_file = ctx.actions.declare_file(in_file.basename + ".png") figures += [out_file] script_cmd = _script_cmd(asycc.path, in_file.path) ctx.actions.run_shell( progress_message = "ASY to PNG: {0}".format(in_file.short_path), inputs = [in_file], outputs = [out_file], tools = [asycc], command = """\ {script} \ asy -render 5 -f png -o "{out_file}" "{in_file}" """.format( out_file=out_file.path, in_file=in_file.path, script=script_cmd), ) deps = [] for target in ctx.attr.deps: ebook_provider = target[EbookInfo] if not ebook_provider: continue deps += ebook_provider.figures runfiles = ctx.runfiles(files=figures+deps) for dep in ctx.attr.deps: runfiles = runfiles.merge(dep[DefaultInfo].data_runfiles) return [ EbookInfo(figures=figures+deps, markdowns=[]), DefaultInfo(files=depset(figures+deps), runfiles=runfiles), ] asymptote = rule(implementation = _asymptote_impl, attrs = { "srcs": attr.label_list( allow_files = [".asy"], doc = "The file to compile", ), "deps": attr.label_list( doc = "The dependencies, any targets should be allowed", ), "output": attr.output(doc="The generated file"), "_script": attr.label( default="//build:docker_run", executable=True, cfg="host"), }, doc = "Transform an asymptote file into png", ) def _copy_file_to_workdir_renamed(ctx, src): src_copy = ctx.actions.declare_file("{}_{}".format(ctx.label.name, src.short_path)) ctx.actions.run_shell( progress_message = "Copying {} to {}".format(src.short_path, src_copy.short_path), outputs = [src_copy], inputs = [src], command="cp {} {}".format(src.path, src_copy.path), ) return src_copy def _copy_file_to_workdir(ctx, src): src_copy = ctx.actions.declare_file(src.basename) ctx.actions.run_shell( progress_message = "Copying {}".format(src.short_path), outputs = [src_copy], inputs = [src], command="cp {} {}".format(src.path, src_copy.path), ) return src_copy def _markdown_lib_impl(ctx): markdowns = [] for target in ctx.attr.srcs: for src in target.files.to_list(): markdowns += [_copy_file_to_workdir(ctx, src)] figures = [] for target in ctx.attr.deps: provider = target[EbookInfo] figures += (provider.figures or []) markdowns += (provider.markdowns or []) runfiles = ctx.runfiles(files=figures+markdowns) for dep in ctx.attr.deps: runfiles = runfiles.merge(dep[DefaultInfo].data_runfiles) return [ EbookInfo(figures=figures, markdowns=markdowns), DefaultInfo( files=depset(figures+markdowns), runfiles=runfiles, ), ] markdown_lib = rule( implementation = _markdown_lib_impl, doc = "Declares a set of markdown files", attrs = { "srcs": attr.label_list( allow_files = [".md"], doc = "The markdown source files", ), "deps": attr.label_list( doc = "The file to compile", providers = [EbookInfo], ), }, ) def _ebook_epub_impl(ctx): name = ctx.label.name # This is duplicated in _ebook_pdf_impl. # steps # run htex on all *md, gives book.htex markdowns = [] figures = [] for dep in ctx.attr.deps: provider = dep[EbookInfo] markdowns += provider.markdowns figures += provider.figures dir_reference = markdowns[0] htex_file = ctx.actions.declare_file("{}.htex".format(name)) markdowns_paths = [file.path for file in markdowns] markdowns_paths_stripped = _strip_reference_dir_from_files(dir_reference, markdowns) script = ctx.executable._script script_cmd = _script_cmd(script.path, markdowns_paths[0]) ctx.actions.run_shell( progress_message = "Building equation environments for: {}".format(name), inputs = markdowns, outputs = [htex_file], tools = [script], command = """\ {script} \ pandoc -s --gladtex -o {target} {sources} \ """.format( script=script_cmd, target=htex_file.path, sources=" ".join(markdowns_paths)) ) # run gladtex on the resulting htex to obtain html and output directory with figures. outdir = ctx.actions.declare_directory("{}.eqn".format(name)) html_file = ctx.actions.declare_file("{}.html".format(name)) ctx.actions.run_shell( progress_message = "Extracting equations for: {}".format(name), inputs = [htex_file], outputs = [outdir, html_file], tools = [script], command = """\ {script} --cd-to-dir-reference \ gladtex -r 200 -d {outdir} {htex_file} \ """.format( script=script_cmd, outdir=_strip_reference_dir(dir_reference, outdir.path), htex_file=_strip_reference_dir(dir_reference, htex_file.path), ) ) outdir_tar = ctx.actions.declare_file("{}.tar".format(outdir.basename)) tar_command = "(cd {base} ; tar cf {archive} {dir})".format( base=outdir_tar.dirname, archive=outdir_tar.basename, dir=outdir.basename) ctx.actions.run_shell( progress_message = "Archiving equations: {}".format(outdir_tar.short_path), inputs = [outdir], outputs = [outdir_tar], command = tar_command, ) # run htexepub to obtain book.epub. # This is gonna be fun! epub_metadata = ctx.attr.metadata_xml.files.to_list()[0] epub_metadata = _copy_file_to_workdir_renamed(ctx, epub_metadata) title_yaml = ctx.attr.title_yaml.files.to_list()[0] title_yaml = _copy_file_to_workdir_renamed(ctx, epub_metadata) ebook_epub = ctx.actions.declare_file("{}.epub".format(name)) inputs = [epub_metadata, title_yaml, html_file, outdir, outdir_tar] + markdowns + figures ctx.actions.run_shell( progress_message = "Building EPUB for: {}".format(name), inputs = inputs, tools = [script], outputs = [ebook_epub], command = """\ {script} --cd-to-dir-reference \ pandoc --epub-metadata={epub_metadata} \ -f html -t epub3 -o {ebook_epub} {html_file} \ """.format( script=script_cmd, epub_metadata=_strip_reference_dir(dir_reference, epub_metadata.path), ebook_epub=_strip_reference_dir(dir_reference, ebook_epub.path), html_file=_strip_reference_dir(dir_reference, html_file.path), )) runfiles = ctx.runfiles(files=[ebook_epub]) for dep in ctx.attr.deps: runfiles = runfiles.merge(dep[DefaultInfo].data_runfiles) return [ dep[EbookInfo], DefaultInfo( files=depset([ebook_epub, outdir, outdir_tar]), runfiles=runfiles, ) ] ebook_epub = rule( implementation = _ebook_epub_impl, attrs = { "deps": attr.label_list( doc = "All the targets you need to make this book work.", providers = [EbookInfo], ), "title_yaml": attr.label( allow_files = True, doc = "The title.yaml file to use for this book", ), "metadata_xml": attr.label( allow_files = True, doc = "The epub-metadata.xml file to use for this book", ), "_script": attr.label( default="//build:docker_run", executable=True, cfg="host"), }, doc = "Generate an ebook in EPUB format" ) def _strip_reference_dir(reference_dir, path): return path.replace(reference_dir.dirname+"/", "") def _strip_reference_dir_from_files(reference_dir, files): return [ _strip_reference_dir(reference_dir, file.path) for file in files] def _ebook_pdf_impl(ctx): name = ctx.label.name # steps # run htex on all *md, gives book.htex markdowns = [] figures = [] for dep in ctx.attr.deps: provider = dep[EbookInfo] markdowns += provider.markdowns figures += provider.figures dir_reference = markdowns[0] # Fixed up paths -- relative to the directory dir_reference, not the # directory where the build happens! This is needed because we can not control # figure inclusion. markdowns_paths = _strip_reference_dir_from_files(dir_reference, markdowns) script = ctx.executable._script script_cmd = _script_cmd(script.path, dir_reference.path) # run htexepub to obtain book.epub. # This is gonna be fun! epub_metadata = ctx.attr.metadata_xml.files.to_list()[0] epub_metadata = _copy_file_to_workdir(ctx, epub_metadata) title_yaml = ctx.attr.title_yaml.files.to_list()[0] title_yaml = _copy_file_to_workdir(ctx, title_yaml) ebook_pdf = ctx.actions.declare_file("{}.pdf".format(name)) inputs = [epub_metadata, title_yaml] + markdowns + figures ctx.actions.run_shell( progress_message = "Building PDF for: {}".format(name), inputs = inputs, tools = [script], outputs = [ebook_pdf], command = """\ {script} --cd-to-dir-reference \ pandoc --epub-metadata={epub_metadata} \ --mathml -o {ebook_pdf} {markdowns} \ """.format( script=script_cmd, epub_metadata=_strip_reference_dir(dir_reference, epub_metadata.path), ebook_pdf=_strip_reference_dir(dir_reference, ebook_pdf.path), markdowns=" ".join(markdowns_paths), )) runfiles = ctx.runfiles(files=[ebook_pdf]) for dep in ctx.attr.deps: runfiles = runfiles.merge(dep[DefaultInfo].data_runfiles) return [ DefaultInfo( files=depset([ebook_pdf]), runfiles=runfiles, ) ] ebook_pdf = rule( implementation = _ebook_pdf_impl, attrs = { "deps": attr.label_list( doc = "All the targets you need to make this book work.", providers = [EbookInfo], ), "title_yaml": attr.label( allow_files = True, doc = "The title.yaml file to use for this book", ), "metadata_xml": attr.label( allow_files = True, doc = "The epub-metadata.xml file to use for this book", ), "_script": attr.label( default="//build:docker_run", executable=True, cfg="host"), }, doc = "Generate an ebook in PDF format" ) def _ebook_kindle_impl(ctx): mobi_file = ctx.actions.declare_file("{}.mobi".format(ctx.label.name)) # First provider is EbookInfo, second is DefaultInfo. (ebook_info, default_info) = _ebook_epub_impl(ctx) # There can be only one such file outputs = default_info.files.to_list() epub_file = outputs[0] equation_outdir = outputs[1] equation_outdir_tar = outputs[2] captured_output = ctx.actions.declare_file( "{}.untar-out".format(ctx.label.name)) # untar the equation dir # Maybe this is not needed. tar_command = "(cd {base} ; tar xvf {archive}) > {output}".format( base=equation_outdir_tar.dirname, archive=equation_outdir_tar.basename, output=captured_output.path) ctx.actions.run_shell( progress_message = "Unarchiving equations: {}".format(equation_outdir_tar.short_path), inputs = [equation_outdir_tar], outputs = [captured_output], command = tar_command, ) dir_reference = epub_file script = ctx.executable._script name = ctx.label.name script_cmd = _script_cmd(script.path, epub_file.path) ctx.actions.run_shell( progress_message = "Building MOBI for: {}".format(name), inputs = [epub_file, equation_outdir], tools = [script], outputs = [mobi_file], command = """\ {script} --cd-to-dir-reference \ ebook-convert {epub_file} {mobi_file} \ """.format( script=script_cmd, epub_file=_strip_reference_dir(dir_reference, epub_file.path), mobi_file=_strip_reference_dir(dir_reference, mobi_file.path), )) runfiles = ctx.runfiles(files=[mobi_file]) for dep in ctx.attr.deps: runfiles = runfiles.merge(dep[DefaultInfo].data_runfiles) return [ DefaultInfo( files=depset([mobi_file, captured_output]), runfiles=runfiles, ) ] ebook_kindle = rule( implementation = _ebook_kindle_impl, attrs = { "deps": attr.label_list( doc = "All the targets you need to make this book work.", providers = [EbookInfo], ), "title_yaml": attr.label( allow_files = True, doc = "The title.yaml file to use for this book", ), "metadata_xml": attr.label( allow_files = True, doc = "The epub-metadata.xml file to use for this book", ), "_script": attr.label( default="//build:docker_run", executable=True, cfg="host"), }, doc = "Generate an ebook in the Kindle's MOBI format" )
n = int(input()) coelho = rato = sapo = contador = 0 for i in range(0, n): q, t = input().split(' ') t = t.upper() q = int(q) if 1 <= q <= 15: contador += q if t == 'C': coelho += q elif t == 'R': rato += q elif t == 'S': sapo += q porccoelho = (coelho * 100) / contador porcrato = (rato * 100) / contador porcsapo = (sapo * 100) / contador print(f'Total: {contador} cobaias') print(f'Total de coelhos: {coelho}') print(f'Total de ratos: {rato}') print(f'Total de sapos: {sapo}') print(f'Percentual de coelhos: {porccoelho:.2f} %') print(f'Percentual de ratos: {porcrato:.2f} %') print(f'Percentual de sapos: {porcsapo:.2f} %')
class APIError(Exception): """ raise APIError if receiving json message indicating failure. """ def __init__(self, error_code, error, request): self.error_code = error_code self.error = error self.request = request Exception.__init__(self, error) def __str__(self): return "APIError: %s: %s, request: %s" % ( self.error_code, self.error, self.request, )
#coding:utf-8 class SystemDeviceType(object): InnerBox = 1 # 主屏分离的室内主机 InnerScreen = 2 # 主屏分离的室内屏 OuterBox = 3 # 室外机 PropCallApp = 4 # 物业值守 PropSentryApp = 5 # 物业岗亭机 Others = 10 ValidatedList = (1,2,3,4,5) class Constants(object): SUPER_ACCESS_TOKEN = 'YTU3NzVlYjktYjQwMi00MGY2LTkxZjktYWMxYjIxZjM4NjNlCg =='
def base_conv(n, input_base=10, output_base=10): """ Converts a number n from base input_base to base output_base. The following symbols are used to represent numbers: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ n can be an int if input_base <= 10, and a string otherwise. The result will be a string. """ numbers = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ## base 10 conversion n = str(n) size = len(n) baseten = 0 for i in range(size): baseten += numbers.index(n[i]) * input_base ** (size - 1 - i) ## base output_base conversion # we search the biggest number m such that n^m < x max_power = 0 while output_base ** (max_power + 1) <= baseten: max_power += 1 result = "" for i in range(max_power + 1): coeff = baseten / (output_base ** (max_power - i)) baseten -= coeff * (output_base ** (max_power - i)) result += numbers[coeff] return result if __name__ == "__main__": assert(base_conv(10) == "10") assert(base_conv(42) == "42") assert(base_conv(5673576) == "5673576") assert(base_conv(10, input_base=2) == "2") assert(base_conv(101010, input_base=2) == "42") assert(base_conv(43, input_base=10, output_base=2) == "101011") assert(base_conv(256**3 - 1, input_base=10, output_base=16) == "ffffff") assert(base_conv("d9bbb9d0ceabf", input_base=16, output_base=8) == "154673563503165277") assert(base_conv("154673563503165277", input_base=8, output_base=10) == "3830404793297599") assert(base_conv(0, input_base=3, output_base=50) == "0")
#a2_t1b.py #This program is to convert Celsius to Kelvin def c_to_k(c): k = c + 273.15 #Formula to convert Celsius to Kelvin return k def f_to_c(f): fa = (f-32) * 5/9 #Formula to convert Fareheit to Celsius return fa c = 25.0 f = 100.0 k = c_to_k(c) fa = f_to_c(f) print("Celsius of " + str(c) + " is " + str(k) + " in Kelvin") print("Farenheit of " + str(f) + " is " + str(fa) + " in Celsius")
"""This module contains the GeneFlow LocalWorkflow class.""" class LocalWorkflow: """ A class that represents the Local Workflow objects. """ def __init__( self, job, config, parsed_job_work_uri ): """ Instantiate LocalWorkflow class. """ self._job = job self._config = config self._parsed_job_work_uri = parsed_job_work_uri def initialize(self): """ Initialize the LocalWorkflow class. This workflow class has no additional functionality. Args: None. Returns: True. """ return True def init_data(self): """ Initialize any data specific to this context. """ return True def get_context_options(self): """ Return dict of options specific for this context. Args: None. Returns: {} - no options specific for this context. """ return {}
# -*- coding: utf-8 -*- def main(): s, t, u = map(str, input().split()) if len(s) == 5 and len(t) == 7 and len(u) == 5: print('valid') else: print('invalid') if __name__ == '__main__': main()
""" 嵌套的列表的坑 """ names = ['关羽', '张飞', '赵云', '马超', '黄忠'] courses = ['语文', '数学', '英语'] # 录入五个学生三门课程的成绩 scores = [[None] * len(courses) for _ in range(len(names))] for row, name in enumerate(names): for col, course in enumerate(courses): scores[row][col] = float(input(f'请输入{name}的{course}的成绩:')) print(scores)
def buttonClick(button): JS(""" var doc = button.ownerDocument; if (doc != null) { var evt = doc.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, null, 0, 0, 0, 0, 0, false, false, false, false, 0, null); button.dispatchEvent(evt); } """) def compare(elem1, elem2): JS(""" if (!elem1 && !elem2) { return true; } else if (!elem1 || !elem2) { return false; } if (!elem1.isSameNode) { return (elem1 == elem2); } return (elem1.isSameNode(elem2)); """) def eventGetButton(evt): JS(""" var button = evt.which; if(button == 2) { return 4; } else if (button == 3) { return 2; } else { return button || 0; } """) # This is what is in GWT 1.5 for getAbsoluteLeft. err... #""" # // We cannot use DOMImpl here because offsetLeft/Top return erroneous # // values when overflow is not visible. We have to difference screenX # // here due to a change in getBoxObjectFor which causes inconsistencies # // on whether the calculations are inside or outside of the element's # // border. # try { # return $doc.getBoxObjectFor(elem).screenX # - $doc.getBoxObjectFor($doc.documentElement).screenX; # } catch (e) { # // This works around a bug in the FF3 betas. The bug # // should be fixed before they release, so this can # // be removed at a later date. # // https://bugzilla.mozilla.org/show_bug.cgi?id=409111 # // DOMException.WRONG_DOCUMENT_ERR == 4 # if (e.code == 4) { # return 0; # } # throw e; # } #""" def getAbsoluteLeft(elem): JS(""" // Firefox 3 expects getBoundingClientRect // getBoundingClientRect can be float: 73.1 instead of 74, see // gwt's workaround at user/src/com/google/gwt/dom/client/DOMImplMozilla.java:47 // Please note, their implementation has 1px offset. if ( typeof elem.getBoundingClientRect == 'function' ) { var left = Math.ceil(elem.getBoundingClientRect().left); return left + $doc.body.scrollLeft + $doc.documentElement.scrollLeft; } // Older Firefox can use getBoxObjectFor else { var left = $doc.getBoxObjectFor(elem).x; var parent = elem.parentNode; while (parent) { if (parent.scrollLeft > 0) { left = left - parent.scrollLeft; } parent = parent.parentNode; } return left + $doc.body.scrollLeft + $doc.documentElement.scrollLeft; } """) # This is what is in GWT 1.5 for getAbsoluteTop. err... #""" # // We cannot use DOMImpl here because offsetLeft/Top return erroneous # // values when overflow is not visible. We have to difference screenY # // here due to a change in getBoxObjectFor which causes inconsistencies # // on whether the calculations are inside or outside of the element's # // border. # try { # return $doc.getBoxObjectFor(elem).screenY # - $doc.getBoxObjectFor($doc.documentElement).screenY; # } catch (e) { # // This works around a bug in the FF3 betas. The bug # // should be fixed before they release, so this can # // be removed at a later date. # // https://bugzilla.mozilla.org/show_bug.cgi?id=409111 # // DOMException.WRONG_DOCUMENT_ERR == 4 # if (e.code == 4) { # return 0; # } # throw e; # } #""" def getAbsoluteTop(elem): JS(""" // Firefox 3 expects getBoundingClientRect if ( typeof elem.getBoundingClientRect == 'function' ) { var top = Math.ceil(elem.getBoundingClientRect().top); return top + $doc.body.scrollTop + $doc.documentElement.scrollTop; } // Older Firefox can use getBoxObjectFor else { var top = $doc.getBoxObjectFor(elem).y; var parent = elem.parentNode; while (parent) { if (parent.scrollTop > 0) { top -= parent.scrollTop; } parent = parent.parentNode; } return top + $doc.body.scrollTop + $doc.documentElement.scrollTop; } """) def getChildIndex(parent, child): JS(""" var count = 0, current = parent.firstChild; while (current) { if (! current.isSameNode) { if (current == child) { return count; } } else if (current.isSameNode(child)) { return count; } if (current.nodeType == 1) { ++count; } current = current.nextSibling; } return -1; """) def isOrHasChild(parent, child): JS(""" while (child) { if ((!parent.isSameNode)) { if (parent == child) { return true; } } else if (parent.isSameNode(child)) { return true; } try { child = child.parentNode; } catch(e) { // Give up on 'Permission denied to get property // HTMLDivElement.parentNode' // See https://bugzilla.mozilla.org/show_bug.cgi?id=208427 return false; } if (child && (child.nodeType != 1)) { child = null; } } return false; """) def releaseCapture(elem): JS(""" if ((DOM.sCaptureElem != null) && DOM.compare(elem, DOM.sCaptureElem)) DOM.sCaptureElem = null; if (!elem.isSameNode) { if (elem == $wnd.__captureElem) { $wnd.__captureElem = null; } } else if (elem.isSameNode($wnd.__captureElem)) { $wnd.__captureElem = null; } """)
casa = int(input('Qual o valor da casa? ')) sal = int(input('Qual seu salario? ')) prazo = int(input('Quantos meses deseja pagar ? ')) parcela = casa/prazo margem = sal* (30/100) if parcela > margem: print('Este negocio não foi aprovado, aumente o prazo .') else: print("Negocio aprovado pois a parcela é de R$ {} e voce pode pagar R$ {} mensais".format(parcela,margem))
""" Demonstration of numbers in Python """ # Python has an integer type called int print("int") print("---") print(0) print(1) print(-3) print(70383028364830) print("") # Python has a real number type called float print("float") print("-----") print(0.0) print(7.35) print(-43.2) print("") # Limited precision print("Precision") print("---------") print(4.56372883832331773) print(1.23456789012345678) print("") # Scientific/exponential notation print("Scientific notation") print("-------------------") print(5e32) print(999999999999999999999999999999999999999.9) print("") # Infinity print("Infinity") print("--------") print(1e500) print(-1e500) print("") # Conversions print("Conversions between numeric types") print("---------------------------------") print(float(3)) print(float(99999999999999999999999999999999999999)) print(int(3.0)) print(int(3.7)) print(int(-3.7)) """ Demonstration of simple arithmetic expressions in Python """ # Unary + and - print("Unary operators") print(+3) print(-5) print(+7.86) print(-3348.63) print("") # Simple arithmetic print("Addition and Subtraction") print(1 + 2) print(48 - 89) print(3.45 + 2.7) print(87.3384 - 12.35) print(3 + 6.7) print(9.8 - 4) print("") print("Multiplication") print(3 * 2) print(7.8 * 27.54) print(7 * 8.2) print("") print("Division") print(8 / 2) print(3 / 2) print(7.538 / 14.3) print(8 // 2) print(3 // 2) print(7.538 // 14.3) print("") print("Exponentiation") print(3 ** 2) print(5 ** 4) print(32.6 ** 7) print(9 ** 0.5) """ Demonstration of compound arithmetic expressions in Python """ # Expressions can include multiple operations print("Compound expressions") print(3 + 5 + 7 + 27) #Operator with same precedence are evaluated from left to right print(18 - 6 + 4) print("") # Operator precedence defines how expressions are evaluated print("Operator precedence") print(7 + 3 * 5) print(5.5 * 6 // 2 + 8) print(-3 ** 2) print("") # Use parentheses to change evaluation order print("Grouping with parentheses") print((7 + 3) * 5) print(5.5 * ((6 // 2) + 8)) print((-3) ** 2) """ Demonstration of the use of variables and how to assign values to them. """ # The = operator can be used to assign values to variables bakers_dozen = 12 + 1 temperature = 93 # Variables can be used as values and in expressions print(temperature, bakers_dozen) print("celsius:", (temperature - 32) * 5 / 9) print("fahrenheit:", float(temperature)) # You can assign a different value to an existing variable temperature = 26 print("new value:", temperature) # Multiple variables can be used in arbitrary expressions offset = 32 multiplier = 5.0 / 9.0 celsius = (temperature - offset) * multiplier print("celsius value:", celsius)
# Natural Language Toolkit: Language Models # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT class ModelI(object): """ A processing interface for assigning a probability to the next word. """ def __init__(self): '''Create a new language model.''' raise NotImplementedError() def train(self, text): '''Train the model on the text.''' raise NotImplementedError() def probability(self, word, context): '''Evaluate the probability of this word in this context.''' raise NotImplementedError() def choose_random_word(self, context): '''Randomly select a word that is likely to appear in this context.''' raise NotImplementedError() def entropy(self, text): '''Evaluate the total entropy of a message with respect to the model. This is the sum of the log probability of each word in the message.''' raise NotImplementedError()
def aaa(): # trick sphinx to build link in doc pass # retired ibmqx2_c_to_tars =\ { 0: [1, 2], 1: [2], 2: [], 3: [2, 4], 4: [2] } # 6 edges # retired ibmqx4_c_to_tars =\ { 0: [], 1: [0], 2: [0, 1, 4], 3: [2, 4], 4: [] } # 6 edges # retired ibmq16Rus_c_to_tars = \ { 0: [], 1: [0, 2], 2: [3], 3: [4, 14], 4: [], 5: [4], 6: [5, 7, 11], 7: [10], 8: [7], 9: [8, 10], 10: [], 11: [10], 12: [5, 11, 13], 13: [4, 14], 14: [], 15: [0, 2, 14] } # 22 edges ibm20AustinTokyo_c_to_tars = \ { 0: [1, 5], 1: [0, 2, 6, 7], 2: [1, 3, 6, 7], 3: [2, 4, 8, 9], 4: [3, 8, 9], 5: [0, 6, 10, 11], 6: [1, 2, 5, 7, 10, 11], 7: [1, 2, 6, 8, 12, 13], 8: [3, 4, 7, 9, 12, 13], 9: [3, 4, 8, 14], 10: [5, 6, 11, 15], 11: [5, 6, 10, 12, 16, 17], 12: [7, 8, 11, 13, 16, 17], 13: [7, 8, 12, 14, 18, 19], 14: [9, 13, 18, 19], 15: [10, 16], 16: [11, 12, 15, 17], 17: [11, 12, 16, 18], 18: [13, 14, 17, 19], 19: [13, 14, 18] } # 86 edges ibmq5YorktownTenerife_c_to_tars = \ { 0: [1, 2], 1: [0, 2], 2: [0, 1, 3, 4], 3: [2, 4], 4: [2, 3] } # 12 edges ibmq14Melb_c_to_tars = \ { 0: [1], 1: [0, 2, 13], 2: [1, 3, 12], 3: [2, 4, 11], 4: [3, 5, 10], 5: [4, 6, 9], 6: [5, 8], 7: [8], 8: [6, 7, 9], 9: [5, 8, 10], 10: [4, 9, 11], 11: [3, 10, 12], 12: [2, 11, 13], 13: [1, 12] } # 36 edges
class Donation_text: # Shown as a message across the top of the page on return from a donation # used in views.py:new_donation() thank_you = ( "Thank you for your donation. " "You may need to refresh this page to see the donation." ) confirmation_email_subject = ( 'Thank you for donating to the Triple Crown for Heart! ' ) # Start of the email sent confirming the paypal payment has gone through # used in paypal.py:process_paypal() confirmation_email_opening = ( 'Thank you for your donation of ' ) # Closing of the email sent confirming the paypal payment has gone through # used in paypal.py:process_paypal() confirmation_email_closing = ( '.\n\nFor all donations over $20, you will receive a tax receipt for ' 'the 2019 tax year.' '\nYour PayPal receipt should arrive in a separate email.\n' ) notification_email_subject = ( "You got a donation!" ) notification_email_opening = ( "Great news! You've just received a donation of " ) notification_email_closing = ( "\n\nAwesome work! They would probably appreciate " "a quick thank you email.\n\n" "-- Triple Crown for Heart\n" ) class Fundraiser_text: # Subject of the email sent on signup signup_email_subject = ( "Welcome to fundraising for the Triple Crown for Heart!" ) # Start of the email sent when someone signs up # used in views.py:signup() signup_email_opening = ( "Thanks for signing up to fundraise with us!\n" "Your fundraising page can be found at:\n" ) # Closing of the email sent when someone signs up # used in views.py:signup() signup_email_closing = ( '\n\nYou can change your information by using the "Login" link at the ' 'top of that page.' '\n\nThe easiest way to start fundraising is to post the above link ' 'on social media or write a short email to your friends telling them ' 'about your ride.' '\nDon\'t forget to include the link to your page!\n' ) # Message show at the top of the fundraiser page after signing up # used in views.py:signup() signup_return_message = ( "Thank you for signing up. Sharing your fundraiser page on social " "media or over email is the best way to get donations." ) signup_wrong_password_existing_user = ( "The username already exists, but the password entered is incorrect. " "If you were already a fundraiser for a previous campaign, please " "enter your previous password or use " "<a href='/team_fundraising/accounts/password_reset/'>" "Forgot your password</a>. If this is your first campaign, " "please choose a different username." )
class Yaratik(object): def move_left(self): print('Moving left...') def move_right(self): print('Moving left...') class Ejderha(Yaratik): def Ates_puskurtme(self): print('ates puskurtum!') class Zombie(Yaratik): def Isirmak(self): print('Isirdim simdi!') enemy = Yaratik() enemy.move_left() # ejderha also includes all functions from parent class (yaratik) ejderha = Ejderha() ejderha.move_left() ejderha.Ates_puskurtme() # Zombie is called the (child class), inherits from Yaratik (parent class) zombie = Zombie() zombie.move_right() zombie.Isirmak()
nota1 = float(input('Digite a nota da primeira nota ')) peso1 = float(input('Digite o peso da primeira nota ')) nota2 = float(input('Digite a nota da seugundo nota ')) peso2 = float(input('Digite o peso da segundo nota ')) media = (nota1/peso1+nota2/peso2)/2 print('A média das duas notas é:', media)
class Solution: def nextGreatestLetter(self, letters: list, target: str) -> str: if target < letters[0] or target >= letters[-1]: return letters[0] left, right = 0, len(letters) - 1 while left < right: mid = left + (right - left) // 2 if letters[mid] > target: right = mid else: left = mid + 1 return letters[right] if __name__ == '__main__': letters = ["c", "f", "j"] target = "a" print(f"Input: letters = {letters}, target = {target}") print(f"Output: {Solution().nextGreatestLetter(letters, target)}")
my_set = {1, 3, 5} my_dict = {'name': 'Jose', 'age': 90} another_dict = {1: 15, 2: 75, 3: 150} lottery_players = [ { 'name': 'Rolf', 'numbers': (13, 45, 66, 23, 22) }, { 'name': 'John', 'numbers': (14, 56, 80, 23, 22) } ] universities = [ { 'name': 'Oxford', 'location': 'UK' }, { 'name': 'MIT', 'location': 'US' } ]
""" Various generic env utilties. """ def center_crop_img(img, crop_zoom): """ crop_zoom is amount to "zoom" into the image. E.g. 2.0 would cut out half of the width, half of the height, and only give the center. """ raw_height, raw_width = img.shape[:2] center = raw_height // 2, raw_width // 2 crop_size = raw_height // crop_zoom, raw_width // crop_zoom min_y, max_y = int(center[0] - crop_size[0] // 2), int(center[0] + crop_size[0] // 2) min_x, max_x = int(center[1] - crop_size[1] // 2), int(center[1] + crop_size[1] // 2) img_cropped = img[min_y:max_y, min_x:max_x] return img_cropped def crop_img(img, relative_corners): """ relative_corners are floats between 0 and 1 designating where the corners of a crop box should be ([[top_left_x, top_left_y], [bottom_right_x, bottom_right_y]]). e.g. [[0, 0], [1, 1]] would be the full image, [[0.5, 0.5], [1, 1]] would be bottom right.""" rc = relative_corners raw_height, raw_width = img.shape[:2] top_left_pix = [int(rc[0][0] * raw_width), int(rc[0][1] * raw_height)] bottom_right_pix = [int(rc[1][0] * raw_width), int(rc[1][1] * raw_height)] img_cropped = img[top_left_pix[1]:bottom_right_pix[1], top_left_pix[0]:bottom_right_pix[0]] return img_cropped
# -*- coding: utf-8 -*- def docstring_property(class_doc): """Property attribute for docstrings. Took from: https://gist.github.com/bfroehle/4041015 >>> class A(object): ... '''Main docstring''' ... def __init__(self, x): ... self.x = x ... @docstring_property(__doc__) ... def __doc__(self): ... return "My value of x is %s." % self.x >>> A.__doc__ 'Main docstring' >>> a = A(10) >>> a.__doc__ 'My value of x is 10.' """ def wrapper(fget): return DocstringProperty(class_doc, fget) return wrapper class DocstringProperty(object): """Property for the `__doc__` attribute. Different than `property` in the following two ways: * When the attribute is accessed from the main class, it returns the value of `class_doc`, *not* the property itself. This is necessary so Sphinx and other documentation tools can access the class docstring. * Only supports getting the attribute; setting and deleting raise an `AttributeError`. """ def __init__(self, class_doc, fget): self.class_doc = class_doc self.fget = fget def __get__(self, obj, type=None): if obj is None: return self.class_doc else: return self.fget(obj) def __set__(self, obj, value): raise AttributeError("can't set attribute") def __delete__(self, obj): raise AttributeError("can't delete attribute")
class PaintEventArgs(EventArgs,IDisposable): """ Provides data for the System.Windows.Forms.Control.Paint event. PaintEventArgs(graphics: Graphics,clipRect: Rectangle) """ def Instance(self): """ This function has been arbitrarily put into the stubs""" return PaintEventArgs() def Dispose(self): """ Dispose(self: PaintEventArgs) Releases all resources used by the System.Windows.Forms.PaintEventArgs. """ pass def __enter__(self,*args): """ __enter__(self: IDisposable) -> object """ pass def __exit__(self,*args): """ __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """ pass def __init__(self,*args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass @staticmethod def __new__(self,graphics,clipRect): """ __new__(cls: type,graphics: Graphics,clipRect: Rectangle) """ pass ClipRectangle=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets the rectangle in which to paint. Get: ClipRectangle(self: PaintEventArgs) -> Rectangle """ Graphics=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets the graphics used to paint. Get: Graphics(self: PaintEventArgs) -> Graphics """
# Copyright (c) 2006- Facebook # Distributed under the Thrift Software License # # See accompanying file LICENSE or visit the Thrift site at: # http://developers.facebook.com/thrift/ class TType: STOP = 0 VOID = 1 BOOL = 2 BYTE = 3 I08 = 3 DOUBLE = 4 I16 = 6 I32 = 8 I64 = 10 STRING = 11 UTF7 = 11 STRUCT = 12 MAP = 13 SET = 14 LIST = 15 UTF8 = 16 UTF16 = 17 class TMessageType: CALL = 1 REPLY = 2 EXCEPTION = 3 class TProcessor: """Base class for procsessor, which works on two streams.""" def process(iprot, oprot): pass class TException(Exception): """Base class for all thrift exceptions.""" def __init__(self, message=None): Exception.__init__(self, message) self.message = message class TApplicationException(TException): """Application level thrift exceptions.""" UNKNOWN = 0 UNKNOWN_METHOD = 1 INVALID_MESSAGE_TYPE = 2 WRONG_METHOD_NAME = 3 BAD_SEQUENCE_ID = 4 MISSING_RESULT = 5 def __init__(self, type=UNKNOWN, message=None): TException.__init__(self, message) self.type = type def __str__(self): if self.message: return self.message elif self.type == UNKNOWN_METHOD: return 'Unknown method' elif self.type == INVALID_MESSAGE_TYPE: return 'Invalid message type' elif self.type == WRONG_METHOD_NAME: return 'Wrong method name' elif self.type == BAD_SEQUENCE_ID: return 'Bad sequence ID' elif self.type == MISSING_RESULT: return 'Missing result' else: return 'Default (unknown) TApplicationException' def read(self, iprot): iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: self.message = iprot.readString(); else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.type = iprot.readI32(); else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): oprot.writeStructBegin('TApplicationException') if self.message != None: oprot.writeFieldBegin('message', TType.STRING, 1) oprot.writeString(self.message) oprot.writeFieldEnd() if self.type != None: oprot.writeFieldBegin('type', TType.I32, 2) oprot.writeI32(self.type) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd()
class Solution: def XXX(self, x: int) -> int: def solve(x): a = list(map(int,str(x))) p = {} d=0 for ind, val in enumerate(a): p[ind] = val for i, v in p.items(): d += v*(10**i) if (2**31 - 1>= d >= -(2**31)): return d else: return 0 if x>=0: return (solve(x)) if x<0: x = -x return (-solve(x))
#------ game constants -----# #players WHITE = 0 BLACK = 1 BOTH = 2 #color for onTurnLabel PLAYER_COLOR = ["white", "black"] #figures PAWN = 1 KNIGHT = 2 BISHOP = 3 ROOK = 4 QUEEN = 5 KING = 6 FIGURE_NAME = [ "", "pawn", "knight", "bishop", "rook", "queen", "king" ] #used in move 32bit for promotion figure prom_figure = figure-2 PROM_KNIGHT = 0 PROM_BISHOP = 1 PROM_ROOK = 2 PROM_QUEEN = 3 #all lines A, B, C, D, E, F, G, H = range(8) #all squares A1, B1, C1, D1, E1, F1, G1, H1, \ A2, B2, C2, D2, E2, F2, G2, H2, \ A3, B3, C3, D3, E3, F3, G3, H3, \ A4, B4, C4, D4, E4, F4, G4, H4, \ A5, B5, C5, D5, E5, F5, G5, H5, \ A6, B6, C6, D6, E6, F6, G6, H6, \ A7, B7, C7, D7, E7, F7, G7, H7, \ A8, B8, C8, D8, E8, F8, G8, H8 = range(64) #----- game display constants -----# DEFAULTBORDERWIDTH = 20 DEFAULTTILEWIDTH = 45 DEFAULTFONTSIZE = (7, 15) COLORS = { "bg":"#EDC08C", "border":"#B55602", "tiles":("#FC9235", "#FFB87A") } #----- move types -----# NORMAL_MOVE, CAPTURE, PROMOTION, DOUBLE_STEP, ENPASSANT_CAPTURE, CASTLING, KING_CAPTURE = range(7) #----- move 32bit reservation -----# # a single move is stored in 32 bit as follows # xxxxxxxx xx x xxx xxx xxxxxx xxxxxx xxx # G F E D C B A # # A: move type (0-6) # B: start sq (0-63) # C: destination sq (0-63) # D: start figure (1-6) # E: captured figure (1-6) # F: color of moved piece (0-1) # G: promotion figure (0-3) #NAME = (start_bit, lenght) MOVE_TYPE = (0, 3) MOVE_START = (3, 6) MOVE_DEST = (9, 6) MOVE_FIG_START = (15, 3) MOVE_FIG_CAPTURE = (18, 3) MOVE_COLOR = (21, 1) MOVE_PROM = (22, 2) #----- castling -----# CASTLING_LEFT = 0 CASTLING_RIGHT = 1 #----- player status -----# IDELING = 0 PICKING = 1 INF = 1000000 ASCII_FIG = [[],[]] ASCII_FIG[WHITE] = [ 'x', chr(9817), chr(9816), chr(9815), chr(9814), chr(9813), chr(9812)] ASCII_FIG[BLACK] = [ 'x', chr(9823), chr(9822), chr(9821), chr(9820), chr(9819), chr(9818)] #AI constants CASTLING_RIGHT_LOSS_PENALTY = -40
num1 = int(input('Digite o 1º número: ')) num2 = int(input('Digite o 2º número: ')) if num1 > num2: print('O {} é maior que {}'.format(num1, num2)) elif num1 < num2: print('O {} é maior que4 {}'.format(num2, num1)) else: print('Os números são iguais')
class BST: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right @staticmethod def array2BST(array): ''' array:sorted array ''' n = len(array) if n == 0: return None m = n//2 left,root,right = array[:m],array[m],array[m+1:] return BST(root,BST.array2BST(left),BST.array2BST(right)) @staticmethod def BST2array(node): ''' node:BST node ''' if not node: return [] return BST.BST2array(node.left)+[node.val]+BST.BST2array(node.right)
TANGO_PALLETE = [ '2e2e34343636', 'cccc00000000', '4e4e9a9a0606', 'c4c4a0a00000', '34346565a4a4', '757550507b7b', '060698989a9a', 'd3d3d7d7cfcf', '555557575353', 'efef29292929', '8a8ae2e23434', 'fcfce9e94f4f', '72729f9fcfcf', 'adad7f7fa8a8', '3434e2e2e2e2', 'eeeeeeeeecec', ] def parse_tango_color(c): r = int(c[:4][:2], 16) g = int(c[4:8][:2], 16) b = int(c[8:][:2], 16) return [r, g, b, 0xFF] def apply_color(cfg, color_table): cfg.default_foreground_color = parse_tango_color('eeeeeeeeecec') cfg.default_background_color = parse_tango_color('323232323232') cfg.default_cursor_color = cfg.default_foreground_color for i in range(len(TANGO_PALLETE)): if i < len(color_table): color_table[i] = parse_tango_color(TANGO_PALLETE[i])
def gen(): i = 0 while 1: yield i i += 1 g = gen() try: g.pend_throw except AttributeError: print("SKIP") raise SystemExit print(next(g)) print(next(g)) g.pend_throw(ValueError()) v = None try: v = next(g) except Exception as e: print("raised", repr(e)) print("ret was:", v) # It's legal to pend exception in a just-started generator, just the same # as it's legal to .throw() into it. g = gen() g.pend_throw(ValueError()) try: next(g) except ValueError: print("ValueError from just-started gen")
# Copyright (c) 2021 Food-X Technologies # # This file is part of foodx_devops_tools. # # You should have received a copy of the MIT License along with # foodx_devops_tools. If not, see <https://opensource.org/licenses/MIT>. """Azure related utilities."""
_base_ = [ '../../../_base_/datasets/imagenet/swin_sz224_4xbs256.py', '../../../_base_/default_runtime.py', ] # model settings model = dict( type='MixUpClassification', pretrained=None, alpha=0.2, mix_mode="cutmix", mix_args=dict( attentivemix=dict(grid_size=32, top_k=None, beta=8), # AttentiveMix+ in this repo (use pre-trained) automix=dict(mask_adjust=0, lam_margin=0), # require pre-trained mixblock fmix=dict(decay_power=3, size=(224,224), max_soft=0., reformulate=False), manifoldmix=dict(layer=(0, 3)), puzzlemix=dict(transport=True, t_batch_size=32, t_size=-1, # adjust t_batch_size if CUDA out of memory mp=None, block_num=4, # block_num<=4 and mp=2/4 for fast training beta=1.2, gamma=0.5, eta=0.2, neigh_size=4, n_labels=3, t_eps=0.8), resizemix=dict(scope=(0.1, 0.8), use_alpha=True), samix=dict(mask_adjust=0, lam_margin=0.08), # require pre-trained mixblock ), backbone=dict( type='ConvNeXt', arch='tiny', out_indices=(3,), norm_cfg=dict(type='LN2d', eps=1e-6), act_cfg=dict(type='GELU'), drop_path_rate=0.1, gap_before_final_norm=True, ), head=dict( type='ClsMixupHead', # mixup CE + label smooth loss=dict(type='LabelSmoothLoss', label_smooth_val=0.1, num_classes=1000, mode='original', loss_weight=1.0), with_avg_pool=False, # gap_before_final_norm is True in_channels=768, num_classes=1000) ) # interval for accumulate gradient update_interval = 2 # total: 8 x bs256 x 2 accumulates = bs4096 # additional hooks custom_hooks = [ dict(type='EMAHook', # EMA_W = (1 - m) * EMA_W + m * W momentum=0.9999, warmup='linear', warmup_iters=20 * 626, warmup_ratio=0.9, # warmup 20 epochs. update_interval=update_interval, ), ] # optimizer optimizer = dict( type='AdamW', lr=4e-3, # lr = 5e-4 * (256 * 4) * 4 accumulate / 1024 = 4e-3 / bs4096 weight_decay=0.05, eps=1e-8, betas=(0.9, 0.999), paramwise_options={ '(bn|ln|gn)(\d+)?.(weight|bias)': dict(weight_decay=0.), 'bias': dict(weight_decay=0.), }) # apex use_fp16 = True fp16 = dict(type='apex', loss_scale=dict(init_scale=512., mode='dynamic')) optimizer_config = dict(grad_clip=None, update_interval=update_interval, use_fp16=use_fp16) # lr scheduler lr_config = dict( policy='CosineAnnealing', by_epoch=False, min_lr=1e-5, warmup='linear', warmup_iters=20, warmup_by_epoch=True, # warmup 20 epochs. warmup_ratio=1e-6, ) # runtime settings runner = dict(type='EpochBasedRunner', max_epochs=300)
# -*- coding: utf-8 -*- __about__ = """ This project demonstrates a social networking site. It provides profiles, friends, photos, blogs, tribes, wikis, tweets, bookmarks, swaps, locations and user-to-user messaging. In 0.5 this was called "complete_project". """
# Level: Hard def isMatch(s: str, p: str) -> bool: if not p: return not s n_s = len(s) n_p = len(p) j = 0 i = -1 while i < n_s-1: i = i+ 1 if j >= n_p: return False if p[j] == '*': while s[i]==s[i-1]: i += 1 j += 1 if p[j] == '.' or s[i] == p[j]: j += 1 # continue elif s[i] != p[j] and j<n_p-1: j += 2 else: return False return True if __name__ == "__main__": ss = 'abbbbbc' p = 'a*' print(isMatch(ss, p))
####################### # Dennis MUD # # locate_item.py # # Copyright 2018-2020 # # Michael D. Reiley # ####################### # ********** # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. # ********** NAME = "locate item" CATEGORIES = ["items"] ALIASES = ["find item"] USAGE = "locate item <item_id>" DESCRIPTION = """Find out what room the item <item_id> is in, or who is holding it. You can only locate an item that you own. Wizards can locate any item. Ex. `locate item 4`""" def COMMAND(console, args): # Perform initial checks. if not COMMON.check(NAME, console, args, argc=1): return False # Perform argument type checks and casts. itemid = COMMON.check_argtypes(NAME, console, args, checks=[[0, int]], retargs=0) if itemid is None: return False # Check if the item exists. thisitem = COMMON.check_item(NAME, console, itemid, owner=True, holding=False) if not thisitem: return False # Keep track of whether we found anything in case the item is duplified and we can't return right away. found_something = False # Check if we are holding the item. if itemid in console.user["inventory"]: console.msg("{0}: {1} ({2}) is in your inventory.".format(NAME, thisitem["name"], thisitem["id"])) # If the item is duplified we need to keep looking for other copies. if not thisitem["duplified"]: return True found_something = True # Check if someone else is holding the item. for targetuser in console.database.users.all(): if targetuser["name"] == console.user["name"]: continue if itemid in targetuser["inventory"]: console.msg("{0}: {1} ({2}) is in the inventory of: {3}.".format(NAME, thisitem["name"], thisitem["id"], targetuser["name"])) # If the item is duplified we need to keep looking for other copies. if not thisitem["duplified"]: return True found_something = True # Check if the item is in a room. for targetroom in console.database.rooms.all(): if itemid in targetroom["items"]: console.msg("{0}: {1} ({2}) is in room: {3} ({4})".format(NAME, thisitem["name"], thisitem["id"], targetroom["name"], targetroom["id"])) # If the item is duplified we need to keep looking for other copies. if not thisitem["duplified"]: return True found_something = True # Couldn't find the item. if not found_something: console.log.error("Item exists but has no location: {item}", item=itemid) console.msg("{0}: ERROR: Item exists but has no location. Use `requisition` to fix this.".format(NAME)) return False # Finished. return True
class Metric(object): """Base class for all metrics. From: https://github.com/pytorch/tnt/blob/master/torchnet/meter/meter.py """ def reset(self): pass def add(self): pass def value(self): pass
# Funções cabecalho = "SISTEMA DE CADASTRO DE FUNCIONARIO\n\n\n" rodape = "\n\n\n Obrigada pela preferencia" def imprimir_tela(conteudo): print(cabecalho) #print(opcao_menu) print(conteudo) print(rodape) def ler_opcoes(): opcao = int(input("Insira a opção: ")) return opcao def carregar_opcoes(opcao): if opcao == 1: imprimir_tela("A opção escolhida foi 'Cadastrar funcionário'") elif opcao == 2: imprimir_tela("A opção escolhida foi 'Listar funcionários'") elif opcao == 3: imprimir_tela("A opção escolhida foi 'Editar funcionário'") elif opcao == 4: imprimir_tela("A opção escolhida foi 'Deletar funcionário'") elif opcao == 5: imprimir_tela("A opção escolhida foi 'Sair'") else: pass
# Take number, and convert integer to string # Calculate and return number of digits def get_num_digits(num): # Convert int to str num_str = str(num) # Calculate number of digits digits = len(num_str) return digits # Define main function def main(): # Prompt user for an integer number = int(input('Enter an integer: ')) # Obtain number of digits num_digits = get_num_digits(number) # Display result print(f'The number of digits in number {number} is {num_digits}.') # Call main function main()
""" link: https://leetcode.com/problems/permutations-ii problem: 求全排列,nums中存在重复数 solution: 同46,加上排序即可 """ class Solution: def permuteUnique(self, nums: List[int]) -> List[List[int]]: if len(nums) == 1: return [nums] new_nums = nums.copy() new_nums.sort() res = [] for i in range(0, len(new_nums)): if i + 1 < len(new_nums) and new_nums[i] == new_nums[i + 1]: continue new_nums[i], new_nums[0] = new_nums[0], new_nums[i] sub_result = self.permuteUnique(new_nums[1:]) for r in sub_result: res.append([new_nums[0]] + r.copy()) new_nums[i], new_nums[0] = new_nums[0], new_nums[i] return res
#Atoi stands for ASCII to Integer Conversion def atoi(string): res = 0 # Iterate through all characters of # input and update result for i in range(len(string)): res = res * 10 + (ord(string[i]) - ord('0')) return res #Adjustment contains rule of three for calculating an integer given another integer representing a percentage def Adjustment(a, b): return (a * b) / 100
def bypass_incompatible_branch(job): return (job.settings.bypass_incompatible_branch or job.author_bypass.get('bypass_incompatible_branch', False)) def bypass_peer_approval(job): return (job.settings.bypass_peer_approval or job.author_bypass.get('bypass_peer_approval', False)) def bypass_leader_approval(job): return (job.settings.bypass_leader_approval or job.author_bypass.get('bypass_leader_approval', False)) def bypass_author_approval(job): return (job.settings.bypass_author_approval or job.author_bypass.get('bypass_author_approval', False)) def bypass_build_status(job): return (job.settings.bypass_build_status or job.author_bypass.get('bypass_build_status', False)) def bypass_jira_check(job): return (job.settings.bypass_jira_check or job.author_bypass.get('bypass_jira_check', False))
class Heap: def __init__(self): self.items = dict() # key - (value, index) self.indexes = [] # index - key // to know indexes # Usefull functions def swap(self, i, j): x = self.indexes[i] # key of 1 item y = self.indexes[j] # key of 2 item # swap keys in index array self.indexes[i] = y self.indexes[j] = x temp = self.items[x][1] # index of 1 item # swap indexes in dictionary self.items.update({x: (self.items[x][0], self.items[y][1])}) self.items.update({y: (self.items[y][0], temp)}) def bigger(self, i, j): if self.indexes[i] <= self.indexes[j]: return False else: return True # Check family UwU def hasParent(self, i): if (i - 1)/2 >= 0: return True return False def parentIndex(self, i): return int((i - 1)/2) def hasLeft(self, i): if i*2 + 1 < len(self.indexes): return True return False def leftIndex(self, i): return int(i*2 + 1) def hasRight(self, i): if i*2 + 2 < len(self.indexes): return True return False def rightIndex(self, i): return int(i*2 + 2) # heapifys def heapifyUp(self, i=None): if i: index = i else: index = len(self.indexes) - 1 while self.hasParent(index) and self.bigger(self.parentIndex(index), index): self.swap(self.parentIndex(index), index) index = self.parentIndex(index) def heapifyDown(self, i=0): index = i while self.hasLeft(index): smaller = self.leftIndex(index) if self.hasRight(index) and self.bigger(self.leftIndex(index), self.rightIndex(index)): smaller = self.rightIndex(index) if self.bigger(smaller, index): break else: self.swap(index, smaller) index = smaller # all needed methods def add(self, key, data): if self.items.get(key, None): raise(Exception) self.items[key] = (data, int(len(self.indexes))) self.indexes.append(key) self.heapifyUp() def set(self, key, data): temp = self.items.get(key, None) if not temp: raise(Exception) self.items[key] = (data, temp[1]) def delete(self, key): temp = self.items.get(key, None) if not temp: raise(Exception) if len(self.indexes) > 1: lastKey = self.indexes[-1] last = self.items.get(lastKey, None) # set last item index of deleted self.items.update({lastKey: (last[0], temp[1])}) # set key of last item to deleted index self.indexes[temp[1]] = lastKey self.indexes.pop() del self.items[key] if temp[1] < len(self.indexes): # dont heapify if deleted last element self.heapifyDown(i=temp[1]) self.heapifyUp(i=temp[1]) def search(self, key): temp = self.items.get(key, None) if temp: print('1', temp[1], temp[0]) else: print('0') def min(self): if len(self.indexes) == 0: raise(Exception) key = self.indexes[0] print(key, '0', self.items[key][0]) def max(self): if len(self.indexes) == 0: raise(Exception) i = int(len(self.indexes)/2) maxKey = self.indexes[i] index = i while i < len(self.indexes): if maxKey < self.indexes[i]: maxKey = self.indexes[i] index = i i += 1 print(maxKey, index, self.items[maxKey][0]) def extract(self): if len(self.indexes) == 0: raise(Exception) rootKey = self.indexes[0] rootData = self.items[rootKey][0] del self.items[rootKey] if len(self.indexes) > 1: self.indexes[0] = self.indexes.pop() # set top item index to 0 self.items.update({self.indexes[0] : (self.items[self.indexes[0]][0], 0)}) self.heapifyDown() else: self.indexes.pop() print(rootKey, rootData) def print(self): height = 0 index = 0 out = '' i = 0 if len(self.indexes) == 0: out += '_\n' print('_') return while i < len(self.indexes): lineLen = 1 << height index += 1 key = self.indexes[i] out += '[' + str(key) + ' ' + self.items[key][0] if height != 0: out += ' ' + str(self.indexes[self.parentIndex(i)]) out += ']' if index == lineLen: out += '\n' index = 0 height += 1 else: out += ' ' i += 1 if index != 0 and index < lineLen: out += '_ ' * (lineLen - index) print(out[0:-1]) else: print(out, end='') cycle = True heap = Heap() while cycle: try: line = input() cmd = line.split(' ', 2) try: if len(cmd) == 1 and cmd[0] == '': continue if len(cmd) == 2 and cmd[0] == '' and cmd[1] == '': continue if cmd[0] == 'add': heap.add(int(cmd[1]), cmd[2]) elif cmd[0] == 'set': heap.set(int(cmd[1]), cmd[2]) elif cmd[0] == 'delete': heap.delete(int(cmd[1])) elif cmd[0] == 'search': heap.search(int(cmd[1])) elif cmd[0] == 'min': heap.min() elif cmd[0] == 'max': heap.max() elif cmd[0] == 'extract': heap.extract() elif cmd[0] == 'print': heap.print() else: raise(Exception) except Exception: print('error') continue except Exception: cycle = False
class Solution(object): def rearrangeString(self, str, k): """ :type str: str :type k: int :rtype: str """ ## greedy: count keeps the # of chars, valid keeps the leftmost valid index of a char. res=[] # count # of chars d=collections.defaultdict(int) for c in str: d[c]+=1 # create a valid dict v=collections.defaultdict(int) # add char one by one, that with max # first, must have valid leftmost index for i in range(len(str)): c=None for key in d: if (not c or d[key]>d[c]) and d[key]>0 and v[key]<=i: # get c with max # and be valid c=key if not c: return '' res.append(c) d[c]-=1 v[c]=i+k return ''.join(res)
''' All the reserved, individual words used in MAlice. ''' A = "a" ALICE = "Alice" AND = "and" ATE = "ate" BECAME = "became" BECAUSE = "because" BUT = "but" CLOSED = "closed" COMMA = "," CONTAINED = "contained" DOT = "." DRANK = "drank" EITHER = "either" ENOUGH = "enough" EVENTUALLY = "eventually" FOUND = "found" HAD = "had" HATTA = "hatta" LETTER = "letter" LOOKING_GLASS = "looking-glass" LPAR = "(" MAYBE = "maybe" NUMBER = "number" OF = "of" OPENED = "opened" OR = "or" PERHAPS = "perhaps" PIECE = "piece" QUESTION = "?" ROOM = "room" RPAR = ")" S = "'s" SAID = "said" SENTENCE = "sentence" SO = "so" SPIDER = "spider" SPOKE = "spoke" THE = "The" THEN = "then" TIMES = "times" TOO = "too" UNDERSCORE = "_" UNSURE = "unsure" WAS = "was" WHAT = "what" WHICH = "which" RESTRICTED = [ A, ALICE, AND, ATE, BECAME ,BECAUSE ,BUT ,CLOSED ,COMMA ,CONTAINED ,DOT ,DRANK ,EITHER ,ENOUGH ,EVENTUALLY ,FOUND ,HAD ,HATTA ,LETTER ,LOOKING_GLASS ,LPAR ,MAYBE ,NUMBER ,OF ,OPENED ,OR ,PERHAPS ,PIECE ,QUESTION ,ROOM ,RPAR ,S ,SAID, SENTENCE ,SO ,SPIDER ,SPOKE ,THE ,THEN ,TIMES ,TOO ,UNDERSCORE ,UNSURE ,WAS ,WHAT ,WHICH]
def migrate(): print('migrating to version 2')
test = { 'name': 'q2b3', 'points': 5, 'suites': [ { 'cases': [ { 'code': '>>> ' 'histories_2b[2].model.count_params()\n' '119260', 'hidden': False, 'locked': False}, { 'code': '>>> ' 'histories_2b[2].model.layers[1].activation.__name__\n' "'sigmoid'", 'hidden': False, 'locked': False}, { 'code': '>>> ' 'histories_2b[2].model.layers[1].units\n' '150', 'hidden': False, 'locked': False}, { 'code': '>>> ' "histories_2b[2].history['loss'][4] " '<= ' "histories_2b[1].history['loss'][4]\n" 'True', 'hidden': False, 'locked': False}], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]}
# Time: O(n*2^n) # Space: O(2^n) class Solution(object): def canPartitionKSubsets(self, nums, k): """ :type nums: List[int] :type k: int :rtype: bool """ def dfs(nums, target, used, todo, lookup): if lookup[used] is None: targ = (todo-1)%target + 1 lookup[used] = any(dfs(nums, target, used | (1<<i), todo-num, lookup) \ for i, num in enumerate(nums) \ if ((used>>i) & 1) == 0 and num <= targ) return lookup[used] total = sum(nums) if total%k or max(nums) > total//k: return False lookup = [None] * (1 << len(nums)) lookup[-1] = True return dfs(nums, total//k, 0, total, lookup) # Time: O(k^(n-k) * k!) # Space: O(n) # DFS solution with pruning. class Solution2(object): def canPartitionKSubsets(self, nums, k): """ :type nums: List[int] :type k: int :rtype: bool """ def dfs(nums, target, i, subset_sums): if i == len(nums): return True for k in range(len(subset_sums)): if subset_sums[k]+nums[i] > target: continue subset_sums[k] += nums[i] if dfs(nums, target, i+1, subset_sums): return True subset_sums[k] -= nums[i] if not subset_sums[k]: break return False total = sum(nums) if total%k != 0 or max(nums) > total//k: return False nums.sort(reverse=True) subset_sums = [0] * k return dfs(nums, total//k, 0, subset_sums)
#!/usr/bin/env python # License: Apache-2.0 # Copyright (C) 2020 Mikhail f. Shiryaev class Column(object): """ Represents ClickHouse column """ def __init__( self, database: str, table: str, name: str, type: str, default_kind: str, default_expression: str, comment: str, compression_codec: str, is_in_partition_key: bool, is_in_sorting_key: bool, is_in_primary_key: bool, is_in_sampling_key: bool, ): self.database = database self.table = table self.name = name self.type = type self.default_kind = default_kind self.default_expression = default_expression self.comment = comment self.compression_codec = compression_codec self.is_in_partition_key = is_in_partition_key self.is_in_sorting_key = is_in_sorting_key self.is_in_primary_key = is_in_primary_key self.is_in_sampling_key = is_in_sampling_key @property def db_table(self): return "{}.{}".format(self.database, self.table) def __str__(self): return self.name
def solve(n, red , blue): rcount = bcount = 0 for i in range(n): if int(red[i]) > int(blue[i]): rcount = rcount +1 elif int(red[i]) < int(blue[i]): bcount = bcount + 1 print( 'RED' if rcount>bcount else ('BLUE' if bcount>rcount else 'EQUAL')) if __name__ == "__main__": T = int(input()) for t in range(T): n = int(input()) red = input() blue = input() solve(n, red, blue)
frase = input('Digite uma frase: ').upper().strip().replace(' ', '') tamanho = int(len(frase)) inverso = '' #Opção mais simples: # inverso = frase[::-1] for contador in range(tamanho-1, -1, -1): inverso += frase[contador] print('O inverso de {} é {}'.format(frase, inverso)) if frase == inverso: print('Temos um palíndromo!') else: print('A frase digitada não é um palíndromo!')