content
stringlengths 7
1.05M
|
|---|
class ExecutionStep(object):
def run(self, db):
raise NotImplementedError('Method run(self, db) is not implemented.')
def explain(self):
raise NotImplementedError('Method explain(self) is not implemented.')
|
class A(object):
def __init__(self):
print("init")
def __call__(self):
print("call ")
a = A() #imprime init
A() #imprime call
#https://pt.stackoverflow.com/q/109813/101
|
""" stub test, remove this when there's actual testing """
def test_nothing():
""" do nothing """
|
def check_for_subfolders(folder_id, service):
new_sub_patterns = {}
folders = service.files().list(q="mimeType='application/vnd.google-apps.folder' and parents in '"+folder_id+"' and trashed = false",fields="nextPageToken, files(id, name)",pageSize=400).execute()
all_folders = folders.get('files', [])
all_files = check_for_files(folder_id, service=service)
n_files = len(all_files)
n_folders = len(all_folders)
old_folder_tree = folder_tree
if n_folders != 0:
for i, folder in enumerate(all_folders):
folder_name = folder['name']
subfolder_pattern = old_folder_tree + '/' + folder_name
new_pattern = subfolder_pattern
new_sub_patterns[subfolder_pattern] = folder['id']
print('New Pattern:', new_pattern)
all_files = check_for_files(folder['id'], service=service)
n_files = len(all_files)
new_folder_tree = new_pattern
if n_files != 0:
for file in all_files:
file_name = file['name']
new_file_tree_pattern = subfolder_pattern + "/" + file_name
new_sub_patterns[new_file_tree_pattern] = file['id']
print("Files added :", file_name)
else:
print('No Files Found')
else:
all_files = check_for_files(folder_id)
n_files = len(all_files)
if n_files != 0:
for file in all_files:
file_name = file['name']
subfolders[folder_tree + '/'+file_name] = file['id']
new_file_tree_pattern = subfolder_pattern + "/" + file_name
new_sub_patterns[new_file_tree_pattern] = file['id']
print("Files added :", file_name)
return new_sub_patterns
def check_for_files(folder_id, service):
other_files = service.files().list(q="mimeType!='application/vnd.google-apps.folder' and parents in '"+folder_id+"' and trashed = false",fields="nextPageToken, files(id, name)",pageSize=400).execute()
all_other_files = other_files.get('files', [])
return all_other_files
def get_folder_tree(folder_ids, service, folder_tree):
sub_folders = check_for_subfolders(folder_ids, service)
for i, sub_folder_id in enumerate(sub_folders.values()):
folder_tree = list(sub_folders.keys())[i]
print('Current Folder Tree : ', folder_tree)
folder_ids.update(sub_folders)
print('****************************************Recursive Search Begins**********************************************')
try:
get_folder_tree(sub_folder_id, service=service, folder_tree=folder_tree)
except:
print('---------------------------------No furtherance----------------------------------------------')
return folder_ids
|
'''
Double Ended Queue or deque is the extended version of Queue
because in deque you can add and remove form both first and last position
of the Queue.
'''
def Deque():
def __init__(self):
self._deque = []
def add_first(self,e):
'Add the item in first position.'
self._deque.insert(0,e)
def add_last(self,e):
'Add the item in last position.'
self._deque.append(e)
def delete_first(self):
'Remove item from the first position.'
self._deque.pop(0)
def delete_last(self):
'Remove item from the last position.'
self._deque.pop()
def first(self):
'Return the first item'
return self._deque[0]
def last(self):
'Return the last item'
return self._deque[-1]
def __len__(self):
'Return the length of deque'
return len(self._deque)
def is_empty(self):
'Check deque is empty or not'
if len(self._deque) == 0:
print('Deque is empty')
else:
print('Deque is not empty')
|
class Error :
def __init__(self,name,details,position):
self.name = name
self.details = details
self.position = position
def __str__(self):
return f'Error : {self.name} -> {self.details} | line :{self.position.line} col : {self.position.col}'
class IllegalCharError(Error):
def __init__(self,details,position):
super().__init__('IllegalCharError',details,position)
class InvalidSyntaxError(Error):
def __init__(self, details, position):
super().__init__('InvalidSyntaxError', details, position)
class RunTimeError(Error):
def __init__(self, details, position,context):
super().__init__('RunTimeError', details, position)
self.context = context
def __str__(self):
return self.traceBack() + '\n' + f'Error : {self.name} -> {self.details} | line :{self.position.line} col : {self.position.col}'
def traceBack(self):
result = ''
position = self.position
context = self.context
while context :
result = f'line {position.line} in {context.name}' + result
position = context.parentEntryPosition
context = context.parent
return result
|
#!/usr/bin/env python
# Copyright 2016 Zara Zaimeche
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# A common colours file. There's no good reason for this to be a thing,
# since there are common libraries for this, but I wanted to make a bad
# pun.
WHITE = (255, 255, 255)
CYAN = (0, 255, 255)
MAGENTA = (255, 0, 255)
BLACK = (0, 0, 0)
ORANGE = (255, 175, 0)
BRIGHTRED = (255, 0, 0)
RED = (155, 0, 0)
PALEGREEN = (150, 255, 150)
BRIGHTGREEN = (0, 255, 0)
GREEN = (0, 155, 0)
BRIGHTBLUE = (0, 0, 255)
BLUE = (0, 0, 155)
PALEYELLOW = (255, 255, 150)
BRIGHTYELLOW = (255, 255, 0)
YELLOW = (155, 155, 0)
DARKGREY = (50, 50, 50) # for '50' shades of grey
|
""" 75 - Desenvolva um programa que leia quatro valores pelo teclado e guarde-os em uma tupla. No final, mostre:
A) Quantas vezes apareceu o valor 9.
B) Em que posição foi digitado o primeiro valor 3.
C) Quais foram os números pares. """
n = (int(input('Digite um número: ')), int(input('Digite outro número: ')),
int(input('Digite mais um número: ')), int(input('Digite o último número: ')))
print(f'Você digitou os valores {n}')
nove = n.count(9)
if nove == 0:
print('O valor 9 não apareceu nenhuma vez.')
elif nove == 1:
print(f'O valor 9 só apareceu {nove} vez.')
else:
print(f'O valor 9 apareceu {nove} vezes')
if 3 in n:
print(f'O valor 3 apareceu na {n.index(3)+1}ª posição.')
else:
print(f'O valor 3 não foi digitado em nenhuma posição.')
print('Os valores pares digitados foram ', end='')
for p in n:
if p % 2 == 0:
print(p, end=' ')
|
"""Constants and membership tests for ASCII characters"""
NUL = 0
SOH = 1
STX = 2
ETX = 3
EOT = 4
ENQ = 5
ACK = 6
BEL = 7
BS = 8
TAB = 9
HT = 9
LF = 10
NL = 10
VT = 11
FF = 12
CR = 13
SO = 14
SI = 15
DLE = 16
DC1 = 17
DC2 = 18
DC3 = 19
DC4 = 20
NAK = 21
SYN = 22
ETB = 23
CAN = 24
EM = 25
SUB = 26
ESC = 27
FS = 28
GS = 29
RS = 30
US = 31
SP = 32
DEL = 127
controlnames = ['NUL', 'SOH', 'STX', 'ETX', 'EOT', 'ENQ', 'ACK', 'BEL',
'BS', 'HT', 'LF', 'VT', 'FF', 'CR', 'SO', 'SI', 'DLE', 'DC1', 'DC2',
'DC3', 'DC4', 'NAK', 'SYN', 'ETB', 'CAN', 'EM', 'SUB', 'ESC', 'FS',
'GS', 'RS', 'US', 'SP']
def _ctoi(c):
if type(c) == type(''):
return ord(c)
else:
return c
def isalnum(c):
return isalpha(c) or isdigit(c)
def isalpha(c):
return isupper(c) or islower(c)
def isascii(c):
return 0 <= _ctoi(c) <= 127
def isblank(c):
return _ctoi(c) in (9, 32)
def iscntrl(c):
return 0 <= _ctoi(c) <= 31 or _ctoi(c) == 127
def isdigit(c):
return 48 <= _ctoi(c) <= 57
def isgraph(c):
return 33 <= _ctoi(c) <= 126
def islower(c):
return 97 <= _ctoi(c) <= 122
def isprint(c):
return 32 <= _ctoi(c) <= 126
def ispunct(c):
return isgraph(c) and not isalnum(c)
def isspace(c):
return _ctoi(c) in (9, 10, 11, 12, 13, 32)
def isupper(c):
return 65 <= _ctoi(c) <= 90
def isxdigit(c):
return isdigit(c) or 65 <= _ctoi(c) <= 70 or 97 <= _ctoi(c) <= 102
def isctrl(c):
return 0 <= _ctoi(c) < 32
def ismeta(c):
return _ctoi(c) > 127
def ascii(c):
if type(c) == type(''):
return chr(_ctoi(c) & 127)
else:
return _ctoi(c) & 127
def ctrl(c):
if type(c) == type(''):
return chr(_ctoi(c) & 31)
else:
return _ctoi(c) & 31
def alt(c):
if type(c) == type(''):
return chr(_ctoi(c) | 128)
else:
return _ctoi(c) | 128
def unctrl(c):
bits = _ctoi(c)
if bits == 127:
rep = '^?'
elif isprint(bits & 127):
rep = chr(bits & 127)
else:
rep = '^' + chr((bits & 127 | 32) + 32)
if bits & 128:
return '!' + rep
return rep
|
graph = {
'5' : ['3','7'],
'3' : ['2', '4'],
'7' : ['8'],
'2' : [],
'4' : ['8'],
'8' : []
}
visited = set()
def dfs(visited, graph, node):
if node not in visited:
print (node)
visited.add(node)
for neighbour in graph[node]:
dfs(visited, graph, neighbour)
# Driver Code
print("Depth-First Search:-")
dfs(visited, graph, '5')
|
"""
Constants for the Shopcart Service
"""
NOT_FOUND = "Not Found"
|
#!/usr/bin/env python3
def part1(filename):
with open(filename) as f:
line = f.readline()
floor = 0
for c in line:
if c == '(':
floor += 1
elif c == ')':
floor -= 1
print(floor)
def part2(filename):
with open(filename) as f:
line = f.readline()
floor = 0
i = None
for (i, c) in enumerate(line, 1):
if c == '(':
floor += 1
elif c == ')':
floor -= 1
if floor == -1:
break
print(i)
if __name__ == '__main__':
part1('day01input.txt')
part2('day01input.txt')
|
alist = ['bob', 'alice', 'tom', 'jerry']
# for i in range(len(alist)):
# print(i, alist[i])
print(list(enumerate(alist)))
for data in enumerate(alist):
print(data)
for i, name in enumerate(alist):
print(i, name)
|
test = { 'name': 'q2',
'points': 6,
'suites': [ { 'cases': [ {'code': ">>> model.get_layer(index=0).output_shape[1] \n"
'300',
'hidden': False,
'locked': False},
{'code': ">>> model.get_layer(index=1).output_shape[1] \n"
'200',
'hidden': False,
'locked': False},
{'code': ">>> model.get_layer(index=2).output_shape[1] \n"
'100',
'hidden': False,
'locked': False},
{'code': ">>> model.get_layer(index=3).output_shape[1] \n"
'10',
'hidden': False,
'locked': False},
{'code': ">>> model.get_layer(index=3).get_config()['activation'] \n"
'\'softmax\'',
'hidden': False,
'locked': False},
{'code': ">>> model.get_layer(index=1).get_config()['activation'] \n"
'\'relu\'',
'hidden': False,
'locked': False},
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'}]}
|
def linear_search_with_sentinel(arr, key):
i = 0
arr.append(key)
while arr[i] != key:
i += 1
if i == len(arr) - 1:
return -1
return i
|
# -*- coding: utf-8 -*-
"""
Copyright (C) 2014-2016 bromix (plugin.video.youtube)
Copyright (C) 2016-2018 plugin.video.youtube
SPDX-License-Identifier: GPL-2.0-only
See LICENSES/GPL-2.0-only for more information.
"""
class RegisterProviderPath(object):
def __init__(self, re_path):
self._kodion_re_path = re_path
def __call__(self, func):
def wrapper(*args, **kwargs):
# only use a wrapper if you need extra code to be run here
return func(*args, **kwargs)
wrapper.kodion_re_path = self._kodion_re_path
return wrapper
|
# No.1/2019-06-10/68 ms/13.3 MB
class Solution:
def generateParenthesis(self, n: int) -> List[str]:
l=['()']
if n==0: return []
for i in range(1,n):
newl=[]
for string in l:
for index in range(len(string)//2+1):
temp=string[:index]+'()'+string[index:]
if temp not in newl: newl.append(temp)
l=newl
return l
|
#function start
def sumtriangle(n):
if n == 1:
return 1
else:
return n+(sumtriangle(n-1)) #recursive function
#function end
n = int(input("Enter number :"))
while (n!= -1): #loop start
print(sumtriangle(n))
n = int(input("Enter number :"))
print("Finished")
|
'''
Создание архива
'''
s, n = [int(e) for e in input().split()]
a = []
for i in range(n):
a.append(int(input()))
a.sort()
new = 0
for i in a:
if (i <= s):
s -= i
new += 1
print(new)
|
# Crie um programa que leia nome e duas notas de vários alunos e guarde tudo em uma lista composta. No final, mostre um boletim contendo a média de cada um e permita que o usuário possa mostrar as notas de cada aluno individualmente.
aluno = list()
boletim = []
while True:
nome = input('Nome: ')
nota1 = float(input('Nota 01: '))
nota2 = float(input('Nota 02: '))
media = (nota1 + nota2) /2
aluno.append(nome)
aluno.append(nota1)
aluno.append(nota2)
aluno.append(media)
boletim.append(aluno[:])
aluno.clear()
opcao = input('Deseja fazer novo cadastro [S/N]: ').strip()[0]
if opcao in 'Nn':
break
print('-'*30)
print(f'{"Nº":<4}{"Nome":<15}{"Média":>8}')
for i in range(0,len(boletim)):
print(f'{i+1:<4}{boletim[i][0]:<15}{boletim[i][3]:>8.1f}')
print('-'*30)
while True:
sair = int(input('Digite número do aluno ou 9999 para sair: '))
print('='*30)
if sair == 9999:
break
else:
print(f'As notas de {boletim[sair-1][0]}')
print(f'Nota 01: {boletim[sair-1][1]}')
print(f'Nota 02: {boletim[sair-1][2]}')
print('='*30)
#print(boletim)
|
def generator(num):
if num < 0:
yield 'negativo'
else:
yield 'positivo'
|
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"color2num": "00_utils.ipynb",
"colorize": "00_utils.ipynb",
"calc_logstd_anneal": "00_utils.ipynb",
"save_frames_as_gif": "00_utils.ipynb",
"conv2d_output_size": "00_utils.ipynb",
"num2tuple": "00_utils.ipynb",
"conv2d_output_shape": "00_utils.ipynb",
"convtransp2d_output_shape": "00_utils.ipynb",
"Saver": "00_utils.ipynb",
"printdict": "00_utils.ipynb",
"PolicyGradientRLDataset": "01_datasets.ipynb",
"QPolicyGradientRLDataset": "01_datasets.ipynb",
"PGBuffer": "02_buffers.ipynb",
"ReplayBuffer": "02_buffers.ipynb",
"MLP": "03_neuralnets.ipynb",
"CNN": "03_neuralnets.ipynb",
"Actor": "03_neuralnets.ipynb",
"CategoricalPolicy": "03_neuralnets.ipynb",
"GaussianPolicy": "03_neuralnets.ipynb",
"ActorCritic": "03_neuralnets.ipynb",
"MLPQActor": "03_neuralnets.ipynb",
"MLPQFunction": "03_neuralnets.ipynb",
"actor_critic_value_loss": "04_losses.ipynb",
"reinforce_policy_loss": "04_losses.ipynb",
"a2c_policy_loss": "04_losses.ipynb",
"ppo_clip_policy_loss": "04_losses.ipynb",
"ddpg_policy_loss": "04_losses.ipynb",
"ddpg_qfunc_loss": "04_losses.ipynb",
"td3_policy_loss": "04_losses.ipynb",
"td3_qfunc_loss": "04_losses.ipynb",
"sac_policy_loss": "04_losses.ipynb",
"sac_qfunc_loss": "04_losses.ipynb",
"ToTorchWrapper": "05_env_wrappers.ipynb",
"StateNormalizeWrapper": "05_env_wrappers.ipynb",
"RewardScalerWrapper": "05_env_wrappers.ipynb",
"BestPracticesWrapper": "05_env_wrappers.ipynb",
"polgrad_interaction_loop": "06_loops.ipynb",
"PPO": "07_algorithms.ipynb"}
modules = ["utils.py",
"datasets.py",
"buffers.py",
"neuralnets.py",
"losses.py",
"env_wrappers.py",
"loops.py",
"algorithms.py"]
doc_url = "https://jfpettit.github.io/rl_bolts/rl_bolts/"
git_url = "https://github.com/jfpettit/rl_bolts/tree/master/"
def custom_doc_links(name): return None
|
def sumofdigits(number):
sum = 0
modulus = 0
while number!=0 :
modulus = number%10
sum+=modulus
number/=10
return sum
print(sumofdigits(123))
|
class Solution:
def generate(self, numRows: int) -> List[List[int]]:
ans = []
for i in range(1, numRows+1):
level = [1] * i
if ans:
for j in range(1, i-1):
level[j] = ans[-1][j-1] + ans[-1][j]
ans.append(level)
return ans
|
def module_fuel(mass, full_mass=True):
'''Calculate the amount of fuel for each part.
With full mass also calculate the amount of fuel for the fuel.
'''
fuel_mass = (mass // 3) - 2
total = 0
if fuel_mass <= 0:
return total
elif full_mass:
total = fuel_mass + module_fuel(fuel_mass)
else:
total = fuel_mass
return total
def calculate_fuel(full_mass=True):
'''Read the file and calculate the fuel of each part.
'''
with open('input101.txt') as f:
parts = f.readlines()
test = [module_fuel(int(part.strip()), full_mass) for part in parts]
return sum(test)
if __name__ == '__main__':
''' To get the amount of fuel required without adding the mass of the fuel
pass `full_mass` as False.
'''
solution = calculate_fuel()
print(f'The amount of fuel required is {solution}')
|
def describe_pet (animal_type,pet_name):
"""Exibe informações sobre um animal de estimação"""
print("\nI have a "+ animal_type)
print("My "+animal_type+"'s name is "+pet_name.title())
#argumentos devem ser fornecidos na posição de seus respectivos parametros
describe_pet(animal_type='hamster', pet_name='harry')
|
"""
@Author : dilless
@Time : 2018/6/23 0:59
@File : __init__.py.py
"""
|
def recursive_power(x, y):
if y == 0:
return 1
if y >= 1:
return x * recursive_power(x, y - 1)
print(recursive_power(2, 10))
print(recursive_power(10, 100))
|
primary_duties=[
'agree',
'agrees',
'duty',
'you will',
'must',
'has to',
'is required',
'requires',
'warrant',
'warrants',
'you shall',
'obligated',
'is liable',
'is responsible for',
'responsibility',
'obligation',
'obligations',
'may not',
'must not',
'not permitted',
'shall not',
'shall NOT',
'will not',
'not eligible',
'nor shall you',
'accept',
'accepts'
]
duty_helpers=[
'shall',
'is to',
'to be',
'acknowledge',
'acknowledges',
'accept',
'accepts',
'understands',
'expectation'
]
secondary_duties=[
'penalty',
'fee',
'pay',
'due',
'responsibility',
'duties',
'responsible',
'expense',
'charge',
'charged',
'prohibited',
'permitted only',
'obligation',
'responsibility',
'resign',
'terminate',
'notified',
'made',
'costs',
'accompanied by',
'reimbursed',
'day',
'days',
'month',
'monts',
'week',
'weeks',
'indemnify',
'do',
'perform',
'assist',
'devote',
'hold',
'disclosed',
'provide',
'reimburse',
'salary'
]
primary_rights=[
'right',
'entitled',
'entitle'
]
right_helpers=[
'shall',
'will',
'is to',
'to be',
'acknowledge',
'acknowledges',
'accept',
'accepts'
]
secondary_rights=[
'paid',
'right',
'pay you',
'eligible',
'benefits',
'reimburse',
'receive',
'grant',
'issued',
'vest',
'reimbursable'
'bonus'
]
|
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains modules and packages for identifying sources in
an astronomical image and estimating their morphological parameters
(e.g. centroid and shape parameters).
"""
|
def export_datatable(byc):
if not "table" in byc["output"]:
return
if not "datatable_mappings" in byc:
return
if not byc["response_type"] in byc["datatable_mappings"]["io_params"]:
return
print('Content-Type: text/tsv')
print('Content-Disposition: attachment; filename='+byc["response_type"]+'.tsv')
print('status: 200')
print()
io_params = byc["datatable_mappings"]["io_params"][ byc["response_type"] ]
io_prefixes = byc["datatable_mappings"]["io_prefixes"][ byc["response_type"] ]
header = create_table_header(io_params, io_prefixes)
print("\t".join( header ))
for pgxdoc in byc["service_response"]['response']["result_sets"][0]["results"]:
line = [ ]
for p, k in io_params.items():
v = _get_nested_value(pgxdoc, k["db_key"])
if isinstance(v, list):
line.append("::".join(v))
else:
if "integer" in k["type"]:
v = int(v)
line.append(str(v))
for par, d in io_prefixes.items():
if "string" in d["type"]:
if par in pgxdoc:
line.append(str(pgxdoc[par]["id"]))
if "label" in pgxdoc[par]:
line.append(str(pgxdoc[par]["label"]))
else:
line.append("")
else:
line.append("")
line.append("")
elif "array" in d["type"]:
for pre in d["pres"]:
status = False
for o in pgxdoc[par]:
if pre in o["id"]:
line.append(str(o["id"]))
status = True
if "label" in o:
line.append(str(o["label"]))
else:
line.append("")
if status is False:
line.append("")
line.append("")
print("\t".join( line ))
exit()
################################################################################
def create_table_header(params, prefixes):
"""podmd
podmd"""
header_labs = [ ]
for par in params.keys():
header_labs.append( par )
for par in prefixes:
for pre in prefixes[par]:
header_labs.append( pre+"::id" )
header_labs.append( pre+"::label" )
return header_labs
################################################################################
def _get_nested_value(parent, dotted_key):
ps = dotted_key.split('.')
v = ""
if len(ps) == 1:
try:
v = parent[ ps[0] ]
except:
v = ""
elif len(ps) == 2:
try:
v = parent[ ps[0] ][ ps[1] ]
except:
v = ""
elif len(ps) == 3:
try:
v = parent[ ps[0] ][ ps[1] ][ ps[2] ]
except:
v = ""
elif len(ps) == 4:
try:
v = parent[ ps[0] ][ ps[1] ][ ps[2] ][ ps[3] ]
except:
v = ""
elif len(ps) == 5:
try:
v = parent[ ps[0] ][ ps[1] ][ ps[2] ][ ps[3] ][ ps[4] ]
except:
v = ""
elif len(ps) > 5:
print("¡¡¡ Parameter key "+dotted_key+" nested too deeply (>5) !!!")
return '_too_deep_'
return v
################################################################################
|
'''
Consider a currency system in which there are notes of six denominations,
namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 50, Rs. 100.
If the sum of Rs. N is input,
write a program to computer smallest number of notes that will combine to give Rs. N.
Input
The first line contains an integer T, total number of testcases.
Then follow T lines, each line contains an integer N.
Output
For each test case, display the smallest number of notes that will combine to give N, in a new line.
Constraints
1 ≤ T ≤ 1000
1 ≤ N ≤ 1000000
Example
Input
3
1200
500
242
Output
12
5
7
'''
# cook your dish here
t=int(input())
for i in range(t):
n=int(input())
c=0
c+=(n//100)
n=n%100
c+=(n//50)
n=n%50
c+=(n//10)
n=n%10
c+=(n//5)
n=n%5
c+=(n//2)
n=n%2
c+=(n//1)
n=n%1
print(c)
|
numero = int(input('Digite um número entre 0 e 9999: '))
u = numero % 10
d = numero // 10 % 10
c = numero // 100 % 10
m = numero // 1000 % 10
print('Unidade: {}\nDezena: {}\nCentena: {}\nMilhar: {}'.format(u,d,c,m))
|
#Los ficheros sirven para guardar datos .csv o bien importar datos, para diferentes situaciones.
#Para consulta o guardar datos.
#a adicionar Añadir elemento a un fichero.
#w Modo de escritura de ficheros
#r modo de lectura de ficheros
#Agregar informacion nueva en un fichero
nombre = input('Nombre :')
#+ adicionar funciones extras.
#b es para adicionar binario.
#archivo = open('ejemplo.txt', 'w+')
#archivo.write(nombre)
#archivo.close()
#Cuando ya se tenga informacion en un archivo dejaremos asi para que se vaya adicionando informacion al fichero:
archivo = open('ejemplo.txt', 'a+')
archivo.write(nombre + '\n') #Para espaciar salto de linea '\n'
archivo.close()
#Metodo de lectura de ficheros o archivos
#archivo = open('ejemplo.txt','r' )
#linea = archivo.readline()
#print(archivo.read())
#Recorrer elemento por elemento para saber si existe un dato.
#for linea in archivo.readlines():
#print(linea)
#Traer datos de fichero sin espacios en blanco por enmedio.
archivo = open('ejemplo.txt','r' )
linea = archivo.readline()
while linea != '':
linea = archivo.readline()
print(linea)
archivo.close()
|
# 给你一个二进制字符串 s(仅由 '0' 和 '1' 组成的字符串)。
# 返回所有字符都为 1 的子字符串的数目。
# 由于答案可能很大,请你将它对 10^9 + 7 取模后返回。
# 示例 1:
# 输入:s = "0110111"
# 输出:9
# 解释:共有 9 个子字符串仅由 '1' 组成
# "1" -> 5 次
# "11" -> 3 次
# "111" -> 1 次
# 示例 2:
# 输入:s = "101"
# 输出:2
# 解释:子字符串 "1" 在 s 中共出现 2 次
# 示例 3:
# 输入:s = "111111"
# 输出:21
# 解释:每个子字符串都仅由 '1' 组成
# 示例 4:
# 输入:s = "000"
# 输出:0
# 提示:
# s[i] == '0' 或 s[i] == '1'
# 1 <= s.length <= 10^5
class Solution:
def numSub(self, s: str) -> int:
if not s or "1" not in s:
return 0
count = 0
ones = s.split("0")
for i in ones:
if i == "":
continue
count += self.calculate(len(i))
return int(count % (1e9+7))
# 计算连续子集数量公式
# f(n) = n^2 - f(n-1)
def calculate(self, num: int) -> int:
f_1 = 1
i = 1
while i != num:
i += 1
f_1 = i**2 - f_1
return f_1
|
#encoding:utf-8
urls = (
'/admin/?', 'controller.admin.index',
'/admin/login', 'controller.admin.login',
'/admin/logout', 'controller.admin.logout',
#--------------user -----------
#----用户信息表----
"/admin/user_list", "controller.admin.user.user_list",
"/admin/user_read/(\d+)", "controller.admin.user.user_read",
"/admin/user_edit/(\d+)", "controller.admin.user.user_edit",
"/admin/user_delete/(\d+)", "controller.admin.user.user_delete",
#--------------end user -------
#--------------area -----------
#----区域表----
"/admin/area_list", "controller.admin.area.area_list",
"/admin/area_read/(\d+)", "controller.admin.area.area_read",
"/admin/area_edit/(\d+)", "controller.admin.area.area_edit",
"/admin/area_delete/(\d+)", "controller.admin.area.area_delete",
#--------------end area -------
#--------------policy -----------
#----政策传递----
"/admin/policy_list", "controller.admin.policy.policy_list",
"/admin/policy_read/(\d+)", "controller.admin.policy.policy_read",
"/admin/policy_edit/(\d+)", "controller.admin.policy.policy_edit",
"/admin/policy_delete/(\d+)", "controller.admin.policy.policy_delete",
#--------------end policy -------
)
|
# Databricks notebook source
# MAGIC %run ./Student-Environment
# COMMAND ----------
# MAGIC %run ./Utilities-Datasets
# COMMAND ----------
def path_exists(path):
try:
return len(dbutils.fs.ls(path)) >= 0
except Exception:
return False
def install_datasets(reinstall=False):
working_dir = working_dir_root
course_name = "apache-spark-programming-with-databricks"
version = "v02"
min_time = "2 minute"
max_time = "5 minutes"
print(f"Your working directory is\n{working_dir}\n")
# You can swap out the source_path with an alternate version during development
# source_path = f"dbfs:/mnt/work-xxx/{course_name}"
source_path = f"wasbs://courseware@dbacademy.blob.core.windows.net/{course_name}/{version}"
print(f"The source for this dataset is\n{source_path}/\n")
# Change the final directory to another name if you like, e.g. from "datasets" to "raw"
target_path = f"{working_dir}/datasets"
existing = path_exists(target_path)
if not reinstall and existing:
print(f"Skipping install of existing dataset to\n{target_path}")
return
# Remove old versions of the previously installed datasets
if existing:
print(f"Removing previously installed datasets from\n{target_path}")
dbutils.fs.rm(target_path, True)
print(f"""Installing the datasets to {target_path}""")
print(f"""\nNOTE: The datasets that we are installing are located in Washington, USA - depending on the
region that your workspace is in, this operation can take as little as {min_time} and
upwards to {max_time}, but this is a one-time operation.""")
dbutils.fs.cp(source_path, target_path, True)
print(f"""\nThe install of the datasets completed successfully.""")
install_datasets(False)
|
class DungeonTile:
def __init__(self, canvas_tile, is_obstacle):
self.canvas_tile = canvas_tile
self.is_obstacle = is_obstacle
|
#!/usr/bin/env python3
"""Write a function which takes a float n as
argument and returns the floor of the float"""
def floor(n: float) -> int:
"""return int part of n
Args:
n (float): arg
Returns:
int: value int of np
"""
return int(n)
|
########
# Copyright (c) 2018 Cloudify Platform Ltd. 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.
############
class DeploymentModificationState(object):
STARTED = 'started'
FINISHED = 'finished'
ROLLEDBACK = 'rolledback'
STATES = [STARTED, FINISHED, ROLLEDBACK]
END_STATES = [FINISHED, ROLLEDBACK]
class SnapshotState(object):
CREATED = 'created'
FAILED = 'failed'
CREATING = 'creating'
UPLOADED = 'uploaded'
STATES = [CREATED, FAILED, CREATING, UPLOADED]
END_STATES = [CREATED, FAILED, UPLOADED]
class ExecutionState(object):
TERMINATED = 'terminated'
FAILED = 'failed'
CANCELLED = 'cancelled'
PENDING = 'pending'
STARTED = 'started'
CANCELLING = 'cancelling'
FORCE_CANCELLING = 'force_cancelling'
KILL_CANCELLING = 'kill_cancelling'
QUEUED = 'queued'
SCHEDULED = 'scheduled'
STATES = [TERMINATED, FAILED, CANCELLED, PENDING, STARTED,
CANCELLING, FORCE_CANCELLING, KILL_CANCELLING, QUEUED, SCHEDULED]
WAITING_STATES = [SCHEDULED, QUEUED]
QUEUED_STATE = [QUEUED]
END_STATES = [TERMINATED, FAILED, CANCELLED]
# needs to be separate because python3 doesn't allow `if` in listcomps
# using names from class scope
ExecutionState.ACTIVE_STATES = [
state for state in ExecutionState.STATES
if state not in ExecutionState.END_STATES and
state not in ExecutionState.WAITING_STATES
]
class VisibilityState(object):
PRIVATE = 'private'
TENANT = 'tenant'
GLOBAL = 'global'
STATES = [PRIVATE, TENANT, GLOBAL]
class AgentState(object):
CREATING = 'creating'
CREATED = 'created'
CONFIGURING = 'configuring'
CONFIGURED = 'configured'
STARTING = 'starting'
STARTED = 'started'
STOPPING = 'stopping'
STOPPED = 'stopped'
DELETING = 'deleting'
DELETED = 'deleted'
RESTARTING = 'restarting'
RESTARTED = 'restarted'
RESTORED = 'restored'
UPGRADING = 'upgrading'
UPGRADED = 'upgraded'
NONRESPONSIVE = 'nonresponsive'
FAILED = 'failed'
STATES = [CREATING, CREATED, CONFIGURING, CONFIGURED, STARTING, STARTED,
STOPPING, STOPPED, DELETING, DELETED, RESTARTING, RESTARTED,
UPGRADING, UPGRADED, FAILED, NONRESPONSIVE, RESTORED]
class PluginInstallationState(object):
PENDING = 'pending-install'
INSTALLING = 'installing'
INSTALLED = 'installed'
ERROR = 'error'
PENDING_UNINSTALL = 'pending-uninstall'
UNINSTALLING = 'uninstalling'
UNINSTALLED = 'uninstalled'
class BlueprintUploadState(object):
PENDING = 'pending'
VALIDATING = 'validating'
UPLOADING = 'uploading'
EXTRACTING = 'extracting'
PARSING = 'parsing'
UPLOADED = 'uploaded'
FAILED_UPLOADING = 'failed_uploading'
FAILED_EXTRACTING = 'failed_extracting'
FAILED_PARSING = 'failed_parsing'
FAILED_EXTRACTING_TO_FILE_SERVER = 'failed_extracting_to_file_server'
INVALID = 'invalid'
FAILED_STATES = [FAILED_UPLOADING, FAILED_EXTRACTING, FAILED_PARSING,
FAILED_EXTRACTING_TO_FILE_SERVER, INVALID]
END_STATES = FAILED_STATES + [UPLOADED]
STATES = END_STATES + [PENDING, UPLOADING, EXTRACTING, PARSING]
|
class loss(object):
def __init__(self):
self.last_input = None
self.grads = {}
self.grads_cuda = {}
def loss(self, x, labels):
raise NotImplementedError
def grad(self, x, labels):
raise NotImplementedError
def loss_cuda(self, x, labels):
raise NotImplementedError
def grad_cuda(self, x, labels):
raise NotImplementedError
|
def example_function(arg1: int, arg2: int =1) -> bool:
"""
This is an example of a docstring that conforms to the Google style guide.
The indentation uses four spaces (no tabs). Note that each section starts
with a header such as `Arguments` or `Returns` and its contents is indented.
Arguments:
arg1: This description for this argument fits on one line.
arg2: This description is too long to fit on a
single line. Note that it is continued by being indented.
Returns:
: Stating the return type here is optional.
We can continue putting explanations in this section as long as the text
is indented.
This text is no longer indented and therefore not part of the `Returns`
section.
Raises:
ValueError: This is exception is raised when arg1 and arg2 are equal.
Examples:
Code block 1.
>>> a = 0
>>> a
0
Code block 2.
>>> b = 1
>>> b
1
"""
if arg1 == arg2:
raise ValueError("`arg1` and `arg2` cannot be equal.")
if arg1 > arg2:
return True
else:
return False
|
'''
Visualizing USA Medal Counts by Edition: Line Plot
Your job in this exercise is to visualize the medal counts by 'Edition' for the USA. The DataFrame has been pre-loaded for you as medals.
INSTRUCTIONS
100XP
Create a DataFrame usa with data only for the USA.
Group usa such that ['Edition', 'Medal'] is the index. Aggregate the count over 'Athlete'.
Use .unstack() with level='Medal' to reshape the DataFrame usa_medals_by_year.
Construct a line plot from the final DataFrame usa_medals_by_year. This has been done for you, so hit 'Submit Answer' to see the plot!
'''
# Create the DataFrame: usa
usa = medals[medals.NOC == 'USA']
# Group usa by ['Edition', 'Medal'] and aggregate over 'Athlete'
usa_medals_by_year = usa.groupby(['Edition', 'Medal'])['Athlete'].count()
# Reshape usa_medals_by_year by unstacking
usa_medals_by_year = usa_medals_by_year.unstack(level='Medal')
# Plot the DataFrame usa_medals_by_year
usa_medals_by_year.plot()
plt.show()
|
class ArrayList:
DEFAULT_CAPACITY = 64
def __init__(self, physicalSize: int = 0):
self.data = None
self.logicalSize = 0
self.physicalSize = self.DEFAULT_CAPACITY
if physicalSize > 1:
self.physicalSize = physicalSize
self.data = [0] * self.physicalSize
def size(self) -> int:
return self.logicalSize
def isEmpty(self) -> bool:
return self.logicalSize == 0
def get(self, index: int) -> int:
if index < 0 or index >= self.logicalSize:
raise RuntimeError("[PANIC - IndexOutOfBounds]")
return self.data[index]
def set(self, index: int, element: object) -> None:
if index < 0 or index >= self.logicalSize:
raise RuntimeError("[PANIC - IndexOutOfBounds]")
self.data[index] = element
def insert(self, index: int, element: object) -> None:
if index < 0 or index > self.logicalSize:
raise RuntimeError("[PANIC - IndexOutOfBounds]")
if self.logicalSize == self.physicalSize:
newCapacity = self.DEFAULT_CAPACITY
if self.physicalSize >= self.DEFAULT_CAPACITY:
newCapacity = self.physicalSize + (self.physicalSize >> 1)
temp = [0] * newCapacity
for i in range(self.logicalSize):
temp[i] = self.data[i]
self.data = temp
self.physicalSize = newCapacity
for i in range(self.logicalSize, index, -1):
self.data[i] = self.data[i - 1]
self.data[index] = element
self.logicalSize += 1
def remove(self, index: int) -> None:
if index < 0 or index >= self.logicalSize:
raise RuntimeError("[PANIC - IndexOutOfBounds]")
for i in range(index + 1, self.logicalSize):
self.data[i - 1] = self.data[i]
self.logicalSize -= 1
self.data[self.logicalSize] = None
def front(self) -> int:
return self.get(0)
def back(self) -> int:
return self.get(self.logicalSize - 1)
def prepend(self, element: object) -> None:
self.insert(0, element)
def append(self, element: object) -> None:
self.insert(self.logicalSize, element)
def poll(self) -> None:
self.remove(0)
def eject(self) -> None:
self.remove(self.logicalSize - 1)
def capacity(self) -> int:
return self.physicalSize
def shrink(self) -> None:
temp = [0] * self.logicalSize
for i in range(self.logicalSize):
temp[i] = self.data[i]
self.data = temp
self.physicalSize = self.logicalSize
|
#!/usr/bin/env python3
class Style:
"""Shortcuts to terminal styling escape sequences"""
BOLD = "\033[1m"
END = "\033[0m"
FG_Black = "\033[30m"
FG_Red = "\033[31m"
FG_Green = "\033[32m"
FG_Yellow = "\033[33m"
FG_Blue = "\033[34m"
FG_Magenta = "\033[35m"
FG_Cyan = "\033[36m"
FG_White = "\033[37m"
BG_Black = "\033[40m"
BG_Red = "\033[41m"
BG_Green = "\033[42m"
BG_Yellow = "\033[43m"
BG_Blue = "\033[44m"
BG_Magenta = "\033[45m"
BG_Cyan = "\033[46m"
BG_White = "\033[47m"
@staticmethod
def bold(string):
return f"{Style.BOLD}{string}{Style.END}"
@staticmethod
def red(string):
return f"{Style.FG_Red}{string}{Style.END}"
@staticmethod
def green(string):
return f"{Style.FG_Green}{string}{Style.END}"
@staticmethod
def blue(string):
return f"{Style.FG_Blue}{string}{Style.END}"
|
# Function for nth Fibonacci number
def Fibonacci(n):
# First Fibonacci number is 0
if n == 0:
return 0
# Second Fibonacci number is 1
elif n == 1:
return 1
else:
return Fibonacci(n - 1) + Fibonacci(n - 2)
k = input("Enter a Number. Do not enter any string or symbol")
try:
if int(k) >= 0:
for i in range(int(k)):
print(Fibonacci(i))
else:
print("its a negative number")
except:
print("Hey stupid enter only number")
|
# 字节数组 bytearray 可变的
print(bytearray())
print(bytearray(1)) # 整数
print(bytearray([1, 2, 3, 4])) # 可迭代
print(bytearray("hello,world", encoding='utf-8')) # 字符串 encod
ba = bytearray([1, 2, 3, 4])
print("更改前:", ba)
ba[0] = 2
print("更改后:", ba)
|
"""
Conversion functions
"""
# Depth and length conversions
def ft_to_m(inputvalue):
"""
Converts feet to metres.
Parameters
----------
inputvalue : float
Input value in feet.
Returns
-------
float
Returns value in metres.
"""
return inputvalue * 0.3048
def m_to_ft(inputvalue):
"""
Converts metres to feet.
Parameters
----------
inputvalue : float
Input value in metres.
Returns
-------
float
Returns value in feet.
"""
return inputvalue * 3.28084
def ft_to_in(inputvalue):
"""
Converts feet to inches.
Parameters
----------
inputvalue : float
Input value in feet.
Returns
-------
float
Returns value in inches.
"""
return inputvalue * 12
def in_to_ft(inputvalue):
"""
Converts inches to feet.
Parameters
----------
inputvalue : float
Input value in inches.
Returns
-------
float
Returns value in feet.
"""
return inputvalue / 12
# Velocity / Slowness conversions
def velocity_to_slowness(inputvalue):
"""
Converts velocity to slowness.
Parameters
----------
inputvalue : float
Input value in velocity units.
Returns
-------
float
Returns value in slowness units.
"""
return 1000000/inputvalue
def slowness_to_velocity(inputvalue):
"""
Converts slowness to velocity.
Parameters
----------
inputvalue : float
Input value in slowness units.
Returns
-------
float
Returns value in velocity units.
"""
return 1000000/inputvalue
# Temperature conversions
def temperature_convert(inputvalue, inputunits, outputunits):
"""
Converts temperature from one unit to another.
Parameters
----------
inputvalue : float
Input temperature value
inputunits : string
Input temperature units:
c = celsius
f = fahrenheit
k = kelvin
outputunits : string
Output temperature units:
c = celsius
f = fahrenheit
k = kelvin
Returns
-------
float
Returns temperature value in required units.
"""
if inputunits.lower() == "c":
if outputunits.lower() == "f":
return (9/5)*inputvalue+32
elif outputunits.lower() == "k":
return inputvalue + 273.15
elif outputunits.lower() == "c":
return inputvalue
if inputunits.lower() == "f":
if outputunits.lower() == "c":
return (5/9)*inputvalue-32
elif outputunits.lower() == "k":
return (inputvalue-32) * (5/9)+273.15
elif outputunits.lower() == "f":
return inputvalue
if inputunits.lower() == "k":
if outputunits.lower() == "c":
return inputvalue - 273.15
elif outputunits.lower() == "f":
return (inputvalue-273.15)*(9/5)+32
elif outputunits.lower() == "k":
return inputvalue
units = ["k", "c", "f"]
if inputunits.lower() not in units or outputunits.lower() not in units:
raise Exception("Enter a valid temperature inputunit or outputunit value. Must be: c, f or k")
|
"""
https://leetcode.com/problems/insert-interval/
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
Example 1:
Input: intervals = [[1,3],[6,9]], newInterval = [2,5]
Output: [[1,5],[6,9]]
Example 2:
Input: intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8]
Output: [[1,2],[3,10],[12,16]]
Explanation: Because the new interval [4,8] overlaps with [3,5],[6,7],[8,10].
Example 3:
Input: intervals = [], newInterval = [5,7]
Output: [[5,7]]
Example 4:
Input: intervals = [[1,5]], newInterval = [2,3]
Output: [[1,5]]
Example 5:
Input: intervals = [[1,5]], newInterval = [2,7]
Output: [[1,7]]
Constraints:
0 <= intervals.length <= 104
intervals[i].length == 2
0 <= intervals[i][0] <= intervals[i][1] <= 105
intervals is sorted by intervals[i][0] in ascending order.
newInterval.length == 2
0 <= newInterval[0] <= newInterval[1] <= 105
"""
# time complexity: O(n), space complexity: O(n)
# this solution is provided by @StefanPochmann in discussion area.
# Don't focus on O(logn) time complexity, focus on the solution first.
class Solution:
def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]:
left, right = [], []
new = newInterval
for interval in intervals:
if interval[1] < new[0]:
left.append(interval)
elif interval[0] > new[1]:
right.append(interval)
else:
new[0] = min(new[0], interval[0])
new[1] = max(new[1], interval[1])
return left + [newInterval] + right
|
def checkpalindromic(num):
i = 1
newNum = num
while i <= 50:
newNum = newNum + int(str(newNum)[::-1])
i = i + 1
if str(newNum) == str(newNum)[::-1]:
return True
return False
ans = 0
for i in range(1,10000):
if not checkpalindromic(i):
ans += 1
print(ans)
|
with open('mar27') as f:
content = f.readlines()
for line in content:
split = line.split(' ')
if split[0] == 'Episode:':
print("("+str(int(split[1])) + "," + split[3].split("\n")[0] + ")")
|
mystring="hello world"
#Print Complete string
print(mystring)
print(mystring[::])
#indexing of string
print(mystring[0])
print(mystring[4])
#slicing
print(mystring[1:7])
print(mystring[0:10:2])
# Methods
print(mystring.upper())
print(mystring.split())
#formatting
print("hello world {},".format("Loki"))
print("hello world {}, {}, {}".format("Loki", "INSERTING", "NEWFORMATTING"))
print("hello world {1}, {2}, {0}".format("By Loki", "INSERTING", "NEWFORMATTING"))
|
'''
Fuente teorica y base: Scientia et Technica Año XIII, No x, Mes de 200x. Universidad Tecnológica de Pereira. ISSN 0122-1701
Referencia en código: https://repl.it/talk/learn/Python-Quine-McCluskey-Algorithm/14461
Funcionamiento del algoritmo
1. Busqueda de implicantes primos
2. Hacer tabla de implicantes primos
3. Encontrar tabla de implicantes primos
'''
# Comparar dos strings buscando si tienen un valor en común
# Devuelve la posición del valor diferente.
def compBinary( s1, s2 ):
cont = 0
position = 0
for pos in range( len( s1 ) ):
if( s1[ pos ] != s2[ pos ] ):
cont += 1
position = pos
if( cont == 1 ):
return True, position
else:
return False, None
#Compara si el numero es igual a un implicante
#Devuelve un valor de verdad
def compBinarySame( term, number ):
for i in range( len( term ) ):
if term[i] != '-':
if term[i] != number[i]:
return False
return True
# Comprueba si hay parejas con elementos reducibles y crea un nuevo grupo
def combinePairs( group, result ):
# Define el tamaño del grupo
size = len(group) -1
# Inicializa lista para verificar comprobación
check = [ ]
# Crea el nuevo grupo de terminos
next_group = [ [ ] for x in range( size )]
# Comprueba cada elemento del grupo comparandolo con el siguiente
for i in range( size ):
for element in group[ i ]:
for element2 in group[ i + 1 ]:
checkEqual, pos = compBinary( element, element2 )
if ( checkEqual == True ):
# Actualización de la lista de verificación
check.append( element )
check.append( element2 )
#Anula los valores simplificables con un ( "-" )
new_element = list( element )
new_element [ pos ] = '-'
new_element = "".join( new_element )
next_group[ i ].append( new_element )
for i in group:
for j in i:
if j not in check:
result.append(j)
return next_group, result
# Descarta listas repetidas en la tabla
def remove_redundant( group ):
new_group = [ ]
for j in group:
new=[ ]
for i in j:
if i not in new:
new.append( i )
new_group.append( new )
return new_group
# Función de comprobación para grupos vacios
# Retorna un valor booleano en respuesta
def check_empty(group):
if len( group ) == 0:
return True
else:
cont = 0
for i in group:
if i:
cont+=1
if ( cont == 0 ):
return True
return False
# Busca los implicantes esenciales
def find_prime(Chart):
prime = [ ]
for x in range( len( Chart[ 0 ] ) ):
cont = 0
pos = 0
for y in range( len( Chart ) ):
# implicante especial
if Chart[ y ][ x ] == 1:
cont += 1
pos = y
if ( cont == 1 ):
prime.append( pos )
return prime
# Comprueba la condición para el algoritmo de patrick
def checkAllZeros( Chart ):
for i in Chart:
for j in i:
if j != 0:
return False
return True
# Cambiar de binario a letra
def binaryToLetter( s ):
result = ''
c = 'a'
n = 0
for i in range(len(s)):
if s[i] == '1':
result = result + c
elif s[i] == '0':
result = result + c+'\''
n += 1
c = chr( ord( c ) + 1 )
return result
def reductFun( fun, n ):
# transformación de lista en enteros
fun = list( map( int, fun ) )
# Crea la lista inicial
group = [ [ ] for x in range (n + 1 )]
for i in range( len( fun )):
# Conversor a binario
fun[ i ] = bin( fun[ i ] )[ 2: ]
if len( fun[ i ]) < n:
# Completar el término con ceros
for j in range( n - len( fun[ i ] ) ):
fun[ i ] = '0'+ fun[ i ]
# grupos de 1
index = fun[ i ].count( '1' )
# Sub grupos
group[ index ].append( fun[ i ])
all_group = [ ]
result = [ ]
# Combinar las parejas que no han sido conbinadas
while check_empty( group ) == False:
all_group.append( group )
next_group, result = combinePairs( group, result )
group = remove_redundant( next_group )
s = ""
for i in result:
s = s + binaryToLetter( i ) + " + "
# - 3 para eliminar el " + " extra
return s[ :( len( s ) - 3 ) ]
def main():
fun = [ 0, 3 ]
n = 2
print( reductFun( fun, n ) )
if __name__ == "__main__":
main()
|
# Copyright © 2020 Province of British Columbia
#
# 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.
"""Test Suite data used across many tests.
Test array used in multiple pytests, and several PPR transactions that can be used in tests.
"""
# testdata pattern is ({str: environment}, {expected return value})
TEST_SCHEMAS_DATA = [
('address.json'),
('amendmentStatement.json'),
('baseDebtor.json'),
('changeStatement.json'),
('clientParty.json'),
('courtOrder.json'),
('dischargeStatement.json'),
('draft.json'),
('draftSummary.json'),
('financingStatement.json'),
('financingStatementHistory.json'),
('generalCollateral.json'),
('party.json'),
('payment.json'),
('personName.json'),
('renewalStatement.json'),
('searchQuery.json'),
('searchQueryResult.json'),
('searchSummary.json'),
('vehicleCollateral.json')
]
|
## Advent of Code 2018: Day 8
## https://adventofcode.com/2018/day/8
## Jesse Williams
## Answers: [Part 1]: 36566, [Part 2]: 30548
class Node(object):
def __init__(self, chs, mds):
self.header = (chs, mds) # number of child nodes and metadata entries as specified in the node header
self.childNodes = [] # list of all child nodes (instances of Node class)
self.metadataList = [] # list of metadata entries (ints)
def getMetadataSum(self):
# Returns the sum of all metadata in this node and all child nodes.
Sum = 0
for node in self.childNodes:
Sum += node.getMetadataSum()
Sum += sum(self.metadataList)
return Sum
def getNodeValue(self):
value = 0
children = self.header[0]
if children == 0: # no child nodes
return sum(self.metadataList)
else:
for mdEntry in self.metadataList:
if (0 < mdEntry <= children): # (if mdEntry > children or mdEntry == 0, nothing is added to the value)
value += self.childNodes[mdEntry-1].getNodeValue()
return value
def readNode(tree, ptr, n):
newNodes = []
for _ in range(n):
(children, metadata) = (tree[ptr], tree[ptr+1])
newNode = Node(children, metadata)
ptr += 2
newChildNodes, ptr = readNode(tree, ptr, children) # if there were no children, loop inside this function will pass
newNode.childNodes += newChildNodes
# At the end of each iteration (after we return from any recursion), read the metadata at the end of the node.
newNode.metadataList = tree[ptr : ptr+metadata]
ptr += metadata
newNodes.append(newNode)
return newNodes, ptr
if __name__ == "__main__":
with open('day8_input.txt') as f:
treeStr = f.read()
tree = [int(s) for s in treeStr.split()]
# Start the recursive chain with the pointer at 0 and the number of children at 1 (the root node).
# The main call to this function will return the root node object with all other child nodes nested inside.
rootNode = readNode(tree, 0, 1)[0][0]
## Part 1
print('\nThe sum of all metadata entries in the tree is {}.'.format(rootNode.getMetadataSum()))
## Part 2
print('\nThe "value" of the root node is {}.'.format(rootNode.getNodeValue()))
|
'A somewhat inefficient (because of string.index) cypher'
plaintext = 'meet me at the usual place'
fromLetters = 'abcdefghijklmnopqrstuv0123456789 '
toLetters = '6n4pde3fs 2c1ivjr05lq8utbgam7hk9o'
for plaintext_char in plaintext:
from_letters_index: int = fromLetters.index(plaintext_char)
encrypted_letter: str = toLetters[from_letters_index]
print(f'{plaintext_char} -> {encrypted_letter}')
print()
cyphertext = '1ddlo1do6lolfdoq5q6cojc64d'
for cyphertext_char in cyphertext:
to_letters_index: int = toLetters.index(cyphertext_char)
decrypted_letter: str = fromLetters[to_letters_index]
print(decrypted_letter, end='')
|
def common_ground(s1,s2):
words = s2.split()
return ' '.join(sorted((a for a in set(s1.split()) if a in words),
key=lambda b: words.index(b))) or 'death'
|
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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.
#
# NOTE: This class is auto generated by the jdcloud code generator program.
class VmInfo(object):
def __init__(self, id=None, region=None, az=None, name=None, hostName=None, imageType=None, instanceType=None, description=None, subnetId=None, tags=None, cloudID=None, keyNames=None, elasticIpAddress=None, privateIpAddress=None, status=None, createdTime=None, imageId=None, securityGroupIds=None):
"""
:param id: (Optional) 资源ID,如果为空,则执行创建操作,否则执行修改操作
:param region: (Optional) 可用区,根据各云平台规范填写
:param az: (Optional) 云主机所属的可用区
:param name: (Optional) 云主机名称
:param hostName: (Optional) 云主机
:param imageType: (Optional)
:param instanceType: (Optional)
:param description: (Optional) 云主机描述
:param subnetId: (Optional) 子网ID
:param tags: (Optional)
:param cloudID: (Optional) 所属云提供商ID
:param keyNames: (Optional) 密钥对名称,jd当前只支持传入一个
:param elasticIpAddress: (Optional) 主网卡主IP绑定弹性IP的地址
:param privateIpAddress: (Optional) 私有ip地址
:param status: (Optional) 云主机状态
:param createdTime: (Optional) 创建时间
:param imageId: (Optional) 镜像ID
:param securityGroupIds: (Optional) 安全组ID
"""
self.id = id
self.region = region
self.az = az
self.name = name
self.hostName = hostName
self.imageType = imageType
self.instanceType = instanceType
self.description = description
self.subnetId = subnetId
self.tags = tags
self.cloudID = cloudID
self.keyNames = keyNames
self.elasticIpAddress = elasticIpAddress
self.privateIpAddress = privateIpAddress
self.status = status
self.createdTime = createdTime
self.imageId = imageId
self.securityGroupIds = securityGroupIds
|
#contador = 0
#print("2 elevado a la" + str(contador) + " es igual a: " + str(2**contador))
contador = 1
print("2 elevado a la" + str(contador) + " es igual a: " + str(2**contador))
|
# Building a stack using python list
class Stack:
def __init__(self):
self.items = []
def is_empty(self):
return self.items == []
def push(self, item):
self.items.append(item)
def pop(self):
if self.is_empty() == True:
return None
else:
return self.items.pop()
def top_stack(self):
if not self.is_empty():
return self.items[-1]
# Testing
MyStack = Stack()
MyStack.push("Web Page 1")
MyStack.push("Web Page 2")
MyStack.push("Web Page 3")
print (MyStack.items)
print(MyStack.top_stack())
MyStack.pop()
MyStack.pop()
print(MyStack.pop())
|
entrada = input()
coste_avion, coste_coche, coste_habitacion, coste_comida, min_amigos, maximo_amigos = entrada.split()
amigos = []
costes_personas = []
valor_pequeño = 0
numero_amigos = 0
for x in range(int(min_amigos), int(maximo_amigos)+1):
numero_coches = 0
if x % 5 == 0:
numero_coches = x//5
else:
numero_coches = x//5 + 1
numero_habitaciones = 0
if x % 3 == 0:
numero_habitaciones = x//3
else:
numero_habitaciones = x//3 + 1
coste_persona_coche = int(coste_coche)*numero_coches//x
coste_persona_habitacion = int(coste_habitacion)*numero_habitaciones//x
coste_persona_total = coste_persona_coche + \
coste_persona_habitacion+int(coste_comida)
costes_personas.append(coste_persona_total)
amigos.append(x)
print(f'{x} friends. Cost per person by plane: {int(coste_avion)}. Cost per person by car: {coste_persona_total}')
valor_pequeño = costes_personas[0]
numero_amigos = amigos[0]
medio_transporte = ''
for x in range(len(costes_personas)):
if costes_personas[x] < valor_pequeño:
valor_pequeño = costes_personas[x]
numero_amigos = amigos[x]
medio_transporte = 'car'
if valor_pequeño > int(coste_avion):
numero_amigos = amigos[len(amigos)-1]
valor_pequeño = int(coste_avion)
medio_transporte = 'plane'
print(
f'The optimal number of friends are: {numero_amigos}, and the total cost going by {medio_transporte} is {valor_pequeño*numero_amigos}')
|
# coding=utf-8
"""Score problem dynamic programming solution Python implementation."""
def sp(n):
dp = [0] * (n + 1)
dp[0] = 1
for i in range(3, n + 1):
dp[i] += dp[i - 3]
for i in range(5, n + 1):
dp[i] += dp[i - 5]
for i in range(10, n + 1):
dp[i] += dp[i - 10]
return dp[n]
if __name__ == "__main__":
for x in range(101):
print(x, sp(x))
|
def maxArea(height) -> int:
res=0
length=len(height)
for x in range(length):
if height[x]==0:
continue
prev_y=0
for y in range(length-1,x,-1):
if (height[y]<=prev_y):
continue
prev_y=height[y]
area=min(height[x],height[y])*(y-x)
if (res<area):
res=area
return res
print(maxArea([2,3,4,5,18,17,6]))
|
# --- Day 8: Seven Segment Search ---
# Each digit of a seven-segment display is rendered by turning on or off any of seven segments named a through g:
# So, to render a 1, only segments c and f would be turned on; the rest would be off.
# To render a 7, only segments a, c, and f would be turned on.
#
# For each display, you watch the changing signals for a while, make a note of all ten unique signal patterns you see,
# and then write down a single four digit output value (your puzzle input).
# Using the signal patterns, you should be able to work out which pattern corresponds to which digit.
# Each entry consists of ten unique signal patterns, a | delimiter, and finally the four digit output value.
# Because the digits 1, 4, 7, and 8 each use a unique number of segments,
# you should be able to tell which combinations of signals correspond to those digits.
#
# --- Part 1 ---
# In the output values, how many times do digits 1, 4, 7, or 8 appear?
test_input = [[num.strip().split(" ") for num in line.split("|")]
for line in open('resources/test_input', 'r').readlines()]
test_input_2 = [[num.strip().split(" ") for num in line.split("|")]
for line in open('resources/test_input_2', 'r').readlines()]
val_input = [[num.strip().split(' ') for num in line.split('|')]
for line in open('resources/val_input', 'r').readlines()]
print(test_input[0])
def find_digit_in_segments(display) -> int:
"""
Computes how many instances of a specific digit are located in the given input.
:param display: The input of a seven segment split at '|' as delimiter.
:return: Sum of the counted digits.
"""
num_digits = 0
# Check each row of the segment display
for digit in display:
# Check each single segment
for segment in digit[1]:
# Increment the output if the number read is either of [1, 4, 7, 8]
if len(segment) == 2 or len(segment) == 3 or len(segment) == 4 or len(segment) == 7:
num_digits += 1
return num_digits
def compute_sum_output(display) -> int:
"""
Computes the digit representation for the output of every line and returns the sum of these outputs.
Needs to determine the character->digit mapping new for each single line.
:param display: Line wise input of the seven segment. Split at '|' as delimiter.
:return: Sum of the output numbers per line.
"""
sum_output = 0
# Filter the obvious numbers from the display input
for digit in display:
known = {}
for segment in digit[0]:
if len(segment) == 2:
known[1] = set(segment)
elif len(segment) == 4:
known[4] = set(segment)
# Filter the numbers from the output
nums = ''
for _segment in digit[1]:
if len(_segment) == 2:
nums += '1'
elif len(_segment) == 3:
nums += '7'
elif len(_segment) == 4:
nums += '4'
elif len(_segment) == 5:
if set(_segment).issuperset(known[1]):
nums += '3'
elif len(set(_segment) & known[4]) == 3:
nums += '5'
else:
nums += '2'
elif len(_segment) == 6:
if not set(_segment).issuperset(known[1]):
nums += '6'
elif set(_segment).issuperset(known[4]):
nums += '9'
else:
nums += '0'
elif len(_segment) == 7:
nums += '8'
sum_output += int(nums)
return sum_output
print(f'Solution test task 01: {find_digit_in_segments(test_input)}')
print(f'Solution test 02 task 01: {find_digit_in_segments(test_input_2)}')
print(f'Solution validation task 01: {find_digit_in_segments(val_input)}')
print('----------------------------')
print(f'Solution test task 02: {compute_sum_output(test_input)}')
print(f'Solution test 2 task 02: {compute_sum_output(test_input_2)}')
print(f'Solution validation task 02: {compute_sum_output(val_input)}')
|
class Solution:
def checkIfExist(self, arr: List[int]) -> bool:
m = {}
for n in arr:
if n in m:
m[n] += 1
else:
m[n] = 1
for n in arr:
if n * 2 in m and n is not 0:
return True
elif n is 0 and m[n] == 2:
return True
return False
|
class Parent:
def __init__(self, last_name, eye_color):
self.last_name = last_name
self.eye_color = eye_color
def show_info(self):
print("Last name - "+self.last_name)
print("Eye color - "+self.eye_color)
class Child(Parent):
def __init__(self, last_name, eye_color, number_toys):
Parent.__init__(self, last_name, eye_color)
self.number_toys = number_toys
def show_info(self):
print("Last name - " + self.last_name)
print("Eye color - " + self.eye_color)
print("Number of toys - " + str(self.number_toys))
billy = Parent("Rocket", "blue")
# print(billy.last_name)
sophie = Child("Flowers", "green", 5)
# print(sophie.last_name)
billy.show_info()
sophie.show_info()
|
"""
WxAPI Exceptions
"""
class WxAPIException(Exception):
"""Base class for exceptions in this module"""
def __init__(self, message):
self.message = message
class InvalidFormat(WxAPIException):
"""The format provided is invalid"""
class FormatNotAllowed(WxAPIException):
"""The format provided is not allowed by this endpoint"""
class APIError(WxAPIException):
"""The API returned an error"""
|
class Solution:
def numJewelsInStones(self, J, S):
"""
:type J: str
:type S: str
:rtype: int
"""
J = set(J)
return sum(1 for stone in S if stone in J)
|
#
# PySNMP MIB module HUAWEI-PWE3-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-PWE3-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:34:00 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection")
hwDatacomm, = mibBuilder.importSymbols("HUAWEI-MIB", "hwDatacomm")
HWL2VpnVcEncapsType, HWEnableValue, HWL2VpnStateChangeReason = mibBuilder.importSymbols("HUAWEI-VPLS-EXT-MIB", "HWL2VpnVcEncapsType", "HWEnableValue", "HWL2VpnStateChangeReason")
ifName, InterfaceIndexOrZero = mibBuilder.importSymbols("IF-MIB", "ifName", "InterfaceIndexOrZero")
InetAddressType, = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType")
EnabledStatus, = mibBuilder.importSymbols("P-BRIDGE-MIB", "EnabledStatus")
NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance")
sysUpTime, = mibBuilder.importSymbols("SNMPv2-MIB", "sysUpTime")
Counter32, Counter64, IpAddress, iso, ModuleIdentity, NotificationType, Gauge32, Integer32, ObjectIdentity, MibIdentifier, Unsigned32, Bits, Bits, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Counter64", "IpAddress", "iso", "ModuleIdentity", "NotificationType", "Gauge32", "Integer32", "ObjectIdentity", "MibIdentifier", "Unsigned32", "Bits", "Bits", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn")
TextualConvention, RowStatus, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString", "TruthValue")
hwL2VpnPwe3 = ModuleIdentity((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4))
if mibBuilder.loadTexts: hwL2VpnPwe3.setLastUpdated('200704120900Z')
if mibBuilder.loadTexts: hwL2VpnPwe3.setOrganization('Huawei Technologies Co., Ltd.')
class HWLdpPwStateChangeReason(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))
namedValues = NamedValues(("ldpSessionDown", 1), ("interfaceDown", 2), ("tunnelDown", 3), ("receivedNoMapping", 4), ("paraUnMatched", 5), ("notifiNotForward", 6))
hwL2Vpn = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119))
hwPwe3MIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1))
hwPwe3Objects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1))
hwPWVcTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1), )
if mibBuilder.loadTexts: hwPWVcTable.setStatus('current')
hwPWVcEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWVcID"), (0, "HUAWEI-PWE3-MIB", "hwPWVcType"))
if mibBuilder.loadTexts: hwPWVcEntry.setStatus('current')
hwPWVcID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 1), Unsigned32())
if mibBuilder.loadTexts: hwPWVcID.setStatus('current')
hwPWVcType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 2), HWL2VpnVcEncapsType())
if mibBuilder.loadTexts: hwPWVcType.setStatus('current')
hwPWVcPeerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 3), InetAddressType().clone('ipv4')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcPeerAddrType.setStatus('current')
hwPWVcPeerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 4), IpAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcPeerAddr.setStatus('current')
hwPWVcStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("plugout", 3), ("backup", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcStatus.setStatus('current')
hwPWVcInboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 6), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcInboundLabel.setStatus('current')
hwPWVcOutboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 7), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcOutboundLabel.setStatus('current')
hwPWVcSwitchSign = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("staticTostatic", 1), ("ldpTostatic", 2), ("ldpToldp", 3), ("upe", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcSwitchSign.setStatus('current')
hwPWVcSwitchID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 9), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSwitchID.setStatus('current')
hwPWVcSwitchPeerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 10), InetAddressType().clone('ipv4')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSwitchPeerAddrType.setStatus('current')
hwPWVcSwitchPeerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 11), IpAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSwitchPeerAddr.setStatus('current')
hwPWVcSwitchInboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 12), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSwitchInboundLabel.setStatus('current')
hwPWVcSwitchOutboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 13), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSwitchOutboundLabel.setStatus('current')
hwPWVcGroupID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 14), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcGroupID.setStatus('current')
hwPWVcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 15), InterfaceIndexOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcIfIndex.setStatus('current')
hwPWVcAcStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("plugout", 3), ("notify", 4), ("notifyDown", 5), ("downNotify", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcAcStatus.setStatus('current')
hwPWVcACOAMStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcACOAMStatus.setStatus('current')
hwPWVcMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(46, 9600), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcMtu.setStatus('current')
hwPWVcCtrlWord = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 19), HWEnableValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcCtrlWord.setStatus('current')
hwPWVcVCCV = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 20), Bits().clone(namedValues=NamedValues(("ccCw", 0), ("ccAlert", 1), ("ccLabel", 2), ("cvIcmpping", 3), ("cvLspping", 4), ("cvBfd", 5), ("ccTtl", 6)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcVCCV.setStatus('current')
hwPWVcBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 21), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 32000000))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcBandWidth.setStatus('current')
hwPWVcMaxAtmCells = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 22), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 28))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcMaxAtmCells.setStatus('current')
hwPWVcTnlPolicyName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 23), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 39))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcTnlPolicyName.setStatus('current')
hwPWVcQoSBehaviorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 24), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcQoSBehaviorIndex.setStatus('current')
hwPWVcExplicitPathName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 25), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcExplicitPathName.setStatus('current')
hwPWVcTemplateName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 26), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 19))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcTemplateName.setStatus('current')
hwPWVcSecondary = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 27), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSecondary.setStatus('current')
hwPWVcUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 28), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcUpTime.setStatus('current')
hwPWOAMSync = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 29), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWOAMSync.setStatus('current')
hwPWVCForBfdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 30), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVCForBfdIndex.setStatus('current')
hwPWVcDelayTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 31), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcDelayTime.setStatus('current')
hwPWVcReroutePolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("delay", 1), ("immediately", 2), ("never", 3), ("none", 4), ("err", 5), ("invalid", 6), ("immediatelySwitch", 7)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcReroutePolicy.setStatus('current')
hwPWVcResumeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 33), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcResumeTime.setStatus('current')
hwPWVcRerouteReason = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 34), HWL2VpnStateChangeReason()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcRerouteReason.setStatus('current')
hwPWVcLastRerouteTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 35), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcLastRerouteTime.setStatus('current')
hwPWVcManualSetFault = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 36), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcManualSetFault.setStatus('current')
hwPWVcActive = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 37), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcActive.setStatus('current')
hwPWVcVrIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 38), InterfaceIndexOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcVrIfIndex.setStatus('current')
hwPWVcVrID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 39), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcVrID.setStatus('current')
hwPWBFDDetectMultiplier = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 40), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 50), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWBFDDetectMultiplier.setStatus('current')
hwPWBFDMinReceiveInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 41), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 1000), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWBFDMinReceiveInterval.setStatus('current')
hwPWBFDMinTransmitInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 42), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 1000), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWBFDMinTransmitInterval.setStatus('current')
hwPWDynamicBFDDetect = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 43), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWDynamicBFDDetect.setStatus('current')
hwPWBFDRemoteVcID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 44), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWBFDRemoteVcID.setStatus('current')
hwPWEthOamType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 45), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ethOam1ag", 1), ("ethOam3ah", 2), ("noEthOamCfg", 3)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWEthOamType.setStatus('current')
hwPWCfmMaIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 46), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 4095), ValueRangeConstraint(4294967295, 4294967295), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWCfmMaIndex.setStatus('current')
hwPWVcUpStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 47), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcUpStartTime.setStatus('current')
hwPWVcUpSumTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 48), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcUpSumTime.setStatus('current')
hwPWVcIfName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 49), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcIfName.setStatus('current')
hwPWVcRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcRowStatus.setStatus('current')
hwPWVcAtmPackOvertime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 52), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(100, 50000), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcAtmPackOvertime.setStatus('current')
hwPWVcPwJitterBufferDepth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 53), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcPwJitterBufferDepth.setStatus('current')
hwPWVcPwTdmEncapsulationNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 54), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 40))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcPwTdmEncapsulationNum.setStatus('current')
hwPWVcPwIdleCode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 55), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 255), ValueRangeConstraint(65535, 65535), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcPwIdleCode.setStatus('current')
hwPWVcPwRtpHeader = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 56), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcPwRtpHeader.setStatus('current')
hwPWVcSwitchTnlPolicyName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 57), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 39))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSwitchTnlPolicyName.setStatus('current')
hwPWVcCfmMdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 58), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 4095), ValueRangeConstraint(4294967295, 4294967295), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcCfmMdIndex.setStatus('current')
hwPWVcCfmMaName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 59), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 43))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcCfmMaName.setStatus('current')
hwPWVcCfmMdName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 60), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 43))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcCfmMdName.setStatus('current')
hwPWVcRawOrTagged = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 61), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("raw", 1), ("tagged", 2), ("rawTagNotConfiged", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcRawOrTagged.setStatus('current')
hwPWVcInterworkingType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 62), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ipInterWorking", 1), ("ipLayer2", 2), ("ipUnknown", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcInterworkingType.setStatus('current')
hwPWVcCir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 63), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcCir.setStatus('current')
hwPWVcPir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 64), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcPir.setStatus('current')
hwPWVcQosProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 65), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcQosProfile.setStatus('current')
hwPWVcSwitchCir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 66), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSwitchCir.setStatus('current')
hwPWVcSwitchPir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 67), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSwitchPir.setStatus('current')
hwPWVcSwitchQosProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 68), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSwitchQosProfile.setStatus('current')
hwPWVcTrigger = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 69), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcTrigger.setStatus('current')
hwPWVcEnableACOAM = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 70), EnabledStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcEnableACOAM.setStatus('current')
hwPWVcSwitchVrIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 71), InterfaceIndexOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSwitchVrIfIndex.setStatus('current')
hwPWVcSwitchVrID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 72), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWVcSwitchVrID.setStatus('current')
hwPWVcQosParaFromPWT = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 73), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("cliOrMib", 1), ("pwTemplate", 2), ("unknown", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcQosParaFromPWT.setStatus('current')
hwPWVcBfdParaFromPWT = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 74), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("cliOrMib", 1), ("pwTemplate", 2), ("unknown", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcBfdParaFromPWT.setStatus('current')
hwPwVcNegotiateMode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 75), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("slaveOrMaster", 1), ("independent", 2), ("unknown", 3), ("frr", 4)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcNegotiateMode.setStatus('current')
hwPwVcIsBypass = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 76), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcIsBypass.setStatus('current')
hwPwVcIsAdmin = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 77), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcIsAdmin.setStatus('current')
hwPwVcAdminPwIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 78), InterfaceIndexOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcAdminPwIfIndex.setStatus('current')
hwPwVcAdminPwLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 79), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("unknown", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPwVcAdminPwLinkStatus.setStatus('current')
hwPwVcSwitchAdminPwIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 80), InterfaceIndexOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcSwitchAdminPwIfIndex.setStatus('current')
hwPwVcSwitchAdminPwLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 81), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("unknown", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPwVcSwitchAdminPwLinkStatus.setStatus('current')
hwPwVcSwitchBackupAdminPwIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 82), InterfaceIndexOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcSwitchBackupAdminPwIfIndex.setStatus('current')
hwPwVcSwitchBackupAdminPwLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 83), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("unknown", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPwVcSwitchBackupAdminPwLinkStatus.setStatus('current')
hwPwVcSwitchBackupVcId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 84), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcId.setStatus('current')
hwPwVcSwitchBackupVcPeerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 85), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcPeerAddrType.setStatus('current')
hwPwVcSwitchBackupVcPeerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 86), IpAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcPeerAddr.setStatus('current')
hwPwVcSwitchBackupVcReceiveLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 87), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcReceiveLabel.setStatus('current')
hwPwVcSwitchBackupVcSendLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 88), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcSendLabel.setStatus('current')
hwPwVcSwitchBackupVcTnlPolicyName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 89), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 19))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcTnlPolicyName.setStatus('current')
hwPwVcSwitchBackupVcCir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 90), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcCir.setStatus('current')
hwPwVcSwitchBackupVcPir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 91), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcPir.setStatus('current')
hwPwVcSwitchBackupVcQosProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 92), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcQosProfile.setStatus('current')
hwPwVcSlaveMasterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 93), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("slave", 1), ("master", 2), ("unknown", 3), ("bypass", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPwVcSlaveMasterMode.setStatus('current')
hwPwVcSwitchVcSlaveMasterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 94), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("slave", 1), ("master", 2), ("unknown", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPwVcSwitchVcSlaveMasterMode.setStatus('current')
hwPwVcSwitchBackupVcSlaveMasterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 95), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("slave", 1), ("master", 2), ("unknown", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcSlaveMasterMode.setStatus('current')
hwPwVcSwitchVcActive = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 96), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPwVcSwitchVcActive.setStatus('current')
hwPwVcSwitchBackupVcActive = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 97), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcActive.setStatus('current')
hwPwVcSwitchCwTrans = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 98), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcSwitchCwTrans.setStatus('current')
hwPwVcSwitchVcServiceName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 99), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 100))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcSwitchVcServiceName.setStatus('current')
hwPwVcSwitchBackupVcServiceName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 100), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 100))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPwVcSwitchBackupVcServiceName.setStatus('current')
hwPWVcTnlTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 2), )
if mibBuilder.loadTexts: hwPWVcTnlTable.setStatus('current')
hwPWVcTnlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 2, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWVcID"), (0, "HUAWEI-PWE3-MIB", "hwPWVcType"), (0, "HUAWEI-PWE3-MIB", "hwPWVcTnlIndex"))
if mibBuilder.loadTexts: hwPWVcTnlEntry.setStatus('current')
hwPWVcTnlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 2, 1, 1), Unsigned32())
if mibBuilder.loadTexts: hwPWVcTnlIndex.setStatus('current')
hwPWVcTnlType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("lsp", 1), ("gre", 2), ("ipsec", 3), ("crLsp", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcTnlType.setStatus('current')
hwPWTnlForBfdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 2, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWTnlForBfdIndex.setStatus('current')
hwPWVcStatisticsTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3), )
if mibBuilder.loadTexts: hwPWVcStatisticsTable.setStatus('current')
hwPWVcStatisticsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWVcID"), (0, "HUAWEI-PWE3-MIB", "hwPWVcType"))
if mibBuilder.loadTexts: hwPWVcStatisticsEntry.setStatus('current')
hwPWVcStatisticsRcvPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcStatisticsRcvPkts.setStatus('current')
hwPWVcStatisticsRcvBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcStatisticsRcvBytes.setStatus('current')
hwPWVcStatisticsSndPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcStatisticsSndPkts.setStatus('current')
hwPWVcStatisticsSndBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcStatisticsSndBytes.setStatus('current')
hwPWRemoteVcTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4), )
if mibBuilder.loadTexts: hwPWRemoteVcTable.setStatus('current')
hwPWRemoteVcEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWVcID"), (0, "HUAWEI-PWE3-MIB", "hwPWVcType"))
if mibBuilder.loadTexts: hwPWRemoteVcEntry.setStatus('current')
hwPWRemoteVcID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWRemoteVcID.setStatus('current')
hwPWRemoteVcType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 2), HWL2VpnVcEncapsType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWRemoteVcType.setStatus('current')
hwPWRemoteVcStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("plugout", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWRemoteVcStatus.setStatus('current')
hwPWRemoteVcGroupID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWRemoteVcGroupID.setStatus('current')
hwPWRemoteVcMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 5), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(46, 9600), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWRemoteVcMtu.setStatus('current')
hwPWRemoteVcCtrlword = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 6), HWEnableValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWRemoteVcCtrlword.setStatus('current')
hwPWRemoteVcMaxAtmCells = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWRemoteVcMaxAtmCells.setStatus('current')
hwPWRemoteVcNotif = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 8), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWRemoteVcNotif.setStatus('current')
hwPWVcSwitchNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 5), HWEnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwPWVcSwitchNotifEnable.setStatus('current')
hwPWVcUpDownNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 6), HWEnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwPWVcUpDownNotifEnable.setStatus('current')
hwPWVcDeletedNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 7), HWEnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwPWVcDeletedNotifEnable.setStatus('current')
hwPWVcStateChangeReason = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 8), HWL2VpnStateChangeReason()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: hwPWVcStateChangeReason.setStatus('current')
hwPWVcSwitchRmtID = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 9), Unsigned32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: hwPWVcSwitchRmtID.setStatus('current')
hwLdpPWStateChangeReason = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 10), HWLdpPwStateChangeReason()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: hwLdpPWStateChangeReason.setStatus('current')
hwPWVcTDMPerfCurrentTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11), )
if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentTable.setStatus('current')
hwPWVcTDMPerfCurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWVcID"), (0, "HUAWEI-PWE3-MIB", "hwPWVcType"))
if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentEntry.setStatus('current')
hwPWVcTDMPerfCurrentMissingPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentMissingPkts.setStatus('current')
hwPWVcTDMPerfCurrentJtrBfrOverruns = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentJtrBfrOverruns.setStatus('current')
hwPWVcTDMPerfCurrentJtrBfrUnderruns = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentJtrBfrUnderruns.setStatus('current')
hwPWVcTDMPerfCurrentMisOrderDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentMisOrderDropped.setStatus('current')
hwPWVcTDMPerfCurrentMalformedPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentMalformedPkt.setStatus('current')
hwPWVcTDMPerfCurrentESs = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentESs.setStatus('current')
hwPWVcTDMPerfCurrentSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentSESs.setStatus('current')
hwPWVcTDMPerfCurrentUASs = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentUASs.setStatus('current')
hwPwe3MIBTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2))
hwPWVcSwitchWtoP = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchRmtID"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"))
if mibBuilder.loadTexts: hwPWVcSwitchWtoP.setStatus('current')
hwPWVcSwitchPtoW = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 2)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchRmtID"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"))
if mibBuilder.loadTexts: hwPWVcSwitchPtoW.setStatus('current')
hwPWVcDown = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 3)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSecondary"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("SNMPv2-MIB", "sysUpTime"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchID"), ("HUAWEI-PWE3-MIB", "hwPWVcTnlPolicyName"))
if mibBuilder.loadTexts: hwPWVcDown.setStatus('current')
hwPWVcUp = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 4)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSecondary"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("SNMPv2-MIB", "sysUpTime"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchID"), ("HUAWEI-PWE3-MIB", "hwPWVcTnlPolicyName"))
if mibBuilder.loadTexts: hwPWVcUp.setStatus('current')
hwPWVcDeleted = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 5)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSecondary"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchID"))
if mibBuilder.loadTexts: hwPWVcDeleted.setStatus('current')
hwPWVcBackup = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 6)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSecondary"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("SNMPv2-MIB", "sysUpTime"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchID"))
if mibBuilder.loadTexts: hwPWVcBackup.setStatus('current')
hwLdpPWVcDown = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 7)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwLdpPWStateChangeReason"))
if mibBuilder.loadTexts: hwLdpPWVcDown.setStatus('current')
hwLdpPWVcUp = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 8)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwLdpPWStateChangeReason"))
if mibBuilder.loadTexts: hwLdpPWVcUp.setStatus('current')
hwSvcObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3))
hwSvcTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1), )
if mibBuilder.loadTexts: hwSvcTable.setStatus('current')
hwSvcEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwSvcIfIndex"))
if mibBuilder.loadTexts: hwSvcEntry.setStatus('current')
hwSvcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 1), InterfaceIndexOrZero())
if mibBuilder.loadTexts: hwSvcIfIndex.setStatus('current')
hwSvcID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 2), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcID.setStatus('current')
hwSvcType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 3), HWL2VpnVcEncapsType()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcType.setStatus('current')
hwSvcPeerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 4), InetAddressType().clone('ipv4')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcPeerAddrType.setStatus('current')
hwSvcPeerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 5), IpAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcPeerAddr.setStatus('current')
hwSvcStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("plugout", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcStatus.setStatus('current')
hwSvcInboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 7), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcInboundLabel.setStatus('current')
hwSvcOutboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 8), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcOutboundLabel.setStatus('current')
hwSvcGroupID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcGroupID.setStatus('current')
hwSvcAcStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("plugout", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcAcStatus.setStatus('current')
hwSvcACOAMStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcACOAMStatus.setStatus('current')
hwSvcMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(46, 9600), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcMtu.setStatus('current')
hwSvcCtrlWord = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 13), HWEnableValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcCtrlWord.setStatus('current')
hwSvcVCCV = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 14), Bits().clone(namedValues=NamedValues(("ccCw", 0), ("ccAlert", 1), ("ccLabel", 2), ("cvIcmpping", 3), ("cvLspping", 4), ("cvBfd", 5)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcVCCV.setStatus('current')
hwSvcBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 15), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 32000000))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcBandWidth.setStatus('current')
hwSvcMaxAtmCells = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 16), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 28))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcMaxAtmCells.setStatus('current')
hwSvcTnlPolicyName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 17), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 39))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcTnlPolicyName.setStatus('current')
hwSvcQoSBehaviorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 18), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcQoSBehaviorIndex.setStatus('current')
hwSvcPWTemplateName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 19), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 19))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcPWTemplateName.setStatus('current')
hwSvcUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 20), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcUpTime.setStatus('current')
hwSvcOAMSync = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 21), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcOAMSync.setStatus('current')
hwSvcForBfdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 22), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcForBfdIndex.setStatus('current')
hwSvcSecondary = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 23), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcSecondary.setStatus('current')
hwSvcDelayTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 24), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcDelayTime.setStatus('current')
hwSvcReroutePolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("delay", 1), ("immediately", 2), ("never", 3), ("none", 4), ("err", 5), ("invalid", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcReroutePolicy.setStatus('current')
hwSvcResumeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 26), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcResumeTime.setStatus('current')
hwSvcRerouteReason = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 27), HWL2VpnStateChangeReason()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcRerouteReason.setStatus('current')
hwSvcLastRerouteTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 28), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcLastRerouteTime.setStatus('current')
hwSvcManualSetFault = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 29), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcManualSetFault.setStatus('current')
hwSvcActive = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 30), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcActive.setStatus('current')
hwSvcUpStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 31), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcUpStartTime.setStatus('current')
hwSvcUpSumTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 32), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcUpSumTime.setStatus('current')
hwSvcAtmPackOvertime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 33), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(100, 50000), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcAtmPackOvertime.setStatus('current')
hwSvcPwJitterBufferDepth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 34), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcPwJitterBufferDepth.setStatus('current')
hwSvcPwTdmEncapsulationNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 35), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 40))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcPwTdmEncapsulationNum.setStatus('current')
hwSvcPwIdleCode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 36), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 255), ValueRangeConstraint(65535, 65535), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcPwIdleCode.setStatus('current')
hwSvcPwRtpHeader = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 37), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcPwRtpHeader.setStatus('current')
hwSvcRawOrTagged = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 38), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("raw", 1), ("tagged", 2), ("rawTagNotConfiged", 3)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcRawOrTagged.setStatus('current')
hwSvcInterworkingType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 39), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ipInterWorking", 1), ("ipLayer2", 2), ("ipUnknown", 3)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcInterworkingType.setStatus('current')
hwSvcCir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 40), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcCir.setStatus('current')
hwSvcPir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 41), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcPir.setStatus('current')
hwSvcQosProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 42), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcQosProfile.setStatus('current')
hwSvcRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwSvcRowStatus.setStatus('current')
hwSvcTnlTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 2), )
if mibBuilder.loadTexts: hwSvcTnlTable.setStatus('current')
hwSvcTnlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 2, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwSvcIfIndex"), (0, "HUAWEI-PWE3-MIB", "hwSvcTnlIndex"))
if mibBuilder.loadTexts: hwSvcTnlEntry.setStatus('current')
hwSvcTnlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 2, 1, 1), Unsigned32())
if mibBuilder.loadTexts: hwSvcTnlIndex.setStatus('current')
hwSvcTnlType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("lsp", 1), ("gre", 2), ("ipsec", 3), ("crLsp", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcTnlType.setStatus('current')
hwSvcTnlForBfdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 2, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcTnlForBfdIndex.setStatus('current')
hwSvcStatisticsTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3), )
if mibBuilder.loadTexts: hwSvcStatisticsTable.setStatus('current')
hwSvcStatisticsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwSvcIfIndex"))
if mibBuilder.loadTexts: hwSvcStatisticsEntry.setStatus('current')
hwSvcStatisticsRcvPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcStatisticsRcvPkts.setStatus('current')
hwSvcStatisticsRcvBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcStatisticsRcvBytes.setStatus('current')
hwSvcStatisticsSndPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcStatisticsSndPkts.setStatus('current')
hwSvcStatisticsSndBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSvcStatisticsSndBytes.setStatus('current')
hwSvcSwitchNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 4), HWEnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwSvcSwitchNotifEnable.setStatus('current')
hwSvcUpDownNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 5), HWEnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwSvcUpDownNotifEnable.setStatus('current')
hwSvcDeletedNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 6), HWEnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwSvcDeletedNotifEnable.setStatus('current')
hwSvcStateChangeReason = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 7), HWL2VpnStateChangeReason()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: hwSvcStateChangeReason.setStatus('current')
hwL2vpnSvcMIBTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4))
hwSvcSwitchWtoP = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwSvcStateChangeReason"), ("IF-MIB", "ifName"))
if mibBuilder.loadTexts: hwSvcSwitchWtoP.setStatus('current')
hwSvcSwitchPtoW = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4, 2)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwSvcStateChangeReason"), ("IF-MIB", "ifName"))
if mibBuilder.loadTexts: hwSvcSwitchPtoW.setStatus('current')
hwSvcDown = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4, 3)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwSvcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcStateChangeReason"), ("IF-MIB", "ifName"), ("HUAWEI-PWE3-MIB", "hwSvcTnlPolicyName"))
if mibBuilder.loadTexts: hwSvcDown.setStatus('current')
hwSvcUp = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4, 4)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwSvcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcStateChangeReason"), ("IF-MIB", "ifName"), ("HUAWEI-PWE3-MIB", "hwSvcTnlPolicyName"))
if mibBuilder.loadTexts: hwSvcUp.setStatus('current')
hwSvcDeleted = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4, 5)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwSvcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcOutboundLabel"))
if mibBuilder.loadTexts: hwSvcDeleted.setStatus('current')
hwPWTemplateTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5), )
if mibBuilder.loadTexts: hwPWTemplateTable.setStatus('current')
hwPWTemplateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWTemplateName"))
if mibBuilder.loadTexts: hwPWTemplateEntry.setStatus('current')
hwPWTemplateName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 19)))
if mibBuilder.loadTexts: hwPWTemplateName.setStatus('current')
hwPWTemplatePeerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 2), InetAddressType().clone('ipv4')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplatePeerAddrType.setStatus('current')
hwPWTemplatePeerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 3), IpAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplatePeerAddr.setStatus('current')
hwPWTemplateCtrlword = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 4), HWEnableValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateCtrlword.setStatus('current')
hwPWTemplateVCCV = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 5), Bits().clone(namedValues=NamedValues(("ccCw", 0), ("ccAlert", 1), ("ccLabel", 2), ("cvIcmpping", 3), ("cvLspping", 4), ("cvBfd", 5), ("ccTtl", 6)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateVCCV.setStatus('current')
hwPWTemplateFrag = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 6), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateFrag.setStatus('current')
hwPWTemplateBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 32000000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWTemplateBandwidth.setStatus('current')
hwPWTemplateTnlPolicyName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 39))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateTnlPolicyName.setStatus('current')
hwPWTemplateQoSBehaviorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 9), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateQoSBehaviorIndex.setStatus('current')
hwPWTemplateExplicitPathName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateExplicitPathName.setStatus('current')
hwPWTemplateBFDDetectMultiplier = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 11), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 50), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateBFDDetectMultiplier.setStatus('current')
hwPWTemplateBFDMinReceiveInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 12), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 1000), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateBFDMinReceiveInterval.setStatus('current')
hwPWTemplateBFDMinTransmitInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 13), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 1000), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateBFDMinTransmitInterval.setStatus('current')
hwPWTemplateDynamicBFDDetect = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 14), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateDynamicBFDDetect.setStatus('current')
hwPWTemplateMaxAtmCells = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 15), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 28))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateMaxAtmCells.setStatus('current')
hwPWTemplateAtmPackOvertime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 16), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(100, 50000), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateAtmPackOvertime.setStatus('current')
hwPWTemplatePwJitterBufferDepth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 17), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplatePwJitterBufferDepth.setStatus('current')
hwPWTemplatePwTdmEncapsulationNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 18), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 40))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplatePwTdmEncapsulationNum.setStatus('current')
hwPWTemplatePwIdleCode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 19), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 255), ValueRangeConstraint(65535, 65535), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplatePwIdleCode.setStatus('current')
hwPWTemplatePwRtpHeader = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 20), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplatePwRtpHeader.setStatus('current')
hwPWTemplatePwCCSeqEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 21), HWEnableValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplatePwCCSeqEnable.setStatus('current')
hwPWTemplateCir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 22), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateCir.setStatus('current')
hwPWTemplatePir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 23), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplatePir.setStatus('current')
hwPWTemplateQosProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 24), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateQosProfile.setStatus('current')
hwPWTemplateFlowLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 25), EnabledStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateFlowLabel.setStatus('current')
hwPWTemplateRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwPWTemplateRowStatus.setStatus('current')
hwPWTemplateMIBTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 6))
hwPWTemplateCannotDeleted = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 6, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwPWTemplateName"))
if mibBuilder.loadTexts: hwPWTemplateCannotDeleted.setStatus('current')
hwPWTableObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7))
hwPWTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1), )
if mibBuilder.loadTexts: hwPWTable.setStatus('current')
hwPWEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWId"), (0, "HUAWEI-PWE3-MIB", "hwPWType"), (0, "HUAWEI-PWE3-MIB", "hwPWPeerIp"))
if mibBuilder.loadTexts: hwPWEntry.setStatus('current')
hwPWId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1, 1, 1), Unsigned32())
if mibBuilder.loadTexts: hwPWId.setStatus('current')
hwPWType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1, 1, 2), HWL2VpnVcEncapsType())
if mibBuilder.loadTexts: hwPWType.setStatus('current')
hwPWPeerIp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1, 1, 3), IpAddress())
if mibBuilder.loadTexts: hwPWPeerIp.setStatus('current')
hwPWInterfaceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1, 1, 4), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwPWInterfaceIndex.setStatus('current')
hwPwe3MIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3))
hwPwe3MIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 1))
hwPwe3MIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 1, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcGroup"), ("HUAWEI-PWE3-MIB", "hwPWVcTnlGroup"), ("HUAWEI-PWE3-MIB", "hwPWVcStatisticsGroup"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcGroup"), ("HUAWEI-PWE3-MIB", "hwPWTemplateGroup"), ("HUAWEI-PWE3-MIB", "hwPWNotificationControlGroup"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReasonGroup"), ("HUAWEI-PWE3-MIB", "hwPWVcNotificationGroup"), ("HUAWEI-PWE3-MIB", "hwPWTableGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwPwe3MIBCompliance = hwPwe3MIBCompliance.setStatus('current')
hwPwe3MIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2))
hwPWVcGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddrType"), ("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcStatus"), ("HUAWEI-PWE3-MIB", "hwPWVcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchSign"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchID"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchPeerAddrType"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcGroupID"), ("HUAWEI-PWE3-MIB", "hwPWVcIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcAcStatus"), ("HUAWEI-PWE3-MIB", "hwPWVcACOAMStatus"), ("HUAWEI-PWE3-MIB", "hwPWVcMtu"), ("HUAWEI-PWE3-MIB", "hwPWVcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwPWVcVCCV"), ("HUAWEI-PWE3-MIB", "hwPWVcBandWidth"), ("HUAWEI-PWE3-MIB", "hwPWVcMaxAtmCells"), ("HUAWEI-PWE3-MIB", "hwPWVcTnlPolicyName"), ("HUAWEI-PWE3-MIB", "hwPWVcQoSBehaviorIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcExplicitPathName"), ("HUAWEI-PWE3-MIB", "hwPWVcTemplateName"), ("HUAWEI-PWE3-MIB", "hwPWVcSecondary"), ("HUAWEI-PWE3-MIB", "hwPWVcUpTime"), ("HUAWEI-PWE3-MIB", "hwPWOAMSync"), ("HUAWEI-PWE3-MIB", "hwPWVCForBfdIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcDelayTime"), ("HUAWEI-PWE3-MIB", "hwPWVcReroutePolicy"), ("HUAWEI-PWE3-MIB", "hwPWVcResumeTime"), ("HUAWEI-PWE3-MIB", "hwPWVcRerouteReason"), ("HUAWEI-PWE3-MIB", "hwPWVcLastRerouteTime"), ("HUAWEI-PWE3-MIB", "hwPWVcManualSetFault"), ("HUAWEI-PWE3-MIB", "hwPWVcActive"), ("HUAWEI-PWE3-MIB", "hwPWVcVrIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcVrID"), ("HUAWEI-PWE3-MIB", "hwPWBFDDetectMultiplier"), ("HUAWEI-PWE3-MIB", "hwPWBFDMinReceiveInterval"), ("HUAWEI-PWE3-MIB", "hwPWBFDMinTransmitInterval"), ("HUAWEI-PWE3-MIB", "hwPWDynamicBFDDetect"), ("HUAWEI-PWE3-MIB", "hwPWBFDRemoteVcID"), ("HUAWEI-PWE3-MIB", "hwPWEthOamType"), ("HUAWEI-PWE3-MIB", "hwPWCfmMaIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcUpStartTime"), ("HUAWEI-PWE3-MIB", "hwPWVcUpSumTime"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"), ("HUAWEI-PWE3-MIB", "hwPWVcRowStatus"), ("HUAWEI-PWE3-MIB", "hwPWVcAtmPackOvertime"), ("HUAWEI-PWE3-MIB", "hwPWVcPwJitterBufferDepth"), ("HUAWEI-PWE3-MIB", "hwPWVcPwTdmEncapsulationNum"), ("HUAWEI-PWE3-MIB", "hwPWVcPwIdleCode"), ("HUAWEI-PWE3-MIB", "hwPWVcPwRtpHeader"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchTnlPolicyName"), ("HUAWEI-PWE3-MIB", "hwPWVcCfmMdIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcCfmMaName"), ("HUAWEI-PWE3-MIB", "hwPWVcCfmMdName"), ("HUAWEI-PWE3-MIB", "hwPWVcRawOrTagged"), ("HUAWEI-PWE3-MIB", "hwPWVcInterworkingType"), ("HUAWEI-PWE3-MIB", "hwPWVcCir"), ("HUAWEI-PWE3-MIB", "hwPWVcPir"), ("HUAWEI-PWE3-MIB", "hwPWVcQosProfile"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchCir"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchPir"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchQosProfile"), ("HUAWEI-PWE3-MIB", "hwPWVcTrigger"), ("HUAWEI-PWE3-MIB", "hwPWVcEnableACOAM"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchVrIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchVrID"), ("HUAWEI-PWE3-MIB", "hwPWVcQosParaFromPWT"), ("HUAWEI-PWE3-MIB", "hwPWVcBfdParaFromPWT"), ("HUAWEI-PWE3-MIB", "hwPwVcNegotiateMode"), ("HUAWEI-PWE3-MIB", "hwPwVcIsBypass"), ("HUAWEI-PWE3-MIB", "hwPwVcIsAdmin"), ("HUAWEI-PWE3-MIB", "hwPwVcAdminPwIfIndex"), ("HUAWEI-PWE3-MIB", "hwPwVcAdminPwLinkStatus"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchAdminPwIfIndex"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchAdminPwLinkStatus"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupAdminPwIfIndex"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupAdminPwLinkStatus"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcId"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcPeerAddrType"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcReceiveLabel"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcSendLabel"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcTnlPolicyName"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcCir"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcPir"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcQosProfile"), ("HUAWEI-PWE3-MIB", "hwPwVcSlaveMasterMode"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchVcSlaveMasterMode"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcSlaveMasterMode"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchVcActive"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcActive"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchCwTrans"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchVcServiceName"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcServiceName"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwPWVcGroup = hwPWVcGroup.setStatus('current')
hwPWVcTnlGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 2)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcTnlType"), ("HUAWEI-PWE3-MIB", "hwPWTnlForBfdIndex"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwPWVcTnlGroup = hwPWVcTnlGroup.setStatus('current')
hwPWVcStatisticsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 3)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcStatisticsRcvPkts"), ("HUAWEI-PWE3-MIB", "hwPWVcStatisticsRcvBytes"), ("HUAWEI-PWE3-MIB", "hwPWVcStatisticsSndPkts"), ("HUAWEI-PWE3-MIB", "hwPWVcStatisticsSndBytes"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwPWVcStatisticsGroup = hwPWVcStatisticsGroup.setStatus('current')
hwPWRemoteVcGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 4)).setObjects(("HUAWEI-PWE3-MIB", "hwPWRemoteVcID"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcType"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcStatus"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcGroupID"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcMtu"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcCtrlword"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcMaxAtmCells"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcNotif"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwPWRemoteVcGroup = hwPWRemoteVcGroup.setStatus('current')
hwPWTemplateGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 5)).setObjects(("HUAWEI-PWE3-MIB", "hwPWTemplatePeerAddrType"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWTemplateCtrlword"), ("HUAWEI-PWE3-MIB", "hwPWTemplateVCCV"), ("HUAWEI-PWE3-MIB", "hwPWTemplateFrag"), ("HUAWEI-PWE3-MIB", "hwPWTemplateBandwidth"), ("HUAWEI-PWE3-MIB", "hwPWTemplateTnlPolicyName"), ("HUAWEI-PWE3-MIB", "hwPWTemplateQoSBehaviorIndex"), ("HUAWEI-PWE3-MIB", "hwPWTemplateExplicitPathName"), ("HUAWEI-PWE3-MIB", "hwPWTemplateBFDDetectMultiplier"), ("HUAWEI-PWE3-MIB", "hwPWTemplateBFDMinReceiveInterval"), ("HUAWEI-PWE3-MIB", "hwPWTemplateBFDMinTransmitInterval"), ("HUAWEI-PWE3-MIB", "hwPWTemplateDynamicBFDDetect"), ("HUAWEI-PWE3-MIB", "hwPWTemplateMaxAtmCells"), ("HUAWEI-PWE3-MIB", "hwPWTemplateAtmPackOvertime"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePwJitterBufferDepth"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePwTdmEncapsulationNum"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePwIdleCode"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePwRtpHeader"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePwCCSeqEnable"), ("HUAWEI-PWE3-MIB", "hwPWTemplateCir"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePir"), ("HUAWEI-PWE3-MIB", "hwPWTemplateQosProfile"), ("HUAWEI-PWE3-MIB", "hwPWTemplateFlowLabel"), ("HUAWEI-PWE3-MIB", "hwPWTemplateRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwPWTemplateGroup = hwPWTemplateGroup.setStatus('current')
hwPWNotificationControlGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 6)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcSwitchNotifEnable"), ("HUAWEI-PWE3-MIB", "hwPWVcUpDownNotifEnable"), ("HUAWEI-PWE3-MIB", "hwPWVcDeletedNotifEnable"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwPWNotificationControlGroup = hwPWNotificationControlGroup.setStatus('current')
hwPWVcStateChangeReasonGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 7)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchRmtID"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwPWVcStateChangeReasonGroup = hwPWVcStateChangeReasonGroup.setStatus('current')
hwPWVcNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 8)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcSwitchWtoP"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchPtoW"), ("HUAWEI-PWE3-MIB", "hwPWVcDown"), ("HUAWEI-PWE3-MIB", "hwPWVcUp"), ("HUAWEI-PWE3-MIB", "hwPWVcDeleted"), ("HUAWEI-PWE3-MIB", "hwPWVcBackup"), ("HUAWEI-PWE3-MIB", "hwLdpPWVcDown"), ("HUAWEI-PWE3-MIB", "hwLdpPWVcUp"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwPWVcNotificationGroup = hwPWVcNotificationGroup.setStatus('current')
hwLdpPWStateChangeReasonGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 9)).setObjects(("HUAWEI-PWE3-MIB", "hwLdpPWStateChangeReason"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwLdpPWStateChangeReasonGroup = hwLdpPWStateChangeReasonGroup.setStatus('current')
hwPWVcTDMPerfCurrentGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 10)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentMissingPkts"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentJtrBfrOverruns"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentJtrBfrUnderruns"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentMisOrderDropped"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentMalformedPkt"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentESs"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentSESs"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentUASs"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwPWVcTDMPerfCurrentGroup = hwPWVcTDMPerfCurrentGroup.setStatus('current')
hwL2vpnSvcMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3))
hwSvcGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcPeerAddrType"), ("HUAWEI-PWE3-MIB", "hwSvcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwSvcStatus"), ("HUAWEI-PWE3-MIB", "hwSvcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcGroupID"), ("HUAWEI-PWE3-MIB", "hwSvcAcStatus"), ("HUAWEI-PWE3-MIB", "hwSvcACOAMStatus"), ("HUAWEI-PWE3-MIB", "hwSvcMtu"), ("HUAWEI-PWE3-MIB", "hwSvcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwSvcVCCV"), ("HUAWEI-PWE3-MIB", "hwSvcBandWidth"), ("HUAWEI-PWE3-MIB", "hwSvcMaxAtmCells"), ("HUAWEI-PWE3-MIB", "hwSvcTnlPolicyName"), ("HUAWEI-PWE3-MIB", "hwSvcQoSBehaviorIndex"), ("HUAWEI-PWE3-MIB", "hwSvcPWTemplateName"), ("HUAWEI-PWE3-MIB", "hwSvcUpTime"), ("HUAWEI-PWE3-MIB", "hwSvcOAMSync"), ("HUAWEI-PWE3-MIB", "hwSvcForBfdIndex"), ("HUAWEI-PWE3-MIB", "hwSvcSecondary"), ("HUAWEI-PWE3-MIB", "hwSvcDelayTime"), ("HUAWEI-PWE3-MIB", "hwSvcReroutePolicy"), ("HUAWEI-PWE3-MIB", "hwSvcResumeTime"), ("HUAWEI-PWE3-MIB", "hwSvcRerouteReason"), ("HUAWEI-PWE3-MIB", "hwSvcLastRerouteTime"), ("HUAWEI-PWE3-MIB", "hwSvcManualSetFault"), ("HUAWEI-PWE3-MIB", "hwSvcActive"), ("HUAWEI-PWE3-MIB", "hwSvcUpStartTime"), ("HUAWEI-PWE3-MIB", "hwSvcUpSumTime"), ("HUAWEI-PWE3-MIB", "hwSvcAtmPackOvertime"), ("HUAWEI-PWE3-MIB", "hwSvcPwJitterBufferDepth"), ("HUAWEI-PWE3-MIB", "hwSvcPwTdmEncapsulationNum"), ("HUAWEI-PWE3-MIB", "hwSvcPwIdleCode"), ("HUAWEI-PWE3-MIB", "hwSvcPwRtpHeader"), ("HUAWEI-PWE3-MIB", "hwSvcRawOrTagged"), ("HUAWEI-PWE3-MIB", "hwSvcInterworkingType"), ("HUAWEI-PWE3-MIB", "hwSvcCir"), ("HUAWEI-PWE3-MIB", "hwSvcPir"), ("HUAWEI-PWE3-MIB", "hwSvcQosProfile"), ("HUAWEI-PWE3-MIB", "hwSvcRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwSvcGroup = hwSvcGroup.setStatus('current')
hwSvcTnlGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 2)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcTnlType"), ("HUAWEI-PWE3-MIB", "hwSvcTnlForBfdIndex"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwSvcTnlGroup = hwSvcTnlGroup.setStatus('current')
hwSvcStatisticsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 3)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcStatisticsRcvPkts"), ("HUAWEI-PWE3-MIB", "hwSvcStatisticsRcvBytes"), ("HUAWEI-PWE3-MIB", "hwSvcStatisticsSndPkts"), ("HUAWEI-PWE3-MIB", "hwSvcStatisticsSndBytes"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwSvcStatisticsGroup = hwSvcStatisticsGroup.setStatus('current')
hwSvcNotificationControlGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 4)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcSwitchNotifEnable"), ("HUAWEI-PWE3-MIB", "hwSvcUpDownNotifEnable"), ("HUAWEI-PWE3-MIB", "hwSvcDeletedNotifEnable"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwSvcNotificationControlGroup = hwSvcNotificationControlGroup.setStatus('current')
hwSvcStateChangeReasonGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 5)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcStateChangeReason"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwSvcStateChangeReasonGroup = hwSvcStateChangeReasonGroup.setStatus('current')
hwSvcNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 6)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcSwitchWtoP"), ("HUAWEI-PWE3-MIB", "hwSvcSwitchPtoW"), ("HUAWEI-PWE3-MIB", "hwSvcDown"), ("HUAWEI-PWE3-MIB", "hwSvcUp"), ("HUAWEI-PWE3-MIB", "hwSvcDeleted"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwSvcNotificationGroup = hwSvcNotificationGroup.setStatus('current')
hwL2vpnPWTableMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 4))
hwPWTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 4, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwPWInterfaceIndex"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwPWTableGroup = hwPWTableGroup.setStatus('current')
mibBuilder.exportSymbols("HUAWEI-PWE3-MIB", hwPWVcAcStatus=hwPWVcAcStatus, hwPWVcPwRtpHeader=hwPWVcPwRtpHeader, hwPWVcManualSetFault=hwPWVcManualSetFault, hwPWVcSwitchPeerAddr=hwPWVcSwitchPeerAddr, hwPWVcOutboundLabel=hwPWVcOutboundLabel, hwPWVcUpTime=hwPWVcUpTime, hwPWBFDRemoteVcID=hwPWBFDRemoteVcID, hwPWVcTnlIndex=hwPWVcTnlIndex, hwPwVcAdminPwLinkStatus=hwPwVcAdminPwLinkStatus, hwPWVcDown=hwPWVcDown, hwSvcSecondary=hwSvcSecondary, hwSvcTnlIndex=hwSvcTnlIndex, hwPWVcGroupID=hwPWVcGroupID, hwPwVcSwitchAdminPwLinkStatus=hwPwVcSwitchAdminPwLinkStatus, hwSvcReroutePolicy=hwSvcReroutePolicy, hwSvcACOAMStatus=hwSvcACOAMStatus, hwL2VpnPwe3=hwL2VpnPwe3, hwPWVcUpDownNotifEnable=hwPWVcUpDownNotifEnable, hwPWTableGroup=hwPWTableGroup, hwSvcStatisticsTable=hwSvcStatisticsTable, hwPWVcDeletedNotifEnable=hwPWVcDeletedNotifEnable, hwPWVcIfName=hwPWVcIfName, hwPWVcACOAMStatus=hwPWVcACOAMStatus, hwPWTemplatePir=hwPWTemplatePir, hwPWVcLastRerouteTime=hwPWVcLastRerouteTime, hwPwVcNegotiateMode=hwPwVcNegotiateMode, hwPWVcTnlPolicyName=hwPWVcTnlPolicyName, hwPWVcQosParaFromPWT=hwPWVcQosParaFromPWT, hwPwVcSwitchBackupVcQosProfile=hwPwVcSwitchBackupVcQosProfile, hwSvcMaxAtmCells=hwSvcMaxAtmCells, hwSvcVCCV=hwSvcVCCV, hwPWVcBandWidth=hwPWVcBandWidth, hwPWVcSwitchQosProfile=hwPWVcSwitchQosProfile, hwPWVcEntry=hwPWVcEntry, hwSvcStateChangeReasonGroup=hwSvcStateChangeReasonGroup, hwSvcManualSetFault=hwSvcManualSetFault, hwPwe3MIBCompliances=hwPwe3MIBCompliances, hwSvcStatisticsGroup=hwSvcStatisticsGroup, hwSvcUpTime=hwSvcUpTime, hwPWVcType=hwPWVcType, hwPWVcBfdParaFromPWT=hwPWVcBfdParaFromPWT, hwPWVcTDMPerfCurrentMisOrderDropped=hwPWVcTDMPerfCurrentMisOrderDropped, hwSvcDeleted=hwSvcDeleted, hwPWVcTDMPerfCurrentJtrBfrUnderruns=hwPWVcTDMPerfCurrentJtrBfrUnderruns, hwSvcStatisticsSndPkts=hwSvcStatisticsSndPkts, hwSvcSwitchPtoW=hwSvcSwitchPtoW, hwPWVcGroup=hwPWVcGroup, hwPWVcTrigger=hwPWVcTrigger, hwPwe3MIBConformance=hwPwe3MIBConformance, hwSvcMtu=hwSvcMtu, hwPwVcSwitchBackupVcServiceName=hwPwVcSwitchBackupVcServiceName, hwPwVcSwitchBackupAdminPwLinkStatus=hwPwVcSwitchBackupAdminPwLinkStatus, hwPWVcSwitchID=hwPWVcSwitchID, hwPWOAMSync=hwPWOAMSync, hwPwVcSwitchBackupAdminPwIfIndex=hwPwVcSwitchBackupAdminPwIfIndex, hwPWInterfaceIndex=hwPWInterfaceIndex, hwPWEntry=hwPWEntry, hwPWPeerIp=hwPWPeerIp, hwPWVcCtrlWord=hwPWVcCtrlWord, hwPwVcSwitchBackupVcActive=hwPwVcSwitchBackupVcActive, hwPWTemplateCir=hwPWTemplateCir, hwSvcInterworkingType=hwSvcInterworkingType, hwPWVcPwJitterBufferDepth=hwPWVcPwJitterBufferDepth, hwPWVcSwitchPtoW=hwPWVcSwitchPtoW, hwSvcQoSBehaviorIndex=hwSvcQoSBehaviorIndex, hwPWVcSwitchTnlPolicyName=hwPWVcSwitchTnlPolicyName, hwPWVcTnlTable=hwPWVcTnlTable, hwPWTemplateFlowLabel=hwPWTemplateFlowLabel, hwPWVcPeerAddrType=hwPWVcPeerAddrType, hwPwVcAdminPwIfIndex=hwPwVcAdminPwIfIndex, hwPWVcStatisticsSndPkts=hwPWVcStatisticsSndPkts, hwPwVcSlaveMasterMode=hwPwVcSlaveMasterMode, hwPWTemplateEntry=hwPWTemplateEntry, hwLdpPWVcUp=hwLdpPWVcUp, hwPWTemplateMIBTraps=hwPWTemplateMIBTraps, hwPWVcTDMPerfCurrentUASs=hwPWVcTDMPerfCurrentUASs, hwPwVcSwitchVcServiceName=hwPwVcSwitchVcServiceName, hwPWTemplateQoSBehaviorIndex=hwPWTemplateQoSBehaviorIndex, hwPWRemoteVcGroup=hwPWRemoteVcGroup, hwPWVcPwIdleCode=hwPWVcPwIdleCode, hwPWVcInboundLabel=hwPWVcInboundLabel, hwPWVcQoSBehaviorIndex=hwPWVcQoSBehaviorIndex, hwPWTemplateExplicitPathName=hwPWTemplateExplicitPathName, hwPWVcStatisticsRcvPkts=hwPWVcStatisticsRcvPkts, hwPWRemoteVcCtrlword=hwPWRemoteVcCtrlword, hwPWVcCfmMdIndex=hwPWVcCfmMdIndex, hwSvcOutboundLabel=hwSvcOutboundLabel, hwPWVcAtmPackOvertime=hwPWVcAtmPackOvertime, hwSvcIfIndex=hwSvcIfIndex, hwPWVcTnlEntry=hwPWVcTnlEntry, hwSvcAcStatus=hwSvcAcStatus, hwSvcCtrlWord=hwSvcCtrlWord, hwPWVcEnableACOAM=hwPWVcEnableACOAM, hwSvcDown=hwSvcDown, hwPWTemplatePeerAddr=hwPWTemplatePeerAddr, hwPWTemplateRowStatus=hwPWTemplateRowStatus, hwSvcSwitchNotifEnable=hwSvcSwitchNotifEnable, hwPwVcSwitchBackupVcCir=hwPwVcSwitchBackupVcCir, hwSvcCir=hwSvcCir, hwSvcID=hwSvcID, hwPWVcSwitchOutboundLabel=hwPWVcSwitchOutboundLabel, hwPWVcSwitchVrIfIndex=hwPWVcSwitchVrIfIndex, hwPwVcSwitchBackupVcPeerAddr=hwPwVcSwitchBackupVcPeerAddr, hwPWVcNotificationGroup=hwPWVcNotificationGroup, hwPWVcID=hwPWVcID, hwPWRemoteVcNotif=hwPWRemoteVcNotif, hwPWTable=hwPWTable, hwSvcPwIdleCode=hwSvcPwIdleCode, hwPWVcDelayTime=hwPWVcDelayTime, hwSvcTnlForBfdIndex=hwSvcTnlForBfdIndex, hwPWVcRerouteReason=hwPWVcRerouteReason, hwPWVcReroutePolicy=hwPWVcReroutePolicy, hwPWVcSecondary=hwPWVcSecondary, hwPWVcTDMPerfCurrentMissingPkts=hwPWVcTDMPerfCurrentMissingPkts, hwPWVcDeleted=hwPWVcDeleted, hwPWVcStateChangeReasonGroup=hwPWVcStateChangeReasonGroup, hwPWVcPwTdmEncapsulationNum=hwPWVcPwTdmEncapsulationNum, hwSvcResumeTime=hwSvcResumeTime, hwSvcLastRerouteTime=hwSvcLastRerouteTime, hwL2vpnSvcMIBTraps=hwL2vpnSvcMIBTraps, hwPWTemplatePwTdmEncapsulationNum=hwPWTemplatePwTdmEncapsulationNum, hwPWVcUpSumTime=hwPWVcUpSumTime, hwPWVcTemplateName=hwPWVcTemplateName, hwSvcStatus=hwSvcStatus, hwSvcStatisticsRcvBytes=hwSvcStatisticsRcvBytes, hwPWTemplateBFDMinTransmitInterval=hwPWTemplateBFDMinTransmitInterval, hwLdpPWVcDown=hwLdpPWVcDown, hwPWType=hwPWType, hwPwe3MIBTraps=hwPwe3MIBTraps, hwSvcUpDownNotifEnable=hwSvcUpDownNotifEnable, hwPWTemplateTable=hwPWTemplateTable, hwPWVcMtu=hwPWVcMtu, hwPWCfmMaIndex=hwPWCfmMaIndex, hwPWVcQosProfile=hwPWVcQosProfile, hwSvcStatisticsEntry=hwSvcStatisticsEntry, hwPwVcIsBypass=hwPwVcIsBypass, hwPWTemplatePeerAddrType=hwPWTemplatePeerAddrType, hwPWRemoteVcMtu=hwPWRemoteVcMtu, hwSvcGroup=hwSvcGroup, hwSvcDelayTime=hwSvcDelayTime, hwPwe3MIBGroups=hwPwe3MIBGroups, hwSvcObjects=hwSvcObjects, hwPwe3MIBObjects=hwPwe3MIBObjects, hwPWVcIfIndex=hwPWVcIfIndex, hwPWVcTDMPerfCurrentSESs=hwPWVcTDMPerfCurrentSESs, hwPwVcSwitchBackupVcTnlPolicyName=hwPwVcSwitchBackupVcTnlPolicyName, hwL2vpnSvcMIBGroups=hwL2vpnSvcMIBGroups, hwPWVcTDMPerfCurrentJtrBfrOverruns=hwPWVcTDMPerfCurrentJtrBfrOverruns, hwPWVCForBfdIndex=hwPWVCForBfdIndex, hwSvcPwJitterBufferDepth=hwSvcPwJitterBufferDepth, hwPWVcStatisticsEntry=hwPWVcStatisticsEntry, hwPWVcStatisticsSndBytes=hwPWVcStatisticsSndBytes, hwPWVcTnlType=hwPWVcTnlType, hwPWVcPeerAddr=hwPWVcPeerAddr, hwPWTemplateBandwidth=hwPWTemplateBandwidth, hwPWVcTDMPerfCurrentGroup=hwPWVcTDMPerfCurrentGroup, hwPWVcSwitchVrID=hwPWVcSwitchVrID, hwPWVcSwitchInboundLabel=hwPWVcSwitchInboundLabel, hwPWVcUp=hwPWVcUp, hwPWVcPir=hwPWVcPir, hwPWId=hwPWId, hwPWVcSwitchWtoP=hwPWVcSwitchWtoP, hwSvcQosProfile=hwSvcQosProfile, hwPwe3Objects=hwPwe3Objects, hwPWBFDMinReceiveInterval=hwPWBFDMinReceiveInterval, hwPwVcIsAdmin=hwPwVcIsAdmin, hwPWNotificationControlGroup=hwPWNotificationControlGroup, hwPWVcVCCV=hwPWVcVCCV, hwSvcNotificationGroup=hwSvcNotificationGroup, hwPWVcTDMPerfCurrentESs=hwPWVcTDMPerfCurrentESs, hwSvcTnlGroup=hwSvcTnlGroup, hwPWVcCfmMdName=hwPWVcCfmMdName, hwSvcForBfdIndex=hwSvcForBfdIndex, hwPWRemoteVcType=hwPWRemoteVcType, hwPWTemplateGroup=hwPWTemplateGroup, hwPWVcStatus=hwPWVcStatus, hwPWRemoteVcMaxAtmCells=hwPWRemoteVcMaxAtmCells, hwSvcActive=hwSvcActive, hwSvcUpStartTime=hwSvcUpStartTime, hwPWVcSwitchCir=hwPWVcSwitchCir, hwPWTemplatePwJitterBufferDepth=hwPWTemplatePwJitterBufferDepth, hwPwVcSwitchBackupVcSendLabel=hwPwVcSwitchBackupVcSendLabel, hwPWVcTDMPerfCurrentTable=hwPWVcTDMPerfCurrentTable, hwPWTemplateVCCV=hwPWTemplateVCCV, hwPWTemplateDynamicBFDDetect=hwPWTemplateDynamicBFDDetect, hwPWTemplateName=hwPWTemplateName, hwPWTemplateBFDMinReceiveInterval=hwPWTemplateBFDMinReceiveInterval, hwPwe3MIBCompliance=hwPwe3MIBCompliance, hwPWVcStatisticsGroup=hwPWVcStatisticsGroup, hwPWVcCir=hwPWVcCir, hwSvcSwitchWtoP=hwSvcSwitchWtoP, hwPWRemoteVcEntry=hwPWRemoteVcEntry, hwSvcStateChangeReason=hwSvcStateChangeReason, hwPWTemplateMaxAtmCells=hwPWTemplateMaxAtmCells, hwPwVcSwitchVcActive=hwPwVcSwitchVcActive, hwSvcPeerAddr=hwSvcPeerAddr, hwPwVcSwitchBackupVcPir=hwPwVcSwitchBackupVcPir, hwPWVcActive=hwPWVcActive, hwPWRemoteVcGroupID=hwPWRemoteVcGroupID, hwPWVcStatisticsRcvBytes=hwPWVcStatisticsRcvBytes, hwPWVcResumeTime=hwPWVcResumeTime, hwSvcTable=hwSvcTable, hwPWRemoteVcStatus=hwPWRemoteVcStatus, hwPWVcBackup=hwPWVcBackup, hwPWTemplateCtrlword=hwPWTemplateCtrlword, hwPWVcInterworkingType=hwPWVcInterworkingType, hwL2Vpn=hwL2Vpn, hwPWVcTable=hwPWVcTable, hwSvcBandWidth=hwSvcBandWidth, hwPWVcVrIfIndex=hwPWVcVrIfIndex, hwSvcStatisticsRcvPkts=hwSvcStatisticsRcvPkts, hwPWTemplateBFDDetectMultiplier=hwPWTemplateBFDDetectMultiplier, hwLdpPWStateChangeReasonGroup=hwLdpPWStateChangeReasonGroup, hwL2vpnPWTableMIBGroups=hwL2vpnPWTableMIBGroups, hwSvcTnlTable=hwSvcTnlTable, hwPWVcTnlGroup=hwPWVcTnlGroup, hwPWVcUpStartTime=hwPWVcUpStartTime, hwSvcPwTdmEncapsulationNum=hwSvcPwTdmEncapsulationNum, hwPwVcSwitchAdminPwIfIndex=hwPwVcSwitchAdminPwIfIndex, hwPwVcSwitchBackupVcSlaveMasterMode=hwPwVcSwitchBackupVcSlaveMasterMode, HWLdpPwStateChangeReason=HWLdpPwStateChangeReason, hwSvcPwRtpHeader=hwSvcPwRtpHeader, hwPWRemoteVcID=hwPWRemoteVcID, hwSvcTnlEntry=hwSvcTnlEntry, hwPWVcStatisticsTable=hwPWVcStatisticsTable, hwPwVcSwitchBackupVcPeerAddrType=hwPwVcSwitchBackupVcPeerAddrType, hwPWVcTDMPerfCurrentMalformedPkt=hwPWVcTDMPerfCurrentMalformedPkt, hwSvcTnlPolicyName=hwSvcTnlPolicyName, hwSvcUp=hwSvcUp, hwSvcAtmPackOvertime=hwSvcAtmPackOvertime, hwSvcPeerAddrType=hwSvcPeerAddrType, hwSvcPWTemplateName=hwSvcPWTemplateName, hwPWBFDMinTransmitInterval=hwPWBFDMinTransmitInterval, hwPWVcMaxAtmCells=hwPWVcMaxAtmCells, hwSvcRowStatus=hwSvcRowStatus, hwSvcStatisticsSndBytes=hwSvcStatisticsSndBytes, hwPWVcSwitchPeerAddrType=hwPWVcSwitchPeerAddrType, hwSvcType=hwSvcType, hwSvcUpSumTime=hwSvcUpSumTime, hwPWRemoteVcTable=hwPWRemoteVcTable, hwPWVcStateChangeReason=hwPWVcStateChangeReason, hwPwVcSwitchVcSlaveMasterMode=hwPwVcSwitchVcSlaveMasterMode, hwPWVcSwitchSign=hwPWVcSwitchSign, hwSvcEntry=hwSvcEntry, PYSNMP_MODULE_ID=hwL2VpnPwe3, hwPWTnlForBfdIndex=hwPWTnlForBfdIndex, hwSvcInboundLabel=hwSvcInboundLabel, hwSvcRerouteReason=hwSvcRerouteReason, hwSvcTnlType=hwSvcTnlType, hwPWVcCfmMaName=hwPWVcCfmMaName, hwPWTemplateAtmPackOvertime=hwPWTemplateAtmPackOvertime, hwPWVcSwitchPir=hwPWVcSwitchPir, hwPWTemplateQosProfile=hwPWTemplateQosProfile, hwSvcDeletedNotifEnable=hwSvcDeletedNotifEnable)
mibBuilder.exportSymbols("HUAWEI-PWE3-MIB", hwPWTemplateFrag=hwPWTemplateFrag, hwPwVcSwitchBackupVcId=hwPwVcSwitchBackupVcId, hwPWEthOamType=hwPWEthOamType, hwPWVcSwitchRmtID=hwPWVcSwitchRmtID, hwSvcOAMSync=hwSvcOAMSync, hwPwVcSwitchCwTrans=hwPwVcSwitchCwTrans, hwPWBFDDetectMultiplier=hwPWBFDDetectMultiplier, hwSvcPir=hwSvcPir, hwPWTableObjects=hwPWTableObjects, hwPwVcSwitchBackupVcReceiveLabel=hwPwVcSwitchBackupVcReceiveLabel, hwSvcRawOrTagged=hwSvcRawOrTagged, hwPWTemplatePwRtpHeader=hwPWTemplatePwRtpHeader, hwPWTemplatePwCCSeqEnable=hwPWTemplatePwCCSeqEnable, hwPWVcRawOrTagged=hwPWVcRawOrTagged, hwLdpPWStateChangeReason=hwLdpPWStateChangeReason, hwPWVcVrID=hwPWVcVrID, hwPWTemplateTnlPolicyName=hwPWTemplateTnlPolicyName, hwPWTemplatePwIdleCode=hwPWTemplatePwIdleCode, hwPWTemplateCannotDeleted=hwPWTemplateCannotDeleted, hwSvcNotificationControlGroup=hwSvcNotificationControlGroup, hwSvcGroupID=hwSvcGroupID, hwPWVcSwitchNotifEnable=hwPWVcSwitchNotifEnable, hwPWVcRowStatus=hwPWVcRowStatus, hwPWVcTDMPerfCurrentEntry=hwPWVcTDMPerfCurrentEntry, hwPWVcExplicitPathName=hwPWVcExplicitPathName, hwPWDynamicBFDDetect=hwPWDynamicBFDDetect)
|
def median(nums):
"""
Find median of a list of numbers.
>>> median([0])
0
>>> median([4,1,3,2])
2.5
Args:
nums: List of nums
Returns:
Median.
"""
sorted_list = sorted(nums)
med = None
if len(sorted_list) % 2 == 0:
mid_index_1 = len(sorted_list) // 2
mid_index_2 = (len(sorted_list) // 2) - 1
med = (sorted_list[mid_index_1] + sorted_list[mid_index_2]) / float(2)
else:
mid_index = (len(sorted_list) - 1) // 2
med = sorted_list[mid_index]
return med
def main():
print("Odd number of numbers:")
print(median([2, 4, 6, 8, 20, 50, 70]))
print("Even number of numbers:")
print(median([2, 4, 6, 8, 20, 50]))
if __name__ == '__main__':
main()
|
# Autogenerated config.py
#
# NOTE: config.py is intended for advanced users who are comfortable
# with manually migrating the config file on qutebrowser upgrades. If
# you prefer, you can also configure qutebrowser using the
# :set/:bind/:config-* commands without having to write a config.py
# file.
#
# Documentation:
# qute://help/configuring.html
# qute://help/settings.html
# Change the argument to True to still load settings configured via autoconfig.yml
config.load_autoconfig(False)
# Always restore open sites when qutebrowser is reopened. Without this
# option set, `:wq` (`:quit --save`) needs to be used to save open tabs
# (and restore them), while quitting qutebrowser in any other way will
# not save/restore the session. By default, this will save to the
# session which was last loaded. This behavior can be customized via the
# `session.default_name` setting.
# Type: Bool
c.auto_save.session = True
# Which cookies to accept. With QtWebEngine, this setting also controls
# other features with tracking capabilities similar to those of cookies;
# including IndexedDB, DOM storage, filesystem API, service workers, and
# AppCache. Note that with QtWebKit, only `all` and `never` are
# supported as per-domain values. Setting `no-3rdparty` or `no-
# unknown-3rdparty` per-domain on QtWebKit will have the same effect as
# `all`. If this setting is used with URL patterns, the pattern gets
# applied to the origin/first party URL of the page making the request,
# not the request URL. With QtWebEngine 5.15.0+, paths will be stripped
# from URLs, so URL patterns using paths will not match. With
# QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so
# you will typically need to set this setting for `example.com` when the
# cookie is set on `somesubdomain.example.com` for it to work properly.
# To debug issues with this setting, start qutebrowser with `--debug
# --logfilter network --debug-flag log-cookies` which will show all
# cookies being set.
# Type: String
# Valid values:
# - all: Accept all cookies.
# - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail.
# - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty.
# - never: Don't accept cookies at all.
config.set('content.cookies.accept', 'all', 'chrome-devtools://*')
# Which cookies to accept. With QtWebEngine, this setting also controls
# other features with tracking capabilities similar to those of cookies;
# including IndexedDB, DOM storage, filesystem API, service workers, and
# AppCache. Note that with QtWebKit, only `all` and `never` are
# supported as per-domain values. Setting `no-3rdparty` or `no-
# unknown-3rdparty` per-domain on QtWebKit will have the same effect as
# `all`. If this setting is used with URL patterns, the pattern gets
# applied to the origin/first party URL of the page making the request,
# not the request URL. With QtWebEngine 5.15.0+, paths will be stripped
# from URLs, so URL patterns using paths will not match. With
# QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so
# you will typically need to set this setting for `example.com` when the
# cookie is set on `somesubdomain.example.com` for it to work properly.
# To debug issues with this setting, start qutebrowser with `--debug
# --logfilter network --debug-flag log-cookies` which will show all
# cookies being set.
# Type: String
# Valid values:
# - all: Accept all cookies.
# - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail.
# - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty.
# - never: Don't accept cookies at all.
config.set('content.cookies.accept', 'all', 'devtools://*')
# Allow websites to request geolocations.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.geolocation', False, 'https://www.google.com.ar')
# Allow websites to request geolocations.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
# Value to send in the `Accept-Language` header. Note that the value
# read from JavaScript is always the global value.
# Type: String
config.set('content.headers.accept_language', '', 'https://matchmaker.krunker.io/*')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version}', 'https://web.whatsapp.com/')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version} Edg/{upstream_browser_version}', 'https://accounts.google.com/*')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99 Safari/537.36', 'https://*.slack.com/*')
# Load images automatically in web pages.
# Type: Bool
config.set('content.images', True, 'chrome-devtools://*')
# Load images automatically in web pages.
# Type: Bool
config.set('content.images', True, 'devtools://*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'chrome-devtools://*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'devtools://*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'chrome://*/*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'qute://*/*')
# Allow websites to record audio.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.media.audio_capture', True, 'https://discord.com')
# Allow websites to record audio and video.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.media.audio_video_capture', True, 'https://hangouts.google.com')
# Allow websites to show notifications.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.notifications.enabled', False, 'https://www.facebook.com')
# Allow websites to show notifications.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.notifications.enabled', False, 'https://www.netflix.com')
# Allow websites to show notifications.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.notifications.enabled', False, 'https://www.nokia.com')
# Allow websites to show notifications.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.notifications.enabled', False, 'https://www.reddit.com')
# Allow websites to show notifications.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.notifications.enabled', False, 'https://www.samsung.com')
# Allow websites to show notifications.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.notifications.enabled', False, 'https://www.youtube.com')
# Allow websites to register protocol handlers via
# `navigator.registerProtocolHandler`.
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
config.set('content.register_protocol_handler', False, 'https://mail.google.com?extsrc=mailto&url=%25s')
# Duration (in milliseconds) to wait before removing finished downloads.
# If set to -1, downloads are never removed.
# Type: Int
c.downloads.remove_finished = 4000
# When to show the statusbar.
# Type: String
# Valid values:
# - always: Always show the statusbar.
# - never: Always hide the statusbar.
# - in-mode: Show the statusbar when in modes other than normal mode.
c.statusbar.show = 'in-mode'
# How to behave when the last tab is closed. If the
# `tabs.tabs_are_windows` setting is set, this is ignored and the
# behavior is always identical to the `close` value.
# Type: String
# Valid values:
# - ignore: Don't do anything.
# - blank: Load a blank page.
# - startpage: Load the start page.
# - default-page: Load the default page.
# - close: Close the window.
c.tabs.last_close = 'startpage'
# When to show the tab bar.
# Type: String
# Valid values:
# - always: Always show the tab bar.
# - never: Always hide the tab bar.
# - multiple: Hide the tab bar if only one tab is open.
# - switching: Show the tab bar when switching tabs.
c.tabs.show = 'never'
# Open a new window for every tab.
# Type: Bool
c.tabs.tabs_are_windows = True
# Search engines which can be used via the address bar. Maps a search
# engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}`
# placeholder. The placeholder will be replaced by the search term, use
# `{{` and `}}` for literal `{`/`}` braces. The following further
# placeholds are defined to configure how special characters in the
# search terms are replaced by safe characters (called 'quoting'): *
# `{}` and `{semiquoted}` quote everything except slashes; this is the
# most sensible choice for almost all search engines (for the search
# term `slash/and&` this placeholder expands to `slash/and%26amp`).
# * `{quoted}` quotes all characters (for `slash/and&` this
# placeholder expands to `slash%2Fand%26amp`). * `{unquoted}` quotes
# nothing (for `slash/and&` this placeholder expands to
# `slash/and&`). * `{0}` means the same as `{}`, but can be used
# multiple times. The search engine named `DEFAULT` is used when
# `url.auto_search` is turned on and something else than a URL was
# entered to be opened. Other search engines can be used by prepending
# the search engine name to the search term, e.g. `:open google
# qutebrowser`.
# Type: Dict
c.url.searchengines = {'DEFAULT': 'https://www.google.com/search?q={}', 'am': 'https://www.amazon.co.in/s?k={}', 'aw': 'https://wiki.archlinux.org/?search={}', 'g': 'https://www.google.com/search?q={}', 're': 'https://www.reddit.com/r/{}', 'wiki': 'https://en.wikipedia.org/wiki/{}', 'yt': 'https://www.youtube.com/results?search_query={}'}
# Page(s) to open at the start.
# Type: List of FuzzyUrl, or FuzzyUrl
c.url.start_pages = '/home/nml/.config/qutebrowser/startpage/index.html'
# Default font families to use. Whenever "default_family" is used in a
# font setting, it's replaced with the fonts listed here. If set to an
# empty value, a system-specific monospace default is used.
# Type: List of Font, or Font
c.fonts.default_family = 'Inter'
# Default font size to use. Whenever "default_size" is used in a font
# setting, it's replaced with the size listed here. Valid values are
# either a float value with a "pt" suffix, or an integer value with a
# "px" suffix.
# Type: String
c.fonts.default_size = '16px'
# Font used in the completion widget.
# Type: Font
c.fonts.completion.entry = '12pt "Inter"'
# Font used in the completion categories.
# Type: Font
c.fonts.completion.category = '12pt "Inter"'
# Font used for the context menu. If set to null, the Qt default is
# used.
# Type: Font
c.fonts.contextmenu = '12pt "Inter"'
# Font used for the debugging console.
# Type: Font
c.fonts.debug_console = '12pt "Inter"'
# Font used for the downloadbar.
# Type: Font
c.fonts.downloads = '12pt "Inter"'
# Font used for the hints.
# Type: Font
c.fonts.hints = '12pt "Inter"'
# Font used in the keyhint widget.
# Type: Font
c.fonts.keyhint = '12pt "Inter"'
# Font used for info messages.
# Type: Font
c.fonts.messages.info = '12pt "Inter"'
# Font used for prompts.
# Type: Font
c.fonts.prompts = '12pt "Inter"'
# Font used in the statusbar.
# Type: Font
c.fonts.statusbar = '12pt "Inter"'
# Font family for standard fonts.
# Type: FontFamily
c.fonts.web.family.standard = 'Inter'
# Font family for sans-serif fonts.
# Type: FontFamily
c.fonts.web.family.sans_serif = 'Inter'
config.source('gruvbox.py')
# Bindings for normal mode
config.bind(',M', 'hint links spawn mpv {hint-url}')
config.bind(',m', 'spawn mpv {url}')
|
'''from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return print("Your bot is alive!")
def run():
app.run(host="0.0.0.0", port=8080) 4692
def keep_alive():
server = Thread(target=run)
server.start()'''
'''from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "I'm alive"
def run():
app.run(host='0.0.0.0',port=4692) #4692 #1151
def keep_alive():
t = Thread(target=run)
t.start()'''
|
#
# PySNMP MIB module CYCLADES-ACS-ADM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CYCLADES-ACS-ADM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:18:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint")
cyACSMgmt, = mibBuilder.importSymbols("CYCLADES-ACS-MIB", "cyACSMgmt")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Gauge32, IpAddress, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, ModuleIdentity, Integer32, Counter32, ObjectIdentity, NotificationType, Counter64, Unsigned32, MibIdentifier, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "IpAddress", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "ModuleIdentity", "Integer32", "Counter32", "ObjectIdentity", "NotificationType", "Counter64", "Unsigned32", "MibIdentifier", "Bits")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
cyACSAdm = ModuleIdentity((1, 3, 6, 1, 4, 1, 2925, 4, 4))
cyACSAdm.setRevisions(('2005-08-29 00:00', '2002-09-20 00:00',))
if mibBuilder.loadTexts: cyACSAdm.setLastUpdated('200508290000Z')
if mibBuilder.loadTexts: cyACSAdm.setOrganization('Cyclades Corporation')
cyACSSave = MibScalar((1, 3, 6, 1, 4, 1, 2925, 4, 4, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("nosave", 0), ("save", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cyACSSave.setStatus('current')
cyACSSerialHUP = MibScalar((1, 3, 6, 1, 4, 1, 2925, 4, 4, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("norestartportslave", 0), ("restartportslave", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cyACSSerialHUP.setStatus('current')
mibBuilder.exportSymbols("CYCLADES-ACS-ADM-MIB", cyACSSerialHUP=cyACSSerialHUP, PYSNMP_MODULE_ID=cyACSAdm, cyACSAdm=cyACSAdm, cyACSSave=cyACSSave)
|
US_CENSUS = {'age': {'18-24': 0.1304,
'25-44': 0.3505,
'45-64': 0.3478,
'65+': 0.1713}, # Age from 2010 US Census https://www.census.gov/prod/cen2010/briefs/c2010br-03.pdf
'education': {'Completed graduate school': 0.1204,
'Graduated from college': 0.2128,
'Some college, no degree': 0.2777,
'Graduated from high school': 0.2832,
'Less than high school': 0.1060}, # Education from 2019 ACS https://www.census.gov/data/tables/2019/demo/educational-attainment/cps-detailed-tables.html
'gender': {'Female': 0.507,
'Male': 0.487,
'Other': 0.006}, # Male-Female from 2010 US Census https://www.census.gov/prod/cen2010/briefs/c2010br-03.pdf, other from https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5227946/
'income': {'Under $15,000': 0.1020,
'Between $15,000 and $49,999': 0.2970,
'Between $50,000 and $74,999': 0.1720,
'Between $75,000 and $99,999': 0.1250,
'Between $100,000 and $150,000': 0.1490,
'Over $150,000': 0.1550}, # Income from 2019 ACS (p34) https://www.census.gov/content/dam/Census/library/publications/2019/demo/p60-266.pdf
'race': {'White or Caucasian': 0.6340,
'Asian or Asian American': 0.0590,
'Black or African American': 0.1340,
'Hispanic or Latino': 0.1530,
'Other': 0.02}, # Race from 2019 Census estimates https://en.wikipedia.org/wiki/Race_and_ethnicity_in_the_United_States#Racial_categories
'urban_rural': {'Suburban': 0.5500,
'Urban': 0.3100,
'Rural': 0.1400}, # Urban-Rural from 2018 Pew https://www.pewsocialtrends.org/2018/05/22/demographic-and-economic-trends-in-urban-suburban-and-rural-communities/
# Regions follow a custom definition, see `US_REGIONS_MAP`
'region': {'Midwest': 0.2149,
'Mountains': 0.0539,
'Northeast': 0.1604,
'Pacific': 0.1602,
'South': 0.2180,
'Southwest': 0.0531,
'Southeast': 0.1398}, # Regions from 2019 Census estimates https://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States_by_population
'vote2016': {'Hillary Clinton': 0.482,
'Donald Trump': 0.461,
'Other': 0.057}, # 2016 US election popular vote as recorded by Wikipedia https://en.wikipedia.org/wiki/2016_United_States_presidential_election
'vote2020': {'Joe Biden': 0.513,
'Donald Trump': 0.469,
'Other': 0.018}, # 2020 US election popular vote as recorded by Wikipedia https://en.wikipedia.org/wiki/2020_United_States_presidential_election
'left_right': {'Liberal': 0.35, # Sienna College / NYT poll <https://int.nyt.com/data/documenttools/nyt-siena-poll-methodology-june-2020/f6f533b4d07f4cbe/full.pdf>
'Moderate': 0.26,
'Conservative': 0.30},
'gss_bible': {'Word of God': 0.31,
'Inspired word': 0.473,
'Book of fables': 0.217}, # From GSS 2018 https://gssdataexplorer.norc.org/variables/364/vshow
'gss_trust': {'Can trust': 0.331,
'Can\'t be too careful': 0.669 }, # From GSS 2018 https://gssdataexplorer.norc.org/variables/441/vshow
'gss_spanking': {'Agree': 0.677,
'Disagree': 0.323}} # From GSS 2018 https://gssdataexplorer.norc.org/trends/Gender%20&%20Marriage?measure=spanking
US_CA_CENSUS = {'age': {'18-24': 0.136,
'25-44': 0.434,
'45-64': 0.282,
'65+': 0.147}, # Age 2018 US Census https://www.infoplease.com/us/census/california/demographic-statistics
'education': {'Completed graduate school': 0.13,
'Graduated from college': 0.218,
'Some college, no degree': 0.285,
'Graduated from high school': 0.206,
'Less than high school': 0.16}, # Education from https://www.statista.com/statistics/306963/educational-attainment-california
'gender': {'Female': 0.499,
'Male': 0.495,
'Other': 0.006}, # Male-Female from 2018 US Census, other from https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5227946/
'income': {'Under $15,000': 0.106,
'Between $15,000 and $49,999': 0.2955,
'Between $50,000 and $74,999': 0.1652,
'Between $75,000 and $99,999': 0.1210,
'Between $100,000 and $150,000': 0.1523,
'Over $150,000': 0.1597}, # Income from https://statisticalatlas.com/state/California/Household-Income
'race': {'White or Caucasian': 0.3664,
'Asian or Asian American': 0.1452,
'Black or African American': 0.0551,
'Hispanic or Latino': 0.3929,
'Other': 0.0404}, # Race from 2018 Census estimates https://en.wikipedia.org/wiki/File:Ethic_California_Organized_Pie.png
'vote2016': {'Hillary Clinton': 0.6173,
'Donald Trump': 0.3162,
'Other': 0.0665}} # 2016 US election popular vote as recorded by Wikipedia https://en.wikipedia.org/wiki/2016_United_States_presidential_election_in_California
US_TX_CENSUS = {'age': {'18-24': 0.109,
'25-44': 0.389,
'45-64': 0.325,
'65+': 0.177}, # Age from 2019 US Census https://www.statista.com/statistics/912205/texas-population-share-age-group/
# 72.7% over 18 per https://en.wikipedia.org/wiki/Demographics_of_Texas
'education': {'Completed graduate school': 0.108,
'Graduated from college': 0.2,
'Some college, no degree': 0.287,
'Graduated from high school': 0.252,
'Less than high school': 0.154}, # Education from https://www.statista.com/statistics/306995/educational-attainment-texas/
'gender': {'Female': 0.499,
'Male': 0.495,
'Other': 0.006}, # Male-Female from https://www.census.gov/quickfacts/TX, other from https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5227946/
'income': {'Under $15,000': 0.1186,
'Between $15,000 and $49,999': 0.3524,
'Between $50,000 and $74,999': 0.1652,
'Between $75,000 and $99,999': 0.119,
'Between $100,000 and $150,000': 0.1342,
'Over $150,000': 0.1106}, # Income from https://statisticalatlas.com/state/Texas/Household-Income
'race': {'White or Caucasian': 0.4140,
'Asian or Asian American': 0.0493,
'Black or African American': 0.1188,
'Hispanic or Latino': 0.3961,
'Other': 0.0218}, # Race from 2018 Census estimates https://en.wikipedia.org/wiki/Demographics_of_Texas
'vote2016': {'Hillary Clinton': 0.4324,
'Donald Trump': 0.5223,
'Other': 0.0453}} # 2016 US election popular vote as recorded by Wikipedia https://en.wikipedia.org/wiki/2016_United_States_presidential_election_in_Texas
US_REGIONS_MAP = {'Midwest': ['Illinois', 'Indiana', 'Iowa', 'Michigan', 'Minnesota',
'Ohio', 'Pennsylvania', 'Wisconsin'],
'Mountains': ['Alaska', 'Idaho', 'Kansas', 'Montana', 'Nebraska',
'North Dakota', 'South Dakota', 'Utah', 'Wyoming', 'Oklahoma'],
'Northeast': ['Connecticut', 'Delaware', 'District of Columbia (DC)',
'Maine', 'Maryland', 'Massachusetts', 'New Hampshire',
'New Jersey', 'New York', 'Rhode Island', 'Vermont'],
'Pacific': ['California', 'Hawaii', 'Oregon', 'Washington', 'Guam',
'Puerto Rico', 'Virgin Islands'],
'South': ['Missouri', 'Tennessee', 'Alabama', 'Arkansas', 'Kentucky',
'Louisiana', 'Mississippi', 'Texas', 'Virginia', 'West Virginia'],
'Southwest': ['Arizona', 'Colorado', 'Nevada', 'New Mexico'],
'Southeast': ['Florida', 'Georgia', 'North Carolina', 'South Carolina']}
|
"""Convert units for human readable values"""
conv_factor = {
'K': 1/1024,
'M': 1,
'G': 1024,
'T': 1024*1024
}
def convert_to_base(string):
"""Convert the string to an integer number of base units.
Example: 3G = 3*1024
"""
stripped = string.strip()
try:
return int(stripped)
except ValueError:
if stripped[-1] in ('K', 'M', 'G', 'T'):
return int(int(stripped[:-1]) * conv_factor[stripped[-1]])
else:
ValueError(f"Invalid unit {stripped[-1]}")
|
# しゃくとり法
N = int(input())
A = list(map(int, input().split()))
result = 0
r = 0
xs = A[0]
cs = A[0]
for l in range(N):
while r < N - 1 and xs ^ A[r + 1] == cs + A[r + 1]:
r += 1
xs ^= A[r]
cs += A[r]
result += r - l + 1
xs ^= A[l]
cs -= A[l]
print(result)
|
def get_range (string):
return_set = set()
for x in string.split(','):
x = x.strip()
if '-' not in x and x.isnumeric():
return_set.add(int(x))
elif x.count('-')==1:
from_here, to_here = x.split('-')[0].strip(), x.split('-')[1].strip()
if from_here.isnumeric() and to_here.isnumeric() and int(from_here)<int(to_here):
for y in range(int(from_here),int(to_here)+1):
return_set.add(y)
return return_set
def search (location='',entry_list=None,less_than=None):
minimum = 0
maximum = len(entry_list)
if less_than is None:
less_than = lambda x,y:x<y
while True:
position = int((minimum+maximum)/2)
if position == minimum or position == maximum:
break
elif entry_list[position] == location:
break
elif 0<position<len(entry_list)-1:
if less_than(entry_list[position-1], location) and less_than(location, entry_list[position+1]):
break
elif less_than(location,entry_list[position]):
maximum = position
else:
minimum = position
else:
break
return position
class Select:
def __init__ (self,entryset=None,sort_function=None):
if entryset:
self.entries = entryset
self.to_delete = set()
self.purged = set()
if sort_function is None:
sort_function = lambda x:x
self.sort_function = sort_function
def load (self,entryset):
self.entries = entryset
if isinstance(self.entries,list):
self.entries = set(self.entries)
def show (self,showlist,start=0):
for counter, x in enumerate(showlist):
print(counter+start,':',x)
def scroll_through (self,entry_list):
def less_than (x,y):
if x == y:
return False
elif sorted([x,y],key = lambda x:self.sort_function(x))[0] == x:
return True
return False
if entry_list:
scroll_list = sorted(entry_list,key=lambda x:self.sort_function(x))
else:
scroll_list = []
starting = 0
showing = 20
go_on = True
while go_on:
sort = False
last = ''
relocate = False
print()
self.show (scroll_list [starting:min([starting+showing,len(scroll_list)])],start=starting)
while True:
inp = input('\n\n[ < > ] D(elete); U(ndelete); C(hange); Q(uit); \nR(eform); I(nvert); c(L)ear); A(dd)\n Add (M)any; S(sort); (F)ind \n')
if inp in ['[',']','<','>','D','C','Q','U','R','I','A','F','S','L','M']:
break
if inp == '[':
starting = 0
elif inp == ']':
staring = len(scroll_list)
elif inp == '<':
starting -= showing
elif inp == '>':
starting += showing
elif inp == 'C':
new = input('SHOW HOW MANY> ?')
if new.isnumeric():
new = int(new)
if 0 < new < 101:
showing = new
elif inp == 'Q':
go_on = False
elif inp in ['D','U']:
to_delete = input('?')
for x in get_range(to_delete):
if 0 <= x < len(scroll_list):
if inp == 'D':
scroll_list [x] = '_'+scroll_list[x]
elif inp == 'U' and scroll_list [x].startswith('_'):
scroll_list [x] = scroll_list [x][1:]
elif inp == 'R':
new_list = []
for x in scroll_list:
if not x.startswith ('_'):
new_list.append(x)
else:
self.purged.add(x[1:])
scroll_list = new_list
elif inp in ['I']:
for x in range(len(scroll_list)):
if scroll_list[x].startswith('_'):
scroll_list[x] = scroll_list[x][1:]
else:
scroll_list [x] = '_' + scroll_list[x]
elif inp == 'L':
for x in range(len(scroll_list)):
if scroll_list[x].startswith('_'):
scroll_list[x] = scroll_list[x][1:]
elif inp == 'A':
new = input('ADD> ?')
scroll_list.append(new.strip())
sort = True
last = new.strip()
relocate = True
position = search(new.strip(),entry_list=scroll_list,less_than=less_than)
elif inp == 'M':
new = input('ADD> W1,W2,W3... ?')
for x in new.split(','):
scroll_list.append(x.strip())
last = x.strip()
relocate = True
sort = True
elif inp == 'S':
sort = True
elif inp == 'F':
last = (input('FIND> ?'))
relocate = True
if sort:
scroll_list = sorted(scroll_list,key=lambda x:self.sort_function(x))
if relocate and last:
position = search(last,entry_list=scroll_list,less_than=less_than)
starting = position - int(showing/2)
if starting < 0:
starting = 0
elif starting > len(entry_list)-1:
starting = len(entry_list)-1
self.entries = set(scroll_list)
return [x for x in scroll_list if not x.startswith('_')]
def finish (self):
return self.entries
if __name__ == '__main__':
sel = Select(sort_function=lambda x:int(x))
sel.scroll_through({str(x) for x in range(100000)})
|
# Implementation of SequentialSearch in python
# Python3 code to sequentially search key in arr[].
# If key is present then return its position,
# otherwise return -1
# If return value -1 then print "Not Found!"
# else print position at which element found
def Sequential_Search(dlist, item):
pos = 0
found = False
while pos < len(dlist) and not found:
if dlist[pos] == item:
# check if element at current position in list matches entered key
found = True
else:
pos += 1
if found:
return pos
else:
return -1
# Driver Code
list = input("Enter list elements (space seperated): ").split()
list = [int(i) for i in list]
key = int(input("Enter key to search: "))
res = Sequential_Search(list, key)
if res >= 0:
print(f"Found element at position: {res}")
else:
print("Not found!")
|
user_name = "user"
password = "pass"
url= "ip address"
project_scope_name = "username"
domain_id = "defa"
|
CURRENCY_LIST_ACRONYM = [
('AUD','Australia Dollar'),
('GBP','Great Britain Pound'),
('EUR','Euro'),
('JPY','Japan Yen'),
('CHF','Switzerland Franc'),
('USD','USA Dollar'),
('AFN','Afghanistan Afghani'),
('ALL','Albania Lek'),
('DZD','Algeria Dinar'),
('AOA','Angola Kwanza'),
('ARS','Argentina Peso'),
('AMD','Armenia Dram'),
('AWG','Aruba Florin'),
('AUD','Australia Dollar'),
('ATS','Austria Schilling'),
('BEF','Belgium Franc'),
('AZN','Azerbaijan New Manat'),
('BSD','Bahamas Dollar'),
('BHD','Bahrain Dinar'),
('BDT','Bangladesh Taka'),
('BBD','Barbados Dollar'),
('BYR','Belarus Ruble'),
('BZD','Belize Dollar'),
('BMD','Bermuda Dollar'),
('BTN','Bhutan Ngultrum'),
('BOB','Bolivia Boliviano'),
('BAM','Bosnia Mark'),
('BWP','Botswana Pula'),
('BRL','Brazil Real'),
('GBP','Great Britain Pound'),
('BND','Brunei Dollar'),
('BGN','Bulgaria Lev'),
('BIF','Burundi Franc'),
('XOF','CFA Franc BCEAO'),
('XAF','CFA Franc BEAC'),
('XPF','CFP Franc'),
('KHR','Cambodia Riel'),
('CAD','Canada Dollar'),
('CVE','Cape Verde Escudo'),
('KYD','Cayman Islands Dollar'),
('CLP','Chili Peso'),
('CNY','China Yuan/Renminbi'),
('COP','Colombia Peso'),
('KMF','Comoros Franc'),
('CDF','Congo Franc'),
('CRC','Costa Rica Colon'),
('HRK','Croatia Kuna'),
('CUC','Cuba Convertible Peso'),
('CUP','Cuba Peso'),
('CYP','Cyprus Pound'),
('CZK','Czech Koruna'),
('DKK','Denmark Krone'),
('DJF','Djibouti Franc'),
('DOP','Dominican Republich Peso'),
('XCD','East Caribbean Dollar'),
('EGP','Egypt Pound'),
('SVC','El Salvador Colon'),
('EEK','Estonia Kroon'),
('ETB','Ethiopia Birr'),
('EUR','Euro'),
('FKP','Falkland Islands Pound'),
('FIM','Finland Markka'),
('FJD','Fiji Dollar'),
('GMD','Gambia Dalasi'),
('GEL','Georgia Lari'),
('DMK','Germany Mark'),
('GHS','Ghana New Cedi'),
('GIP','Gibraltar Pound'),
('GRD','Greece Drachma'),
('GTQ','Guatemala Quetzal'),
('GNF','Guinea Franc'),
('GYD','Guyana Dollar'),
('HTG','Haiti Gourde'),
('HNL','Honduras Lempira'),
('HKD','Hong Kong Dollar'),
('HUF','Hungary Forint'),
('ISK','Iceland Krona'),
('INR','India Rupee'),
('IDR','Indonesia Rupiah'),
('IRR','Iran Rial'),
('IQD','Iraq Dinar'),
('IED','Ireland Pound'),
('ILS','Israel New Shekel'),
('ITL','Italy Lira'),
('JMD','Jamaica Dollar'),
('JPY','Japan Yen'),
('JOD','Jordan Dinar'),
('KZT','Kazakhstan Tenge'),
('KES','Kenya Shilling'),
('KWD','Kuwait Dinar'),
('KGS','Kyrgyzstan Som'),
('LAK','Laos Kip'),
('LVL','Latvia Lats'),
('LBP','Lebanon Pound'),
('LSL','Lesotho Loti'),
('LRD','Liberia Dollar'),
('LYD','Libya Dinar'),
('LTL','Lithuania Litas'),
('LUF','Luxembourg Franc'),
('MOP','Macau Pataca'),
('MKD','Macedonia Denar'),
('MGA','Malagasy Ariary'),
('MWK','Malawi Kwacha'),
('MYR','Malaysia Ringgit'),
('MVR','Maldives Rufiyaa'),
('MTL','Malta Lira'),
('MRO','Mauritania Ouguiya'),
('MUR','Mauritius Rupee'),
('MXN','Mexico Peso'),
('MDL','Moldova Leu'),
('MNT','Mongolia Tugrik'),
('MAD','Morocco Dirham'),
('MZN','Mozambique New Metical'),
('MMK','Myanmar Kyat'),
('ANG','NL Antilles Guilder'),
('NAD','Namibia Dollar'),
('NPR','Nepal Rupee'),
('NLG','Netherlands Guilder'),
('NZD','New Zealand Dollar'),
('NIO','Nicaragua Cordoba Oro'),
('NGN','Nigeria Naira'),
('KPW','North Korea Won'),
('NOK','Norway Kroner'),
('OMR','Oman Rial'),
('PKR','Pakistan Rupee'),
('PAB','Panama Balboa'),
('PGK','Papua New Guinea Kina'),
('PYG','Paraguay Guarani'),
('PEN','Peru Nuevo Sol'),
('PHP','Philippines Peso'),
('PLN','Poland Zloty'),
('PTE','Portugal Escudo'),
('QAR','Qatar Rial'),
('RON','Romania New Lei'),
('RUB','Russia Rouble'),
('RWF','Rwanda Franc'),
('WST','Samoa Tala'),
('STD','Sao Tome/Principe Dobra'),
('SAR','Saudi Arabia Riyal'),
('RSD','Serbia Dinar'),
('SCR','Seychelles Rupee'),
('SLL','Sierra Leone Leone'),
('SGD','Singapore Dollar'),
('SKK','Slovakia Koruna'),
('SIT','Slovenia Tolar'),
('SBD','Solomon Islands Dollar'),
('SOS','Somali Shilling'),
('ZAR','South Africa Rand'),
('KRW','South Korea Won'),
('ESP','Spain Peseta'),
('LKR','Sri Lanka Rupee'),
('SHP','St Helena Pound'),
('SDG','Sudan Pound'),
('SRD','Suriname Dollar'),
('SZL','Swaziland Lilangeni'),
('SEK','Sweden Krona'),
('CHF','Switzerland Franc'),
('SYP','Syria Pound'),
('TWD','Taiwan Dollar'),
('TZS','Tanzania Shilling'),
('THB','Thailand Baht'),
('TOP','Tonga Pa\'anga'),
('TTD','Trinidad/Tobago Dollar'),
('TND','Tunisia Dinar'),
('TRY','Turkish New Lira'),
('TMM','Turkmenistan Manat'),
('USD','USA Dollar'),
('UGX','Uganda Shilling'),
('UAH','Ukraine Hryvnia'),
('UYU','Uruguay Peso'),
('AED','United Arab Emirates Dirham'),
('VUV','Vanuatu Vatu'),
('VEB','Venezuela Bolivar'),
('VND','Vietnam Dong'),
('YER','Yemen Rial'),
('ZMK','Zambia Kwacha'),
('ZWD','Zimbabwe Dollar')
]
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
if __name__=='__main__':
print("Hello every body, I am Thomas.Li. I will be study hard for algorithms excercise")
|
class CIDR(object):
def __init__(self, base, size=None):
try:
base, _size = base.split('/')
except ValueError:
pass
else:
if size is None:
size = _size
self.size = 2 ** (32 - int(size))
self._mask = ~(self.size - 1)
self._base = self.ip2dec(base) & self._mask
self.base = self.dec2ip(self._base)
self.block = int(size)
self.mask = self.dec2ip(self._mask)
@property
def last(self):
return self.dec2ip(self._base + self.size - 1)
def __len__(self):
return self.size
def __str__(self):
return "{0}/{1}".format(
self.base,
self.block,
)
def __contains__(self, ip):
return self.ip2dec(ip) & self._mask == self._base
@staticmethod
def ip2dec(ip):
return sum([int(q) << i * 8 for i, q in enumerate(reversed(ip.split(".")))])
@staticmethod
def dec2ip(ip):
return '.'.join([str((ip >> 8 * i) & 255) for i in range(3, -1, -1)])
class CIDRIterator(object):
def __init__(self, base, size):
self.current = base
self.final = base + size
def __iter__(self):
return self
def next(self):
c = self.current
self.current += 1
if self.current > self.final:
raise StopIteration
return CIDR.dec2ip(c)
def __iter__(self):
return self.CIDRIterator(self._base, self.size)
|
'''
URL: https://leetcode.com/problems/minimum-falling-path-sum
Time complexity: O(nm)
Space complexity: O(nm)
'''
class Solution:
def minFallingPathSum(self, A):
"""
:type A: List[List[int]]
:rtype: int
"""
memo = [[None for i in range(len(A[0]))] for j in range(len(A))]
curr_min_sum = float('inf')
for i in range(len(A)):
min_sum = self._min_falling(memo, (0, i), A)
curr_min_sum = min(min_sum, curr_min_sum)
return curr_min_sum
def _min_falling(self, memo, curr_pos, A):
x, y = curr_pos
next_row = x+1
if next_row >= len(A):
return A[x][y]
curr_min_sum = float('inf')
curr_column_selected = None
next_columns = [y-1, y, y+1]
for next_column in next_columns:
if next_column < 0 or next_column >= len(A[0]):
continue
if memo[next_row][next_column] is not None:
child_min_sum = memo[next_row][next_column]
else:
child_min_sum = self._min_falling(memo, (next_row, next_column), A)
if A[x][y] + child_min_sum < curr_min_sum:
curr_min_sum = child_min_sum + A[x][y]
curr_column_selected = next_column
memo[x][y] = curr_min_sum
return curr_min_sum
|
USERS = "users"
COMMUNITIES = 'communities'
TEAMS = 'teams'
METRICS = 'metrics'
ACTIONS = 'actions'
|
'''
Created on 28-mei-2016
@author: vincent
Static configuration, updated and generated by autoconf
'''
VERSION = "0.1.0"
|
# -*- coding: utf-8 -*-
# SiteProfileNotAvailable compatibility
class SiteProfileNotAvailable(Exception):
pass
|
# 817. Linked List Components
# ttungl@gmail.com
# We are given head, the head node of a linked list containing unique integer values.
# We are also given the list G, a subset of the values in the linked list.
# Return the number of connected components in G, where two values are connected if they appear consecutively in the linked list.
# Example 1:
# Input:
# head: 0->1->2->3
# G = [0, 1, 3]
# Output: 2
# Explanation:
# 0 and 1 are connected, so [0, 1] and [3] are the two connected components.
# Example 2:
# Input:
# head: 0->1->2->3->4
# G = [0, 3, 1, 4]
# Output: 2
# Explanation:
# 0 and 1 are connected, 3 and 4 are connected, so [0, 1] and [3, 4] are the two connected components.
# Note:
# If N is the length of the linked list given by head, 1 <= N <= 10000.
# The value of each node in the linked list will be in the range [0, N - 1].
# 1 <= G.length <= 10000.
# G is a subset of all values in the linked list.
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def numComponents(self, head, G):
"""
:type head: ListNode
:type G: List[int]
:rtype: int
"""
# sol 1:
# if node in G and (next node null or next node val not in G): count.
# runtime: 135ms
res, setG = 0, set(G)
while head:
if head.val in setG and (not head.next or head.next.val not in setG):
res += 1
head = head.next
return res
# sol 2:
# runtime: 144ms
res, setG = 0, set(G)
p, prev = head, False
while p:
if p.val in setG and not prev: res += 1
prev, p = p.val in setG, p.next
return res
|
class Queen:
def __init__(self, row: int, column: int):
if row not in range(0, 8) or column not in range(0, 8):
raise ValueError("Must be between 0 and 7")
self.i = row
self.j = column
def can_attack(self, another_queen: 'Queen') -> bool:
if self.i == another_queen.i and self.j == another_queen.j:
raise ValueError(f"Cannot be the same initial position [{self.i},{self.j}]")
# same row, column or diff
return self.i == another_queen.i or self.j == another_queen.j \
or abs(another_queen.i - self.i) == abs(another_queen.j - self.j)
|
def append_suppliers_list():
suppliers = []
counter = 1
supply = ""
while supply != "stop":
supply = input(f'Enter first name and last name of suppliers {counter} \n')
suppliers.append(supply)
counter += 1
suppliers.pop()
return suppliers
append_suppliers_list()
|
def test(a,b,c):
a =1
b =2
c =3
return [1,2,3]
a = test(1,2,3)
print(a,test)
|
class BaseData:
def __init__(self):
self.root_dir = None
self.gray = None
self.div_Lint = None
self.filenames = None
self.L = None
self.Lint = None
self.mask = None
self.M = None
self.N = None
def _load_mask(self):
raise NotImplementedError
def _load_M(self):
raise NotImplementedError
def _load_N(self):
raise NotImplementedError
def _to_gray(self):
raise NotImplementedError
def _div_Lint(self):
raise NotImplementedError
|
def decimal_to_binary(decimal_integer):
return bin(decimal_integer).replace("0b", "")
def solution(binary_integer):
count = 0
max_count = 0
for element in binary_integer:
if element == "1":
count += 1
if max_count < count:
max_count = count
else:
count = 0
return max_count
if __name__ == '__main__':
n = int(input())
binary_n = decimal_to_binary(n)
print(solution(binary_n))
|
rows= int(input("Enter the number of rows: "))
cols= int(input("Enter the number of columns: "))
matrixA=[]
print("Enter the entries rowwise for matrix A: ")
for i in range(rows):
a=[]
for j in range(cols):
a.append(int(input()))
matrixA.append(a)
matrixB=[]
print("Enter the entries rowwise for matrix B: ")
for i in range(rows):
b=[]
for j in range(cols):
b.append(int(input()))
matrixB.append(b)
matrixResultant=[[ 0 for i in range(rows) ] for j in range(cols)]
for i in range(rows):
for j in range(cols):
matrixResultant[i][j]=matrixA[i][j]+matrixB[i][j]
for r in matrixResultant:
print (r)
|
"""
- 기본적으로 1개의 서브리스트가 나올때까지 분할을 진행
- 이후 배열값을 반복문을 통해 비교 -> 정렬 ->교환 후 합치기
ref : https://www.geeksforgeeks.org/merge-sort/
"""
def merge_sort(arr):
if len(arr) >1 :
mid = len(arr) // 2 # 배열의 중간 찾기
left = arr[:mid] # 나눠진 왼쪽부분
right = arr[mid:] # 나눠진 오른쪽 부분
# 재귀 분할정복
merge_sort(left) # 왼쪽부분에 대해 정렬 함수 호출을 통해 정렬
merge_sort(right) # 오른쪽 부분에 대해 정렬함수 호출을 통해 정렬
i = j = k = 0
# 배열의 인덱스를 참조하여 비교-> 정렬 -> 교환
while i <len(left) and j < len(right):
if left[i] < right[j]:
arr[k] = left[i] # 왼쪽 값을 결과를 위한 값에 저장
i += 1 # 왼쪽 배열값 인덱스 1 증가
else: # 왼쪼값 > 오른쪽 값
arr[k] = right[j]
j += 1
k +=1
#왼쪽과 오른쪽에 대해 중간정렬 결과 확인
print(left)
print(right)
# 왼쪽에 남는 요소가 있는지 확인
while i < len(left) :
arr[k] = left[i]
i +=1
k +=1
# 오른쪽에 남는 요소가 있는지 확인
while j < len(right):
arr[k] = right[j]
j += 1
k += 1
def printlist(arr):
for i in range(len(arr)):
print(arr[i], end = " ")
print()
if __name__ == "__main__":
arr = [7,3,2,16,24,4,11,9]
print("정렬전 테스트 배열 ",end="\n")
printlist(arr)
merge_sort(arr) # 병합정렬 적용
print("정렬된 테스트 배열 ",end="\n")
printlist(arr)
|
class Solution(object):
def rob(self, nums):
def helper(nums, i):
le = len(nums)
if i == le - 1:
return nums[le-1]
if i == le - 2:
return max(nums[le-1], nums[le-2])
if i == le - 3:
return max(nums[le-3] + nums[le-1], nums[le-2])
return max(helper(nums, i+2) + nums[i], helper(nums, i+1))
return helper(nums, 0)
def rob_2(self, nums):
le = len(nums)
ans = [0]*(le+1)
ans[-2] = nums[-1]
for i in range(le-2, -1, -1):
ans[i] = max(nums[i] + ans[i+2], ans[i+1])
return ans[0]
if __name__ == '__main__':
print(Solution().rob_2([2, 7, 9, 3, 1]))
|
k = int(input())
for z in range(k):
l = int(input())
n = list(map(int,input().split()))
c = 0
for i in range(l-1):
for j in range(i+1,l):
if n[i]>n[j]:
c += 1
if c%2==0:
print('YES')
else:
print('NO')
|
test = {
'name': 'q3_1_1',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> len(my_20_features)
20
""",
'hidden': False,
'locked': False
},
{
'code': r"""
>>> np.all([f in test_movies.labels for f in my_20_features])
True
""",
'hidden': False,
'locked': False
},
{
'code': r"""
>>> # It looks like there are many movies in the training set that;
>>> # don't have any of your chosen words. That will make your;
>>> # classifier perform very poorly in some cases. Try choosing;
>>> # at least 1 common word.;
>>> train_f = train_movies.select(my_20_features);
>>> np.count_nonzero(train_f.apply(lambda r: np.sum(np.abs(np.array(r))) == 0)) < 20
True
""",
'hidden': False,
'locked': False
},
{
'code': r"""
>>> # It looks like there are many movies in the test set that;
>>> # don't have any of your chosen words. That will make your;
>>> # classifier perform very poorly in some cases. Try choosing;
>>> # at least 1 common word.;
>>> test_f = test_movies.select(my_20_features);
>>> np.count_nonzero(test_f.apply(lambda r: np.sum(np.abs(np.array(r))) == 0)) < 5
True
""",
'hidden': False,
'locked': False
},
{
'code': r"""
>>> # It looks like you may have duplicate words! Make sure not to!;
>>> len(set(my_20_features)) >= 20
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'
}
]
}
|
line = input().split()
H = int(line[0])
W = int(line[1])
array = []
def get_ij(index):
i = index // W
if (i % 2 == 0):
j = index % W
else:
j = W - index % W - 1
return i+1, j+1
for i in range(H):
if i % 2 == 0:
array.extend([int(a) for a in input().split()])
else:
array.extend(reversed([int(a) for a in input().split()]))
move_index = []
previous_move = False
for i, a in enumerate(array[:-1]):
even = a % 2 == 0
if previous_move and even:
# print(i, a, 1, previous_move, even)
move_index.append(i)
previous_move = True
elif not previous_move and not even:
# print(i, a, 2, previous_move, even)
move_index.append(i)
previous_move = True
else:
previous_move = False
print(len(move_index))
for i in move_index:
ind_from = get_ij(i)
ind_to = get_ij(i+1)
print("{} {} {} {}".format(ind_from[0], ind_from[1], ind_to[0], ind_to[1]))
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
VERSION
Control de versiones.
Autor: PABLO PIZARRO @ github.com/ppizarror
Fecha: SEPTIEMBRE 2016
Licencia: MiT licence
"""
__version__ = '1.0.0'
|
# -*- coding: utf-8 -*-
"""
Created on Sun May 20 21:01:53 2018
@author: DrLC
"""
class VarDecl(object):
def __init__(self, line=""):
line = line.strip().strip(';,').strip().split()
self.__type = line[0]
assert self.__type in ["int", "float"], "Invalid type \""+self.__type+"\""
self.__name = line[-1]
def __str__(self):
return str(self.__type) + " " + str(self.__name)
def __eq__(self, obj):
if type(obj) is not type(self):
return False
return (obj.get_name() == self.__name
and obj.get_type() == self.__type)
def get_name(self): return self.__name
def get_type(self): return self.__type
class FuncDecl(object):
def __init__(self, line=""):
line = line.strip()
self.__name = line[:line.find("(")].strip()
arg_line = line[line.find("(")+1: line.find(")")].strip()
if len(arg_line) > 0:
arg_line = arg_line.split(",")
self.__args = []
for a in arg_line:
self.__args.append(VarDecl(a.strip().strip(',').strip()))
else: self.__args = []
def __str__(self):
ret = self.__name + " ("
for i in range(len(self.__args)):
if i == 0:
ret += str(self.__args[i])
else: ret += ", " + str(self.__args[i])
return ret + ")"
def __eq__(self, obj):
if type(obj) is not type(self):
return False
if not obj.get_name() == self.__name:
return False
obj_args = obj.get_args()
if not len(obj_args) == len(self.__args):
return False
for i in range(len(obj_args)):
if not obj_args[i].get_type() == self.__args[i].get_type():
return False
return True
def get_name(self): return self.__name
def get_args(self): return self.__args
def build_symtab(ssa=""):
with open(ssa, 'r') as f:
lines = f.readlines()
new_func = False
in_func = False
var_decl = False
SYM_TABLE = {}
for line, line_no in zip(lines, range(len(lines))):
# print (line, end="")
if line[:2] == ';;':
new_func = True
elif new_func and len(line.strip()) > 0:
new_func = False
var_decl = True
in_func = True
tmp_f = FuncDecl(line)
tmp_f_begin = line_no
tmp_vars = []
elif var_decl:
if len(line.strip()) == 0:
pass
elif line.find("<") >= 0 and line.find(">") >= 0:
var_decl = False
tmp_f_bb_line = line_no
SYM_TABLE[tmp_f.get_name()] = {"decl": tmp_f, "vars": tmp_vars}
elif line.strip() == '{': pass
else: tmp_vars.append(VarDecl(line))
elif in_func:
if line.strip() == '}':
in_func = False
SYM_TABLE[tmp_f.get_name()]['lines'] = [tmp_f_begin, tmp_f_bb_line, line_no]
for key in SYM_TABLE.keys():
item = SYM_TABLE[key]
var_list = item['decl'].get_args() + item['vars']
for i in range(len(var_list)-1):
for j in range(i+1, len(var_list)):
assert not var_list[i].get_name() == var_list[j].get_name(), \
"Redefine of \""+str(var_list[i])+"\" and \""+str(var_list[j])+"\""
return SYM_TABLE
if __name__ == "__main__":
sym_tab = build_symtab("../benchmark/t7.ssa")
for key in sym_tab.keys():
item = sym_tab[key]
print ("Function:")
print (" "+str(item["decl"]))
print (" Begin: line "+str(item['lines'][0]))
print (" Blocks: line "+str(item['lines'][1]))
print (" End: line "+str(item['lines'][2]))
if len(item["vars"]) == 0:
print (" Vars:\tNone")
else:
print (" Vars:")
for v in item["vars"]:
print (end=" ")
print (str(v))
print ()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.