content stringlengths 7 1.05M |
|---|
"""Wrapper Exceptions"""
class ApiRequestFailed(Exception):
"""
Denotes a failure interacting with the API, such as the HTTP 4xx Series
"""
pass
class ApiRequest400(ApiRequestFailed):
"""
Denotes a HTTP 400 error while interacting with the API
"""
pass
class ImportDeleteError(ApiRequestFailed):
"""
The API call to mark an import as deleted did not complete correctly
"""
pass
class MemberChangeStatusError(ApiRequestFailed):
"""
The API call to change a member's status did not complete correctly
"""
pass
class MemberCopyToGroupError(ApiRequestFailed):
"""
The API call to copy members into a group did not complete correctly
"""
pass
class MemberDeleteError(ApiRequestFailed):
"""
The API call to delete a member did not complete correctly
"""
pass
class MemberDropGroupError(ApiRequestFailed):
"""
The API call to drop groups from a member did not complete correctly
"""
pass
class MemberUpdateError(ApiRequestFailed):
"""
The API call to update a member's information did not complete correctly
"""
pass
class GroupUpdateError(ApiRequestFailed):
"""
The API call to update a group's information did not complete correctly
"""
pass
class NoMemberEmailError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (email)
"""
pass
class NoMemberIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (member_id)
"""
pass
class NoMemberStatusError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (status)
"""
pass
class NoGroupIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (member_group_id)
"""
pass
class NoGroupNameError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (group_name)
"""
pass
class NoImportIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (import_id)
"""
pass
class NoFieldIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (field_id)
"""
pass
class NoMailingIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (mailing_id)
"""
pass
class NoSearchIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (search_id)
"""
pass
class NoTriggerIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (trigger_id)
"""
pass
class NoWebHookIdError(ApiRequestFailed):
"""
An API call was attempted with missing required parameters (webhook_id)
"""
pass
class ClearMemberFieldInformationError(ApiRequestFailed):
"""
An API call to clear member info from a field did not complete correctly
"""
pass
class MailingArchiveError(ApiRequestFailed):
"""
An API call to archive a mailing did not complete correctly
"""
pass
class MailingCancelError(ApiRequestFailed):
"""
An API call to cancel a mailing did not complete correctly
"""
pass
class MailingForwardError(ApiRequestFailed):
"""
An API call to forward a mailing did not complete correctly
"""
pass
class SyntaxValidationError(ApiRequestFailed):
"""
An API call to validate message syntax did not complete correctly
"""
pass
class WebHookDeleteError(ApiRequestFailed):
"""
An API call to delete a webhook did not complete correctly
"""
pass |
# write program reading an integer from standard input - a
# printing sum of squares of natural numbers smaller than a
# for example, for a=4, result = 1*1 + 2*2 + 3*3 = 14
a = int(input("pass a - "))
element = 1
result = 0
while element < a:
result = result + element * element
element = element + 1
print("result = " + str(result))
|
#Ex1
n1 = input("Nome: ")
i1 = int(input("Idade: "))
n2 = input("Nome: ")
i2 = int(input("Idade: "))
if i1 > i2:
print(f"{n1} é mais velho que {n2}.")
elif i2 > i1:
print(f"{n2} é mais velho que {n1}.")
else:
print(f"{n1} e {n2} possuem a mesma idade.")
#Ex2
h = float(input("Hectares: "))
p = float(input("Preço Tonelada(Soja): R$ "))
t = h * 3
print(f"Serão produzidos {t:.1f} toneladas.", end='')
if t >= 10:
print(f" O faturamento será de R$ {(t*p):.2f}.", end='')
print(f" Com um incentivo de R$ {(t*p)*0.05:.2f}.")
else:
print(f" O faturamento será de R$ {t*p:.2f}. ", end='')
print("Com um incentivo de R$ 0.")
#Ex3
va = 60
vb = 52
h = 1
while True:
df = 45 + (vb * h) - (va * h)
if df <= 0:
break
h += 1
print(f"O veículo A alcançará o veículo B em {h} horas!")
# Ex4
c = map = mp = ma = maa = si = sp = sa = 0
while True:
i = int(input("Idade: "))
if i == 0:
break
p = float(input("Peso: "))
a = float(input("Altura: "))
si += i
sp += p
sa += a
c += 1
if c == 1:
map = mp = p
ma = maa = a
else:
if a > maa:
maa = a
if a < ma:
ma = a
if p > map:
map = p
if p < mp:
mp = p
print(f"Médias:\nAltura: {sa/c:.2f};\nPeso: {sp/c:.2f};\nIdade: {si/c:.2f}.")
print(f"Maior/Menor Valor:\nMaior Altura: {maa};\nMenor Altura: {ma};\nMaior peso: {map};\nMenor Peso:{mp}.")
# ex5
# Não consegui fazer
# ex6
n = int(input("Número: "))
f = n
fa = 1
print(f"{n}! = ", end= '')
while f > 0:
print(f"{f}", end='')
print(" x " if f > 1 else " = ", end='')
fa *= f
f -= 1
print(f"{fa}") |
# implement strip() to remove the white spaces in the head and tail of a string.
def strip(s):
while len(s) != 0 and (s[0] == ' ' or s[-1] == ' '):
s = s[1:] if s[0] == ' ' else s
s = s[:-1] if s[-1] == ' ' else s
return s
if __name__ == "__main__":
if strip('hello ') != 'hello':
print('fail!')
elif strip(' hello') != 'hello':
print('fail!')
elif strip(' hello ') != 'hello':
print('fail!')
elif strip(' hello world ') != 'hello world':
print('fail!')
elif strip('') != '':
print('fail!')
elif strip(' ') != '':
print('fail!')
else:
print('success!')
|
a = [1,2,3,4,5]
k =2
del a[0]
for i in range(0,len(a)):
print(a[i])
|
# Copyright (c) 2018 Lotus Load
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")
load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")
def app_image(name, binary, repository, **kwargs):
go_image(
name = "image",
binary = binary,
**kwargs)
container_bundle(
name = "bundle",
images = {
"$(DOCKER_REGISTRY)/%s:{STABLE_GIT_COMMIT}" % repository: ":image",
"$(DOCKER_REGISTRY)/%s:{STABLE_GIT_COMMIT_FULL}" % repository: ":image",
},
)
docker_push(
name = "push",
bundle = ":bundle",
**kwargs)
|
"""
Exceptions
----------
"""
class FactoryException(Exception):
"""General exception for a factory being not able to produce a penalty model."""
class ImpossiblePenaltyModel(FactoryException):
"""PenaltyModel is impossible to build."""
class MissingPenaltyModel(FactoryException):
"""PenaltyModel is missing from the cache or otherwise unavailable."""
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# import pprint
# eng = r"<ffx:amp_2> Don't think it was all in vain... You saved us all. <ffx:wonder>And Kirill... I'll give him this watch and make sure he gets out of this hellhole. <ffx:neutral>You have my word."
# ru = r"Не думай, что все было зря... Ты всех нас спас. А Кирилл... Я передам ему часы и прослежу, чтобы он выбрался из этой дыры. Обещаю."
tag_closing = '>'
# if dot split length is eqaul
# Takes tags from the start and from the end.
# Not from the middle of the phrase
# Replaces all triple and double signs
def normalize_marks(val):
signs = ['!!!', '!!', '?!', '!?', '!!?',
'!??', '???', '??', '?', '...', '..']
for s in signs:
val = val.replace(s, '.')
val = val.replace(',', '')
return val
def normalize_spaces(val):
val = val.replace('>', '> ')
val = val.replace('<', ' <')
return ' '.join(val.split())
def delete_tags(val):
filtered_val = [v for v in val.split(' ') if tag_closing not in v]
return ' '.join(filtered_val)
def get_tags(val):
search_deep = 2
tags = []
words = val.split()
if len(words) < search_deep:
search_deep = len(words)
for id in range(search_deep):
if tag_closing in words[id]:
tags.append(words[id])
return tags
def get_tags_data(val):
val = normalize_marks(normalize_spaces(val))
tag_data = {}
sentences = val.split('.')
for i, text in enumerate(sentences):
tag_data[i] = get_tags(text)
return tag_data
def add_tags_data(data, val):
val = normalize_marks(normalize_spaces(val))
val = delete_tags(val)
sentences = val.split('.')
tagged_val = []
if len(data) == len(sentences):
for i, tags in data.iteritems():
tagged_val.append(' '.join(tags) + ' ' + sentences[i])
else:
for i, text in enumerate(sentences):
if i == 0:
tagged_val.append(' '.join(data[i]) + ' ' + text)
else:
tagged_val.append(text)
tagged = '. '.join(tagged_val)
return ' '.join(tagged.split())
|
# working-with-Data-structure
#union
def union(set1,set2):
return set(set1)&(set2)
# driver code
Set1={0,2,3,4,5,6,8}
Set2={1,2,3,4,5}
Print(union(set1,set2))
#intersection
def intersection(set1,set2):
return set(set1)&(set2)
#driver code
Set1={0,2,4,6,8}
Set2={1,2,4,4,5}
Print(intersection(set1,set2))
#difference
Set1={0,2,3,4,5,6,8}
Set2={1,2,3,4,5}
Set_difference=(set1)-(set2)
Set_difference=set(set_difference)
Print(set_difference)
#python code to find the symmetric_difference
#use of symmetric_difference()method
Set_A={0,2,4,6,8}
Set_B={1,2,3,4,5}
Print(set_A,symmetric_difference(set_B))
|
class Qint(int):
def __init__(self, num):
self.qkey = None
self.parent = None
self.parental_id = None
self.name = None
self._qint = True
|
def testDoc():
"""
Test __doc__
"""
pass
print(abs.__doc__)
print(help(abs))
print(int.__doc__)
print(testDoc.__doc__)
print(help(testDoc))
|
#!/usr/bin/env python
# Analyse des accidents corporels de la circulation a partir des fichiers csv open data
# - telecharger les fichiers csv depuis :
# https://www.data.gouv.fr/en/datasets/bases-de-donnees-annuelles-des-accidents-corporels-de-la-circulation-routiere-annees-de-2005-a-2019/
# - changer la commune et l'annee :
commune = '92012'
annee = 2019
id_acc = []
accidents = {}
gravite = {'1' : 'indemne', '2' : 'tue', '3' : 'grave', '4' : 'leger'}
def get_header(line):
h = line.rstrip().replace('"', '').split(';')
h = dict(zip(h, range(len(h))))
return h
with open('caracteristiques-' + str(annee) + '.csv') as f:
head = get_header(f.readline())
for l in f:
data = l.rstrip().replace('"', '').split(';')
try:
com = data[head['com']]
except:
break
if com == commune:
Num_Acc = data[head['Num_Acc']]
id_acc.append(Num_Acc)
accidents[Num_Acc] = {}
accidents[Num_Acc]['lat'] = data[head['lat']].replace(',','.')
accidents[Num_Acc]['long'] = data[head['long']].replace(',','.')
accidents[Num_Acc]['usagers'] = []
accidents[Num_Acc]['catv'] = []
#print id_acc
velos = []
with open('vehicules-' + str(annee) + '.csv') as f:
head = get_header(f.readline())
for l in f:
data = l.rstrip().replace('"', '').split(';')
try:
Num_Acc = data[head['Num_Acc']]
except:
break
if not Num_Acc in id_acc:
continue
catv = data[head['catv']]
id_vehicule = data[head['id_vehicule']]
accidents[Num_Acc]['catv'].append(catv)
if catv == '1' or catv == '80':
velos.append(id_vehicule)
cyclistes = []
with open('usagers-' + str(annee) + '.csv') as f:
head = get_header(f.readline())
for l in f:
data = l.rstrip().replace('"', '').split(';')
try:
Num_Acc = data[head['Num_Acc']]
except:
break
if not Num_Acc in id_acc:
continue
catu = data[head['catu']]
grav = gravite[data[head['grav']]]
id_vehicule = data[head['id_vehicule']]
accidents[Num_Acc]['usagers'].append([catu, grav])
if id_vehicule in velos and catu != '3':
cyclistes.append([Num_Acc, grav])
#print accidents
with open('pietons.csv', 'w') as f:
f.write("lat,long,grav,catv\n")
for v in accidents.values():
catv = v['catv']
if '1' in catv or '80' in catv:
catv = 'velo'
else:
catv = 'vehicule'
for u in v['usagers']:
if u[0] == '3':
f.write('%s,%s,%s,%s\n' % (v['lat'], v['long'],u[1],catv))
with open('cyclistes.csv', 'w') as f:
f.write("lat,long,grav\n")
for Num_Acc, grav in cyclistes:
v = accidents[Num_Acc]
f.write('%s,%s,%s\n' % (v['lat'], v['long'],grav))
|
# n = int(input('Enter the number of time you want to display Hello World!'))
# i = 0
##While Loop
# while i < n :
# print('Hello World\n')
# x += 1
n = input('Enter a number: ')
#Check if the input is empty
if n == "":
print('Nothing to display')
else:
#For Loop
for i in range(int(n)):
print('Hello World!') |
"""
Datos de entrada
nombre-->nom-->string
monto_comra-->mc-->float
Datos de salida
nombre-->nom-->string
monto_compra-->mp-->float
monto_pagar-->mg-->float
descuento-->de-->float
"""
#Entrada
nom=str(input("Ingrese nombre del cliente: "))
mc=float(input("Ingrese el monto de compra: "))
#Caja negra
if(mc<50000):
mg=mc
de=0
elif(mc>50000) and (mc<=100000):
mgg=mc*0.05
mg=mc-mgg
de=0.05*100
elif(mc>100000) and (mc<=700000):
mgg=mc*0.11
mg=mc-mgg
de=0.11*100
elif(mc>700000) and (mc<=1500000):
mgg=mc*0.18
mg=mc-mgg
de=0.18*100
elif(mc>1500000):
mgg=mc*0.25
mg=mc-mgg
de=0.35*100
#Salida
print("Nombre del cliente: ", nom)
print("El monto de compra es: ", mc)
print("El monto a pagar es: ", mg)
print(f"El descuento fue de: {de}%") |
class MenuItem:
pass
# Buat instance untuk class MenuItem
menu_item1 = MenuItem()
|
class Vertice:
def __init__(self,rotulo):
self.rotulo = rotulo # por exemplo "A"
self.visitado = False
# def visitado(self):
# self.visitado = True
def igualA(self,r):
return r == self.rotulo
def foiVisitado(self):
return self.visitado
def regVisitado(self):
self.visitado = True
def limpa(self):
self.visitado = False
# Matriz adjacencia: como inserir uma aresta em grafo
# adjmat[1][3]
# adjmat[3][1]
# Lista de adjacencia: como inserir uma aresta entre os vertices 1 e 3
# adjlista[1].append(3)
# adjlista[3].append(1)
class Grafo:
def __init__ (self):
self.numVerticesMaximo=20
self.numVertices = 0
self.listaVertices = []
self.matrizAdjacencias = []
self.matrizOrdenada = [ ] # incluido
for i in range(self.numVerticesMaximo):
linhaMatriz=[]
for j in range(self.numVerticesMaximo):
linhaMatriz.append(0)
self.matrizAdjacencias.append(linhaMatriz)
def adicionaVertice(self,rotulo):
self.numVertices += 1
self.listaVertices.append(Vertice(rotulo))
def adicionaArco(self,inicio,fim):
self.matrizAdjacencias[inicio][fim] =1
# self.matrizAdjacencias[fim][inicio] =1
def mostraVertice(self,vertice):
print (self.listaVertices[vertice].rotulo)
def imprimeMatriz(self):
print (" "),
# for i in range(self.numVertices):
# print (self.listaVertices[i].rotulo),
# print
# for i in range(self.numVertices):
# print (self.listaVertices[i].rotulo),
# for j in range(self.numVertices):
# print (self.matrizAdjacencias[i][j]),
# print
for i in range(self.numVertices):
for j in range(self.numVertices):
print (f'[{self.matrizAdjacencias[i][j]}]', end=' ')
print()
def localizaRotulo(self,rotulo):
for i in range(self.numVertices):
if self.listaVertices[i].igualA(rotulo):
return i
return -1
def obtemAdjacenteNaoVisitado(self,v):
for i in range (self.numVertices):
if (self.matrizAdjacencias[v][i] ==1 and self.listaVertices[i].foiVisitado() == False):
return i
return -1
def topo(self):
while(self.numVertices > 0 ):
verticeAtual = self.obtemVerticeSemSucessor() # faz a busca no grafo de tras para frente
if verticeAtual == -1: #ciclo
print (" grafo com ciclos")
return
self.matrizOrdenada.append(self.listaVertices[verticeAtual].rotulo)
self.removeVertice(verticeAtual)
self.matrizOrdenada.reverse () # recurso do Python para reverter a matriz
print ("vertices ordenados topologicamente: ", self.matrizOrdenada)
def obtemVerticeSemSucessor(self):
for linha in range (self.numVertices):
ehEixo = False
for coluna in range(self.numVertices):
if self.matrizAdjacencias[linha][coluna] > 0:
ehEixo = True
break
if not ehEixo:
return linha
return -1
def removeVertice(self,vertice):
for linha in range(len(self.matrizAdjacencias)): # vai apagando passo a passo a matrzis de adjacencias
del self.matrizAdjacencias[linha][vertice] # recurso do Pyhton para eliminar linhas e colunas de uma matriz
del self.matrizAdjacencias[vertice]
del self.listaVertices[vertice] # elimina o vertice da lista de vertices
self.numVertices -= 1
# if __name__ == '__main__':
# print('me executou pelo terminal') ... $ phyton foo.py
# else:
# print('me executou como um módulo') ... >>> import foo
if __name__ == '__main__':
# os.system("clear")
grf=Grafo()
while True:
print ("Escolha a sua opção")
print (" (M) mostra, (V) Inserir vertice, (A) Inserir Aresta, (O) ORDENACAO, (S) Sair")
escolha = input("Digite sua opção")
if escolha == 'm':
grf.imprimeMatriz()
elif escolha =='v':
val=input("Digite o rotulo do vertice a inserir ")
grf.adicionaVertice(val)
elif escolha == 'a':
rinicio = input ("Digite o rotulo do vertice de inicio da aresta")
inicio = grf.localizaRotulo(rinicio)
if (inicio == -1):
print ("vertice nao cadastrado. Cadastre o vertice primeiro")
input()
continue
rfim = input("Digite o rotulo do vertice de fim da aresta")
fim = grf.localizaRotulo(rfim)
if (fim == -1):
print ("vertice nao cadastrado. Cadastre o vertice primeiro")
input()
continue
grf.adicionaArco(inicio,fim)
elif escolha =='o':
#rinicio = input("digite rotulo de inicio")
#inicio = grf.localizaRotulo(rinicio)
#if (inicio == -1):
# print ("vertice nao cadastrado ! cadastre o vertice")
# continue
grf.topo()
elif escolha=='s':
break
else:
print("Entrada invalida. Pressionar enter")
input()
|
# Copyright 2020 Rubrik, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
"""
Collection of methods for sonar on demand scan
"""
ERROR_MESSAGES = {
'MISSING_PARAMETERS_IN_SCAN': 'scan_name, resources, and analyzer_groups fields are required.',
'MISSING_PARAMETERS_IN_SCAN_STATUS': 'crawl_id field is required.',
'MISSING_PARAMETERS_IN_SCAN_RESULT': 'crawl_id and filters fields are required.',
"INVALID_FILE_TYPE": "'{}' is an invalid value for 'file type'. Value must be in {}."
}
def trigger_on_demand_scan(self, scan_name, resources, analyzer_groups):
"""
Trigger an on-demand scan of a system (specifying policies to search for).
Args:
scan_name (str): Name of the scan.
analyzer_groups (list): List of sonar policy analyzer groups.
resources (list): List of object IDs to scan.
Returns:
dict: Response from the API.
Raises:
ValueError: If input is invalid
RequestException: If the query to Polaris returned an error
"""
try:
if not scan_name or not resources or not analyzer_groups:
raise ValueError(ERROR_MESSAGES['MISSING_PARAMETERS_IN_SCAN'])
query_name = "sonar_on_demand_scan"
variables = {
"crawlName": scan_name,
"resources": resources,
"analyzerGroups": analyzer_groups
}
query = self._query_raw(query_name=query_name, variables=variables)
return query
except Exception:
raise
def get_on_demand_scan_status(self, crawl_id):
"""Retrieve the list of scan status details.
Args:
crawl_id (str): ID for which scan status is to be obtained.
Returns:
dict: Dictionary of list of scan status details.
Raises:
ValueError: If input is invalid
RequestException: If the query to Polaris returned an error.
"""
try:
if not crawl_id:
raise ValueError(ERROR_MESSAGES['MISSING_PARAMETERS_IN_SCAN_STATUS'])
query_name = "sonar_on_demand_scan_status"
variables = {
"crawlId": crawl_id
}
response = self._query_raw(query_name=query_name, variables=variables)
return response
except Exception:
raise
def get_on_demand_scan_result(self, crawl_id, filters):
"""
Retrieve the download link for the requested scanned file.
Args:
crawl_id (str): ID for which file needs to be downloaded.
filters (dict): Dictionary of filter containing file type.
Returns:
dict: Dictionary containing download link for the result file.
Raises:
ValueError: If input is invalid
RequestException: If the query to Polaris returned an error.
"""
try:
if not crawl_id or not filters:
raise ValueError(ERROR_MESSAGES['MISSING_PARAMETERS_IN_SCAN_RESULT'])
file_type = filters.get('fileType')
file_type_enum = self.get_enum_values(name="FileCountTypeEnum")
if file_type not in file_type_enum:
raise ValueError(ERROR_MESSAGES['INVALID_FILE_TYPE'].format(file_type, file_type_enum))
query_name = "sonar_on_demand_scan_result"
variables = {
"crawlId": crawl_id,
"filter": filters
}
query = self._query_raw(query_name=query_name, variables=variables)
return query
except Exception:
raise
|
"""This module demonstrates usage of if-else statements, while loop and break."""
def calculate_grade(grade):
"""Function that calculates final grades based on points earned."""
if grade >= 90:
if grade == 100:
return 'A+'
return 'A'
if grade >= 80:
return 'B'
if grade >= 70:
return 'C'
return 'F'
if __name__ == '__main__':
while True:
grade_str = input('Number of points (<ENTER> for END): ')
if len(grade_str) == 0:
break
points = int(grade_str)
print(calculate_grade(points))
print('Good Bye!')
|
"""
Write a Python program to get variable unique identification number or string.
"""
x = 100
print(format(id(x), "x")) |
class FederationClientServiceVariables:
def __init__(self):
self.FederationClientServiceStatus = ''
self.FederationClientServicePort = 9000
self.FederationClientServiceIP = None |
class Format:
def skip(self, line):
False
def before(self, line):
return s, None
def after(self, line, data):
return s
class fastText(Format):
LABEL_PREFIX = '__label__'
def before(self, line):
labels = []
_ = []
for w in line.split(' '):
if w.startswith(fastText.LABEL_PREFIX):
labels.append(w)
else:
_.append(w)
return ' '.join(_), labels
def after(self, line, data):
return ' '.join(data) + ' ' + line
|
print('\033[32mCalcule a media de suas notas! \033[m')
nota1 = float(input('Digite sua primeira nota: '))
nota2 = float(input('Digite sua segunda nota: '))
media = (nota1 + nota2) / 2
if media < 5.0:
print(f'Sua média foi de {media:.1f}! Que pena, você foi reprovado! ')
elif media>=5.0 and media<=6.9:
print(f'Sua média foi de {media:.1f}! Quase lá, você ficou de recuperação!')
else:
print(f'Sua média foi de {media:.1f}! Parabéns, você foi aprovado!') |
# Time complexity: O(n)
# Approach: Backtracking. Similar to DP 2D array solution.
class Solution:
def findIp(self, s, index, i, tmp, ans):
if i==4:
if index >= len(s):
ans.append(tmp[1:])
return
if index >= len(s):
return
if s[index]=='0':
self.findIp(s, index+1, i+1, tmp+'.'+s[index], ans)
else:
if int(s[index])>=0 and int(s[index])<=255:
self.findIp(s, index+1, i+1, tmp+'.'+s[index], ans)
if index+2<=len(s) and int(s[index:index+2])>=0 and int(s[index:index+2])<=255:
self.findIp(s, index+2, i+1, tmp+'.'+s[index:index+2], ans)
if index+3<=len(s) and int(s[index:index+3])>=0 and int(s[index:index+3])<=255:
self.findIp(s, index+3, i+1, tmp+'.'+s[index:index+3], ans)
def restoreIpAddresses(self, s: str) -> List[str]:
ans = []
self.findIp(s, 0, 0, "", ans)
return ans |
# s = '??????'
# print(s.count("?"))
# print(s.count("?"))
# a = 5
# b = 2
# print(a/b)
# import re
#
# def Find(string):
# url = re.findall('https?://(?:[-\w.]|(?:%[\da-fA-F]{2}))+', string)
# # url = regex.findall(string)
# return url
#
# string = 'Runoob 的网页地址为:https://www.runoob.com,Google 的网页地址为:https://www.google.com,哈哈哈 http://t.cn/RqFEaUT 态度网(www.taiduw.com) 拍摄者直呼上帝啊。http://www.miaopai.com/show/~ZNc8qjCvIyVurnl4oQAkQ__.htm'
# print("Urls: ", Find(string))
# from snownlp import sentiment
# from snownlp import SnowNLP
#
# # sentiment.train(r'E:\PythonCode\Features\util\negative.txt',r'E:\PythonCode\Features\util\positive.txt')
# # sentiment.save(r'E:\PythonCode\Features\util\sentiment.marshal')
# s = SnowNLP('那个人真让人不舒服 ')
# print(s.sentiments)
# import jieba.posseg as pseg
# import re
# words =pseg.cut("".join(re.findall(u"[\u4e00-\u9fa5]","【外卖配送员无证驾驶闯红灯924次面临十几万罚款】近日,广东茂名民警在对一辆闯红灯的外卖配送摩托进行核查时大吃一惊:该车仅半年就闯红灯924次!平均每天五六次,最多时一天闯红灯十八次。按道路交通安全法,该驾驶员要为他900多次闯红灯的行为缴纳十几万元的罚款。中国新闻网...(中国新闻网)")))
# n = 0
# r = 0
# v = 0
# for w in words:
# print(w.word,w.flag)
# if(w.flag.startswith('n')):
# n += 1
# elif(w.flag.startswith('v')):
# v += 1
# elif(w.flag.startswith('r')):
# r += 1
# print("名词个数:",n)
# print("动词个数:",v)
# print("代词个数:",r)
# from gensim.models import word2vec
# import logging
# import jieba
# import os
# import re
# import pandas as pd
# import jieba.posseg as pseg
# text_csv_path = r'G:\毕设\数据集\微博\text.csv'
# text_raw_path= r'G:\毕设\数据集\微博\test.txt'
# stopwords_path = os.path.abspath(os.path.dirname(os.getcwd())+os.path.sep+".")+"/util/stopwords.txt"
#
# def text_data_read():
# '''
# 文本特征文件的读取
# :return: 文本特征文件
# '''
# df_text = pd.read_csv(text_csv_path)
# return df_text
#
# def jieba_clear_text(text):
# '''
# jieba分词,并使用自定义停用词表去除停用词
# '''
# raw_result = "/".join(jieba.cut(text))
# myword_list = []
# #去除停用词
# for myword in raw_result.split('/'):
# if myword not in stopwords:
# myword_list.append(myword)
# return " ".join(myword_list)
#
# def get_stopwords_list():
# '''
# 获得停用词的列表
# :return: stopwords:停用词列表
# '''
# my_stopwords = []
# fstop = open(stopwords_path, "r", encoding='UTF-8')
# for eachWord in fstop.readlines():
# my_stopwords.append(eachWord.strip())
# fstop.close()
# return my_stopwords
#
# def text_train_word2vec_model(raw_txt):
# logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
# sentences = word2vec.Text8Corpus(raw_txt)
# model = word2vec.Word2Vec(sentences,size=100, window=5, min_count=5, negative=3, sample=0.001, hs=1,workers=4)
# model.save(r'E:\PythonCode\Features\util\text8.model')
# return model
#
# def text_load_word2vec_model():
# model = word2vec.Word2Vec.load(r'G:\毕设\数据集\微博\news_12g_baidubaike_20g_novel_90g_embedding_64.model')
# return model
#
# logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
# # stopwords = get_stopwords_list()
# # df_text = text_data_read()
# # txt = ''
# # with open(r'G:\毕设\数据集\微博\test.txt', 'a') as f:
# # for index, row in df_text.iterrows():
# # text_content = row['text']
# # raw_txt = jieba_clear_text("".join(re.findall(u"[\u4e00-\u9fa5]", text_content)))
# # f.write(raw_txt+"\n")
# # logging.info("运行结束")
#
#
# # sentences = word2vec.Text8Corpus(text_raw_path)
# # model = word2vec.Word2Vec(sentences,size=100,workers=4)
# # model.save(r'E:\PythonCode\Features\util\text8.model')
# model = text_load_word2vec_model()
# import numpy as np
# a = np.array([1,1,1,1])
# b = np.array([2,2,2,2])
# c = a+b
# print(c)
# list = []
# list.append(a)
# list.append(b)
# c = np.array(list)
# d = np.mean(c,axis=0)
# print(d.tolist())
# print(d)
# s = 'hahha 555 jck 98 -- *'.split(' ')
# for word in s:
# print(word)
# import cv2
# import numpy as np
#
# # Compute low order moments(1,2,3)
# def color_moments(filename):
# img = cv2.imread(filename)
# if img is None:
# return
# # Convert BGR to HSV colorspace OpenCV 默认的颜色空间是 BGR,类似于RGB,但不是RGB
# # HSV颜色空间的色调、饱和度、明度与人眼对颜色的主观认识相对比较符合,与其他颜色空间相比HSV空间能更好的反映人类对颜色的感知
# hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
# # Split the channels - h,s,v
# h, s, v = cv2.split(hsv)
# # Initialize the color feature
# color_feature = []
# # N = h.shape[0] * h.shape[1]
# # The first central moment - average 一阶矩(均值)
# h_mean = np.mean(h) # np.sum(h)/float(N)
# s_mean = np.mean(s) # np.sum(s)/float(N)
# v_mean = np.mean(v) # np.sum(v)/float(N)
# color_feature.extend([h_mean, s_mean, v_mean])
# # The second central moment - standard deviation 二阶矩(方差)
# h_std = np.std(h) # np.sqrt(np.mean(abs(h - h.mean())**2))
# s_std = np.std(s) # np.sqrt(np.mean(abs(s - s.mean())**2))
# v_std = np.std(v) # np.sqrt(np.mean(abs(v - v.mean())**2))
# color_feature.extend([h_std, s_std, v_std])
# # The third central moment - the third root of the skewness 三阶矩(斜度)
# h_skewness = np.mean(abs(h - h.mean())**3)
# s_skewness = np.mean(abs(s - s.mean())**3)
# v_skewness = np.mean(abs(v - v.mean())**3)
# h_thirdMoment = h_skewness**(1./3)
# s_thirdMoment = s_skewness**(1./3)
# v_thirdMoment = v_skewness**(1./3)
# color_feature.extend([h_thirdMoment, s_thirdMoment, v_thirdMoment])
# return color_feature
# print(color_moments(r'G:\毕设\数据集\微博\train\truth_pic\000ffb2483e3e1bd634e920fa2cc93b9.jpg'))
# print(color_moments('E:\PythonCode\Features\image\example\cn_pic.png'))
# list_a = [1,2,3,4,5]
# list_b = [4,5,6,7,8]
# list_c = sorted(set(list_b) - set(list_a),key=list_b.index)
# import numpy as np
# import pandas as pd
# import logging
# image_csv_path = r'G:\毕设\数据集\微博\image.csv'
# def image_data_read():
# '''
# 图片特征文件的读取
# :return: 图片特征文件
# '''
# df_image = pd.read_csv(image_csv_path)
# return df_image
#
# def image_insert_cols(df_image,new_features_list):
# '''
# 增加图片新的特征列,方便后续提取并补充值
# :param df_image: 图片信息
# :return: df_image: 新图片信息dataframe
# '''
# logging.info("正在扩展图片新特征列...")
# col_name = list(df_image.columns)
# #插入新列之前列名去重
# col_name = col_name + sorted(set(new_features_list) - set(col_name), key = new_features_list.index)
# df_image = df_image.reindex(columns=col_name, fill_value=0)
# logging.info("图片新特征列扩展完成")
# return df_image
# #原始数据读入
# df_image = image_data_read()
# #图片新特征列扩展
# new_image_features_list = ['h_first_moment','s_first_moment','v_first_moment',
# 'h_second_moment','s_second_moment','v_second_moment',
# 'h_third_moment','s_third_moment','v_third_moment']
# df_image = image_insert_cols(df_image,new_image_features_list)
# import random
#
# import numpy as np
# import tensorflow as tf
# from sklearn import svm
# from sklearn import preprocessing
#
# right0 = 0.0 # 记录预测为1且实际为1的结果数
# error0 = 0 # 记录预测为1但实际为0的结果数
# right1 = 0.0 # 记录预测为0且实际为0的结果数
# error1 = 0 # 记录预测为0但实际为1的结果数
#
# for file_num in range(10):
# # 在十个随机生成的不相干数据集上进行测试,将结果综合
# print('testing NO.%d dataset.......' % file_num)
# ff = open('digit_train_' + file_num.__str__() + '.data')
# rr = ff.readlines()
# x_test2 = []
# y_test2 = []
#
# for i in range(len(rr)):
# x_test2.append(list(map(int, map(float, rr[i].split(' ')[:256]))))
# y_test2.append(list(map(int, rr[i].split(' ')[256:266])))
# ff.close()
# # 以上是读出训练数据
# ff2 = open('digit_test_' + file_num.__str__() + '.data')
# rr2 = ff2.readlines()
# x_test3 = []
# y_test3 = []
# for i in range(len(rr2)):
# x_test3.append(list(map(int, map(float, rr2[i].split(' ')[:256]))))
# y_test3.append(list(map(int, rr2[i].split(' ')[256:266])))
# ff2.close()
# # 以上是读出测试数据
#
# sess = tf.InteractiveSession()
#
#
# # 建立一个tensorflow的会话
#
# # 初始化权值向量
# def weight_variable(shape):
# initial = tf.truncated_normal(shape, stddev=0.1)
# return tf.Variable(initial)
#
#
# # 初始化偏置向量
# def bias_variable(shape):
# initial = tf.constant(0.1, shape=shape)
# return tf.Variable(initial)
#
#
# # 二维卷积运算,步长为1,输出大小不变
# def conv2d(x, W):
# return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
#
#
# # 池化运算,将卷积特征缩小为1/2
# def max_pool_2x2(x):
# return tf.nn.max_pool(x, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')
#
#
# # 给x,y留出占位符,以便未来填充数据
# x = tf.placeholder("float", [None, 256])
# y_ = tf.placeholder("float", [None, 10])
# # 设置输入层的W和b
# W = tf.Variable(tf.zeros([256, 10]))
# b = tf.Variable(tf.zeros([10]))
# # 计算输出,采用的函数是softmax(输入的时候是one hot编码)
# y = tf.nn.softmax(tf.matmul(x, W) + b)
# # 第一个卷积层,5x5的卷积核,输出向量是32维
# w_conv1 = weight_variable([5, 5, 1, 32])
# b_conv1 = bias_variable([32])
# x_image = tf.reshape(x, [-1, 16, 16, 1])
# # 图片大小是16*16,,-1代表其他维数自适应
# h_conv1 = tf.nn.relu(conv2d(x_image, w_conv1) + b_conv1)
# h_pool1 = max_pool_2x2(h_conv1)
# # 采用的最大池化,因为都是1和0,平均池化没有什么意义
#
# # 第二层卷积层,输入向量是32维,输出64维,还是5x5的卷积核
# w_conv2 = weight_variable([5, 5, 32, 64])
# b_conv2 = bias_variable([64])
#
# h_conv2 = tf.nn.relu(conv2d(h_pool1, w_conv2) + b_conv2)
# h_pool2 = max_pool_2x2(h_conv2)
#
# # 全连接层的w和b
# w_fc1 = weight_variable([4 * 4 * 64, 256])
# b_fc1 = bias_variable([256])
# # 此时输出的维数是256维
# h_pool2_flat = tf.reshape(h_pool2, [-1, 4 * 4 * 64])
# h_fc1 = tf.nn.relu(tf.matmul(h_pool2_flat, w_fc1) + b_fc1)
# # h_fc1是提取出的256维特征,很关键。后面就是用这个输入到SVM中
#
# # 设置dropout,否则很容易过拟合
# keep_prob = tf.placeholder("float")
# h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)
#
# # 输出层,在本实验中只利用它的输出反向训练CNN,至于其具体数值我不关心
# w_fc2 = weight_variable([256, 10])
# b_fc2 = bias_variable([10])
#
# y_conv = tf.nn.softmax(tf.matmul(h_fc1_drop, w_fc2) + b_fc2)
# cross_entropy = -tf.reduce_sum(y_ * tf.log(y_conv))
# # 设置误差代价以交叉熵的形式
# train_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy)
# # 用adma的优化算法优化目标函数
# correct_prediction = tf.equal(tf.argmax(y_conv, 1), tf.argmax(y_, 1))
# accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))
# sess.run(tf.global_variables_initializer())
# for i in range(3000):
# # 跑3000轮迭代,每次随机从训练样本中抽出50个进行训练
# batch = ([], [])
# p = random.sample(range(795), 50)
# for k in p:
# batch[0].append(x_test2[k])
# batch[1].append(y_test2[k])
# if i % 100 == 0:
# train_accuracy = accuracy.eval(feed_dict={x: batch[0], y_: batch[1], keep_prob: 1.0})
# # print "step %d, train accuracy %g" % (i, train_accuracy)
# train_step.run(feed_dict={x: batch[0], y_: batch[1], keep_prob: 0.6})
# # 设置dropout的参数为0.6,测试得到,大点收敛的慢,小点立刻出现过拟合
#
# print("test accuracy %g" % accuracy.eval(feed_dict={x: x_test3, y_: y_test3, keep_prob: 1.0}))
# # def my_test(input_x):
# # y = tf.nn.softmax(tf.matmul(sess.run(x), W) + b)
#
# for h in range(len(y_test2)):
# if np.argmax(y_test2[h]) == 7:
# y_test2[h] = 1
# else:
# y_test2[h] = 0
# for h in range(len(y_test3)):
# if np.argmax(y_test3[h]) == 7:
# y_test3[h] = 1
# else:
# y_test3[h] = 0
# # 以上两步都是为了将源数据的one hot编码改为1和0,我的学号尾数为7
# x_temp = []
# for g in x_test2:
# x_temp.append(sess.run(h_fc1, feed_dict={x: np.array(g).reshape((1, 256))})[0])
# # 将原来的x带入训练好的CNN中计算出来全连接层的特征向量,将结果作为SVM中的特征向量
# x_temp2 = []
# for g in x_test3:
# x_temp2.append(sess.run(h_fc1, feed_dict={x: np.array(g).reshape((1, 256))})[0])
#
# clf = svm.SVC(C=0.9, kernel='linear') # linear kernel
# # clf = svm.SVC(C=0.9, kernel='rbf') #RBF kernel
# # SVM选择了RBF核,C选择了0.9
# # x_temp = preprocessing.scale(x_temp) #normalization
#
# clf.fit(x_temp, y_test2)
# # SVM选择了RBF核,C选择了0.9
# print('svm testing accuracy:')
# print(clf.score(x_temp2, y_test3))
#
# for j in range(len(x_temp2)):
# # 验证时出现四种情况分别对应四个变量存储
# # 这里报错了,需要对其进行reshape(1,-1)
# if clf.predict(x_temp2[j].reshape(1, -1))[0] == y_test3[j] == 1:
# right0 += 1
# elif clf.predict(x_temp2[j].reshape(1, -1))[0] == y_test3[j] == 0:
# right1 += 1
# elif clf.predict(x_temp2[j].reshape(1, -1))[0] == 1 and y_test3[j] == 0:
# error0 += 1
# else:
# error1 += 1
#
# accuracy = right0 / (right0 + error0) # 准确率
# recall = right0 / (right0 + error1) # 召回率
# print('svm right ratio ', (right0 + right1) / (right0 + right1 + error0 + error1))
# print('accuracy ', accuracy)
# print('recall ', recall)
# print('F1 score ', 2 * accuracy * recall / (accuracy + recall)) # 计算F1值
# from PIL import Image
# import os
# filename = r'G:\train\rumor_pic\0afa91cdde95373b8e4e88daeae7f815.jpg'
# im = Image.open(filename)#返回一个Image对象
# print('宽:%d,高:%d'%(im.size[0],im.size[1]))
# fsize = os.path.getsize(filename)
# fsize = fsize / float(1024)
# print(round(fsize,2))
# import hashlib
# import time
# import urllib
# import random
#
# from gensim.models import word2vec
# import gensim
# import jieba
# import numpy as np
# from scipy.linalg import norm
# from translate import Translator
# import json
#
# # model_file = r'G:\毕设\数据集\微博\news_12g_baidubaike_20g_novel_90g_embedding_64.bin'
# # model = gensim.models.KeyedVectors.load_word2vec_format(model_file, binary=True)
# # translator= Translator(from_lang="english",to_lang="chinese")
# # translation = translator.translate(dic[str(i)][1])
# #
# appid = '20190716000318328'
# secretKey = '7pjdBCkaUodI5eNqsBWB'
# url_baidu = 'http://api.fanyi.baidu.com/api/trans/vip/translate'
# def translateBaidu(text, f='en', t='zh'):
# salt = random.randint(32768, 65536)
# sign = appid + text + str(salt) + secretKey
# sign = hashlib.md5(sign.encode()).hexdigest()
# url = url_baidu + '?appid=' + appid + '&q=' + urllib.parse.quote(text) + '&from=' + f + '&to=' + t + '&salt=' + str(salt) + '&sign=' + sign
# response = urllib.request.urlopen(url)
# content = response.read().decode('utf-8')
# data = json.loads(content)
# result = str(data['trans_result'][0]['dst'])
# return result
#
# fn = open(r'G:\毕设\数据集\微博\imagenet_class_cn.json', "r", encoding='UTF-8')
# j = fn.read()
# dic = json.loads(j)
# fn.close()
# print(dic)
# txt_dic = {}
# for i in range(0,1000):
# try:
# start = time.time()
# txt_dic[dic[str(i)][1]] = translateBaidu(dic[str(i)][1])
# end = time.time()
# if end - start < 1:
# time.sleep(1) #api接口限制,每秒调用1次
# except Exception as e:
# print(e)
# json_str = json.dumps(txt_dic)
# file_object = open(r'G:\毕设\数据集\微博\imagenet_class_cn.json', 'w')
# file_object.write(json_str)
# file_object.close( )
# # translateBaidu('borzoi')
# list = [0,1.02365666,2.66666]
# str = " ".join('%s' %id for id in list)
# print(str)
# import pandas as pd
# import numpy as np
# text_csv_path = r'C:\Backup\桌面\test.csv'
# df = pd.read_csv(text_csv_path) #只加载text列,提升速度,减小不必要的内存损耗
# aa = ['a','b','label']
# df_list = [x for x in aa if x not in ['label']]
# print(df_list)
# df1 = pd.read_csv(r"G:/1.csv")
# df2 = pd.read_csv(r"G:/2.csv")
# for i in df1.columns:
# for j in df2.columns:
# if df1[i].to_list() == df2[j].to_list():
# print(i)
# break
with open(r'E:\PythonCode\Features\util\word2vec_corpus.txt', "r", encoding='UTF-8') as f:
chinese_text = f.readlines()
text_1 = chinese_text[0:19188]
print(len(text_1))
text_2 = chinese_text[19188:]
print(len(text_2))
text_2_new =[]
for item in text_2:
if item.find('锦绣') == -1:
text_2_new.append(item)
print(len(text_2_new)) |
# Just to implement while loop
answer = 'no'
while answer != 'yes':
answer = input( 'Are you done?' )
print( 'Finally Exited.' );
|
base_tree = [{
'url_delete': 'http://example.com/adminpages/delete/id/1',
'list_of_pk': ('["id", 1]', ),
'id': 1,
'label': u'Hello Traversal World!',
'url_update': 'http://example.com/adminpages/update/id/1',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/2',
'list_of_pk': ('["id", 2]', ),
'id': 2,
'label': u'We \u2665 gevent',
'url_update': 'http://example.com/adminpages/update/id/2',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/3',
'list_of_pk': ('["id", 3]', ),
'id': 3,
'label': u'And Pyramid',
'url_update': 'http://example.com/adminpages/update/id/3',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/12',
'list_of_pk': ('["id", 12]', ),
'id': 12,
'label': u'and aiohttp!',
'url_update': 'http://example.com/adminpages/update/id/12',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/14',
'list_of_pk': ('["id", 14]', ),
'id': 14,
'label': u'and beer!',
'url_update': 'http://example.com/adminpages/update/id/14',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/15',
'url_update': 'http://example.com/adminpages/update/id/15',
'id': 15,
'list_of_pk': ('["id", 15]', ),
'label': u'and bear to!'
}]
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/13',
'url_update': 'http://example.com/adminpages/update/id/13',
'id': 13,
'list_of_pk': ('["id", 13]', ),
'label': u'and asyncio!'
}]
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/4',
'list_of_pk': ('["id", 4]', ),
'id': 4,
'label': u'Redirect 301 to we-love-gevent',
'url_update': 'http://example.com/adminpages/update/id/4',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/5',
'url_update': 'http://example.com/adminpages/update/id/5',
'id': 5,
'list_of_pk': ('["id", 5]', ),
'label': u'Redirect 200 to about-company'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/6',
'url_update': 'http://example.com/adminpages/update/id/6',
'id': 6,
'list_of_pk': ('["id", 6]', ),
'label': u'\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f ITCase'
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/7',
'list_of_pk': ('["id", 7]', ),
'id': 7,
'label': u'Our strategy',
'url_update': 'http://example.com/adminpages/update/id/7',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/8',
'list_of_pk': ('["id", 8]', ),
'id': 8,
'label': u'Wordwide',
'url_update': 'http://example.com/adminpages/update/id/8',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/9',
'url_update': 'http://example.com/adminpages/update/id/9',
'id': 9,
'list_of_pk': ('["id", 9]', ),
'label': u'Technology'
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/10',
'list_of_pk': ('["id", 10]', ),
'id': 10,
'label': u'What we do',
'url_update': 'http://example.com/adminpages/update/id/10',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/11',
'url_update': 'http://example.com/adminpages/update/id/11',
'id': 11,
'list_of_pk': ('["id", 11]', ),
'label': u'at a glance'
}]
}]
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/100',
'list_of_pk': ('["id", 100]', ),
'id': 100,
'label': u'Countries',
'url_update': 'http://example.com/adminpages/update/id/100',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/101',
'list_of_pk': ('["id", 101]', ),
'id': 101,
'label': u'Africa',
'url_update': 'http://example.com/adminpages/update/id/101',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/102',
'url_update': 'http://example.com/adminpages/update/id/102',
'id': 102,
'list_of_pk': ('["id", 102]', ),
'label': u'Algeria'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/103',
'url_update': 'http://example.com/adminpages/update/id/103',
'id': 103,
'list_of_pk': ('["id", 103]', ),
'label': u'Marocco'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/104',
'url_update': 'http://example.com/adminpages/update/id/104',
'id': 104,
'list_of_pk': ('["id", 104]', ),
'label': u'Libya'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/105',
'url_update': 'http://example.com/adminpages/update/id/105',
'id': 105,
'list_of_pk': ('["id", 105]', ),
'label': u'Somalia'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/106',
'url_update': 'http://example.com/adminpages/update/id/106',
'id': 106,
'list_of_pk': ('["id", 106]', ),
'label': u'Kenya'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/107',
'url_update': 'http://example.com/adminpages/update/id/107',
'id': 107,
'list_of_pk': ('["id", 107]', ),
'label': u'Mauritania'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/108',
'url_update': 'http://example.com/adminpages/update/id/108',
'id': 108,
'list_of_pk': ('["id", 108]', ),
'label': u'South Africa'
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/200',
'list_of_pk': ('["id", 200]', ),
'id': 200,
'label': u'America',
'url_update': 'http://example.com/adminpages/update/id/200',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/201',
'list_of_pk': ('["id", 201]', ),
'id': 201,
'label': u'North-America',
'url_update': 'http://example.com/adminpages/update/id/201',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/202',
'url_update': 'http://example.com/adminpages/update/id/202',
'id': 202,
'list_of_pk': ('["id", 202]', ),
'label': u'Canada'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/203',
'url_update': 'http://example.com/adminpages/update/id/203',
'id': 203,
'list_of_pk': ('["id", 203]', ),
'label': u'USA'
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/300',
'list_of_pk': ('["id", 300]', ),
'id': 300,
'label': u'Middle-America',
'url_update': 'http://example.com/adminpages/update/id/300',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/301',
'url_update': 'http://example.com/adminpages/update/id/301',
'id': 301,
'list_of_pk': ('["id", 301]', ),
'label': u'Mexico'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/302',
'url_update': 'http://example.com/adminpages/update/id/302',
'id': 302,
'list_of_pk': ('["id", 302]', ),
'label': u'Honduras'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/303',
'url_update': 'http://example.com/adminpages/update/id/303',
'id': 303,
'list_of_pk': ('["id", 303]', ),
'label': u'Guatemala'
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/400',
'list_of_pk': ('["id", 400]', ),
'id': 400,
'label': u'South-America',
'url_update': 'http://example.com/adminpages/update/id/400',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/401',
'url_update': 'http://example.com/adminpages/update/id/401',
'id': 401,
'list_of_pk': ('["id", 401]', ),
'label': u'Brazil'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/402',
'url_update': 'http://example.com/adminpages/update/id/402',
'id': 402,
'list_of_pk': ('["id", 402]', ),
'label': u'Argentina'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/403',
'url_update': 'http://example.com/adminpages/update/id/403',
'id': 403,
'list_of_pk': ('["id", 403]', ),
'label': u'Uruguay'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/404',
'url_update': 'http://example.com/adminpages/update/id/404',
'id': 404,
'list_of_pk': ('["id", 404]', ),
'label': u'Chile'
}]
}]
}, {
'url_delete': 'http://example.com/adminpages/delete/id/500',
'list_of_pk': ('["id", 500]', ),
'id': 500,
'label': u'Asia',
'url_update': 'http://example.com/adminpages/update/id/500',
'children': [{
'url_delete': 'http://example.com/adminpages/delete/id/501',
'url_update': 'http://example.com/adminpages/update/id/501',
'id': 501,
'list_of_pk': ('["id", 501]', ),
'label': u'China'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/502',
'url_update': 'http://example.com/adminpages/update/id/502',
'id': 502,
'list_of_pk': ('["id", 502]', ),
'label': u'India'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/503',
'url_update': 'http://example.com/adminpages/update/id/503',
'id': 503,
'list_of_pk': ('["id", 503]', ),
'label': u'Malaysia'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/504',
'url_update': 'http://example.com/adminpages/update/id/504',
'id': 504,
'list_of_pk': ('["id", 504]', ),
'label': u'Thailand'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/505',
'url_update': 'http://example.com/adminpages/update/id/505',
'id': 505,
'list_of_pk': ('["id", 505]', ),
'label': u'Vietnam'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/506',
'url_update': 'http://example.com/adminpages/update/id/506',
'id': 506,
'list_of_pk': ('["id", 506]', ),
'label': u'Singapore'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/507',
'url_update': 'http://example.com/adminpages/update/id/507',
'id': 507,
'list_of_pk': ('["id", 507]', ),
'label': u'Indonesia'
}, {
'url_delete': 'http://example.com/adminpages/delete/id/508',
'url_update': 'http://example.com/adminpages/update/id/508',
'id': 508,
'list_of_pk': ('["id", 508]', ),
'label': u'Mongolia'
}]
}]
}]
|
# 非常耗费时间,待改进
class Solution:
def sortArrayByParityII(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
odd=[]
odd_not=[]
for ele in A:
if ele%2 == 0:
odd_not.append(ele)
else:
odd.append(ele)
for i in range(len(A)):
if i%2==0:
A[i] = odd_not.pop()
else:
A[i] = odd.pop()
return A |
# change this code
number = 16
second_number = 0
first_array = [1,2,3]
second_array = [1,2]
if number > 15:
print("1")
if first_array:
print("2")
if len(second_array) == 2:
print("3")
if len(first_array) + len(second_array) == 5:
print("4")
if first_array and first_array[0] == 1:
print("5")
if not second_number:
print("6")
#=======================================
# pętle
#
primes = [2, 3, 5, 7]
for prime in primes:
print(prime)
# Prints out the numbers 0,1,2,3,4
for x in range(5):
print(x)
# Prints out 3,4,5
for x in range(3, 6):
print(x)
# Prints out 3,5,7
for x in range(3, 8, 2):
print(x)
# Prints out 0,1,2,3,4
count = 0
while count < 5:
print(count)
count += 1 # This is the same as count = count + 1
#==================================================
#berack continue
# Prints out 0,1,2,3,4
count = 0
while True:
print(count)
count += 1
if count >= 5:
break
# Prints out only odd numbers - 1,3,5,7,9
for x in range(10):
# Check if x is even
if x % 2 == 0:
continue
print(x)
#======================================================
# Prints out 0,1,2,3,4 and then it prints "count value reached 5"
count=0
while(count<5):
print(count)
count +=1
else:
print("count value reached %d" %(count))
# Prints out 1,2,3,4
for i in range(1, 10):
if(i%5==0):
break
print(i)
else:
print("this is not printed because for loop is terminated because of break but not due to fail in condition")
#elese - inne zachowanie niz w cpp
#========================================================
'''
Loop through and print out all even numbers from the numbers list in the same order they are received. Don't print any numbers that come after 237 in the sequence.
'''
numbers = [
951, 402, 984, 651, 360, 69, 408, 319, 601, 485, 980, 507, 725, 547, 544,
615, 83, 165, 141, 501, 263, 617, 865, 575, 219, 390, 984, 592, 236, 105, 942, 941,
386, 462, 47, 418, 907, 344, 236, 375, 823, 566, 597, 978, 328, 615, 953, 345,
399, 162, 758, 219, 918, 237, 412, 566, 826, 248, 866, 950, 626, 949, 687, 217,
815, 67, 104, 58, 512, 24, 892, 894, 767, 553, 81, 379, 843, 831, 445, 742, 717,
958, 609, 842, 451, 688, 753, 854, 685, 93, 857, 440, 380, 126, 721, 328, 753, 470,
743, 527
]
# your code goes here
for number in numbers:
if number == 237:
break
if number % 2 == 1:
continue
print(number)
'''
function
'''
def my_function():
print("Hello From My Function!")
def my_function_with_args(username, greeting):
print("Hello, %s , From My Function!, I wish you %s"%(username, greeting))
def sum_two_numbers(a, b):
return a + b
#===============================================
# Define our 3 functions
def my_function():
print("Hello From My Function!")
def my_function_with_args(username, greeting):
print("Hello, %s , From My Function!, I wish you %s"%(username, greeting))
def sum_two_numbers(a, b):
return a + b
# print(a simple greeting)
my_function()
#prints - "Hello, John Doe, From My Function!, I wish you a great year!"
my_function_with_args("John Doe", "a great year!")
# after this line x will hold the value 3!
x = sum_two_numbers(1,2)
#================================================
# Modify this function to return a list of strings as defined above
def list_benefits():
return "More organized code", "More readable code", "Easier code reuse", "Allowing programmers to share and connect code together"
# Modify this function to concatenate to each benefit - " is a benefit of functions!"
def build_sentence(benefit):
return "%s is a benefit of functions!" % benefit
def name_the_benefits_of_functions():
list_of_benefits = list_benefits()
for benefit in list_of_benefits:
print(build_sentence(benefit))
name_the_benefits_of_functions()
#==============================================================
'''
classes and objects
'''
class MyClass:
variable = "blah"
def function(self):
print("This is a message inside the class.")
class MyClass:
variable = "blah"
def function(self):
print("This is a message inside the class.")
myobjectx = MyClass()
#self
class MyClass:
variable = "blah"
def function(self):
print("This is a message inside the class.")
myobjectx = MyClass()
myobjectx.variable = "xxxx"
print(myobjectx.variable)
#============================================
class MyClass:
variable = "blah"
def function(self):
print("This is a message inside the class.")
myobjectx = MyClass()
myobjecty = MyClass()
myobjecty.variable = "yackity"
# Then print out both values
print(myobjectx.variable)
print(myobjecty.variable)
class MyClass:
variable = "blah"
def function(self):
print("This is a message inside the class.")
myobjectx = MyClass()
myobjectx.function()
#=======================================================
# define the Vehicle class
class Vehicle:
name = ""
kind = "car"
color = ""
value = 100.00
def description(self):
desc_str = "%s is a %s %s worth $%.2f." % (self.name, self.color, self.kind, self.value)
return desc_str
# your code goes here
car1 = Vehicle()
car1.name = "Fer"
car1.color = "red"
car1.kind = "convertible"
car1.value = 60000.00
car2 = Vehicle()
car2.name = "Jump"
car2.color = "blue"
car2.kind = "van"
car2.value = 10000.00
# test code
print(car1.description())
print(car2.description())
#https://www.learnpython.org/en/Dictionaries
#dictionaries
#podobne do tablic ale klucze i wartości
phonebook = {}
phonebook["John"] = 938477566
phonebook["Jack"] = 938377264
phonebook["Jill"] = 947662781
print(phonebook)
phonebook = {
"John" : 938477566,
"Jack" : 938377264,
"Jill" : 947662781
}
print(phonebook)
#iteracja
phonebook = {"John" : 938477566,"Jack" : 938377264,"Jill" : 947662781}
for name, number in phonebook.items():
print("Phone number of %s is %d" % (name, number))
phonebook = {
"John" : 938477566,
"Jack" : 938377264,
"Jill" : 947662781
}
del phonebook["John"]
print(phonebook)
#lub
phonebook = {
"John" : 938477566,
"Jack" : 938377264,
"Jill" : 947662781
}
phonebook.pop("John")
print(phonebook)
#-------------------------------------
phonebook = {
"John" : 938477566,
"Jack" : 938377264,
"Jill" : 947662781
}
# write your code here
phonebook["Jake"] = 938273443
del phonebook["Jill"]
# testing code
if "Jake" in phonebook:
print("Jake is listed in the phonebook.")
if "Jill" not in phonebook:
print("Jill is not listed in the phonebook.")
#------------------------------
#moduły
'''
mygame/
mygame/game.py
mygame/draw.py
# game.py
# import the draw module
import draw
def play_game():
...
def main():
result = play_game()
draw.draw_game(result)
# this means that if this script is executed, then
# main() will be executed
if __name__ == '__main__':
main()
------------------
# draw.py
def draw_game():
...
def clear_screen(screen):
...
---------------------
# game.py
# import the draw module
from draw import draw_game
def main():
result = play_game()
draw_game(result)
importowanie wszystkich obiektów z modułu
# game.py
# import the draw module
from draw import *
def main():
result = play_game()
draw_game(result)
Custom import name
# game.py
# import the draw module
if visual_mode:
# in visual mode, we draw using graphics
import draw_visual as draw
else:
# in textual mode, we print out text
import draw_textual as draw
def main():
result = play_game()
# this can either be visual or textual depending on visual_mode
draw.draw_game(result)
Module initialization
# draw.py
def draw_game():
# when clearing the screen we can use the main screen object initialized in this module
clear_screen(main_screen)
...
def clear_screen(screen):
...
class Screen():
...
# initialize main_screen as a singleton
main_screen = Screen()
Extending module load path
PYTHONPATH=/foo python game.py
This will execute game.py, and will enable the script to load modules from the foo directory as well as the local directory.
Another method is the sys.path.append function. You may execute it before running an import command:
sys.path.append("/foo")
Exploring built-in modules
# import the library
import urllib
# use it
urllib.urlopen(...)
import urllib
dir(urllib)
help(urllib.urlopen)
Writing packages
Packages are namespaces which contain multiple packages and modules themselves. They are simply directories, but with a twist.
Each package in Python is a directory which MUST contain a special file called __init__.py. This file can be empty, and it indicates that the directory it contains is a Python package, so it can be imported the same way a module can be imported.
If we create a directory called foo, which marks the package name, we can then create a module inside that package called bar. We also must not forget to add the __init__.py file inside the foo directory.
To use the module bar, we can import it in two ways:
import foo.bar
from foo import bar
In the first method, we must use the foo prefix whenever we access the module bar. In the second method, we don't, because we import the module to our module's namespace.
The __init__.py file can also decide which modules the package exports as the API, while keeping other modules internal, by overriding the __all__ variable, like so:
__init__.py:
__all__ = ["bar"]
In this exercise, you will need to print an alphabetically sorted list of all functions in the re module, which contain the word find.
import re
# Your code goes here
find_members = []
for member in dir(re):
if "find" in member:
find_members.append(member)
print(sorted(find_members))
>>> "ala" in "ala ma kota"
True
>>> "ola" in "ala ma kota"
False
'''
'''
numpy array
https://www.learnpython.org/en/Numpy_Arrays
'''
|
@metadata_reactor
def add_backup_key(metadata):
return {
'users': {
'root': {
'authorized_keys': {
'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDM70gDI1cuIKu15VAEYnlWMFi3zGPf6shtQCzrHBv1nOOkfPdXlXACC4H5+MiTV5foAIA8PUaqOV9gow1w639TnWDL2DwPJ5RsT+P5g4eWszW5xQPo0zAKuvlTMB9JkDXGx1OpOE4e9n3++71yuvF/wVlqYxJwxeWXCdHf2ayx6OrTMcSMUIi+zqD494YBhKt+QJAiRrXGNU82FczJeK3iRMTtd+LUeGtnEoskcDOwhGfOXGsUGt3BMWLiDhGXp4ZvKUhNSTz5Kr9OCQT/uWam3nXciZrx1a2kVFJhd1ur81LRqxxDMGQjS29z6Vpd2vxG/P8mP3w2r7fvoqE33hpv': {}
}
}
}
}
|
"""
CCC '01 J1 - Dressing Up
Find this problem at:
https://dmoj.ca/problem/ccc01j1
"""
height = int(input())
# These are the two parts of the bow tie
for half in (range(1, height, 2), range(height, -1, -2)):
# Print each line accordingly
for i in half:
print('*' * i + ' ' * ((height-i)*2) + '*' * i)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:
21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
17 16 15 14 13
It can be verified that the sum of the numbers on the diagonals is 101.
What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral formed in the same way?
"""
def main():
dimension = 1001
curr = 1
result = curr
for n in range(1, dimension/2 + 1):
for i in range(4):
curr += n * 2
result += curr
print(result)
if __name__ == '__main__':
main()
|
print('Cadastro de Alunos')
cadastro = input('Deseja cadastrar um aluno?(S/N)')
cadastro = cadastro.upper()
cadastro = cadastro.strip()
listaAlunos = []
while(cadastro == 'S'):
aluno = []
nome = input('Qual nome do aluno? ')
nome = nome.capitalize()
nome = nome.strip()
aluno.append(nome)
matricula = int(input('qual seu código de matricula? '))
aluno.append(matricula)
nota1 = float(input('Nota do primeiro bimestre: '))
nota2 = float(input('Nota do segundo bimestre: '))
nota3 = float(input('Nota do terceiro bimestre: '))
nota4 = float(input('Nota do quarto bimestre: '))
mediaNotas = (nota1 + nota2 + nota3 + nota4) / 4
aluno.append(mediaNotas)
if (mediaNotas >= 7.0):
aluno.append('Aprovado')
elif (mediaNotas < 7 and mediaNotas > 3):
aluno.append('Recuperação')
else:
aluno.append('Reprovado')
print('Aluno = {}\nMatrícula = {} '.format(aluno[0], aluno[1]))
print(' Nota do primeiro bimestre = {} \n Nota do segundo bimestre = {} \n Nota do terceiro bimestre = {} \n '
'Nota do quarto bimestre = {}'.format(nota1, nota2, nota3, nota4))
print(' Sua média final foi ', mediaNotas)
print('status: ', aluno[3])
listaAlunos.append(aluno)
cadastro = input('Deseja cadastrar um novo aluno?(S/N) ').upper().capitalize()
print(listaAlunos)
|
# This file mainly exists to allow python setup.py test to work.
# flake8: noqa
def runtests():
pass
if __name__ == '__main__':
runtests()
|
line = open("day10.txt", "r").readline()
def day10(iterate, sequence):
for i in range(iterate):
concat = ""
first = True
second = False
sameNumberCounter = 0
secondNum = 0
numCounter = 0
for num in sequence:
numCounter += 1
if second and secondNum != num:
concat += str(sameNumberCounter) + str(secondNum)
first = True
second = False
if numCounter == len(sequence):
sameNumberCounter = 1
concat += str(sameNumberCounter) + str(num)
sameNumberCounter = 0
secondNum = 0
elif secondNum == num:
sameNumberCounter += 1
continue
if first:
firstNum = num
sameNumberCounter += 1
first = False
continue
elif firstNum == num:
sameNumberCounter += 1
continue
else:
concat += str(sameNumberCounter) + str(firstNum)
secondNum = num
second = True
sameNumberCounter = 1
if numCounter == len(sequence):
concat += str(sameNumberCounter) + str(secondNum)
sequence = concat
print(len(concat))
print("Part 1:")
day10(40, line)
print("Part 2:")
day10(50, line)
|
"""Base class for writing hooks."""
class BaseHook(object):
"""Base class for all hooks."""
KEY = 'hook'
NAME = 'Hook'
def __init__(self, extension):
self.extension = extension
@property
def pod(self):
"""Reference to the pod."""
return self.extension.pod
# pylint:disable=no-self-use, unused-argument
def should_trigger(self, previous_result, *_args, **_kwargs):
"""Determine if the hook should trigger."""
return True
def trigger(self, previous_result, *_args, **_kwargs):
"""Trigger the hook."""
raise NotImplementedError()
|
# -*- coding: utf-8 -*-
a, b, c, d = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
d = int(d)
if b > c and d > a and c + d > a + b and c > 0 and d > 0 and a % 2 == 0:
print('Valores aceitos')
else:
print('Valores não aceitos')
# coment
|
#!/usr/bin/env python3
# https://codeforces.com/problemset/problem/1266/B
# 相对的面和为7,所以中间骰子可见的面=14; 骰子塔可见的面=14*k+(1-6)
n = int(input())
l = list(map(int,input().split()))
[print('YES' if i>14 and (i-1)%14<6 else 'NO') for i in l]
|
# Copyright 2015-2021 Mathieu Bernard
#
# This file is part of phonemizer: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Phonemizer is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with phonemizer. If not, see <http://www.gnu.org/licenses/>.
"""Parse a Scheme expression as a nested list
The main function of this module is lispy.parse, other ones should be
considered private. This module is a dependency of the festival
backend.
From http://www.norvig.com/lispy.html
"""
def parse(program):
"""Read a Scheme expression from a string
Return a nested list
Raises an IndexError if the expression is not valid scheme
(unbalanced parenthesis).
>>> parse('(+ 2 (* 5 2))')
['+', '2', ['*', '5', '2']]
"""
return _read_from_tokens(_tokenize(program))
def _tokenize(chars):
"Convert a string of characters into a list of tokens."
return chars.replace('(', ' ( ').replace(')', ' ) ').split()
def _read_from_tokens(tokens):
"Read an expression from a sequence of tokens"
if len(tokens) == 0: # pragma: nocover
raise SyntaxError('unexpected EOF while reading')
token = tokens.pop(0)
if token == '(':
L = []
while tokens[0] != ')':
L.append(_read_from_tokens(tokens))
tokens.pop(0) # pop off ')'
return L
if token == ')': # pragma: nocover
raise SyntaxError('unexpected )')
return token
|
a = "python"
print(a*2)
try:
print(a[-10])
except IndexError as e:
print("인덱스 범위를 초과 했습니다.")
print(e)
print(a[0:4])
print(a[1:-2])
# -10은 hi뒤로 10칸
print("%-10sjane." % "hi")
b = "Python is best choice."
print(b.find("b"))
print(b.find("B"))
try:
print(b.index("B"))
except ValueError as e:
print(e)
c = "hi"
print(c.upper())
a = " hi"
print("kk",a.lstrip())
a = " hi "
print(a.strip())
|
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 25 20:03:57 2019
@Project : Python Memo
@File : fileop.py
@Function : 文件操作
@Author : yehx
@E-mail : yehxian@163.com
"""
#保存到记事本
with open("test.txt","w") as f:
f.write("string")
#读取记事本内容
with open("test.txt", "r") as f:
while True:
data = f.readline()
print(data)
if not data:
break |
#
# PySNMP MIB module ALCATEL-IND1-IPMS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALCATEL-IND1-IPMS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:02:25 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)
#
softentIND1Ipms, = mibBuilder.importSymbols("ALCATEL-IND1-BASE", "softentIND1Ipms")
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint")
InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex")
ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance")
MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, TimeTicks, Counter32, Counter64, MibIdentifier, Bits, Integer32, ObjectIdentity, NotificationType, Gauge32, iso, ModuleIdentity, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "TimeTicks", "Counter32", "Counter64", "MibIdentifier", "Bits", "Integer32", "ObjectIdentity", "NotificationType", "Gauge32", "iso", "ModuleIdentity", "Unsigned32")
TextualConvention, RowStatus, DisplayString, MacAddress = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString", "MacAddress")
alcatelIND1IPMSMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1))
alcatelIND1IPMSMIB.setRevisions(('2007-04-03 00:00',))
if mibBuilder.loadTexts: alcatelIND1IPMSMIB.setLastUpdated('200704030000Z')
if mibBuilder.loadTexts: alcatelIND1IPMSMIB.setOrganization('Alcatel-Lucent')
alcatelIND1IPMSMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1))
alaIpmsConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1))
alaIpmsStatus = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsStatus.setStatus('current')
alaIpmsLeaveTimeout = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 2), Unsigned32().clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsLeaveTimeout.setStatus('current')
alaIpmsQueryInterval = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 3), Unsigned32().clone(125)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsQueryInterval.setStatus('current')
alaIpmsNeighborTimer = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 4), Unsigned32().clone(90)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsNeighborTimer.setStatus('current')
alaIpmsQuerierTimer = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 5), Unsigned32().clone(260)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsQuerierTimer.setStatus('current')
alaIpmsMembershipTimer = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 6), Unsigned32().clone(260)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsMembershipTimer.setStatus('current')
alaIpmsPriority = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(4, 3, 2, 1, 0))).clone(namedValues=NamedValues(("unsupported", 4), ("urgent", 3), ("high", 2), ("medium", 1), ("low", 0))).clone('low')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsPriority.setStatus('current')
alaIpmsMaxBandwidth = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 8), Unsigned32().clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsMaxBandwidth.setStatus('current')
alaIpmsHardwareRoute = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unsupported", 0), ("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsHardwareRoute.setStatus('current')
alaIpmsIGMPMembershipProxyVersion = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("igmpv1", 1), ("igmpv2", 2), ("igmpv3", 3))).clone('igmpv2')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsIGMPMembershipProxyVersion.setStatus('current')
alaIpmsOtherQuerierTimer = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 1, 11), Unsigned32().clone(255)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsOtherQuerierTimer.setStatus('current')
alaIpmsGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2))
alaIpmsGroupTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1), )
if mibBuilder.loadTexts: alaIpmsGroupTable.setStatus('current')
alaIpmsGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupDestIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupClientIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupClientVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupClientIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupClientVci"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupIGMPVersion"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupIGMPv3SrcIP"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupIGMPv3SrcType"))
if mibBuilder.loadTexts: alaIpmsGroupEntry.setStatus('current')
alaIpmsGroupDestIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsGroupDestIpAddr.setStatus('current')
alaIpmsGroupClientIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 2), IpAddress())
if mibBuilder.loadTexts: alaIpmsGroupClientIpAddr.setStatus('current')
alaIpmsGroupClientMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 3), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupClientMacAddr.setStatus('current')
alaIpmsGroupClientVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsGroupClientVlan.setStatus('current')
alaIpmsGroupClientIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 5), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsGroupClientIfIndex.setStatus('current')
alaIpmsGroupClientVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 6), Unsigned32())
if mibBuilder.loadTexts: alaIpmsGroupClientVci.setStatus('current')
alaIpmsGroupIGMPVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("igmpv1", 1), ("igmpv2", 2), ("igmpv3", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupIGMPVersion.setStatus('current')
alaIpmsGroupIGMPv3SrcIP = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 8), IpAddress())
if mibBuilder.loadTexts: alaIpmsGroupIGMPv3SrcIP.setStatus('current')
alaIpmsGroupIGMPv3SrcType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("na", 0), ("include", 1), ("exclude", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupIGMPv3SrcType.setStatus('current')
alaIpmsGroupIGMPv3SrcTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupIGMPv3SrcTimeout.setStatus('current')
alaIpmsGroupIGMPv3GroupType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("na", 0), ("include", 1), ("exclude", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupIGMPv3GroupType.setStatus('current')
alaIpmsGroupTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 2, 1, 1, 12), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsGroupTimeout.setStatus('current')
alaIpmsNeighbor = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3))
alaIpmsNeighborTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1), )
if mibBuilder.loadTexts: alaIpmsNeighborTable.setStatus('current')
alaIpmsNeighborEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborIpAddr"))
if mibBuilder.loadTexts: alaIpmsNeighborEntry.setStatus('current')
alaIpmsNeighborIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsNeighborIpAddr.setStatus('current')
alaIpmsNeighborVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsNeighborVlan.setStatus('current')
alaIpmsNeighborIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 3), InterfaceIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsNeighborIfIndex.setStatus('current')
alaIpmsNeighborVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsNeighborVci.setStatus('current')
alaIpmsNeighborType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsNeighborType.setStatus('current')
alaIpmsNeighborTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 3, 1, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsNeighborTimeout.setStatus('current')
alaIpmsStaticNeighbor = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4))
alaIpmsStaticNeighborTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1), )
if mibBuilder.loadTexts: alaIpmsStaticNeighborTable.setStatus('current')
alaIpmsStaticNeighborEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticNeighborVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticNeighborIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticNeighborVci"))
if mibBuilder.loadTexts: alaIpmsStaticNeighborEntry.setStatus('current')
alaIpmsStaticNeighborVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsStaticNeighborVlan.setStatus('current')
alaIpmsStaticNeighborIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 2), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsStaticNeighborIfIndex.setStatus('current')
alaIpmsStaticNeighborVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 3), Unsigned32())
if mibBuilder.loadTexts: alaIpmsStaticNeighborVci.setStatus('current')
alaIpmsStaticNeighborIGMPVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3))).clone(namedValues=NamedValues(("igmpv2", 2), ("igmpv3", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsStaticNeighborIGMPVersion.setStatus('current')
alaIpmsStaticNeighborRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 4, 1, 1, 5), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsStaticNeighborRowStatus.setStatus('current')
alaIpmsQuerier = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5))
alaIpmsQuerierTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1), )
if mibBuilder.loadTexts: alaIpmsQuerierTable.setStatus('current')
alaIpmsQuerierEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierIpAddr"))
if mibBuilder.loadTexts: alaIpmsQuerierEntry.setStatus('current')
alaIpmsQuerierIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsQuerierIpAddr.setStatus('current')
alaIpmsQuerierVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsQuerierVlan.setStatus('current')
alaIpmsQuerierIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 3), InterfaceIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsQuerierIfIndex.setStatus('current')
alaIpmsQuerierVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsQuerierVci.setStatus('current')
alaIpmsQuerierType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsQuerierType.setStatus('current')
alaIpmsQuerierTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 5, 1, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsQuerierTimeout.setStatus('current')
alaIpmsStaticQuerier = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6))
alaIpmsStaticQuerierTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1), )
if mibBuilder.loadTexts: alaIpmsStaticQuerierTable.setStatus('current')
alaIpmsStaticQuerierEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticQuerierVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticQuerierIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticQuerierVci"))
if mibBuilder.loadTexts: alaIpmsStaticQuerierEntry.setStatus('current')
alaIpmsStaticQuerierVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsStaticQuerierVlan.setStatus('current')
alaIpmsStaticQuerierIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 2), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsStaticQuerierIfIndex.setStatus('current')
alaIpmsStaticQuerierVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 3), Unsigned32())
if mibBuilder.loadTexts: alaIpmsStaticQuerierVci.setStatus('current')
alaIpmsStaticQuerierIGMPVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3))).clone(namedValues=NamedValues(("igmpv2", 2), ("igmpv3", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsStaticQuerierIGMPVersion.setStatus('current')
alaIpmsStaticQuerierRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 6, 1, 1, 5), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alaIpmsStaticQuerierRowStatus.setStatus('current')
alaIpmsSource = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7))
alaIpmsSourceTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1), )
if mibBuilder.loadTexts: alaIpmsSourceTable.setStatus('current')
alaIpmsSourceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceDestIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceUniIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcVci"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcType"))
if mibBuilder.loadTexts: alaIpmsSourceEntry.setStatus('current')
alaIpmsSourceDestIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsSourceDestIpAddr.setStatus('current')
alaIpmsSourceSrcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 2), IpAddress())
if mibBuilder.loadTexts: alaIpmsSourceSrcIpAddr.setStatus('current')
alaIpmsSourceSrcMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 3), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsSourceSrcMacAddr.setStatus('current')
alaIpmsSourceSrcVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsSourceSrcVlan.setStatus('current')
alaIpmsSourceSrcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 5), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsSourceSrcIfIndex.setStatus('current')
alaIpmsSourceUniIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 6), IpAddress())
if mibBuilder.loadTexts: alaIpmsSourceUniIpAddr.setStatus('current')
alaIpmsSourceSrcVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 7), Unsigned32())
if mibBuilder.loadTexts: alaIpmsSourceSrcVci.setStatus('current')
alaIpmsSourceSrcType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3))))
if mibBuilder.loadTexts: alaIpmsSourceSrcType.setStatus('current')
alaIpmsSourceTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 7, 1, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsSourceTimeout.setStatus('current')
alaIpmsForward = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8))
alaIpmsForwardTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1), )
if mibBuilder.loadTexts: alaIpmsForwardTable.setStatus('current')
alaIpmsForwardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardDestIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardDestVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardUniIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcVci"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardDestType"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcType"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardDestIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardDestTunIpAddr"))
if mibBuilder.loadTexts: alaIpmsForwardEntry.setStatus('current')
alaIpmsForwardDestIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsForwardDestIpAddr.setStatus('current')
alaIpmsForwardSrcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 2), IpAddress())
if mibBuilder.loadTexts: alaIpmsForwardSrcIpAddr.setStatus('current')
alaIpmsForwardDestVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsForwardDestVlan.setStatus('current')
alaIpmsForwardSrcVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsForwardSrcVlan.setStatus('current')
alaIpmsForwardSrcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 5), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsForwardSrcIfIndex.setStatus('current')
alaIpmsForwardUniIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 6), IpAddress())
if mibBuilder.loadTexts: alaIpmsForwardUniIpAddr.setStatus('current')
alaIpmsForwardSrcVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 7), Unsigned32())
if mibBuilder.loadTexts: alaIpmsForwardSrcVci.setStatus('current')
alaIpmsForwardDestType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3))))
if mibBuilder.loadTexts: alaIpmsForwardDestType.setStatus('current')
alaIpmsForwardSrcType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3))))
if mibBuilder.loadTexts: alaIpmsForwardSrcType.setStatus('current')
alaIpmsForwardDestTunIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 10), IpAddress())
if mibBuilder.loadTexts: alaIpmsForwardDestTunIpAddr.setStatus('current')
alaIpmsForwardSrcTunIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 11), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsForwardSrcTunIpAddr.setStatus('current')
alaIpmsForwardRtrMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 12), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsForwardRtrMacAddr.setStatus('current')
alaIpmsForwardRtrTtl = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsForwardRtrTtl.setStatus('current')
alaIpmsForwardDestIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 8, 1, 1, 14), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsForwardDestIfIndex.setStatus('current')
alaIpmsPolicy = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9))
alaIpmsPolicyTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1), )
if mibBuilder.loadTexts: alaIpmsPolicyTable.setStatus('current')
alaIpmsPolicyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicyDestIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicyUniIpAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcVci"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcType"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicyPolicy"))
if mibBuilder.loadTexts: alaIpmsPolicyEntry.setStatus('current')
alaIpmsPolicyDestIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsPolicyDestIpAddr.setStatus('current')
alaIpmsPolicySrcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 2), IpAddress())
if mibBuilder.loadTexts: alaIpmsPolicySrcIpAddr.setStatus('current')
alaIpmsPolicySrcMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 3), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsPolicySrcMacAddr.setStatus('current')
alaIpmsPolicySrcVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsPolicySrcVlan.setStatus('current')
alaIpmsPolicySrcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 5), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsPolicySrcIfIndex.setStatus('current')
alaIpmsPolicyUniIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 6), IpAddress())
if mibBuilder.loadTexts: alaIpmsPolicyUniIpAddr.setStatus('current')
alaIpmsPolicySrcVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 7), Unsigned32())
if mibBuilder.loadTexts: alaIpmsPolicySrcVci.setStatus('current')
alaIpmsPolicySrcType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("native", 0), ("ipip", 1), ("pim", 2), ("cmm", 3))))
if mibBuilder.loadTexts: alaIpmsPolicySrcType.setStatus('current')
alaIpmsPolicyPolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("membership", 1))))
if mibBuilder.loadTexts: alaIpmsPolicyPolicy.setStatus('current')
alaIpmsPolicyDisposition = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("drop", 0), ("accept", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsPolicyDisposition.setStatus('current')
alaIpmsPolicyTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 9, 1, 1, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alaIpmsPolicyTimeout.setStatus('current')
alaIpmsStaticMember = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10))
alaIpmsStaticMemberTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1), )
if mibBuilder.loadTexts: alaIpmsStaticMemberTable.setStatus('current')
alaIpmsStaticMemberEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticMemberGroupAddr"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticMemberVlan"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticMemberIfIndex"), (0, "ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticMemberVci"))
if mibBuilder.loadTexts: alaIpmsStaticMemberEntry.setStatus('current')
alaIpmsStaticMemberGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: alaIpmsStaticMemberGroupAddr.setStatus('current')
alaIpmsStaticMemberIGMPVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3))).clone(namedValues=NamedValues(("igmpv2", 2), ("igmpv3", 3))))
if mibBuilder.loadTexts: alaIpmsStaticMemberIGMPVersion.setStatus('current')
alaIpmsStaticMemberVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: alaIpmsStaticMemberVlan.setStatus('current')
alaIpmsStaticMemberIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 4), InterfaceIndex())
if mibBuilder.loadTexts: alaIpmsStaticMemberIfIndex.setStatus('current')
alaIpmsStaticMemberVci = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 5), Unsigned32())
if mibBuilder.loadTexts: alaIpmsStaticMemberVci.setStatus('current')
alaIpmsStaticMemberRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 1, 10, 1, 1, 6), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: alaIpmsStaticMemberRowStatus.setStatus('current')
alcatelIND1IPMSMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2))
alcatelIND1IPMSMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 1))
alcatelIND1IPMSMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2))
alaIpmsCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 1, 1)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsConfig"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsGroup"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighbor"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticNeighbor"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerier"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticQuerier"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsSource"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsForward"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicy"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsCompliance = alaIpmsCompliance.setStatus('current')
alaIpmsConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 1)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsStatus"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsLeaveTimeout"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQueryInterval"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborTimer"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierTimer"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsMembershipTimer"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsOtherQuerierTimer"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsConfigGroup = alaIpmsConfigGroup.setStatus('current')
alaIpmsGroupGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 2)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupClientMacAddr"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupTimeout"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupIGMPv3GroupType"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsGroupIGMPv3SrcTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsGroupGroup = alaIpmsGroupGroup.setStatus('current')
alaIpmsNeighborGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 3)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborVlan"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborIfIndex"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborVci"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborType"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsNeighborTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsNeighborGroup = alaIpmsNeighborGroup.setStatus('current')
alaIpmsStaticNeighborGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 4)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticNeighborRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsStaticNeighborGroup = alaIpmsStaticNeighborGroup.setStatus('current')
alaIpmsQuerierGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 5)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierVlan"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierIfIndex"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierVci"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierType"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsQuerierTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsQuerierGroup = alaIpmsQuerierGroup.setStatus('current')
alaIpmsStaticQuerierGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 6)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsStaticQuerierRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsStaticQuerierGroup = alaIpmsStaticQuerierGroup.setStatus('current')
alaIpmsSourceGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 7)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceSrcMacAddr"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsSourceTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsSourceGroup = alaIpmsSourceGroup.setStatus('current')
alaIpmsForwardGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 8)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardSrcTunIpAddr"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardRtrMacAddr"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsForwardRtrTtl"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsForwardGroup = alaIpmsForwardGroup.setStatus('current')
alaIpmsPolicyGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 18, 1, 2, 2, 9)).setObjects(("ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicySrcMacAddr"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicyDisposition"), ("ALCATEL-IND1-IPMS-MIB", "alaIpmsPolicyTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
alaIpmsPolicyGroup = alaIpmsPolicyGroup.setStatus('current')
mibBuilder.exportSymbols("ALCATEL-IND1-IPMS-MIB", alaIpmsStaticNeighborRowStatus=alaIpmsStaticNeighborRowStatus, alaIpmsQuerierVlan=alaIpmsQuerierVlan, alaIpmsStaticQuerier=alaIpmsStaticQuerier, alaIpmsGroupClientMacAddr=alaIpmsGroupClientMacAddr, alaIpmsNeighbor=alaIpmsNeighbor, alaIpmsStaticNeighborVci=alaIpmsStaticNeighborVci, alaIpmsPolicyUniIpAddr=alaIpmsPolicyUniIpAddr, alaIpmsForwardSrcVlan=alaIpmsForwardSrcVlan, alaIpmsGroupDestIpAddr=alaIpmsGroupDestIpAddr, alaIpmsNeighborVci=alaIpmsNeighborVci, alaIpmsStaticNeighbor=alaIpmsStaticNeighbor, alaIpmsGroupGroup=alaIpmsGroupGroup, alaIpmsForwardDestVlan=alaIpmsForwardDestVlan, alaIpmsStaticQuerierIfIndex=alaIpmsStaticQuerierIfIndex, alcatelIND1IPMSMIBCompliances=alcatelIND1IPMSMIBCompliances, alaIpmsSourceSrcVlan=alaIpmsSourceSrcVlan, alaIpmsForwardSrcIfIndex=alaIpmsForwardSrcIfIndex, alaIpmsHardwareRoute=alaIpmsHardwareRoute, alaIpmsNeighborTimeout=alaIpmsNeighborTimeout, alaIpmsStaticMemberIGMPVersion=alaIpmsStaticMemberIGMPVersion, alaIpmsStaticNeighborTable=alaIpmsStaticNeighborTable, alaIpmsNeighborIpAddr=alaIpmsNeighborIpAddr, alaIpmsForwardDestTunIpAddr=alaIpmsForwardDestTunIpAddr, alaIpmsSourceEntry=alaIpmsSourceEntry, alaIpmsPolicySrcVci=alaIpmsPolicySrcVci, alaIpmsForwardSrcType=alaIpmsForwardSrcType, alaIpmsQuerierIpAddr=alaIpmsQuerierIpAddr, alaIpmsOtherQuerierTimer=alaIpmsOtherQuerierTimer, alaIpmsGroupClientIfIndex=alaIpmsGroupClientIfIndex, alaIpmsForwardSrcVci=alaIpmsForwardSrcVci, alaIpmsStaticMember=alaIpmsStaticMember, alaIpmsPolicySrcIpAddr=alaIpmsPolicySrcIpAddr, alaIpmsForwardSrcIpAddr=alaIpmsForwardSrcIpAddr, alaIpmsPolicySrcMacAddr=alaIpmsPolicySrcMacAddr, alaIpmsStaticQuerierGroup=alaIpmsStaticQuerierGroup, alaIpmsStaticMemberVci=alaIpmsStaticMemberVci, alaIpmsPolicyTable=alaIpmsPolicyTable, alaIpmsMembershipTimer=alaIpmsMembershipTimer, alaIpmsStaticNeighborIGMPVersion=alaIpmsStaticNeighborIGMPVersion, alaIpmsSourceSrcVci=alaIpmsSourceSrcVci, alaIpmsForwardUniIpAddr=alaIpmsForwardUniIpAddr, alaIpmsPolicySrcType=alaIpmsPolicySrcType, alaIpmsGroupEntry=alaIpmsGroupEntry, alaIpmsNeighborGroup=alaIpmsNeighborGroup, alaIpmsSourceSrcMacAddr=alaIpmsSourceSrcMacAddr, alaIpmsStaticNeighborVlan=alaIpmsStaticNeighborVlan, alaIpmsStaticNeighborIfIndex=alaIpmsStaticNeighborIfIndex, alaIpmsQueryInterval=alaIpmsQueryInterval, alaIpmsPolicyGroup=alaIpmsPolicyGroup, alaIpmsForwardRtrMacAddr=alaIpmsForwardRtrMacAddr, alaIpmsStaticMemberEntry=alaIpmsStaticMemberEntry, alaIpmsNeighborTimer=alaIpmsNeighborTimer, alaIpmsConfig=alaIpmsConfig, alaIpmsForwardTable=alaIpmsForwardTable, alaIpmsQuerierGroup=alaIpmsQuerierGroup, alaIpmsGroup=alaIpmsGroup, alaIpmsGroupClientVlan=alaIpmsGroupClientVlan, alaIpmsNeighborVlan=alaIpmsNeighborVlan, alaIpmsMaxBandwidth=alaIpmsMaxBandwidth, alaIpmsSourceGroup=alaIpmsSourceGroup, alaIpmsGroupTable=alaIpmsGroupTable, alaIpmsPolicy=alaIpmsPolicy, alaIpmsConfigGroup=alaIpmsConfigGroup, alaIpmsForwardDestIfIndex=alaIpmsForwardDestIfIndex, alaIpmsSourceSrcType=alaIpmsSourceSrcType, alaIpmsSourceDestIpAddr=alaIpmsSourceDestIpAddr, alaIpmsPolicyDisposition=alaIpmsPolicyDisposition, alaIpmsQuerierTimeout=alaIpmsQuerierTimeout, alaIpmsGroupIGMPv3SrcTimeout=alaIpmsGroupIGMPv3SrcTimeout, alaIpmsStaticMemberRowStatus=alaIpmsStaticMemberRowStatus, alcatelIND1IPMSMIBObjects=alcatelIND1IPMSMIBObjects, PYSNMP_MODULE_ID=alcatelIND1IPMSMIB, alaIpmsSourceSrcIfIndex=alaIpmsSourceSrcIfIndex, alaIpmsPolicyEntry=alaIpmsPolicyEntry, alaIpmsPolicyPolicy=alaIpmsPolicyPolicy, alaIpmsStaticQuerierVci=alaIpmsStaticQuerierVci, alaIpmsQuerierEntry=alaIpmsQuerierEntry, alaIpmsSource=alaIpmsSource, alaIpmsGroupClientIpAddr=alaIpmsGroupClientIpAddr, alaIpmsIGMPMembershipProxyVersion=alaIpmsIGMPMembershipProxyVersion, alaIpmsNeighborEntry=alaIpmsNeighborEntry, alaIpmsNeighborType=alaIpmsNeighborType, alaIpmsStaticQuerierVlan=alaIpmsStaticQuerierVlan, alaIpmsGroupTimeout=alaIpmsGroupTimeout, alaIpmsPolicySrcVlan=alaIpmsPolicySrcVlan, alaIpmsForwardEntry=alaIpmsForwardEntry, alaIpmsQuerierTable=alaIpmsQuerierTable, alaIpmsForwardGroup=alaIpmsForwardGroup, alaIpmsGroupIGMPv3SrcIP=alaIpmsGroupIGMPv3SrcIP, alaIpmsSourceSrcIpAddr=alaIpmsSourceSrcIpAddr, alaIpmsGroupIGMPVersion=alaIpmsGroupIGMPVersion, alaIpmsSourceTimeout=alaIpmsSourceTimeout, alcatelIND1IPMSMIBConformance=alcatelIND1IPMSMIBConformance, alaIpmsQuerierTimer=alaIpmsQuerierTimer, alaIpmsStaticNeighborGroup=alaIpmsStaticNeighborGroup, alaIpmsPolicySrcIfIndex=alaIpmsPolicySrcIfIndex, alaIpmsForwardRtrTtl=alaIpmsForwardRtrTtl, alaIpmsPolicyTimeout=alaIpmsPolicyTimeout, alaIpmsStaticMemberTable=alaIpmsStaticMemberTable, alaIpmsStatus=alaIpmsStatus, alaIpmsStaticMemberGroupAddr=alaIpmsStaticMemberGroupAddr, alaIpmsGroupIGMPv3GroupType=alaIpmsGroupIGMPv3GroupType, alaIpmsForwardDestType=alaIpmsForwardDestType, alaIpmsForwardDestIpAddr=alaIpmsForwardDestIpAddr, alaIpmsStaticQuerierTable=alaIpmsStaticQuerierTable, alcatelIND1IPMSMIB=alcatelIND1IPMSMIB, alaIpmsQuerierVci=alaIpmsQuerierVci, alaIpmsStaticQuerierRowStatus=alaIpmsStaticQuerierRowStatus, alaIpmsStaticMemberVlan=alaIpmsStaticMemberVlan, alaIpmsLeaveTimeout=alaIpmsLeaveTimeout, alaIpmsStaticMemberIfIndex=alaIpmsStaticMemberIfIndex, alcatelIND1IPMSMIBGroups=alcatelIND1IPMSMIBGroups, alaIpmsPolicyDestIpAddr=alaIpmsPolicyDestIpAddr, alaIpmsStaticQuerierEntry=alaIpmsStaticQuerierEntry, alaIpmsForward=alaIpmsForward, alaIpmsGroupClientVci=alaIpmsGroupClientVci, alaIpmsGroupIGMPv3SrcType=alaIpmsGroupIGMPv3SrcType, alaIpmsForwardSrcTunIpAddr=alaIpmsForwardSrcTunIpAddr, alaIpmsStaticQuerierIGMPVersion=alaIpmsStaticQuerierIGMPVersion, alaIpmsSourceUniIpAddr=alaIpmsSourceUniIpAddr, alaIpmsQuerier=alaIpmsQuerier, alaIpmsPriority=alaIpmsPriority, alaIpmsQuerierIfIndex=alaIpmsQuerierIfIndex, alaIpmsNeighborIfIndex=alaIpmsNeighborIfIndex, alaIpmsCompliance=alaIpmsCompliance, alaIpmsNeighborTable=alaIpmsNeighborTable, alaIpmsSourceTable=alaIpmsSourceTable, alaIpmsQuerierType=alaIpmsQuerierType, alaIpmsStaticNeighborEntry=alaIpmsStaticNeighborEntry)
|
num = int(input( "Digite um valor de 0 a 9999: "))
num1 = str(num)
num2 = num1.zfill(4)
print('Unidade: {}'.format(num2[3]))
print('Dezena: {}'.format(num2[2]))
print('Centena: {}'.format(num2[1]))
print('Milhar: {}'.format(num2[0]))
|
builder_layers = {
# P-CAD ASCII layer types:
# Signal, Plane, NonSignal
-1: "null", # LT_UNDEFINED
0: "Signal", # LT_SIGNAL
1: "Plane", # LT_POWER
2: "NonSignal", # LT_MIXED
3: "Plane" # LT_JUMPER
}
builder_padshapes = {
# P-CAD ASCII padshape types:
# padViaShapeType(
# Ellipse, Oval, Rect, RndRect, Thrm2, Thrm2_90,
# Thrm4, Thrm4_45, Direct, NoConnect, Polygon
# )
0: "Ellipse", # PAD_SHAPE_CIRCLE
1: "Rect", # PAD_SHAPE_RECT
2: "Oval", # PAD_SHAPE_OVAL
3: "", # PAD_SHAPE_TRAPEZOID
4: "RndRect", # PAD_SHAPE_ROUNDRECT
5: "", # PAD_SHAPE_CHAMFERED_RECT
6: "Polygon" # PAD_SHPAE_CUSTOM
}
builder_fontRenderer_Stroke = 0
builder_fontRenderer_TrueType = 2
builder_fontFamily_Serif = 0
builder_fontFamily_Sanserif = 1
builder_fontFamily_Modern = 2
builder_fontRenderers = {
builder_fontRenderer_Stroke: "Stroke",
builder_fontRenderer_TrueType: "TrueType"
}
builder_fontFamilies = {
builder_fontFamily_Serif: "Serif",
builder_fontFamily_Sanserif: "Sanserif",
builder_fontFamily_Modern: "Modern"
}
class builder_param:
is_mm = True
used_fontFamily = builder_fontFamily_Sanserif
|
class Solution(object):
def myAtoi(self, str):
"""
:type str: str
:rtype: int
"""
temp = str.strip()
if not temp:
return 0
negative = False
resint = 0
head = temp[0]
if head == "-":
negative = True
elif head == "+":
negative = False
elif not head.isnumeric():
return 0
else:
resint += ord(head) - ord('0')
for i in range(1,len(temp)):
if temp[i].isnumeric():
resint = 10*resint + ord(temp[i]) - ord('0')
if not negative and resint >= 2147483647:
return 2147483647
if negative and resint >= 2147483648:
return -2147483648
else:
break
if not negative:
return resint
else:
return -resint |
def calc_no(val):
temp = val
s = 0
while temp > 0:
s += temp%10
temp //= 10
return not(val%s)
row = int(input())
arr = [] # storing input values
for i in range(row):
arr.append(list(map(int,input().split())))
bool_tab = [] # storing their resp boolean value if it is divisible by the sum of digits than True else False
for i in range(row):
x = []
for j in range(len(arr[0])):
x.append(calc_no(arr[i][j]))
bool_tab.append(x)
res = []
for i in range(row-1):
for j in range(len(arr[0])-1):
if bool_tab[i][j] and bool_tab[i][j+1] and bool_tab[i+1][j] and bool_tab[i+1][j+1]:
res.append([arr[i][j], arr[i][j+1],arr[i+1][j],arr[i+1][j+1]])
if len(res) > 0:
for i in res:
print(i[0], i[1])
print(i[2], i[3])
print()
else:
print('No matrix found')
''' Input
3
42 54 2
30 24 27
180 190 40
Output
42 54
30 24
54 2
24 27
30 24
180 190
24 27
190 40''' |
# 最简单的输出
print('Hello World!')
# 输出表达式值
print(20+10)
# print函数支持多个参数,遇到逗号输出空格。
print('Nice','to','meet','you!',999)
# 字符串连接
print('a'+'b')
# 格式化输出
print('100 + 200 =',100+200) |
def weather_conditions(temp):
if temp > 7:
print("Warm")
else:
print("Cold")
x = int(input("Enter a temparature"))
weather_conditions(x)
|
T = int(input())
for kase in range(1, T + 1):
n = int(input())
[input() for i in range(0, n + 1)]
if n & 1:
print(f'Case #{kase}: 1\n0.0')
else:
print(f'Case #{kase}: 0') |
# https://app.codility.com/demo/results/trainingUJUBFH-2H3/
def solution(X, A):
"""
DINAKAR
Clue -> Find the earliest time when the frog can jump to the other side of the river. The frog can cross only when leaves appear at every position across the river from 1 to X
[1, 3, 1, 4, 2, 3, 5, 4]
X = 5 ie. {1, 2, 3, 4, 5} here 1 to X/5 is completed so we return the index which is time
"""
positions = set()
for index, item in enumerate(A):
print("Current Time " + str(index))
print("Position " + str(item))
positions.add(item)
print("Positions covered..." + str(positions))
if len(positions) == X:
return index
return -1
result = solution(5, [1, 3, 1, 4, 2, 3, 5, 4])
print("Sol " + str(result))
"""
Current Time 0
Position 1
Positions covered...{1}
Current Time 1
Position 3
Positions covered...{1, 3}
Current Time 2
Position 1
Positions covered...{1, 3}
Current Time 3
Position 4
Positions covered...{1, 3, 4}
Current Time 4
Position 2
Positions covered...{1, 2, 3, 4}
Current Time 5
Position 3
Positions covered...{1, 2, 3, 4}
Current Time 6
Position 5
Positions covered...{1, 2, 3, 4, 5}
Sol 6
"""
|
# Atharv Kolhar
# Python Bytes
# https://www.youtube.com/channel/UC71nPTNDEG7oyusXTifvB7g?sub_confirmation=1
"""
Tuple
"""
# Declaration
var_tuple = (1, 2, 3)
print(var_tuple)
print(type(var_tuple))
var_tuple_1 = 1, 2, 3
print(var_tuple_1)
print(type(var_tuple_1))
# Function for Tuples
# Counting the element repeated in the tuple
var_tuple_2 = (1, 1, 2, 3, 2, 1, 4, 1)
print(var_tuple_2.count(1))
print(var_tuple_2.count(4))
# Index finding
print(var_tuple_2.index(1))
print(var_tuple_2.index(1, 2, 6))
# Changing the Data Type
# Tuple to List
var_list_from_tuple = list(var_tuple_2)
print(var_list_from_tuple)
print(type(var_list_from_tuple))
# List to Tuple
var_tuple_from_list = tuple(var_list_from_tuple)
print(var_tuple_from_list)
print(type(var_tuple_from_list))
# End |
school_class = {}
while True:
name = input("Enter the student's name: ")
if name == '':
break
score = int(input("Enter the student's score (0-10): "))
if score not in range(0, 11):
break
if name in school_class:
school_class[name] += (score,)
else:
school_class[name] = (score,)
for name in sorted(school_class.keys()):
adding = 0
counter = 0
for score in school_class[name]:
adding += score
counter += 1
print(name, ":", adding / counter)
################
pol_eng_dictionary = {
"kwiat": "flower",
"woda": "water",
"gleba": "soil"
}
item_1 = pol_eng_dictionary["gleba"] # ex. 1
print(item_1) # outputs: soil
item_2 = pol_eng_dictionary.get("woda")
print(item_2) # outputs: water
############
phonebook = {} # an empty dictionary
phonebook["Adam"] = 3456783958 # create/add a key-value pair
print(phonebook) # outputs: {'Adam': 3456783958}
del phonebook["Adam"]
print(phonebook) # outputs: {}
##########
pol_eng_dictionary = {
"zamek": "castle",
"woda": "water",
"gleba": "soil"
}
copy_dictionary = pol_eng_dictionary.copy()
|
with open("day6_input") as infile:
cycles = [[int(x) for x in infile.readline().split('\t') if x != '\n']]
steps = 0
while True:
current_cycle = cycles[-1]
max_ = max(current_cycle)
maxindex = current_cycle.index(max_)
new_cycle = current_cycle[:]
new_cycle[maxindex] = 0
for i in range(maxindex + 1, maxindex + 1 + max_):
new_cycle[i % len(new_cycle)] += 1
cycles.append(new_cycle)
steps += 1
if steps > 1 and new_cycle in cycles[:-1]: break
print(steps)
print(steps - cycles[:-1].index(cycles[-1]))
|
pattern = []
with open('day_3.txt') as f:
for line in f:
pattern.append([line.rstrip()])
def count_trees(pattern, right, down):
'''Use dictionary to redefine positions outside base pattern,
count all trees in pattern (#) which we meet, when we follow defined number of moves to right and down'''
# for making dictionary
len_line = len(''.join(pattern[0]))
border_pos = len_line - right - 1 # border positions - need to be translated
keys = [*range(border_pos, len_line)] # keys up to length of line
values = []
for key in keys:
values.append(key - border_pos - 1)
# make dictionary
dictionary = dict(zip(keys, values))
# count trees and change current position
count = 0
pos = 0
for index, line in enumerate(pattern):
if index % down == 0:
# count met tree
if line[0][pos] == '#':
count += 1
# define new position after move
if pos > border_pos: # redefine border position, if needed
pos = dictionary[pos]
else:
pos += right
return count
def follow_instructions(instructions):
'''Call function count_trees() for every instruction, return product of multiplication of all trees'''
for i, instruction in enumerate(instructions):
right, down = instruction
if i == 0:
total = count_trees(pattern, right, down)
else:
total *= count_trees(pattern, right, down)
return total
part1_instructions = [(3, 1)]
part2_instructions = [(1, 1), (3, 1), (5, 1), (7, 1), (1, 2)]
print(follow_instructions(part1_instructions))
print(follow_instructions(part2_instructions))
|
'''
Dictionary that keeps the cost of individual parts of cars.
'''
car_body = {
'Honda' : 500,
'Nissan' : 1000,
'Suzuki' : 600,
'Toyota' : 500
}
car_tyres = {
'Honda' : 1400,
'Nissan' : 500,
'Suzuki' : 600,
'Toyota' : 1000
}
car_doors = {
'Honda' : 400,
'Nissan': 300,
'Suzuki' : 600,
'Toyota' : 800
} |
class Solution:
def findKthPositive(self, arr: List[int], k: int) -> int:
missing = []
limit = arr[-1]
nums = set(arr)
for i in range(1,limit):
if i not in nums:
missing.append(i)
if len(missing) >= k:
return missing[k-1]
else:
return limit + k - len(missing) |
# mendapatkan tagihan bulanan
# selamat satu unit lagi dan anda sudah membuat sebuah program! ketika
# kita bilang anda bisa membuat apa saja dengan python, kita bersungguh-sungguh!
# batas dari apa yang anda bisa bangun adalah di imajinasi anda
# terus belajar ke bab berikutnya dan akhirnya anda akan bisa membuat program yang
# lebih keren lagi!
'''
instruksi
-oke sekarang kita buat variabel
total_tagihan
yang merupakan jumlah dari
sisa_cicilan
dan
jumlah_bunga
-setelahnya kita buat
tagihan_bulanan
yang merupakan
total_tagihan
dibagi
12
-jalankan codenya dan lihat tagihan bulananan anda
-ubah angkanya sesuasi yang anda mau dan bermain mainlah dengan apa yang telah anda pelajari
'''
# harga_laptop = 5000000
# uang_muka = 1000000
# sisa_cicilan = harga_laptop-uang_muka
# suku_bunga = 10
# jumlah_bunga = sisa_cicilan * suku_bunga /100
# total_tagihan = sisa_cicilan + jumlah_bunga
# tagihan_bulanan = total_tagihan /12
# print(tagihan_bulanan)
while True:
print('''
menghitung total tagihan''')
harga = int(input('harga barang: '))
uang_muka = int(input('uang muka: '))
sisa_cicilan = harga-uang_muka
print('sisa cicilan {} - {} = {}'.format(harga,uang_muka,sisa_cicilan))
suku_bunga = int(input('bunga: '))
jumlah_bunga = sisa_cicilan * suku_bunga / 100
total_tagihan = sisa_cicilan + jumlah_bunga
tagihan_bulanan = total_tagihan / 12
print('jumlah bunga {} x {} / 100 = {}'.format(sisa_cicilan,suku_bunga,jumlah_bunga))
print('total tagihan: {} + {} = {}'.format(sisa_cicilan,jumlah_bunga,total_tagihan))
print('tagihan bulanan: {} / 12 = %.2f'.format(total_tagihan)%(tagihan_bulanan))
d = input('try again(y/n)? ')
if d=='y' or d=='Y':
print()
elif d=='n' or d=='N':
exit()
|
def find(n, m, x, y, dx, dy):
if x < 0 or x == 20 or y < 0 or y == 20:
return -1
elif n == 0:
return 1
else:
return m[y][x] * find(n - 1, m, x + dx, y + dy, dx, dy)
directions = [None] * 8
for i in range(0, 8):
if i == 0:
directions[i] = [0, 1]
elif i == 1:
directions[i] = [1, 0]
elif i == 2:
directions[i] = [0, -1]
elif i == 3:
directions[i] = [-1, 0]
elif i == 4:
directions[i] = [1, 1]
elif i == 5:
directions[i] = [1, -1]
elif i == 6:
directions[i] = [-1, 1]
else:
directions[i] = [-1, -1]
max0 = 0
m = [list(map(int, input().split())) for i in range(20)]
for j in range(0, 8):
(dx, dy) = directions[j]
for x in range(0, 20):
for y in range(0, 20):
max0 = max(max0, find(4, m, x, y, dx, dy))
print("%d\n" % max0, end='')
|
cue_words=["call it as",
"call this as",
"called as the",
"call it as",
"referred to as",
"is defined as",
"known as the",
"defined as",
"known as",
"mean by",
"concept of",
"talk about",
"called as",
"called the",
"called an",
"called a",
"call as",
"called"]
|
def nonrep():
checklist=[]
my_string={"pythonprograming"}
for s in my_string:
if s in my_string:
my_string[s]+=1
else:
my_string=1
checklist.appened(my_string[s])
for s in checklist:
if s==1:
return True
else:
False
result=nonrep()
print(result)
|
# -*- coding: utf-8 -*-
"""DQ0 SDK Data Utils Package
This package contains general data helper functions.
"""
__all__ = [
'util',
'plotting'
]
|
REQUEST_BODY_JSON = """
{
"verification_details": {
"amount": 1.1,
"payment_transaction_id": "string",
"transaction_type": "PHONE_PAY",
"screenshot_url": "string"
}
}
"""
|
#!/usr/bin/env python3
CONVERSION_TABLE = {
'I': 1,
'II': 2,
'III': 3,
'IV': 4,
'V': 5,
'VI': 6,
'VII': 7,
'VIII': 8,
'IX': 9,
'X': 10,
'XX': 20,
'XXX': 30,
'XL': 40,
'L': 50,
'LX': 60,
'LXX': 70,
'LXXX': 80,
'XC': 90,
'C': 100,
'D': 500,
'M': 1000,
}
def roman_to_arabic(roman_value: str) -> int:
"""
>>> roman_to_arabic("I")
1
>>> roman_to_arabic("IX")
9
>>> roman_to_arabic("MDL")
1550
>>> roman_to_arabic("XIV")
14
"""
roman_value.capitalize()
arabic_value = []
for letter in roman_value:
if letter in CONVERSION_TABLE:
arabic_value.append(CONVERSION_TABLE[letter])
last_value = CONVERSION_TABLE["M"] * 2
cumulative_value = 0
for value in arabic_value:
if last_value < value:
cumulative_value -= 2 * last_value
cumulative_value += value
last_value = value
return cumulative_value
|
'''
This file contains any primitives for Lyanna that aren't just
borrowed from the language. Basically this is Nothing and Undefined,
which are singletons. That is, their classes are stuck here and only
selected instances are exported through __all__
'''
class NothingType(object):
def __str__(self):
return "Nothing"
class UndefinedType(object):
def __str__(self):
return "Undefined"
Nothing = NothingType()
Undefined = UndefinedType()
def is_primitive(item):
return isinstance(item, (NothingType, UndefinedType, bool, int, basestring))
__all__ = ['Nothing', 'Undefined']
|
def settingDecoder(data):
# data can be:
# raw string
# list of strings
data = data.strip()
if (len(data) > 1) and (data[0] == '[') and (data[-1] == ']'):
data = [x.strip() for x in data[1:-1].split(',')]
return data
def loadSetting(filename = "SETTINGS"):
res = dict()
with open(filename, 'r') as f:
for line in f:
sline = line.strip()
if sline.startswith('#'):
continue
if sline.find('=') != -1:
eIdx = sline.find('=')
res[line[:eIdx]] = settingDecoder(sline[(eIdx + 1):])
return res
settings = loadSetting()
def getSetting(key, value = None):
if key in settings:
return settings[key]
else:
return value
if __name__ == '__main__':
print(loadSetting()) |
resposta = input('Mamae você comprou chocolate?[sim/não] ')
if resposta == 'sim':
print('Obrigado Mainha')
elif resposta == 'não':
print('Então vou chorar ... Buá, Buá')
else:
print('Não foi o que eu perguntei') |
messages = 'game.apps.core.signals.messages.%s' # user.id
planet = 'game.apps.core.signals.planet_details.%s' # planetID_requestID
account_data = 'game.apps.core.signals.account_data.%s'
building = 'game.apps.core.signals.building.%s' # buildingID
task_updated = 'game.apps.core.signals.task_updated.%s' # user.id
|
# 39. Combination Sum
# Time: O((len(candidates))^(target/avg(candidates))) Review
# Space: O(target/avg(candidates))) [depth of recursion tree?]Review
class Solution:
def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]:
result = []
self.util(candidates, target, 0 , [], result)
return result
def util(self, candidates, target, start, cur_res, result):
if target<0:
return
if target==0:
result.append(cur_res)
return
for i in range(start, len(candidates)):
self.util(candidates, target-candidates[i], i, cur_res+[candidates[i]], result)
|
class audo:
def __init__(self, form, data = None):
self.form = form
self.values = []
if data:
self.load(data)
def load(self, data):
for i in range(data.readUInt32()):
while (data.offset & 3) != 0:
data.offset += 1
data.push(data.readUInt32())
self.values.append(data.readBytes(data.readUInt32()))
data.pop()
def __getitem__(self, index):
return self.values[index]
|
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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.
IPPROTO_IP = 0
IPPROTO_HOPOPTS = 0
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
IPPROTO_TCP = 6
IPPROTO_UDP = 17
IPPROTO_ROUTING = 43
IPPROTO_FRAGMENT = 44
IPPROTO_GRE = 47
IPPROTO_AH = 51
IPPROTO_ICMPV6 = 58
IPPROTO_NONE = 59
IPPROTO_DSTOPTS = 60
IPPROTO_OSPF = 89
IPPROTO_VRRP = 112
IPPROTO_SCTP = 132
|
"""
MainWindow.setWindowTitle('Physics')
self.centralwidget.setLayout(self.gridLayout)
version = "v1"
""" |
lst = [90, 180, 0]
empty = []
lst.append(empty)
def function_a():
for empty in lst:
if empty in lst:
print(lst)
function_b()
function_b()
print(lst)
def function_b():
for empty in lst:
if empty in lst:
print(lst)
function_b()
function_a()
|
def options_displ():
print(
'''
weather now: Displays the current weather
weather today: Displays the weather for this day
weather tenday: Displays weather for next ten days
detailed tenday: Displays ten day weather with extended info
weather -t: Displays current temperature
weather -dew: Displays cloud dew point currently
weather -prs: Displays precipitation percentage currently
weather -par: Displays current atmospheric pressure (bar)
weather -mnp: Displays moon phase
weather -ws: Displays current wind speed and direction
weather -hdu: Displays current humidity percentage
weather -vis: Displays current visibility (km)
weather -uv: Displays current UV index out of 10 (0 - Minimum, 10 - Maximum)
weather -dsc: Displays current weather description
weather -tab: Displays startup table again
--h or -help: Displays help page
--o or -options: Displays options(current) page
clear(): clear screen
loc -p: Change permanent location
loc -t: Change temporary location
loc -pr: Return to permanent location
--loc: View if location is permanent or temporary
settings: Turn toggle on or off
exit: Exit application
'''
)
_ = input('Press enter to continue >> ')
def help_application():
print(
'''
Startup:
When you first start up the app, it will ask you for your country and location. This is stored permanently and can be changed in the future.
This system helps to reduce time when logging in to check the current weather
NOTE:You can view all the commands by entering --o or -options in the terminal. Use -help only when needing assistance with the app.
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Command line modifications:
When in the MAIN command line you will see a > which denotes an input suggestion. Here you can enter any command from the list below!
When in sections like weather ten day or weather today, you will see a >> which means you are in the terminal for that particular weather section.
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Settings:
This app currently has a toggle feature which is enabled by default and can be changed later.
Toggle helps to change the way the day/hour navigation system works under the weather ten day and weather today sections.
If you have settings toggle enabled you can navigate using the letter P(Previous hr/day), N(Next hr/day), E(Extended info), Q(exit to main cli).
If you have settings disabled then you can navigate using Enter(next day) or Q(exit to main cli).
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Location change:
There are primarily 2 location change commands in this app. loc -p and loc -t
Loc -p changes your permanent location, this changes every section in the app from the startup menu weather and the weather sections
Loc -t changes your location temporarily, this is useful when you want to view another location temporarily
To know if you're in a temporary location or not just scroll up and you'll see your location near the title
If there is a text which says 'Temporary Location', it means you're currently not in the permanent selected location, an alternate way to check is by typing the command --loc,
this will tell you if you have permanent location selected or not
To change back to permanent selected location type the command loc -pr and you'll be taken back.
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Title screen weather:
When you load up the app, you will see a dropdown box which displays the hourly weather. This box is dynamic and the amount of information changes according to the size of your terminal.
It is recommended to have your terminal on full screen or at least extended beyond the default size.
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Other information:
Under the weather hourly section, if toggle is enabled and if it's the last hour of the day. The section will display only the particular weather for the next hour and exit the section
Since weather.com uses a separate tag for the current weather, you can view it only by typing the command weather now.
Exiting the app:
Please try to use only the EXIT command to exit the app, you can use CTRL-Z ent or CTRL-C to exit but these exit methods create issues when in the loc -p section.
If CTRL-C or CTRL-Z in pressed in the loc -p section, it leads to a corrupt file issue sometimes. The next time you open the app an error will be displayed on the screen.
'''
)
_ = input('Press enter to read more >> ')
print(
'''
Errors:
1. Port connection:
If you try to use the app without access to the internet or have a very slow connection. Sometimes you'll get a port connection error
Make sure you're connected to the internet or just wait for sometime for the issue to get resolved
2. File error:
As mentioned in the above section (exiting the app), CTRL-Z ent or CTRL-C can produce errors when used in the loc -p section.
When this occurs the app will close automatically and the next time you open it, the app will be reset meaning that you'd have to enter your permanent location again.
Other than that there's no major issue using CTRL-Z ent or CTRL-C
3. Requests error:
This error can only occur if you modify the contents of any of the location files.
If this occurs, make sure to delete the gotloc.txt file when launching the application again.
'''
)
_ = input('Press enter to exit help >> ')
|
class TimelineService(object):
@classmethod
def get_timeline(cls, officer_allegations):
allegations_date = officer_allegations\
.values_list('allegation__incident_date_only', 'start_date')\
.order_by('allegation__incident_date')
items = []
for date in allegations_date:
if not date[0] and date[1]:
items.append(date[1])
elif date[0]:
items.append(date[0])
return sorted(items)
|
l = [int(e) for e in input().split()]
for i in range(1, len(l), 2):
l[i], l[i - 1] = l[i - 1], l[i]
[print(n) for n in l]
|
# Description
# You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells). The island doesn't have "lakes" (water inside that isn't connected to the water around the island). One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.
# Example
# [[0,1,0,0],
# [1,1,1,0],
# [0,1,0,0],
# [1,1,0,0]]
# Answer: 16
class Solution:
"""
@param grid: a 2D array
@return: the perimeter of the island
"""
def islandPerimeter(self, grid):
# Write your code here
count = 0
for y in range(len(grid)):
for x in range(len(grid[0])):
if grid[y][x]:
if x == 0:
count = count + 1
elif grid[y][x-1] == 0:
count = count + 1
if y == 0:
count = count + 1
elif grid[y-1][x] == 0:
count = count + 1
if x == len(grid[0])-1:
count = count + 1
elif grid[y][x+1] == 0:
count = count + 1
if y == len(grid)-1:
count = count + 1
elif grid[y+1][x] == 0:
count = count + 1
return count |
# 94. Binary Tree Inorder Traversal
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# recursive
def inorderTraversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
ans = []
def helper(root):
if root.left: helper(root.left)
ans.append(root.val)
if root.right: helper(root.right)
if root: helper(root)
return ans
# iterative
def inorderTraversal2(self, root):
stack, ans = [], []
curr = root
while curr or stack:
while curr:
stack.append(curr)
curr = curr.left
curr = stack.pop()
ans.append(curr.val)
curr = curr.right
return ans
sol = Solution()
root = TreeNode(1)
root.left = TreeNode(2)
root.right = TreeNode(3)
root.left.left = TreeNode(4)
root.left.right = TreeNode(5)
root.right.left = TreeNode(6)
root.right.right = TreeNode(7)
print(sol.inorderTraversal2(root))
|
tag = list(map(str, (input())))
vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
if tag[2] in vowels:
print("invalid")
else:
if (int(tag[0])+int(tag[1]))%2==0 and (int(tag[3])+int(tag[4]))%2==0 and (int(tag[4])+int(tag[5]))%2==0 and (int(tag[7])+int(tag[8]))%2==0:
print("valid")
else:
print("invalid") |
__all__ = ['Simple']
class Simple(object):
def __init__(self, func):
self.func = func
def __call__(self, inputs, params, other):
return self.forward(inputs)
def forward(self, inputs):
return self.func(inputs), None
def backward(self, grad_out, cache):
return grad_out
|
class Stats:
def getLevelStats():
return [
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Str",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Mag",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
"Def",
]
def getAp():
return [
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"Ap",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
"Ap",
"",
]
def getBonusStats():
return ["HP"]*20+["MP"]*4+["Armor"]*3 +["Accessory"]*3+["Item"]*5+["Drive"]*6 # Added missing drive gauge up and mp up |
#1. Kod
l=[[1,'a',['cat'],2],[[[3]],'dog'],4,5]
m = []
def flaten(x):
for i in x:
if type(i) == list:
flaten(i)
else:
m.append(i)
flaten(l)
print(m)
[1, 'a', 'cat', 2, 3, 'dog', 4, 5]
#2.Kod
a = [[1, 2], [3, 4], [5, 6, 7]]
l=[]
for i in range(0,len(a)):
a[i].reverse()
l.append(a[i])
l.reverse()
print(l)
[[7, 6, 5], [4, 3], [2, 1]]
|
def anagramSolution(s1,s2):
c1 = {}
for i in s1:
if i in c1:
c1[i] = c1[i] + 1
else:
c1[i] = 1
for i in s2:
anagram = True
if i not in c1:
anagram = False
return anagram
return anagram
print(anagramSolution('apple','pleap')) |
slimearm = Actor('alien')
slimearm.topright = 0, 10
WIDTH = 712
HEIGHT = 508
def draw():
screen.fill((240, 6, 253))
slimearm.draw()
def update():
slimearm.left += 2
if slimearm.left > WIDTH:
slimearm.right = 0
def on_mouse_down(pos):
if slimearm.collidepoint(pos):
set_alien_hurt()
else:
print("you missed me!")
def set_alien_hurt():
print("Eek!")
sounds.eep.play()
slimearm.image = 'alien_hurt'
clock.schedule_unique(set_alien_normal, 1.0)
def set_alien_normal():
slimearm.image = 'alien' |
class StringMult:
def times(self, sFactor, iFactor):
if(sFactor == ""):
return ""
elif(iFactor == 0):
return ""
elif(iFactor > 0):
return sFactor * iFactor
else:
reverse = sFactor[::-1]
return reverse * abs(iFactor)
|
#for loop + while loop看似两层循环, 但是while loop只会出现在n-1 is None的情况下 所以 整体时间复杂度O(n)
class Solution:
def longestConsecutive(self, nums: List[int]) -> int:
num_set = set(nums)
ret = 0
for num in num_set:
if num - 1 not in num_set:
cur_len = 1
while num + 1 in num_set:
cur_len += 1
num += 1
ret = max(ret, cur_len)
return ret
|
#Calculate number of distinct characters in a string using a for loop.
def unique_count(word):
k=list()
b = word.split()
b = ''.join(b)
for x in b:
if x not in k:
k.append(x)
return len(k)
enter=input()
print('унікальних символів:',unique_count(enter))
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
class Chapter:
def __init__(
self,
client,
json_data,
):
"""
Constructs all the necessary attributes for the Chapter object.
Parameters
----------
json_data : json
data in json format.
"""
self.__json = json_data
self.chapter_number = int(json_data["chapter_number"])
self.chapter_summary = json_data["chapter_summary"]
self.name = json_data["name"]
self.verses_count = json_data["verses_count"]
self.name_meaning = json_data["name_meaning"]
self.name_translation = json_data["name_translation"]
self.client = client
self.name_transliterated = json_data["name_transliterated"]
self.name_meaning = json_data["name_meaning"]
def json(self):
return self.__json
def __str__(self):
"""Returns the name of chapter."""
return self.name
|
numbers = [int(el) for el in input().split()]
average = sum(numbers) / (len(numbers))
top_5_list = []
current_max = 0
for num in range(5):
current_max = max(numbers)
if current_max > average:
top_5_list.append(current_max)
numbers.remove(current_max)
list(top_5_list)
if top_5_list:
print(*top_5_list)
else:
print("No") |
class Solution:
def uniquePathsIII(self, grid) -> int:
start=list()
paths=set()
row=len(grid)
col=len(grid[0])
for r in range(row):
for c in range(col):
if grid[r][c]==1:
start.append(r)
start.append(c)
if grid[r][c]==0:
paths.add(self.generateNext(r,c))
res=set()
self.dfs("",[start],start,res,grid,paths)
return len(res)
def dfs(self,path,visited, cur,res,grid, paths):
row = len(grid)
col = len(grid[0])
if grid[cur[0]][cur[1]]==2:
if len(paths)==0:
res.add(path)
return
if grid[cur[0]][cur[1]]==-1:
return
steps=[[-1,0],[0,-1],[0,1],[1,0]]
for step in steps:
nextr=cur[0]+step[0]
nextc=cur[1]+step[1]
if nextr>-1 and nextr<row and nextc>-1 and nextc<col and [nextr,nextc] not in visited:
curs=self.generateNext(nextr,nextc)
paths.discard(curs)
self.dfs(path+curs,visited+[[nextr,nextc]],[nextr,nextc],res,grid,paths)
if grid[nextr][nextc]==0:
paths.add(curs)
def generateNext(self,r,c):
return "("+str(r)+","+str(c)+")"
if __name__ == '__main__':
sol=Solution()
# grid=[[1,0,0,0],[0,0,0,0],[0,0,2,-1]]
grid=[[1,0,0,0],[0,0,0,0],[0,0,0,2]]
print(sol.uniquePathsIII(grid))
|
def print_multiples(n, high):
for i in range(1, high+1):
print(n * i, end=" ")
print()
def print_mult_table(high):
for i in range(1, high+1):
print_multiples(i, i)
print_mult_table(7)
|
# -*- coding: utf-8 -*-
thislist = ["banana", "Orange", "Kiwi", "cherry"]
thislist.sort(key = str.lower)
print(thislist)
|
"""
None
"""
class Solution:
def wordsAbbreviation(self, dict: List[str]) -> List[str]:
def shorten(word, idx):
return word if idx > len(word) - 3 else \
word[:idx] + str(len(word)-1-idx) + word[-1]
res = [shorten(word, 1) for word in dict]
pre = {word : 1 for word in dict}
n = len(dict)
for i in range(n):
while True:
duplicate = [j for j in range(i, n) if res[i] == res[j]]
if len(duplicate) == 1: break
for k in duplicate:
pre[dict[k]] += 1
res[k] = shorten(dict[k], pre[dict[k]])
return res
|
#!/usr/bin/python3.6
# This should be introduced in the interactive python shell. Where the arguments to print should just be passed to the shell.
# We should keep it to the 4 basic arithmetic functions at first since most kids don't get introduced to other functions until later.
print(2 + 2)
print(3 - 2)
print(2 * 3)
# Introduce the concept integer numbers and floating point numbers.
print(8 / 5)
# Introducing variables...
x = 10
print(x)
y = 5
# We can apply arithmetic operations to our variables.
print(x * y)
print(x - y)
# At this point we will introduce an error by calling a variable that has not been defined yet IE 'k'.
# Explain the output caused by the error and how it can be useful to debug a program
|
"""
Data acquisition boards
=======================
.. todo:: Data acquisition board drivers.
Provides:
.. autosummary::
:toctree:
daqmx
"""
|
#
# PySNMP MIB module Wellfleet-SWSMDS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Wellfleet-SWSMDS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:41:47 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, SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
IpAddress, enterprises, Opaque, Counter32, mgmt, NotificationType, ObjectIdentity, ModuleIdentity, Bits, Gauge32, Unsigned32, Integer32, mib_2, NotificationType, Counter64, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "enterprises", "Opaque", "Counter32", "mgmt", "NotificationType", "ObjectIdentity", "ModuleIdentity", "Bits", "Gauge32", "Unsigned32", "Integer32", "mib-2", "NotificationType", "Counter64", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "MibIdentifier")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
wfSmdsSwGroup, = mibBuilder.importSymbols("Wellfleet-COMMON-MIB", "wfSmdsSwGroup")
wfSmdsSwSubTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1), )
if mibBuilder.loadTexts: wfSmdsSwSubTable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubTable.setDescription('The Wellfleet SMDS Switch Circuit (SNI, subscriber) Record. This record holds information on a per circuit (SSI, SNI, subscriber) basis.')
wfSmdsSwSubEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1), ).setIndexNames((0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwSubCct"))
if mibBuilder.loadTexts: wfSmdsSwSubEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubEntry.setDescription('Per Wellfleet circuit SMDS Switch configuration parameters and counters. This table contains Subscriber-Network Interface (SNI) parameters and state variables, one entry per SIP port.')
wfSmdsSwSubDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubDelete.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubDelete.setDescription('create/delete parameter, dflt = created')
wfSmdsSwSubDisable = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubDisable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubDisable.setDescription('enable/disable parameter, dflt = enabled')
wfSmdsSwSubState = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("init", 3), ("notpresent", 4))).clone('notpresent')).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubState.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubState.setDescription('SMDS Switch state variable, Up, Down Init, Not Present')
wfSmdsSwSubCct = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1023))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubCct.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubCct.setDescription('cct number for this instance')
wfSmdsSwSubDisableHrtbtPoll = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubDisableHrtbtPoll.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubDisableHrtbtPoll.setDescription('determine use of DXI heartbeat poll')
wfSmdsSwSubHrtbtPollAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("cpe", 1), ("net", 2))).clone('net')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubHrtbtPollAddr.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubHrtbtPollAddr.setDescription('determine if heartbeat poll messages are sent as as CPE or network (CSU/DSU) messages.')
wfSmdsSwSubHrtbtPollInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(6, 2147483647)).clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubHrtbtPollInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubHrtbtPollInterval.setDescription("heartbeat polling messages get sent every this many seconds - we don't want the polling interval to be less than or equal to the no-acknowledgment timer.")
wfSmdsSwSubHrtbtPollDownCount = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10)).clone(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubHrtbtPollDownCount.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubHrtbtPollDownCount.setDescription('if this many consecutive heartbeat polling messages go unacknowledged, log an event declaring the line down')
wfSmdsSwSubDisableNetMgmt = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubDisableNetMgmt.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubDisableNetMgmt.setDescription('determine use of LMI network management')
wfSmdsSwSubInterfaceType = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("sni", 1), ("ssi", 2))).clone('sni')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubInterfaceType.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInterfaceType.setDescription('defines whether this interface is a SNI or SSI.')
wfSmdsSwSubInterfaceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 11), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubInterfaceIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInterfaceIndex.setDescription('The index number for the SSI/SNI. Each SNI in the network has a unique id. The value of this object identifies the SIP port interface for which this entry contains management information.')
wfSmdsSwSubDisableL3PduChecks = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubDisableL3PduChecks.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubDisableL3PduChecks.setDescription('Enable/Disable L3_PDU verification. Default is disabled.')
wfSmdsSwSubDisableUsageGeneration = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubDisableUsageGeneration.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubDisableUsageGeneration.setDescription('enable/disable usage data generation. Default is disabled.')
wfSmdsSwSubDisableMIR = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubDisableMIR.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubDisableMIR.setDescription('enable/disable MIR enforcement, default is disabled.')
wfSmdsSwSubUnassignedSAs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 15), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubUnassignedSAs.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubUnassignedSAs.setDescription('The total number of SIP Level 3 PDUs discarded by the SMDS Switch because the Source Address was not assigned to the SNI.')
wfSmdsSwSubSAScreenViolations = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSAScreenViolations.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSAScreenViolations.setDescription('The number of SIP L3_PDUs that violated the address screen based on source address screening for an SNI.')
wfSmdsSwSubDAScreenViolations = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubDAScreenViolations.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubDAScreenViolations.setDescription('The total number of SIP Level 3 PDUs that violated the Destination Address Screening using either an Individual Address Screen or a Group Address Screen for the SNI.')
wfSmdsSwSubNumPDUExceededMIR = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 18), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubNumPDUExceededMIR.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubNumPDUExceededMIR.setDescription('The total number of SIP L3_PDUs that exceeded the MIR on this interface.')
wfSmdsSwSubSipL3ReceivedIAs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 19), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSipL3ReceivedIAs.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSipL3ReceivedIAs.setDescription('The total number of individually addressed SIP Level 3 PDUs received by the SMDS Switch from the CPE. The total includes only unerrored L3PDUs.')
wfSmdsSwSubSipL3ReceivedGAs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 20), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSipL3ReceivedGAs.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSipL3ReceivedGAs.setDescription('The total number of group addressed SIP Level 3 PDUs received by the SMDS Switch from the CPE. The total includes only unerrored L3PDUs.')
wfSmdsSwSubSipL3UnrecIAs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 21), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSipL3UnrecIAs.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSipL3UnrecIAs.setDescription('The number of SIP Level 3 PDUs received by the SMDS Switch from the CPE that have an unknown, valid, individual SMDS Destination Address.')
wfSmdsSwSubSipL3UnrecGAs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 22), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSipL3UnrecGAs.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSipL3UnrecGAs.setDescription('The number of SIP Level 3 PDUs received by the SMDS Switch from the CPE that have an unknown, valid, group SMDS Destination Address.')
wfSmdsSwSubSipL3SentIAs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 23), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSipL3SentIAs.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSipL3SentIAs.setDescription('The number of individually addressed SIP Level 3 PDUs that have been sent by this SMDS Switch to the CPE.')
wfSmdsSwSubSipL3SentGAs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 24), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSipL3SentGAs.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSipL3SentGAs.setDescription('The number of group addressed SIP L3PDUs that have been sent by this SMDS Switch to the CPE.')
wfSmdsSwSubSipL3Errors = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 25), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSipL3Errors.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSipL3Errors.setDescription('The total number of SIP Level 3 PDUs received by the SMDS Switch from the CPE that were discovered to have protocol errors.')
wfSmdsSwSubSipL3InvAddrTypes = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 26), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSipL3InvAddrTypes.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSipL3InvAddrTypes.setDescription('The total number of SIP Level 3 PDUs received by the SMDS Switch from the CPE that had a value in the Source or Destination Address type subfield other than group or individual. Or if the Source Address type subfield value indicates a group address.')
wfSmdsSwSubSipL3VersionSupport = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("version", 1))).clone('version')).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSipL3VersionSupport.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSipL3VersionSupport.setDescription('A value which indicates the version(s) of SIP that this SNI supports. The value is a sum. This sum initially takes the value zero. For each version, V, that this interface supports, 2 raised to (V - 1) is added to the sum. For example, a port supporting versions 1 and 2 would have a value of (2^(1-1)+2^(2-1))=3. The SipL3VersionSupport is effectively a bit mask with Version 1 equal to the least significant bit (LSB).')
wfSmdsSwSubSAScrnViolationOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 28), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSAScrnViolationOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSAScrnViolationOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded as a result of a Source Address violation.')
wfSmdsSwSubDAScrnViolationOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 29), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubDAScrnViolationOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubDAScrnViolationOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded as a result of a Destination Address violation.')
wfSmdsSwSubUnassignedSAOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 30), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubUnassignedSAOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubUnassignedSAOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded as a result of a unassigned Source Address.')
wfSmdsSwSubSAErrorOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 31), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubSAErrorOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubSAErrorOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded because of a Source Address Field Format error.')
wfSmdsSwSubDAErrorOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 32), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubDAErrorOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubDAErrorOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded because of a Destination Address Field Format error.')
wfSmdsSwSubInvalidBASizeOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 33), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubInvalidBASizeOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInvalidBASizeOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded because of an invalid BASize field value.')
wfSmdsSwSubInvalidHELenOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 34), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubInvalidHELenOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInvalidHELenOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded because of an invalid Header Extension Length Field value.')
wfSmdsSwSubInvalidHEVerOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 35), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubInvalidHEVerOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInvalidHEVerOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded because of an invalid Header Extension Version element.')
wfSmdsSwSubInvalidHECarOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 36), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubInvalidHECarOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInvalidHECarOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded because of an invalid Header Extension Carrier element.')
wfSmdsSwSubInvalidHEPadOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 37), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubInvalidHEPadOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInvalidHEPadOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded because of an invalid Header Extension Pad element.')
wfSmdsSwSubBEtagOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 38), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubBEtagOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubBEtagOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded because of a Beginning-End Tag mismatch.')
wfSmdsSwSubBAsizeNELenOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 39), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubBAsizeNELenOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubBAsizeNELenOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded because the BAsize and Length fields are not equal.')
wfSmdsSwSubIncorrectLenOccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 40), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubIncorrectLenOccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubIncorrectLenOccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded because of an incorrect length.')
wfSmdsSwSubExceededMIROccur = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 41), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubExceededMIROccur.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubExceededMIROccur.setDescription('A string containing the SMDS Source Address, Destination Address, and Event time of the most recent occurance of an L3_PDU discarded because it exceeded the MIR.')
wfSmdsSwSubInBandMgmtDisable = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 42), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtDisable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtDisable.setDescription('In-Band Management enable/disable parameter. This attribute indicates whether the local WSNI (only) is enabled to run IP in Host mode, for in-band management purposes, in additional to being a switch interface. The default is disabled')
wfSmdsSwSubInBandMgmtLocalAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 43), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtLocalAddr.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtLocalAddr.setDescription('Special SMDS E.164 Individual address that identifies this local circuit. This attribute is only used when the wfSmdsSwSubInBandMgmtDisable attribute is set to ENABLED')
wfSmdsSwSubInBandMgmtReceivedPDUs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 44), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtReceivedPDUs.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtReceivedPDUs.setDescription('The total number of individually addressed In-Band Management PDUs received by the SMDS Switch from the CPE. The total includes only unerrored PDUs.')
wfSmdsSwSubInBandMgmtSentPDUs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 45), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtSentPDUs.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtSentPDUs.setDescription('The number of individually addressed In-Band Management PDUs that have been sent by this SMDS Switch to the CPE.')
wfSmdsSwSubInBandMgmtMaxLenErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 46), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtMaxLenErrors.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtMaxLenErrors.setDescription('The number of In-Band Management PDUs that have exceeded the MTU size configured for the line')
wfSmdsSwSubInBandMgmtEncapsErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 47), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtEncapsErrors.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubInBandMgmtEncapsErrors.setDescription('The number of In-Band Management PDUs that have invalid encapsulation schemes')
wfSmdsSwSubGAPartialResolve = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 48), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubGAPartialResolve.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubGAPartialResolve.setDescription("The number of times group addressed L3_PDU's could not be resolved due to congestion.")
wfSmdsSwSubDANotOnSni = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 1, 1, 49), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSubDANotOnSni.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSubDANotOnSni.setDescription('The number of times a L3_PDU was discarded at the egress because the destination address was not assigned to the SNI.')
wfSmdsSwEndpTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 2), )
if mibBuilder.loadTexts: wfSmdsSwEndpTable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwEndpTable.setDescription('The Parameters for the Endpoint table. An Endpoint is defined as an IP address, SMDS E.164 address pair. Endpoint ranges should never overlap.')
wfSmdsSwEndpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 2, 1), ).setIndexNames((0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwEndpE164AddrHigh"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwEndpE164AddrDelta"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwEndpInterfaceIndex"))
if mibBuilder.loadTexts: wfSmdsSwEndpEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwEndpEntry.setDescription('The parameters for a particular Endpoint.')
wfSmdsSwEndpDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwEndpDelete.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwEndpDelete.setDescription('Indication to delete this endpoint entry.')
wfSmdsSwEndpE164AddrHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwEndpE164AddrHigh.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwEndpE164AddrHigh.setDescription('The High end of the E.164 address range for this endpoint information.')
wfSmdsSwEndpE164AddrDelta = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 2, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwEndpE164AddrDelta.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwEndpE164AddrDelta.setDescription('The difference between wfSmdsSwEndpE164AddrHigh to the beginning of the endpoint information.')
wfSmdsSwEndpInterfaceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 2, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwEndpInterfaceIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwEndpInterfaceIndex.setDescription('This number indicates which SNI the endpoint information refers to.')
wfSmdsSwInterfaceTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 3), )
if mibBuilder.loadTexts: wfSmdsSwInterfaceTable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwInterfaceTable.setDescription('This is the Interface Table. This table also holds the Maximum Information Rate (MIR) information.')
wfSmdsSwInterfaceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 3, 1), ).setIndexNames((0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwInterfaceType"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwInterfaceIndex"))
if mibBuilder.loadTexts: wfSmdsSwInterfaceEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwInterfaceEntry.setDescription('This table defines the IP addresses and what interfaces they are associated with.')
wfSmdsSwInterfaceDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwInterfaceDelete.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwInterfaceDelete.setDescription('Indication to delete this interface entry.')
wfSmdsSwInterfaceType = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("sni", 1), ("ssi", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwInterfaceType.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwInterfaceType.setDescription('This number determines whether the interface information refers to an SNI, SSI, or ICI.')
wfSmdsSwInterfaceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 3, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwInterfaceIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwInterfaceIndex.setDescription('This number indicates which SNI, SSI, or ICI the interface information refers to.')
wfSmdsSwInterfaceIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 3, 1, 4), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwInterfaceIpAddr.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwInterfaceIpAddr.setDescription('IP Address associated with the interface.')
wfSmdsSwInterfaceMIR = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 3, 1, 5), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwInterfaceMIR.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwInterfaceMIR.setDescription('This number represents the MIR in octets per second.')
wfSmdsSwInterfaceCurrentRate = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 3, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwInterfaceCurrentRate.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwInterfaceCurrentRate.setDescription('This number indicates the current rate of traffic flow to the interface. The software updates this counter. When this attribute exceeds wfSmdsSwInterfaceMIR traffic to the interface is dropped. Periodically the sofware resets this counter to zero.')
wfSmdsSwAssocScrnTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 4), )
if mibBuilder.loadTexts: wfSmdsSwAssocScrnTable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwAssocScrnTable.setDescription('This list identifies the associated SNI addresses per individualand group address screen. Different addresses on an SNI may be associated with different individual and group address screens (one individual address screen per associated address on an SNI, and one group address screen per associated address on an SNI ).')
wfSmdsSwAssocScrnEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 4, 1), ).setIndexNames((0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwAssocScrnSniIndex"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwAssocScrnAddrInd"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwAssocScrnIndivIndex"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwAssocScrnGrpIndex"))
if mibBuilder.loadTexts: wfSmdsSwAssocScrnEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwAssocScrnEntry.setDescription('An SNI index, group and individual screening list index, and the associated addresses for the SNI for the address screens.')
wfSmdsSwAssocScrnDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 4, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwAssocScrnDelete.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwAssocScrnDelete.setDescription('Indication to delete this associated screen entry.')
wfSmdsSwAssocScrnSniIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 4, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwAssocScrnSniIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwAssocScrnSniIndex.setDescription('The value of this object identifies the SIP Port interface for which this entry contains management information. The value of this object for a particular interface has the same value as the ifIndex, defined in RFC1213, for the same interface.')
wfSmdsSwAssocScrnAddrInd = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 4, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwAssocScrnAddrInd.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwAssocScrnAddrInd.setDescription('The value of this object identifies one of the SMDS addresses for the SNI, identified by the wfSmdsSwAssocScrnSniIndex that belongs to this individual (or group) address screen (wfSmdsSwAssocScrnAddrInd). This list will contain both individual and group addresses, because this list is used for both Destination Address Screening and Source Address Screening; the destination address in the L3_PDU that is undergoing Source Address Screening may be either a group or individual address that is assigned to that SNI. One screen will have a maximum of 64 associated addresses; up to a maximum of 16 individual addresses identifying an SNI and up to a maximum of 48 group addresses identifying an SNI.')
wfSmdsSwAssocScrnIndivIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwAssocScrnIndivIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwAssocScrnIndivIndex.setDescription('The value of this object identifies the individual address screening list. There is at least one individual address screen and at most s individual address screens per SNI. The initial value of s is defined to be 4. In the future more screening lists per SNI may be allowed. The values of this object correspond to the values of wfSmdsSwIAScrnIndex in the wfSmdsSwIAScrnTable.')
wfSmdsSwAssocScrnGrpIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwAssocScrnGrpIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwAssocScrnGrpIndex.setDescription('The value of this object identifies the group address screening list. There is at least one group address screen and at most s group address screens per SNI. The initial value of s is defined to be 4. In the future more screening lists per SNI may be allowed. The values of this object correspond to the values of wfSmdsSwGAScrnIndex in the wfSmdsSwGAScrnTable. This field applies only to individual addresses on the SNI because it applies only to destination address screening of group addresses.')
wfSmdsSwIAScrnTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 5), )
if mibBuilder.loadTexts: wfSmdsSwIAScrnTable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwIAScrnTable.setDescription('This list identifies the individual addresses that will be screened per individual address screen table. The are up to s (s is equal to 4) individual address screens per SNI and at least one individual address screen per SNI. The Individual Address Screens and the Group Address Screens together consist of up to n addresses. The initial value of n is defined as 128. In the future a value of n up to 2048 may be supported. The Individual Address Screen is used to perform Destination Address Screening for individually addressed data units and Source Address Screening for all data units. The Group Address Screen is used to perform Destination Address Screening for group addressed data units.')
wfSmdsSwIAScrnEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 5, 1), ).setIndexNames((0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwIAScrnSniIndex"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwIAScrnIndex"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwIAScrnAddr"))
if mibBuilder.loadTexts: wfSmdsSwIAScrnEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwIAScrnEntry.setDescription('An SNI index, a screening list index, the individual addresses to be screened for the individual address screen, and whether the screened address is valid or invalid.')
wfSmdsSwIAScrnDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 5, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwIAScrnDelete.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwIAScrnDelete.setDescription('Indication to delete this IA screen entry.')
wfSmdsSwIAScrnSniIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 5, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwIAScrnSniIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwIAScrnSniIndex.setDescription('The value of this object identifies the SIP Port interface for which this entry contains management information. The value of this object for a particular interface has the same value as the ifIndex, defined in RFC1213, for the same interface.')
wfSmdsSwIAScrnIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 5, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwIAScrnIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwIAScrnIndex.setDescription('The value of this object identifies the individual address screening list. There are at least one individual address screen and at most s individual address screens per SNI. The initial value of s is defined to be 4. In the future more screening lists per SNI may be allowed. The values of this object correspond to the values of wfSmdsSwScrnIndex in the wfSmdsSwScrnTable.')
wfSmdsSwIAScrnAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 5, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwIAScrnAddr.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwIAScrnAddr.setDescription('The value of this object identifies one of the individual addresses to be screened for source and destination address screening for the SNI identified by the wfSmdsSwIAScrnSniIndex and for the particular individual address screen (wfSmdsSwIAScrnIndex).')
wfSmdsSwGAScrnTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 6), )
if mibBuilder.loadTexts: wfSmdsSwGAScrnTable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGAScrnTable.setDescription('This list identifies the group addresses that will be screened per group address screen table. The are up to s (s is equal to 4) group address screens per SNI and at least one group address screen per SNI. The Individual Address Screen and the Group Address Screen together consist of up to n addresses. The initial value of n is defined as 128. In the future a value of n up to 2048 may be supported. The Individual Address Screen is used to perform Destination Address Screening for individually addressed data units and Source Address Screening for all data units. The Group Address Screen is used to perform Destination Address Screening for group addressed data units.')
wfSmdsSwGAScrnEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 6, 1), ).setIndexNames((0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwGAScrnSniIndex"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwGAScrnIndex"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwGAScrnAddr"))
if mibBuilder.loadTexts: wfSmdsSwGAScrnEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGAScrnEntry.setDescription('An SNI index, a screening list index, the group addresses to be screened for the group address screen, and whether the screened address is valid or invalid.')
wfSmdsSwGAScrnDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 6, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwGAScrnDelete.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGAScrnDelete.setDescription('Indication to delete this GA screen entry.')
wfSmdsSwGAScrnSniIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 6, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwGAScrnSniIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGAScrnSniIndex.setDescription('The value of this object identifies the SIP Port interface for which this entry contains management information. The value of this object for a particular interface has the same value as the ifIndex, defined in RFC1213, for the same interface.')
wfSmdsSwGAScrnIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 6, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwGAScrnIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGAScrnIndex.setDescription('The value of this object identifies the group address screening list. There is at least one group address screen and at most s group address screens per SNI. The initial value of s is defined to be 4. In the future more screening lists per SNI may be allowed. The values of this object correspond to the values of wfSmdsSwScrnIndex in the wfSmdsSwSmdsScrnTable.')
wfSmdsSwGAScrnAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 6, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwGAScrnAddr.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGAScrnAddr.setDescription('The value of this object identifies one of the group addresses to be screened for destination address screening for the SNI identified by the wfSmdsSwGAScrnSniIndex and for the particular group address screen (wfSmdsSwGAScrnIndex).')
wfSmdsSwGATable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 7), )
if mibBuilder.loadTexts: wfSmdsSwGATable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGATable.setDescription('A table of all group addresses in the network and the associated individual addresses identified by each group address. A group address identifies up to m individual addresses. An SMDS SS supports up to n group addresses. A group address can be identified by up to p individual addresses. A particular SNI is identified by up to 48 group addresses. The initial values of m, n, and p are defined as 128, 1024, and 32, respectively. In the future values of m and n of 2048 and 8192, respectively, may be supported.')
wfSmdsSwGAEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 7, 1), ).setIndexNames((0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwGASSI"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwGAGroupAddress"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwGAGroupMember"))
if mibBuilder.loadTexts: wfSmdsSwGAEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGAEntry.setDescription('A Group Address and an address in that group and whether that association is valid or invalid.')
wfSmdsSwGADelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 7, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwGADelete.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGADelete.setDescription('Indication to delete this group address entry.')
wfSmdsSwGASSI = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 7, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwGASSI.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGASSI.setDescription('The SSI associated with this Group Address. An SSI of 0 is used to indicate that all interfaces can use the group address. An SSI other than 0 indicates that only the SSI, or an SNI associated with the SSI should use the group.')
wfSmdsSwGAGroupAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 7, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwGAGroupAddress.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGAGroupAddress.setDescription('A Group Address.')
wfSmdsSwGAGroupMember = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 7, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwGAGroupMember.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwGAGroupMember.setDescription('An individual SMDS address that belongs to this Group Address.')
wfSmdsSwCurUsageTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 8), )
if mibBuilder.loadTexts: wfSmdsSwCurUsageTable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwCurUsageTable.setDescription('This table contains the Current Usage Data. This is the interface between Billing and Switching. The Switch gates create these records. The Billing gates collect them to create billing data.')
wfSmdsSwCurUsageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 8, 1), ).setIndexNames((0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwCurUsageSni"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwCurUsageDestAddr"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwCurUsageSrcAddr"))
if mibBuilder.loadTexts: wfSmdsSwCurUsageEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwCurUsageEntry.setDescription('The usage data for the current usage period indexed by destination,source address.')
wfSmdsSwCurUsageDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 8, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwCurUsageDelete.setStatus('obsolete')
if mibBuilder.loadTexts: wfSmdsSwCurUsageDelete.setDescription('Indication to delete this current usage entry.')
wfSmdsSwCurUsageSni = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 8, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwCurUsageSni.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwCurUsageSni.setDescription('The SNI number of the interface generating the usage information')
wfSmdsSwCurUsageDestAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 8, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwCurUsageDestAddr.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwCurUsageDestAddr.setDescription('The destination address of a SMDS group or individual E.164 address.')
wfSmdsSwCurUsageSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 8, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwCurUsageSrcAddr.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwCurUsageSrcAddr.setDescription('The source address of a SMDS individual E.164 address.')
wfSmdsSwCurUsageGrpIndAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 8, 1, 5), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwCurUsageGrpIndAddr.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwCurUsageGrpIndAddr.setDescription('When the destination address of an L3_PDU is a group address, this attribute is set to one of the E.164 individual addresses that is in the group address and on the destination SNI.')
wfSmdsSwCurUsageNumL3Pdu = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 8, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwCurUsageNumL3Pdu.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwCurUsageNumL3Pdu.setDescription('This number represents the number of billable L3_PDUs counted by the circuit during the most recent collection interval.')
wfSmdsSwCurUsageNumOctet = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 8, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwCurUsageNumOctet.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwCurUsageNumOctet.setDescription('This number represents the number of billable octets counted by the circuit during the most recent collection interval.')
wfSmdsSwCurUsageToBeDeleted = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 8, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwCurUsageToBeDeleted.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwCurUsageToBeDeleted.setDescription('Indication to billing to delete this current usage entry.')
wfSmdsSwUsage = MibIdentifier((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9))
wfSmdsSwUsageEnable = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageEnable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageEnable.setDescription('Enable/Disable SMDS_SW billing.')
wfSmdsSwUsageVolume = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 14))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageVolume.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageVolume.setDescription("Indicates the file system volume number to which the billing usage data files will be written. The volume number corresponds to the slot number on which the volume resides. Note: Value 0 has the special meaning that no 'Store' and 'Flush' operations will take place. This translates to no Billing data will be written to the local file system. 'Update' operations will still be performed on each local slot. Full Billing statistics will still be available in the wfSmdsSwUsageTable MIB.")
wfSmdsSwUsageVolumeBackup = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 14))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageVolumeBackup.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageVolumeBackup.setDescription('Indicates the backup volume if wfSmdsSwUsageVolume becomes inoperative. Note: This feature is not implemented in this release.')
wfSmdsSwUsageDirectory = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 4), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageDirectory.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageDirectory.setDescription('The name of the directory where the billing usage data files are stored. ')
wfSmdsSwUsageFilePrefix = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 5), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageFilePrefix.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageFilePrefix.setDescription('The base name of billing usage data files.')
wfSmdsSwUsageTimerInterval = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 60)).clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageTimerInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageTimerInterval.setDescription('This number determines the timer interval (number of seconds) unit for the Billing process to perform its various timer driven tasks. i.e. updating billing usage data, writing billing usage data to file system and file system management activities.')
wfSmdsSwUsageUpdateInterval = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)).clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageUpdateInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageUpdateInterval.setDescription('This number specifies the interval (number of minutes) for the Billing process to collect and update billing usage data in the wfSmdsSwUsage MIB. Note: When converted to seconds, this must be a multiple of wfSmdsSwUsageTimerInterval. ')
wfSmdsSwUsageStoreInterval = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)).clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageStoreInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageStoreInterval.setDescription('This number specifies the interval (number of minutes) for the Billing process to write billing usage data on to the file system from the wfSmdsSwUsage MIB. Note: When converted to seconds, this must be a multiple of wfSmdsSwUsageTimerInterval. ')
wfSmdsSwUsageFlushInterval = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)).clone(60)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageFlushInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageFlushInterval.setDescription('This number specifies the interval (number of minutes) for the Billing process to write billing usage data on to the file system from the wfSmdsSwUsage MIB followed by zeroing the wfSmdsSwUsage MIB. Note: When converted to seconds, this must be a multiple of wfSmdsSwUsageTimerInterval. ')
wfSmdsSwUsageCleanupInterval = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)).clone(60)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageCleanupInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCleanupInterval.setDescription('This is the interval (number of minutes) for the Billing process to check and delete old billing usage data files. Note: When converted to seconds, this must be a multilple of wfSmdsSwUsageTimerInterval. ')
wfSmdsSwUsageLocalTimeZone = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageLocalTimeZone.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageLocalTimeZone.setDescription('Indicates local time zone of the switch')
wfSmdsSwUsageUpdateTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 12), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageUpdateTimeStamp.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageUpdateTimeStamp.setDescription('Time stamp of last wfSmdsSwUsageUpdateInterval timer expiration or the starting time of the current wfSmdsSwUsageUpdateInterval. This value is number of seconds since midnight Jan 1, 1976 (GMT). ')
wfSmdsSwUsageStoreTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 13), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageStoreTimeStamp.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageStoreTimeStamp.setDescription('Time stamp of last wfSmdsSwUsageStoreInterval timer expiration or the starting time of the current wfSmdsSwUsageStoreInterval. This value is number of seconds since midnight Jan. 1, 1976 (GMT). ')
wfSmdsSwUsageFlushTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 14), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageFlushTimeStamp.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageFlushTimeStamp.setDescription('Time stamp of last wfSmdsSwUsageFlushInterval timer expiration or the starting time of the current wfSmdsSwUsageFlushInterval. This value is number of seconds since midnight Jan. 1, 1976 (GMT). ')
wfSmdsSwUsageCleanupTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 15), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageCleanupTimeStamp.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCleanupTimeStamp.setDescription('Time stamp of last wfSmdsSwUsageCleanupInterval timer expiration or the starting time of the current wfSmdsSwUsageCleanupInterval. This value is number of seconds since midnight Jan. 1, 1976 (GMT). ')
wfSmdsSwUsageUpdateData = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 16), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageUpdateData.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageUpdateData.setDescription('Setting this attribute to a non-zero value will cause an immediate updating of the billing usage data. Once activated, this attribute should be reset to zero to allow subsequent activations. ')
wfSmdsSwUsageStoreData = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 17), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageStoreData.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageStoreData.setDescription('Setting this attribute to a non-zero value will cause an immediate updating and writing of the billing usage data. Once activated, this attribute should be reset to zero to allow subsequent activations. ')
wfSmdsSwUsageFlushData = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 18), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageFlushData.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageFlushData.setDescription('Setting this attribute to a non-zero value will cause an immediate updating and writing of the billing usage data and followed by zeroing the wfSmdsSwBillingUsage MIB. Once activated, this attribute should be reset to zero to allow subsequent activations. ')
wfSmdsSwUsageFileCleanup = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 19), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageFileCleanup.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageFileCleanup.setDescription('Setting this attribute to a non-zero value will cause an immediate checking and deleting old billing usage data files. Once activated, this attribute should be reset to zero to allow subsequent activations. ')
wfSmdsSwUsageState = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("init", 3), ("notpresent", 4))).clone('notpresent')).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageState.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageState.setDescription('current state of SMDS_SW billing.')
wfSmdsSwUsageCurVolume = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 14))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageCurVolume.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCurVolume.setDescription('current file system volume number used. This number is the same as wfSmdsSwUsageVolume except when the user sets wfSmdsSwUsageVolume to an invalid number.')
wfSmdsSwUsageCurVolumeBackup = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 22), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 14))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageCurVolumeBackup.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCurVolumeBackup.setDescription('curent backup file system volume number used. This number is the same as wfSmdsSwUsageVolumeBackUp except when the user sets wfSmdsSwUsageVolume to an invalid number. Note: This feature is not implemented in this release.')
wfSmdsSwUsageCurDirectory = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 23), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageCurDirectory.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCurDirectory.setDescription('current directory name used. This number is the same as wfSmdsSwUsageDirectory except when the user sets wfSmdsSwUsageDirectory to an invalid name.')
wfSmdsSwUsageCurFilePrefix = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 24), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageCurFilePrefix.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCurFilePrefix.setDescription('current base file name used. This number is the same as wfSmdsSwUsageFilePrefix except when the user sets wfSmdsSwUsageFilePrefix to an invalid name.')
wfSmdsSwUsageCurTimerInterval = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 25), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 60)).clone(1)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageCurTimerInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCurTimerInterval.setDescription('current timer interval number used. This number is the same as wfSmdsSwUsageTimerInterval except when the user sets wfSmdsSwUsageTimerInterval to an invalid value.')
wfSmdsSwUsageCurUpdateInterval = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 26), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)).clone(10)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageCurUpdateInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCurUpdateInterval.setDescription('current update interval number used. This number is the same as wfSmdsSwUsageUpdateInterval except when the user sets wfSmdsSwUsageUpdateInterval to an invalid value.')
wfSmdsSwUsageCurStoreInterval = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 27), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)).clone(10)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageCurStoreInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCurStoreInterval.setDescription('current store timer interval number used. This number is the same as wfSmdsSwUsageStoreInterval except when the user sets wfSmdsSwUsageStoreInterval to an invalid value.')
wfSmdsSwUsageCurFlushInterval = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 28), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)).clone(60)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageCurFlushInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCurFlushInterval.setDescription('current flush timer interval number used. This number is the same as wfSmdsSwUsageFlushInterval except when the user sets wfSmdsSwUsageFlushInterval to an invalid value.')
wfSmdsSwUsageCurCleanupInterval = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 29), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)).clone(60)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageCurCleanupInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCurCleanupInterval.setDescription('current file cleanup timer interval number used. This number is the same as wfSmdsSwUsageCleanupInterval except when the user sets wfSmdsSwUsageCleanupInterval to an invalid value.')
wfSmdsSwUsageDebug = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwUsageDebug.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageDebug.setDescription('Enable/Disable printing of debug edl (trap) messages. NOTE: Do not enable this attribute in operational enviornment as it will likely flood the logging facility. This attribute is reserved for specialized debugging in a controlled lab enviornment.')
wfSmdsSwUsageCurDebug = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageCurDebug.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageCurDebug.setDescription('current debug value used. This value is the same as wfSmdsSwUsageDebug except when the user sets wfSmdsSwUsageDeubg to an invalid value.')
wfSmdsSwUsageSwitchId = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 32), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageSwitchId.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageSwitchId.setDescription('switch id used in the billing usage data file.')
wfSmdsSwUsageNumEntries = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 9, 33), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageNumEntries.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageNumEntries.setDescription('number of entries in wfSmdsSwUsageTable')
wfSmdsSwUsageTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10), )
if mibBuilder.loadTexts: wfSmdsSwUsageTable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageTable.setDescription('The Billing Usage Table.')
wfSmdsSwUsageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1), ).setIndexNames((0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwUsageSni"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwUsageDestAddr"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwUsageSrcAddr"))
if mibBuilder.loadTexts: wfSmdsSwUsageEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageEntry.setDescription('The parameters for Billing Usage.')
wfSmdsSwUsageDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageDelete.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageDelete.setDescription('Indicates status of this entry. SMDS_SW_USAGE_CREATED is the normal case. SMDS_SW_USAGE_DELETED means this billing instance will be deleted at the end of the next wfSmdsSwUsageFlush period after this billing record is written out to the file system.')
wfSmdsSwUsageSni = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageSni.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageSni.setDescription('The circuit number of the interface generating the usage information')
wfSmdsSwUsageDestAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageDestAddr.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageDestAddr.setDescription('Instance identifier; the destination address of an L3_PDU. The SMDS Switch collects usage data based on the destination/source address pair.')
wfSmdsSwUsageSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageSrcAddr.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageSrcAddr.setDescription('Instance identifier; the source address of an L3_PDU. The SMDS Switch collects usage data based on the destination/source address pair.')
wfSmdsSwUsageStartTimeStampHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageStartTimeStampHigh.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageStartTimeStampHigh.setDescription('Time stamp of the starting time (the high 32 bits) of last billing usage interval. This value is the number of 1/100th seconds since midnight Jan 1, 1976 (GMT).')
wfSmdsSwUsageStartTimeStampLow = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageStartTimeStampLow.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageStartTimeStampLow.setDescription('Time stamp of the starting time (the low 32 bits) of last billing usage interval. This value is the number of 1/100th seconds since midnight Jan 1, 1976 (GMT).')
wfSmdsSwUsageEndTimeStampHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageEndTimeStampHigh.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageEndTimeStampHigh.setDescription('Time stamp of the ending time (the high 32 bits) of last billing usage interval. This value is the number of 1/100th seconds since midnight Jan 1, 1976 (GMT).')
wfSmdsSwUsageEndTimeStampLow = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageEndTimeStampLow.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageEndTimeStampLow.setDescription('Time stamp of the ending time (the low 32 bits) of last billing usage interval. This value is the number of 1/100th seconds since midnight Jan 1, 1976 (GMT).')
wfSmdsSwUsageSentL3PduHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageSentL3PduHigh.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageSentL3PduHigh.setDescription('Number (the high 32 bits) of L3_PDUs sent to the CPE between wfSmdsSwUsageStartTimeStamp and wfSmdsSwUsageEndTimeStamp.')
wfSmdsSwUsageSentL3PduLow = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageSentL3PduLow.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageSentL3PduLow.setDescription('Number (the low 32 bits) of L3_PDUs sent to the CPE between wfSmdsSwUsageStartTimeStamp and wfSmdsSwUsageEndTimeStamp.')
wfSmdsSwUsageSentOctetHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageSentOctetHigh.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageSentOctetHigh.setDescription('Number (the high 32 bits) of octets sent to the CPE between wfSmdsSwUsageStartTimeStamp and wfSmdsSwUsageEndTimeStamp.')
wfSmdsSwUsageSentOctetLow = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageSentOctetLow.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageSentOctetLow.setDescription('Number (the low 32 bits) of octets sent to the CPE between wfSmdsSwUsageStartTimeStamp and wfSmdsSwUsageEndTimeStamp.')
wfSmdsSwUsageLastL3PduHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageLastL3PduHigh.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageLastL3PduHigh.setDescription('The (high 32 bits) value of wfSmdsSwCurUsageNumL3Pdu value at wfSmdsSwUsageEndTimeStamp. Note: Since wfSmdsSwCurUsageNumL3Pdu is a 32-bit COUNTER, this is really a counter keeping track of number of times wfSmdsSwCurUsageNumL3Pdu has wrapped around.')
wfSmdsSwUsageLastL3PduLow = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageLastL3PduLow.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageLastL3PduLow.setDescription('The (low 32 bits) value of wfSmdsSwCurUsageNumL3Pdu value at wfSmdsSwUsageEndTimeStamp.')
wfSmdsSwUsageLastOctetHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 15), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageLastOctetHigh.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageLastOctetHigh.setDescription('The (high 32 bits) value of wfSmdsSwCurUsageNumOctets value at wfSmdsSwUsageEndTimeStamp. Note: Since wfSmdsSwCurUsageNumOctets is a 32-bit COUNTER, this is really a counter keeping track of number of times wfSmdsSwCurUsageNumOctets has wrapped around.')
wfSmdsSwUsageLastOctetLow = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageLastOctetLow.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageLastOctetLow.setDescription('The (low 32 bits) value of wfSmdsSwCurUsageNumOctets value at wfSmdsSwUsageEndTimeStamp.')
wfSmdsSwUsageGrpIndAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 10, 1, 17), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwUsageGrpIndAddr.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwUsageGrpIndAddr.setDescription('When the destination address of an L3_PDU is a group address, this attribute is set to one of the E.164 individual addresses that is in the group address and on the destination SNI.')
wfSmdsSwSsiSniTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 11), )
if mibBuilder.loadTexts: wfSmdsSwSsiSniTable.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSsiSniTable.setDescription("The Parameters for the SSI/SNI Object. This object associates SNI's with SSI's for Bellcore TR-TSV-001239 compliance.")
wfSmdsSwSsiSniEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 11, 1), ).setIndexNames((0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwSsiSniSSI"), (0, "Wellfleet-SWSMDS-MIB", "wfSmdsSwSsiSniSNI"))
if mibBuilder.loadTexts: wfSmdsSwSsiSniEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSsiSniEntry.setDescription('The parameters for a particular SSI/SNI.')
wfSmdsSwSsiSniDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 11, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfSmdsSwSsiSniDelete.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSsiSniDelete.setDescription('Indication to delete this SSI/SNI entry.')
wfSmdsSwSsiSniSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 11, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSsiSniSSI.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSsiSniSSI.setDescription('An SSI.')
wfSmdsSwSsiSniSNI = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 9, 7, 11, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfSmdsSwSsiSniSNI.setStatus('mandatory')
if mibBuilder.loadTexts: wfSmdsSwSsiSniSNI.setDescription('An SNI.')
mibBuilder.exportSymbols("Wellfleet-SWSMDS-MIB", wfSmdsSwCurUsageToBeDeleted=wfSmdsSwCurUsageToBeDeleted, wfSmdsSwUsageUpdateTimeStamp=wfSmdsSwUsageUpdateTimeStamp, wfSmdsSwUsageEndTimeStampLow=wfSmdsSwUsageEndTimeStampLow, wfSmdsSwSubSipL3InvAddrTypes=wfSmdsSwSubSipL3InvAddrTypes, wfSmdsSwUsageSwitchId=wfSmdsSwUsageSwitchId, wfSmdsSwSubUnassignedSAOccur=wfSmdsSwSubUnassignedSAOccur, wfSmdsSwCurUsageDelete=wfSmdsSwCurUsageDelete, wfSmdsSwSubUnassignedSAs=wfSmdsSwSubUnassignedSAs, wfSmdsSwAssocScrnSniIndex=wfSmdsSwAssocScrnSniIndex, wfSmdsSwAssocScrnDelete=wfSmdsSwAssocScrnDelete, wfSmdsSwGASSI=wfSmdsSwGASSI, wfSmdsSwInterfaceType=wfSmdsSwInterfaceType, wfSmdsSwUsageSni=wfSmdsSwUsageSni, wfSmdsSwAssocScrnTable=wfSmdsSwAssocScrnTable, wfSmdsSwSubSipL3VersionSupport=wfSmdsSwSubSipL3VersionSupport, wfSmdsSwIAScrnTable=wfSmdsSwIAScrnTable, wfSmdsSwSubBAsizeNELenOccur=wfSmdsSwSubBAsizeNELenOccur, wfSmdsSwSubCct=wfSmdsSwSubCct, wfSmdsSwSubGAPartialResolve=wfSmdsSwSubGAPartialResolve, wfSmdsSwUsageStoreInterval=wfSmdsSwUsageStoreInterval, wfSmdsSwUsageVolumeBackup=wfSmdsSwUsageVolumeBackup, wfSmdsSwUsageStartTimeStampHigh=wfSmdsSwUsageStartTimeStampHigh, wfSmdsSwIAScrnAddr=wfSmdsSwIAScrnAddr, wfSmdsSwSubSipL3UnrecIAs=wfSmdsSwSubSipL3UnrecIAs, wfSmdsSwUsageStartTimeStampLow=wfSmdsSwUsageStartTimeStampLow, wfSmdsSwUsageLastL3PduLow=wfSmdsSwUsageLastL3PduLow, wfSmdsSwUsageStoreTimeStamp=wfSmdsSwUsageStoreTimeStamp, wfSmdsSwGAScrnDelete=wfSmdsSwGAScrnDelete, wfSmdsSwSubDisableUsageGeneration=wfSmdsSwSubDisableUsageGeneration, wfSmdsSwSubInBandMgmtLocalAddr=wfSmdsSwSubInBandMgmtLocalAddr, wfSmdsSwAssocScrnIndivIndex=wfSmdsSwAssocScrnIndivIndex, wfSmdsSwUsageSentOctetHigh=wfSmdsSwUsageSentOctetHigh, wfSmdsSwSubHrtbtPollAddr=wfSmdsSwSubHrtbtPollAddr, wfSmdsSwSubSipL3Errors=wfSmdsSwSubSipL3Errors, wfSmdsSwSubInBandMgmtEncapsErrors=wfSmdsSwSubInBandMgmtEncapsErrors, wfSmdsSwSubInvalidHELenOccur=wfSmdsSwSubInvalidHELenOccur, wfSmdsSwSubState=wfSmdsSwSubState, wfSmdsSwSubSipL3SentIAs=wfSmdsSwSubSipL3SentIAs, wfSmdsSwUsageUpdateInterval=wfSmdsSwUsageUpdateInterval, wfSmdsSwUsageSrcAddr=wfSmdsSwUsageSrcAddr, wfSmdsSwSubInterfaceIndex=wfSmdsSwSubInterfaceIndex, wfSmdsSwIAScrnIndex=wfSmdsSwIAScrnIndex, wfSmdsSwSubDAScrnViolationOccur=wfSmdsSwSubDAScrnViolationOccur, wfSmdsSwSubInterfaceType=wfSmdsSwSubInterfaceType, wfSmdsSwSsiSniSSI=wfSmdsSwSsiSniSSI, wfSmdsSwUsageCurUpdateInterval=wfSmdsSwUsageCurUpdateInterval, wfSmdsSwUsageFlushTimeStamp=wfSmdsSwUsageFlushTimeStamp, wfSmdsSwSubExceededMIROccur=wfSmdsSwSubExceededMIROccur, wfSmdsSwUsageLastOctetHigh=wfSmdsSwUsageLastOctetHigh, wfSmdsSwSubDANotOnSni=wfSmdsSwSubDANotOnSni, wfSmdsSwGAScrnEntry=wfSmdsSwGAScrnEntry, wfSmdsSwCurUsageEntry=wfSmdsSwCurUsageEntry, wfSmdsSwUsageLocalTimeZone=wfSmdsSwUsageLocalTimeZone, wfSmdsSwInterfaceMIR=wfSmdsSwInterfaceMIR, wfSmdsSwUsageLastOctetLow=wfSmdsSwUsageLastOctetLow, wfSmdsSwInterfaceIndex=wfSmdsSwInterfaceIndex, wfSmdsSwUsageTimerInterval=wfSmdsSwUsageTimerInterval, wfSmdsSwGAScrnAddr=wfSmdsSwGAScrnAddr, wfSmdsSwEndpInterfaceIndex=wfSmdsSwEndpInterfaceIndex, wfSmdsSwGAEntry=wfSmdsSwGAEntry, wfSmdsSwSubIncorrectLenOccur=wfSmdsSwSubIncorrectLenOccur, wfSmdsSwUsageCleanupInterval=wfSmdsSwUsageCleanupInterval, wfSmdsSwCurUsageGrpIndAddr=wfSmdsSwCurUsageGrpIndAddr, wfSmdsSwSubSipL3SentGAs=wfSmdsSwSubSipL3SentGAs, wfSmdsSwSubDelete=wfSmdsSwSubDelete, wfSmdsSwUsageCurStoreInterval=wfSmdsSwUsageCurStoreInterval, wfSmdsSwSsiSniSNI=wfSmdsSwSsiSniSNI, wfSmdsSwCurUsageNumL3Pdu=wfSmdsSwCurUsageNumL3Pdu, wfSmdsSwEndpE164AddrDelta=wfSmdsSwEndpE164AddrDelta, wfSmdsSwGATable=wfSmdsSwGATable, wfSmdsSwUsageCurVolumeBackup=wfSmdsSwUsageCurVolumeBackup, wfSmdsSwUsageCurFlushInterval=wfSmdsSwUsageCurFlushInterval, wfSmdsSwSubEntry=wfSmdsSwSubEntry, wfSmdsSwSubInvalidHEVerOccur=wfSmdsSwSubInvalidHEVerOccur, wfSmdsSwGAScrnSniIndex=wfSmdsSwGAScrnSniIndex, wfSmdsSwSubHrtbtPollDownCount=wfSmdsSwSubHrtbtPollDownCount, wfSmdsSwUsageUpdateData=wfSmdsSwUsageUpdateData, wfSmdsSwUsageDebug=wfSmdsSwUsageDebug, wfSmdsSwIAScrnEntry=wfSmdsSwIAScrnEntry, wfSmdsSwInterfaceTable=wfSmdsSwInterfaceTable, wfSmdsSwSsiSniEntry=wfSmdsSwSsiSniEntry, wfSmdsSwGADelete=wfSmdsSwGADelete, wfSmdsSwUsageState=wfSmdsSwUsageState, wfSmdsSwUsageDirectory=wfSmdsSwUsageDirectory, wfSmdsSwAssocScrnGrpIndex=wfSmdsSwAssocScrnGrpIndex, wfSmdsSwUsageEndTimeStampHigh=wfSmdsSwUsageEndTimeStampHigh, wfSmdsSwSubInBandMgmtSentPDUs=wfSmdsSwSubInBandMgmtSentPDUs, wfSmdsSwEndpDelete=wfSmdsSwEndpDelete, wfSmdsSwUsageSentL3PduHigh=wfSmdsSwUsageSentL3PduHigh, wfSmdsSwUsageSentOctetLow=wfSmdsSwUsageSentOctetLow, wfSmdsSwUsageEntry=wfSmdsSwUsageEntry, wfSmdsSwSubSAErrorOccur=wfSmdsSwSubSAErrorOccur, wfSmdsSwInterfaceIpAddr=wfSmdsSwInterfaceIpAddr, wfSmdsSwIAScrnSniIndex=wfSmdsSwIAScrnSniIndex, wfSmdsSwUsageFilePrefix=wfSmdsSwUsageFilePrefix, wfSmdsSwUsageFlushData=wfSmdsSwUsageFlushData, wfSmdsSwUsageCurFilePrefix=wfSmdsSwUsageCurFilePrefix, wfSmdsSwUsageCurDirectory=wfSmdsSwUsageCurDirectory, wfSmdsSwGAGroupAddress=wfSmdsSwGAGroupAddress, wfSmdsSwAssocScrnEntry=wfSmdsSwAssocScrnEntry, wfSmdsSwSubDAErrorOccur=wfSmdsSwSubDAErrorOccur, wfSmdsSwSubInvalidHECarOccur=wfSmdsSwSubInvalidHECarOccur, wfSmdsSwSubHrtbtPollInterval=wfSmdsSwSubHrtbtPollInterval, wfSmdsSwSsiSniTable=wfSmdsSwSsiSniTable, wfSmdsSwSubSipL3ReceivedGAs=wfSmdsSwSubSipL3ReceivedGAs, wfSmdsSwUsageSentL3PduLow=wfSmdsSwUsageSentL3PduLow, wfSmdsSwAssocScrnAddrInd=wfSmdsSwAssocScrnAddrInd, wfSmdsSwUsageLastL3PduHigh=wfSmdsSwUsageLastL3PduHigh, wfSmdsSwUsageEnable=wfSmdsSwUsageEnable, wfSmdsSwUsageNumEntries=wfSmdsSwUsageNumEntries, wfSmdsSwSubInBandMgmtDisable=wfSmdsSwSubInBandMgmtDisable, wfSmdsSwSubSipL3UnrecGAs=wfSmdsSwSubSipL3UnrecGAs, wfSmdsSwUsageGrpIndAddr=wfSmdsSwUsageGrpIndAddr, wfSmdsSwGAScrnTable=wfSmdsSwGAScrnTable, wfSmdsSwUsageFlushInterval=wfSmdsSwUsageFlushInterval, wfSmdsSwEndpEntry=wfSmdsSwEndpEntry, wfSmdsSwCurUsageNumOctet=wfSmdsSwCurUsageNumOctet, wfSmdsSwUsageCurVolume=wfSmdsSwUsageCurVolume, wfSmdsSwSubSAScrnViolationOccur=wfSmdsSwSubSAScrnViolationOccur, wfSmdsSwUsageTable=wfSmdsSwUsageTable, wfSmdsSwUsageCurTimerInterval=wfSmdsSwUsageCurTimerInterval, wfSmdsSwSubSAScreenViolations=wfSmdsSwSubSAScreenViolations, wfSmdsSwInterfaceDelete=wfSmdsSwInterfaceDelete, wfSmdsSwSubTable=wfSmdsSwSubTable, wfSmdsSwSubDisableNetMgmt=wfSmdsSwSubDisableNetMgmt, wfSmdsSwEndpTable=wfSmdsSwEndpTable, wfSmdsSwSubDisable=wfSmdsSwSubDisable, wfSmdsSwCurUsageSrcAddr=wfSmdsSwCurUsageSrcAddr, wfSmdsSwSubNumPDUExceededMIR=wfSmdsSwSubNumPDUExceededMIR, wfSmdsSwCurUsageTable=wfSmdsSwCurUsageTable, wfSmdsSwEndpE164AddrHigh=wfSmdsSwEndpE164AddrHigh, wfSmdsSwUsageDelete=wfSmdsSwUsageDelete, wfSmdsSwSubDisableMIR=wfSmdsSwSubDisableMIR, wfSmdsSwSubDisableHrtbtPoll=wfSmdsSwSubDisableHrtbtPoll, wfSmdsSwInterfaceCurrentRate=wfSmdsSwInterfaceCurrentRate, wfSmdsSwUsageVolume=wfSmdsSwUsageVolume, wfSmdsSwSubInBandMgmtReceivedPDUs=wfSmdsSwSubInBandMgmtReceivedPDUs, wfSmdsSwSsiSniDelete=wfSmdsSwSsiSniDelete, wfSmdsSwGAGroupMember=wfSmdsSwGAGroupMember, wfSmdsSwSubSipL3ReceivedIAs=wfSmdsSwSubSipL3ReceivedIAs, wfSmdsSwSubInvalidHEPadOccur=wfSmdsSwSubInvalidHEPadOccur, wfSmdsSwUsageFileCleanup=wfSmdsSwUsageFileCleanup, wfSmdsSwSubDisableL3PduChecks=wfSmdsSwSubDisableL3PduChecks, wfSmdsSwGAScrnIndex=wfSmdsSwGAScrnIndex, wfSmdsSwUsageCleanupTimeStamp=wfSmdsSwUsageCleanupTimeStamp, wfSmdsSwUsageCurCleanupInterval=wfSmdsSwUsageCurCleanupInterval, wfSmdsSwInterfaceEntry=wfSmdsSwInterfaceEntry, wfSmdsSwUsage=wfSmdsSwUsage, wfSmdsSwIAScrnDelete=wfSmdsSwIAScrnDelete, wfSmdsSwUsageCurDebug=wfSmdsSwUsageCurDebug, wfSmdsSwUsageStoreData=wfSmdsSwUsageStoreData, wfSmdsSwSubDAScreenViolations=wfSmdsSwSubDAScreenViolations, wfSmdsSwSubInBandMgmtMaxLenErrors=wfSmdsSwSubInBandMgmtMaxLenErrors, wfSmdsSwCurUsageSni=wfSmdsSwCurUsageSni, wfSmdsSwUsageDestAddr=wfSmdsSwUsageDestAddr, wfSmdsSwSubBEtagOccur=wfSmdsSwSubBEtagOccur, wfSmdsSwCurUsageDestAddr=wfSmdsSwCurUsageDestAddr, wfSmdsSwSubInvalidBASizeOccur=wfSmdsSwSubInvalidBASizeOccur)
|
#!/usr/bin/env python
class Edge:
"""Edge class, to contain a directed edge of a tree or directed graph.
attributes parent and child: index of parent and child node in the graph.
"""
def __init__ (self, parent, child, length=None):
"""create a new Edge object, linking nodes
with indices parent and child."""
self.parent = parent
self.child = child
self.length = length
def __str__(self):
res = "edge from " + str(self.parent) + " to " + str(self.child)
return res
class Tree:
""" Tree, described by its list of edges."""
def __init__(self, edgelist):
"""create a new Tree object from a list of existing Edges"""
self.edge = edgelist
if edgelist:
self.update_node2edge()
def __str__(self):
res = "parent -> child:"
for e in self.edge:
res += "\n" + str(e.parent) + " " + str(e.child)
return res
def add_edge(self, ed):
"""add an edge to the tree"""
self.edge.append(ed)
self.update_node2edge()
def new_edge(self, parent, child):
"""add to the tree a new edge from parent to child (node indices)"""
self.add_edge( Edge(parent,child) )
def update_node2edge(self):
"""dictionary child node index -> edge for fast access to edges.
also add/update root attribute."""
self.node2edge = {e.child : e for e in self.edge}
childrenset = set(self.node2edge.keys())
rootset = set(e.parent for e in self.edge).difference(childrenset)
if len(rootset) > 1:
raise Warning("there should be a single root: " + str(rootset))
if len(rootset) == 0:
raise Exception("there should be at least one root!")
self.root = rootset.pop()
def get_path2root(self, i):
"""takes the index i of a node and returns the list of nodes
from i to the root, in this order.
This function is written with a loop.
An alternative option would have been a recursive function:
that would call itself on the parent of i (unless i is the root)"""
res = []
nextnode = i
while True:
res.append(nextnode) # add node to the list
if nextnode == self.root:
break
nextnode = self.node2edge[nextnode].parent # grab the parent to get closer to root
return res
def get_dist2root(self, i):
"""take the index i of a node and return the number of edges
between node i and the root"""
path = self.get_path2root(i)
return len(path)-1
def get_nodedist(self, i, j):
"""takes 2 nodes and returns the distance between them:
number of edges from node i to node j"""
if i==j:
return 0
pathi = self.get_path2root(i) # last node in this list: root
pathj = self.get_path2root(j)
while pathi and pathj:
anci = pathi[-1] # anc=ancestor, last one
ancj = pathj[-1]
if anci == ancj:
pathi.pop()
pathj.pop()
else:
break
return len(pathi)+len(pathj)
|
class Session(list):
"""Abstract Session class"""
def to_strings(self, user_id, session_id):
"""represent session as list of strings (one per event)"""
user_id, session_id = str(user_id), str(session_id)
session_type = self.get_type()
strings = []
for event, product in self:
columns = [user_id, session_type, session_id, event, str(product)]
strings.append(','.join(columns))
return strings
def get_type(self):
raise NotImplemented
class OrganicSessions(Session):
def __init__(self):
super(OrganicSessions, self).__init__()
def next(self, context, action):
self.append(
{
't': context.time(), # time step we're in
'plant_id': context.plant(), # get the id of the plant
'maturity': context.maturity(), #get the maturity of that plant
'water_level': context.water_level(),
'forecast':context.forecast(),
'day':context.day(),
'fertilizer':context.fertilizer()
}
)
def get_type(self):
return 'organic'
## don't really get this
def get_views(self):
return [p for _, _, e, p in self if e == 'pageview']
|
DEVICE_NOT_KNOWN = "Device name not known"
NEED_TO_SPECIFY_DEVICE_NAME = "You need to specify device name : ?device_name=..."
INVALID_HOUR = "Provided time is invalid"
DEVICE_SCHEDULE_OK = "Device schedule was setup"
NEED_TO_SPECIFY_JOB_ID = "You need to specidy Job id you want to get removed"
DELETE_SCHEDULE_OK = "Schedule was deleted" |
# Variáveis int
nota1 = int(input('Digite a primeira nota: '))
nota2 = int(input('Digite a segunda nota: '))
# Variável
media = (nota1 + nota2) / 2
# Cor
cor = {'fim': '\033[m',
'roxo': '\033[35m'}
# Print
print('A média do aluno: {}{}{}'.format(cor['roxo'], media, cor['fim']))
|
'''
name = input()
if name != 'Anton':
print(f'I am not Anton, i am {name}')
else:
print(f'I am {name}')
'''
n = 10
while n > 0:
n = n - 1
print(n)
|
# Pattern Matching (Python)
# string is already given to you. Please don't edit this string.
stringData = "qwe sdf dsld dssdfsqwe sdlcsd fdslkcsdsdk sdvnsdnvs dsvd d d dddqwelkmvl sdlksf qwelkmdsldm dsfkmsdf ds lknvnv dsdfdfnoiewqwek sdjnsdf djndsjnnqwnewefsjdc kqwj fsdfjsldnlsqwelkwnekennlksnq dlkneknqwn wqenln qlwn qlwknr wkernwen dkfndks ewqsdkslf efwekwkewqwen mdfsdfsdfskdnlknqwenknfsd lsklksna kasndasndqweq we qkewkwj e kjnqwne sd kqjwnekjqnwda kjqwnej dajqkjwe k wd qwekqwle kjnwqkejqw qwe jqnwjnqw djwnejwd"
pattern = input()
n = len(pattern)
count = 0
for i in range(len(stringData)-n+1) :
if pattern == stringData[i:i+n] :
count += 1
print(count)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.