content
stringlengths
7
1.05M
print('first') print('second') if True: x = 1 y = 2 print('hi')
''' sekarang kita menghitung bunganya! ooh ya, apakah anda tahu bahwa kita bisa merantai perhitungan seperti ini jawaban = 2000 * /100 kita buat hal serupa di sini ''' ''' ciptakan variabel suku_bunga dan berikan nilai antara 5 hingga 30 -ciptakan juga varibel jumlah_bunga yang merupakan hasil perkalian sisa_cicilan dan suku_bunga dan di bagi 100 kenapa dibagi 100? >>>karena suku bunga satuannya adalah persen ''' harga_laptop = 5000000 uang_muka = 1000000 sisa_cicilan = harga_laptop - uang_muka suku_bunga = 20 jumlah_bunga = sisa_cicilan * suku_bunga /100 print(jumlah_bunga)
# Title : Insert new element before each element # Author : Kiran raj R. # Date : 23:10:2020 def insert_b4(list_in, str_elem): out = [elem for list_elem in list_in for elem in (str_elem, list_elem)] print(f"After inserting element: {out}") def insert_after(list_in, str_elem): out = [elem for list_elem in list_in for elem in (list_elem, str_elem)] print(f"After inserting element: {out}") insert_b4([1, 2, 3, 4, 5], "$") insert_after([1, 2, 3, 4, 5], "#")
NOP = 0 RD = 1 WR = 2 class mmiodev(object): def __init__(self): self.regmap = {} self.regidx = {} def addReg(self, name, addr, length, readonly=0, default=0): # make sure it doesn't overlap with anything. for (a0,a1) in self.regmap: assert addr < a0 or addr >= a1 assert name not in self.regidx self.regmap[(addr, addr+length)] = (name, length, readonly, [default]*length) self.regidx[name] = (addr, addr+length) def read(self, addr): assert addr >= 0 and addr <= 65536 for (a0, a1) in self.regmap: if addr >= a0 and addr < a1: (name, length, readonly, data) = self.regmap[(a0, a1)] offset = addr-a0 return True, data[offset] return False, 0 def write(self, addr, byte): assert addr >= 0 and addr <= 65536 for (a0, a1) in self.regmap: if addr >= a0 and addr < a1: (name, length, readonly, data) = self.regmap[(a0, a1)] if not readonly: offset = addr-a0 data[offset] = byte def getRegB(self, name): (a0, a1) = self.regidx[name] (name, length, readonly, data) = self.regmap[(a0, a1)] return data def getRegI(self, name): (a0, a1) = self.regidx[name] (name, length, readonly, data) = self.regmap[(a0, a1)] m, v = 1, 0 for i in xrange(length): v = v + m * data[i] m = m * 0x100 return v def setRegI(self, name, datain): (a0, a1) = self.regidx[name] (name, length, readonly, data) = self.regmap[(a0, a1)] data = [] for i in xrange(length): data.append(datain & 0xFF) datain = datain >> 8 self.regmap[(a0, a1)] = (name, length, readonly, data) def setRegB(self, name, datain): (a0, a1) = self.regidx[name] (name, length, readonly, data) = self.regmap[(a0, a1)] assert len(datain) == length self.regmap[(a0, a1)] = (name, length, readonly, datain)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Author: Jorge Mauricio # Email: [email protected] # Date: 2018-02-01 # Version: 1.0 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Objetivo: Define una función en la cual se acepten dos variables string, evalue cual de las dos funciones tiene el número mayor de caracteres y la imprima, si las dos palabras tienen un número igual de caracteres, se deben de imprimir las dos palabras Ej. hola adios Resultado: adios """
def of(n, acc1=0, acc2=1): if n < 0: raise ValueError if n == 0: return 0 elif n <= 1: return acc2 else: return of(n - 1, acc2, acc1 + acc2)
#!/usr/bin/python3 # Create a file and call it lyrics.txt (it does not need to have any content) # Create a new file and call it songs.docx and in this file write 3 lines # of text to it. # Open and read the content and write it to your terminal # window. * you should use the read(), readline(), and readlines() # methods for this. (so 3 times the same output). # from typing import TextIO songs_dox = "../files/songs.docx" def separator(text): print(f"\n#----- Reading from songs.docx with {text} -----#\n") lyricsFile = open("../files/lyrics.txt", "w+") print("lyrics.txt has been created in folder files,", "any previous data has been deleted") lyricsFile.close() songsFile = open(songs_dox, "w+") songsFile.write("This is the first line of the file.\n") songsFile.write("And this is the second line of the file.\n") songsFile.write("Ths is the third and final line of the file,", "I hope you enjoyed your stay.\n") print("songs.docx has been created and overwritten") songsFile.close() # read() separator("read()") songsFile = open(songs_dox, "r") if songsFile.mode == "r": text = songsFile.read() print(text) songsFile.close() # readline() separator("readline()") songsFile = open(songs_dox, "r") if songsFile.mode == "r": text = songsFile.readline() while text: # printline adds a \n char so i want to remove my old one print(text.replace("\n", "")) text = songsFile.readline() songsFile.close() # readlines() separator("readlines()") songsFile = open(songs_dox, "r") if songsFile.mode == "r": text = songsFile.readlines() for x in text: x = x.replace("\n", "") print(x) songsFile.close()
class Star: def __init__(self): self.x = random(-width/2, width/2) self.y = random(-height/2, height/2) self.z = random(width/2) self.pz = self.z def update(self, speed): self.z = self.z - speed if self.z < 1: self.z = width/2 self.x = random(-width/2, width/2) self.y = random(-height/2, height/2) self.pz = self.z def show(self): fill(255) noStroke() sx = map(self.x / self.z, 0, 1, 0, width/2) sy = map(self.y / self.z, 0, 1, 0, height/2) r = map(self.z, 0, width/2, 16, 0) ellipse(sx, sy, r, r) px = map(self.x / self.pz, 0, 1, 0, width/2) py = map(self.y / self.pz, 0, 1, 0, height/2) self.pz = self.z stroke(255) line(px, py, sx, sy)
login_schema = { 'type': 'object', 'properties': { 'login': {'type': 'string', 'pattern': '^[0-9A-z-_]+$'}, 'password': {'type': 'string', 'pattern': '^[0-9A-z-_]+$'} }, 'required': ['login', 'password'] } register_schema = { 'type': 'object', 'properties': { 'login': {'type': 'string', 'pattern': '^[0-9A-z-_]+$'}, 'email': {'type': 'string', 'pattern': '^[0-9A-z-_]+@[0-9A-z-_]+.[0-9A-z]+$'}, 'password': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'}, 'first_name': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'}, 'second_name': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'} }, 'required': ['login', 'password', 'first_name', 'second_name', 'email'] } profile_update_schema = { 'type': 'object', 'properties': { 'first_name': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'}, 'second_name': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'} }, 'required': ['first_name', 'second_name'] } chat_create_schema = { 'type': 'object', 'properties': { 'name': {'type': 'string', 'pattern': '^[0-9A-zА-я-_\s][^\\r\\t\\n\\v\\f]+$'}, }, 'required': ['name'] } chat_send_msg_schema = { 'type': 'object', 'properties': { 'name': {'type': 'string', 'pattern': '^[0-9A-z-_]+$'}, }, 'required': ['name'] } password_schema = { 'type': 'object', 'properties': { 'password': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'}, }, 'required': ['password'] }
# -*- coding: utf-8 -*- # Copyright 2021 Cohesity Inc. class ValueTypeEnum(object): """Implementation of the 'ValueType' enum. Specifies the type of the value contained here. All values are returned as pointers to strings, but they can be casted to the type indicated here. 'kInt64' indicates that the value stored in the Task Attribute is a 64-bit integer. 'kDouble' indicates that the value stored in the Task Attribute is a 64 bit floating point number. 'kString' indicates that the value stored in the Task Attribute is a string. 'kBytes' indicates that the value stored in the Task Attribute is an array of bytes. Attributes: KINT64: TODO: type description here. KDOUBLE: TODO: type description here. KSTRING: TODO: type description here. KBYTES: TODO: type description here. """ KINT64 = 'kInt64' KDOUBLE = 'kDouble' KSTRING = 'kString' KBYTES = 'kBytes'
#!/usr/bin/python # -*- coding: UTF-8 -*- """ @file : hooks.py @Time : 2021/3/31 15:32 @Author: Tao.Xu @Email : [email protected] """ def pytest_smtp_report_title(report): """ Called before adding the title to the report """ def pytest_smtp_results_summary(prefix, summary, postfix): """ Called before adding the summary section to the report """ def pytest_smtp_results_table_header(cells): """ Called after building results table header. """ def pytest_smtp_results_table_row(report, cells): """ Called after building results table row. """ def pytest_smtp_results_table_html(report, data): """ Called after building results table additional HTML. """
DATABASE_AUTO_CREATE_INDEX = True DATABASES = { 'default': { 'db': 'billing', 'host': 'localhost', 'port': 27017, 'username': '', 'password': '' } } CACHES = { 'default': {}, 'local': { 'backend': 'spaceone.core.cache.local_cache.LocalCache', 'max_size': 128, 'ttl': 300 } } HANDLERS = { } CONNECTORS = { 'BillingPluginConnector': { }, 'SpaceConnector': { 'backend': 'spaceone.core.connector.space_connector.SpaceConnector', 'endpoints': { 'identity': 'grpc://identity:50051', 'plugin': 'grpc://plugin:50051', 'repository': 'grpc://repository:50051', 'secret': 'grpc://secret:50051', 'config': 'grpc://config:50051', } }, } INSTALLED_DATA_SOURCE_PLUGINS = [ # { # 'name': '', # 'plugin_info': { # 'plugin_id': '', # 'version': '', # 'options': {}, # 'secret_data': {}, # 'schema': '', # 'upgrade_mode': '' # }, # 'tags':{ # 'description': '' # } # } ]
# We're trying to find the sum of the even fibonacci numbers # from 1 to `max_num` class Solution: # We're going to do fibonacci iteratively def solution(self, max_num: int) -> int: # `minus1` and `minus2` keep track of the last two values # starting with 0 and 1, `num` keeps track of the current # value, and `sum` is a running sum of `num`'s even values. # minus1, minus2 = 1, 0 num = 0 sum = 0 while num < max_num: num = minus1 + minus2 minus2 = minus1 minus1 = num # We only care to sum even values of `num` if num % 2 == 0: sum += num return sum
class Solution: def maxDistance(self, position: List[int], m: int) -> int: position=sorted(position) dis=position[-1]-position[0] if m==2: return position[-1]-position[0] low=1 high=dis def validInterval(interval): n=m-1 i=0 while n>0: j=i while j<len(position)-1 and position[j]-position[i]<interval: j+=1 if position[j]-position[i]<interval: return False i=j n-=1 return True while low!=high: mid=(high+low)//2 if mid==low: mid+=1 if validInterval(mid): low=mid else: high=mid-1 return high
project = 'django-sms' copyright = '2021, Roald Nefs' author = 'Roald Nefs' release = '0.4.0' extensions = ['m2r2'] templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] source_suffix = ['.rst', '.md'] html_theme = 'alabaster' html_theme_options = { "description": "A Django app for sending SMS with interchangeable backends.", "show_powered_by": False, "github_user": "roaldnefs", "github_repo": "django-sms", "github_button": True, "github_banner": True, "show_related": False, } html_static_path = ['_static']
def main(): f = [int(i) for i in [line.rstrip("\n") for line in open("Data.txt")][0].split(",")] f[1] = 12 f[2] = 2 i = 0 while True: if f[i] == 99: break elif f[i] == 1: f[f[i + 3]] = f[f[i + 1]] + f[f[i + 2]] elif f[i] == 2: f[f[i + 3]] = f[f[i + 1]]*f[f[i + 2]] else: print("Something went wrong") i += 4 print(f[0]) if __name__ == "__main__": main()
def pivotedBinarySearch(arr, n, key): pivot = findPivot(arr, 0, n-1) if pivot == -1: return binarySearch(arr, 0, n-1, key) if arr[pivot] == key: return pivot if arr[0] <= key: return binarySearch(arr, 0, pivot-1, key) return binarySearch(arr, pivot + 1, n-1, key) def findPivot(arr, low, high): if high < low: return -1 if high == low: return low mid = int((low + high)/2) if mid < high and arr[mid] > arr[mid + 1]: return mid if mid > low and arr[mid] < arr[mid - 1]: return (mid-1) if arr[low] >= arr[mid]: return findPivot(arr, low, mid-1) return findPivot(arr, mid + 1, high) def binarySearch(arr, low, high, key): if high < low: return -1 mid = int((low + high)/2) if key == arr[mid]: return mid if key > arr[mid]: return binarySearch(arr, (mid + 1), high, key) return binarySearch(arr, low, (mid - 1), key) def broken_search(nums, target): """ Функция должна вернуть индекс элемента, равного k Eсли такой есть в массиве (нумерация с нуля). Если элемент не найден, функция должна вернуть -1 Изменять массив нельзя. """ n = len(nums) return pivotedBinarySearch(nums, n, target) def test(): arr = [19, 21, 100, 101, 1, 4, 5, 7, 12] assert broken_search(arr, 5) == 6
def register(mf): mf.register_event("main", lambda: print("tests"), unique=False) register_parents = False
# https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/ # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def buildTree(self, inorder: List[int], postorder: List[int]) -> TreeNode: map_inorder = {} for i, val in enumerate(inorder): map_inorder[val] = i def recur(low, high): if low > high: return None x = TreeNode(postorder.pop()) mid = map_inorder[x.val] x.right = recur(mid+1, high) x.left = recur(low, mid-1) return x return recur(0, len(inorder)-1)
''' Exercício Python 26: Faça um programa que leia uma frase pelo teclado e mostre quantas vezes aparece a letra “A”, em que posição ela aparecea primeira vez e em que posição ela aparece a última vez. ''' frase = str(input('Digite uma frase: ')).upper().strip() print(f'A letra "A" aparece {frase.count("A")} vezes na frase.') print(f'A primeira letra "A" apareceu na posição {frase.find("A")+1}') print(f'A ultima letra "A" apareceu na posição {frase.rfind("A")+1}')
DATABASE = { 'host': None, 'port': None, 'username': None, # 'data' 'password': None, # 'cafl-2021' 'db': None, 'uri': None, } BROWSER = { # broswer settings 'options': [ "--no-sandbox", "--dns-prefetch-disable", "--disable-browser-side-navigation", "--disable-dev-shm-usage", "--disable-infobars", "enable-automation" ], # delay, 'delay': 0, # waiting time to restart chrome after blocked by Amazon 'waitInterval': 10, # wait for web element 'elementTimeout': 0.5, # browser loading timeout 'browserTimeout': 180, } LOGGER = "error" VERBOSEDIGIT = 2 PROGRESSLEN = 25 SKIPERROR = True PRIVATE_PROXY = { # -------------- private proxy with authentication configuration ------------- # # 'username': '12345678', # 'password': '12345678', "manifest_json": """ { "version": "1.0.0", "manifest_version": 2, "name": "Chrome Proxy", "permissions": [ "proxy", "tabs", "unlimitedStorage", "storage", "<all_urls>", "webRequest", "webRequestBlocking" ], "background": { "scripts": ["background.js"] }, "minimum_chrome_version":"22.0.0" } """, "background_js": """ var config = { mode: "fixed_servers", rules: { singleProxy: { scheme: "http", host: "%s", port: parseInt(%s) }, bypassList: ["localhost"] } }; chrome.proxy.settings.set({value: config, scope: "regular"}, function() {}); function callbackFn(details) { return { authCredentials: { username: "%s", password: "%s" } }; } chrome.webRequest.onAuthRequired.addListener( callbackFn, {urls: ["<all_urls>"]}, ['blocking'] ); """ }
# Copyright 2021 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Implementation for macOS universal binary rule.""" load(":apple_support.bzl", "apple_support") load(":lipo.bzl", "lipo") load(":transitions.bzl", "macos_universal_transition") load("@bazel_skylib//lib:dicts.bzl", "dicts") def _universal_binary_impl(ctx): inputs = [ binary.files.to_list()[0] for binary in ctx.split_attr.binary.values() ] if not inputs: fail("Target (%s) `binary` label ('%s') does not provide any " + "file for universal binary" % (ctx.attr.name, ctx.attr.binary)) output = ctx.actions.declare_file(ctx.label.name) if len(inputs) > 1: lipo.create( actions = ctx.actions, apple_fragment = ctx.fragments.apple, inputs = inputs, output = output, xcode_config = ctx.attr._xcode_config[apple_common.XcodeVersionConfig], ) else: # If the transition doesn't split, this is building for a non-macOS # target, so just create a symbolic link of the input binary. ctx.actions.symlink(target_file = inputs[0], output = output) return [ DefaultInfo( executable = output, files = depset([output]), ), ] universal_binary = rule( attrs = dicts.add( apple_support.action_required_attrs(), { "binary": attr.label( cfg = macos_universal_transition, doc = "Target to generate a 'fat' binary from.", mandatory = True, ), "_allowlist_function_transition": attr.label( default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ), }, ), doc = """ This rule produces a multi-architecture ("fat") binary targeting Apple macOS platforms *regardless* of the architecture of the macOS host platform. The `lipo` tool is used to combine built binaries of multiple architectures. For non-macOS platforms, this simply just creates a symbolic link of the input binary. """, fragments = ["apple"], implementation = _universal_binary_impl, )
# compose tree to describe object dictionary # assume all instrument readings are four-byte floats theTree = { 0x1000: { 0x00: {0x40: 0, 'size': 4} }, 0x6001: { 0x00: {0x40: 5}, 0x01: {0x40: 'INST:SEL CH1;:SOUR:VOLT?', 0x23: 'INST:SEL CH1;:SOUR:VOLT'}, 0x02: {0x40: 'INST:SEL CH1;:SOUR:CURR?', 0x23: 'INST:SEL CH1;:SOUR:CURR'}, 0x03: {0x40: 'FETCH:VOLT? CH1'}, 0x04: {0x40: 'FETCH:CURR? CH1'}, 0x05: {0x40: 'FETCH:POW? CH1'} }, 0x6002: { 0x00: {0x40: 5}, 0x01: {0x40: 'INST:SEL CH2;:SOUR:VOLT?', 0x23: 'INST:SEL CH2;:SOUR:VOLT'}, 0x02: {0x40: 'INST:SEL CH2;:SOUR:CURR?', 0x23: 'INST:SEL CH2;:SOUR:CURR'}, 0x03: {0x40: 'FETCH:VOLT? CH2'}, 0x04: {0x40: 'FETCH:CURR? CH2'}, 0x05: {0x40: 'FETCH:POW? CH2'} }, 0x6003: { 0x00: {0x40: 5}, 0x01: {0x40: 'INST:SEL CH3;:SOUR:VOLT?', 0x23: 'INST:SEL CH3;:SOUR:VOLT'}, 0x02: {0x40: 'INST:SEL CH3;:SOUR:CURR?', 0x23: 'INST:SEL CH3;:SOUR:CURR'}, 0x03: {0x40: 'FETCH:VOLT? CH3'}, 0x04: {0x40: 'FETCH:CURR? CH3'}, 0x05: {0x40: 'FETCH:POW? CH3'} } }
api_key = "" api_secret = "" access_token_key = "" access_token_secret = ""
USERS = {} def update_user(user): if user not in USERS: USERS[user] = 0 USERS[user] += 1 return {'name': user, 'access': USERS[user]}
N, A, B = map(int, input().split()) if B >= A*N: print(A*N) else: print(B)
class Network: def __init__(self): self.layer_list = [] self.num_layer = 0 def add(self, layer): self.num_layer = self.num_layer + 1 self.layer_list.append(layer) def forward(self, x): for i in range(self.num_layer): x = self.layer_list[i].forward(x) return x def backward(self, delta): for i in reversed(range(self.num_layer)): delta = self.layer_list[i].backward(delta)
""" define in here e.g. the number of class, box scale, ... meaning constants class date: 9/30 author: arabian9ts """ # the number of classified class classes = 21 # the number of boxes per feature map boxes = [4, 6, 6, 6, 6, 6,] # default box ratios # each length should be matches boxes[index] box_ratios = [ [1.0, 1.0, 2.0, 1.0/2.0], [1.0, 1.0, 2.0, 1.0/2.0, 3.0, 1.0/3.0], [1.0, 1.0, 2.0, 1.0/2.0, 3.0, 1.0/3.0], [1.0, 1.0, 2.0, 1.0/2.0, 3.0, 1.0/3.0], [1.0, 1.0, 2.0, 1.0/2.0, 3.0, 1.0/3.0], [1.0, 1.0, 2.0, 1.0/2.0, 3.0, 1.0/3.0], ]
_base_ = [ '../../_base_/models/detr.py', '../../_base_/datasets/mot15.py', '../../_base_/default_runtime.py' #'../../_base_/datasets/mot_challenge.py', ] custom_imports = dict(imports=['mmtrack.models.mot.kf'], allow_failed_imports=False) link = 'https://download.openmmlab.com/mmdetection/v2.0/detr/detr_r50_8x2_150e_coco/detr_r50_8x2_150e_coco_20201130_194835-2c4b8974.pth' model = dict(type='KFSORT', detector=dict( init_cfg=dict(type='Pretrained',checkpoint=link), ), score_thres=0.9, iou_thres=0.3, ) dataset_type = 'MOTChallengeDataset' data_root = 'data/MOT15/' # data = dict( # samples_per_gpu=2, # workers_per_gpu=2, # train=dict( # type=dataset_type, # visibility_thr=-1, # ann_file=data_root + 'annotations/half-train_cocoformat.json', # img_prefix=data_root + 'train', # ref_img_sampler=dict( # num_ref_imgs=1, # frame_range=10, # filter_key_img=True, # method='uniform'), # pipeline=train_pipeline), # val=dict( # type=dataset_type, # ann_file=data_root + 'annotations/half-val_cocoformat.json', # img_prefix=data_root + 'train', # ref_img_sampler=None, # pipeline=test_pipeline), # test=dict( # type=dataset_type, # ann_file=data_root + 'annotations/half-val_cocoformat.json', # img_prefix=data_root + 'train', # ref_img_sampler=None, # pipeline=test_pipeline)) # learning policy lr_config = dict( policy='step', warmup='linear', warmup_iters=100, warmup_ratio=1.0 / 100, step=[3]) # runtime settings total_epochs = 4 evaluation = dict(metric=['bbox', 'track'], interval=1) search_metrics = ['MOTA', 'IDF1', 'FN', 'FP', 'IDs', 'MT', 'ML']
_base_ = [ '../_base_/default_runtime.py' ] model = dict( type='opera.InsPose', backbone=dict( type='mmdet.ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_eval=False, style='pytorch', init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), neck=dict( type='mmdet.FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, start_level=1, add_extra_convs='on_output', num_outs=5, relu_before_extra_convs=True), bbox_head=dict( type='opera.InsPoseHead', num_classes=1, # (only person) in_channels=256, stacked_convs=4, feat_channels=256, stacked_convs_kpt=4, feat_channels_kpt=512, stacked_convs_hm=3, feat_channels_hm=512, strides=[8, 16, 32, 64, 128], center_sampling=True, center_sample_radius=1.5, centerness_on_reg=True, regression_normalize=True, with_hm_loss=True, min_overlap_hm=0.9, min_hm_radius=0, max_hm_radius=3, min_overlap_kp=0.9, min_offset_radius=0, max_offset_radius=3, loss_cls=dict( type='mmdet.VarifocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.75, iou_weighted=True, loss_weight=1.0), loss_bbox=dict(type='mmdet.GIoULoss', loss_weight=1.0), loss_centerness=dict( type='mmdet.CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0), loss_hm=dict( type='mmdet.FocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.25, loss_weight=1.0), loss_weight_offset=1.0, unvisible_weight=0.1), test_cfg = dict( nms_pre=1000, score_thr=0.05, nms=dict(type='soft_nms', iou_threshold=0.3), mask_thresh=0.5, max_per_img=100)) # dataset settings dataset_type = 'opera.CocoPoseDataset' data_root = '/dataset/public/coco/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='mmdet.LoadImageFromFile', to_float32=True), dict(type='opera.LoadAnnotations', with_bbox=True, with_mask=True, with_keypoint=True), dict(type='opera.Resize', img_scale=[(1333, 800), (1333, 768), (1333, 736), (1333, 704), (1333, 672), (1333, 640)], multiscale_mode='value', keep_ratio=True), dict(type='opera.RandomFlip', flip_ratio=0.5), dict(type='mmdet.Normalize', **img_norm_cfg), dict(type='mmdet.Pad', size_divisor=32), dict(type='opera.DefaultFormatBundle'), dict(type='mmdet.Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks', 'gt_keypoints']), ] test_pipeline = [ dict(type='mmdet.LoadImageFromFile'), dict( type='mmdet.MultiScaleFlipAug', img_scale=(1333, 800), flip=False, transforms=[ dict(type='mmdet.Resize', keep_ratio=True), dict(type='mmdet.RandomFlip'), dict(type='mmdet.Normalize', **img_norm_cfg), dict(type='mmdet.Pad', size_divisor=32), dict(type='mmdet.ImageToTensor', keys=['img']), dict(type='mmdet.Collect', keys=['img']), ]) ] data = dict( samples_per_gpu=4, workers_per_gpu=2, train=dict( type=dataset_type, ann_file='/data/configs/inspose/person_keypoints_train2017_pesudobox.json', img_prefix=data_root + 'images/train2017/', pipeline=train_pipeline, skip_invaild_pose=False), val=dict( type=dataset_type, ann_file=data_root + 'annotations/person_keypoints_val2017.json', img_prefix=data_root + 'images/val2017/', pipeline=test_pipeline), test=dict( type=dataset_type, ann_file=data_root + 'annotations/person_keypoints_val2017.json', img_prefix=data_root + 'images/val2017/', pipeline=test_pipeline)) evaluation = dict(interval=1, metric='keypoints') # optimizer optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2)) # learning policy lr_config = dict( policy='step', warmup='linear', warmup_iters=2000, warmup_ratio=0.001, step=[27, 33]) runner = dict(type='EpochBasedRunner', max_epochs=36) checkpoint_config = dict(interval=1, max_keep_ckpts=3)
# -*- coding: utf-8 -*- """ meraki This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ). """ class ObjectTypeEnum(object): """Implementation of the 'objectType' enum. TODO: type enum description here. Attributes: PERSON: TODO: type description here. VEHICLE: TODO: type description here. """ PERSON = 'person' VEHICLE = 'vehicle'
# Задача 1. Вариант 38. # Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается Аврора Жюпен. После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода. # Kucheryavenko A. I. # 17.03.2016 print("Жорж Санд более известна, как французская писательница Амандина Аврора Люсиль Дюпен.") input("\n\nНажмите Enter для выхода.")
""" Define multi-algoritmic simulation errors. :Author: Arthur Goldberg <[email protected]> :Date: 2016-12-12 :Copyright: 2016-2018, Karr Lab :License: MIT """ class Error(Exception): """ Base class for exceptions involving multi-algoritmic simulation Attributes: message (:obj:`str`): the exception's message """ def __init__(self, message=None): super().__init__(message) class MultialgorithmError(Error): """ Exception raised for errors in package `wc_sim` Attributes: message (:obj:`str`): the exception's message """ def __init__(self, message=None): super().__init__(message) class DynamicMultialgorithmError(Error): """ Exception raised for errors in package `wc_sim` that occur during a simulation Attributes: time (:obj:`float`): the simulation time at which the error occurs message (:obj:`str`): the exception's message """ TIME_PRECISION = 5 def __init__(self, time, message=None): self.time = time super().__init__(f"{time:.{self.TIME_PRECISION}E}: {message}") class SpeciesPopulationError(Error): """ Exception raised when species population management encounters a problem Attributes: message (:obj:`str`): the exception's message """ def __init__(self, message=None): super().__init__(message) class DynamicSpeciesPopulationError(DynamicMultialgorithmError): """ Exception raised when species population management encounters a problem during a simulation Attributes: time (:obj:`float`): the simulation time at which the error occurs message (:obj:`str`): the exception's message """ def __init__(self, time, message=None): super().__init__(time, message) class DynamicFrozenSimulationError(DynamicMultialgorithmError): """ Exception raised by an SSA submodel when it is the only submodel and total propensities == 0 A simulation in this state cannot progress. Attributes: time (:obj:`float`): the simulation time at which the error occurs message (:obj:`str`): the exception's message """ def __init__(self, time, message=None): super().__init__(time, message) class DynamicNegativePopulationError(DynamicMultialgorithmError): """ Exception raised when a negative species population is predicted The sum of `last_population` and `population_decrease` equals the predicted negative population. Attributes: time (:obj:`float`): the simulation time at which the error occurs method (:obj:`str`): name of the method in which the exception occured species (:obj:`str`): name of the species whose population is predicted to be negative last_population (:obj:`float`): previous recorded population for the species population_decrease (:obj:`float`): change to the population which would make it negative delta_time (:obj:`float`, optional): if the species has been updated by a continuous submodel, time since the last continuous update """ def __init__(self, time, method, species, last_population, population_decrease, delta_time=None): self.method = method self.species = species self.last_population = last_population self.population_decrease = population_decrease self.delta_time = delta_time super().__init__(time, 'negative population predicted') def __eq__(self, other): """ Determine whether two instances have the same content """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other): return not self.__eq__(other) def __hash__(self): return hash((self.method, self.species, self.last_population, self.population_decrease, self.delta_time)) def __str__(self): """ Provide a readable `DynamicNegativePopulationError` which contains all its attributes Returns: :obj:`str`: a readable representation of this `DynamicNegativePopulationError` """ rv = "at {:g}: {}(): negative population predicted for '{}', with decline from {:g} to {:g}".format( self.time, self.method, self.species, self.last_population, self.last_population + self.population_decrease) if self.delta_time is None: return rv else: if self.delta_time == 1: return rv + " over 1 time unit" else: return rv + " over {:g} time units".format(self.delta_time) class MultialgorithmWarning(UserWarning): """ `wc_sim` multialgorithm warning """ pass
class Employee(): def __init__(self, first_name, last_name, money): self.first_name = first_name self.last_name = last_name self.money = money def give_raise(self, add_money=5000): self.money += add_money return self.money
#Shape of capital B: def for_B(): """printing capital 'B' using for loop""" for row in range(7): for col in range(5): if col==0 or row==0 and col!=4 or row==3 and col!=4 or row==6 and col!=4 or col==4 and row%3!=0: print("*",end=" ") else: print(" ",end=" ") print() for_B() def while_B(): """printing capital 'B' using while loop""" i=0 while i<7: j=0 while j<5: if j==0 or i==0 and j!=4 or i==3 and j!=4 or i==6 and j!=4 or j==4 and i%3!=0: print("*",end=" ") else: print(" ",end=" ") j+=1 print() i+=1 while_B()
def add(x,y): return x + y def multiply(x,y): return x * y def subtract(x,y): return x - y def divide(x,y): return y/x def power(x,y): return x**y
""" https://leetcode.com/problems/longest-increasing-subsequence/ Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Input: [10,9,2,5,3,7,101,18] Output: 4 Explanation: The longest increasing subsequence is [2,3,7,101], therefore the length is 4. Note: There may be more than one LIS combination, it is only necessary for you to return the length. Your algorithm should run in O(n2) complexity. Follow up: Could you improve it to O(n log n) time complexity? """ class Solution(object): def lengthOfLISDP(self, nums): """ This O(n^2) approach uses DP. Each index contains the longest increasing subsequence at that index. When evaluating each index, iterate through previous values. If a previous number is less than current number, increment the LIS value at the current index, if LIS value is greater than existing LIS value. At the end of iterating through each current index value, if the LIS value at the current index is greater than the max LIS, use it. :type nums: List[int] :rtype: int """ if len(nums) <= 1: return len(nums) values = [1] * len(nums) max_value = 1 for i in range(0, len(nums)): for j in range(0, i): if nums[j] < nums[i]: values[i] = max(values[i], values[j] + 1) max_value = max(max_value, values[i]) return max_value def lengthOfLIS(self, nums): """ Keep track of the smallest value in an array, where the index of the array corresponds to the size of the subsequence. So index 0 of the array represents the smallest value of all subsequences with a size of 1. Index 1 of the array would correspond to the smallest value of all subsequences with a size of 2. As one iterates over the numbers in the inputted array, if the number is greater than any of the smallest values in any of the subsequences, then add it to the array for the next greatest subsequence size. This basically means that an increasing subsequence exists with the updated size since a smaller increasing subsequence existed with a lesser value, and we're iterating through the numbers. To find if any of the smallest subsequence values match, binary search through smallest values in subsequences array. Since smallest sequences value array could be N long in worst case, and since need to search over the array N times, the total runtime is O(N * log N). :type nums: List[int] :rtype: int """ length_tail_min_values = [0] * len(nums) size = 0 for num in nums: start = 0 end = size while start != end: middle = int((start + end) / 2) if length_tail_min_values[middle] < num: start = middle + 1 else: end = middle length_tail_min_values[start] = num size = max(start + 1, size) return size
''' Created on 1.12.2016 @author: Darren '''''' Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. For example, Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6. The above elevation map is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped. Thanks Marcos for contributing this image!" ''' class Solution(object): def trap(self, height): """ :type height: List[int] :rtype: int """ l,r=0,len(height)-1 res=0 while l<r: min_height=min(height[l],height[r]) if min_height==height[l]: l+=1 while l<r and height[l]<min_height: res+=min_height-height[l] l+=1 else: r-=1 while l<r and height[r]<min_height: res+=min_height-height[r] r-=1 return res
## -*- coding: utf-8 -*- ## ## Sage Doctest File ## #**************************************# #* Generated from PreTeXt source *# #* on 2017-08-24T11:43:34-07:00 *# #* *# #* http://mathbook.pugetsound.edu *# #* *# #**************************************# ## """ Please contact Rob Beezer ([email protected]) with any test failures here that need to be changed as a result of changes accepted into Sage. You may edit/change this file in any sensible way, so that development work may procede. Your changes may later be replaced by the authors of "Abstract Algebra: Theory and Applications" when the text is updated, and a replacement of this file is proposed for review. """ ## ## To execute doctests in these files, run ## $ $SAGE_ROOT/sage -t <directory-of-these-files> ## or ## $ $SAGE_ROOT/sage -t <a-single-file> ## ## Replace -t by "-tp n" for parallel testing, ## "-tp 0" will use a sensible number of threads ## ## See: http://www.sagemath.org/doc/developer/doctesting.html ## or run $ $SAGE_ROOT/sage --advanced for brief help ## ## Generated at 2017-08-24T11:43:34-07:00 ## From "Abstract Algebra" ## At commit 26d3cac0b4047f4b8d6f737542be455606e2c4b4 ## ## Section 18.5 Sage ## r""" ~~~~~~~~~~~~~~~~~~~~~~ :: sage: Q = ZZ.fraction_field(); Q Rational Field ~~~~~~~~~~~~~~~~~~~~~~ :: sage: Q == QQ True ~~~~~~~~~~~~~~~~~~~~~~ :: sage: R.<x> = ZZ[] sage: P = R.fraction_field();P Fraction Field of Univariate Polynomial Ring in x over Integer Ring ~~~~~~~~~~~~~~~~~~~~~~ :: sage: f = P((x^2+3)/(7*x+4)) sage: g = P((4*x^2)/(3*x^2-5*x+4)) sage: h = P((-2*x^3+4*x^2+3)/(x^2+1)) sage: ((f+g)/h).numerator() 3*x^6 + 23*x^5 + 32*x^4 + 8*x^3 + 41*x^2 - 15*x + 12 ~~~~~~~~~~~~~~~~~~~~~~ :: sage: ((f+g)/h).denominator() -42*x^6 + 130*x^5 - 108*x^4 + 63*x^3 - 5*x^2 + 24*x + 48 ~~~~~~~~~~~~~~~~~~~~~~ :: sage: F.<c> = FiniteField(3^5) sage: F.characteristic() 3 ~~~~~~~~~~~~~~~~~~~~~~ :: sage: G = F.prime_subfield(); G Finite Field of size 3 ~~~~~~~~~~~~~~~~~~~~~~ :: sage: G.list() [0, 1, 2] ~~~~~~~~~~~~~~~~~~~~~~ :: sage: K.<y>=QuadraticField(-7); K Number Field in y with defining polynomial x^2 + 7 ~~~~~~~~~~~~~~~~~~~~~~ :: sage: K.prime_subfield() Rational Field ~~~~~~~~~~~~~~~~~~~~~~ :: sage: K.<x> = ZZ[sqrt(-3)]; K Order in Number Field in a with defining polynomial x^2 + 3 ~~~~~~~~~~~~~~~~~~~~~~ :: sage: K.is_integral_domain() True ~~~~~~~~~~~~~~~~~~~~~~ :: sage: K.basis() [1, a] ~~~~~~~~~~~~~~~~~~~~~~ :: sage: x a ~~~~~~~~~~~~~~~~~~~~~~ :: sage: (1+x)*(1-x) == 2*2 True ~~~~~~~~~~~~~~~~~~~~~~ :: sage: four = K(4) sage: four.is_unit() False ~~~~~~~~~~~~~~~~~~~~~~ :: sage: four^-1 1/4 ~~~~~~~~~~~~~~~~~~~~~~ :: sage: T.<x>=ZZ[] sage: T.is_integral_domain() True ~~~~~~~~~~~~~~~~~~~~~~ :: sage: J = T.ideal(5, x); J Ideal (5, x) of Univariate Polynomial Ring in x over Integer Ring ~~~~~~~~~~~~~~~~~~~~~~ :: sage: Q = T.quotient(J); Q Quotient of Univariate Polynomial Ring in x over Integer Ring by the ideal (5, x) ~~~~~~~~~~~~~~~~~~~~~~ :: sage: J.is_principal() Traceback (most recent call last): ... NotImplementedError ~~~~~~~~~~~~~~~~~~~~~~ :: sage: Q.is_field() Traceback (most recent call last): ... NotImplementedError """
# EclipseCon Europe Che Challenge # # This program prints the numbers from 1 to 100, with every multiple of 3 # replaced by "Fizz", and every multiple of 5 replaced by "Buzz". Numbers # divisible by both are replaced by "FizzBuzz". Otherwise, the program # prints the number. # # Your mission, if you choose to accept it, is to change this program so that, # in addition to the above, it prints "Fizz" for any number which includes a 3, # and prints "Buzz" for any number including a 5. After modification, for # example, the number 53 should be replaced by "FizzBuzz". # # Once you have completed the challenge, you will be entered into a draw for # one of the ChromeBooks at the Eclipse Che booth. for i in range(1, 101): num = "%s" % i; if (i % 3 == 0): num = "Fizz" if (i % 5 == 0): num = "Buzz" print (f"{num}");
class DataPacker: #list data type will only write out the values without the key @staticmethod def dataTypeList(): return "list" @staticmethod def dataTypeObject(): return "object" def __init__(self, type): self.type = type self.data = [] def add_pair(self, key, value): self.data.append([key, value]) def add_value(self, key, value): self.data.append(key, value) def to_string(self, coding): if self.type == self.dataTypeObject(): if coding == 'json': s = "{" for item in self.data: s += ' "' + item[0] + '": ' s += '"' + item[1] + '"\n' s += "}" else: for item in self.data: s += item[0].replace('=', '\\=') + '=' s += item[1] + '\n' if self.type == self.dataTypeList(): if coding == 'json': s = "[" for item in self.data: s += '"' + item[1] + '"\n' s += "]" else: for item in self.data: s += item[1] + '\n' return s
#! /usr/bin/python # Filename: object_init # Description: the constructor in python class Persion: def __init__(self, name): self.name = name def sayHi(self): print(self.name) test = Persion("Hello,world") test.sayHi()
arr = [-3, 4, 8, -2, -1, 5, 4, 8] for i in range(0, len(arr)-1): if(arr[i] > 0): #num is positive temp = arr[i] arr[i] = arr[i+1] arr[i+1] = temp print(arr)
class Rememberer: def __init__(self): self.funcs = [] def register(self, fn): self.funcs.append(fn) fn.__conform__ = lambda new: self.recode(fn, new) return self def recode(self, fn, new): if new is None: self.funcs.remove(fn) else: fn.__code__ = new.__code__ def __call__(self, *args): return [fn(*args) for fn in self.funcs] activities = Rememberer() @activities.register def do(x): return f"Paint {x} canvasses" @activities.register def do(x): return f"Sing {x} songs" @activities.register def do(x): return f"Worship the {x} suns" @activities.register def do(x): return f"Dance for {x} hours" @activities.register def do(x): return f"Do {x} push-ups"
# coding=utf-8 """ 백준 16953번 : A -> B """ A, B = map(int, input().split()) count = 0 while A < B: string = str(B) if str(B)[-1] == '1': B = int(string[:len(string)-1]) count += 1 else: if B % 2 == 0: B = B // 2 count += 1 else: break if A == B: print(count + 1) else: print(-1)
# Fibonacci maxi = int(input("Insira até que numero deve ser calculado a sequencia de Fibonacci: ")) a = 0 b = 1 c = 0 while c < maxi: c = a + b print(c) a = b b = c
""" categories: Core,Functions description: Assign instance variable to function cause: Unknown workaround: Unknown """ def f(): pass f.x = 0 print(f.x)
# СОРТИРОВКА ПУЗЫРЬКОМ nums = [2,5,1,8,7,3,4,6,9] print(nums) for i in range(len(nums)): for j in range(len(nums)-i-1): if nums[j] > nums[j+1]: nums[j], nums[j+1] = nums[j+1], nums[j] print(nums)
# Create a program that reads an integer and shows on the screen whether it is even or odd n = int(input('Type a integer: ')) if n % 2 == 0: print('The number {} is {} EVEN {}'.format(n, '\033[1;31;40m', '\033[m')) else: print('The number {} is {} ODD {}'.format(n, '\033[7;30m', '\033[m'))
# @Time : 2019/4/24 23:22 # @Author : shakespere # @FileName: 3Sum.py ''' 15. 3Sum Medium Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain duplicate triplets. Example: Given array nums = [-1, 0, 1, 2, -1, -4], A solution set is: [ [-1, 0, 1], [-1, -1, 2] ] ''' class Solution(object): def threeSum(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ nums.sort() res = [] for i in range(len(nums) - 2): if i == 0 or nums[i] > nums[i - 1]: left = i + 1 right = len(nums) - 1 while left < right: if nums[left] + nums[right] == -nums[i]: res.append([nums[i], nums[left], nums[right]]) left += 1 right -= 1 while left < right and nums[left] == nums[left - 1]: left += 1 while left < right and nums[right] == nums[right + 1]: right -= 1 elif nums[left] + nums[right] < -nums[i]: while left < right: left += 1 if nums[left] > nums[left - 1]: break else: while left < right: right -= 1 if nums[right] < nums[right + 1]: break return res
# -*- coding: utf-8 -*- # # Copyright © 2009-2010 CEA # Pierre Raybaut # Licensed under the terms of the CECILL License # (see guiqwt/__init__.py for details) """ guiqwt.signals -------------- In `guiqwt` version 2, the `signals` module used to contain constants defining the custom Qt SIGNAL objects used by `guiqwt`: the signals definition were gathered here to avoid misspelling signals at connect and emit sites (with old-style signals, any misspelled signal string would have lead to a silent failure of signal emission or connection). Since version 3, to ensure PyQt5 compatibility, `guiqwt` is using only new-style signals and slots. However, all signals are summarized below, in order to facilitate migration from `guiqwt` v2 to `guiqwt` v3. Signals available: :py:data:`guiqwt.baseplot.BasePlot.SIG_ITEM_MOVED` Emitted by plot when an IBasePlotItem-like object was moved from (x0, y0) to (x1, y1) Arguments: item object, x0, y0, x1, y1 :py:data:`guiqwt.baseplot.BasePlot.SIG_MARKER_CHANGED` Emitted by plot when a `guiqwt.shapes.Marker` position changes Arguments: `guiqwt.shapes.Marker` object :py:data:`guiqwt.baseplot.BasePlot.SIG_AXES_CHANGED` Emitted by plot when a `guiqwt.shapes.Axes` position (or angle) changes Arguments: `guiqwt.shapes.Axes` object :py:data:`guiqwt.baseplot.BasePlot.SIG_ANNOTATION_CHANGED` Emitted by plot when an annotations.AnnotatedShape position changes Arguments: annotation item :py:data:`guiqwt.baseplot.BasePlot.SIG_RANGE_CHANGED` Emitted by plot when a shapes.XRangeSelection range changes Arguments: range object, lower_bound, upper_bound :py:data:`guiqwt.baseplot.BasePlot.SIG_ITEMS_CHANGED` Emitted by plot when item list has changed (item removed, added, ...) Arguments: plot :py:data:`guiqwt.baseplot.BasePlot.SIG_ACTIVE_ITEM_CHANGED` Emitted by plot when selected item has changed Arguments: plot :py:data:`guiqwt.baseplot.BasePlot.SIG_ITEM_REMOVED` Emitted by plot when an item was deleted from the itemlist or using the delete item tool Arguments: removed item :py:data:`guiqwt.baseplot.BasePlot.SIG_ITEM_SELECTION_CHANGED` Emitted by plot when an item is selected Arguments: plot :py:data:`guiqwt.baseplot.BasePlot.SIG_PLOT_LABELS_CHANGED` Emitted (by plot) when plot's title or any axis label has changed Arguments: plot :py:data:`guiqwt.baseplot.BasePlot.SIG_AXIS_DIRECTION_CHANGED` Emitted (by plot) when any plot axis direction has changed Arguments: plot :py:data:`guiqwt.histogram.LevelsHistogram.SIG_VOI_CHANGED` Emitted by "contrast" panel's histogram when the lut range of some items changed (for now, this signal is for guiqwt.histogram module's internal use only - the 'public' counterpart of this signal is SIG_LUT_CHANGED, see below) :py:data:`guiqwt.baseplot.BasePlot.SIG_LUT_CHANGED` Emitted by plot when LUT has been changed by the user Arguments: plot :py:data:`guiqwt.baseplot.BasePlot.SIG_MASK_CHANGED` Emitted by plot when image mask has changed Arguments: MaskedImageItem object :py:data:`guiqwt.baseplot.BasePlot.SIG_CS_CURVE_CHANGED` Emitted by cross section plot when cross section curve data has changed Arguments: plot :py:data:`guiqwt.panels.PanelWidget.SIG_VISIBILITY_CHANGED` Emitted for example by panels when their visibility has changed Arguments: state (boolean) :py:data:`guiqwt.tools.InteractiveTool.SIG_VALIDATE_TOOL` Emitted by an interactive tool to notify that the tool has just been "validated", i.e. <ENTER>, <RETURN> or <SPACE> was pressed Arguments: filter :py:data:`guiqwt.tools.InteractiveTool.SIG_TOOL_JOB_FINISHED` Emitted by an interactive tool to notify that it is finished doing its job :py:data:`guiqwt.tools.OpenFileTool.SIG_OPEN_FILE` Emitted by an open file tool :py:data:`guiqwt.tools.ImageMaskTool.SIG_APPLIED_MASK_TOOL` Emitted by the ImageMaskTool when applying the shape-defined mask """
# 5. Ваканция # Напишете програма, която спрямо даден бюджет и сезон да пресмята цената, локацията и мястото на настаняване за ваканция. # Сезоните са лято и зима – "Summer" и "Winter". Локациите са – "Alaska" и "Morocco". Възможните места за настаняване # – "Hotel", "Hut" или "Camp". # • При бюджет по-малък или равен от 1000лв.: # o Настаняване в "Camp" # o Според сезона локацията ще е една от следните и ще струва определен процент от бюджета: #  Лято – Аляска – 65% от бюджета #  Зима – Мароко – 45% от бюджета # • При бюджет по-голям от 1000лв. и по-малък или равен от 3000лв.: # o Настаняване в "Hut" # o Според сезона локацията ще е една от следните и ще струва определен процент от бюджета: #  Лято – Аляска – 80% от бюджета #  Зима – Мароко – 60% от бюджета # • При бюджет по-голям от 3000лв.: # o Настаняване в "Hotel" # o Според сезона локацията ще е една от следните и ще струва 90% от бюджета: #  Лято – Аляска #  Зима – Мароко budget = float(input()) season = input() if budget <= 1000: accommodation_type = 'Camp' if season == 'Summer': location = 'Alaska' price = 0.65 * budget elif season == 'Winter': location = 'Morocco' price = 0.45 * budget elif 1000 < budget <= 3000: accommodation_type = 'Hut' if season == 'Summer': location = 'Alaska' price = 0.8 * budget elif season == 'Winter': location = 'Morocco' price = 0.6 * budget elif budget > 3000: accommodation_type = 'Hotel' price = 0.9 * budget if season == 'Summer': location = 'Alaska' elif season == 'Winter': location = 'Morocco' print(f'{location} - {accommodation_type} - {price:.2f}')
# Handshake # Count the number of Handshakes in a board meeting. # # https://www.hackerrank.com/challenges/handshake/problem # T = int(input()) for a0 in range(T): N = int(input()) print(N * (N - 1) // 2)
inicial = int(input('Qual o numero inicial?')) final = int(input('Qual o numero final?')) x = inicial while( x <= final): if(x % 2 == 0): print(x) x = x + 1
#!/usr/bin/env python3 # Everything in Python are objects. # This means that everything that's created is an # instance on a pre-defined class, or a self-defined class. # These instances are in memory (hence named objects), and # has access to the functions defined in the original classes # and is called methods. # 1. Creating a name in the namespace # This example shows creating a variable. # Know that this variable `name` is created as an instance # of the str() class. name = "Rob" print(type(name)) print(dir(name)) # 2. Creating a custom class class Animal: """Animal Class""" def __init__(self): """Constructor for Animal Class""" pass def print_name(self, name): print("{} is an Animal".format(name)) # Creating an instance out of Animal class my_animal = Animal() my_animal.print_name("Deer") # 3. self # `self` is a contruct which refers to the instance # of the class itself. class Vehicle: """Vehicle class""" def __init__(self, color, doors, tires, vtype): self.color = color self.doors = doors self.tires = tires self.vtype = vtype def brake(self): return "{} braking".format(self.vtype) def drive(self): return "I am driving a {0} {1}".format(self.color, self.vtype) if __name__ == "__main__": car = Vehicle("Blue", 5, 4, "car") print(car.brake()) print(car.drive()) truck = Vehicle("Red", 3, 6, "truck") print(truck.drive()) print(truck.brake())
def print_header(cadena_texto): print("Hola ", cadena_texto) nombre = input("¿Cuál es tu nombre? ") print_header(nombre)
def main_screen(calendar): while True: print("What would you like to do? ") print("\ta) Add event") print("\tb) Delete event") print("\tc) Print events") print("\td) Exit") answer = input(" $ ") if "a" in answer: add_event(calendar) elif "b" in answer: delete_event(calendar) elif "c" in answer: print_events(calendar) elif "d" in answer: break else: pass def add_event(calendar): print("What is the name of the event that you would like to add?") name = input(" $ ") print("When does your event start? FORMAT: dd/mm/yyyy hh:mm:ss") start_time = input(" $ ") print("When does your event end? FORMAT: dd/mm/yyyy hh:mm:ss") end_time = input(" $ ") try: calendar.add_event(name, start_time, end_time) except ValueError: print("Check your inputs, they don't seem to be in the right format.") def delete_event(calendar): calendar.print_events() print("What is the ID of the event(s) you would like to delete? Separate ids with ,.") event_ids = input(" $ ") event_ids = event_ids.split(",") calendar.delete_event(event_ids) def print_events(calendar): calendar.print_events()
def levenshtein_Distance(word1,word2): word1="#"+word1 wordTmp="#"+word2 letters1 = list(word1) letters2 = list(wordTmp) # Initializing table table = [ [0 for i in range(len(word1))] for j in range(len(wordTmp))] for i in range (len(word1)): table[0][i] = i for j in range (len(wordTmp)): table[j][0] = j for i in range (1,len(word1)): for j in range (1,len(wordTmp)): tmpList=[] x = table[j][i-1]+1 tmpList.append(x) y = table[j-1][i]+1 tmpList.append(y) if letters1[i] == letters2[j]: z = table[j-1][i-1] else: z = table[j-1][i-1]+2 tmpList.append(z) table[j][i] =min(tmpList) return table[-1][-1],word2
# # PySNMP MIB module ACMEPACKET-PRODUCTS (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ACMEPACKET-PRODUCTS # Produced by pysmi-0.3.4 at Mon Apr 29 16:57:56 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) # acmepacket, = mibBuilder.importSymbols("ACMEPACKET-SMI", "acmepacket") Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Counter32, Gauge32, iso, Integer32, Counter64, Unsigned32, ObjectIdentity, IpAddress, TimeTicks, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, ModuleIdentity, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Gauge32", "iso", "Integer32", "Counter64", "Unsigned32", "ObjectIdentity", "IpAddress", "TimeTicks", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "ModuleIdentity", "Bits") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") acmepacketProducts = ModuleIdentity((1, 3, 6, 1, 4, 1, 9148, 1)) acmepacketProducts.setRevisions(('2012-07-16 00:00', '2007-04-03 15:00',)) if mibBuilder.loadTexts: acmepacketProducts.setLastUpdated('201207160000Z') if mibBuilder.loadTexts: acmepacketProducts.setOrganization('Acme Packet, Inc.') apNetNet4000Series = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 1)) if mibBuilder.loadTexts: apNetNet4000Series.setStatus('current') apNetNet4250 = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 1, 1)) if mibBuilder.loadTexts: apNetNet4250.setStatus('current') apNetNet4500 = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 1, 2)) if mibBuilder.loadTexts: apNetNet4500.setStatus('current') apNetNet9000Series = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 2)) if mibBuilder.loadTexts: apNetNet9000Series.setStatus('current') apNetNet9200 = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 2, 1)) if mibBuilder.loadTexts: apNetNet9200.setStatus('current') apNetNet3000Series = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 3)) if mibBuilder.loadTexts: apNetNet3000Series.setStatus('current') apNetNet3800 = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 3, 1)) if mibBuilder.loadTexts: apNetNet3800.setStatus('current') apNetNet3820 = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 3, 2)) if mibBuilder.loadTexts: apNetNet3820.setStatus('current') apNetNetOSSeries = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 4)) if mibBuilder.loadTexts: apNetNetOSSeries.setStatus('current') apNetNetOS = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 4, 1)) if mibBuilder.loadTexts: apNetNetOS.setStatus('current') apNetNetOSVM = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 4, 2)) if mibBuilder.loadTexts: apNetNetOSVM.setStatus('current') apNetNet6000Series = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 5)) if mibBuilder.loadTexts: apNetNet6000Series.setStatus('current') apNetNet6300 = ObjectIdentity((1, 3, 6, 1, 4, 1, 9148, 1, 5, 1)) if mibBuilder.loadTexts: apNetNet6300.setStatus('current') mibBuilder.exportSymbols("ACMEPACKET-PRODUCTS", apNetNet9000Series=apNetNet9000Series, apNetNet3820=apNetNet3820, apNetNet4500=apNetNet4500, apNetNet3000Series=apNetNet3000Series, apNetNet4250=apNetNet4250, apNetNetOSVM=apNetNetOSVM, PYSNMP_MODULE_ID=acmepacketProducts, apNetNet4000Series=apNetNet4000Series, apNetNet6000Series=apNetNet6000Series, apNetNet9200=apNetNet9200, acmepacketProducts=acmepacketProducts, apNetNetOS=apNetNetOS, apNetNet6300=apNetNet6300, apNetNet3800=apNetNet3800, apNetNetOSSeries=apNetNetOSSeries)
# Feature flag to raise an exception in case of a non existing device feature. # The flag should be fully removed in a later release. # It allows dependend libraries to gracefully migrate to the new behaviour raise_exception_on_not_supported_device_feature = True # Feature flag to raise exception if rate limit of the API is hit raise_exception_on_rate_limit = True # Feature flag to raise exception on command calls if the API does not return (2xx or 3xx) responses. raise_exception_on_command_failure = True
class Solution: def countOdds(self, low: int, high: int) -> int: c = high - low + 1 if c % 2 == 1 and low % 2 == 1: r = 1 else: r = 0 return r + c // 2
class Solution: def reverseWords(self, s: str) -> str: res, blank = '', False for _ in s[::-1]: res += _ return ' '.join(res.split()[::-1])
# ----------------------------------------------------------------------------- # Copyright * 2014, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. All # rights reserved. # # The Crisis Mapping Toolkit (CMT) v1 platform is 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. # ----------------------------------------------------------------------------- # this file stores variously previously learned Adaboost classifiers modis_classifiers = dict() radar_classifiers = dict() # default classifier, learned from ['unflooded_mississippi_2010.xml', 'unflooded_new_orleans_2004.xml', 'sf_bay_area_2011_4.xml', 'unflooded_bosnia_2013.xml'] modis_classifiers['default'] = [(u'dartmouth', 0.30887438055782945, 1.4558371112080295), (u'b2', 2020.1975382568198, 0.9880130793929531), (u'MNDWI', 0.3677501330908955, 0.5140443440746121), (u'b2', 1430.1463073852296, 0.15367606716883875), (u'b1', 1108.5241042345276, 0.13193086117959033), (u'dartmouth', 0.7819758531686796, -0.13210548296374583), (u'dartmouth', 0.604427824270283, 0.12627962195951867), (u'b2', 1725.1719228210247, -0.07293616881105353), (u'b2', 1872.6847305389224, -0.09329031467870501), (u'b2', 1577.659115103127, 0.1182474134065663), (u'b2', 1946.441134397871, -0.13595282841411163), (u'b2', 2610.24876912841, 0.10010381165310277), (u'b2', 1983.3193363273454, -0.0934455057392682), (u'b2', 1503.9027112441784, 0.13483194249576771), (u'b2', 2001.7584372920826, -0.10099203054937314), (u'b2', 2905.2743845642053, 0.1135686859467779), (u'dartmouth', 0.5156538098210846, 0.07527677772747364), (u'b2', 2010.9779877744513, -0.09535260187161688), (u'b2', 1798.9283266799735, 0.07889358547222977), (u'dartmouth', 0.36787708796485785, -0.07370319016383906), (u'MNDWI', -0.6422574132273133, 0.06922934793487515), (u'dartmouth', 0.33837573426134365, -0.10266747186797487), (u'dartmouth', 0.4712668025964854, 0.09612545197834421), (u'dartmouth', 0.3236250574095866, -0.10754218805531587), (u'MNDWI', -0.48248013602276113, 0.111365639029263), (u'dartmouth', 0.316249718983708, -0.10620217821842894), (u'dartmouth', 0.4490732989841858, 0.09743861137429623), (u'dartmouth', 0.31256204977076874, -0.08121162639185005), (u'MNDWI', -0.5623687746250372, 0.10344420165347998), (u'dartmouth', 0.3107182151642991, -0.08899821447581886), (u'LSWI', -0.29661326544921773, 0.08652882218688322), (u'dartmouth', 0.3097962978610643, -0.07503568257204306), (u'MNDWI', 0.022523637136343283, 0.08765150582301148), (u'b2', 2015.5877630156356, -0.06978548014829108), (u'b2', 3052.7871922821028, 0.08567389991115743), (u'LSWI', -0.19275063787434812, 0.08357667312445341), (u'dartmouth', 0.3093353392094469, -0.08053950648462435), (u'LSWI', -0.14081932408691333, 0.07186342090261867), (u'dartmouth', 0.30910485988363817, -0.05720223719278896), (u'MNDWI', 0.19513688511361937, 0.07282637257701345), (u'NDWI', -0.361068160450533, 0.06565995208358431), (u'NDWI', -0.2074005503754442, -0.0522715989389411), (u'b1', 775.4361563517915, 0.05066415016422507), (u'b2', 2017.8926506362277, -0.0596357907686033), (u'b2', 1762.050124750499, 0.06600172638129476), (u'b2', 2019.0450944465238, -0.05498763067596745), (u'b1', 941.9801302931596, 0.06500771792028737), (u'dartmouth', 0.24987167315080105, 0.06409775979747406), (u'b2', 2979.0307884231543, 0.06178896578945445), (u'dartmouth', 0.22037031944728686, 0.04708770942378687), (u'dartmouth', 0.30898962022073384, -0.06357932266591948), (u'EVI', -0.13991172174597732, 0.061167901067941045), (u'dartmouth', 0.30893200038928165, -0.047538992866687814), (u'dartmouth', 0.23512099629904396, 0.055800430467148325), (u'dartmouth', 0.3089031904735555, -0.04993911823852714), (u'dartmouth', 0.22774565787316542, 0.045917043382747345), (u'b1', 232.32231270358304, -0.04624672841408699), (u'LSWIminusEVI', -1.3902019910129537, 0.044122210356250594), (u'fai', 914.8719936250361, 0.04696283008449494), (u'b2', 2019.6213163516718, -0.051114386132496435), (u'b2', 2315.2231536926147, 0.048898662215419296), (u'fai', 1434.706585047812, -0.05352547959475242), (u'diff', -544.4250000000001, -0.04459039609050114), (u'dartmouth', 0.39737844166837205, 0.045452678171318414), (u'dartmouth', 0.3088887855156925, -0.03891014191130265), (u'dartmouth', 0.22405798866022614, 0.042128457713671935), (u'diff', -777.2958333333333, -0.03902784979889064), (u'dartmouth', 0.2222141540537565, 0.03788131334473313), (u'dartmouth', 0.30888158303676094, -0.037208213701295255), (u'dartmouth', 0.3531264111131007, 0.0375648736301961), (u'dartmouth', 0.3088779817972952, -0.03427856593613819), (u'LSWI', -0.16678498098063071, 0.03430983541990538), (u'fai', -425.5957838307736, -0.03348006551810443), (u'NDWI', -0.13056674533789978, -0.03552899660957818), (u'b2', 2019.3332053990978, -0.0344936369203531), (u'b2', 1835.806528609448, 0.03856210900250611), (u'b2', 1467.0245093147041, -0.0345449746977328), (u'fai', 395.0374022022602, 0.031130251540884356), (u'fai', 654.9546979136481, 0.04214466417320743), (u'b2', 1448.5854083499669, -0.05667775728680656), (u'fai', 135.12010649087222, 0.03948338203848539), (u'dartmouth', 0.493460306208785, -0.045802615250103394), (u'fai', 784.9133457693422, 0.03128133499873274), (u'fai', 1174.7892893364242, -0.04413487095880613), (u'b2', 3015.9089903526283, 0.04133685218791008), (u'fai', 1304.7479371921181, -0.04107557606064173), (u'b2', 2462.7359614105126, 0.03777625735990945), (u'fai', 1369.727261119965, -0.03524600268462714), (u'b2', 2997.4698893878913, 0.03864830537283341), (u'dartmouth', 0.22313607135699132, 0.0348041704038284), (u'fai', -575.9950811359025, -0.036345846940478974), (u'fai', 1402.2169230838886, -0.03481517966048645), (u'fai', 719.9340218414952, 0.032833655233338276), (u'b2', 2019.1891499228109, -0.03272953788499046), (u'b2', 2388.9795575515636, 0.03713369823962704), (u'b2', 2019.1171221846673, -0.027949075715791222), (u'b2', 1743.611023785762, 0.03310357200312585), (u'LSWIminusNDVI', -0.3990346417915731, 0.029045726328998267), (u'NDWI', -0.16898364785667197, -0.025735337614573982), (u'dartmouth', 0.3088761811775623, -0.02973898070330325)] ## Trained only on Mississippi MODIS x 30 #classifier = [(u'dartmouth', 0.4601187028446295, 1.3933244326017509), (u'b2', 2354.099683544304, 0.8009263433881945), (u'LSWIminusNDVI', -0.37403464179157314, -0.19660698864485893), (u'b2', 997.0490506329114, -0.22609471240379023), (u'LSWI', 0.7307270024497643, -0.19371590131103372), (u'b2', 2862.799841772152, 0.1958087739665682), (u'LSWI', 0.6519079187081369, -0.10411467161095657), (u'b2', 827.2238924050632, -0.1627002183497957), (u'LSWI', 0.6124983768373232, -0.1164763151056205), (u'b2', 3117.149920886076, 0.14045495336435712), (u'dartmouth', 0.8979830751809463, -0.12738474810727388), (u'b2', 1845.3995253164558, 0.09053474497663075), (u'LSWIminusNDVI', -0.4337695820901687, 0.0857764518831651), (u'dartmouth', 1.4135180226982098, 0.07075600803587892), (u'LSWIminusNDVI', 0.7774358230593219, -0.11418946709797562), (u'dartmouth', 1.3146504355818416, 0.10739211371940653), (u'dartmouth', 1.0568829618232098, -0.11015352163127118), (u'b2', 2989.974881329114, 0.08685181198332771), (u'LSWI', 0.8095460861913917, -0.08786494584616246), (u'b2', 912.1364715189873, -0.10303455995441295), (u'MNDWI', -0.29396969047077653, 0.07596098140939918), (u'dartmouth', 1.3640842291400257, 0.09266573131480345), (u'LSWI', 0.8489556280622054, -0.0783584759736119), (u'NDVI', 0.7748969641121193, 0.07406876644625034), (u'dartmouth', 0.9774330185020781, -0.08325113592851094), (u'dartmouth', 0.739083188538683, 0.07799308375292567), (u'dartmouth', 0.9377080468415122, -0.07468962616015257), (u'b2', 3053.562401107595, 0.08334191996627335), (u'LSWI', 0.8686603989976123, -0.05795058684040472), (u'b2', 954.5927610759493, -0.0764128019856413)] # Trained only on Bosnia data set # 30 #classifier = [(u'fai', -105.57184246833049, 2.011175093865707), (u'diff', 1251.7560240963855, 0.8824534628772853), (u'LSWI', -0.1950396228838406, -0.34104836216017687), (u'MNDWI', 0.3156758628856189, 0.3971974262249763), (u'diff', 1652.1280120481929, 0.2301851751240506), (u'fai', 21.356797943057927, -0.25320140980424466), (u'ratio', 8.124320652173912, -0.27487135740578195), (u'MNDWI', 0.4338371139090058, 0.23183008491145138), (u'fai', -42.10752226263628, -0.2838952387654039), (u'ratio', 9.051290760869565, -0.18060837756218376), (u'MNDWI', 0.4929177394206993, 0.26151319350647706), (u'dartmouth', 0.7715202347815262, -0.19603377110432904), (u'MNDWI', 0.46337742666485254, 0.16945766306122212), (u'ratio', 9.51477581521739, -0.19326781484568353), (u'fai', -73.83968236548338, -0.1914520350524376), (u'dartmouth', 0.8985318397001062, 0.1320588534810869), (u'ratio', 9.746518342391305, -0.19297983361086213), (u'dartmouth', 0.9620376421593961, 0.138279854734148), (u'dartmouth', 0.8350260372408163, -0.11171574068467803), (u'fai', 84.82111814875213, 0.10168445603729025), (u'fai', -89.70576241690694, -0.14899335489218352), (u'NDVI', 0.7246944616336632, -0.12905505976725612), (u'MNDWI', 0.5224580521765461, 0.13393714338762214), (u'MNDWI', -0.09581370874173237, 0.0971904083985509), (u'fai', -97.63880244261871, -0.12420188150947246), (u'fai', 116.55327825159924, 0.1379596068377162), (u'fai', -101.6053224554746, -0.13973920004492527), (u'ratio', 9.862389605978262, -0.13788473854143857), (u'dartmouth', 0.9302847409297512, 0.12752031805931177), (u'dartmouth', 0.8032731360111712, -0.12615703892605462)] # 100 #classifier = [(u'fai', -105.57184246833049, 2.011175093865707), (u'diff', 1251.7560240963855, 0.8824534628772853), (u'LSWI', -0.1950396228838406, -0.34104836216017687), (u'MNDWI', 0.3156758628856189, 0.3971974262249763), (u'diff', 1652.1280120481929, 0.2301851751240506), (u'fai', 21.356797943057927, -0.25320140980424466), (u'ratio', 8.124320652173912, -0.27487135740578195), (u'MNDWI', 0.4338371139090058, 0.23183008491145138), (u'fai', -42.10752226263628, -0.2838952387654039), (u'ratio', 9.051290760869565, -0.18060837756218376), (u'MNDWI', 0.4929177394206993, 0.26151319350647706), (u'dartmouth', 0.7715202347815262, -0.19603377110432904), (u'MNDWI', 0.46337742666485254, 0.16945766306122212), (u'ratio', 9.51477581521739, -0.19326781484568353), (u'fai', -73.83968236548338, -0.1914520350524376), (u'dartmouth', 0.8985318397001062, 0.1320588534810869), (u'ratio', 9.746518342391305, -0.19297983361086213), (u'dartmouth', 0.9620376421593961, 0.138279854734148), (u'dartmouth', 0.8350260372408163, -0.11171574068467803), (u'fai', 84.82111814875213, 0.10168445603729025), (u'fai', -89.70576241690694, -0.14899335489218352), (u'NDVI', 0.7246944616336632, -0.12905505976725612), (u'MNDWI', 0.5224580521765461, 0.13393714338762214), (u'MNDWI', -0.09581370874173237, 0.0971904083985509), (u'fai', -97.63880244261871, -0.12420188150947246), (u'fai', 116.55327825159924, 0.1379596068377162), (u'fai', -101.6053224554746, -0.13973920004492527), (u'ratio', 9.862389605978262, -0.13788473854143857), (u'dartmouth', 0.9302847409297512, 0.12752031805931177), (u'dartmouth', 0.8032731360111712, -0.12615703892605462), (u'fai', 53.08895804590503, 0.11280108368230035), (u'fai', -103.58858246190255, -0.1323621639708806), (u'fai', 68.95503809732858, 0.11111732544776452), (u'fai', -104.58021246511652, -0.09561460982792948), (u'ratio', 9.920325237771738, -0.11350588718525503), (u'MNDWI', 0.5372282085544694, 0.12457806680434337), (u'ratio', 9.949293053668477, -0.10142947278348549), (u'b1', 1024.4102564102564, 0.12769119462941034), (u'LSWIminusEVI', 1.2275397718573775, -0.10736324339508174), (u'b2', 3027.5, 0.11335627686056896), (u'LSWIminusEVI', 0.9969081432144813, -0.09855102339735189), (u'b2', 2856.25, 0.12341099685812779), (u'LSWIminusEVI', 1.1122239575359294, -0.09888830150850089), (u'fai', -105.0760274667235, -0.10867185036244718), (u'LSWI', -0.22884831003114736, 0.09390617010433257), (u'b1', 855.3653846153845, 0.09224267581066231), (u'dartmouth', 0.7873966853963488, -0.08654968485638263), (u'MNDWI', 0.5076878957986226, 0.08281065550953068), (u'LSWIminusEVI', 1.0545660503752052, -0.10070544168373859), (u'b1', 939.8878205128204, 0.09546509230524551), (u'LSWIminusEVI', 1.0257370967948432, -0.07512157753132792), (u'dartmouth', 0.9144082903149287, 0.08334614008782373), (u'MNDWI', 0.37475648839731235, -0.09347621062767539), (u'EVI', -0.5354007283235324, 0.07174011237019035), (u'MNDWI', 0.5298431303655078, 0.09325407788460913), (u'LSWIminusEVI', 1.011322620004662, -0.07094468512780058), (u'fai', -105.323934967527, -0.08699012823035202), (u'fai', 37.22287799448148, 0.0825373235212839), (u'dartmouth', 0.7794584600889375, -0.07138166975482693), (u'dartmouth', 0.8667789384704612, 0.07712045798967725), (u'dartmouth', 0.7754893474352318, -0.06762386155357324), (u'dartmouth', 0.6445086298629463, 0.07866161620559303), (u'fai', -105.44788871792875, -0.06872185637143167), (u'LSWI', -0.21194396645749397, 0.07899481836422567), (u'b1', 982.1490384615383, 0.067325499150263), (u'dartmouth', 0.773504791108379, -0.06463211254050916), (u'dartmouth', 0.5810028274036563, 0.07334871420010625), (u'b1', 770.8429487179487, -0.059061001597415036), (u'fai', -105.50986559312962, -0.0589202777929247), (u'EVI', -0.7131758497107877, 0.07543805485058235), (u'b2', 2941.875, 0.0769994468975548), (u'ratio', 9.934809145720108, -0.06559718164524614), (u'MNDWI', 0.5150729739875843, 0.0716339467915095), (u'dartmouth', 0.7725125129449526, -0.051293672818369905), (u'LSWI', -0.2034917946706673, 0.05938789552971963), (u'b1', 961.0184294871794, 0.07318340098162476), (u'b1', 813.1041666666666, -0.06572293073399683), (u'fai', 735.022130941929, 0.060554277275912824), (u'fai', 1028.3904772356705, -0.05029509963366562), (u'dartmouth', 0.9223465156223399, 0.0603999613021688), (u'ratio', 9.927567191745922, -0.059891901340974205), (u'fai', -105.54085403073006, -0.07731554985749788), (u'EVI', -0.62428828901716, 0.06719923296302845), (u'b1', 950.453125, 0.07579445528659902), (u'LSWIminusEVI', 1.0041153816095716, -0.056489892194208524), (u'MNDWI', 0.5113804348931035, 0.05913619958443161), (u'MNDWI', 0.4042968011531591, -0.05075066212771365), (u'diff', 44.518072289156635, 0.04720084087401721), (u'fai', -105.55634824953027, -0.05663241244401389), (u'diff', 247.76506024096386, 0.0590397873216613), (u'b2', 2899.0625, 0.05140907548559329), (u'NDVI', 0.678130801361386, -0.05420275867925114), (u'fai', -105.56409535893039, -0.0578072448545363), (u'NDVI', 0.6548489712252474, -0.07016682881460558), (u'dartmouth', 0.9183774029686342, 0.07612486244144435), (u'NDVI', 0.6664898862933167, -0.06024946186606819), (u'MNDWI', 0.544613286743431, 0.07203803995934993), (u'NDVI', 0.660669428759282, -0.055733385225458454), (u'b2', 2877.65625, 0.05993217671898275), (u'b1', 834.2347756410256, -0.05155918752640494)] # New Orleans 30 #classifier = [(u'b2', 396.6109850939728, 1.4807909625958868), (u'b2', 1768.9536616979908, 0.8924003455619385), (u'b1', 854.8195364238411, 0.40691523803721014), (u'MNDWI', 0.3892345080908955, 0.36259940088550857), (u'dartmouth', 0.30135484930782946, -0.14337027100064728), (u'NDWI', -0.08016322692474476, -0.15831813233382272), (u'b2', 2281.2268308489956, 0.1353187435748396), (u'dartmouth', 0.7479193288987777, -0.16003727715630708), (u'b2', 2537.363415424498, 0.14061137727842032), (u'ratio', 6.880495612552257, -0.1166499595177218), (u'dartmouth', 0.3565977910898579, -0.11078288758401122), (u'NDWI', -0.2159195980788689, -0.10724023529180131), (u'dartmouth', 0.3289763201988437, -0.10755196279513543), (u'LSWI', -0.0569956547430914, 0.13659163207872768), (u'ratio', 3.9894934188283853, -0.10611849585590673), (u'b2', 2665.4317077122487, 0.14308264148123284), (u'ratio', 5.434994515690321, -0.0863607116606289), (u'b2', 2729.4658538561243, 0.08311291715506125), (u'fai', 902.9220972795897, -0.09359740396097607), (u'NDWI', -0.14804141250180683, -0.0705379771355723), (u'dartmouth', 0.31516558475333656, -0.08259143592340348), (u'LSWI', -0.14982826386693998, 0.08733446419322317), (u'ratio', 9.771497806276129, 0.08172740412577022), (u'MNDWI', -0.6315152257273133, 0.09657359625983933), (u'ratio', 11.216998903138064, 0.08246857226665376), (u'MNDWI', -0.7966635966818656, 0.07605162061421399), (u'dartmouth', 0.32207095247609013, -0.08295128868296117), (u'MNDWI', -0.7140894112045895, 0.0793663117501679), (u'ratio', 10.494248354707096, 0.08231229722793916), (u'LSWIminusEVI', -0.08557300521224676, -0.07043790156684442)] # 87 on a full set including a dozen lakes modis_classifiers['lakes'] = [(u'dartmouth', 0.3191065854189406, 1.557305460141852), (u'MNDWI', 0.36596171757859164, 0.6348226054395288), (u'fai', 1076.7198220279101, 0.30760696551024047), (u'b1', 2490.1666666666665, 0.15428815637057783), (u'b1', 1382.4166666666665, 0.23468676605683622), (u'MNDWI', 0.016043270812331922, 0.2328762729873063), (u'diff', 1348.2627965043696, 0.0893530403812219), (u'EVI', -0.936229495395644, -0.0634313110230615), (u'EVI', 0.15713514272585227, -0.1369834357186273), (u'MNDWI', 0.19100249419546178, 0.1396065269707512), (u'EVI', -0.3895471763348959, -0.0699137042914175), (u'fai', -167.53021645595163, 0.09996436618217863), (u'diff', 3321.3055555555557, 0.09048885842380311), (u'fai', -39.46036556514488, 0.10447135022949844), (u'LSWIminusEVI', -1.8703796507388168, -0.08555612086933119), (u'fai', 24.57455988025849, 0.06788717248868892), (u'EVI', -0.1162060168045218, -0.07076437875624517), (u'EVI', 0.020464562960665234, -0.06640347420417587), (u'MNDWI', 0.2784821058870267, 0.0724098935614613), (u'LSWIminusEVI', -1.4401890608008658, -0.07070792766742959), (u'fai', -7.442902842443196, 0.07045138322018761), (u'EVI', -0.047870726921928286, -0.07285420746159146), (u'LSWIminusEVI', -1.2250937658318906, -0.055977386707896926), (u'b2', 3161.583333333333, -0.06589191057236488), (u'b2', 4305.708333333333, 0.04837026087353021), (u'dartmouth', 0.38322539525652455, 0.06306567258296356), (u'b2', 3733.645833333333, 0.054927931406532564), (u'dartmouth', 0.41528480017531655, 0.06032232647772757), (u'b2', 4019.677083333333, 0.0519316593408497), (u'dartmouth', 0.43131450263471255, 0.04868064475460096), (u'EVI', -0.013703081980631526, -0.052847995106752886), (u'b1', 828.5416666666666, -0.045046979840081554), (u'dartmouth', 0.4393293538644105, 0.03393621379393856), (u'b2', 436.6666666666667, -0.058719990230070525), (u'dartmouth', 0.44333677947925954, 0.055475163457599744), (u'dartmouth', 0.35116599033773255, -0.04464212550237975), (u'diff', 1956.9369538077403, -0.044786403818468996), (u'fai', 582.664653676786, 0.034362389553391215), (u'dartmouth', 0.3351362878783366, -0.03792028656513705), (u'dartmouth', 0.44534049228668404, 0.05187952065328861), (u'dartmouth', 0.3271214366486386, -0.05470657728868695), (u'MNDWI', -0.6666113750420029, 0.05405507219193603), (u'dartmouth', 0.32311401103378956, -0.05376528359478583), (u'dartmouth', 0.4463423486903963, 0.05449932480484019), (u'dartmouth', 0.32111029822636505, -0.0508089033370553), (u'MNDWI', -0.5002432754979653, 0.05120260867296932), (u'dartmouth', 0.32010844182265286, -0.0486732927468307), (u'dartmouth', 0.44684327689225245, 0.04692181887347917), (u'dartmouth', 0.31960751362079676, -0.04268244773234967), (u'MNDWI', -0.5834273252699841, 0.04712231236239887), (u'dartmouth', 0.31935704951986865, -0.04401637387406991), (u'MNDWI', -0.6250193501559935, 0.040914589219895145), (u'dartmouth', 0.31923181746940466, -0.038101469357921955), (u'dartmouth', 0.4470937409931805, 0.03911555294126862), (u'fai', 335.6370695012239, -0.0367701043425464), (u'fai', 212.12327741344288, -0.029512647597407196), (u'diff', 739.5886392009988, 0.04428176152799306), (u'diff', 1043.925717852684, 0.03722820575844798), (u'fai', 273.8801734573334, -0.04948130454705945), (u'dartmouth', 0.2549877755813566, 0.03377180068269043), (u'MNDWI', 0.3222219117328092, -0.04255121251198512), (u'diff', 1196.0942571785267, 0.045470427081376316), (u'MNDWI', 0.3440918146557004, -0.047085347000781985), (u'MNDWI', 0.23474230004124425, 0.04054075125347783), (u'MNDWI', 0.355026766117146, -0.046736584848805475), (u'MNDWI', 0.30035200880991797, 0.04078965556380944), (u'MNDWI', 0.3604942418478688, -0.04776704868198665), (u'LSWIminusNDVI', -0.5568084053554159, -0.04437083563150389), (u'MNDWI', 0.3112869602713636, 0.036248827530157374), (u'MNDWI', 0.36322797971323023, -0.04875479813967596), (u'MNDWI', 0.3167544360020864, 0.04123070622165848), (u'MNDWI', 0.36459484864591096, -0.03810930893128258), (u'diff', 1120.0099875156054, 0.035777913949894054), (u'fai', 829.6922378523481, -0.047446531409649384), (u'diff', 1081.9678526841449, 0.03507927976215228), (u'fai', 953.2060299401292, -0.04108410252021359), (u'b2', 4162.692708333333, 0.04836338373525389), (u'dartmouth', 0.44721897304364455, 0.03740129289331726), (u'dartmouth', 0.3191692014441726, -0.03601093736536919), (u'fai', 1014.9629259840196, -0.03601118264855319), (u'diff', 1158.052122347066, 0.04506611179539899), (u'fai', 1045.841374005965, -0.03593891978458228), (u'diff', 1652.599875156055, 0.03514766129091426), (u'fai', 1061.2805980169376, -0.034972506816040166), (u'fai', 1570.7749903790343, 0.03247104395760117), (u'MNDWI', -0.6042233377129889, 0.03328561186493601), (u'b2', 4091.184895833333, 0.03369074877033)] # Gloucester #classifier = [(u'Red', 106.25, 2.6908694873435546), (u'EVI', 1.8180788840643158, -1.6880493518661959), (u'MNDWI', 0.46606862179569125, 0.6759920285041151), (u'b1', 304.25, 0.6781297845583472), (u'Red', 145.5, -0.9332055109286996)] # New Bedford # Sumatra # BAD!!! #classifier = [(u'MNDWI', 0.4333154844558887, 1.493003861830998), (u'LSWI', 0.37775474450370045, -1.8148849780535137), (u'MNDWI', 0.44980066412990727, -0.7511626994787829), (u'NDWI', -0.6339380319013941, -0.8071101617753624), (u'LSWI', 0.39116467763045004, -0.6801609455151723), (u'Red_idm', 0.13091442790613322, -0.5990066511447246), (u'MNDWI', 0.5321794476425439, 1.0282918260098124), (u'b1', 534.25, 0.8524646445337082), (u'b2', 3215.75, 1.039598641718185), (u'LSWIminusEVI', -1.34846955925935, 0.5222328913364728), (u'MNDWI', 0.4168303047818701, 0.7765206583109537), (u'b1', 523.375, 0.8634569486904281), (u'NDVI', 0.7289698882981454, 1.2326959603643795), (u'b1', 366.25, 0.8382830454882036), (u'EVI', 1.422945109473755, 1.1928188689191888), (u'b1', 349.125, 0.7785531677333495), (u'LSWIminusEVI', -1.3167488924224617, 1.0260639426964406), (u'MNDWI', 0.40858771494486085, 1.4027451684417347), (u'LSWIminusEVI', -1.332609225840906, 1.9664195043168113), (u'MNDWI', 0.40446642002635624, 2.492961637332882), (u'EVI', 1.50922532584799, 3.6046473932813488), (u'LSWIminusEVI', -1.4332960268996904, 1.6903927811081079), (u'b1', 340.5625, 2.3605074347987642), (u'NDVI', 0.7122812759311696, 3.37782938914105), (u'b1', 517.9375, 1.6428199426052579), (u'MNDWI', 0.5321873001187866, 2.1599753462719047), (u'LSWIminusEVI', -1.340539392550128, 1.4453448840683698), (u'b1', 336.28125, 2.3208302513464885), (u'NDVI', 0.7039369697476817, 3.2525521714322845), (u'b1', 515.21875, 1.314512950758647), (u'MNDWI', 0.532191226356908, 1.617127359609984), (u'b2', 3156.375, 1.8784471643971616), (u'b1', 334.140625, 1.0400732285323449), (u'NDVI', 0.7959284553377698, 1.193027997994037), (u'b1', 333.0703125, 1.0099517832242602), (u'MNDWI', 0.5321931894759686, 1.0361885558471728), (u'EVI', 1.3797149514279692, 1.2523657802915276), (u'LSWIminusEVI', -1.344504475904739, 0.8719989740804845), (u'b1', 332.53515625, 1.0839084753587287), (u'NDVI', 0.6997648166559378, 1.7315726665929243), (u'b1', 332.267578125, 0.996052880739089), (u'NDVI', 0.7791377841849334, 1.0759593744171274), (u'b1', 332.1337890625, 0.9513482878953953), (u'MNDWI', 0.4024057725671039, 0.9086363886393817), (u'LSWIminusEVI', -1.3464870175820445, 1.8026760313828059), (u'Red', 86.875, 2.427801754929139), (u'b1', 513.859375, 1.058023863094511), (u'NDVI', 0.7875331197613515, 1.483041632820267), (u'b1', 332.06689453125, 1.052590647877841), (u'diff', 2716.75, 1.0137422040649617)] # Malawi #classifier = [(u'Red', 211.375, -1.4978661367770034), (u'NIR', 171.875, 1.5677471079645802), (u'Red', 208.6875, -0.7549541585435253), (u'b1', 1460.25, 0.6831800731095334), (u'EVI', 0.29952058003806714, 0.5210102026304385)] # trained on Landsat and MODIS # trained on Landsat multiple floods and MODIS (doesn't work well) #classifier = [(u'dartmouth', 0.31990953680782946, 1.3532525832292066), (u'LSWIminusNDVI', -0.41260886054157314, -2.2975599250672945), (u'LSWIminusNDVI', -0.3721610296179776, 0.8951755042386669), (u'LSWIminusNDVI', -0.4530566914651687, 0.6168756052926035), (u'b2', 2031.3975382568196, 0.4928850390139595), (u'B5', 59.35646171559858, 0.396967826941809), (u'B3', 115.2403564453125, -0.5827723329456356), (u'NDVI', -0.499185231572826, -0.8206139450883484), (u'NDVI', 15.27728981864239, -0.9612414977608352), (u'b1', 164.72231270358304, -1.1021978514482116), (u'ratio', 20.830495612552255, -0.8400239901683402), (u'B1', 14.01019038342401, -1.179673542586125), (u'B5', 7.458179092108224, 0.6191675239346668), (u'B5', 37.11245136246036, 0.45205356755293613), (u'LSWIminusNDVI', -0.4328327760033709, 0.2929427581041321), (u'LSWIminusNDVI', -0.35193711415617984, -0.3282316089074475), (u'MNDWI', -0.6320035069773133, -0.5077801803359128), (u'NDVI', 7.549723790463586, -0.7433972707850641), (u'MNDWI', -0.7969077373068656, -0.9734434265642887), (u'NDVI', 3.6859407763741845, -1.1185334743968922), (u'MNDWI', -0.8793598524716417, -1.2191574474417988), (u'dartmouth', 0.25538925127580103, 0.68557400171212), (u'b1', 93.5093648208469, -0.3183118201605347), (u'NDVI', 1.7540492693294836, -0.47533945354750357), (u'b1', 57.902890879478825, -0.5350006454963759), (u'NDVI', 0.7881035158071331, -0.488488980846825), (u'B1', 7.068814236390512, -0.43090497876107114), (u'B5', 11.163310050715186, 0.49166007962734726), (u'LSWIminusNDVI', -0.422720818272472, 0.24376142023795544), (u'LSWIminusEVI', -1.467155116012954, -0.2949111121125788), (u'NDVI', 1.2710763925683084, -0.3532787638045371), (u'b1', 40.099653908794785, -0.35440607970179305), (u'NDVI', 1.0295899541877207, -0.31164486232315497), (u'B1', 3.5981261628737626, -0.3626550539485778), (u'B5', 13.015875530018668, 0.21001981049372742), (u'LSWIminusNDVI', -0.4176648394070226, 0.22155949367640532), (u'LSWIminusNDVI', -0.47328060692696644, -0.25778054247623255), (u'LSWIminusNDVI', -0.4151368499742979, 0.22653206426504116), (u'LSWIminusNDVI', -0.3620490718870787, -0.22717813859342045), (u'LSWIminusNDVI', -0.4138728552579355, 0.22124896614628006), (u'LSWIminusNDVI', -0.4631686491960676, -0.22046149882433666), (u'LSWIminusNDVI', -0.4132408578997543, 0.20278657322608665), (u'B1', 74.36108315515176, -0.19698717197097967), (u'LSWIminusNDVI', -0.36710505075252814, -0.16603353237141502), (u'diff', -3.4819277108433653, -0.2138109964074318), (u'NDVI', 1.1503331733780144, -0.20132627230609748), (u'diff', -182.7289156626506, -0.29647898630599173), (u'LSWI', 22.59461849485026, -0.27478785278729473), (u'b1', 31.198035423452765, -0.3858949394312004), (u'LSWI', 11.28157617977539, -0.35278992723251107)] # trained on default, plus training data #classifier = [(u'diff', 7.851405622489949, 1.1499210570729492), (u'dartmouth', 0.8282223665130863, 0.8336847949898812), (u'LSWIminusNDVI', -0.4029517424860176, -0.4969022650114408), (u'B5', 67.74833454545968, 0.3966703235020681), (u'NDVI', 15.214214631938633, -0.34964556047496637), (u'B6', 83.3055415045817, -0.48622666016349725), (u'B5', 42.37932419232148, 0.3589512700830869), (u'diff', 1463.1726907630523, -0.33190674445403395), (u'dartmouth', 0.6501106091055225, 0.2663771427981788), (u'B1', 13.950356873100874, -0.21287499601676665), (u'NDVI', 7.477843215269061, -0.1659665288248955), (u'diff', -177.06224899598394, -0.23543668173775398), (u'NDVI', 3.6096575069342753, -0.23525924970683706), (u'diff', -84.605421686747, -0.23398869224812702), (u'NDVI', 1.6755646527668824, -0.21432187901910843), (u'MNDWI', -0.6460009028106466, -0.21133622170592178), (u'NDVI', 2.642611079850579, -0.19832033019573156), (u'MNDWI', -0.8039064352235321, -0.21902250388685324), (u'NDVI', 2.159087866308731, -0.21759471721995757), (u'MNDWI', -0.882859201429975, -0.22462325352727264), (u'NDVI', 1.9173262595378067, -0.22133287794719197), (u'MNDWI', -0.9223355845331964, -0.21912707745520124), (u'NDVI', 1.7964454561523446, -0.212352900657123)] # trained on unflooded_mississippi with landsat modis_classifiers['mississippi_5'] = [(u'B5', 22.5, 1.424016860332339)]#, (u'NDWI', -0.3488199979104613, -1.1643319348488192)]#, (u'MNDWI', 0.2060761675061745, -0.8190562053615513), (u'NDWI', 0.12342893439063468, -0.5539167295936754), (u'B6', 128.5625, -0.676969969487169)]#, (u'NDWI', -0.050652615441503096, -0.6038609463852692), (u'MNDWI', 0.0688502702628284, -0.5667166676298596), (u'NDWI', 0.6956693010823654, -0.5326141290666078), (u'MNDWI', -0.29396969047077653, -0.4977145365280558), (u'NDWI', -0.137693390357572, -0.5296068483657974), (u'MNDWI', 0.00023732164115535664, -0.40996366647279703), (u'NDWI', 0.2975104842227725, -0.45039955994958353)] modis_classifiers['mississippi'] = [(u'B5', 20.25, 1.4064982148857947), (u'NDWI', -0.3488199979104613, -1.1281588137098968), (u'MNDWI', 0.2060761675061745, -0.6204705541547991), (u'NDWI', 0.12342893439063468, -0.43739127359050894), (u'B6', 130.03125, -0.7385587172087229), (u'NDWI', -0.050652615441503096, -0.6351588979749766), (u'MNDWI', 0.0688502702628284, -0.7096006602751659), (u'NDWI', -0.137693390357572, -0.6767143211075154), (u'MNDWI', 0.00023732164115535664, -0.4784325526693348), (u'NDWI', 0.6956693010823654, -0.5175430073894397), (u'B6', 129.515625, -0.7658727652948186), (u'NDWI', 0.5836306675686378, -0.8230539867550758)]#, (u'MNDWI', -0.29396969047077653, -1.010378000263949), (u'NDWI', 0.2975104842227725, -1.3470307294716275), (u'MNDWI', -0.40676672221590593, -2.2975599250672945), (u'LSWIminusNDVI', 0.7774358230593219, -2.2975599250672945), (u'b1', 462.17105263157896, -2.2975599250672945), (u'ratio', 1.4121003963517729, -2.2975599250672945), (u'b2', 997.0490506329114, 1.708867948280161), (u'NDWI', -0.41086291422887156, -1.42020845722415), (u'b1', 519.8092105263158, 1.5190611577702313), (u'NDWI', -0.37984145606966646, 0.6952464401700104), (u'NDWI', 0.03638815947456579, -0.7169989507219887), (u'b2', 2354.099683544304, 0.3890029333764627), (u'MNDWI', 0.3433020647495206, -0.41277191754557085), (u'B5', 72.5, 0.3363970042121114), (u'NDWI', 0.38455125913884136, -0.3114385403162398), (u'B5', 15.125, -0.42367907943593436), (u'ratio', 1.7288336636264774, 0.29873586627097254), (u'b2', 827.2238924050632, -0.3807266400174877), (u'b1', 490.9901315789474, 0.35653058641342855), (u'ratio', 1.5704670299891252, 0.4029986460707291), (u'b2', 912.1364715189873, -0.2884661529282731), (u'NDWI', -0.395352185149269, 0.28270986674046317), (u'B1', 79.0625, -0.33478669976778425), (u'NDWI', 0.4280716465968758, -0.27808569593125426), (u'MNDWI', -0.1811726587256471, -0.4277643212788643), (u'NDWI', 0.21046970930670358, -0.47535345223600173), (u'MNDWI', -0.1247741428530824, -0.4532532405442839), (u'NDWI', 0.25399009676473805, -0.3579646150883709), (u'B6', 136.8125, 0.433260616467046), (u'b1', 476.5805921052632, 0.3387323994289085), (u'B3', 29.625, -0.2228446437747992), (u'b1', 469.37582236842104, 0.17408297061563255), (u'ratio', 1.491283713170449, 0.1900202691541482), (u'b2', 954.5927610759493, -0.28090682024123353), (u'ratio', 1.451692054761111, 0.2696401463438538), (u'NDVI', 0.4442480887479201, -0.26025283609038974), (u'LSWIminusEVI', -1.269889491012954, -0.2179140715466851), (u'b1', 465.7734375, 0.2120846094538366)] # trained on unflooded_new_orleans with landsat modis_classifiers['new_orleans'] = [(u'B4', 13.375, 1.4669571862477135), (u'b2', 1768.9536616979908, 0.7191964118271637), (u'B3', 18.3125, -0.4070155359645522), (u'LSWIminusEVI', -0.08557300521224676, -0.5810809746072104), (u'B4', 10.6875, -0.5291029708890636), (u'NDWI', 0.6135381706131, -0.42333042815387417), (u'MNDWI', -0.6315152257273133, -0.4508129543642559), (u'NDWI', 0.40244384299830177, -0.4529011567813934), (u'MNDWI', -0.7966635966818656, -0.4229803773880765), (u'NDWI', 0.8246324982278983, -0.4069177636794863), (u'MNDWI', -0.8792377821591417, -0.4443473879013045), (u'NDWI', 0.7190853344204992, -0.4883209250265058), (u'MNDWI', -0.9205248748977797, -0.49636567364951045), (u'NDWI', 0.7718589163241987, -0.47532398301078105), (u'MNDWI', -0.9411684212670988, -0.46105794712582865), (u'NDWI', 0.9301796620352974, -0.44708336474163696), (u'MNDWI', -0.9514901944517582, -0.4449868419505934), (u'NDWI', 0.8774060801315979, -0.4471999560229246), (u'MNDWI', -0.956651081044088, -0.44724569495404887), (u'NDWI', 0.8510192891797481, -0.4452132576283198), (u'MNDWI', -0.9592315243402529, -0.4429423461902555), (u'NDWI', 0.8378258937038232, -0.4412914152487152), (u'MNDWI', -0.46636685477276113, -0.44065814160370703), (u'NDWI', 0.7454721253723489, -0.42970202497381904), (u'MNDWI', -0.9605217459883353, -0.48957048644758405), (u'NDWI', 0.8312291959658608, -0.5099369404270232), (u'MNDWI', -0.9611668568123766, -0.5177206937846746), (u'NDWI', 0.8279308470968796, -0.5208055090499037), (u'MNDWI', -0.9614894122243971, -0.5218294172269368), (u'NDWI', 0.8262816726623889, -0.5221839375535151), (u'MNDWI', -0.9616506899304074, -0.5222930845903063), (u'NDWI', 0.8254570854451436, -0.5222798634644608), (u'MNDWI', -0.9617313287834126, -0.5221948879561688), (u'NDWI', 0.8250447918365209, -0.5221108271103068), (u'MNDWI', -0.9617716482099152, -0.5220471206666469), (u'NDWI', 0.8248386450322096, -0.5220049728945718), (u'MNDWI', -0.9617918079231664, -0.5219766049261293), (u'NDWI', 0.824735571630054, -0.5219580845269158), (u'MNDWI', -0.961801887779792, -0.5219465310519422), (u'NDWI', 0.8246840349289761, -0.5219393305356076), (u'MNDWI', -0.9618069277081049, -0.5219349735701074), (u'NDWI', 0.8246582665784372, -0.521932312793635), (u'MNDWI', -0.9618094476722614, -0.5219307253356017)] # radar classifiers # Rome TODO radar_classifiers['rome'] = [(u'diff', 178.90461847389557, 2.46177797269142), (u'dartmouth', 0.695180948525906, 0.5636808582048225), (u'b2', 3259.75, 0.40623813335255893), (u'vh', 60.0, 0.512954469752306), (u'b1', 600.7550251256282, 0.2801037593761655), (u'diff', 2154.25, 0.22719741605005747), (u'vh', 48.375, 0.1929392221948245), (u'EVI', -0.39797892895956055, -0.26067596700783746), (u'vh', 42.5625, 0.20882052714352622), (u'diff', 263.7538487282463, -0.211052953848031), (u'LSWI', 0.5436867478118161, -0.16553174402115256), (u'diff', 221.32923360107094, -0.15858370383683376), (u'LSWI', 0.45046812317651347, -0.19487772605927273), (u'EVI', -0.40180875045282066, -0.18574586377612953), (u'LSWI', 0.4038588108588621, -0.1607083937449329), (u'dartmouth', 1.0862723406778199, 0.14520750017543604), (u'b1', 365.38253768844226, 0.13710337373549727), (u'diff', 200.11692603748327, -0.12794110582183135), (u'LSWI', 0.38055415470003645, -0.14473310752902216), (u'b1', 1459.25, 0.13486298225301327), (u'MNDWI', 0.45613992940110276, 0.13252409515935595), (u'b1', 483.0687814070352, 0.1234375368417903), (u'vh', 39.65625, 0.10828147089675809), (u'b1', 1653.125, 0.14309662904293483), (u'vh', 30.875, 0.12050226416705825), (u'diff', 189.5107722556894, -0.13029115438110866), (u'dartmouth', 0.567399392562919, 0.12046203774769106), (u'diff', 184.20769536479247, -0.11034439591730216), (u'vh', 33.8125, 0.12078156192671918), (u'EVI', -0.4037236611994507, -0.11025517176478977), (u'LSWIminusEVI', -1.0112946701259427, -0.11523798706849528), (u'diff', 1909.875, -0.10464945907884636), (u'diff', 2032.0625, 0.07976450393456289), (u'dartmouth', 1.15403648079079, -0.1117066685929633), (u'diff', 2093.15625, 0.0968477259918149), (u'b1', 541.9119032663317, 0.07969028249670798), (u'b1', 836.1275125628141, -0.08405908949318663), (u'diff', 181.556156919344, -0.09346085859259494), (u'LSWI', 0.49707743549416483, -0.1085325347020279), (u'EVI', -0.40468111657276573, -0.09747783097236294), (u'vh', 32.34375, 0.09782288286234157), (u'b1', 1750.0625, 0.10205751464991006), (u'b1', 718.4412688442212, -0.09593339090882935), (u'b1', 424.2256595477387, 0.10473543924639585), (u'MNDWI', 0.5560647563672181, 0.06538569127220625), (u'MNDWI', 0.5061023428841604, 0.12118441764008514), (u'vh', 31.609375, 0.1342091965527664), (u'diff', 1787.6875, -0.10241482447678286), (u'MNDWI', 0.5310835496256893, 0.09017490496680071), (u'dartmouth', 1.187918550847275, -0.07281106494462425)] # Malawi radar_classifiers['malawi'] = [(u'b1', 1206.75, -1.4978661367770034), (u'vv', 92.25, 1.7076910083270624), (u'vv', 155.625, 0.7927423357058031), (u'LSWI', 0.17814903701073945, -0.5656867478534681), (u'b2', 2386.5, 0.39133434117158), (u'vv', 101.625, 0.494237798312077), (u'EVI', 0.29952058003806714, 0.4815500071179563), (u'vv', 106.3125, 0.3791369535317837), (u'LSWIminusNDVI', -0.16354986340261995, -0.3392309042314572), (u'vv', 108.65625, 0.2514716832021546), (u'b2', 2386.75, 0.3450772215737547), (u'vv', 107.484375, 0.2546137126854733), (u'LSWIminusNDVI', -0.16492926771972327, -0.2120703141095119), (u'vv', 106.8984375, 0.1745865336139307), (u'b2', 2386.875, 0.20753425729944486), (u'vv', 106.60546875, 0.17151475757505275), (u'LSWIminusNDVI', -0.16561896987827493, -0.15231935160185775), (u'vv', 106.458984375, 0.13206764439243204), (u'b2', 2386.9375, 0.14843573703920598), (u'vv', 106.3857421875, 0.1291434356120595), (u'LSWIminusNDVI', -0.16596382095755075, -0.11830301992251846), (u'b2', 2242.25, -0.11673694258002199), (u'vv', 154.4375, 0.14908876959293232), (u'LSWI', 0.1611832167953936, -0.13132406390088658), (u'vv', 153.84375, 0.11576377977859459), (u'vv', 106.34912109375, 0.10789584424489668), (u'b2', 2386.96875, 0.09128013378839395), (u'LSWI', 0.1527003066877207, -0.10621539361861156), (u'vv', 153.546875, 0.09035974506503541), (u'LSWI', 0.14845885163388423, -0.08265186904318825), (u'vv', 153.3984375, 0.07612663467721505), (u'vv', 106.330810546875, 0.08087104691133243), (u'EVI', 0.29940517086505597, 0.08383365337627942), (u'vv', 106.3216552734375, 0.0773362495526882), (u'LSWIminusNDVI', -0.16613624649718867, -0.07278061333579333), (u'vv', 106.31707763671875, 0.06783538228239976), (u'b2', 2386.984375, 0.07162768046483561), (u'LSWI', 0.146338124106966, -0.06916246665080311), (u'vv', 153.32421875, 0.06162461812861291), (u'vv', 106.31478881835938, 0.06613725906318095), (u'EVI', 0.29934746627855036, 0.06260671123906972), (u'vv', 106.31364440917969, 0.05891377646208847), (u'b2', 2386.9921875, 0.06026476394466554), (u'LSWI', 0.1452777603435069, -0.05929864988094706), (u'vv', 153.287109375, 0.053562732376205416), (u'vv', 106.31307220458984, 0.05635435997933675), (u'LSWIminusNDVI', -0.16622245926700763, -0.05460616467334437), (u'vv', 106.31278610229492, 0.051776199455337915), (u'b2', 2386.99609375, 0.053322901499510564), (u'LSWI', 0.14580794222523646, -0.05070452620576959)] # Mississippi radar_classifiers['mississippi'] = [(u'NDWI', -0.11622393735660222, -0.8115012757343506), (u'b2', 2985.5263157894738, 0.702679351118156), (u'vv', 5217.619047619048, 0.32062701131953586), (u'MNDWI', 0.26416074525030153, 0.3471969659874681), (u'b1', 1168.775, 0.23958804098018174), (u'b2', 3260.7631578947367, 0.1757460665061179), (u'MNDWI', 0.23640999604191795, 0.16849237965344419), (u'MNDWI', -0.051449424342105275, 0.21073597217765677), (u'LSWIminusNDVI', -0.15381863239050603, 0.261929215268214), (u'MNDWI', 0.10345585696939877, 0.17522339053409086), (u'NDVI', 0.37550520655709846, -0.11678248102474162), (u'ratio', 1.5808138542284427, 0.1307997498783867), (u'MNDWI', 0.22253462143772618, 0.15496439880003274), (u'vv', 23686.289682539682, 0.12065151422211098), (u'LSWIminusNDVI', -0.16578319612225706, 0.10079262433049868), (u'NDWI', 0.01798571473181413, -0.11427381786395764), (u'MNDWI', 0.15605755190146658, 0.12846750517442398), (u'LSWIminusNDVI', -0.15980091425638154, 0.12183307890098613), (u'b2', 3398.3815789473683, 0.0966718411565018), (u'NDWI', -0.035607830086293674, -0.1132584559163686), (u'hv', 4575.416666666667, -0.10741868882123311), (u'NDWI', 0.07157925954992193, -0.10737359754159287), (u'b2', 3467.190789473684, 0.13415083578467207), (u'b1', 1191.3125, -0.11146696782543182), (u'LSWIminusEVI', -2.5247238686545077, 0.11340603990862676), (u'vv', 31272.89484126984, 0.08425074607028928), (u'NDWI', 0.044782487140868035, -0.08653314042576717), (u'b2', 3792.0, 0.1044832325795063), (u'NDVI', 0.43088596754931874, -0.08847969070316128), (u'MNDWI', 0.18235839936750048, 0.07058671161786771), (u'NDWI', 0.058180873345394984, -0.08947323800356782), (u'b2', 3664.0, 0.08796628891143386), (u'NDWI', 0.06488006644765845, -0.07018091636763152), (u'b1', 1180.04375, -0.08727299235554262), (u'LSWIminusNDVI', -0.15680977332344379, 0.08425838412482411), (u'MNDWI', 0.19550882310051743, 0.0619919718523082), (u'NDWI', 0.09837603195897585, -0.08165793068280822), (u'b2', 3600.0, 0.08026689946353305), (u'NDWI', -0.008811057677239772, -0.059679375901025386), (u'hv', 5903.513888888889, -0.06982902975780846), (u'vv', 27479.592261904763, 0.06622628594867959), (u'hv', 51808.0, -0.06271609598725954), (u'vv', 16099.684523809523, -0.06691035524355445), (u'vv', 29376.2435515873, 0.06455229511493261), (u'vv', 19892.9871031746, -0.05233305018274409), (u'b2', 2710.289473684211, 0.05121585389944283), (u'b2', 2847.9078947368425, -0.06272919860762075), (u'b2', 2572.671052631579, 0.083277023990062), (u'b2', 2916.7171052631584, -0.11017977593192452), (u'b2', 2503.8618421052633, 0.08271694814319466)]
def N(): for row in range(7): for col in range(7): if (col==0 or col==6) or row-col==0: print("*",end=" ") else: print(end=" ") print()
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def addOneRow(self, root, v, d): """ :type root: TreeNode :type v: int :type d: int :rtype: TreeNode """ # BFS is even better because it terminates much earlier dummy = TreeNode(-1) dummy.left = root stack = [(1, dummy, 0)] while stack: p, node, h = stack.pop() if not node: continue if p == 1: stack.extend([(1, node.right, h + 1), (1, node.left, h + 1), (0, node, h + 1)]) elif h == d: left = node.left right = node.right node.left, node.right = map(TreeNode, (v,v)) node.left.left = left node.right.right = right return dummy.left
a=list(map(int,input().split(',')))[:4] x,y,p,q=a[0],a[1],a[2],a[3] b1,b2,b3=1,1,1 print(b1,'C',x,b2,'H',y,',',b3,',C',p,'H',q) print((b1*x+b2*y),(b3*(p*q))) while (b1*x+b2*y)!=(b3*(p*q)): while b1*x!=b3*p: print('l1') if b1*x!=p: b1+=1 elif x!=b3*p: b3+=1 else: b1+=1 b3+=1 while b2*y!=b3*q: print('l2') if b2*y!=q: b2+=1 elif y!=b3*q: b3+=1 else: b2+=1 b3+=1 print(b1,'C',x,b2,'H',y,',',b3,',C',p,'H',q)
league_schema_name = None def tn(tablename: str) -> str: if league_schema_name is not None: return '`{0}`.`{1}`'.format(league_schema_name, tablename) else: return '`{0}`'.format(tablename)
A = [1, 2, 3] for i, x in enumerate(A): A[i] += x B = A[0] C = A[0] D: int = 3 while C < A[2]: C += 1 if C == A[2]: print('True') def main(): print("Main started") print(A) print(B) print(C) print(D) if __name__ == '__main__': main()
# Folders FOLDER_SCHEMA = "graphql" # Packages PACKAGE_RESOLVERS = "resolvers" # Modules MODULE_MODELS = "models" MODULE_DIRECTIVES = "directives" MODULE_SETTINGS = "settings" MODULE_PYDANTIC = "pyd_models"
""" The ``covertutils`` module provides ready plug-n-play tools for `Remote Code Execution Agent` programming. Features like `chunking`, `encryption`, `data identification` are all handled transparently by its classes. The :class:`SimpleOrchestrator` handles all data manipulation, and the :class:`Handlers.BaseHandler` derivative classes handle the agent's and handler's actions and responses. The module does not provide networking functionalities. All networking has to be wrapped by two functions (a sender and a receiver functions) and Handlers will use those for raw_data. """ __version__ = '0.3.4' __name__ = 'covertutils' __author__ = 'John Torakis - operatorequals' __email__ = '[email protected]' __github__ = 'https://github.com/operatorequals/covertutils' __readthedocs__ = 'https://covertutils.readthedocs.io'
# 2. Matching Parentheses # You are given an algebraic expression with parentheses. Scan through the string and extract each set of parentheses. # Print the result back on the console. string = list(input()) stack_index = [] for index in range(len(string)): if string[index] == "(": stack_index.append(index) elif string[index] == ")": start_index = stack_index.pop() end_index = index parentheses_set = string[start_index:end_index+1] print(''.join(parentheses_set))
# # PySNMP MIB module JUNIPER-FABRIC-CHASSIS (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/JUNIPER-FABRIC-CHASSIS # Produced by pysmi-0.3.4 at Wed May 1 13:59:10 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint") JnxChassisId, = mibBuilder.importSymbols("JUNIPER-MIB", "JnxChassisId") jnxDcfMibRoot, jnxFabricChassisTraps, jnxFabricChassisOKTraps = mibBuilder.importSymbols("JUNIPER-SMI", "jnxDcfMibRoot", "jnxFabricChassisTraps", "jnxFabricChassisOKTraps") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") MibIdentifier, ObjectIdentity, ModuleIdentity, Counter32, Integer32, IpAddress, Bits, iso, Counter64, TimeTicks, Gauge32, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "ObjectIdentity", "ModuleIdentity", "Counter32", "Integer32", "IpAddress", "Bits", "iso", "Counter64", "TimeTicks", "Gauge32", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32") DisplayString, TextualConvention, DateAndTime = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "DateAndTime") jnxFabricAnatomy = ModuleIdentity((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2)) jnxFabricAnatomy.setRevisions(('2012-09-13 00:00', '2012-07-26 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: jnxFabricAnatomy.setRevisionsDescriptions(('Added director group device (DG) enum to JnxFabricContainersFamily.', 'Modified the description for JnxFabricDeviceId. Added ufabric as part of JnxFabricContainersFamily.',)) if mibBuilder.loadTexts: jnxFabricAnatomy.setLastUpdated('201209130000Z') if mibBuilder.loadTexts: jnxFabricAnatomy.setOrganization('Juniper Networks, Inc.') if mibBuilder.loadTexts: jnxFabricAnatomy.setContactInfo(' Juniper Technical Assistance Center Juniper Networks, Inc. 1194 N. Mathilda Avenue Sunnyvale, CA 94089 E-mail: [email protected]') if mibBuilder.loadTexts: jnxFabricAnatomy.setDescription("The MIB modules representing Juniper Networks' Quantum Fabric hardware components.") jnxFabricAnatomyScalars = MibIdentifier((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 1)) jnxFabricAnatomyTables = MibIdentifier((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2)) class JnxFabricDeviceId(TextualConvention, Integer32): description = 'The device identifier assigned to the individual devices across the fabric by SFC. This shall be a unique index for each of the devices constituting the fabric.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 2147483647) class JnxFabricContainersFamily(TextualConvention, Integer32): description = 'The family of container that defines the device.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("fabricChassis", 1), ("fabricNode", 2), ("ufabric", 3), ("directorGroupDevice", 4)) jnxFabricClass = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 1, 1), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricClass.setStatus('current') if mibBuilder.loadTexts: jnxFabricClass.setDescription('The product line of the fabric switch.') jnxFabricDescr = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricDescr.setDescription('The name, model, or detailed description of the fabric, indicating which product the fabric is about.') jnxFabricSerialNo = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricSerialNo.setStatus('current') if mibBuilder.loadTexts: jnxFabricSerialNo.setDescription('The serial number of this subject, blank if unknown or unavailable.') jnxFabricRevision = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRevision.setStatus('current') if mibBuilder.loadTexts: jnxFabricRevision.setDescription('The revision of this subject, blank if unknown or unavailable.') jnxFabricFirmwareRevision = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFirmwareRevision.setStatus('current') if mibBuilder.loadTexts: jnxFabricFirmwareRevision.setDescription('The firmware (u-boot) revision of this subject, blank if unknown or unavailable.') jnxFabricLastInstalled = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 1, 6), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricLastInstalled.setStatus('current') if mibBuilder.loadTexts: jnxFabricLastInstalled.setDescription('The value of sysUpTime when the subject was last installed, up-and-running. Zero if unknown or already up-and-running when the agent was up.') jnxFabricContentsLastChange = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 1, 7), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsLastChange.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsLastChange.setDescription('The value of sysUpTime when the fabric contents table last changed. Zero if unknown or already existing when the agent was up.') jnxFabricFilledLastChange = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 1, 8), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFilledLastChange.setStatus('current') if mibBuilder.loadTexts: jnxFabricFilledLastChange.setDescription('The value of sysUpTime when the fabric filled status table last changed. Zero if unknown or already at that state when the agent was up.') jnxFabricDeviceTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1), ) if mibBuilder.loadTexts: jnxFabricDeviceTable.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceTable.setDescription('A list of fabric device entries.') jnxFabricDeviceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1), ).setIndexNames((0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex")) if mibBuilder.loadTexts: jnxFabricDeviceEntry.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntry.setDescription('An entry of fabric device table.') jnxFabricDeviceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 1), JnxFabricDeviceId()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceIndex.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceIndex.setDescription('Identifies the device on which the contents of this row exists.') jnxFabricDeviceEntryContainersFamily = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 2), JnxFabricContainersFamily()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntryContainersFamily.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntryContainersFamily.setDescription('The family of container that defines this device.') jnxFabricDeviceEntryClass = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 3), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntryClass.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntryClass.setDescription('The productline of the device entry.') jnxFabricDeviceEntryModel = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 4), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntryModel.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntryModel.setDescription('The model object identifier of the device entry.') jnxFabricDeviceEntryDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntryDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntryDescr.setDescription('The name or detailed description of the device entry.') jnxFabricDeviceEntrySerialNo = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntrySerialNo.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntrySerialNo.setDescription('The serial number of this subject, blank if unknown or unavailable.') jnxFabricDeviceEntryName = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntryName.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntryName.setDescription('The name of this subject which is same as the serial number unless a device alias has been configured.') jnxFabricDeviceEntryRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntryRevision.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntryRevision.setDescription('The revision of this subject, blank if unknown or unavailable.') jnxFabricDeviceEntryFirmwareRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntryFirmwareRevision.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntryFirmwareRevision.setDescription('The firmware (u-boot) revision of this subject, blank if unknown or unavailable.') jnxFabricDeviceEntryInstalled = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 10), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntryInstalled.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntryInstalled.setDescription('The value of sysUpTime when the subject was last installed, up-and-running. Zero if unknown or already up-and-running when the agent was up.') jnxFabricDeviceEntryContentsLastChange = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 11), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntryContentsLastChange.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntryContentsLastChange.setDescription('The value of sysUpTime when the contents table last changed. Zero if unknown or already existing when the agent was up.') jnxFabricDeviceEntryFilledLastChange = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 12), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntryFilledLastChange.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntryFilledLastChange.setDescription('The value of sysUpTime when the filled status table last changed. Zero if unknown or already at that state when the agent was up.') jnxFabricDeviceEntryKernelMemoryUsedPercent = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 1, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricDeviceEntryKernelMemoryUsedPercent.setStatus('current') if mibBuilder.loadTexts: jnxFabricDeviceEntryKernelMemoryUsedPercent.setDescription('The percentage of kernel memory used of this subject. 0 if unavailable or inapplicable.') jnxFabricContainersTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 2), ) if mibBuilder.loadTexts: jnxFabricContainersTable.setStatus('current') if mibBuilder.loadTexts: jnxFabricContainersTable.setDescription('A list of containers entries.') jnxFabricContainersEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 2, 1), ).setIndexNames((0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricContainersFamily"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricContainersIndex")) if mibBuilder.loadTexts: jnxFabricContainersEntry.setStatus('current') if mibBuilder.loadTexts: jnxFabricContainersEntry.setDescription('An entry of containers table. Each entry is indexed by the container table type and the container index.') jnxFabricContainersFamily = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 2, 1, 1), JnxFabricContainersFamily()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContainersFamily.setStatus('current') if mibBuilder.loadTexts: jnxFabricContainersFamily.setDescription('The family of container.') jnxFabricContainersIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContainersIndex.setStatus('current') if mibBuilder.loadTexts: jnxFabricContainersIndex.setDescription('The index for this entry.') jnxFabricContainersView = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 2, 1, 3), Bits().clone(namedValues=NamedValues(("viewFront", 0), ("viewRear", 1), ("viewTop", 2), ("viewBottom", 3), ("viewLeftHandSide", 4), ("viewRightHandSide", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContainersView.setStatus('current') if mibBuilder.loadTexts: jnxFabricContainersView.setDescription('The view(s) from which the specific container appears. This variable indicates that the specific container is embedded and accessible from the corresponding view(s). The value is a bit map represented as a sum. If multiple bits are set, the specified container(s) are located and accessible from that set of views. The various values representing the bit positions and its corresponding views are: 1 front 2 rear 4 top 8 bottom 16 leftHandSide 32 rightHandSide Note 1: LefHandSide and rightHandSide are referred to based on the view from the front. Note 2: If the specified containers are scattered around various views, the numbering is according to the following sequence: front -> rear -> top -> bottom -> leftHandSide -> rightHandSide For each view plane, the numbering sequence is first from left to right, and then from up to down. Note 3: Even though the value in chassis hardware (e.g. slot number) may be labelled from 0, 1, 2, and up, all the indices in MIB start with 1 (not 0) according to network management convention.') jnxFabricContainersLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("level0", 0), ("level1", 1), ("level2", 2), ("level3", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContainersLevel.setStatus('current') if mibBuilder.loadTexts: jnxFabricContainersLevel.setDescription('The abstraction level of the chassis or device. It is enumerated from the outside to the inside, from the outer layer to the inner layer. For example, top level (i.e. level 0) refers to chassis frame, level 1 FPC slot within chassis frame, level 2 PIC space within FPC slot.') jnxFabricContainersWithin = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 2, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContainersWithin.setStatus('current') if mibBuilder.loadTexts: jnxFabricContainersWithin.setDescription('The index of its next higher level container housing this entry. The associated jnxFabricContainersIndex in the jnxFabricContainersTable represents its next higher level container.') jnxFabricContainersType = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 2, 1, 6), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContainersType.setStatus('current') if mibBuilder.loadTexts: jnxFabricContainersType.setDescription('The type of this container.') jnxFabricContainersDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 2, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContainersDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricContainersDescr.setDescription('The name or detailed description of this subject.') jnxFabricContainersCount = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 2, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContainersCount.setStatus('current') if mibBuilder.loadTexts: jnxFabricContainersCount.setDescription('The maximum number of containers of this level per container of the next higher level. e.g. if there are six level 2 containers in level 1 container, then jnxFabricContainersCount for level 2 is six.') jnxFabricContentsTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3), ) if mibBuilder.loadTexts: jnxFabricContentsTable.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsTable.setDescription('A list of contents entries.') jnxFabricContentsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1), ).setIndexNames((0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsContainerIndex"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL1Index"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL2Index"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL3Index")) if mibBuilder.loadTexts: jnxFabricContentsEntry.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsEntry.setDescription('An entry of contents table.') jnxFabricContentsContainerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsContainerIndex.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsContainerIndex.setDescription('The associated jnxFabricContainersIndex in the jnxFabricContainersTable.') jnxFabricContentsL1Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsL1Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsL1Index.setDescription('The level one index of the container housing this subject. Zero if unavailable or inapplicable.') jnxFabricContentsL2Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsL2Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsL2Index.setDescription('The level two index of the container housing this subject. Zero if unavailable or inapplicable.') jnxFabricContentsL3Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsL3Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsL3Index.setDescription('The level three index of the container housing this subject. Zero if unavailable or inapplicable.') jnxFabricContentsType = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 5), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsType.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsType.setDescription('The type of this subject. zeroDotZero if unknown.') jnxFabricContentsDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsDescr.setDescription('The name or detailed description of this subject.') jnxFabricContentsSerialNo = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsSerialNo.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsSerialNo.setDescription('The serial number of this subject, blank if unknown or unavailable.') jnxFabricContentsRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsRevision.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsRevision.setDescription('The revision of this subject, blank if unknown or unavailable.') jnxFabricContentsInstalled = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 9), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsInstalled.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsInstalled.setDescription('The value of sysUpTime when the subject was last installed, up-and-running. Zero if unknown or already up-and-running when the agent was up.') jnxFabricContentsPartNo = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsPartNo.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsPartNo.setDescription('The part number of this subject, blank if unknown or unavailable.') jnxFabricContentsChassisId = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 11), JnxChassisId()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsChassisId.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsChassisId.setDescription('Identifies the chassis on which the contents of this row exists.') jnxFabricContentsChassisDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsChassisDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsChassisDescr.setDescription('A textual description of the chassis on which the contents of this row exists.') jnxFabricContentsChassisCleiCode = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 3, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricContentsChassisCleiCode.setStatus('current') if mibBuilder.loadTexts: jnxFabricContentsChassisCleiCode.setDescription('The clei code of this subject, blank if unknown or unavailable. A CLEI code is an intelligent code that consists of 10 alphanumeric characters with 4 data elements. The first data element is considered the basic code with the first 2 characters indicating the technology or equipment type, and the third and fourth characters denoting the functional sub-category. The second data element represents the features, and its three characters denote functional capabilities or changes. The third data element has one character and denotes a reference to a manufacturer, system ID, specification, or drawing. The fourth data element consists of two characters and contains complementary data. These two characters provide a means of differentiating or providing uniqueness between the eight character CLEI codes by identifying the manufacturing vintage of the product. Names are assigned via procedures defined in [GR485]. The assigned maintenance agent for the CLEI code, Telcordia Technologies, is responsible for assigning certain equipment and other identifiers (e.g., location, manufacturer/supplier) for the telecommunications industry.') jnxFabricFilledTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 4), ) if mibBuilder.loadTexts: jnxFabricFilledTable.setStatus('current') if mibBuilder.loadTexts: jnxFabricFilledTable.setDescription('A list of filled status entries.') jnxFabricFilledEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 4, 1), ).setIndexNames((0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricFilledContainerIndex"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricFilledL1Index"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricFilledL2Index"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricFilledL3Index")) if mibBuilder.loadTexts: jnxFabricFilledEntry.setStatus('current') if mibBuilder.loadTexts: jnxFabricFilledEntry.setDescription('An entry of filled status table.') jnxFabricFilledContainerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFilledContainerIndex.setStatus('current') if mibBuilder.loadTexts: jnxFabricFilledContainerIndex.setDescription('The associated jnxFabricContainersIndex in the jnxFabricContainersTable.') jnxFabricFilledL1Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFilledL1Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricFilledL1Index.setDescription('The level one index of the container housing this subject. Zero if unavailable or inapplicable.') jnxFabricFilledL2Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFilledL2Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricFilledL2Index.setDescription('The level two index of the container housing this subject. Zero if unavailable or inapplicable.') jnxFabricFilledL3Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFilledL3Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricFilledL3Index.setDescription('The level three index of the container housing this subject. Zero if unavailable or inapplicable.') jnxFabricFilledDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 4, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFilledDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricFilledDescr.setDescription('The name or detailed description of this subject.') jnxFabricFilledState = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 4, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unknown", 1), ("empty", 2), ("filled", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFilledState.setStatus('current') if mibBuilder.loadTexts: jnxFabricFilledState.setDescription('The filled state of this subject.') jnxFabricFilledChassisId = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 4, 1, 7), JnxChassisId()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFilledChassisId.setStatus('current') if mibBuilder.loadTexts: jnxFabricFilledChassisId.setDescription('Identifies the chassis on which the contents of this row exists.') jnxFabricFilledChassisDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 4, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFilledChassisDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricFilledChassisDescr.setDescription('A textual description of the chassis on which the contents of this row exists.') jnxFabricOperatingTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5), ) if mibBuilder.loadTexts: jnxFabricOperatingTable.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingTable.setDescription('A list of operating status entries.') jnxFabricOperatingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1), ).setIndexNames((0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricOperatingContentsIndex"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricOperatingL1Index"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricOperatingL2Index"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricOperatingL3Index")) if mibBuilder.loadTexts: jnxFabricOperatingEntry.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingEntry.setDescription('An entry of operating status table.') jnxFabricOperatingContentsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingContentsIndex.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingContentsIndex.setDescription('The associated jnxFabricContentsContainerIndex in the jnxFabricContentsTable.') jnxFabricOperatingL1Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingL1Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingL1Index.setDescription('The level one index associated with this subject. Zero if unavailable or inapplicable.') jnxFabricOperatingL2Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingL2Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingL2Index.setDescription('The level two index associated with this subject. Zero if unavailable or inapplicable.') jnxFabricOperatingL3Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingL3Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingL3Index.setDescription('The level three index associated with this subject. Zero if unavailable or inapplicable.') jnxFabricOperatingDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingDescr.setDescription('The name or detailed description of this subject.') jnxFabricOperatingState = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("unknown", 1), ("running", 2), ("ready", 3), ("reset", 4), ("runningAtFullSpeed", 5), ("down", 6), ("standby", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingState.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingState.setDescription('The operating state of this subject.') jnxFabricOperatingTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 7), Integer32()).setUnits('Celsius (degrees C)').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingTemp.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingTemp.setDescription('The temperature in Celsius (degrees C) of this subject. Zero if unavailable or inapplicable.') jnxFabricOperatingCPU = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingCPU.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingCPU.setDescription('The CPU utilization in percentage of this subject. Zero if unavailable or inapplicable.') jnxFabricOperatingISR = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingISR.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingISR.setDescription('The CPU utilization in percentage of this subject spending in interrupt service routine (ISR). Zero if unavailable or inapplicable.') jnxFabricOperatingDRAMSize = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingDRAMSize.setStatus('deprecated') if mibBuilder.loadTexts: jnxFabricOperatingDRAMSize.setDescription('The DRAM size in bytes of this subject. Zero if unavailable or inapplicable.') jnxFabricOperatingBuffer = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingBuffer.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingBuffer.setDescription('The buffer pool utilization in percentage of this subject. Zero if unavailable or inapplicable.') jnxFabricOperatingHeap = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingHeap.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingHeap.setDescription('The heap utilization in percentage of this subject. Zero if unavailable or inapplicable.') jnxFabricOperatingUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 13), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingUpTime.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingUpTime.setDescription('The time interval in 10-millisecond period that this subject has been up and running. Zero if unavailable or inapplicable.') jnxFabricOperatingLastRestart = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 14), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingLastRestart.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingLastRestart.setDescription('The value of sysUpTime when this subject last restarted. Zero if unavailable or inapplicable.') jnxFabricOperatingMemory = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 15), Integer32()).setUnits('Megabytes').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingMemory.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingMemory.setDescription('The installed memory size in Megabytes of this subject. Zero if unavailable or inapplicable.') jnxFabricOperatingStateOrdered = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("running", 1), ("standby", 2), ("ready", 3), ("runningAtFullSpeed", 4), ("reset", 5), ("down", 6), ("unknown", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingStateOrdered.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingStateOrdered.setDescription("The operating state of this subject. Identical to jnxFabricOperatingState, but with enums ordered from 'most operational' to 'least operational' states.") jnxFabricOperatingChassisId = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 17), JnxChassisId()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingChassisId.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingChassisId.setDescription('Identifies the chassis on which the contents of this row exists.') jnxFabricOperatingChassisDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 18), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingChassisDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingChassisDescr.setDescription('A textual description of the chassis on which the contents of this row exists.') jnxFabricOperatingRestartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 19), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperatingRestartTime.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperatingRestartTime.setDescription('The time at which this entity last restarted.') jnxFabricOperating1MinLoadAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 20), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperating1MinLoadAvg.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperating1MinLoadAvg.setDescription('The CPU Load Average over the last 1 minutes Here it will be shown as percentage value Zero if unavailable or inapplicable.') jnxFabricOperating5MinLoadAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperating5MinLoadAvg.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperating5MinLoadAvg.setDescription('The CPU Load Average over the last 5 minutes Here it will be shown as percentage value Zero if unavailable or inapplicable.') jnxFabricOperating15MinLoadAvg = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 5, 1, 22), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricOperating15MinLoadAvg.setStatus('current') if mibBuilder.loadTexts: jnxFabricOperating15MinLoadAvg.setDescription('The CPU Load Average over the last 15 minutes Here it will be shown as percentage value Zero if unavailable or inapplicable.') jnxFabricRedundancyTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6), ) if mibBuilder.loadTexts: jnxFabricRedundancyTable.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyTable.setDescription('A list of redundancy information entries.') jnxFabricRedundancyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1), ).setIndexNames((0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancyContentsIndex"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancyL1Index"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancyL2Index"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancyL3Index")) if mibBuilder.loadTexts: jnxFabricRedundancyEntry.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyEntry.setDescription('An entry in the redundancy information table.') jnxFabricRedundancyContentsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyContentsIndex.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyContentsIndex.setDescription('The associated jnxFabricContentsContainerIndex in the jnxFabricContentsTable.') jnxFabricRedundancyL1Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyL1Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyL1Index.setDescription('The level one index associated with this subject. Zero if unavailable or inapplicable.') jnxFabricRedundancyL2Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyL2Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyL2Index.setDescription('The level two index associated with this subject. Zero if unavailable or inapplicable.') jnxFabricRedundancyL3Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyL3Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyL3Index.setDescription('The level three index associated with this subject. Zero if unavailable or inapplicable.') jnxFabricRedundancyDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyDescr.setDescription('The name or detailed description of this subject.') jnxFabricRedundancyConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unknown", 1), ("master", 2), ("backup", 3), ("disabled", 4), ("notApplicable", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyConfig.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyConfig.setDescription("The election priority of redundancy configuration for this subject. The value 'notApplicable' means no specific instance is configured to be master or backup; whichever component boots up first becomes a master.") jnxFabricRedundancyState = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown", 1), ("master", 2), ("backup", 3), ("disabled", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyState.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyState.setDescription('The current running state for this subject.') jnxFabricRedundancySwitchoverCount = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancySwitchoverCount.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancySwitchoverCount.setDescription('The total number of switchover as perceived by this subject since routing engine is up and running. The switchover is defined as a change in state of jnxFabricRedundancyState from master to backup or vice versa. Its value is reset when the routing engine is reset or rebooted.') jnxFabricRedundancySwitchoverTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 9), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancySwitchoverTime.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancySwitchoverTime.setDescription('The value of sysUpTime when the jnxFabricRedundancyState of this subject was last switched over from master to backup or vice versa. Zero if unknown or never switched over since the routing engine is up and running.') jnxFabricRedundancySwitchoverReason = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("neverSwitched", 2), ("userSwitched", 3), ("autoSwitched", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancySwitchoverReason.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancySwitchoverReason.setDescription('The reason of the last switchover for this subject.') jnxFabricRedundancyKeepaliveHeartbeat = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyKeepaliveHeartbeat.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyKeepaliveHeartbeat.setDescription('The period of sending keepalive messages between the master and backup subsystems. It is a system-wide preset value in seconds used by internal mastership resolution. Zero if unavailable or inapplicable.') jnxFabricRedundancyKeepaliveTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyKeepaliveTimeout.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyKeepaliveTimeout.setDescription('The timeout period in seconds, by the keepalive watchdog timer, before initiating a switch over to the backup subsystem. Zero if unavailable or inapplicable.') jnxFabricRedundancyKeepaliveElapsed = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyKeepaliveElapsed.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyKeepaliveElapsed.setDescription('The elapsed time in seconds by this subject since receiving the last keepalive message from the other subsystems. Zero if unavailable or inapplicable.') jnxFabricRedundancyKeepaliveLoss = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyKeepaliveLoss.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyKeepaliveLoss.setDescription('The total number of losses on keepalive messages between the master and backup subsystems as perceived by this subject since the system is up and running. Zero if unavailable or inapplicable.') jnxFabricRedundancyChassisId = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 15), JnxChassisId()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyChassisId.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyChassisId.setDescription('Identifies the chassis on which the contents of this row exists.') jnxFabricRedundancyChassisDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 6, 1, 16), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricRedundancyChassisDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancyChassisDescr.setDescription('A textual description of the chassis on which the contents of this row exists.') jnxFabricFruTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7), ) if mibBuilder.loadTexts: jnxFabricFruTable.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruTable.setDescription('A list of FRU status entries.') jnxFabricFruEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1), ).setIndexNames((0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), (0, "JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index")) if mibBuilder.loadTexts: jnxFabricFruEntry.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruEntry.setDescription('An entry in the FRU status table.') jnxFabricFruContentsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruContentsIndex.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruContentsIndex.setDescription('The associated jnxFabricContentsContainerIndex in the jnxFabricContentsTable.') jnxFabricFruL1Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruL1Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruL1Index.setDescription('The level one index associated with this subject. Zero if unavailable or inapplicable.') jnxFabricFruL2Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruL2Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruL2Index.setDescription('The level two index associated with this subject. Zero if unavailable or inapplicable.') jnxFabricFruL3Index = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruL3Index.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruL3Index.setDescription('The level three index associated with this subject. Zero if unavailable or inapplicable.') jnxFabricFruName = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruName.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruName.setDescription('The name or detailed description of this subject.') jnxFabricFruType = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16))).clone(namedValues=NamedValues(("other", 1), ("clockGenerator", 2), ("flexiblePicConcentrator", 3), ("switchingAndForwardingModule", 4), ("controlBoard", 5), ("routingEngine", 6), ("powerEntryModule", 7), ("frontPanelModule", 8), ("switchInterfaceBoard", 9), ("processorMezzanineBoardForSIB", 10), ("portInterfaceCard", 11), ("craftInterfacePanel", 12), ("fan", 13), ("lineCardChassis", 14), ("forwardingEngineBoard", 15), ("protectedSystemDomain", 16)))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruType.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruType.setDescription('The FRU type for this subject.') jnxFabricFruSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruSlot.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruSlot.setDescription('The slot number of this subject. This is equivalent to jnxFabricFruL1Index in meaning. Zero if unavailable or inapplicable.') jnxFabricFruState = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("unknown", 1), ("empty", 2), ("present", 3), ("ready", 4), ("announceOnline", 5), ("online", 6), ("anounceOffline", 7), ("offline", 8), ("diagnostic", 9), ("standby", 10)))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruState.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruState.setDescription('The current state for this subject.') jnxFabricFruTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 9), Integer32()).setUnits('Celsius (degrees C)').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruTemp.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruTemp.setDescription('The temperature in Celsius (degrees C) of this subject. Zero if unavailable or inapplicable.') jnxFabricFruOfflineReason = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75))).clone(namedValues=NamedValues(("unknown", 1), ("none", 2), ("error", 3), ("noPower", 4), ("configPowerOff", 5), ("configHoldInReset", 6), ("cliCommand", 7), ("buttonPress", 8), ("cliRestart", 9), ("overtempShutdown", 10), ("masterClockDown", 11), ("singleSfmModeChange", 12), ("packetSchedulingModeChange", 13), ("physicalRemoval", 14), ("unresponsiveRestart", 15), ("sonetClockAbsent", 16), ("rddPowerOff", 17), ("majorErrors", 18), ("minorErrors", 19), ("lccHardRestart", 20), ("lccVersionMismatch", 21), ("powerCycle", 22), ("reconnect", 23), ("overvoltage", 24), ("pfeVersionMismatch", 25), ("febRddCfgChange", 26), ("fpcMisconfig", 27), ("fruReconnectFail", 28), ("fruFwddReset", 29), ("fruFebSwitch", 30), ("fruFebOffline", 31), ("fruInServSoftUpgradeError", 32), ("fruChasdPowerRatingExceed", 33), ("fruConfigOffline", 34), ("fruServiceRestartRequest", 35), ("spuResetRequest", 36), ("spuFlowdDown", 37), ("spuSpi4Down", 38), ("spuWatchdogTimeout", 39), ("spuCoreDump", 40), ("fpgaSpi4LinkDown", 41), ("i3Spi4LinkDown", 42), ("cppDisconnect", 43), ("cpuNotBoot", 44), ("spuCoreDumpComplete", 45), ("rstOnSpcSpuFailure", 46), ("softRstOnSpcSpuFailure", 47), ("hwAuthenticationFailure", 48), ("reconnectFpcFail", 49), ("fpcAppFailed", 50), ("fpcKernelCrash", 51), ("spuFlowdDownNoCore", 52), ("spuFlowdCoreDumpIncomplete", 53), ("spuFlowdCoreDumpComplete", 54), ("spuIdpdDownNoCore", 55), ("spuIdpdCoreDumpIncomplete", 56), ("spuIdpdCoreDumpComplete", 57), ("spuCoreDumpIncomplete", 58), ("spuIdpdDown", 59), ("fruPfeReset", 60), ("fruReconnectNotReady", 61), ("fruSfLinkDown", 62), ("fruFabricDown", 63), ("fruAntiCounterfeitRetry", 64), ("fruFPCChassisClusterDisable", 65), ("spuFipsError", 66), ("fruFPCFabricDownOffline", 67), ("febCfgChange", 68), ("routeLocalizationRoleChange", 69), ("fruFpcUnsupported", 70), ("psdVersionMismatch", 71), ("fruResetThresholdExceeded", 72), ("picBounce", 73), ("badVoltage", 74), ("fruFPCReducedFabricBW", 75)))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruOfflineReason.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruOfflineReason.setDescription('The offline reason of this subject.') jnxFabricFruLastPowerOff = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 11), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruLastPowerOff.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruLastPowerOff.setDescription('The value of sysUpTime when this subject was last powered off. Zero if unavailable or inapplicable.') jnxFabricFruLastPowerOn = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 12), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruLastPowerOn.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruLastPowerOn.setDescription('The value of sysUpTime when this subject was last powered on. Zero if unavailable or inapplicable.') jnxFabricFruPowerUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 13), TimeTicks()).setUnits('centi-seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruPowerUpTime.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruPowerUpTime.setDescription('The time interval in 10-millisecond period that this subject has been up and running since the last power on time. Zero if unavailable or inapplicable.') jnxFabricFruChassisId = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 14), JnxChassisId()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruChassisId.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruChassisId.setDescription('Identifies the chassis on which the contents of this row exists.') jnxFabricFruChassisDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 15), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruChassisDescr.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruChassisDescr.setDescription('A textual description of the chassis on which the contents of this row exists.') jnxFabricFruPsdAssignment = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 42, 2, 2, 7, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxFabricFruPsdAssignment.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruPsdAssignment.setDescription('The PSD assignment of this subject. Zero if unavailable or not applicable.') jnxFabricPowerSupplyFailure = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 1)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsContainerIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsDescr"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricOperatingState")) if mibBuilder.loadTexts: jnxFabricPowerSupplyFailure.setStatus('current') if mibBuilder.loadTexts: jnxFabricPowerSupplyFailure.setDescription('A jnxFabricPowerSupplyFailure trap signifies that the SNMP entity, acting in an agent role, has detected that the specified power supply in the chassis has been in the failure (bad DC output) condition.') jnxFabricFanFailure = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 2)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsContainerIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsDescr"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricOperatingState")) if mibBuilder.loadTexts: jnxFabricFanFailure.setStatus('current') if mibBuilder.loadTexts: jnxFabricFanFailure.setDescription('A jnxFabricFanFailure trap signifies that the SNMP entity, acting in an agent role, has detected that the specified cooling fan or impeller in the chassis has been in the failure (not spinning) condition.') jnxFabricOverTemperature = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 3)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsContainerIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsDescr"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricOperatingTemp")) if mibBuilder.loadTexts: jnxFabricOverTemperature.setStatus('current') if mibBuilder.loadTexts: jnxFabricOverTemperature.setDescription('A jnxFabricOverTemperature trap signifies that the SNMP entity, acting in an agent role, has detected that the specified hardware component in the chassis has experienced over temperature condition.') jnxFabricRedundancySwitchover = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 4)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancyContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancyL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancyL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancyL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancyDescr"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancyConfig"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancyState"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancySwitchoverCount"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancySwitchoverTime"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricRedundancySwitchoverReason")) if mibBuilder.loadTexts: jnxFabricRedundancySwitchover.setStatus('current') if mibBuilder.loadTexts: jnxFabricRedundancySwitchover.setDescription('A jnxFabricRedundancySwitchover trap signifies that the SNMP entity, acting in an agent role, has detected that the specified hardware component in the chassis has experienced a redundancy switchover event defined as a change in state of jnxFabricRedundancyState from master to backup or vice versa.') jnxFabricFruRemoval = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 5)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot")) if mibBuilder.loadTexts: jnxFabricFruRemoval.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruRemoval.setDescription('A jnxFabricFruRemoval trap signifies that the SNMP entity, acting in an agent role, has detected that the specified FRU (Field Replaceable Unit) has been removed from the chassis.') jnxFabricFruInsertion = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 6)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot")) if mibBuilder.loadTexts: jnxFabricFruInsertion.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruInsertion.setDescription('A jnxFabricFruInsertion trap signifies that the SNMP entity, acting in an agent role, has detected that the specified FRU (Field Replaceable Unit) has been inserted into the chassis.') jnxFabricFruPowerOff = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 7)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruOfflineReason"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruLastPowerOff"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruLastPowerOn")) if mibBuilder.loadTexts: jnxFabricFruPowerOff.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruPowerOff.setDescription('A jnxFabricFruPowerOff trap signifies that the SNMP entity, acting in an agent role, has detected that the specified FRU (Field Replaceable Unit) has been powered off in the chassis.') jnxFabricFruPowerOn = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 8)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruOfflineReason"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruLastPowerOff"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruLastPowerOn")) if mibBuilder.loadTexts: jnxFabricFruPowerOn.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruPowerOn.setDescription('A jnxFabricFruPowerOn trap signifies that the SNMP entity, acting in an agent role, has detected that the specified FRU (Field Replaceable Unit) has been powered on in the chassis.') jnxFabricFruFailed = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 9)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot")) if mibBuilder.loadTexts: jnxFabricFruFailed.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruFailed.setDescription('This indicates the specified FRU (Field Replaceable Unit) has failed in the chassis. Most probably this is due toi some hard error such as fru is not powering up or not able to load ukernel. In these cases, fru is replaced.') jnxFabricFruOffline = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 10)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruOfflineReason"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruLastPowerOff"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruLastPowerOn")) if mibBuilder.loadTexts: jnxFabricFruOffline.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruOffline.setDescription('A jnxFabricFruOffline trap signifies that the SNMP entity, acting in an agent role, has detected that the specified FRU (Field Replaceable Unit) has gone offline in the chassis.') jnxFabricFruOnline = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 11)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot")) if mibBuilder.loadTexts: jnxFabricFruOnline.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruOnline.setDescription('A jnxFabricFruOnline trap signifies that the SNMP entity, acting in an agent role, has detected that the specified FRU (Field Replaceable Unit) has gone online in the chassis.') jnxFabricFruCheck = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 12)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot")) if mibBuilder.loadTexts: jnxFabricFruCheck.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruCheck.setDescription('A jnxFabricFruCheck trap signifies that the SNMP entity, acting in an agent role, has detected that the specified FRU (Field Replaceable Unit) has encountered some operational errors and gone into check state in the chassis.') jnxFabricFEBSwitchover = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 13)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot")) if mibBuilder.loadTexts: jnxFabricFEBSwitchover.setStatus('current') if mibBuilder.loadTexts: jnxFabricFEBSwitchover.setDescription('A jnxFabricFEBSwitchover trap signifies that the SNMP entity, acting in an agent role, has detected that the specified FEB (Forwarding Engine Board) has switched over.') jnxFabricHardDiskFailed = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 14)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot")) if mibBuilder.loadTexts: jnxFabricHardDiskFailed.setStatus('current') if mibBuilder.loadTexts: jnxFabricHardDiskFailed.setDescription('A jnxHardDiskFailed trap signifies that the SNMP entity, acting in an agent role, has detected that the Disk in the specified Routing Engine has encountered some operational errors and gone into failed state in the chassis.') jnxFabricHardDiskMissing = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 15)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot")) if mibBuilder.loadTexts: jnxFabricHardDiskMissing.setStatus('current') if mibBuilder.loadTexts: jnxFabricHardDiskMissing.setDescription('A DiskMissing trap signifies that the SNMP entity, acting in an agent role, has detected that hard disk in the specified outing Engine is missing from boot device list.') jnxFabricBootFromBackup = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 19, 16)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot")) if mibBuilder.loadTexts: jnxFabricBootFromBackup.setStatus('current') if mibBuilder.loadTexts: jnxFabricBootFromBackup.setDescription('A jnxBootFromBackup trap signifies that the SNMP entity, acting in an agent role, has detected that the specified routing-engine/member has booted from the back up root partition') jnxFabricPowerSupplyOK = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 20, 1)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsContainerIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsDescr"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricOperatingState")) if mibBuilder.loadTexts: jnxFabricPowerSupplyOK.setStatus('current') if mibBuilder.loadTexts: jnxFabricPowerSupplyOK.setDescription('A jnxFabricPowerSupplyOK trap signifies that the SNMP entity, acting in an agent role, has detected that the specified power supply in the chassis has recovered from the failure (bad DC output) condition.') jnxFabricFanOK = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 20, 2)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsContainerIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsDescr"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricOperatingState")) if mibBuilder.loadTexts: jnxFabricFanOK.setStatus('current') if mibBuilder.loadTexts: jnxFabricFanOK.setDescription('A jnxFabricFanOK trap signifies that the SNMP entity, acting in an agent role, has detected that the specified cooling fan or impeller in the chassis has recovered from the failure (not spinning) condition.') jnxFabricTemperatureOK = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 20, 3)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsContainerIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricContentsDescr"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricOperatingTemp")) if mibBuilder.loadTexts: jnxFabricTemperatureOK.setStatus('current') if mibBuilder.loadTexts: jnxFabricTemperatureOK.setDescription('A jnxFabricTemperatureOK trap signifies that the SNMP entity, acting in an agent role, has detected that the specified hardware component in the chassis has recovered from over temperature condition.') jnxFabricFruOK = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 20, 4)).setObjects(("JUNIPER-FABRIC-CHASSIS", "jnxFabricDeviceIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruContentsIndex"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL1Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL2Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruL3Index"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruName"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruType"), ("JUNIPER-FABRIC-CHASSIS", "jnxFabricFruSlot")) if mibBuilder.loadTexts: jnxFabricFruOK.setStatus('current') if mibBuilder.loadTexts: jnxFabricFruOK.setDescription('A jnxFabricFabricFruOK trap signifies that the SNMP entity, acting in an agent role, has detected that the specified FRU (Field Replaceable Unit) has recovered from previous operational errors and it is in ok state in the chassis.') mibBuilder.exportSymbols("JUNIPER-FABRIC-CHASSIS", jnxFabricFruL3Index=jnxFabricFruL3Index, jnxFabricDeviceEntryDescr=jnxFabricDeviceEntryDescr, jnxFabricOverTemperature=jnxFabricOverTemperature, jnxFabricDeviceEntrySerialNo=jnxFabricDeviceEntrySerialNo, jnxFabricRedundancyChassisId=jnxFabricRedundancyChassisId, jnxFabricContentsRevision=jnxFabricContentsRevision, jnxFabricOperatingDRAMSize=jnxFabricOperatingDRAMSize, jnxFabricContentsContainerIndex=jnxFabricContentsContainerIndex, jnxFabricOperatingDescr=jnxFabricOperatingDescr, jnxFabricRedundancyKeepaliveElapsed=jnxFabricRedundancyKeepaliveElapsed, jnxFabricFruL1Index=jnxFabricFruL1Index, jnxFabricFruPowerOff=jnxFabricFruPowerOff, jnxFabricRevision=jnxFabricRevision, jnxFabricFilledL1Index=jnxFabricFilledL1Index, jnxFabricRedundancySwitchoverTime=jnxFabricRedundancySwitchoverTime, jnxFabricContainersLevel=jnxFabricContainersLevel, jnxFabricFruCheck=jnxFabricFruCheck, jnxFabricContainersTable=jnxFabricContainersTable, jnxFabricFilledDescr=jnxFabricFilledDescr, jnxFabricContainersFamily=jnxFabricContainersFamily, jnxFabricFilledContainerIndex=jnxFabricFilledContainerIndex, jnxFabricOperating1MinLoadAvg=jnxFabricOperating1MinLoadAvg, jnxFabricContentsL1Index=jnxFabricContentsL1Index, jnxFabricDeviceTable=jnxFabricDeviceTable, jnxFabricDeviceEntryClass=jnxFabricDeviceEntryClass, jnxFabricContainersWithin=jnxFabricContainersWithin, jnxFabricFilledChassisId=jnxFabricFilledChassisId, jnxFabricRedundancyTable=jnxFabricRedundancyTable, jnxFabricOperatingCPU=jnxFabricOperatingCPU, jnxFabricOperatingTable=jnxFabricOperatingTable, jnxFabricRedundancyL3Index=jnxFabricRedundancyL3Index, jnxFabricFanFailure=jnxFabricFanFailure, jnxFabricRedundancyEntry=jnxFabricRedundancyEntry, jnxFabricClass=jnxFabricClass, jnxFabricContentsL3Index=jnxFabricContentsL3Index, jnxFabricDeviceEntryRevision=jnxFabricDeviceEntryRevision, jnxFabricContentsChassisId=jnxFabricContentsChassisId, jnxFabricFruType=jnxFabricFruType, jnxFabricContentsLastChange=jnxFabricContentsLastChange, jnxFabricContentsChassisDescr=jnxFabricContentsChassisDescr, jnxFabricFruRemoval=jnxFabricFruRemoval, jnxFabricDeviceEntryFirmwareRevision=jnxFabricDeviceEntryFirmwareRevision, jnxFabricRedundancyKeepaliveLoss=jnxFabricRedundancyKeepaliveLoss, jnxFabricFruTemp=jnxFabricFruTemp, jnxFabricDescr=jnxFabricDescr, jnxFabricFanOK=jnxFabricFanOK, PYSNMP_MODULE_ID=jnxFabricAnatomy, jnxFabricFruOfflineReason=jnxFabricFruOfflineReason, jnxFabricContainersEntry=jnxFabricContainersEntry, jnxFabricRedundancyState=jnxFabricRedundancyState, jnxFabricOperatingLastRestart=jnxFabricOperatingLastRestart, jnxFabricContentsDescr=jnxFabricContentsDescr, jnxFabricFirmwareRevision=jnxFabricFirmwareRevision, jnxFabricContentsEntry=jnxFabricContentsEntry, jnxFabricRedundancyDescr=jnxFabricRedundancyDescr, jnxFabricDeviceEntryName=jnxFabricDeviceEntryName, jnxFabricOperating15MinLoadAvg=jnxFabricOperating15MinLoadAvg, jnxFabricFilledTable=jnxFabricFilledTable, jnxFabricRedundancySwitchover=jnxFabricRedundancySwitchover, jnxFabricTemperatureOK=jnxFabricTemperatureOK, jnxFabricBootFromBackup=jnxFabricBootFromBackup, jnxFabricAnatomyScalars=jnxFabricAnatomyScalars, jnxFabricDeviceIndex=jnxFabricDeviceIndex, jnxFabricContainersIndex=jnxFabricContainersIndex, jnxFabricFruPsdAssignment=jnxFabricFruPsdAssignment, jnxFabricDeviceEntryKernelMemoryUsedPercent=jnxFabricDeviceEntryKernelMemoryUsedPercent, jnxFabricOperatingChassisDescr=jnxFabricOperatingChassisDescr, jnxFabricFruLastPowerOn=jnxFabricFruLastPowerOn, jnxFabricDeviceEntryModel=jnxFabricDeviceEntryModel, jnxFabricFruSlot=jnxFabricFruSlot, jnxFabricOperatingHeap=jnxFabricOperatingHeap, jnxFabricOperatingL2Index=jnxFabricOperatingL2Index, jnxFabricFilledChassisDescr=jnxFabricFilledChassisDescr, jnxFabricOperatingRestartTime=jnxFabricOperatingRestartTime, jnxFabricFruContentsIndex=jnxFabricFruContentsIndex, jnxFabricOperatingStateOrdered=jnxFabricOperatingStateOrdered, jnxFabricContentsChassisCleiCode=jnxFabricContentsChassisCleiCode, jnxFabricFruInsertion=jnxFabricFruInsertion, jnxFabricRedundancyContentsIndex=jnxFabricRedundancyContentsIndex, jnxFabricFEBSwitchover=jnxFabricFEBSwitchover, jnxFabricFruPowerOn=jnxFabricFruPowerOn, jnxFabricFilledLastChange=jnxFabricFilledLastChange, jnxFabricContainersDescr=jnxFabricContainersDescr, jnxFabricFilledState=jnxFabricFilledState, jnxFabricFruEntry=jnxFabricFruEntry, jnxFabricOperatingState=jnxFabricOperatingState, jnxFabricHardDiskFailed=jnxFabricHardDiskFailed, jnxFabricDeviceEntry=jnxFabricDeviceEntry, jnxFabricFruPowerUpTime=jnxFabricFruPowerUpTime, jnxFabricContentsType=jnxFabricContentsType, jnxFabricContainersCount=jnxFabricContainersCount, jnxFabricOperatingL3Index=jnxFabricOperatingL3Index, jnxFabricRedundancyKeepaliveTimeout=jnxFabricRedundancyKeepaliveTimeout, jnxFabricOperatingUpTime=jnxFabricOperatingUpTime, jnxFabricOperatingISR=jnxFabricOperatingISR, jnxFabricOperatingTemp=jnxFabricOperatingTemp, jnxFabricFruOffline=jnxFabricFruOffline, jnxFabricLastInstalled=jnxFabricLastInstalled, jnxFabricAnatomyTables=jnxFabricAnatomyTables, jnxFabricContentsPartNo=jnxFabricContentsPartNo, jnxFabricRedundancySwitchoverReason=jnxFabricRedundancySwitchoverReason, jnxFabricAnatomy=jnxFabricAnatomy, jnxFabricContentsSerialNo=jnxFabricContentsSerialNo, jnxFabricContentsInstalled=jnxFabricContentsInstalled, jnxFabricFruChassisId=jnxFabricFruChassisId, jnxFabricFruState=jnxFabricFruState, jnxFabricOperatingL1Index=jnxFabricOperatingL1Index, jnxFabricRedundancySwitchoverCount=jnxFabricRedundancySwitchoverCount, jnxFabricFilledEntry=jnxFabricFilledEntry, jnxFabricOperatingEntry=jnxFabricOperatingEntry, jnxFabricRedundancyKeepaliveHeartbeat=jnxFabricRedundancyKeepaliveHeartbeat, jnxFabricFruOnline=jnxFabricFruOnline, jnxFabricDeviceEntryFilledLastChange=jnxFabricDeviceEntryFilledLastChange, jnxFabricDeviceEntryContentsLastChange=jnxFabricDeviceEntryContentsLastChange, jnxFabricOperatingContentsIndex=jnxFabricOperatingContentsIndex, jnxFabricHardDiskMissing=jnxFabricHardDiskMissing, jnxFabricFruL2Index=jnxFabricFruL2Index, jnxFabricContainersView=jnxFabricContainersView, jnxFabricOperatingChassisId=jnxFabricOperatingChassisId, jnxFabricRedundancyChassisDescr=jnxFabricRedundancyChassisDescr, jnxFabricFruFailed=jnxFabricFruFailed, jnxFabricRedundancyConfig=jnxFabricRedundancyConfig, jnxFabricPowerSupplyOK=jnxFabricPowerSupplyOK, jnxFabricOperatingBuffer=jnxFabricOperatingBuffer, jnxFabricSerialNo=jnxFabricSerialNo, jnxFabricDeviceEntryContainersFamily=jnxFabricDeviceEntryContainersFamily, JnxFabricContainersFamily=JnxFabricContainersFamily, jnxFabricOperatingMemory=jnxFabricOperatingMemory, jnxFabricFruChassisDescr=jnxFabricFruChassisDescr, jnxFabricContentsL2Index=jnxFabricContentsL2Index, jnxFabricOperating5MinLoadAvg=jnxFabricOperating5MinLoadAvg, jnxFabricContainersType=jnxFabricContainersType, jnxFabricRedundancyL2Index=jnxFabricRedundancyL2Index, jnxFabricFruLastPowerOff=jnxFabricFruLastPowerOff, jnxFabricDeviceEntryInstalled=jnxFabricDeviceEntryInstalled, jnxFabricFilledL2Index=jnxFabricFilledL2Index, jnxFabricFruTable=jnxFabricFruTable, jnxFabricPowerSupplyFailure=jnxFabricPowerSupplyFailure, JnxFabricDeviceId=JnxFabricDeviceId, jnxFabricRedundancyL1Index=jnxFabricRedundancyL1Index, jnxFabricContentsTable=jnxFabricContentsTable, jnxFabricFruName=jnxFabricFruName, jnxFabricFruOK=jnxFabricFruOK, jnxFabricFilledL3Index=jnxFabricFilledL3Index)
"""Rules for simple testing without dependencies by parsing output logs.""" def tflite_micro_cc_test( name, expected_in_logs = "~~~ALL TESTS PASSED~~~", srcs = [], includes = [], defines = [], copts = [], nocopts = "", linkopts = [], deps = [], tags = [], visibility = None): """Tests a C/C++ binary without testing framework dependencies`. Runs a C++ binary, and tests that the output logs contain the expected value. This is a deliberately spartan way of testing, to match what's available when testing microcontroller binaries. Args: name: a unique name for this rule. expected_in_logs: A regular expression that is required to be present in the binary's logs for the test to pass. srcs: sources to compile (C, C++, ld scripts). includes: include paths to add to this rule and its dependents. defines: list of `VAR` or `VAR=VAL` to pass to CPP for this rule and its dependents. copts: gcc compilation flags for this rule only. nocopts: list of gcc compilation flags to remove for this rule only. No regexp like for `cc_library`. linkopts: `gcc` flags to add to the linking phase. For "pure" ld flags, prefix them with the `-Wl,` prefix here. deps: dependencies. only `tflite_bare_metal_cc_library()` dependencies allowed. visibility: visibility. """ native.cc_binary( name = name + "_binary", srcs = srcs, includes = includes, defines = defines, copts = copts, nocopts = nocopts, linkopts = linkopts, deps = deps, tags = tags, visibility = visibility, ) native.sh_test( name = name, size = "medium", srcs = [ "//tensorflow/contrib/lite/experimental/micro/testing:test_linux_binary.sh", ], args = [ native.package_name() + "/" + name + "_binary", "'" + expected_in_logs + "'", ], data = [ name + "_binary", # Internal test dependency placeholder ], deps = [ ], tags = tags, )
class Solution: def minPathSum(self, grid: List[List[int]]) -> int: rows=len(grid) columns=len(grid[0]) for i in range(1,columns): grid[0][i]+=grid[0][i-1] for j in range(1,rows): grid[j][0]+=grid[j-1][0] for k in range(1,rows): for l in range(1,columns): grid[k][l]+=min(grid[k][l-1],grid[k-1][l]) return grid[-1][-1]
''' Take two sorted linked lists L, R and return the merge of L and R Notes: * when declaring a python class, inherit from object if not otherwise specified * in the python class __init__ function, self is a required first argument * next is a reserved name (iterator method) in python. use the variable name next_node for the pointer field instead. * what went right * used dummy linked list head pattern * bugs * forgot to advance the merged list node pointer variable ''' class LinkedListNode(object): def __init__(self, val, next_node=None): self.val = val self.next_node = next_node def print_nodes(self): print(self.val) if self.next_node is not None: self.next_node.print_nodes() def merge_lists(l, r): dummy_head = LinkedListNode(0) node = dummy_head while True: if l is None: node.next_node = r break if r is None: node.next_node = l break if l.val < r.val: node.next_node = l l = l.next_node else: node.next_node = r r = r.next_node node = node.next_node return dummy_head.next_node def create_list_from_arr(arr): dummy_head = LinkedListNode(0) node = dummy_head for el in arr: next_node = LinkedListNode(el) node.next_node = next_node node = next_node return dummy_head.next_node if __name__ == '__main__': test_cases = [ ([1,4,6,10], [2,3,5]), ([1,4,6,10], []), ([], [2,3,5]), ([1,2,3], [4,5,6]), ] for t in test_cases: l = create_list_from_arr(t[0]) r = create_list_from_arr(t[1]) print(t) merge_lists(l,r).print_nodes()
# -*- coding: utf-8 -*- """Top-level package for mvstats.""" __author__ = """Hrishikesh A. Chandanpurkar""" __email__ = '[email protected]' __version__ = '0.1.0'
global_transform = 0 # TODO: add types / proper data structures to variables def find_attitude_data(timestamp): """ Find corresponding attitude data by time stamp. :param timestamp: The timestamp. :return: ? """ pass def find_displacement_data(timestamp): """ Find corresponding displacement data by time stamp. :param timestamp: The timestamp. :return: ? """ pass def transform_cloud(a, b, c): """ Transform the point cloud of previous frame into its own navigation coordinate system. :param a: Point Cloud. :param b: Point. :param c: Point difference. :return: ? """ pass def pair_align(a, b): """ Accurate Registration. :param a: Point cloud for previous frame. :param b: Point cloud for current frame. :return: The matrix. """ x = 0 return x def transform_point_cloud(a, b): """ Transform the point cloud to the global coordinate system which is the navigation coordinate system of the first input point cloud. :param a: Point cloud for current frame. :param b: New transform. :return: ? """ pass def compute_transform(a, b): """ Calculate the transformation from C1 to C2, C1 is the point cloud obtained by transforming C into its own navigation coordinate system, C2 is the point cloud obtained by transforming c into the navigation coordinate system of previous frame. :param a: Point cloud for current frame. :param b: New transform. :return: ? """ pass def align_point_clouds(C, L, P, D): """ This Program does stuff. :param C: Point cloud of current frame. :param L: Point cloud of previous frame. :param P: IMU data set. :param D: Encoder data set. :return: Point cloud of current frame that transformed to the global coordinate. """ global global_transform # Initial Registration: for p1 in P: print(f'{p1 = }') if L.timestamp == p1.timestamp: find_attitude_data(p1.timestamp) return p1 for d1 in D: print(f'{d1 = }') if L.timestamp == d1.timestamp: find_displacement_data(d1.timestamp) return d1 transform_cloud(L, p1, 0) for p2 in P: print(f'{p2 = }') if C.timestamp == p2.timestamp: find_attitude_data(p2.timestamp) return p2 for d2 in D: print(f'{d2 = }') if C.timestamp == d2.timestamp: find_displacement_data(d2.timestamp) return d2 transform_cloud(C, p2, d2 - d1) # Accurate Registration: pair_transform = pair_align(L, C) # Transform the point cloud to the global coordinate system which is the navigation # coordinate system of the first input point cloud. transform_point_cloud(C, global_transform * pair_transform) _transform = compute_transform(p2, d2 - d1) # Update global transformation. global_transform = global_transform * pair_transform * _transform return C
PRED_TYPE = 'Basic' TTA_PRED_TYPE = 'TTA' ENS_TYPE = 'Ens' MEGA_ENS_TYPE = 'MegaEns'
# -*- coding: UTF-8 -*- """ Copyright 2021 Tianshu AI Platform. 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. ============================================================= """ def get_proto_value(value): _data = None if value.HasField("number_value"): _data = value.number_value elif value.HasField("string_value"): _data = value.string_value elif value.HasField("bool_value"): _data = value.bool_value return _data class hparams_read: """ 返回hparams数据 args: data:内存中的超参数数据 """ def __init__(self, data=None, scalar_data=None): self.data = data self.scalar_data = scalar_data self.res = {"hparamsInfo": [], "metrics": []} def get_data(self): _data = self.data if not _data: return None self.parse_hparams() return self.res def parse_hparams(self): # 先添加metrics的tag for i in range(len(self.data[0].session_start_info.metrics)): self.res['metrics'].append({'tag': '', 'value': []}) # 再添加metrics的数据 for hp in self.data: group_name = hp.session_start_info.group_name current_hparams_info = { group_name: {"hparams": [], "start_time_secs": None} } session_start_info = hp.session_start_info for name in session_start_info.hparams: value = session_start_info.hparams[name] _data = get_proto_value(value) current_hparams_info[group_name]["hparams"].append({ "name": name, "data": _data }) current_hparams_info[group_name]["start_time_secs"] = \ hp.session_start_info.start_time_secs for i, tag in enumerate(session_start_info.metrics): if tag in self.scalar_data: self.res['metrics'][i]['tag'] = tag self.res['metrics'][i]['value'].append(self.scalar_data[tag]) self.res["hparamsInfo"].append(current_hparams_info)
# Copyright (c) 2017 Dustin Doloff # Licensed under Apache License v2.0 load( ":internal.bzl", "assert_files_equal_rule", "assert_label_struct_rule", ) def assert_equal(v1, v2): """ Asserts that two values are equal. If not, fails the build """ if v1 != v2: fail("Values were not equal (" + str(v1) + ") (" + str(v2) + ")") def assert_str_equal(v1, v2): """ Asserts that the string representation of two values are equal. If not, fails the build """ assert_equal(str(v1), str(v2)) def assert_repr_equal(v1, v2): """ Asserts that the `repr` of two values are equal. If not, fails the build """ assert_equal(repr(v1), repr(v2)) def assert_files_equal(expected_file, actual_file): """ Asserts that two files are equal Args: expected_file: `label` - The file compared against actual_file: `label` - The file being tested """ name = "assert_files_equal_{hash}".format(hash = hash(expected_file + actual_file)) assert_files_equal_rule( name = name, expected_file = expected_file, actual_file = actual_file, ) def assert_label_providers(label, expected_struct): """ Asserts that a label's provider struct matches the expected struct Args: label: `Label|str` - The label or name of a label to check expected_struct: `struct` - The struct expected to match the provider's of `label` """ if type(expected_struct) != "dict": fail("expected_struct is not a dict") expected_struct_string = str(expected_struct) name = "assert_label_struct_{hash}".format(hash = hash(label + expected_struct_string)) assert_label_struct_rule( name = name, label = label, expected_struct_string = expected_struct_string, )
class Application: def __init__(self, owner, raw): self.id = raw['app_id'] self.owner_id = raw['owner_id'] self._update(owner, raw) def _update(self, owner, raw): self._raw = raw self.owner = owner self.name = raw['name'] self.type = raw['type'] self.token = raw['token'] self.description = raw.get('description') @property def as_json(self): return { 'id': str(self.id), 'owner_id': str(self.owner_id), 'description': self.description, 'name': self.name, 'owner': self.owner.as_json, 'token': self.token, }
'''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.''' # Bitcoin Cash (BCH) qpz32c4lg7x7lnk9jg6qg7s4uavdce89myax5v5nuk # Ether (ETH) - 0x843d3DEC2A4705BD4f45F674F641cE2D0022c9FB # Litecoin (LTC) - Lfk5y4F7KZa9oRxpazETwjQnHszEPvqPvu # Bitcoin (BTC) - 34L8qWiQyKr8k4TnHDacfjbaSqQASbBtTd # contact :- [email protected] """ Problem Statement: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3,5,6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below N. """ def solution(n): """Returns the sum of all the multiples of 3 or 5 below n. >>> solution(3) 0 >>> solution(4) 3 >>> solution(10) 23 >>> solution(600) 83700 """ a = 3 result = 0 while a < n: if a % 3 == 0 or a % 5 == 0: result += a elif a % 15 == 0: result -= a a += 1 return result if __name__ == "__main__": print(solution(int(input().strip())))
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified). __all__ = ['a'] # Cell def a(b): "qgerhwtejyrkafher arerhtrw" return 10
print ("Hello there welcome to Medieval Village.") print ("You have a village that you need to take care of. Choose one of the options to keep the village in good shape 1) Plant and harvest the crops 2) Use resources from the forest near the village 3) Get your defenses up") user_choice = input() user_choice = int(user_choice) if user_choice == 1: print("You planted and harvested the crops!") print("Now choose from: 2) Use resources from the forest near the village or 3) Get your defenses up ") user_choice1 = input() user_choice1 = int(user_choice1) if user_choice1 == 2 : print("You used the resources in the forest.") print("Now 3) Get your defenses up") user_choice12 = input() user_choice12 = int(user_choice12) if user_choice12 == 3 : print("You got your defenses up! Your village holds strong agianst its invaders!") print("Your village is strong! You have nothing to worry about! Game over") elif user_choice1 == 3 : print("You got your defenses up! Your village holds strong agianst its invaders!") print("Now 2) Use resources from the forest near the village") user_choice13 = input() user_choice13 = int(user_choice13) if user_choice13 == 2: print("You used resources from the forest.") print("Your village is strong! You have nothing to worry about! Game over") elif user_choice == 2 : print("You used the resources in the forest.") print("Now choose from: 1) Plant and harvest the crops or 3) Get your defenses up") user_choice2 = input() user_choice2 = int(user_choice2) if user_choice2 == 1: print("You harvested the crops!") print("Now 3) Get your defenses up") user_choice21 = input() user_choice21 = int(user_choice21) if user_choice21 == 3: print("You got your defenses up! Your village holds strong agianst its invaders!") print("Your village is strong! You have nothing to worry about! Game over") elif user_choice2 == 3: print("You got your defenses up! Your village holds strong agianst its invaders!") print("Now 1) Plant and harvest the crops") user_choice23 = input() user_choice23 = int(user_choice23) if user_choice23 == 1: print("You harvested the crops!") print("Your village is strong! You have nothing to worry about! Game over") elif user_choice == 3: print("You got your defenses up! Your village holds strong agianst its invaders!") print("Now choose from: 1) Plant and harvest the crops or 2) Use resources from the forest near the village") user_choice3 = input() user_choice3 = int(user_choice3) if user_choice3 == 1: print("You harvested the crops!") print("Now 2) Use resources from the forest near the village") user_choice31 = input() user_choice31 = int(user_choice31) if user_choice31 == 2: print("You used resources from the forest near the village.") print("Your village is strong! You have nothing to worry about! Game over") elif user_choice3 == 2: print("You used resources from the forest near the village.") print("Now 1) Plant and harvest the crops") user_choice32 = input() user_choice32 = int(user_choice32) if user_choice32 == 1: print("You harvested the crops!") print("Your village is strong! You have nothing to worry about! Game over") else : print ("Invalid entry try again!")
def solution(board, moves): # At first, make stack of each columns boardStack = [[] for _ in range(len(board[0]))] for row in board[::-1]: # Watch out, column index is subtracted by -1 for column, element in enumerate(row): if element != 0: boardStack[column].append(element) bucketStack = []; exploded = 0; for move in moves: if boardStack[(move - 1)]: pick = boardStack[(move - 1)].pop() if bucketStack: if bucketStack[-1] == pick: bucketStack.pop() exploded += 2 else: bucketStack.append(pick) else: bucketStack.append(pick) return exploded
repeat = int(input()) for x in range(repeat): inlist = list(map( int, input().split())) inlen = inlist.pop(0) avg = sum(inlist)//inlen inlist.sort() for i in range(inlen): if inlist[i] > avg: result = (inlen-i)/inlen *100 break result = 0 print("%.3f"%result, "%",sep="")
""" CCC Problem J2 Randy Zhu """ infection_limit = int(input()) patient_zeroes = int(input()) infection_rate = int(input()) infected = 0 # newly_infected = 0 # infected = 0 currently_infected = patient_zeroes # infected = 0 days = 0 while infected < infection_limit: infected += (currently_infected * infection_rate) * \ infection_rate + patient_zeroes currently_infected = infected days += 1 print(days)
#!/usr/bin/env python # # Copyright 2009-2020 NTESS. Under the terms # of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. # # Copyright (c) 2009-2020, NTESS # All rights reserved. # # Portions are copyright of other developers: # See the file CONTRIBUTORS.TXT in the top level directory # the distribution for more information. # # This file is part of the SST software package. For license # information, see the LICENSE file in the top level directory of the # distribution. clock = "100MHz" memory_clock = "100MHz" coherence_protocol = "MSI" memory_backend = "timing" memory_controllers_per_group = 1 groups = 8 memory_capacity = 16384 * 4 # Size of memory in MBs cpu_params = { "verbose" : 0, "printStats" : 1, } l1cache_params = { "clock" : clock, "coherence_protocol": coherence_protocol, "cache_frequency": clock, "replacement_policy": "lru", "cache_size": "32KB", "maxRequestDelay" : "10000", "associativity": 8, "cache_line_size": 64, "access_latency_cycles": 1, "L1": 1, "debug": "0" } bus_params = { "bus_frequency" : memory_clock } l2cache_params = { "clock" : clock, "coherence_protocol": coherence_protocol, "cache_frequency": clock, "replacement_policy": "lru", "cache_size": "32KB", "associativity": 8, "cache_line_size": 64, "access_latency_cycles": 1, "debug": "0" } memory_params = { "coherence_protocol" : coherence_protocol, "rangeStart" : 0, "clock" : memory_clock, "addr_range_start" : 0, "addr_range_end" : (memory_capacity // (groups * memory_controllers_per_group) ) * 1024*1024, } memory_backend_params = { "id" : 0, "clock" : "1333MHz", "mem_size" : str( memory_capacity // (groups * memory_controllers_per_group)) + "MiB", "max_requests_per_cycle": "-1", "addrMapper" : "memHierarchy.roundRobinAddrMapper", "addrMapper.interleave_size" : "64B", "addrMapper.row_size" : "1KiB", "channels" : 8, "channel.transaction_Q_size" : 32, "channel.numRanks" : 8, "channel.rank.numBanks" : 16, "channel.rank.bank.CL" : 12, "channel.rank.bank.CL_WR" : 10, "channel.rank.bank.RCD" : 12, "channel.rank.bank.TRP" : 12, "channel.rank.bank.dataCycles" : 2, "channel.rank.bank.pagePolicy" : "memHierarchy.simplePagePolicy", "channel.rank.bank.transactionQ" : "memHierarchy.reorderTransactionQ", "channel.rank.bank.pagePolicy.close" : 0, "printconfig" : 1, "channel.printconfig" : 0, "channel.rank.printconfig" : 0, "channel.rank.bank.printconfig" : 0, } params = { "numThreads" : 1, "cpu_params" : cpu_params, "l1_params" : l1cache_params, "bus_params" : bus_params, "l2_params" : l2cache_params, "nic_cpu_params" : cpu_params, "nic_l1_params" : l1cache_params, "memory_params" : memory_params, "memory_backend": memory_backend, "memory_backend_params" : memory_backend_params, }
""" Given the capacity of the knapsack and items specified by weights and values, return the maximum summarized value of the items that can be fit in the knapsack. Example: capacity = 5, items(value, weight) = [(60, 5), (50, 3), (70, 4), (30, 2)] result = 80 (items valued 50 and 30 can both be fit in the knapsack) The time complexity is O(n * m) and the space complexity is O(m), where n is the total number of items and m is the knapsack's capacity. """ class Item: def __init__(self, value, weight): self.value = value self.weight = weight def get_maximum_value(items, capacity): dp = [0] * (capacity + 1) for item in items: for cur_weight in reversed(range(item.weight, capacity+1)): dp[cur_weight] = max(dp[cur_weight], item.value + dp[cur_weight - item.weight]) return dp[capacity]
class TBikeTruck: def __init__(self, id, capacity, init_location): self.id = id self.capacity = capacity self.location = init_location self.bikes_count = 0 self.distance = 0 def to_json(self): return { 'id': self.id, 'location_id': self.location.id, 'loaded_bikes_count': self.bikes_count } def go_up(self): loc = self.location.at_top() if loc is not None: self.location = loc self.distance += 1 def go_down(self): loc = self.location.at_bottom() if loc is not None: self.location = loc self.distance += 1 def go_left(self): loc = self.location.at_left() if loc is not None: self.location = loc self.distance += 1 def go_right(self): loc = self.location.at_right() if loc is not None: self.location = loc self.distance += 1 def load_bike(self): if self.location.bikes_count > 0 and self.bikes_count < self.capacity: self.location.bikes_count -= 1 self.bikes_count += 1 def unload_bike(self): if self.bikes_count > 0: self.location.bikes_count += 1 self.bikes_count -= 1
class Stack: topIndex = 0 items = [None] * 64 def push(self, item): self.topIndex += 1 self.items[self.topIndex] = item def pop(self): if self.topIndex == 0: return None else: itemToReturn = self.items[self.topIndex] self.topIndex -= 1 return itemToReturn def peek(self): if self.topIndex == 0: return None else: return self.items[self.topIndex]
# Cheering Expression (6510) rinz = 2012007 scissorhands = 1162003 sweetness = 5160021 sm.setSpeakerID(rinz) sm.sendNext("Welcome! What can I do for you today? ...A gift? For me? " "Wow, a customer's never given me a gift before!") sm.giveItem(sweetness) sm.completeQuest(parentID) sm.consumeItem(scissorhands) sm.sendNext(''.join(["WOW! #t", repr(scissorhands), "#?! " "The material...the color...the sound of the blades snipping together... " "It's so beautiful! Thank you so much! You're the best, #h #! \r\n\r\n" "#fUI/UIWindow2.img/QuestIcon/4/0# \r\n" "#i", repr(sweetness), "# #t", repr(sweetness), "# x 1"])) sm.setPlayerAsSpeaker() sm.sendSay("#b(You learned the Cheering Expression from Rinz the Assistant.)")
''' Faça um progroma que leia nome e média de um aluno, guardando também a situação[aprovado or nao em um dicionário. No final, mostre o conteúdo da estrutura na tela. ''' turma = dict() turma['nome'] = str(input('Nome: ')) turma['media'] = float(input('Média: ')) if turma['media'] > 6.9: turma['situacao'] = 'Aprovado' else: turma['situacao'] ='Reprovado' print(f"Estudante {turma['nome']} com a média {turma['media']} foi {turma['situacao']}.")
# Copyright 2019 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. config_type='sweetberry' inas = [ ('sweetberry', '0x40:3', 'pp1050_a', 1.05, 0.010, 'j2', True), # R462, SOC ('sweetberry', '0x40:1', 'pp1050_st', 1.05, 0.010, 'j2', True), # R665 ('sweetberry', '0x40:2', 'pp1050_stg', 1.05, 0.010, 'j2', True), # R664 ('sweetberry', '0x40:0', 'pp1200_dram_u', 1.20, 0.010, 'j2', True), # R463 ('sweetberry', '0x41:3', 'pp1800_a', 1.80, 0.010, 'j2', True), # R556, SOC + audio ('sweetberry', '0x41:1', 'pp3300_a', 3.30, 0.010, 'j2', True), # R478 ('sweetberry', '0x41:2', 'pp3300_cam_a', 3.30, 0.010, 'j2', True), # R482 ('sweetberry', '0x41:0', 'pp3300_ec', 3.30, 0.500, 'j2', True), # R474, originally 0.01 Ohm ('sweetberry', '0x42:3', 'pp3300_g', 3.30, 0.010, 'j2', True), # R458 ('sweetberry', '0x42:1', 'pp3300_h1_g', 3.30, 0.500, 'j2', True), # R473, originally 0.01 Ohm ('sweetberry', '0x42:2', 'pp3300_hp_vbat', 3.30, 0.500, 'j2', True), # R260, originally 0 Ohm ('sweetberry', '0x42:0', 'pp3300_panel_dx', 3.30, 0.010, 'j2', True), # R476 ('sweetberry', '0x43:3', 'pp3300_rtc', 3.30, 0.010, 'j2', True), # R472 ('sweetberry', '0x43:1', 'pp3300_soc_a', 3.30, 0.100, 'j2', True), # R480, originally 0.01 Ohm ('sweetberry', '0x43:2', 'pp3300_ssd_a', 3.30, 0.010, 'j2', True), # R708 ('sweetberry', '0x43:0', 'pp3300_tcpc_g', 3.30, 0.100, 'j2', True), # R475, originally 0.01 Ohm ('sweetberry', '0x44:3', 'pp3300_trackpad_a', 3.30, 0.010, 'j3', True), # R483 ('sweetberry', '0x44:1', 'pp3300_tsp_dig_dx', 3.30, 0.010, 'j3', True), # R670 ('sweetberry', '0x44:2', 'pp3300_wlan_a', 3.30, 0.010, 'j3', True), # R479 ('sweetberry', '0x44:0', 'pp5000_a', 5.00, 0.010, 'j3', True), # R459, USB ('sweetberry', '0x45:3', 'pp950_vccio', 0.95, 0.010, 'j3', True), # R461 ('sweetberry', '0x45:1', 'ppvar_bat', 7.70, 0.010, 'j3', True), # R569 ('sweetberry', '0x45:2', 'ppvar_elv_in', 7.70, 0.010, 'j3', True), # R717 ('sweetberry', '0x45:0', 'ppvar_elvdd', 4.60, 0.010, 'j3', True), # L12, originally 0 Ohm ('sweetberry', '0x46:3', 'ppvar_gt', 1.52, 0.020, 'j3', True), # U143, originally 0 Ohm ('sweetberry', '0x46:1', 'ppvar_sa', 1.52, 0.020, 'j3', True), # U144, originally 0 Ohm ('sweetberry', '0x46:2', 'ppvar_vcc', 1.52, 0.020, 'j3', True), # U141, originally 0 Ohm ('sweetberry', '0x46:0', 'ppvar_vprim_core_a', 1.05, 0.010, 'j3', True), # R460 ]
def selectionSort(A): for i in range(len(A) - 1): index_min = i value_min = A[i] for j in range(i + 1, len(A)): if A[j] < value_min: index_min = j value_min = A[j] A[index_min] = A[i] A[i] = value_min return A def insertionSort2(A): min_index = 0 for i in range(len(A)): if A[i] < A[min_index]: min_index = i temp = A[0] A[0] = A[min_index] A[min_index] = temp for i in range(2, len(A)): value_min = A[i] j = i - 1 while value_min < A[j]: A[j + 1] = A[j] j = j - 1 A[j + 1] = value_min return A def insertionSort1(A): for i in range(1, len(A)): value_min = A[i] j = i - 1 while (j >= 0) & (value_min < A[j]): A[j + 1] = A[j] j = j - 1 A[j + 1] = value_min return A def bubbleSort1(A): for i in range(len(A)): for j in range(1, len(A)): if (A[j - 1] > A[j]): temp = A[j - 1] A[j - 1] = A[j] A[j] = temp return A def bubbleSort2(A): for i in range(len(A)): for j in range(1, len(A) - i): if (A[j - 1] > A[j]): temp = A[j - 1] A[j - 1] = A[j] A[j] = temp return A def bubbleSort3(A): for i in range(len(A)): done = True for j in range(1, len(A) - i): if (A[j - 1] > A[j]): done = False temp = A[j - 1] A[j - 1] = A[j] A[j] = temp if done: return A return A def checkSorted(A): for i in range(1, len(A)): if A[i - 1] > A[i]: return False return True
# # LeetCode # # Problem - 386 # URL - https://leetcode.com/problems/lexicographical-numbers/ # class Solution: def lexicalOrder(self, n: int) -> List[int]: ans = [] for i in range(1, n+1): ans.insert(bisect.bisect_left(ans, str(i)), str(i)) return ans
def _method(f): return lambda *l, **d: f(i, *l, **d) class o: def __init__(i, **d): i.__dict__.update(**d) def __repr__(i): return str( {k: (v.__name__ + "()" if callable(v) else v) for k, v in sorted(i.__dict__.items()) if k[0] != "_"}) def of(i, **methods): for k, f in methods.items(): i.__dict__[k] = _method(f) return i def Fred(a=2): def p(i): return i.a + i.c + 20 def lt(i, j): return i.a < j.a return of(o(a=a, b=2, c=3), say=p, lt=lt) f = Fred(a=-10000000000000000) print(f.say()) print(f.lt(Fred())) # f.say(100000000) # g = Fred(10) # print(g < f
class Solution(object): def minCost(self, costs): """ :type costs: List[List[int]] :rtype: int """ if not costs: return 0 dp = [0] * (len(costs[0])) dp[:] = costs[0] for i in xrange(1, len(costs)): d0 = d1 = d2 = 0 for j in xrange(0, 3): if j == 0: d0 = min(dp[1], dp[2]) + costs[i][0] elif j == 1: d1 = min(dp[0], dp[2]) + costs[i][1] else: d2 = min(dp[0], dp[1]) + costs[i][2] dp[0], dp[1], dp[2] = d0, d1, d2 return min(dp)
class Solution: def romanToInt(self, s: str) -> int: romanMap = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} result = 0 prev = 1000 for c in s: curr = romanMap[c] if curr > prev: result += curr - prev*2 else: result += curr prev = curr return result
''' Design a calculator which will solve all the problems correctly except for 1. 45*3 = 555 2. 56+9 = 77 3. 56/6 = 4 Your program should take two numbers, operator as input and show the output. ''' def add(n1,n2): ''' To add the given numbers ''' result = n1+n2 return result def sub(n1,n2): ''' To subtract given numbers ''' result = n1-n2 return result def mul(n1,n2): ''' To multiply given numbers ''' result = n1*n2 return result def div(n1,n2): ''' To divide the given numbers ''' result = n1/n2 return result def CalculatorLogic(num1,num2,operator): # Conditions for calculation including faulty ones if(((num1 == 3 and num2 == 45) or (num1 == 45 and num2 == 3)) and operator == '*'): # Faulty condition 1 print(f"\t\n{num1} * {num2} = 555") elif(((num1 == 56 and num2 == 9) or (num1 == 9 and num2 == 56)) and operator == '+'): # Faulty condition 2 print(f"\t\n{num1} + {num2} = 77") elif(((num1 == 56 and num2 == 6) or (num1 == 6 and num2 == 56)) and operator == '/'): # Faulty condition 3 print(f"\t\n{num1} / {num2} = 4") elif(operator == '+'): # If user wants to add numbers print(f"\t\n{num1} + {num2} = {add(num1,num2)}") elif(operator == '-'): # If user wants to subtract numbers print(f"\t\n{num1} - {num2} = {sub(num1,num2)}") elif(operator == '*'): # If user wants to multiply numbers print(f"\t\n{num1} * {num2} = {mul(num1,num2)}") elif(operator == '/'): # If user wants to divide numbers print(f"\t\n{num1} / {num2} = {div(num1,num2)}") else: print("Invalid Option, please retry") def main(): # Introducing the name of app to user print("Faulty Calculator".center(40,"-")) # Creating looping conditions for using calculator as long as user wants cont = 'y' while(cont == 'y'): # Taking required inputs n1 = int(input("Enter first number: ")) n2 = int(input("Enter second number: ")) operator = input("Enter the operator you want to use:") # Calling the main logic behind the calculator CalculatorLogic(n1,n2,operator) cont = str(input("Do you want to continue? y or n? ")) cont = cont.lower() # Thanking user for using our calculator print("Thank you for using our calculator!") if __name__ == "__main__": main()