content
stringlengths
7
1.05M
#!/usr/bin/env python3 class Key: def __init__(self, group_name=None, item_name=None, variable_name=None): self._group_name = group_name self._item_name = item_name self._variable_name = variable_name def group_name(self): return self._group_name def item_name(self): return self._item_name def variable_name(self): return self._variable_name def __str__(self): path = [self._group_name] if self._item_name is not None: path.append(self._item_name) if self._variable_name is not None: path.append(self._variable_name)
X = X[:2000,:] labels = labels[:2000] score = pca_model.transform(X) with plt.xkcd(): visualize_components(score[:,0],score[:,1],labels) plt.show()
{ 'targets': [{ 'target_name': 'shoco', 'type': 'static_library', 'sources': ['shoco/shoco.c'], 'cflags': [ '-std=c99', '-fexceptions', '-Wall', '-march=native', '-Ofast' ], 'xcode_settings': { 'OTHER_CFLAGS': [ '-std=c99', '-fexceptions', '-Wall', '-march=native', '-Ofast' ] }, 'msvs_settings': { 'VCCLCompilerTool': { 'ExceptionHandling': 1, 'DisableSpecificWarnings': ['4244'] } } }] }
# =========================================================================== # scores.py --------------------------------------------------------------- # =========================================================================== # class ------------------------------------------------------------------- # --------------------------------------------------------------------------- class Scores(): # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def __init__( self, number=1, logger=None ): self._len = number self._logger = logger # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def __len__(self): return self._len # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def __iter__(self): self._index = -1 return self # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def __next__(self): if self._index < self._len-1: self._index += 1 return self else: raise StopIteration # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def __repr__(self): pass # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def logger(self, log_str): if self._logger is not None: self._logger.info(log_str) return log_str
def get_disc_loss(gen, disc, criterion, real, num_images, z_dim, device): ''' Return the loss of the discriminator given inputs. Parameters: gen: the generator model, which returns an image given z-dimensional noise disc: the discriminator model, which returns a single-dimensional prediction of real/fake criterion: the loss function, which should be used to compare the discriminator's predictions to the ground truth reality of the images (e.g. fake = 0, real = 1) real: a batch of real images num_images: the number of images the generator should produce, which is also the length of the real images z_dim: the dimension of the noise vector, a scalar device: the device type Returns: disc_loss: a torch scalar loss value for the current batch ''' noise_vectors = get_noise(num_images, z_dim, device) gen_out = gen(noise_vectors) disc_output_fake = disc(gen_out.detach()) loss_fake = criterion(disc_output_fake,torch.zeros_like(disc_output_fake)) disc_output_real = disc(real) loss_real = criterion(disc_output_real,torch.ones_like(disc_output_real)) disc_loss = (loss_fake+loss_real)/2 return disc_loss
# -*- coding: utf-8 -*- # @Author : ydf # @Time : 2019/8/8 0008 11:50 """ 实现各种中间件类型的发布者。 """
#!/usr/bin/env python def get_user_password(sockfile): """Given the path of a socket file, returns a tuple (user, password).""" return ("root", file('/etc/mysql/root.pw').read().strip())
load("//bazel:common.bzl", "get_env_bool_value") _IS_PLATFORM_ALIBABA = "IS_PLATFORM_ALIBABA" def _blade_service_common_impl(repository_ctx): if get_env_bool_value(repository_ctx, _IS_PLATFORM_ALIBABA): repository_ctx.template("blade_service_common_workspace.bzl", Label("//bazel/blade_service_common:blade_service_common_workspace.bzl.tpl"), { }) else: repository_ctx.template("blade_service_common_workspace.bzl", Label("//bazel/blade_service_common:blade_service_common_empty_workspace.bzl.tpl"), { }) repository_ctx.template("BUILD", Label("//bazel/blade_service_common:BUILD.tpl"), { }) blade_service_common_configure = repository_rule( implementation = _blade_service_common_impl, environ = [ _IS_PLATFORM_ALIBABA, ], )
def get_leveshtein(s1, s2): """Returns levenshtein's length, i.e. the number of characters to modify to get a pattern string""" if s1 is None or s2 is None: return -1 if len(s1) < len(s2): return get_leveshtein(s2, s1) # len(s1) >= len(s2) if len(s2) == 0: return len(s1) previous_row = range(len(s2) + 1) for i, c1 in enumerate(s1): current_row = [i + 1] for j, c2 in enumerate(s2): insertions = previous_row[j + 1] + 1 deletions = current_row[j] + 1 substitutions = previous_row[j] + (c1 != c2) current_row.append(min(insertions, deletions, substitutions)) previous_row = current_row return previous_row[-1] def trim(inquiry, candidate): """Trims input string to eliminate excessive words from the inquiry, and successively invokes get_livenshtein() method""" if inquiry is None or candidate is None: return -1 inquiry_words = inquiry.lower().split() candidate_words = candidate.lower().split() indexes = [] for i in range(0, len(inquiry_words)): for j in range(0, len(candidate_words)): if inquiry_words[i] == candidate_words[j]: indexes.append(j) if len(indexes) == 0: return -1 return get_leveshtein( "".join(candidate_words[min(indexes):max(indexes) + 1]), "".join(inquiry_words)) def determine_range(prices): """Approximates the range to eliminate accessories""" max_price = prices[0] for x in range(1, len(prices)): if prices[x] > max_price: max_price = prices[x] min_price = 100000000 for x in range(0, len(prices)): if prices[x] < min_price and prices[x] / max_price > 0.5: min_price = prices[x] return {"min": min_price, "max": max_price}
"""Exceptions and errors for BondGraphTools""" class InvalidPortException(Exception): """Exception for trying to access a port that is in use, or does not exist """ pass class InvalidComponentException(Exception): """Exception for when trying to use a model that can't be found, or is of the wrong type""" class ModelParsingError(Exception): """Exception for problems generating symbolic equations from string""" class ModelException(Exception): """Exception for inconsistent or invalid models when running simulations""" class SymbolicException(Exception): """Exception for when there are issues in model reduction or symbolic manipulation""" class SolverException(Exception): """Exception for issues running numerical solving."""
def defuzz(fset, type): # check for input type if not isinstance(fset, dict): raise TypeError("First input argument should be a dictionary.") # check input dictionary length if len(list(fset.keys())) < 1: raise ValueError("dictionary should have at least one member.") for key, value in fset.items(): if not isinstance(key, int) and not isinstance(value, float): raise TypeError("key :" + str(key) + " in dictionary should be a float or integer.") if not isinstance(value, int) and not isinstance(value, float): raise TypeError("value" + str(value) + " in dictionary should be a float or integer.") if value > 1 or value < 0: raise ValueError("value:" + str(value) + " should be between 0 or 1.") if not isinstance(type, str): raise TypeError("Second input argument should be a String.") if type.lower() == "centroid": # finding centroid: sum_moment_area = 0.0 sum_area = 0.0 k = list(fset.keys()) k.sort() # If the membership function is a singleton fuzzy set: if len(fset) == 1: return k[0] * fset[k[0]] / fset[k[0]] # else return the sum of moment*area/sum of area for i in range(1, len(k)): x1 = k[i - 1] x2 = k[i] y1 = fset[k[i - 1]] y2 = fset[k[i]] # if y1 == y2 == 0.0 or x1==x2: --> rectangle of zero height or width if not (y1 == y2 == 0.0 or x1 == x2): if y1 == y2: # rectangle moment = 0.5 * (x1 + x2) area = (x2 - x1) * y1 elif y1 == 0.0 and y2 != 0.0: # triangle, height y2 moment = 2.0 / 3.0 * (x2 - x1) + x1 area = 0.5 * (x2 - x1) * y2 elif y2 == 0.0 and y1 != 0.0: # triangle, height y1 moment = 1.0 / 3.0 * (x2 - x1) + x1 area = 0.5 * (x2 - x1) * y1 else: moment = (2.0 / 3.0 * (x2 - x1) * (y2 + 0.5 * y1)) / (y1 + y2) + x1 area = 0.5 * (x2 - x1) * (y1 + y2) sum_moment_area += moment * area sum_area += area return sum_moment_area / sum_area elif type.lower() == "mom": # finding mom: items = [k for k, v in fset.items() if v == max(fset.values())] return sum(items)/len(items) elif type.lower() == "som": # finding som: min_item, max_value = sorted(fset.items())[0] for item, value in sorted(fset.items()): if value > max_value: max_value = value min_item = item return min_item elif type.lower() == "lom": # finding lom: largest_item, largest_value = sorted(fset.items())[0] for item, value in sorted(fset.items()): if value >= largest_value: largest_value = value largest_item = item return largest_item else: raise ValueError("defuzzification type is unknown.")
freq=int(input()) list1=[] list2=[] for i in range(0,freq): row=[] fn=input().split() fn=[int(i) for i in fn] for e in fn: row.append(e) #[row.append(e) for e in fn] list1.append(row) for row in list1: for i in range(0,freq): list2.append(list1[0][i]) #for e in row: for row in list1: print(row) print(list2)
class Action: """ Función de transición con su acción correspondiente. """ def __init__(self, name, parameters, variables, preconditions, effects): """ :param name: Name of the action. :param parameters: List of variables. :param variables: List of free variables. They can take whatever object of the domain as long as their values ​​satisfy the constraints of the preconditions. :param preconditions: List of predicates with free variables. The state of the world must have the same predicates in order to apply this action. :param effects: List of predicates with free variables. It represents the effects that occur after applying this action. """ self.name = name self.parameters = parameters self.vars = variables self.preconditions = preconditions self.effects = effects def __str__(self): dic = {'name': self.name, 'params': ' '.join(str(p) for p in self.parameters), 'prec': ' '.join(str(p) for p in self.preconditions), 'efec': ' '.join(str(p) for p in self.effects) } if self.vars: dic['vars'] = f'\n :vars ({" ".join(str(v) for v in self.vars)})' else: dic['vars'] = '' if len(self.preconditions) >= 2: dic['prec'] = '(and ' + dic['prec'] + ')' if len(self.effects) >= 2: dic['efec'] = '(and ' + dic['efec'] + ')' return """(:action {name} :parameters ({params}) {vars} :precondition {prec} :effect {efec} )""".format(**dic)
# The code below almost works name = input("Enter your name") print("Hello", name)
''' Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times.You may assume that the majority element always exists in the array. Example: Input - [2,2,1,1,1,2,2] Output - 2 Explanation - 2 occurs more than 3 times Constraints: Time complexity - O(n) Space complexity - O(1) n == nums.length 1 <= n <= 5 * 10^4 -2^31 <= nums[i] <= 2^31 - 1 ''' def majorityElement(nums): count = 0 m = 0 for i in nums: if count == 0: m = i count += 1 elif m == i: count += 1 else: count -= 1 return m if __name__ == "__main__": nums = input() nums = [int(i.strip()) for i in nums[1:-1].split(',')] print(majorityElement(nums))
# -*- coding: utf-8 -*- # Copyright (c) 2018 Richard Hull & Contributors # See LICENSE.md for details. """ Alternative pin mappings for Orange PI 4 (https://drive.google.com/drive/folders/1jALhyhwjSVsxwSX1MwhjiOyQdx_fwlFg) Usage: .. code:: python import orangepi.4 from OPi import GPIO GPIO.setmode(orangepi.4.BOARD) or GPIO.setmode(orangepi.4.BCM) """ # pin number = (position of letter in alphabet - 1) * 32 + pin number # So, PD14 will be (4 - 1) * 32 + 14 = 110 # Orange Pi 4 physical board pin to GPIO pin BOARD = { 3: 64, # I2C2_SDA_3V0 5: 65, # I2C2_SCL_3V0 7: 150, # GPIO4_C6/PWM1 8: 145, # I2C3_SCL 10: 144, # I2C3_SDA 11: 33, # GPIO1_A1 12: 50, # GPIO1_C2 13: 35, # GPIO1_A3 15: 92, # GPIO2_D4 16: 54, # GPIO1_C6 18: 55, # GPIO1_C7 19: 40, # UART4_TX 21: 39, # UART4_RX 22: 56, # GPIO1_D0 23: 41, # SPI1_CLK 24: 42, # SPI1_CSn0 26: 149, # GPIO4_C5 27: 64, # I2C2_SDA 28: 65, # I2C2_SCL 29: 121, # I2S0_RX 31: 122, # I2S0_TX 32: 128, # I2S_CLK 33: 120, # I2S0_SCK 35: 123, # I2S0_SI0 36: 127, # I2S0_SO0 37: 124, # I2S0_SI1 38: 125, # I2S0_SI2 40: 126, # I2S0_SI3 } # No reason for BCM mapping, keeping it for compatibility BCM = BOARD
""" VTGS Relay Daemon -- https://github.com/zleffke/cdh_sim """ __title__ = "CDH SIM" __version__ = "0.0.0" __author__ = "Zach Leffke, KJ4QLP" __email__ = "zleffke@vt.edu" __desc__ = "VCC CDH Simulator" __url__ = "vtgs.hume.vt.edu"
# coding=UTF-8 def find_shortest_node(costs,process): shortest_value = float('inf') shortest_node = None for key in costs : if costs[key] < shortest_value and key not in process: print( 'key:'+key +'->'+ str(costs[key]) ) shortest_node = key shortest_value = costs[key] return shortest_node # 图-》主要的数据库存储 graph = {} graph['a'] = {} graph['a']['b'] = 5 graph['a']['c'] = 2 graph['b'] = {} graph['b']['d'] = 4 graph['b']['e'] = 2 graph['c'] = {} graph['c']['b'] = 8 graph['c']['e'] = 7 graph['d'] = {} graph['d']['f'] = 3 graph['d']['e'] = 6 graph['e'] = {} graph['e']['f'] = 1 graph['f'] = {} # 起点到各点的最小距离 costs = {} # 标记已经处理过的值 process = [] # 记录最小路径的经过 parents = {} infinity = float('inf') # init costs start = 'a' end = 'f' for node in graph.keys(): if node == start: costs[node] = 0 else: costs[node] = infinity print( str(costs) ) # 调用方法,找到未处理过的路径最短的点 node = find_shortest_node(costs,process) while len( graph.keys() ) > 0: print( "shortest temp :" + node) neighbours = graph[node] for one_neithbour in neighbours.keys(): old_length = costs[one_neithbour] # 当前节点到邻居的距离加上当前节点 new_length = graph[node][one_neithbour] + costs[node] if new_length < old_length: costs[one_neithbour] = new_length parents[one_neithbour] = node del graph[node] process.append(node) node = find_shortest_node(costs,process) print( str(costs) ) print( str(parents) )
# Algocja leży na wielkiej pustyni i składa się z miast oraz oaz połączonych drogami. Każde miasto # jest otoczone murem i ma tylko dwie bramy - północną i południową. Z każdej bramy prowadzi dokładnie # jedna droga do jednej oazy (ale do danej oazy może dochodzić dowolnie wiele dróg; oazy mogą też być # połączone drogami między sobą). Prawo Algocji wymaga, że jeśli ktoś wjechał do miasta jedną bramą, # to musi go opuścić drugą. Szach Algocji postanowił wysłać gońca, który w każdym mieście kraju odczyta # zakaz formułowania zadań “o szachownicy” (obraza majestatu). Szach chce, żeby goniec odwiedził każde # miasto dokładnie raz (ale nie ma ograniczeń na to ile razy odwiedzi każdą z oaz). Goniec wyjeżdża ze # stolicy Algocji, miasta x, i po odwiedzeniu wszystkich miast ma do niej wrócić. Proszę przedstawić # algorytm, który stwierdza czy odpowiednia trasa gońca istnieje. def check_and_bishop(graph, oasis): changed_graph = [] for i in range(len(graph)): if i not in oasis: changed_graph.append([graph[i][0], graph[i][1], 0]) else: for j in range(len(graph[i])): if graph[i][j] in oasis: if [graph[i][j], i, 1] not in changed_graph: changed_graph.append([i, graph[i][j], 1]) count = 0 vertices = [] for i in range(len(changed_graph)): if changed_graph[i][2] == 1: vertices.append((changed_graph[i][0], changed_graph[i][1])) count += 1 for i in range(len(vertices)): for j in range(len(changed_graph)): if changed_graph[j][0] in vertices[i]: changed_graph[j][0] = min(vertices[i]) if changed_graph[j][1] in vertices[i]: changed_graph[j][1] = min(vertices[i]) i = 0 while i < len(changed_graph): j = i + 1 while j < len(changed_graph): if changed_graph[i][0] == changed_graph[j][0] and changed_graph[i][1] == changed_graph[j][1] and \ changed_graph[i][2] == 1: changed_graph.remove(changed_graph[i]) elif changed_graph[i][0] == changed_graph[j][0] and changed_graph[i][1] == changed_graph[j][1] and \ changed_graph[j][2] == 1: changed_graph.remove(changed_graph[j]) j += 1 i += 1 new_graph = [] for i in range(len(changed_graph)): if changed_graph[i][0] not in new_graph: new_graph.append(changed_graph[i][0]) if changed_graph[i][1] not in new_graph: new_graph.append(changed_graph[i][1]) for i in range(len(new_graph)): new_graph[i] = [new_graph[i], 0] for i in range(len(new_graph)): for j in range(len(changed_graph)): if new_graph[i][0] == changed_graph[j][0]: new_graph[i][1] += 1 if new_graph[i][0] == changed_graph[j][1]: new_graph[i][1] += 1 for i in range(len(new_graph)): if new_graph[i][1] % 2 == 1: return False return True oasis = [2, 4, 5, 7, 9] graph = [[2, 4], [2, 9], [0, 4, 3], [2, 5], [0, 2, 6], [3, 7, 8], [4, 7], [5, 6, 8], [5, 7], [1]] print(check_and_bishop(graph, oasis))
#!/usr/bin/env python3 class FilterModule(object): # my_vars: "{{ dom_dt.data.sub_domains | json_select('', ['ip','domain','phpversion','customlog','phpopenbasedirprotect']) }}" # my_vars: "{{ dom_dt | json_select(['data','sub_domains'], ['ip','domain','phpversion','customlog','phpopenbasedirprotect']) }}" # my_vars: "{{ dom_dt.data | json_select(['sub_domains',0], ['ip','domain','phpversion','customlog','phpopenbasedirprotect']) }}" # my_vars: "{{ dom_dt.data.sub_domains | json_select(0, ['ip','domain','phpversion','customlog','phpopenbasedirprotect']) }}" # def filters(self): return { 'json_select': self.json_select } def jmagik(self, jbody, jpth, jfil): countr = 0 countr1 = True if jpth != "" and type(jpth) is not int: jvar=jbody for i in jpth: jvar=jvar[i] elif type(jpth) is int: jvar=jbody[jpth] else: jvar=jbody if type(jvar) is not list: # we must convert dict to list because without it, we geting ['','','','',''.........,''] but we need [{'','','',...,''}] jvar = [jvar] countr1 = False for nm in range(len(jvar)): # chek how levels exist if it's [{'.......'},....{'......'}] for i in list((jvar[nm])): # convert jvar[nm] because it's dict(we need list) and iterate countr = 0 for j in jfil: if j != i: countr +=1 if(countr == len(jfil)): jvar[nm].pop(i) if countr1 == False: jvar=jvar[0] return jvar def json_select(self, jbody, jpth, jfil): if(jpth != "" and type(jpth) is not int ): jbody[str(jpth)] = self.jmagik(jbody, jpth, jfil) del jbody[str(jpth)] elif(type(jpth) is int): jbody[jpth] = self.jmagik(jbody, jpth, jfil) else: jbody = self.jmagik(jbody, jpth, jfil) return jbody
a = float(input()) b = float(input()) c = float(input()) d = float(input()) a = a*2 b = b*3 c = c*4 e = (a+b+c+d)/10 print("Media: %.1f"%e) if (e >= 7): print("Aluno aprovado.") elif(e < 5): print("Aluno reprovado.") else: print("Aluno em exame.") f = float(input()) print("Nota do exame: %.1f"%f) f = (e+f)/2 if (f >= 5): print("Aluno aprovado.") print("Media final: %.1f"%f) else: print("Aluno reprovado.") print("Media final: %.1f"%f)
x=('zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen') y=('twenty','thirty','fourty','fifty','sixty','seventy','eighty','ninety','hundred','thousand') ins=["one","hundred","fourty","nine"] d=t=h=T=1 ans=0 for i in ins[::-1]: if d: ans+=x.index(i);d=0 print(i) print(ans)
cont = ('zero', 'um','dois', 'três','quatro', 'cinco', 'seis', 'sete', 'oito', 'nove', 'dez' 'onze', 'quatorze', 'quinze', 'dezesseis', 'dezessete', 'dezoito', 'dezenove', 'vinte') while True: núm = int(input('Digite um valor de [0 até 20]: ')) if 0 <= núm <= 20: break print('Féra tente novamente.', end='') print(f'Você digitou o número {cont[núm]}')
# Exercício 75 # Desenvolva um programa que leia quatro valores pelo teclado e guarde-os em uma tupla. No final, mostre: # A) Quantas vezes apareceu o valor 9. # B) Em que posição foi digitado o primeiro valor 3. # C) Quais foram os Números Pares. NumPar = 0 num1 = int(input("Digite um número: ")) num2 = int(input(("Digite outro número: "))) num3 = int(input(("Digite outro número: "))) num4 = int(input(("Digite outro número: "))) Numeros = (num1, num2, num3, num4) print(f"Os números digitados foram: {Numeros}") print(f"O número '9' apareceu {Numeros.count(9)} Vezes") if 3 in Numeros: print(f"O número '3' foi digitado pela primeira vez no {Numeros.index(3)+1}º Número") else: print("O número '3' não foi digitado") print("Os números pares digitados foram: ", end='') for numero in Numeros: if numero % 2 == 0: print(f"{numero} ", end='')
# Michael Williamson # NATO Phonetic/Morse Code Translator # 7/29/2020 MORSE_CODE_DICT = { 'A':'.-', 'B':'-...', 'C':'-.-.', 'D':'-..', 'E':'.', 'F':'..-.', 'G':'--.', 'H':'....', 'I':'..', 'J':'.---', 'K':'-.-', 'L':'.-..', 'M':'--', 'N':'-.', 'O':'---', 'P':'.--.', 'Q':'--.-', 'R':'.-.', 'S':'...', 'T':'-', 'U':'..-', 'V':'...-', 'W':'.--', 'X':'-..-', 'Y':'-.--', 'Z':'--..'} NATO_PHONETIC_DICT = { 'A':'Alpha', 'B':'Bravo', 'C':'Charlie', 'D':'Delta', 'E':'Echo', 'F':'Foxtrot', 'G':'Golf', 'H':'Hotel', 'I':'India', 'J':'Juliet', 'K':'Kilo', 'L':'Lima', 'M':'Mike', 'N':'November', 'O':'Oscar', 'P':'Papa', 'Q':'Quebec', 'R':'Romeo', 'S':'Sierra', 'T':'Tango', 'U':'Uniform', 'V':'Victor', 'W':'Whiskey', 'X':'Xray', 'Y':'Yankee', 'Z':'Zulu'} sentence = input("What phrase would you like to convert to NATO Phonetic/Morse Code or decrypt (Only alphabet)? ") sentence = sentence.upper() sentence = sentence.replace(" ", "") nato = "" morse = "" for i in sentence: nato = nato + NATO_PHONETIC_DICT[i] + " " morse = morse + MORSE_CODE_DICT[i] + " " print("Nato Phonetic: " + nato) print("Morse Code: " + morse)
# -- encoding:utf-8 -- """ Create by ibf on 2018/6/21 """
def test_lowercase_spell(client): assert "Fireball" in client.post('/spellbook', data=dict(text="fireball", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text'] def test_uppercase_spell(client): assert "Fireball" in client.post('/spellbook', data=dict(text="FIREBALL", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text'] def test_titlecase_spell(client): assert "Fireball" in client.post('/spellbook', data=dict(text="Fireball", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text'] def test_apostrophe_spell(client): assert "Crusader's Mantle" in client.post('/spellbook', data=dict(text="Crusader's Mantle", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text'] def test_blank(client): error_message = "You have to tell me what spell to look up for you. I'm not a mind flayer." assert error_message in client.post('/spellbook', data=dict(text="", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text'] def test_bad_input(client): error_message = "No spell by that name found." assert error_message in client.post('/spellbook', data=dict(text="asdfasdfasdf", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text'] def test_durations(client): nondetect_response = client.post('/spellbook', data=dict(text="Nondetection", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text'] assert '*Duration:* 8 hours' in nondetect_response fireball_response = client.post('/spellbook', data=dict(text="Fireball", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text'] assert '*Duration:* Instant' in fireball_response cloud_response = client.post('/spellbook', data=dict(text="Incendiary Cloud", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text'] assert '*Duration:* 1 minute (concentration)' in cloud_response or '*Duration:* Concentration' in cloud_response imprisonment_response = client.post('/spellbook', data=dict(text="Imprisonment", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text'] assert '*Duration:* Permanent' in imprisonment_response or '*Duration:* Until dispelled' in imprisonment_response def test_cantrip(client): assert "cantrip" in client.post('/spellbook', data=dict(text="Shocking Grasp", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text'] def test_ritual(client): assert "ritual" in client.post('/spellbook', data=dict(text="Identify", team_id='test-team-id', token='test-token', user_id='asdf')).get_json()['text']
x = 1 if x == 1: # indented four spaces print("x is ASDJASJDJAJSAJD JASJD ASJD JASJD JASDJ AJSDJ ASJD JASJD JASJD JASJD AJS DJASJD JASJD JASDJ AJSD JASJD JSADJ ASJD JASD AJSD JASJD JASD AJSDJ ASJD JA1.")
description = 'Laser Safety Shutter' prefix = '14IDB:B1Bi0' target = 0.0 command_value = 1.0 auto_open = 0.0 EPICS_enabled = True
""" file namers """ class Extension(): """ file extensions """ INFORMATION = '.yaml' INPUT_LOG = '.inp' OUTPUT_LOG = '.out' PROJROT_LOG = '.prot' TEMPLATE = '.temp' SHELL_SCRIPT = '.sh' ENERGY = '.ene' GEOMETRY = '.xyz' TRAJECTORY = '.t.xyz' ZMATRIX = '.zmat' VMATRIX = '.vmat' TORS = '.tors' RTORS = '.rtors' GRADIENT = '.grad' HESSIAN = '.hess' CUBIC_FC = '.cubic' QUARTIC_FC = '.quartic' HARMONIC_ZPVE = '.hzpve' ANHARMONIC_ZPVE = '.azpve' HARMONIC_FREQUENCIES = '.hfrq' ANHARMONIC_FREQUENCIES = '.afrq' PROJECTED_FREQUENCIES = '.pfrq' ANHARMONICITY_MATRIX = '.xmat' VIBRO_ROT_MATRIX = '.vrmat' CENTRIF_DIST_CONSTS = '.qcd' LJ_EPSILON = '.eps' LJ_SIGMA = '.sig' EXTERNAL_SYMMETRY_FACTOR = '.esym' INTERNAL_SYMMETRY_FACTOR = '.isym' DIPOLE_MOMENT = '.dmom' POLARIZABILITY = '.polar' # Transformation files REACTION = '.r.yaml' # Instability Transformation files INSTAB = '.yaml' # Various VaReCoF files VRC_TST = '.tst' VRC_DIVSUR = '.divsur' VRC_MOLP = '.molpro' VRC_TML = '.tml' VRC_STRUCT = '.struct' VRC_POT = '.pot' VRC_FLUX = '.flux' JSON = '.json' def information(file_name): """ adds information extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.INFORMATION) def input_file(file_name): """ adds input file extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.INPUT_LOG) def output_file(file_name): """ adds output file extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.OUTPUT_LOG) def instability(file_name): """ adds instability extension, if missing """ return _add_extension(file_name, Extension.INSTAB) def projrot_file(file_name): """ adds projrot file extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.PROJROT_LOG) def run_script(file_name): """ adds run script extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.SHELL_SCRIPT) def energy(file_name): """ adds energy extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.ENERGY) def geometry(file_name): """ adds geometry extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.GEOMETRY) def trajectory(file_name): """ adds trajectory extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.TRAJECTORY) def zmatrix(file_name): """ adds zmatrix extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.ZMATRIX) def vmatrix(file_name): """ adds variable zmatrix extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.VMATRIX) def torsions(file_name): """ adds variable torsions extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.TORS) def ring_torsions(file_name): """ adds variable torsions extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.RTORS) def gradient(file_name): """ adds gradient extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.GRADIENT) def hessian(file_name): """ adds hessian extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.HESSIAN) def harmonic_zpve(file_name): """ adds harmonic zpve extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.HARMONIC_ZPVE) def anharmonic_zpve(file_name): """ adds anharmonic zpve extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.ANHARMONIC_ZPVE) def harmonic_frequencies(file_name): """ adds harmonic frequencies extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.HARMONIC_FREQUENCIES) def anharmonic_frequencies(file_name): """ adds anharmonic frequencies extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.ANHARMONIC_FREQUENCIES) def projected_frequencies(file_name): """ adds projected frequencies extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.PROJECTED_FREQUENCIES) def cubic_force_constants(file_name): """ adds cubic force constants extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.CUBIC_FC) def quartic_force_constants(file_name): """ adds quartic force constants extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.QUARTIC_FC) def anharmonicity_matrix(file_name): """ adds anharmonicity maxtrix extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.ANHARMONICITY_MATRIX) def vibro_rot_alpha_matrix(file_name): """ adds vibro_rot_alpha maxtrix extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.VIBRO_ROT_MATRIX) def quartic_centrifugal_dist_consts(file_name): """ adds quartic centrifugal distortion constants, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.CENTRIF_DIST_CONSTS) def lennard_jones_epsilon(file_name): """ adds lennard-jones epsilon extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.LJ_EPSILON) def lennard_jones_sigma(file_name): """ adds lennard-jones sigma extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.LJ_SIGMA) def lennard_jones_input(file_name): """ adds lennard-jones input file extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.INPUT_LOG) def lennard_jones_elstruct(file_name): """ adds lennard-jones sigma extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.TEMPLATE) def external_symmetry_factor(file_name): """ adds external symmetry number extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.EXTERNAL_SYMMETRY_FACTOR) def internal_symmetry_factor(file_name): """ adds internal symmetry number extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.INTERNAL_SYMMETRY_FACTOR) def dipole_moment(file_name): """ adds dipole moment extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.DIPOLE_MOMENT) def polarizability(file_name): """ adds dipole moment extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.POLARIZABILITY) def reaction(file_name): """ adds reaction extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.REACTION) def vrctst_tst(file_name): """ adds vrctst_tst extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.VRC_TST) def vrctst_divsur(file_name): """ adds vrctst_divsur extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.VRC_DIVSUR) def vrctst_molpro(file_name): """ adds vrctst_molpro extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.VRC_MOLP) def vrctst_tml(file_name): """ adds vrctst_tml extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.VRC_TML) def vrctst_struct(file_name): """ adds vrctst_struct extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.VRC_STRUCT) def vrctst_pot(file_name): """ adds vrctst_pot extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.VRC_POT) def vrctst_flux(file_name): """ adds vrctst_flux extension, if missing :param file_name: name of file :type file_name: str :returns: file with extension added :rtype: str """ return _add_extension(file_name, Extension.VRC_FLUX) def _add_extension(file_name, ext): if not str(file_name).endswith(ext): file_name = '{}{}'.format(file_name, ext) return file_name
Matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] print('='*40) print('GERADOR DE MATRIZ') print('='*40) for i in range(0, 3): for j in range(0, 3): Matriz[i][j] = int(input(f'Insira um valor na linha {i}, coluna {j}: ')) print( '='*40) print('\n') print(f"{'A = ': ^17}") for i in range(0, 3): for j in range(0, 3): print(f'[{Matriz[i][j]: ^3}] ', end='') print('')
class ApiEndpoint(object): client = None parent = None def __init__(self, client, parent=None): self.client = client self.parent = parent
__all__ = [ "SamplingError", "IncorrectArgumentsError", "TraceDirectoryError", "ImputationWarning", "ShapeError" ] class SamplingError(RuntimeError): pass class IncorrectArgumentsError(ValueError): pass class TraceDirectoryError(ValueError): """Error from trying to load a trace from an incorrectly-structured directory,""" pass class ImputationWarning(UserWarning): """Warning that there are missing values that will be imputed.""" pass class ShapeError(Exception): """Error that the shape of a variable is incorrect.""" def __init__(self, message, actual=None, expected=None): if expected and actual: super().__init__('{} (actual {} != expected {})'.format(message, actual, expected)) else: super().__init__(message) class DtypeError(TypeError): """Error that the dtype of a variable is incorrect.""" def __init__(self, message, actual=None, expected=None): if expected and actual: super().__init__('{} (actual {} != expected {})'.format(message, actual, expected)) else: super().__init__(message)
''' This package serves two purposes: 1. Define the interface for different parser adapters to implement. 2. Implement the completion generation logic based on the defined interface. Other packages should subclass the supplied classes and implement the interface. '''
__author__ = "Sylvain Dangin" __licence__ = "Apache 2.0" __version__ = "1.0" __maintainer__ = "Sylvain Dangin" __email__ = "sylvain.dangin@gmail.com" __status__ = "Development" class last_word(): def transform(input_data): """Get the last word of a string with more than one word. :param input_data: Text with more than one word. :return: The last word of the input string. :rtype: str """ if isinstance(input_data, str): if ' ' in input_data: # Remove punctuation find_punctuation = True punctuations = ['.', '?', '!', ','] while find_punctuation: find_punctuation = False for punctuation in punctuations: if punctuation == input_data[len(input_data) - 1]: find_punctuation = True input_data = input_data[:-1] # Remove space before punctuation if input_data[len(input_data) - 1] == ' ': input_data = input_data[:-1] break parts = input_data.split(' ') return parts[len(parts) - 1] return input_data
'''Crie um programa onde o usuário digite uma expressão qualquer que use parênteses. Seu aplicativo deverá analisar se a expressão passada está com os parênteses abertos e fechados na ordem correta.''' '''frase = str(input('Digite uma expressão qualquer: ')) list1 = list() list2 = list() for i in frase: if i == '(': list1.append(i) if i == ')': list2.append(1) if len(list1) == len(list2): print('Sua expressão está válida.') else: print('Sua expressão está errada.')''' expr = str(input('Digite sua expressão: ')) pilha = [] for simb in expr: if simb == '(': pilha.append('(') elif simb == ')': if len(pilha) > 0: pilha.pop() else: pilha.append(')') break if len(pilha) == 0: print('Sua expressão esta correta') else: print('Sua expressão esta errada')
# -*- coding: utf-8 -*- """ Created on Tue Aug 24 11:36:00 2021 @author: 2900888 """ tall_streng = input("Skriv inn en alder: ") alder = int(tall_streng) if alder >= 13 and alder < 18: print("Personen er tenåring") else: print("Personen er ikke tenåring")
# @desc The 2nd character in a string is at index 1. def combine2(s1, s2): s3 = s1[1] s4 = s2[1] result = s3 + s4 return result def main(): print(combine2('Car', 'wash')) print(combine2(' Hello', ' world')) print(combine2('55', '88')) print(combine2('Snow', 'ball')) print(combine2('Rain', 'boots')) print(combine2('Reading', 'bat')) print(combine2('AA', 'HI')) print(combine2('Hi', 'there')) print(combine2(' ', ' ')) if __name__ == '__main__': main()
""" Description =========== Write a simple function that take a input string, add a space after every 3rd character, and return the modified string """ def simple_function(input): """ Adds a space every 3rd character of an input :param input: String - some string :returns: String - A string with a space between every 3rd character """ output = "" for index in range(len(input)): if index%3==0 and index!=0: output += " " output += input[index] return output def main(): input = "jalsdflbvflnvfmdklsdfsdjkbd" output = simple_function(input) print("Input: '%s'" % input) print("Output: '%s'" % output) if __name__ == "__main__": main()
class Node: def __init__(self, data): self.data = data self.next = None def create_circular_linked_list(): head = Node(1) node2 = Node(2) node3 = Node(3) node4 = Node(4) node5 = Node(5) head.next = node2 node2.next = node3 node3.next = node4 node4.next = node5 node5.next = node2 return head def check_loop(head): slow = head.next fast = slow.next while head: if slow == fast: print("Loop exists") return fast elif slow is None or fast is None: print("Loop does not exist") break else: slow = slow.next fast = fast.next.next def get_first_node_of_loop(start, mid): while start: if start == mid: print("The data of the first node of the loop is " + str(mid.data)) break else: start = start.next mid = mid.next head = create_circular_linked_list() a = check_loop(head) get_first_node_of_loop(head, a)
# # PySNMP MIB module RADLAN-rlFft (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RADLAN-rlFft # Produced by pysmi-0.3.4 at Mon Apr 29 20:42:31 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion") rnd, = mibBuilder.importSymbols("RADLAN-MIB", "rnd") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") iso, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Counter32, TimeTicks, NotificationType, Bits, ObjectIdentity, Integer32, ModuleIdentity, Gauge32, Counter64, Unsigned32, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Counter32", "TimeTicks", "NotificationType", "Bits", "ObjectIdentity", "Integer32", "ModuleIdentity", "Gauge32", "Counter64", "Unsigned32", "IpAddress") TextualConvention, TruthValue, RowStatus, PhysAddress, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "TruthValue", "RowStatus", "PhysAddress", "DisplayString") class Percents(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 100) class NetNumber(TextualConvention, OctetString): status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(4, 4) fixedLength = 4 rlFFT = ModuleIdentity((1, 3, 6, 1, 4, 1, 89, 47)) rlFFT.setRevisions(('2004-06-01 00:00',)) if mibBuilder.loadTexts: rlFFT.setLastUpdated('200406010000Z') if mibBuilder.loadTexts: rlFFT.setOrganization('') rlIpFFT = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 47, 1)) rlIpFftMibVersion = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftMibVersion.setStatus('current') rlIpMaxFftNumber = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpMaxFftNumber.setStatus('current') rlIpFftDynamicSupported = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("supported", 1), ("unsupported", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftDynamicSupported.setStatus('current') rlIpFftSubnetSupported = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("supported", 1), ("unsupported", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubnetSupported.setStatus('current') rlIpFftUnknownAddrMsgUsed = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("used", 1), ("unused", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftUnknownAddrMsgUsed.setStatus('current') rlIpFftAgingTimeSupported = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("supported", 1), ("unsupported", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftAgingTimeSupported.setStatus('current') rlIpFftSrcAddrSupported = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("supported", 1), ("unsupported", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSrcAddrSupported.setStatus('current') rlIpFftAgingTimeout = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 1, 8), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpFftAgingTimeout.setStatus('current') rlIpFftRedBoundary = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 1, 9), Percents()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpFftRedBoundary.setStatus('current') rlIpFftYellowBoundary = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 1, 10), Percents()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpFftYellowBoundary.setStatus('current') rlIpFftNumTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 1, 12), ) if mibBuilder.loadTexts: rlIpFftNumTable.setStatus('current') rlIpFftNumEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 1, 12, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpFftNumIndex")) if mibBuilder.loadTexts: rlIpFftNumEntry.setStatus('current') rlIpFftNumIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 12, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNumIndex.setStatus('current') rlIpFftNumStnRoutesNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 12, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNumStnRoutesNumber.setStatus('current') rlIpFftNumSubRoutesNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 12, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNumSubRoutesNumber.setStatus('current') rlIpFftStnTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 1, 13), ) if mibBuilder.loadTexts: rlIpFftStnTable.setStatus('current') rlIpFftStnEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpFftStnIndex"), (0, "RADLAN-rlFft", "rlIpFftStnMrid"), (0, "RADLAN-rlFft", "rlIpFftStnDstIpAddress")) if mibBuilder.loadTexts: rlIpFftStnEntry.setStatus('current') rlIpFftStnIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftStnIndex.setStatus('current') rlIpFftStnMrid = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftStnMrid.setStatus('current') rlIpFftStnDstIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftStnDstIpAddress.setStatus('current') rlIpFftStnDstRouteIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1, 4), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftStnDstRouteIpMask.setStatus('current') rlIpFftStnDstIpAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("local", 1), ("remote", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftStnDstIpAddrType.setStatus('current') rlIpFftStnDstMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1, 6), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftStnDstMacAddress.setStatus('current') rlIpFftStnSrcMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1, 7), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftStnSrcMacAddress.setStatus('current') rlIpFftStnOutIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftStnOutIfIndex.setStatus('current') rlIpFftStnVid = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftStnVid.setStatus('current') rlIpFftStnTaggedMode = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("untagged", 1), ("tagged", 2), ("basedPortConfig", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftStnTaggedMode.setStatus('current') rlIpFftStnAge = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 13, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftStnAge.setStatus('current') rlIpFftSubTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 1, 14), ) if mibBuilder.loadTexts: rlIpFftSubTable.setStatus('current') rlIpFftSubEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpFftSubMrid"), (0, "RADLAN-rlFft", "rlIpFftSubDstIpSubnet"), (0, "RADLAN-rlFft", "rlIpFftSubDstIpMask")) if mibBuilder.loadTexts: rlIpFftSubEntry.setStatus('current') rlIpFftSubMrid = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubMrid.setStatus('current') rlIpFftSubDstIpSubnet = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubDstIpSubnet.setStatus('current') rlIpFftSubDstIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubDstIpMask.setStatus('current') rlIpFftSubAge = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubAge.setStatus('current') rlIpFftSubNextHopSetRefCount = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopSetRefCount.setStatus('current') rlIpFftSubNextHopCount = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopCount.setStatus('current') rlIpFftSubNextHopIfindex1 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIfindex1.setStatus('current') rlIpFftSubNextHopIpAddr1 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 8), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIpAddr1.setStatus('current') rlIpFftSubNextHopIfindex2 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIfindex2.setStatus('current') rlIpFftSubNextHopIpAddr2 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 10), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIpAddr2.setStatus('current') rlIpFftSubNextHopIfindex3 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIfindex3.setStatus('current') rlIpFftSubNextHopIpAddr3 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 12), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIpAddr3.setStatus('current') rlIpFftSubNextHopIfindex4 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIfindex4.setStatus('current') rlIpFftSubNextHopIpAddr4 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 14), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIpAddr4.setStatus('current') rlIpFftSubNextHopIfindex5 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIfindex5.setStatus('current') rlIpFftSubNextHopIpAddr5 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 16), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIpAddr5.setStatus('current') rlIpFftSubNextHopIfindex6 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 17), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIfindex6.setStatus('current') rlIpFftSubNextHopIpAddr6 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 18), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIpAddr6.setStatus('current') rlIpFftSubNextHopIfindex7 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 19), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIfindex7.setStatus('current') rlIpFftSubNextHopIpAddr7 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 20), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIpAddr7.setStatus('current') rlIpFftSubNextHopIfindex8 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIfindex8.setStatus('current') rlIpFftSubNextHopIpAddr8 = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 14, 1, 22), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftSubNextHopIpAddr8.setStatus('current') rlIpFftCountersTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 1, 15), ) if mibBuilder.loadTexts: rlIpFftCountersTable.setStatus('current') rlIpFftCountersEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 1, 15, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpFftCountersIndex")) if mibBuilder.loadTexts: rlIpFftCountersEntry.setStatus('current') rlIpFftCountersIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 15, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftCountersIndex.setStatus('current') rlIpFftInReceives = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 15, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftInReceives.setStatus('current') rlIpFftForwDatagrams = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 15, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftForwDatagrams.setStatus('current') rlIpFftInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 15, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftInDiscards.setStatus('current') rlIpFftNextHopTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 1, 16), ) if mibBuilder.loadTexts: rlIpFftNextHopTable.setStatus('current') rlIpFftNextHopEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 1, 16, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpFftNextHopifindex"), (0, "RADLAN-rlFft", "rlIpFftNextHopIpAddress")) if mibBuilder.loadTexts: rlIpFftNextHopEntry.setStatus('current') rlIpFftNextHopifindex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 16, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNextHopifindex.setStatus('current') rlIpFftNextHopIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 16, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNextHopIpAddress.setStatus('current') rlIpFftNextHopValid = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 16, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNextHopValid.setStatus('current') rlIpFftNextHopType = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 16, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("local", 1), ("remote", 2), ("reject", 3), ("drop", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNextHopType.setStatus('current') rlIpFftNextHopReferenceCount = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 16, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNextHopReferenceCount.setStatus('current') rlIpFftNextHopNetAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 16, 1, 6), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNextHopNetAddress.setStatus('current') rlIpFftNextHopVid = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 16, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNextHopVid.setStatus('current') rlIpFftNextHopMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 16, 1, 8), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNextHopMacAddress.setStatus('current') rlIpFftNextHopOutIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 16, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftNextHopOutIfIndex.setStatus('current') rlIpFftL2InfoTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 1, 17), ) if mibBuilder.loadTexts: rlIpFftL2InfoTable.setStatus('current') rlIpFftL2InfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 1, 17, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpFftL2InfoIfindex"), (0, "RADLAN-rlFft", "rlIpFftL2InfoDstMacAddress")) if mibBuilder.loadTexts: rlIpFftL2InfoEntry.setStatus('current') rlIpFftL2InfoIfindex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 17, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftL2InfoIfindex.setStatus('current') rlIpFftL2InfoDstMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 17, 1, 2), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftL2InfoDstMacAddress.setStatus('current') rlIpFftL2InfoValid = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 17, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftL2InfoValid.setStatus('current') rlIpFftL2InfoType = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 17, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("other", 1), ("vlan", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftL2InfoType.setStatus('current') rlIpFftL2InfoReferenceCount = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 17, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftL2InfoReferenceCount.setStatus('current') rlIpFftL2InfoVid = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 17, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftL2InfoVid.setStatus('current') rlIpFftL2InfoSrcMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 17, 1, 7), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftL2InfoSrcMacAddress.setStatus('current') rlIpFftL2InfoOutIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 17, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftL2InfoOutIfIndex.setStatus('current') rlIpFftL2InfoTaggedMode = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 1, 17, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("untagged", 1), ("tagged", 2), ("basedPortConfig", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpFftL2InfoTaggedMode.setStatus('current') rlIpxFFT = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 47, 2)) rlIpxFftMibVersion = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 2, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftMibVersion.setStatus('current') rlIpxMaxFftNumber = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 2, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxMaxFftNumber.setStatus('current') rlIpxFftDynamicSupported = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 2, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("supported", 1), ("unsupported", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftDynamicSupported.setStatus('current') rlIpxFftNetworkSupported = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 2, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("supported", 1), ("unsupported", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftNetworkSupported.setStatus('current') rlIpxFftUnknownAddrMsgUsed = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 2, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("used", 1), ("unused", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftUnknownAddrMsgUsed.setStatus('current') rlIpxFftAgingTimeSupported = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 2, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("supported", 1), ("unsupported", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftAgingTimeSupported.setStatus('current') rlIpxFftSrcAddrSupported = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 2, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("supported", 1), ("unsupported", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftSrcAddrSupported.setStatus('current') rlIpxFftAgingTimeout = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 2, 8), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpxFftAgingTimeout.setStatus('current') rlIpxFftRedBoundary = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 2, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpxFftRedBoundary.setStatus('current') rlIpxFftYellowBoundary = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 2, 10), Percents()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpxFftYellowBoundary.setStatus('current') rlIpxFftNumTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 2, 12), ) if mibBuilder.loadTexts: rlIpxFftNumTable.setStatus('current') rlIpxFftNumEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 2, 12, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpxFftNumIndex")) if mibBuilder.loadTexts: rlIpxFftNumEntry.setStatus('current') rlIpxFftNumIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 12, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftNumIndex.setStatus('current') rlIpxFftNumStnRoutesNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 12, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftNumStnRoutesNumber.setStatus('current') rlIpxFftNumSubRoutesNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 12, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftNumSubRoutesNumber.setStatus('current') rlIpxFftStnTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 2, 13), ) if mibBuilder.loadTexts: rlIpxFftStnTable.setStatus('current') rlIpxFftStnEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpxFftStnIndex"), (0, "RADLAN-rlFft", "rlIpxFftStnDstNetid"), (0, "RADLAN-rlFft", "rlIpxFftStnDstNode"), (0, "RADLAN-rlFft", "rlIpxFftStnSrcNetid"), (0, "RADLAN-rlFft", "rlIpxFftStnSrcNode")) if mibBuilder.loadTexts: rlIpxFftStnEntry.setStatus('current') rlIpxFftStnIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnIndex.setStatus('current') rlIpxFftStnDstNetid = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 2), NetNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnDstNetid.setStatus('current') rlIpxFftStnDstNode = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 3), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnDstNode.setStatus('current') rlIpxFftStnSrcNetid = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 4), NetNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnSrcNetid.setStatus('current') rlIpxFftStnSrcNode = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 5), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnSrcNode.setStatus('current') rlIpxFftStnDstIpxAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("local", 1), ("remote", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnDstIpxAddrType.setStatus('current') rlIpxFftStnEncapsulation = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("novell", 1), ("ethernet", 2), ("llc", 3), ("snap", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnEncapsulation.setStatus('current') rlIpxFftStnDstMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 8), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnDstMacAddress.setStatus('current') rlIpxFftStnSrcMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 9), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnSrcMacAddress.setStatus('current') rlIpxFftStnOutIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnOutIfIndex.setStatus('current') rlIpxFftStnTci = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnTci.setStatus('current') rlIpxFftStnFacsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnFacsIndex.setStatus('current') rlIpxFftStnAge = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 13, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftStnAge.setStatus('current') rlIpxFftSubTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 2, 14), ) if mibBuilder.loadTexts: rlIpxFftSubTable.setStatus('current') rlIpxFftSubEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 2, 14, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpxFftSubIndex"), (0, "RADLAN-rlFft", "rlIpxFftSubDstNetid")) if mibBuilder.loadTexts: rlIpxFftSubEntry.setStatus('current') rlIpxFftSubIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 14, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftSubIndex.setStatus('current') rlIpxFftSubDstNetid = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 14, 1, 2), NetNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftSubDstNetid.setStatus('current') rlIpxFftSubEncapsulation = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 14, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("novell", 1), ("ethernet", 2), ("llc", 3), ("snap", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftSubEncapsulation.setStatus('current') rlIpxFftSubDstMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 14, 1, 4), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftSubDstMacAddress.setStatus('current') rlIpxFftSubSrcMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 14, 1, 5), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftSubSrcMacAddress.setStatus('current') rlIpxFftSubOutIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 14, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftSubOutIfIndex.setStatus('current') rlIpxFftSubTci = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 14, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftSubTci.setStatus('current') rlIpxFftSubFacsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 14, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftSubFacsIndex.setStatus('current') rlIpxFftSubAge = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 14, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftSubAge.setStatus('current') rlIpxFftCountersTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 2, 15), ) if mibBuilder.loadTexts: rlIpxFftCountersTable.setStatus('current') rlIpxFftCountersEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 2, 15, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpxFftCountersIndex")) if mibBuilder.loadTexts: rlIpxFftCountersEntry.setStatus('current') rlIpxFftCountersIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 15, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftCountersIndex.setStatus('current') rlIpxFftInReceives = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 15, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftInReceives.setStatus('current') rlIpxFftForwDatagrams = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 15, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftForwDatagrams.setStatus('current') rlIpxFftInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 2, 15, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpxFftInDiscards.setStatus('current') rlIpmFFT = MibIdentifier((1, 3, 6, 1, 4, 1, 89, 47, 3)) rlIpmFftMibVersion = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 3, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftMibVersion.setStatus('current') rlIpmMaxFftNumber = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 3, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmMaxFftNumber.setStatus('current') rlIpmFftDynamicSupported = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 3, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("supported", 1), ("unsupported", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftDynamicSupported.setStatus('current') rlIpmFftUnknownAddrMsgUsed = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 3, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("used", 1), ("unused", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftUnknownAddrMsgUsed.setStatus('current') rlIpmFftUserAgingTimeout = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 3, 5), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpmFftUserAgingTimeout.setStatus('current') rlIpmFftRouterAgingTimeout = MibScalar((1, 3, 6, 1, 4, 1, 89, 47, 3, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftRouterAgingTimeout.setStatus('current') rlIpmFftNumTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 3, 8), ) if mibBuilder.loadTexts: rlIpmFftNumTable.setStatus('current') rlIpmFftNumEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 3, 8, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpmFftNumIndex")) if mibBuilder.loadTexts: rlIpmFftNumEntry.setStatus('current') rlIpmFftNumIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 8, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftNumIndex.setStatus('current') rlIpmFftNumRoutesNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 8, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftNumRoutesNumber.setStatus('current') rlIpmFftTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 3, 9), ) if mibBuilder.loadTexts: rlIpmFftTable.setStatus('current') rlIpmFftEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 3, 9, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpmFftIndex"), (0, "RADLAN-rlFft", "rlIpmFftSrcIpAddress"), (0, "RADLAN-rlFft", "rlIpmFftDstIpAddress")) if mibBuilder.loadTexts: rlIpmFftEntry.setStatus('current') rlIpmFftIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 9, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftIndex.setStatus('current') rlIpmFftSrcIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 9, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftSrcIpAddress.setStatus('current') rlIpmFftDstIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 9, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftDstIpAddress.setStatus('current') rlIpmFftSrcIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 9, 1, 4), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftSrcIpMask.setStatus('current') rlIpmFftInputIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 9, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftInputIfIndex.setStatus('current') rlIpmFftInputVlanTag = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 9, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftInputVlanTag.setStatus('current') rlIpmFftForwardAction = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 9, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("forward", 1), ("discard", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftForwardAction.setStatus('current') rlIpmFftInportAction = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 9, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("sentToCPU", 1), ("discard", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftInportAction.setStatus('current') rlIpmFftAge = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 9, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftAge.setStatus('current') rlIpmFftPortTagTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 3, 10), ) if mibBuilder.loadTexts: rlIpmFftPortTagTable.setStatus('current') rlIpmFftPortTagEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 3, 10, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpmFftPortIndex"), (0, "RADLAN-rlFft", "rlIpmFftPortSrcIpAddress"), (0, "RADLAN-rlFft", "rlIpmFftPortDstIpAddress"), (0, "RADLAN-rlFft", "rlIpmFftPortOutputifIndex"), (0, "RADLAN-rlFft", "rlIpmFftPortOutputTag")) if mibBuilder.loadTexts: rlIpmFftPortTagEntry.setStatus('current') rlIpmFftPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 10, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftPortIndex.setStatus('current') rlIpmFftPortSrcIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 10, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftPortSrcIpAddress.setStatus('current') rlIpmFftPortDstIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 10, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftPortDstIpAddress.setStatus('current') rlIpmFftPortOutputifIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 10, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftPortOutputifIndex.setStatus('current') rlIpmFftPortOutputTag = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 10, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftPortOutputTag.setStatus('current') rlIpmFftCountersTable = MibTable((1, 3, 6, 1, 4, 1, 89, 47, 3, 11), ) if mibBuilder.loadTexts: rlIpmFftCountersTable.setStatus('current') rlIpmFftCountersEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 47, 3, 11, 1), ).setIndexNames((0, "RADLAN-rlFft", "rlIpmFftCountersIndex")) if mibBuilder.loadTexts: rlIpmFftCountersEntry.setStatus('current') rlIpmFftCountersIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 11, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftCountersIndex.setStatus('current') rlIpmFftInReceives = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 11, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftInReceives.setStatus('current') rlIpmFftForwDatagrams = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 11, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftForwDatagrams.setStatus('current') rlIpmFftInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 47, 3, 11, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlIpmFftInDiscards.setStatus('current') mibBuilder.exportSymbols("RADLAN-rlFft", rlIpxFftStnDstNode=rlIpxFftStnDstNode, rlIpmFftSrcIpMask=rlIpmFftSrcIpMask, rlIpFftSubNextHopIpAddr5=rlIpFftSubNextHopIpAddr5, rlIpFftNextHopVid=rlIpFftNextHopVid, rlIpxFftNumIndex=rlIpxFftNumIndex, rlIpmFftIndex=rlIpmFftIndex, rlIpmFftRouterAgingTimeout=rlIpmFftRouterAgingTimeout, rlIpmFftInReceives=rlIpmFftInReceives, rlIpFftSubTable=rlIpFftSubTable, rlIpFftL2InfoIfindex=rlIpFftL2InfoIfindex, rlIpmFftMibVersion=rlIpmFftMibVersion, rlIpmFftTable=rlIpmFftTable, rlIpxFftStnDstMacAddress=rlIpxFftStnDstMacAddress, rlIpxFftCountersTable=rlIpxFftCountersTable, rlIpFftYellowBoundary=rlIpFftYellowBoundary, rlIpmFftInDiscards=rlIpmFftInDiscards, rlIpxFftStnFacsIndex=rlIpxFftStnFacsIndex, rlIpmFftInportAction=rlIpmFftInportAction, rlIpFftSubEntry=rlIpFftSubEntry, rlIpFftSubNextHopIpAddr1=rlIpFftSubNextHopIpAddr1, rlIpFftL2InfoOutIfIndex=rlIpFftL2InfoOutIfIndex, rlIpFftNextHopEntry=rlIpFftNextHopEntry, rlIpFftStnDstIpAddrType=rlIpFftStnDstIpAddrType, rlIpMaxFftNumber=rlIpMaxFftNumber, rlIpxFftSubAge=rlIpxFftSubAge, rlIpxFftStnSrcMacAddress=rlIpxFftStnSrcMacAddress, rlIpmFftCountersTable=rlIpmFftCountersTable, rlIpFftCountersTable=rlIpFftCountersTable, rlIpFftAgingTimeSupported=rlIpFftAgingTimeSupported, rlIpxFftForwDatagrams=rlIpxFftForwDatagrams, rlIpxFftUnknownAddrMsgUsed=rlIpxFftUnknownAddrMsgUsed, rlIpmFFT=rlIpmFFT, rlIpFftForwDatagrams=rlIpFftForwDatagrams, rlIpmMaxFftNumber=rlIpmMaxFftNumber, rlIpmFftNumIndex=rlIpmFftNumIndex, rlIpFftStnTable=rlIpFftStnTable, rlIpFftNextHopMacAddress=rlIpFftNextHopMacAddress, rlIpmFftPortTagTable=rlIpmFftPortTagTable, rlIpxFftSubSrcMacAddress=rlIpxFftSubSrcMacAddress, rlIpmFftInputIfIndex=rlIpmFftInputIfIndex, rlIpmFftForwDatagrams=rlIpmFftForwDatagrams, rlIpFftStnIndex=rlIpFftStnIndex, rlFFT=rlFFT, rlIpFftNumEntry=rlIpFftNumEntry, rlIpFftL2InfoEntry=rlIpFftL2InfoEntry, rlIpFftSubNextHopIfindex4=rlIpFftSubNextHopIfindex4, rlIpxFftNumTable=rlIpxFftNumTable, rlIpFftRedBoundary=rlIpFftRedBoundary, rlIpxFftStnEntry=rlIpxFftStnEntry, rlIpmFftAge=rlIpmFftAge, rlIpmFftPortOutputifIndex=rlIpmFftPortOutputifIndex, rlIpFftSubNextHopIfindex1=rlIpFftSubNextHopIfindex1, rlIpxFftMibVersion=rlIpxFftMibVersion, rlIpFftSubNextHopIfindex7=rlIpFftSubNextHopIfindex7, rlIpxFftSubFacsIndex=rlIpxFftSubFacsIndex, rlIpmFftNumRoutesNumber=rlIpmFftNumRoutesNumber, rlIpxFftCountersIndex=rlIpxFftCountersIndex, rlIpFftNumStnRoutesNumber=rlIpFftNumStnRoutesNumber, rlIpFftSubNextHopIpAddr2=rlIpFftSubNextHopIpAddr2, rlIpFftSubNextHopIfindex2=rlIpFftSubNextHopIfindex2, rlIpFftNextHopValid=rlIpFftNextHopValid, rlIpxFftAgingTimeSupported=rlIpxFftAgingTimeSupported, rlIpmFftNumTable=rlIpmFftNumTable, NetNumber=NetNumber, rlIpFftL2InfoReferenceCount=rlIpFftL2InfoReferenceCount, rlIpxFftCountersEntry=rlIpxFftCountersEntry, rlIpFftStnDstMacAddress=rlIpFftStnDstMacAddress, rlIpFftNextHopTable=rlIpFftNextHopTable, rlIpFftL2InfoVid=rlIpFftL2InfoVid, rlIpmFftPortIndex=rlIpmFftPortIndex, rlIpFftL2InfoTable=rlIpFftL2InfoTable, rlIpFftSubNextHopIfindex6=rlIpFftSubNextHopIfindex6, rlIpxFftInDiscards=rlIpxFftInDiscards, rlIpFftCountersEntry=rlIpFftCountersEntry, rlIpFftStnTaggedMode=rlIpFftStnTaggedMode, rlIpmFftUserAgingTimeout=rlIpmFftUserAgingTimeout, rlIpFftStnSrcMacAddress=rlIpFftStnSrcMacAddress, rlIpFftSubNextHopIpAddr3=rlIpFftSubNextHopIpAddr3, rlIpmFftSrcIpAddress=rlIpmFftSrcIpAddress, rlIpFftSubNextHopIpAddr6=rlIpFftSubNextHopIpAddr6, rlIpxFftStnSrcNetid=rlIpxFftStnSrcNetid, rlIpFftNextHopifindex=rlIpFftNextHopifindex, rlIpxFftNumSubRoutesNumber=rlIpxFftNumSubRoutesNumber, rlIpxFftSubOutIfIndex=rlIpxFftSubOutIfIndex, rlIpFftSrcAddrSupported=rlIpFftSrcAddrSupported, rlIpFftSubnetSupported=rlIpFftSubnetSupported, rlIpxFftStnEncapsulation=rlIpxFftStnEncapsulation, rlIpxMaxFftNumber=rlIpxMaxFftNumber, rlIpxFftSubTci=rlIpxFftSubTci, rlIpmFftPortDstIpAddress=rlIpmFftPortDstIpAddress, rlIpFftStnEntry=rlIpFftStnEntry, rlIpxFftSubDstNetid=rlIpxFftSubDstNetid, rlIpFftInDiscards=rlIpFftInDiscards, rlIpFftNextHopOutIfIndex=rlIpFftNextHopOutIfIndex, rlIpxFftStnTci=rlIpxFftStnTci, rlIpmFftCountersIndex=rlIpmFftCountersIndex, rlIpFftAgingTimeout=rlIpFftAgingTimeout, rlIpFftStnAge=rlIpFftStnAge, rlIpFftL2InfoTaggedMode=rlIpFftL2InfoTaggedMode, rlIpxFFT=rlIpxFFT, rlIpFftUnknownAddrMsgUsed=rlIpFftUnknownAddrMsgUsed, rlIpFftSubNextHopCount=rlIpFftSubNextHopCount, rlIpFftSubNextHopIpAddr8=rlIpFftSubNextHopIpAddr8, rlIpFftSubMrid=rlIpFftSubMrid, rlIpFftInReceives=rlIpFftInReceives, rlIpmFftPortTagEntry=rlIpmFftPortTagEntry, rlIpFftL2InfoSrcMacAddress=rlIpFftL2InfoSrcMacAddress, rlIpFftStnDstIpAddress=rlIpFftStnDstIpAddress, rlIpmFftPortSrcIpAddress=rlIpmFftPortSrcIpAddress, rlIpFftStnOutIfIndex=rlIpFftStnOutIfIndex, rlIpFftSubAge=rlIpFftSubAge, rlIpxFftYellowBoundary=rlIpxFftYellowBoundary, rlIpxFftStnSrcNode=rlIpxFftStnSrcNode, rlIpxFftStnDstIpxAddrType=rlIpxFftStnDstIpxAddrType, rlIpFftNumSubRoutesNumber=rlIpFftNumSubRoutesNumber, rlIpFftSubNextHopSetRefCount=rlIpFftSubNextHopSetRefCount, rlIpxFftNumStnRoutesNumber=rlIpxFftNumStnRoutesNumber, rlIpxFftRedBoundary=rlIpxFftRedBoundary, rlIpFftDynamicSupported=rlIpFftDynamicSupported, rlIpFftNextHopIpAddress=rlIpFftNextHopIpAddress, rlIpmFftEntry=rlIpmFftEntry, rlIpxFftStnIndex=rlIpxFftStnIndex, rlIpxFftDynamicSupported=rlIpxFftDynamicSupported, rlIpmFftUnknownAddrMsgUsed=rlIpmFftUnknownAddrMsgUsed, rlIpFftStnDstRouteIpMask=rlIpFftStnDstRouteIpMask, rlIpFftNumIndex=rlIpFftNumIndex, rlIpFftCountersIndex=rlIpFftCountersIndex, rlIpmFftDstIpAddress=rlIpmFftDstIpAddress, rlIpFftNumTable=rlIpFftNumTable, rlIpFftSubNextHopIfindex5=rlIpFftSubNextHopIfindex5, rlIpxFftInReceives=rlIpxFftInReceives, rlIpFftL2InfoType=rlIpFftL2InfoType, rlIpFftL2InfoDstMacAddress=rlIpFftL2InfoDstMacAddress, rlIpFftSubNextHopIpAddr7=rlIpFftSubNextHopIpAddr7, rlIpxFftStnAge=rlIpxFftStnAge, rlIpFftMibVersion=rlIpFftMibVersion, rlIpFftSubDstIpMask=rlIpFftSubDstIpMask, rlIpxFftNumEntry=rlIpxFftNumEntry, rlIpFftNextHopReferenceCount=rlIpFftNextHopReferenceCount, rlIpxFftNetworkSupported=rlIpxFftNetworkSupported, rlIpxFftStnTable=rlIpxFftStnTable, rlIpFftNextHopType=rlIpFftNextHopType, rlIpmFftCountersEntry=rlIpmFftCountersEntry, rlIpmFftPortOutputTag=rlIpmFftPortOutputTag, rlIpmFftInputVlanTag=rlIpmFftInputVlanTag, rlIpFFT=rlIpFFT, rlIpxFftSubEncapsulation=rlIpxFftSubEncapsulation, rlIpFftSubNextHopIfindex3=rlIpFftSubNextHopIfindex3, rlIpxFftSubTable=rlIpxFftSubTable, rlIpFftL2InfoValid=rlIpFftL2InfoValid, rlIpmFftDynamicSupported=rlIpmFftDynamicSupported, rlIpxFftSubEntry=rlIpxFftSubEntry, rlIpxFftSubIndex=rlIpxFftSubIndex, Percents=Percents, rlIpFftStnMrid=rlIpFftStnMrid, rlIpFftSubNextHopIfindex8=rlIpFftSubNextHopIfindex8, rlIpxFftStnOutIfIndex=rlIpxFftStnOutIfIndex, rlIpmFftForwardAction=rlIpmFftForwardAction, rlIpFftSubNextHopIpAddr4=rlIpFftSubNextHopIpAddr4, rlIpxFftAgingTimeout=rlIpxFftAgingTimeout, rlIpxFftSrcAddrSupported=rlIpxFftSrcAddrSupported, PYSNMP_MODULE_ID=rlFFT, rlIpFftSubDstIpSubnet=rlIpFftSubDstIpSubnet, rlIpFftNextHopNetAddress=rlIpFftNextHopNetAddress, rlIpxFftSubDstMacAddress=rlIpxFftSubDstMacAddress, rlIpmFftNumEntry=rlIpmFftNumEntry, rlIpFftStnVid=rlIpFftStnVid, rlIpxFftStnDstNetid=rlIpxFftStnDstNetid)
a=1 for i in range(325): a=a*0.1 print(a)
# Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. # In Pascal's triangle, each number is the sum of the two numbers directly above it. # Example: # Input: 5 # Output: # [ # [1], # [1,1], # [1,2,1], # [1,3,3,1], # [1,4,6,4,1] # ] class Solution(object): def generate(self, numRows): """ :type numRows: int :rtype: List[List[int]] """ # M1. 模拟 res = [] for i in range(numRows): tmp = [None for _ in range(i+1)] tmp[0], tmp[-1] = 1, 1 for j in range(1, i): tmp[j] = res[i-1][j-1] + res[i-1][j] res.append(tmp) return res # M2. 另一种模拟写法 res = [[1] * n for n in range(1, numRows+1)] for i in range(1, numRows): for j in range(1, i): res[i][j] = res[i-1][j-1] + res[i-1][j] return res
def notas(*n, sit=False): """ ==> Função para analizar notas de alunos! :param n: Digite nota de quantos alunos quiser. :param sit: Se sit=True você ira abilitar a função de situação! (mostra se o aluno foi bem, na média ou ruim) :return: um dicionrio com informaçãoes de cada aluno! """ dicio = {'total': len(n), 'menor': min(n), 'maior': max(n), 'media': sum(n) / len(n)} if sit and dicio['media'] < 6: dicio['situação'] = 'Ruim' elif sit and 6 <= dicio['media'] < 7: dicio['situação'] = 'Razoável' elif sit: dicio['situação'] = 'Boa' return dicio resp = notas(8.5, 8, 5.5, 7, 9, sit=True) resp1 = notas(3.5, 7, 9.2, 6, sit=True) resp2 = notas(4.6, 5, 6.1, 4, 3.5, 5, sit=True) print(f'Turma 1 = {resp}\nTurma 2 = {resp1}\nTurma 3 = {resp2}') help(notas)
""" Given a array of numbers representing the stock prices of a company in chronological order, write a function that calculates the maximum profit you could have made from buying and selling that stock once. You must buy before you can sell it. For example, given [9, 11, 8, 5, 7, 10], you should return 5, since you could buy the stock at 5 dollars and sell it at 10 dollars. """
#! /usr/bin/env python # -*- coding:utf-8 -*- """ @author: Vesper Huang """ class Solution(object): def convertInteger(self, A, B): """ :type A: int :type B: int :rtype: int """ tmp = A ^ B count = 0 for i in range(32): count += tmp & 1 tmp = tmp >> 1 return count obj = Solution() print(obj.convertInteger(826966453, -729934991))
class BasicSettingsApiCredentialsBackend(object): CLIENT_ERROR_MESSAGE = "Client implementations must define a `{0}` attribute" CLIENT_SETTINGS_ERROR_MESSAGE = "Settings must contain a `{0}` attribute" def __init__(self, client): self.client = client @property def base_url(self): return self.get_setting('domain_settings_name') @property def client_id(self): return self.get_setting('client_id_settings_name') @property def private_key(self): return self.get_setting('private_key_settings_name') def get_setting(self, name): raise NotImplementedError
def fill_n(arr, offset_x, value, symbol=True): """Fill cells of arr starting from row offset_x with value in unary counting.""" value_left = value width = arr.shape[1] current_row = offset_x while value_left: add_this_iter = min(width, value_left) arr[current_row, :add_this_iter] = [symbol] * add_this_iter current_row += 1 value_left -= add_this_iter
dial = {'A': 2, 'B': 2, 'C': 2, 'D': 3, 'E': 3, 'F': 3, 'G': 4, 'H': 4, 'I': 4, 'J': 5, 'K': 5, 'L': 5, 'M': 6, 'N': 6, 'O': 6, 'P': 7, 'Q': 7, 'R': 7, 'T': 8, 'U': 8, 'V': 8, 'W': 9, 'X': 9, 'Y': 9, 'S': 7, 'Z': 9} n, s = 0, input() for c in s: n += dial[c] print(n+len(s))
input() l = [i for i,j in enumerate(input()) if j =='.'] ans = 11111111 for i in range(len(l)-1): ans = min(ans, l[i+1] - l[i]) print(ans - 1)
coins = 0 price = round(float(input()), 2) while price != 0: if price >= 2: price -= 2 coins += 1 elif price >= 1: price -= 1 coins += 1 elif price >= 0.50: price -= 0.50 coins += 1 elif price >= 0.20: price -= 0.20 coins += 1 elif price >= 0.10: price -= 0.10 coins += 1 elif price >= 0.05: price -= 0.05 coins += 1 elif price >= 0.02: price -= 0.02 coins += 1 elif price >= 0.01: price -= 0.01 coins += 1 price = round(price, 2) print (coins)
{ "targets": [{ "target_name": "krb5", "sources": [ "./src/module.cc", "./src/krb5_bind.cc", "./src/gss_bind.cc", "./src/base64.cc" ], 'cflags!': ['-fno-exceptions'], 'cflags_cc!': ['-fno-exceptions'], 'include_dirs': ["<!@(node -p \"require('node-addon-api').include\")"], 'dependencies': ["<!(node -p \"require('node-addon-api').gyp\")"], 'cflags!': ['-fno-exceptions'], 'cflags_cc!': ['-fno-exceptions'], 'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ], "conditions": [ [ "OS=='win'", { "variables": { "KRB_PATH": "/Program Files/MIT/Kerberos" }, "include_dirs": ["<(KRB_PATH)/include", "<(KRB_PATH)/include/gssapi", "src"], "conditions": [ [ "target_arch=='x64'", { "msvs_settings": { "VCCLCompilerTool": { "AdditionalOptions": ["/MP /EHsc"] }, "VCLinkerTool": { "AdditionalLibraryDirectories": ["<(KRB_PATH)/lib/amd64/"] } }, "libraries": ["-lkrb5_64.lib", "-lgssapi64.lib"] } ], [ "target_arch=='ia32'", { "msvs_settings": { "VCCLCompilerTool": { "AdditionalOptions": ["/MP /EHsc"] }, "VCLinkerTool": { "AdditionalLibraryDirectories": ["<(KRB_PATH)/lib/amd64/"] } }, "libraries": ["-lkrb5_32.lib", "-lgssapi32.lib"] } ] ] } ], [ "OS!='win'", { "libraries": ["-lkrb5", "-lgssapi_krb5"] } ] ] }] }
class Solution: def validPalindrome(self, s: str) -> bool: left, right = self.twopointer(0, len(s) - 1, s) if left >= right : return True return self.valid(left + 1, right, s) or self.valid(left, right - 1, s) def valid(self, left, right, s) : l, r = self.twopointer(left, right, s) if l >= r : return True else: return False def twopointer(self, left, right, s) : while left < right : if s[left] == s[right] : left += 1 right -= 1 else : return left, right return left, right
def get_metrics(response): """ Extract asked metrics from api response @list_metrics : list of dict """ list_metrics = [] for i in response['reports'][0]['columnHeader']['metricHeader']['metricHeaderEntries']: list_metrics.append(i['name']) return list_metrics def get_dimensions(response): """ Extract asked dimensions from api response @list_dimensions : list of dict """ return response['reports'][0]['columnHeader']['dimensions'] def extract_api_data(response): """ Extract all data from api response """ try: rows = response['reports'][0]['data']['rows'] except: return [] try: samples_read_counts = response['reports'][0]['data']['samplesReadCounts'] sampling_space_sizes = response['reports'][0]['data']['samplesReadCounts'] print("SAMPLING") print(samples_read_counts) print(sampling_space_sizes) exit() except: pass metric_response = get_metrics(response) dimensions_response = get_dimensions(response) data = [] for row in rows: d = {} j = 0 for i in dimensions_response: d[i] = row['dimensions'][j] j = j + 1 j = 0 for i in metric_response: d[i] = row['metrics'][0]['values'][j] j = j + 1 data.append(d) return data
SQLALCHEMY_DATABASE_URI = "postgresql:///test_freight" LOG_LEVEL = "INFO" WORKSPACE_ROOT = "/tmp/freight-tests" SSH_PRIVATE_KEY = "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEArvyc+vZVxUjC5ZcFg1VN3jQOCOjO94gwQKFxlz0zOCrCz+Sq\nnWk28YdUpOU016Zinlh4ZZk2136nCKKTMnNMjd6cTTCn5fWomjR+F2CSdaYYpYfO\nNtVnq0SIDUgGmjyPncOGrxVT6EzjjSvgE8W8YIc5rVJqNMAH5OywUH0nqISYN2yP\nwbUPVf8zqu3kpnTt7YcWZ+Ye4b3jX6Fo2Xw5P1TTwQ92K9JdVAltBRpwSLtBQUYC\nMkwtNf6QIbRYKoVZuEhi/8XCxT0zG78Lsqpbld8IEnLWUGifCtx9mKqVi8Y3QTsT\nknMWFaf+Su8htgw/W7tufmrtTKNJYDtPTGiBeQIDAQABAoIBABYsC/gAnn2Q6qEM\nsbYiaOtuzRhz50WWDAckbbAsIQFM6cJNxxCK9FtGOoNqR3fLrVNDAn5dG4XSlneR\nofUShvCy9DsTnzKUHfjsDc4IfoZJtXXD720jPS+GT3bfWXbRlaD31Wj52tfkZjDN\nDmdy9puEhtpfRvXIHzfyhaStNwkzDh0jp8e8yok1mLA+3FPqkJPF6ptxPs6HEQS8\npY75jxvypbux2+W9249J/HqMmd5/+r7tt62vciqnXb2LG2AmUxLhTAQU9mGM2OSL\nrh2j+7/2apEQLdJ0DbS19IkQZRpO/DLPyhg6C29ZuNQffQWoLiZlfgIEaBT939aM\nkFdzy8ECgYEA4BdisLRCyCdm2M7fMDsV7j71z48Q1Kdl5A6/ngiK1dCwnjRMvkLx\nKOHtmvpJxHTH+JAewrrGUg0GF1YpM3gi0FQ7f9qTlAeFIrU3udV8F/m6+rIOpx92\nB2FSrYTaonLX8g4OzXKNtQcwzx91mFWTIEmfQl9let0WMrCRzReXp0sCgYEAx+dC\ncbERCVcJvs9+SUwVXXOreCF4PedLrg7bjkfYSpmAJk9c36EOi1jIGO5rat5/k7Nb\n0plWghADjtcb4r8oO6pzhMR81cESgFOk1UasP4rPYX4mEYPBwVGgN7ECUXj9XFPZ\n/tk7lgneBc1/6eV978MTprXiHU5Rv7yZBMuf68sCgYAd6YE27Rjs9rV3w0VvfrOS\ntbzCE+q/OAkVxBI32hQOLmkk9P45d14RgvbgdQBbxOrcdwBkJeJLGYnym4GsaSDc\nhiHbEyYX4FkZJO9nUuPZn3Ah/pqOHFj46zjKCK3WeVXx7YZ0ThI0U91kCGL+Do4x\nBSLJDUrSd6h6467SnY+UuQKBgGV0/AYT5h+lay7KxL+Su+04Pbi01AAnGgP3SnuF\n/0KtcZsAAJUHewhCQRxWNXKCBqICEAJtDLjqQ8QFbQPCHTtbIVIrH2ilmyxCR5Bv\nVBDT9Lj4e328L2Rcd0KMti5/h6eKb0OnIVTfIS40xE0Dys0bZyfffCl/jIIRyF/k\nsP/NAoGBAIfxtr881cDFrxahrTJ3AtGXxjJjMUW/S6+gKd7Lj9i+Uadb9vjD8Wt8\ngWrUDwXVAhD5Sxv+OCBizPF1CxXTgC3+/ophkUcy5VTcBchgQI7JrItujxUc0EvR\nCwA7/JPyO8DaUtvpodUKO27vr11G/NmXYrOohCP6VxH/Y6p5L9o4\n-----END RSA PRIVATE KEY-----" GITHUB_TOKEN = "a" * 40
# # PySNMP MIB module SUPERMICRO-SMI (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SUPERMICRO-SMI # Produced by pysmi-0.3.4 at Mon Apr 29 21:04:30 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") ObjectIdentity, iso, Gauge32, Counter32, Unsigned32, NotificationType, ModuleIdentity, IpAddress, Counter64, Bits, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, enterprises, Integer32, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "iso", "Gauge32", "Counter32", "Unsigned32", "NotificationType", "ModuleIdentity", "IpAddress", "Counter64", "Bits", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "enterprises", "Integer32", "MibIdentifier") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") supermicro = ModuleIdentity((1, 3, 6, 1, 4, 1, 10876)) supermicro.setRevisions(('2001-10-26 00:00',)) if mibBuilder.loadTexts: supermicro.setLastUpdated('200110260000Z') if mibBuilder.loadTexts: supermicro.setOrganization('Super Micro Computer Inc.') smProducts = ObjectIdentity((1, 3, 6, 1, 4, 1, 10876, 1)) if mibBuilder.loadTexts: smProducts.setStatus('current') smHealth = ObjectIdentity((1, 3, 6, 1, 4, 1, 10876, 2)) if mibBuilder.loadTexts: smHealth.setStatus('current') mibBuilder.exportSymbols("SUPERMICRO-SMI", smProducts=smProducts, PYSNMP_MODULE_ID=supermicro, smHealth=smHealth, supermicro=supermicro)
# # PySNMP MIB module CISCO-WAN-ATM-CONN-CAPABILITY (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-WAN-ATM-CONN-CAPABILITY # Produced by pysmi-0.3.4 at Mon Apr 29 18:03:44 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint") ciscoAgentCapability, = mibBuilder.importSymbols("CISCO-SMI", "ciscoAgentCapability") ModuleCompliance, AgentCapabilities, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "AgentCapabilities", "NotificationGroup") iso, IpAddress, Integer32, ObjectIdentity, Bits, ModuleIdentity, NotificationType, Counter64, Unsigned32, TimeTicks, Counter32, MibIdentifier, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "IpAddress", "Integer32", "ObjectIdentity", "Bits", "ModuleIdentity", "NotificationType", "Counter64", "Unsigned32", "TimeTicks", "Counter32", "MibIdentifier", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") ciscoWanAtmConnCapability = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 7, 380)) ciscoWanAtmConnCapability.setRevisions(('2004-02-07 00:00', '2002-03-26 00:00',)) if mibBuilder.loadTexts: ciscoWanAtmConnCapability.setLastUpdated('200402070000Z') if mibBuilder.loadTexts: ciscoWanAtmConnCapability.setOrganization('Cisco Systems, Inc.') cwAtmConnCapabilityAxsmV2R0160 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 380, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityAxsmV2R0160 = cwAtmConnCapabilityAxsmV2R0160.setProductRelease('MGX8850 Release 2.1.60.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityAxsmV2R0160 = cwAtmConnCapabilityAxsmV2R0160.setStatus('current') cwAtmConnCapabilityAxsmeV2R0160 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 380, 2)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityAxsmeV2R0160 = cwAtmConnCapabilityAxsmeV2R0160.setProductRelease('MGX8850 Release 2.1.60') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityAxsmeV2R0160 = cwAtmConnCapabilityAxsmeV2R0160.setStatus('current') cwAtmConnCapabilityRpmprV2R0160 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 380, 3)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityRpmprV2R0160 = cwAtmConnCapabilityRpmprV2R0160.setProductRelease('MGX8850 Release 2.1.60') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityRpmprV2R0160 = cwAtmConnCapabilityRpmprV2R0160.setStatus('current') cwAtmConnCapabilityBpxsesV3R00 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 380, 4)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityBpxsesV3R00 = cwAtmConnCapabilityBpxsesV3R00.setProductRelease('BPX SES Release 3.0.00') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityBpxsesV3R00 = cwAtmConnCapabilityBpxsesV3R00.setStatus('current') cwAtmConnCapabilityAxsmV3R00 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 380, 5)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityAxsmV3R00 = cwAtmConnCapabilityAxsmV3R00.setProductRelease('MGX8850 Release 3.0.00.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityAxsmV3R00 = cwAtmConnCapabilityAxsmV3R00.setStatus('current') cwAtmConnCapabilityAxsmeV3R00 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 380, 6)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityAxsmeV3R00 = cwAtmConnCapabilityAxsmeV3R00.setProductRelease('MGX8850 Release 3.0.00.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityAxsmeV3R00 = cwAtmConnCapabilityAxsmeV3R00.setStatus('current') cwAtmConnCapabilityPxm1eV3R00 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 380, 7)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityPxm1eV3R00 = cwAtmConnCapabilityPxm1eV3R00.setProductRelease('MGX8850 Release 3.0.00.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityPxm1eV3R00 = cwAtmConnCapabilityPxm1eV3R00.setStatus('current') cwAtmConnCapabilityRpmprV3R00 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 380, 8)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityRpmprV3R00 = cwAtmConnCapabilityRpmprV3R00.setProductRelease('MGX8850 Release 3.0.00') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityRpmprV3R00 = cwAtmConnCapabilityRpmprV3R00.setStatus('current') cwAtmConnCapabilityRpmxfV12R02 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 380, 9)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityRpmxfV12R02 = cwAtmConnCapabilityRpmxfV12R02.setProductRelease('IOS Release 12.2\n in MGX8850 Release 3.0.00') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityRpmxfV12R02 = cwAtmConnCapabilityRpmxfV12R02.setStatus('current') cwAtmConnCapabilityV5R00 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 380, 10)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityV5R00 = cwAtmConnCapabilityV5R00.setProductRelease('MGX8850 Release 5.0.00.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cwAtmConnCapabilityV5R00 = cwAtmConnCapabilityV5R00.setStatus('current') mibBuilder.exportSymbols("CISCO-WAN-ATM-CONN-CAPABILITY", PYSNMP_MODULE_ID=ciscoWanAtmConnCapability, cwAtmConnCapabilityRpmprV2R0160=cwAtmConnCapabilityRpmprV2R0160, cwAtmConnCapabilityAxsmeV3R00=cwAtmConnCapabilityAxsmeV3R00, cwAtmConnCapabilityAxsmV3R00=cwAtmConnCapabilityAxsmV3R00, cwAtmConnCapabilityPxm1eV3R00=cwAtmConnCapabilityPxm1eV3R00, cwAtmConnCapabilityBpxsesV3R00=cwAtmConnCapabilityBpxsesV3R00, cwAtmConnCapabilityRpmxfV12R02=cwAtmConnCapabilityRpmxfV12R02, cwAtmConnCapabilityV5R00=cwAtmConnCapabilityV5R00, ciscoWanAtmConnCapability=ciscoWanAtmConnCapability, cwAtmConnCapabilityAxsmV2R0160=cwAtmConnCapabilityAxsmV2R0160, cwAtmConnCapabilityRpmprV3R00=cwAtmConnCapabilityRpmprV3R00, cwAtmConnCapabilityAxsmeV2R0160=cwAtmConnCapabilityAxsmeV2R0160)
# 数据类型 # int money = 28 print(type(money)) # <class 'int'> # float money = 28.9 print(type(money)) # <class 'float'> # String money = '10000' print(type(money)) # <class 'str'> money = "100000" print(type(money)) # <class 'str'> message = '"Ryan Fawcett"' print(message) message = "'Ryan Fawcett'" print(message) # 保留格式输出字符串 message = ''' 出塞 [唐] 王昌龄 秦时明月汉时关,万里长征人未还。 但使龙城飞将在,不教胡马度阴山。 ''' print(message) # boolean isLogin = True print(isLogin) isLogin = False print(type(isLogin)) # <class 'bool'>
s = 0 for i in range(101): s += i print("Suma liczb od 1 do 100 to: ", s)
def BinarySearch(Array, LowerBound, UpperBound, What): while LowerBound != UpperBound: mid = (LowerBound + UpperBound) // 2 if Array[mid] < What: LowerBound = mid elif Array[mid] > What: UpperBound = mid - 1 else: return mid return None
''' immutable ''' letters = ("a", "b", "c", "d", "c") print(letters.count("c")) print(letters.index("d")) coordinates = (94, 6, 7) x, y, z = coordinates print(x, y, z)
responses = { 'https://example.com/api/v1/something/': { 'count': 5, 'next': 'https://example.com/api/v1/something/?limit=3&offset=3', 'previous': None, 'results': [ {'id': 1}, {'id': 2}, {'id': 3} ], 'collection_links': {} }, 'https://example.com/api/v1/something/?limit=3&offset=3': { 'count': 5, 'next': 'https://example.com/api/v1/something/?limit=3&offset=6', 'previous': 'https://example.com/api/v1/something/?limit=3', 'results': [ {'id': 4}, {'id': 5}, {'id': 6} ], 'collection_links': {} }, 'https://example.com/api/v1/something/?limit=3&offset=6': { 'count': 5, 'next': None, 'previous': 'https://example.com/api/v1/something/?limit=3', 'results': [ {'id': 7}, {'id': 8} ], 'collection_links': {} }, }
#!/usr/bin/env python # coding: utf-8 # # Author: Kazuto Nakashima # URL: https://github.com/kazuto1011 # Created: 2016-06-07 config = { 'server_IP': '192.168.4.170', 'PORT': 49952, 'xml_file': 'C:/Users/nemuriscan/Desktop/NemuriScanLog/NemuriScanStateInfo.xml' }
# Replace the file path with an existing text file on your machine. with open("/home/aditya/Desktop/sample.txt", "r") as file_: lines = file_.readlines() for line in lines: print(lines)
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: otp.uberdog.SpeedchatRelayGlobals NORMAL = 0 CUSTOM = 1 EMOTE = 2 PIRATES_QUEST = 3 TOONTOWN_QUEST = 4
# # PySNMP MIB module JUNIPER-PFE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/JUNIPER-PFE-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:00:43 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") ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint") jnxPfeMibRoot, = mibBuilder.importSymbols("JUNIPER-SMI", "jnxPfeMibRoot") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") TimeTicks, IpAddress, Integer32, ObjectIdentity, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Counter64, Counter32, NotificationType, Unsigned32, Gauge32, iso, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "IpAddress", "Integer32", "ObjectIdentity", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Counter64", "Counter32", "NotificationType", "Unsigned32", "Gauge32", "iso", "Bits") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") jnxPfeMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1)) jnxPfeMib.setRevisions(('2014-11-14 00:00', '2014-03-12 00:00', '2011-09-09 00:00', '2010-02-07 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: jnxPfeMib.setRevisionsDescriptions(('Added jnxPfeMemoryTrapVars and jnxPfeMemoryNotifications.', 'Added new Table jnxPfeNotifyGlParAccSec which counts notifications for the packets parsed/processed by access-security.', 'Added new Table jnxPfeMemoryErrorsTable which gives parity and ecc errors. Added new Trap pfeMemoryErrors', 'Added new notification types.',)) if mibBuilder.loadTexts: jnxPfeMib.setLastUpdated('201109220000Z') if mibBuilder.loadTexts: jnxPfeMib.setOrganization('Juniper Networks, Inc.') if mibBuilder.loadTexts: jnxPfeMib.setContactInfo(' Juniper Technical Assistance Center Juniper Networks, Inc. 1194 N. Mathilda Avenue Sunnyvale, CA 94089 E-mail: support@juniper.net') if mibBuilder.loadTexts: jnxPfeMib.setDescription('The MIB provides PFE specific data.') class JnxPfeMemoryTypeEnum(TextualConvention, Integer32): description = 'PFE memory type, nh (1), fw (2), encap (3)' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("nh", 1), ("fw", 2), ("encap", 3)) jnxPfeNotification = MibIdentifier((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1)) jnxPfeNotifyGlTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1), ) if mibBuilder.loadTexts: jnxPfeNotifyGlTable.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlTable.setDescription('This table provides global PFE notification statistics.') jnxPfeNotifyGlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1), ).setIndexNames((0, "JUNIPER-PFE-MIB", "jnxPfeNotifyGlSlot")) if mibBuilder.loadTexts: jnxPfeNotifyGlEntry.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlEntry.setDescription('') jnxPfeNotifyGlSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))) if mibBuilder.loadTexts: jnxPfeNotifyGlSlot.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlSlot.setDescription('The PFE slot number for this set of global PFE notification statistics.') jnxPfeNotifyGlParsed = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlParsed.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlParsed.setDescription('Count of notifications reported by the routing chip.') jnxPfeNotifyGlAged = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlAged.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlAged.setDescription('Count of notifications that are dropped due to the fact that the they have been in the system for too long and hence not valid anymore.') jnxPfeNotifyGlCorrupt = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlCorrupt.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlCorrupt.setDescription('Count of notifications dropped due to the fact that they have an invalid notification result format. This counter is valid for Internet Processor-I and Internet Processor-II only.') jnxPfeNotifyGlIllegal = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlIllegal.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlIllegal.setDescription('Count of notifications dropped due to the fact that they have an illegal notification type.') jnxPfeNotifyGlSample = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlSample.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlSample.setDescription('Count of sample notifications reported by the routing chip.') jnxPfeNotifyGlGiants = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlGiants.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlGiants.setDescription('Count of notifications dropped that are larger than the supported DMA size.') jnxPfeNotifyGlTtlExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlTtlExceeded.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlTtlExceeded.setDescription('Count of options/TTL-expired notifications that need to be sent to service interfaces as transit packets. This counter is valid for Internet Processor-I and Internet Processor-II only.') jnxPfeNotifyGlTtlExcErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlTtlExcErrors.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlTtlExcErrors.setDescription('Count of options/TTL-expired packet notifications that could not be sent as transit packets because the output interface could not be determined. This counter is valid for Internet Processor-I and Internet Processor-II only.') jnxPfeNotifyGlSvcOptAsp = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlSvcOptAsp.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlSvcOptAsp.setDescription('Count of IP options packets that are sent out to a Services PIC.') jnxPfeNotifyGlSvcOptRe = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlSvcOptRe.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlSvcOptRe.setDescription('Count of IP options packets that are sent out to the Routing Engine.') jnxPfeNotifyGlPostSvcOptOut = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlPostSvcOptOut.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlPostSvcOptOut.setDescription('Count of notifications that were re-injected by the services PIC after it had processed the associated packets. These notifications now need to be forwarded out to their actual destination. This counter is valid for Internet Processor-I and Internet Processor-II only.') jnxPfeNotifyGlOptTtlExp = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlOptTtlExp.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlOptTtlExp.setDescription('Count of TTL-expired transit packets.') jnxPfeNotifyGlDiscSample = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlDiscSample.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlDiscSample.setDescription('Count of sample notifications that are dropped as they refer to discarded packets in PFE.') jnxPfeNotifyGlRateLimited = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlRateLimited.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlRateLimited.setDescription('Count of notifications ignored because of PFE software throttling.') jnxPfeNotifyGlPktGetFails = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlPktGetFails.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlPktGetFails.setDescription('Count of notifications where we could not allocate memory for DMA.') jnxPfeNotifyGlDmaFails = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlDmaFails.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlDmaFails.setDescription('Count of notifications where the DMA of associated packets failed for miscellaneous reasons. Valid for T-series Internet Processor only.') jnxPfeNotifyGlDmaTotals = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlDmaTotals.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlDmaTotals.setDescription('Count of notifications for which the packet DMA completed. Valid for T-series Internet Processor only.') jnxPfeNotifyGlUnknowns = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlUnknowns.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlUnknowns.setDescription('Count of notifications that could not be resolved to a known next hop destination. Valid for T-series Internet Processor only.') jnxPfeNotifyGlParAccSec = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 1, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyGlParAccSec.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyGlParAccSec.setDescription('Count of notifications for the packets parsed/processed by access-security.') jnxPfeNotifyTypeTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 2), ) if mibBuilder.loadTexts: jnxPfeNotifyTypeTable.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyTypeTable.setDescription('This provides type-specific PFE notification stats') jnxPfeNotifyTypeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 2, 1), ).setIndexNames((0, "JUNIPER-PFE-MIB", "jnxPfeNotifyGlSlot"), (0, "JUNIPER-PFE-MIB", "jnxPfeNotifyTypeId")) if mibBuilder.loadTexts: jnxPfeNotifyTypeEntry.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyTypeEntry.setDescription('') jnxPfeNotifyTypeId = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14))).clone(namedValues=NamedValues(("illegal", 1), ("unclassified", 2), ("option", 3), ("nextHop", 4), ("discard", 5), ("sample", 6), ("redirect", 7), ("dontFragment", 8), ("cfdf", 9), ("poison", 10), ("unknown", 11), ("specialMemPkt", 12), ("autoConfig", 13), ("reject", 14)))) if mibBuilder.loadTexts: jnxPfeNotifyTypeId.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyTypeId.setDescription("This identifies the PFE notification type for this row's stats. Below is a description of each notification type: 1. illegal Packets with invalid notification type. 2. unclassified Packets that did not have a key lookup performed on them. 3. option Packets which have L3 options present. 4. nextHop Packets that are destined to the host. 5. discard Used when a discarded packet is sent to the route processor. 6. sample Unused. 7. redirect This is used when a packet is being sent out on the interface it came in on. 8. dontFragment This is used that a packet needs to be fragmented but the DF (don't fragment) bit is set. 9. cfdf When an MTU exceeded indication is triggered by the CF chip and the packet has DF (don't fragment) set. 10. poison Packets that resolved to a poisoned next hop index. 11. unknown Packets of unknown notification type. 12. specialMemPkt Packets with special memory pkt type notification used in diagnostics. 13. autoconfig Packets with autoconfig PFE notification type used for dynamic VLANs. 14. reject Packets of reject PFE notification type.") jnxPfeNotifyTypeDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyTypeDescr.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyTypeDescr.setDescription('The description of the Pfe Notification type for this entry.') jnxPfeNotifyTypeParsed = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 2, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyTypeParsed.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyTypeParsed.setDescription('Count of successful parsing of notifications.') jnxPfeNotifyTypeInput = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 2, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyTypeInput.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyTypeInput.setDescription("Count of notifications whose associated packets were DMA'ed into route processor memory.") jnxPfeNotifyTypeFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 2, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyTypeFailed.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyTypeFailed.setDescription('Count of failures in parsing the notifications.') jnxPfeNotifyTypeIgnored = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 2, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeNotifyTypeIgnored.setStatus('current') if mibBuilder.loadTexts: jnxPfeNotifyTypeIgnored.setDescription('Count of notifications where the notification type in the message does not match any of the valid types.') jnxPfeMemoryErrorsTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 3), ) if mibBuilder.loadTexts: jnxPfeMemoryErrorsTable.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryErrorsTable.setDescription('This provides PFE memory errors') jnxPfeMemoryErrorsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 3, 1), ).setIndexNames((0, "JUNIPER-PFE-MIB", "jnxPfeFpcSlot"), (0, "JUNIPER-PFE-MIB", "jnxPfeSlot")) if mibBuilder.loadTexts: jnxPfeMemoryErrorsEntry.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryErrorsEntry.setDescription('') jnxPfeFpcSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))) if mibBuilder.loadTexts: jnxPfeFpcSlot.setStatus('current') if mibBuilder.loadTexts: jnxPfeFpcSlot.setDescription('The FPC slot number for this set of PFE notification') jnxPfeSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))) if mibBuilder.loadTexts: jnxPfeSlot.setStatus('current') if mibBuilder.loadTexts: jnxPfeSlot.setDescription('The pfe slot number for this set of errors') jnxPfeParityErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 3, 1, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeParityErrors.setStatus('current') if mibBuilder.loadTexts: jnxPfeParityErrors.setDescription('The parity error count') jnxPfeEccErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 3, 1, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeEccErrors.setStatus('current') if mibBuilder.loadTexts: jnxPfeEccErrors.setDescription('The ECC error count') pfeMemoryErrorsNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 0)) pfeMemoryErrors = NotificationType((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 1, 0, 1)).setObjects(("JUNIPER-PFE-MIB", "jnxPfeParityErrors"), ("JUNIPER-PFE-MIB", "jnxPfeEccErrors")) if mibBuilder.loadTexts: pfeMemoryErrors.setStatus('current') if mibBuilder.loadTexts: pfeMemoryErrors.setDescription('A pfeMemoryErrors notification is sent when the value of jnxPfeParityErrors or jnxPfeEccErrors increases.') jnxPfeMemory = MibIdentifier((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2)) jnxPfeMemoryUkernTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 1), ) if mibBuilder.loadTexts: jnxPfeMemoryUkernTable.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryUkernTable.setDescription('This table provides global PFE ukern memory statistics for specified slot.') jnxPfeMemoryUkernEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 1, 1), ).setIndexNames((0, "JUNIPER-PFE-MIB", "jnxPfeGlSlot")) if mibBuilder.loadTexts: jnxPfeMemoryUkernEntry.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryUkernEntry.setDescription('Entry represent ukern memory percentage free.') jnxPfeMemoryUkernFreePercent = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 1, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeMemoryUkernFreePercent.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryUkernFreePercent.setDescription('The percent PFE ukern memory free within ukern heap.') jnxPfeMemoryForwardingTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 2), ) if mibBuilder.loadTexts: jnxPfeMemoryForwardingTable.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryForwardingTable.setDescription('This table provides PFE ASIC memory - NH/JTREE or FW/Filter or Encap memory utilization statistics.') jnxPfeMemoryForwardingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 2, 1), ).setIndexNames((0, "JUNIPER-PFE-MIB", "jnxPfeGlSlot"), (0, "JUNIPER-PFE-MIB", "jnxPfeMemoryForwardingChipSlot"), (0, "JUNIPER-PFE-MIB", "jnxPfeMemoryType")) if mibBuilder.loadTexts: jnxPfeMemoryForwardingEntry.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryForwardingEntry.setDescription('Entry represent ASIC memory free percent of a specific type in specified pfe instance') jnxPfeMemoryForwardingChipSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))) if mibBuilder.loadTexts: jnxPfeMemoryForwardingChipSlot.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryForwardingChipSlot.setDescription('ASIC instance number or pfe complex instance number.') jnxPfeMemoryType = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 2, 1, 2), JnxPfeMemoryTypeEnum()) if mibBuilder.loadTexts: jnxPfeMemoryType.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryType.setDescription('PFE ASIC memory type, nh = 1, fw = 2, encap = 3.') jnxPfeMemoryForwardingPercentFree = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 2, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxPfeMemoryForwardingPercentFree.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryForwardingPercentFree.setDescription('Percentage ASIC memory free for a specific memory type. For Trio based linecards Encap memory is not available.Hence no value is returned') jnxPfeMemoryTrapVars = ObjectIdentity((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 3)) if mibBuilder.loadTexts: jnxPfeMemoryTrapVars.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryTrapVars.setDescription('PFE notification object definitions.') jnxPfeGlSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 3, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: jnxPfeGlSlot.setStatus('current') if mibBuilder.loadTexts: jnxPfeGlSlot.setDescription('Global slot number for line card resource monitoring.') jnxPfeInstanceNumber = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 3, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: jnxPfeInstanceNumber.setStatus('current') if mibBuilder.loadTexts: jnxPfeInstanceNumber.setDescription('PFE instance number in pfe complex.') jnxPfeMemoryThreshold = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 3, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: jnxPfeMemoryThreshold.setStatus('current') if mibBuilder.loadTexts: jnxPfeMemoryThreshold.setDescription('Configured high memory utilization threshold.') jnxPfeMemoryNotificationsPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 4)) jnxPfeMemoryNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 4, 0)) jnxPfeHeapMemoryThresholdExceeded = NotificationType((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 4, 0, 1)).setObjects(("JUNIPER-PFE-MIB", "jnxPfeGlSlot"), ("JUNIPER-PFE-MIB", "jnxPfeMemoryThreshold")) if mibBuilder.loadTexts: jnxPfeHeapMemoryThresholdExceeded.setStatus('current') if mibBuilder.loadTexts: jnxPfeHeapMemoryThresholdExceeded.setDescription('Indicates that the Heap Memory utilization has crossed the configured watermark.') jnxPfeHeapMemoryThresholdAbated = NotificationType((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 4, 0, 2)).setObjects(("JUNIPER-PFE-MIB", "jnxPfeGlSlot"), ("JUNIPER-PFE-MIB", "jnxPfeMemoryThreshold")) if mibBuilder.loadTexts: jnxPfeHeapMemoryThresholdAbated.setStatus('current') if mibBuilder.loadTexts: jnxPfeHeapMemoryThresholdAbated.setDescription('Indicates that the Heap Memory utilization has fallen below the configured watermark.') jnxPfeNextHopMemoryThresholdExceeded = NotificationType((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 4, 0, 3)).setObjects(("JUNIPER-PFE-MIB", "jnxPfeGlSlot"), ("JUNIPER-PFE-MIB", "jnxPfeInstanceNumber"), ("JUNIPER-PFE-MIB", "jnxPfeMemoryThreshold")) if mibBuilder.loadTexts: jnxPfeNextHopMemoryThresholdExceeded.setStatus('current') if mibBuilder.loadTexts: jnxPfeNextHopMemoryThresholdExceeded.setDescription('Indicates that the Next Hop Memory utilization has crossed the configured watermark.') jnxPfeNextHopMemoryThresholdAbated = NotificationType((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 4, 0, 4)).setObjects(("JUNIPER-PFE-MIB", "jnxPfeGlSlot"), ("JUNIPER-PFE-MIB", "jnxPfeInstanceNumber"), ("JUNIPER-PFE-MIB", "jnxPfeMemoryThreshold")) if mibBuilder.loadTexts: jnxPfeNextHopMemoryThresholdAbated.setStatus('current') if mibBuilder.loadTexts: jnxPfeNextHopMemoryThresholdAbated.setDescription('Indicates that the Next Hop Memory utilization has fallen below the configured watermark.') jnxPfeFilterMemoryThresholdExceeded = NotificationType((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 4, 0, 5)).setObjects(("JUNIPER-PFE-MIB", "jnxPfeGlSlot"), ("JUNIPER-PFE-MIB", "jnxPfeInstanceNumber"), ("JUNIPER-PFE-MIB", "jnxPfeMemoryThreshold")) if mibBuilder.loadTexts: jnxPfeFilterMemoryThresholdExceeded.setStatus('current') if mibBuilder.loadTexts: jnxPfeFilterMemoryThresholdExceeded.setDescription('Indicates that the Filter Memory utilization has crossed the configured watermark.') jnxPfeFilterMemoryThresholdAbated = NotificationType((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 4, 0, 6)).setObjects(("JUNIPER-PFE-MIB", "jnxPfeGlSlot"), ("JUNIPER-PFE-MIB", "jnxPfeInstanceNumber"), ("JUNIPER-PFE-MIB", "jnxPfeMemoryThreshold")) if mibBuilder.loadTexts: jnxPfeFilterMemoryThresholdAbated.setStatus('current') if mibBuilder.loadTexts: jnxPfeFilterMemoryThresholdAbated.setDescription('Indicates that the Filter Memory utilization has fallen below the configured watermark.') jnxPfeEncapMemoryThresholdExceeded = NotificationType((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 4, 0, 7)).setObjects(("JUNIPER-PFE-MIB", "jnxPfeGlSlot"), ("JUNIPER-PFE-MIB", "jnxPfeInstanceNumber"), ("JUNIPER-PFE-MIB", "jnxPfeMemoryThreshold")) if mibBuilder.loadTexts: jnxPfeEncapMemoryThresholdExceeded.setStatus('current') if mibBuilder.loadTexts: jnxPfeEncapMemoryThresholdExceeded.setDescription('Indicates that the ENCAP Memory utilization has crossed the configured watermark.') jnxPfeEncapMemoryThresholdAbated = NotificationType((1, 3, 6, 1, 4, 1, 2636, 3, 44, 1, 2, 4, 0, 8)).setObjects(("JUNIPER-PFE-MIB", "jnxPfeGlSlot"), ("JUNIPER-PFE-MIB", "jnxPfeInstanceNumber"), ("JUNIPER-PFE-MIB", "jnxPfeMemoryThreshold")) if mibBuilder.loadTexts: jnxPfeEncapMemoryThresholdAbated.setStatus('current') if mibBuilder.loadTexts: jnxPfeEncapMemoryThresholdAbated.setDescription('Indicates that the ENCAP Memory utilization has fallen below the configured watermark.') mibBuilder.exportSymbols("JUNIPER-PFE-MIB", jnxPfeNotifyTypeTable=jnxPfeNotifyTypeTable, jnxPfeNotifyGlTtlExcErrors=jnxPfeNotifyGlTtlExcErrors, jnxPfeFpcSlot=jnxPfeFpcSlot, jnxPfeNotifyTypeEntry=jnxPfeNotifyTypeEntry, jnxPfeMemoryUkernFreePercent=jnxPfeMemoryUkernFreePercent, jnxPfeEncapMemoryThresholdExceeded=jnxPfeEncapMemoryThresholdExceeded, jnxPfeMemoryNotifications=jnxPfeMemoryNotifications, jnxPfeNotifyGlSlot=jnxPfeNotifyGlSlot, jnxPfeNotifyTypeIgnored=jnxPfeNotifyTypeIgnored, jnxPfeMemoryForwardingEntry=jnxPfeMemoryForwardingEntry, jnxPfeSlot=jnxPfeSlot, jnxPfeMemoryType=jnxPfeMemoryType, jnxPfeMib=jnxPfeMib, jnxPfeNotifyGlOptTtlExp=jnxPfeNotifyGlOptTtlExp, jnxPfeMemoryUkernTable=jnxPfeMemoryUkernTable, PYSNMP_MODULE_ID=jnxPfeMib, jnxPfeNotifyGlAged=jnxPfeNotifyGlAged, pfeMemoryErrors=pfeMemoryErrors, jnxPfeMemoryTrapVars=jnxPfeMemoryTrapVars, jnxPfeNotifyTypeDescr=jnxPfeNotifyTypeDescr, jnxPfeMemoryErrorsEntry=jnxPfeMemoryErrorsEntry, jnxPfeFilterMemoryThresholdExceeded=jnxPfeFilterMemoryThresholdExceeded, jnxPfeNotifyGlCorrupt=jnxPfeNotifyGlCorrupt, jnxPfeNextHopMemoryThresholdAbated=jnxPfeNextHopMemoryThresholdAbated, jnxPfeNotifyGlPktGetFails=jnxPfeNotifyGlPktGetFails, jnxPfeNotifyGlGiants=jnxPfeNotifyGlGiants, jnxPfeNotifyGlDiscSample=jnxPfeNotifyGlDiscSample, jnxPfeNotifyTypeParsed=jnxPfeNotifyTypeParsed, jnxPfeMemoryForwardingChipSlot=jnxPfeMemoryForwardingChipSlot, jnxPfeHeapMemoryThresholdExceeded=jnxPfeHeapMemoryThresholdExceeded, jnxPfeMemoryNotificationsPrefix=jnxPfeMemoryNotificationsPrefix, jnxPfeEccErrors=jnxPfeEccErrors, jnxPfeNotifyTypeFailed=jnxPfeNotifyTypeFailed, jnxPfeMemoryErrorsTable=jnxPfeMemoryErrorsTable, jnxPfeNotifyGlUnknowns=jnxPfeNotifyGlUnknowns, jnxPfeNotifyGlSvcOptAsp=jnxPfeNotifyGlSvcOptAsp, JnxPfeMemoryTypeEnum=JnxPfeMemoryTypeEnum, jnxPfeNextHopMemoryThresholdExceeded=jnxPfeNextHopMemoryThresholdExceeded, jnxPfeNotifyGlDmaFails=jnxPfeNotifyGlDmaFails, jnxPfeGlSlot=jnxPfeGlSlot, jnxPfeHeapMemoryThresholdAbated=jnxPfeHeapMemoryThresholdAbated, jnxPfeNotification=jnxPfeNotification, jnxPfeNotifyGlTable=jnxPfeNotifyGlTable, jnxPfeNotifyGlParAccSec=jnxPfeNotifyGlParAccSec, jnxPfeFilterMemoryThresholdAbated=jnxPfeFilterMemoryThresholdAbated, jnxPfeParityErrors=jnxPfeParityErrors, jnxPfeNotifyGlSvcOptRe=jnxPfeNotifyGlSvcOptRe, jnxPfeMemoryForwardingTable=jnxPfeMemoryForwardingTable, jnxPfeNotifyGlSample=jnxPfeNotifyGlSample, jnxPfeNotifyGlParsed=jnxPfeNotifyGlParsed, jnxPfeNotifyGlIllegal=jnxPfeNotifyGlIllegal, jnxPfeMemoryForwardingPercentFree=jnxPfeMemoryForwardingPercentFree, jnxPfeEncapMemoryThresholdAbated=jnxPfeEncapMemoryThresholdAbated, jnxPfeNotifyTypeInput=jnxPfeNotifyTypeInput, jnxPfeNotifyGlEntry=jnxPfeNotifyGlEntry, jnxPfeNotifyGlDmaTotals=jnxPfeNotifyGlDmaTotals, jnxPfeMemoryUkernEntry=jnxPfeMemoryUkernEntry, jnxPfeNotifyGlTtlExceeded=jnxPfeNotifyGlTtlExceeded, jnxPfeNotifyGlRateLimited=jnxPfeNotifyGlRateLimited, jnxPfeInstanceNumber=jnxPfeInstanceNumber, jnxPfeMemoryThreshold=jnxPfeMemoryThreshold, jnxPfeNotifyGlPostSvcOptOut=jnxPfeNotifyGlPostSvcOptOut, pfeMemoryErrorsNotificationPrefix=pfeMemoryErrorsNotificationPrefix, jnxPfeNotifyTypeId=jnxPfeNotifyTypeId, jnxPfeMemory=jnxPfeMemory)
def implement_each(folder, each): folder['tags'] = each['tags'] + folder['tags'] for key, tags in each['folders'].items(): folder['folders'][key] = {'tags': tags, 'folders': {}} return folder
""" @author: Rodrigo Vargas modulo encargado del comportamiento de los disparos estandar """ class Disparo : """ modulo encargado del comportamiento de los disparos estandar Attributes: XY (list):coordenadas (x,y) del disparo Velocidad (int):velocidad del disparo Index(int):indice sprite del disparo VelocidadFinal(int):velocidad maxima del disparo Aceleracion(float):acceleracion del disparo Daño(int):daño del disparo Tipo(str):tipo de sprite que tiene el disparo Continuo(bool):indica si el disparo puede producir otros disparos Fin(bool):indica si el disparo tiene que eliminarse Alianza(str):bando al que pertenece """ # recordar siempre declarar self en una funcion de objeto XY: list = None #Color = None Index: int = 0 # Z=None#aun no implementado Velocidad: int = -5 Aceleracion: float = 0 VelocidadFinal: int = 0 # parametro dueño para comprobar colisiones Daño: int = 300 # añadir a constructores Tipo: str = "Estatico" Continuo: bool = False Fin: bool = False def __init__ ( self , xy: list , velocidad: int , velocidadFinal: int , aceleracion: float , alianza: str ) : """ Args: xy: lista coordenadas (x,y) velocidad: velocididad de movimiento aceleracion: aceleracion por ciclo de velocidad velocidadFinal: velocidad final de movimiento alianza: bando al que pertenece :rtype: cls :type alianza: str :type aceleracion: float :type velocidadFinal: int :type xy: list :type velocidad: int """ # self.Daño=10 self.XY = xy self.Velocidad = velocidad self.Aceleracion = aceleracion self.VelocidadFinal = velocidadFinal # self.Z=z self.Alianza = alianza def EsContinuo ( self ) -> bool: """ indica si un disparo puede generar nuevas intancias de disparo :rtype: bool """ aux = self.Continuo self.Continuo = False return aux def GetAlianza ( self ) -> str : """ indica a que bando pertence la entidad :rtype: str """ return self.Alianza def GetX ( self ) -> int : """ Returns: valor numerico de XY[0] :rtype: int """ return self.XY [ 0 ] """obtener X""" def GetY ( self ) -> int : """ Returns: valor numerico de XY[0] :rtype: int """ return self.XY [ 1 ] """obtener Y""" def SetX ( self , x: int ) -> None : """ Args: x: nueva valor XY[0] Returns: fija un nuevo XY[0] no retorna nada :rtype: None """ self.XY [ 0 ] = x pass """fijar X""" def SetY ( self , y: int ) -> None : """ Args: y: nueva valor XY[1] Returns: fija un nuevo XY[1] no retorna nada :rtype: None """ self.XY [ 1 ] = y pass """fijar Y""" def GetTipo ( self ) -> str: """ Returns: indica si el sprite del disparo puede tener rotaciones :rtype: str """ return self.Tipo def GetDaño ( self ) -> int: """ Returns: entre la cantidad de daño del disparo :rtype: int """ return self.Daño def GetVel ( self ) -> int : """ Returns: valor numerico de la velocidad :rtype: int """ return self.Velocidad """fijar obtener velocidad""" def EsFin ( self ) -> bool: """ Returns: indica si un disparo tiene que ser eliminado :rtype: bool """ return self.Fin def GetTodo ( self ) -> tuple : """ Returns: :rtype: tuple :return: retorna coordenadas para localizar el sprite """ return (self.XY [ 0 ] , self.XY [ 1 ] ) """ Returns: retorna coordenadas para localizar el sprite """ """obtener tupla de coordenadas""" def Actualizar ( self ) -> None : """ Returns: la funcion esta encargada de calcular las fisicas del disparo :rtype: None """ self.SetY ( self.GetY ( ) - self.GetVel ( ) ) pass """actualizar datos""" def GetIndex ( self ) -> int : """ Returns: indice del sprite asignado :rtype: int """ return self.Index def GetXY ( self ) -> list : """ :rtype: list :return: entrega las coordenas en formato de lista """ return self.XY def Accelerar ( self ) -> None: """ funcion encargada de calcular las fisicas correspondientes a acceleraciones y desaceleraciones :rtype: None """ if self.Aceleracion == 0 : pass elif self.Aceleracion < 0 : if self.Velocidad + self.Aceleracion > self.VelocidadFinal : self.Velocidad = self.Velocidad + self.Aceleracion else : self.Velocidad = self.VelocidadFinal elif self.Aceleracion > 0 : if self.Velocidad + self.Aceleracion < self.VelocidadFinal : self.Velocidad = self.Velocidad + self.Aceleracion else : self.Velocidad = self.VelocidadFinal pass
class PointSegmentError(Exception): """ """ pass class AngleRotationSegmentError(Exception): """ """ pass class PointTranslateSegmentError(Exception): """ """ pass class NbPointSegmentDError(Exception): """ """ pass
# encoding: utf-8 # module System.ComponentModel.Design.Serialization calls itself Serialization # from System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 # by generator 1.145 """ NamespaceTracker represent a CLS namespace. """ # no imports # no functions # classes class ComponentSerializationService(object): """ Provides the base class for serializing a set of components or serializable objects into a serialization store. """ def CreateStore(self): """ CreateStore(self: ComponentSerializationService) -> SerializationStore Creates a new System.ComponentModel.Design.Serialization.SerializationStore. Returns: A new System.ComponentModel.Design.Serialization.SerializationStore. """ pass def Deserialize(self, store, container=None): """ Deserialize(self: ComponentSerializationService, store: SerializationStore, container: IContainer) -> ICollection Deserializes the given store and populates the given System.ComponentModel.IContainer with deserialized System.ComponentModel.IComponent objects. store: The System.ComponentModel.Design.Serialization.SerializationStore to deserialize. container: The System.ComponentModel.IContainer to which System.ComponentModel.IComponent objects will be added. Returns: A collection of objects created according to the stored state. Deserialize(self: ComponentSerializationService, store: SerializationStore) -> ICollection Deserializes the given store to produce a collection of objects. store: The System.ComponentModel.Design.Serialization.SerializationStore to deserialize. Returns: A collection of objects created according to the stored state. """ pass def DeserializeTo( self, store, container, validateRecycledTypes=None, applyDefaults=None ): """ DeserializeTo(self: ComponentSerializationService, store: SerializationStore, container: IContainer, validateRecycledTypes: bool) Deserializes the given System.ComponentModel.Design.Serialization.SerializationStore to the given container, optionally validating recycled types. store: The System.ComponentModel.Design.Serialization.SerializationStore to deserialize. container: The container to which System.ComponentModel.IComponent objects will be added. validateRecycledTypes: true to guarantee that the deserialization will only work if applied to an object of the same type. DeserializeTo(self: ComponentSerializationService, store: SerializationStore, container: IContainer) Deserializes the given System.ComponentModel.Design.Serialization.SerializationStore to the given container. store: The System.ComponentModel.Design.Serialization.SerializationStore to deserialize. container: The container to which System.ComponentModel.IComponent objects will be added. DeserializeTo(self: ComponentSerializationService, store: SerializationStore, container: IContainer, validateRecycledTypes: bool, applyDefaults: bool) Deserializes the given System.ComponentModel.Design.Serialization.SerializationStore to the given container, optionally applying default property values. store: The System.ComponentModel.Design.Serialization.SerializationStore to deserialize. container: The container to which System.ComponentModel.IComponent objects will be added. validateRecycledTypes: true to guarantee that the deserialization will only work if applied to an object of the same type. applyDefaults: true to indicate that the default property values should be applied. """ pass def LoadStore(self, stream): """ LoadStore(self: ComponentSerializationService, stream: Stream) -> SerializationStore Loads a System.ComponentModel.Design.Serialization.SerializationStore from a stream. stream: The System.IO.Stream from which the store will be loaded. Returns: A new System.ComponentModel.Design.Serialization.SerializationStore instance. """ pass def Serialize(self, store, value): """ Serialize(self: ComponentSerializationService, store: SerializationStore, value: object) Serializes the given object to the given System.ComponentModel.Design.Serialization.SerializationStore. store: The System.ComponentModel.Design.Serialization.SerializationStore to which the state of value will be written. value: The object to serialize. """ pass def SerializeAbsolute(self, store, value): """ SerializeAbsolute(self: ComponentSerializationService, store: SerializationStore, value: object) Serializes the given object, accounting for default property values. store: The System.ComponentModel.Design.Serialization.SerializationStore to which the state of value will be serialized. value: The object to serialize. """ pass def SerializeMember(self, store, owningObject, member): """ SerializeMember(self: ComponentSerializationService, store: SerializationStore, owningObject: object, member: MemberDescriptor) Serializes the given member on the given object. store: The System.ComponentModel.Design.Serialization.SerializationStore to which the state of member will be serialized. owningObject: The object to which member is attached. member: A System.ComponentModel.MemberDescriptor specifying the member to serialize. """ pass def SerializeMemberAbsolute(self, store, owningObject, member): """ SerializeMemberAbsolute(self: ComponentSerializationService, store: SerializationStore, owningObject: object, member: MemberDescriptor) Serializes the given member on the given object, accounting for the default property value. store: The System.ComponentModel.Design.Serialization.SerializationStore to which the state of member will be serialized. owningObject: The object to which member is attached. member: The member to serialize. """ pass class ContextStack(object): """ Provides a stack object that can be used by a serializer to make information available to nested serializers. ContextStack() """ def Append(self, context): """ Append(self: ContextStack, context: object) Appends an object to the end of the stack, rather than pushing it onto the top of the stack. context: A context object to append to the stack. """ pass def Pop(self): """ Pop(self: ContextStack) -> object Removes the current object off of the stack, returning its value. Returns: The object removed from the stack; null if no objects are on the stack. """ pass def Push(self, context): """ Push(self: ContextStack, context: object) Pushes, or places, the specified object onto the stack. context: The context object to push onto the stack. """ pass def __getitem__(self, *args): # cannot find CLR method """ x.__getitem__(y) <==> x[y]x.__getitem__(y) <==> x[y] """ pass Current = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets the current object on the stack. Get: Current(self: ContextStack) -> object """ class DefaultSerializationProviderAttribute(Attribute, _Attribute): """ The System.ComponentModel.Design.Serialization.DefaultSerializationProviderAttribute attribute is placed on a serializer to indicate the class to use as a default provider of that type of serializer. DefaultSerializationProviderAttribute(providerType: Type) DefaultSerializationProviderAttribute(providerTypeName: str) """ def __init__(self, *args): # cannot find CLR method """ 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 # known case of __new__ def __new__(self, *__args): """ __new__(cls: type, providerType: Type) __new__(cls: type, providerTypeName: str) """ pass ProviderTypeName = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets the type name of the serialization provider. Get: ProviderTypeName(self: DefaultSerializationProviderAttribute) -> str """ class DesignerLoader(object): """ Provides a basic designer loader interface that can be used to implement a custom designer loader. """ def BeginLoad(self, host): """ BeginLoad(self: DesignerLoader, host: IDesignerLoaderHost) Begins loading a designer. host: The loader host through which this loader loads components. """ pass def Dispose(self): """ Dispose(self: DesignerLoader) Releases all resources used by the System.ComponentModel.Design.Serialization.DesignerLoader. """ pass def Flush(self): """ Flush(self: DesignerLoader) Writes cached changes to the location that the designer was loaded from. """ pass Loading = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets a value indicating whether the loader is currently loading a document. Get: Loading(self: DesignerLoader) -> bool """ class DesignerSerializerAttribute(Attribute, _Attribute): """ Indicates a serializer for the serialization manager to use to serialize the values of the type this attribute is applied to. This class cannot be inherited. DesignerSerializerAttribute(serializerType: Type, baseSerializerType: Type) DesignerSerializerAttribute(serializerTypeName: str, baseSerializerType: Type) DesignerSerializerAttribute(serializerTypeName: str, baseSerializerTypeName: str) """ def __init__(self, *args): # cannot find CLR method """ 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 # known case of __new__ def __new__(self, *__args): """ __new__(cls: type, serializerType: Type, baseSerializerType: Type) __new__(cls: type, serializerTypeName: str, baseSerializerType: Type) __new__(cls: type, serializerTypeName: str, baseSerializerTypeName: str) """ pass SerializerBaseTypeName = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets the fully qualified type name of the serializer base type. Get: SerializerBaseTypeName(self: DesignerSerializerAttribute) -> str """ SerializerTypeName = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets the fully qualified type name of the serializer. Get: SerializerTypeName(self: DesignerSerializerAttribute) -> str """ TypeId = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Indicates a unique ID for this attribute type. Get: TypeId(self: DesignerSerializerAttribute) -> object """ class IDesignerLoaderHost(IDesignerHost, IServiceContainer, IServiceProvider): """ Provides an interface that can extend a designer host to support loading from a serialized state. """ def EndLoad(self, baseClassName, successful, errorCollection): """ EndLoad(self: IDesignerLoaderHost, baseClassName: str, successful: bool, errorCollection: ICollection) Ends the designer loading operation. baseClassName: The fully qualified name of the base class of the document that this designer is designing. successful: true if the designer is successfully loaded; otherwise, false. errorCollection: A collection containing the errors encountered during load, if any. If no errors were encountered, pass either an empty collection or null. """ pass def Reload(self): """ Reload(self: IDesignerLoaderHost) Reloads the design document. """ pass def __init__(self, *args): # cannot find CLR method """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass class IDesignerLoaderHost2( IDesignerLoaderHost, IDesignerHost, IServiceContainer, IServiceProvider ): """ Provides an interface that extends System.ComponentModel.Design.Serialization.IDesignerLoaderHost to specify whether errors are tolerated while loading a design document. """ def __init__(self, *args): # cannot find CLR method """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass CanReloadWithErrors = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets or sets a value indicating whether it is possible to reload with errors. Get: CanReloadWithErrors(self: IDesignerLoaderHost2) -> bool Set: CanReloadWithErrors(self: IDesignerLoaderHost2) = value """ IgnoreErrorsDuringReload = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets or sets a value indicating whether errors should be ignored when System.ComponentModel.Design.Serialization.IDesignerLoaderHost.Reload is called. Get: IgnoreErrorsDuringReload(self: IDesignerLoaderHost2) -> bool Set: IgnoreErrorsDuringReload(self: IDesignerLoaderHost2) = value """ class IDesignerLoaderService: """ Provides an interface that can extend a designer loader to support asynchronous loading of external components. """ def AddLoadDependency(self): """ AddLoadDependency(self: IDesignerLoaderService) Registers an external component as part of the load process managed by this interface. """ pass def DependentLoadComplete(self, successful, errorCollection): """ DependentLoadComplete(self: IDesignerLoaderService, successful: bool, errorCollection: ICollection) Signals that a dependent load has finished. successful: true if the load of the designer is successful; false if errors prevented the load from finishing. errorCollection: A collection of errors that occurred during the load, if any. If no errors occurred, pass either an empty collection or null. """ pass def Reload(self): """ Reload(self: IDesignerLoaderService) -> bool Reloads the design document. Returns: true if the reload request is accepted, or false if the loader does not allow the reload. """ pass def __init__(self, *args): # cannot find CLR method """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass class IDesignerSerializationManager(IServiceProvider): """ Provides an interface that can manage design-time serialization. """ def AddSerializationProvider(self, provider): """ AddSerializationProvider(self: IDesignerSerializationManager, provider: IDesignerSerializationProvider) Adds the specified serialization provider to the serialization manager. provider: The serialization provider to add. """ pass def CreateInstance(self, type, arguments, name, addToContainer): """ CreateInstance(self: IDesignerSerializationManager, type: Type, arguments: ICollection, name: str, addToContainer: bool) -> object Creates an instance of the specified type and adds it to a collection of named instances. type: The data type to create. arguments: The arguments to pass to the constructor for this type. name: The name of the object. This name can be used to access the object later through System.ComponentModel.Design.Serialization.IDesignerSerializationManager.GetInstance(System.Strin g). If null is passed, the object is still created but cannot be accessed by name. addToContainer: If true, this object is added to the design container. The object must implement System.ComponentModel.IComponent for this to have any effect. Returns: The newly created object instance. """ pass def GetInstance(self, name): """ GetInstance(self: IDesignerSerializationManager, name: str) -> object Gets an instance of a created object of the specified name, or null if that object does not exist. name: The name of the object to retrieve. Returns: An instance of the object with the given name, or null if no object by that name can be found. """ pass def GetName(self, value): """ GetName(self: IDesignerSerializationManager, value: object) -> str Gets the name of the specified object, or null if the object has no name. value: The object to retrieve the name for. Returns: The name of the object, or null if the object is unnamed. """ pass def GetSerializer(self, objectType, serializerType): """ GetSerializer(self: IDesignerSerializationManager, objectType: Type, serializerType: Type) -> object Gets a serializer of the requested type for the specified object type. objectType: The type of the object to get the serializer for. serializerType: The type of the serializer to retrieve. Returns: An instance of the requested serializer, or null if no appropriate serializer can be located. """ pass def GetType(self, typeName): """ GetType(self: IDesignerSerializationManager, typeName: str) -> Type Gets a type of the specified name. typeName: The fully qualified name of the type to load. Returns: An instance of the type, or null if the type cannot be loaded. """ pass def RemoveSerializationProvider(self, provider): """ RemoveSerializationProvider(self: IDesignerSerializationManager, provider: IDesignerSerializationProvider) Removes a custom serialization provider from the serialization manager. provider: The provider to remove. This object must have been added using System.ComponentModel.Design.Serialization.IDesignerSerializationManager.AddSerializationProvider (System.ComponentModel.Design.Serialization.IDesignerSerializationProvider). """ pass def ReportError(self, errorInformation): """ ReportError(self: IDesignerSerializationManager, errorInformation: object) Reports an error in serialization. errorInformation: The error to report. This information object can be of any object type. If it is an exception, the message of the exception is extracted and reported to the user. If it is any other type, System.Object.ToString is called to display the information to the user. """ pass def SetName(self, instance, name): """ SetName(self: IDesignerSerializationManager, instance: object, name: str) Sets the name of the specified existing object. instance: The object instance to name. name: The name to give the instance. """ pass def __init__(self, *args): # cannot find CLR method """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass Context = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets a stack-based, user-defined storage area that is useful for communication between serializers. Get: Context(self: IDesignerSerializationManager) -> ContextStack """ Properties = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Indicates custom properties that can be serializable with available serializers. Get: Properties(self: IDesignerSerializationManager) -> PropertyDescriptorCollection """ ResolveName = None SerializationComplete = None class IDesignerSerializationProvider: """ Provides an interface that enables access to a serializer. """ def GetSerializer(self, manager, currentSerializer, objectType, serializerType): """ GetSerializer(self: IDesignerSerializationProvider, manager: IDesignerSerializationManager, currentSerializer: object, objectType: Type, serializerType: Type) -> object Gets a serializer using the specified attributes. manager: The serialization manager requesting the serializer. currentSerializer: An instance of the current serializer of the specified type. This can be null if no serializer of the specified type exists. objectType: The data type of the object to serialize. serializerType: The data type of the serializer to create. Returns: An instance of a serializer of the type requested, or null if the request cannot be satisfied. """ pass def __init__(self, *args): # cannot find CLR method """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass class IDesignerSerializationService: """ Provides an interface that can invoke serialization and deserialization. """ def Deserialize(self, serializationData): """ Deserialize(self: IDesignerSerializationService, serializationData: object) -> ICollection Deserializes the specified serialization data object and returns a collection of objects represented by that data. serializationData: An object consisting of serialized data. Returns: An System.Collections.ICollection of objects rebuilt from the specified serialization data object. """ pass def Serialize(self, objects): """ Serialize(self: IDesignerSerializationService, objects: ICollection) -> object Serializes the specified collection of objects and stores them in a serialization data object. objects: A collection of objects to serialize. Returns: An object that contains the serialized state of the specified collection of objects. """ pass def __init__(self, *args): # cannot find CLR method """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass class INameCreationService: """ Provides a service that can generate unique names for objects. """ def CreateName(self, container, dataType): """ CreateName(self: INameCreationService, container: IContainer, dataType: Type) -> str Creates a new name that is unique to all components in the specified container. container: The container where the new object is added. dataType: The data type of the object that receives the name. Returns: A unique name for the data type. """ pass def IsValidName(self, name): """ IsValidName(self: INameCreationService, name: str) -> bool Gets a value indicating whether the specified name is valid. name: The name to validate. Returns: true if the name is valid; otherwise, false. """ pass def ValidateName(self, name): """ ValidateName(self: INameCreationService, name: str) Gets a value indicating whether the specified name is valid. name: The name to validate. """ pass def __init__(self, *args): # cannot find CLR method """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass class InstanceDescriptor(object): """ Provides the information necessary to create an instance of an object. This class cannot be inherited. InstanceDescriptor(member: MemberInfo, arguments: ICollection, isComplete: bool) InstanceDescriptor(member: MemberInfo, arguments: ICollection) """ def Invoke(self): """ Invoke(self: InstanceDescriptor) -> object Invokes this instance descriptor and returns the object the descriptor describes. Returns: The object this instance descriptor describes. """ pass @staticmethod # known case of __new__ def __new__(self, member, arguments, isComplete=None): """ __new__(cls: type, member: MemberInfo, arguments: ICollection) __new__(cls: type, member: MemberInfo, arguments: ICollection, isComplete: bool) """ pass Arguments = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets the collection of arguments that can be used to reconstruct an instance of the object that this instance descriptor represents. Get: Arguments(self: InstanceDescriptor) -> ICollection """ IsComplete = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets a value indicating whether the contents of this System.ComponentModel.Design.Serialization.InstanceDescriptor completely identify the instance. Get: IsComplete(self: InstanceDescriptor) -> bool """ MemberInfo = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets the member information that describes the instance this descriptor is associated with. Get: MemberInfo(self: InstanceDescriptor) -> MemberInfo """ class MemberRelationship(object): """ Represents a single relationship between an object and a member. MemberRelationship(owner: object, member: MemberDescriptor) """ def Equals(self, obj): """ Equals(self: MemberRelationship, obj: object) -> bool Determines whether two System.ComponentModel.Design.Serialization.MemberRelationship instances are equal. obj: The System.ComponentModel.Design.Serialization.MemberRelationship to compare with the current System.ComponentModel.Design.Serialization.MemberRelationship. Returns: true if the specified System.ComponentModel.Design.Serialization.MemberRelationship is equal to the current System.ComponentModel.Design.Serialization.MemberRelationship; otherwise, false. """ pass def GetHashCode(self): """ GetHashCode(self: MemberRelationship) -> int Returns the hash code for this instance. Returns: A hash code for the current System.ComponentModel.Design.Serialization.MemberRelationship. """ pass def __eq__(self, *args): # cannot find CLR method """ x.__eq__(y) <==> x==y """ pass @staticmethod # known case of __new__ def __new__(self, owner, member): """ __new__[MemberRelationship]() -> MemberRelationship __new__(cls: type, owner: object, member: MemberDescriptor) """ pass def __ne__(self, *args): # cannot find CLR method pass IsEmpty = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets a value indicating whether this relationship is equal to the System.ComponentModel.Design.Serialization.MemberRelationship.Empty relationship. Get: IsEmpty(self: MemberRelationship) -> bool """ Member = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets the related member. Get: Member(self: MemberRelationship) -> MemberDescriptor """ Owner = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets the owning object. Get: Owner(self: MemberRelationship) -> object """ Empty = None class MemberRelationshipService(object): """ Provides the base class for relating one member to another. """ def GetRelationship(self, *args): # cannot find CLR method """ GetRelationship(self: MemberRelationshipService, source: MemberRelationship) -> MemberRelationship Gets a relationship to the given source relationship. source: The source relationship. Returns: A relationship to source, or System.ComponentModel.Design.Serialization.MemberRelationship.Empty if no relationship exists. """ pass def SetRelationship(self, *args): # cannot find CLR method """ SetRelationship(self: MemberRelationshipService, source: MemberRelationship, relationship: MemberRelationship) Creates a relationship between the source object and target relationship. source: The source relationship. relationship: The relationship to set into the source. """ pass def SupportsRelationship(self, source, relationship): """ SupportsRelationship(self: MemberRelationshipService, source: MemberRelationship, relationship: MemberRelationship) -> bool Gets a value indicating whether the given relationship is supported. source: The source relationship. relationship: The relationship to set into the source. Returns: true if a relationship between the given two objects is supported; otherwise, false. """ pass def __getitem__(self, *args): # cannot find CLR method """ x.__getitem__(y) <==> x[y]x.__getitem__(y) <==> x[y] """ pass def __setitem__(self, *args): # cannot find CLR method """ x.__setitem__(i, y) <==> x[i]=x.__setitem__(i, y) <==> x[i]= """ pass class ResolveNameEventArgs(EventArgs): """ Provides data for the System.ComponentModel.Design.Serialization.IDesignerSerializationManager.ResolveName event. ResolveNameEventArgs(name: str) """ @staticmethod # known case of __new__ def __new__(self, name): """ __new__(cls: type, name: str) """ pass Name = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets the name of the object to resolve. Get: Name(self: ResolveNameEventArgs) -> str """ Value = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets or sets the object that matches the name. Get: Value(self: ResolveNameEventArgs) -> object Set: Value(self: ResolveNameEventArgs) = value """ class ResolveNameEventHandler(MulticastDelegate, ICloneable, ISerializable): """ Represents the method that handles the System.ComponentModel.Design.Serialization.IDesignerSerializationManager.ResolveName event of a serialization manager. ResolveNameEventHandler(object: object, method: IntPtr) """ def BeginInvoke(self, sender, e, callback, object): """ BeginInvoke(self: ResolveNameEventHandler, sender: object, e: ResolveNameEventArgs, callback: AsyncCallback, object: object) -> IAsyncResult """ pass def CombineImpl(self, *args): # cannot find CLR method """ CombineImpl(self: MulticastDelegate, follow: Delegate) -> Delegate Combines this System.Delegate with the specified System.Delegate to form a new delegate. follow: The delegate to combine with this delegate. Returns: A delegate that is the new root of the System.MulticastDelegate invocation list. """ pass def DynamicInvokeImpl(self, *args): # cannot find CLR method """ DynamicInvokeImpl(self: Delegate, args: Array[object]) -> object Dynamically invokes (late-bound) the method represented by the current delegate. args: An array of objects that are the arguments to pass to the method represented by the current delegate.-or- null, if the method represented by the current delegate does not require arguments. Returns: The object returned by the method represented by the delegate. """ pass def EndInvoke(self, result): """ EndInvoke(self: ResolveNameEventHandler, result: IAsyncResult) """ pass def GetMethodImpl(self, *args): # cannot find CLR method """ GetMethodImpl(self: MulticastDelegate) -> MethodInfo Returns a static method represented by the current System.MulticastDelegate. Returns: A static method represented by the current System.MulticastDelegate. """ pass def Invoke(self, sender, e): """ Invoke(self: ResolveNameEventHandler, sender: object, e: ResolveNameEventArgs) """ pass def RemoveImpl(self, *args): # cannot find CLR method """ RemoveImpl(self: MulticastDelegate, value: Delegate) -> Delegate Removes an element from the invocation list of this System.MulticastDelegate that is equal to the specified delegate. value: The delegate to search for in the invocation list. Returns: If value is found in the invocation list for this instance, then a new System.Delegate without value in its invocation list; otherwise, this instance with its original invocation list. """ pass def __init__(self, *args): # cannot find CLR method """ 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 # known case of __new__ def __new__(self, object, method): """ __new__(cls: type, object: object, method: IntPtr) """ pass def __reduce_ex__(self, *args): # cannot find CLR method pass class RootDesignerSerializerAttribute(Attribute, _Attribute): """ Indicates the base serializer to use for a root designer object. This class cannot be inherited. RootDesignerSerializerAttribute(serializerTypeName: str, baseSerializerTypeName: str, reloadable: bool) RootDesignerSerializerAttribute(serializerType: Type, baseSerializerType: Type, reloadable: bool) RootDesignerSerializerAttribute(serializerTypeName: str, baseSerializerType: Type, reloadable: bool) """ def __init__(self, *args): # cannot find CLR method """ 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 # known case of __new__ def __new__(self, *__args): """ __new__(cls: type, serializerType: Type, baseSerializerType: Type, reloadable: bool) __new__(cls: type, serializerTypeName: str, baseSerializerType: Type, reloadable: bool) __new__(cls: type, serializerTypeName: str, baseSerializerTypeName: str, reloadable: bool) """ pass Reloadable = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets a value indicating whether the root serializer supports reloading of the design document without first disposing the designer host. Get: Reloadable(self: RootDesignerSerializerAttribute) -> bool """ SerializerBaseTypeName = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets the fully qualified type name of the base type of the serializer. Get: SerializerBaseTypeName(self: RootDesignerSerializerAttribute) -> str """ SerializerTypeName = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets the fully qualified type name of the serializer. Get: SerializerTypeName(self: RootDesignerSerializerAttribute) -> str """ TypeId = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets a unique ID for this attribute type. Get: TypeId(self: RootDesignerSerializerAttribute) -> object """ class SerializationStore(object, IDisposable): """ Provides the base class for storing serialization data for the System.ComponentModel.Design.Serialization.ComponentSerializationService. """ def Close(self): """ Close(self: SerializationStore) Closes the serialization store. """ pass def Dispose(self, *args): # cannot find CLR method """ Dispose(self: SerializationStore, disposing: bool) Releases the unmanaged resources used by the System.ComponentModel.Design.Serialization.SerializationStore and optionally releases the managed resources. disposing: true to release both managed and unmanaged resources; false to release only unmanaged resources. """ pass def Save(self, stream): """ Save(self: SerializationStore, stream: Stream) Saves the store to the given stream. stream: The stream to which the store will be serialized. """ pass def __enter__(self, *args): # cannot find CLR method """ __enter__(self: IDisposable) -> object Provides the implementation of __enter__ for objects which implement IDisposable. """ pass def __exit__(self, *args): # cannot find CLR method """ __exit__(self: IDisposable, exc_type: object, exc_value: object, exc_back: object) Provides the implementation of __exit__ for objects which implement IDisposable. """ pass def __init__(self, *args): # cannot find CLR method """ 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 def __repr__(self, *args): # cannot find CLR method """ __repr__(self: object) -> str """ pass Errors = property( lambda self: object(), lambda self, v: None, lambda self: None ) # default """Gets a collection of errors that occurred during serialization or deserialization. Get: Errors(self: SerializationStore) -> ICollection """
print('============== Conversor de Temperaturas ===============') tc = float(input('Informe a temperatura em C° ')) tf = (((9 * tc) / 5) + 32) print('\n') print('A temperatura em graus {:.1f}C° convertida em graus será {:.1f}F° '.format(tc,tf))
# Palindrome Permutation: # Given a string, write a function to check if it is a permutation of a palindrome. A palindrome is a word or phrase that is the same forwards and backwards. A permutation is a rearrangement of letters. The palindrome does not need to be limited to just dictionary words. def palindromePermutation(string): string = string.lower() sort = sorted(string) sortedString = "".join(sort) # sort the string isPerm = True oddCounter = 0 charCount = len(sortedString) if charCount % 2 == 0: # If there is an even number of characters, for char in range(0, charCount, 2): # loop through the string, pairing up each letter to the one after it. if sortedString[char] == sortedString[char+1]: # If all the pairs match up, isPerm = True # then the whole thing is a permutation of a palindrome. else: # Otherwise, isPerm = False # it is not. else: # If there is an odd number of characters, for char in range(0, charCount-1, 2): # loop through the string minus that odd one out, pairing up the letters. if sortedString[char] == sortedString[char+1]: # If the pair matches up, isPerm = True # then continue to the next pair. else: oddCounter += 1 sortedString.replace(sortedString[char], "", 1) if oddCounter > 1: isPerm = False return isPerm print(palindromePermutation("tact coa")) # True print(palindromePermutation("abdccdcdba")) # True print(palindromePermutation("yeet")) # False
# 核心思路 # 首先排序保证数组为递增序(题目保证每个元素都不同) # 然后不断调用next-permutation生成序列 class Solution(object): def permute(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ nums.sort() result = [] while True: result.append(nums[:]) if not next_perm(nums): break return result def next_perm(nums): x, y = -1, -1 for i in range(len(nums) - 1): if nums[i] < nums[i+1]: x = i if x != -1 and nums[x] < nums[i]: y = i # Have reached the last permutation. if x == -1: return False # Check the last element. if nums[-1] > nums[x]: y = len(nums) - 1 nums[x], nums[y] = nums[y], nums[x] nums[x+1:] = reversed(nums[x+1:]) return True
# Default colors STRONG = "5aa69d" # primary color (for highlighting etc) NEUTRAL = "999999" POSITIVE = "47b358" NEGATIVE = "ec6b56" FILL_BETWEEN = "F7F4F4" WARM = "ff808f" COLD = "4062bb" BLACK = "0F1108" DARK_GRAY = "42404F" LIGHT_GRAY = "C8C7D1" # For categorical coloring # picked from color brewer, but without too much thought... # Can be overridden with style file QUALITATIVE = ["66c2a5", "fc8d62", "8da0cb", "e78ac3", "a6d854", "ffd92f", "e5c494", "b3b3b3"]
#!/usr/bin/env python # -*- coding: utf-8 -*- # 定义一系列计算年终奖的算法 bouns_strategy = { 'S': lambda s: s * 4, 'A': lambda s: s * 3, 'B': lambda s: s * 2, # 添加 S+ 和 C 算法 'SP': lambda s: s * 5, 'C': lambda s: s, } def calculate_bouns(name, strategy, salary): return '{name} get {salary}'.format(name=name, salary=strategy(salary)) if __name__ == '__main__': print(calculate_bouns('jack', bouns_strategy['S'], 10000)) print(calculate_bouns('linda', bouns_strategy['A'], 10000)) print(calculate_bouns('sean', bouns_strategy['B'], 10000)) # 现在需求变化了,添加 S+ 作为最高级,C 级 作为最低级 # jack 从 S 调整到 S+ # sean 从 B 调整到 C print('需求改变以后......') print(calculate_bouns('jack', bouns_strategy['SP'], 10000)) print(calculate_bouns('linda', bouns_strategy['A'], 10000)) print(calculate_bouns('sean', bouns_strategy['C'], 10000))
values = [] values.append(1) values.append(3) values.append(5) print('first time:', values) values = values[1:] print('second time:', values)
s = list(map(int, input().split())) for i in range(1, len(s), 2): s[i - 1], s[i] = s[i], s[i - 1] print(*s)
#!/usr/bin/env python3 """The Western Exchange module""" def np_transpose(matrix): """transposes matrix""" return matrix.transpose()
""" Import from other sources to database. """
for i in range(100): count=i+1 if count % 3==0 and count % 5==0: a= 'fizzbuzz' elif count % 3==0: a= "fizz" elif count % 5==0: a="buzz" else: a=count user=input("whats the next number in fizzbuzz?") a= str(a) if user==a: print("goodjob") else: print('sorry,wrong answer') break
# .py file for python maths exercises # convert degree to radian # x * pi/180 # in = 15 # out = 0.2619047619047619 def deg2rad(degrees): pi = 22/7 return degrees * pi / 180 # convert radian to degree # in = .52 # out = 29.781818181818185 def rad2deg(rad): pi = 22/7 return rad / pi * 180 # area of trapezoid # a = (a+b/2)h # in = h: 5, a: 5, b: 6 # # out = 27.5 def area_of_trapezoid(a, b, h): ab = a + b return (ab / 2) * h # area of parallelogram # a = bh # in = b: 5, h: 6 def area_of_parallelogram(b, h): return b*h # surface volume and surface area of cylinder # a = 2(pi)rh + 2(pi)r^2 # v = (pi)r^2h # in = h: 4, r: 6 # out a = 377.1428571428571 # out v = 452.57142857142856 def get_volume_surface_of_cylinder(r, h): pi = 22/7 a = (2 *pi) * r * h + (2 * pi) * (r * r) print(a) v = pi * (r * r) * h print (v)
# coding=utf-8 """Maximum sum increasing subsequence dynamic programming solution Python implementation.""" def msis(seq): dp = [x for x in seq] for i in range(1, len(seq)): for j in range(i): if seq[i] > seq[j] and dp[i] < dp[j] + seq[i]: dp[i] = dp[j] + seq[i] return max(dp) if __name__ == "__main__": arr = [1, 101, 2, 3, 100, 4, 5] print(msis(arr))
def binary_search(input_array, value): """this function take an input array, and return the index of value if present in the input array or -1 if not""" min_index = 0 max_index = len(input_array)-1 while (min_index<=max_index): midle = (min_index+max_index)//2 if input_array[midle]==value: return midle elif value > input_array[midle]: min_index = midle+1 else : max_index = max_index-1 return -1 test_list = [1,3,9,11,15,19,29] test_val1 = 25 test_val2 = 29 print(binary_search(test_list, test_val1)) print(binary_search(test_list, test_val2)) print(binary_search(test_list, -7))
#!/usr/bin/env python3 #while loops will continue to run while the condition remains true #laços de repetição while continuam executando enquanto a condição permanecer verdadeira #------------------------------------------------------------------------ #english answer = "yes" while answer != "no": answer = input("Want to continue?") #portugues resposta = "sim" while resposta != "nao": resposta = input(" Quer continuar?") #------------------------------------------------------------------------
def add_class_name(attrs, class_name): class_names = attrs.get('class') if class_names: class_names = [class_names] else: class_names = [] class_names.append(class_name) attrs['class'] = ' '.join(class_names) return attrs class ReadonlyValue: def __init__(self, value, humanized_value): self.value = value self.humanized_value = humanized_value
''' Segments which start with six zero-bits after the header are very often ascii files. ''' class R1k6ZeroSegment(): ''' Look for ascii files with six zero bits prefix ''' def __init__(self, this): if not this.has_note('R1k_Segment'): return bits = bin(int.from_bytes(b'\xff' + this[:17].tobytes(), 'big'))[10:] hdr0 = int(bits[:32], 2) hdr1 = int(bits[32:64], 2) hdr2 = int(bits[64:96], 2) hdr3 = int(bits[96:128], 2) hdr4 = int(bits[128:134], 2) if hdr4: return if hdr0 > hdr3: return if hdr2: return if hdr1 & 0xfff != 0xfff: return if hdr3 & 0xfff != 0xfff: return if (hdr0 + 0x7f - 134) % 8: return text = [] a = (this[16] & 3) << 8 hdr0 += 0x7f self.incomplete = 0 for n, i in enumerate(this): hdr0 -= 8 if hdr0 < 0: break if n > 16: a |= i char = (a >> 2) & 0xff a &= 3 a <<= 8 if 32 <= char <= 126: text.append(b'%c' % char) elif char in (9, 10, 12, 13,): text.append(b'%c' % char) else: if n > 17: print("6Z FAIL", this, "char 0x%02x" % i, n, hdr0) if n > 1024: self.incomplete = n break return if len(text) > 0: this.add_note("R1k6ZERO") self.that = this.create(bits=b''.join(text)) self.that.add_note("R1k Text-file segment") this.add_interpretation(self, self.render_bits) if self.incomplete: this.add_interpretation(self, this.html_interpretation_hexdump) def render_bits(self, fo, _this): ''' just a pointer to the new artifact ''' fo.write('<H3>R1K Text file</H3>\n') fo.write('<pre>\n') fo.write('Please see content at' + self.that.summary() + '\n') if self.incomplete: fo.write('From approx 0x%x conversion failed\n' % self.incomplete) fo.write('</pre>\n')
_base_ = ["./FlowNet512_1.5AugAAE_Flat_Pbr_01_ape.py"] OUTPUT_DIR = "output/deepim/lmPbrSO/FlowNet512_1.5AugAAE_Flat_lmPbr_SO/can" DATASETS = dict(TRAIN=("lm_pbr_can_train",), TEST=("lm_real_can_test",)) # bbnc5 # objects can Avg(1) │··············································································································· # ad_2 26.08 26.08 │··············································································································· # ad_5 93.80 93.80 │··············································································································· # ad_10 99.90 99.90 │··············································································································· # rete_2 97.83 97.83 │··············································································································· # rete_5 100.00 100.00 │··············································································································· # rete_10 100.00 100.00 │··············································································································· # re_2 97.93 97.93 │··············································································································· # re_5 100.00 100.00 │··············································································································· # re_10 100.00 100.00 │··············································································································· # te_2 99.80 99.80 │··············································································································· # te_5 100.00 100.00 │··············································································································· # te_10 100.00 100.00 │··············································································································· # proj_2 52.17 52.17 │··············································································································· # proj_5 98.82 98.82 │··············································································································· # proj_10 100.00 100.00 │··············································································································· # re 0.91 0.91 │··············································································································· # te 0.01 0.01
""" Given a string containing just the characters '(', ')', '{', '}', '[', ']', determine if the input string is valid. An input string is valid if: 1. Open brackets must be closed by the same type of brackets. 2. Open brackets must be closed in the correct order. Note that an empty string is also considered valid. Example: Input: "()[]{}" Output: true """ #Difficulty: Easy #76 / 76 test cases passed. #Runtime: 28 ms #Memory Usage: 13.8 MB #Runtime: 28 ms, faster than 82.23% of Python3 online submissions for Valid Parentheses. #Memory Usage: 13.8 MB, less than 64.83% of Python3 online submissions for Valid Parentheses. class Solution: def isValid(self, s: str) -> bool: parentheses = {'(':')', '{':'}', '[':']'} stack = [] for b in s: # take bracket 'b' from string 's' if b in parentheses: # if bracket in parentheses stack.append(parentheses[b]) # append it's opposite to stack elif not stack or stack.pop() != b: # if not stack or bracket not return False # equal last bracket in stack return not stack # if stack still exists -> False else True
class BufAny: pass class Buffer: """An input buffer. Allows socket data to be read immediately and buffered, but fine-grained byte-counting or sentinel-searching to be specified by consumers of incoming data.""" def __init__(self): self._atinbuf = [] self._atterm = None self._atmark = 0 def set_term(self, term): """Set the current sentinel. `term` is either an int, for a byte count, or a string, for a sequence of characters that needs to occur in the byte stream.""" self._atterm = term def feed(self, data): """Feed some data into the buffer. The buffer is appended, and the check() is run in case this append causes the sentinel to be satisfied.""" if type(data) is not bytes: raise TypeError('Expected <bytes> got {}'.format(type(data))) self._atinbuf.append(data) self._atmark += len(data) return self.check() def clear_term(self): self._atterm = None def check(self): """Look for the next message in the data stream based on the current sentinel.""" if self._atterm is None: return if self._atterm is BufAny: if self.has_data: return self.pop() return if type(self._atterm) is int: buf = None ind = self._atterm if self._atterm <= self._atmark else None elif type(self._atterm) is bytes: buf = b''.join(self._atinbuf) res = buf.find(self._atterm) ind = res + len(self._atterm) if res != -1 else None else: raise TypeError('`term` must be a <int>, <bytes>, <BufAny> or <None>', type(self._atterm)) if ind is not None: self._atterm = None # this terminator was used if buf is None: buf = b''.join(self._atinbuf) use = buf[:ind] new_buf = buf[ind:] self._atinbuf = [new_buf] self._atmark = len(new_buf) return use def pop(self): b = b''.join(self._atinbuf) self._atinbuf = [] self._atmark = 0 return b @property def has_data(self): return bool(self._atinbuf)
# _*_ coding: utf-8 _*_ """ @Date: 2021/5/6 11:42 下午 @Author: wz @File: NonDecreasingArray.py @Decs: """ ''' question: 给你一个长度为 n 的整数数组,请你判断在 最多 改变 1 个元素的情况下,该数组能否变成一个非递减数列。 我们是这样定义一个非递减数列的: 对于数组中任意的 i (0 <= i <= n-2),总满足 nums[i] <= nums[i + 1]。 示例 1: 输入: nums = [4,2,3] 输出: true 解释: 你可以通过把第一个4变成1来使得它成为一个非递减数列。 ''' class Solution(): def __init__(self, array): self.array = array def check_possibility(self): """ 该题的思路同样是从左到右遍历array,当每遇到一个array[i]<array[i-1],必然都需要进行一次调整,使其符合非递减,遍历玩array后,得到至少要调整多少次,使其达到全局最优 而问题就到了array[i]<array[i-1]时需要如何调整的问题,尤其时下文的情况2。 Returns: """ # 假设有array为:...i-2,i-1,i,i+1,... ,需要做调整的情况有几种: # 1、考虑array为: ...1, 4, 2, 3,... 有两种方法,a). 4 -> 2 正解,因为对于i的位置来说,在满足非递减原则下,其值越小越好,越容易满足i+1及其后面非递减的原则;b). 2 -> 4 # 2、考虑array为: ...3, 4, 2, 3,... 只有一种方法,a). 2 -> 4 (虽然调整后i-1,i,i+1也不能满足非递减的原则,但是i-2,i-1,i三个元素必然需要调整一次值,所以改例子并不能在改变 1 个元素的情况下,使之变成一个非递减数列) N = len(array) count = 0 for i in range(1, N): if array[i] < array[i - 1]: count += 1 if i == 1 or array[i] >= array[i - 2]: # short-circuit or array[i - 1] = array[i] else: array[i] = array[i - 1] print(array) return count <= 1 if __name__ == "__main__": array = [3, 4, 2, 1, 8, 7] solution = Solution(array) print(solution.check_possibility())
""" This file is part of EmailHarvester Copyright (C) 2016 @maldevel https://github.com/maldevel/EmailHarvester EmailHarvester - A tool to retrieve Domain email addresses from Search Engines. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. For more see the file 'LICENSE' for copying permission. """ #config = None app_emailharvester = None def search(domain, limit): all_emails = [] app_emailharvester.show_message("[+] Searching in Github") yahooUrl = "http://search.yahoo.com/search?p=site%3Agithub.com+%40{word}&n=100&ei=UTF-8&va_vt=any&vo_vt=any&ve_vt=any&vp_vt=any&vd=all&vst=0&vf=all&vm=p&fl=0&fr=yfp-t-152&xargs=0&pstart=1&b={counter}" app_emailharvester.init_search(yahooUrl, domain, limit, 1, 100, 'Yahoo + Github') app_emailharvester.process() all_emails += app_emailharvester.get_emails() bingUrl = "http://www.bing.com/search?q=site%3Agithub.com+%40{word}&count=50&first={counter}" app_emailharvester.init_search(bingUrl, domain, limit, 0, 50, 'Bing + Github') app_emailharvester.process() all_emails += app_emailharvester.get_emails() googleUrl = 'https://www.google.com/search?num=100&start={counter}&hl=en&q=site%3Agithub.com+"%40{word}"' app_emailharvester.init_search(googleUrl, domain, limit, 0, 100, 'Google + Github') app_emailharvester.process() all_emails += app_emailharvester.get_emails() url = 'http://www.baidu.com/search/s?wd=site%3Agithub.com+"%40{word}"&pn={counter}' app_emailharvester.init_search(url, domain, limit, 0, 10, 'Baidu + Github') app_emailharvester.process() all_emails += app_emailharvester.get_emails() url = "http://www.exalead.com/search/web/results/?q=site%3Agithub.com+%40{word}&elements_per_page=10&start_index={counter}" app_emailharvester.init_search(url, domain, limit, 0, 50, 'Exalead + Github') app_emailharvester.process() all_emails += app_emailharvester.get_emails() #dogpile seems to not support site: return all_emails class Plugin: def __init__(self, app, conf):# global app_emailharvester, config #config = conf app.register_plugin('github', {'search': search}) app_emailharvester = app
def vote_registration_app(): print(f"\tWelcome to the Voter Registration App") name = input(f"\tPlease enter your name:\t") age = int(input(f"\tPlease enter your age:\t")) if age >= 18: print(f"\n\tCongratulations {name}! You are old enough to register to vote.\n") print(f"""\t\t-Republican \t-Democratic \t-Independent \t-Libertarian \t-Green\n""") party = input(f"\tWhat party would you like to join:\t").lower() if party == "republican" or party == "democratic": print(f"\tCongratulations {name}! You have joined the {party.title()} party!\n\tThat is a major party!") elif party == "independent": print(f"\tCongratulations {name}! You have joined the {party.title()} party!\n\tYou are an independent person!") else: print(f"\tCongratulations {name}! You have joined the {party.title()} party!\n\tThat is not a major party!") else: print(f"\tYou are not old enough to register vote") vote_registration_app()
c = c2 = c3 = 0 while True: print('-' * 30) print(' CADASTRE UMA PESSOA ') print('-' * 30) idade = int(input('Idade: ')) sexo = str(input('Sexo: [F/M] ')).strip().upper()[0] while sexo not in 'FM': sexo = str(input('Sexo: [F/M] ')).strip().upper()[0] if idade < 18: c += 1 if sexo == 'M': c2 += 1 if sexo == 'F' and idade < 20: c3 += 1 print('-' * 30) continuar = str(input('Deseja continuar? [S/N] ')).upper().strip()[0] if continuar == 'N': break while continuar not in 'SN': print('-' * 30) continuar = str(input('Deseja continuar? [S/N] ')).upper().strip()[0] print('-' * 30) print(f'Foram contadas {c} pessoas com menos de 18 anos, {c2} homens e {c3} mulheres com menos de 20 anos.') print('='*5,'FIM DO PROGRAMA','='*5)
# 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. """Module for performing common group operations.""" class AbstractGroupManager(object): """The interface required for user grouping in Upvote.""" def DoesGroupExist(self, groupname): """Determines if a given group exists. Args: groupname: The group name to check. Returns: Whether the group exists. """ raise NotImplementedError() def AllMembers(self, groupname): """Returns all the members of the provided group. Args: groupname: str, The group for which the members should be retrieved. Returns: A list<str> of all user emails in the given group. """ raise NotImplementedError() class GroupManager(AbstractGroupManager): """An static implementation of the groups interface.""" _GROUPS = { 'admin-users': [ "alex@farmersbusinessnetwork.com", "amohr@farmersbusinessnetwork.com", "ed@farmersbusinessnetwork.com", "mdaniel@farmersbusinessnetwork.com", ] } def DoesGroupExist(self, groupname): """See base class for description.""" return groupname in self._GROUPS def AllMembers(self, groupname): """See base class for description.""" return self._GROUPS[groupname]
#-*- coding:utf-8 -*- AbsoluteFreqMap = { 'C': 261, '#C': 276, 'bD': 276, 'D': 292, '#D': 310, 'bE': 310, 'E': 328, 'F': 348, '#F': 369, 'bG': 369, 'G': 391, '#G': 414, 'bA': 414, 'A': 438, '#A': 465, 'bB': 465, 'B': 492 } RelativeFreqMap = { '1': 0, '#1': 1 / 12, 'b2': 1 / 12, '2': 2 / 12, '#2': 3 / 12, 'b3': 3 / 12, '3': 4 / 12, '4': 5 / 12, '#4': 6 / 12, 'b5': 6 / 12, '5': 7 / 12, '#5': 8 / 12, 'b5': 8 / 12, '6': 9 / 12, '#6': 10 / 12, 'b7': 10 / 12, '7': 11 / 12 }
# -*- coding: utf-8 -*- __author__ = "苦叶子" """ 公众号: 开源优测 Email: lymking@foxmail.com """ HEADER = """\ """ #根据实际的ip修改 SERVER_NAME = "192.168.1.141:5000"
def open_file(): file = input('Enter input file:') if file=="measles.txt": return file else: print("File should be \"measles.txt\"") exit() #Function compare income and the integers def ref(income): if income==1: income="WB_LI" return income elif income==2: income="WB_LMI" return income elif income==3: income="WB_UMI" return income elif income==4: income="WB_HI" return income else: print("Invalid income") while True: try: file=open_file() year = int(input('Enter year:')) year = str(year) income = int(input('Enter income level:')) income2=ref(income) measles = open(file, 'r') count=0 add=0 lowest=99 highest=0 for line in measles: if (income2 in line[51:57]) and (year==line[88:92]): child=line[59:62] child2=int(child) if child2>highest: highest=child2 if child2<lowest: lowest=child2 add+=child2 count+=1 average=add/count print("Lowest percentage =",lowest) print("Highest percentage =",highest) print("Average percentage =",average) print("Success!!") break except: print("Error!! , Invalid Input!!") continue
load( "@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install", ) PACKAGE_JSON = "@com_github_scionproto_scion//spec/tools:package.json" def install_yarn_dependencies(): node_repositories( package_json = [PACKAGE_JSON], ) yarn_install( name = "spec_npm", # Opt out of directory artifacts, we rely on ts_library which needs # to see labels for all third-party files. exports_directories_only = False, package_json = PACKAGE_JSON, yarn_lock = "@com_github_scionproto_scion//spec/tools:yarn.lock", )
def test_del_first_group(app): app.group.delete_first_group()
class HttpFetchError(BaseException): pass class MaxExceptionError(BaseException): pass class KnownError(BaseException): pass