content stringlengths 7 1.05M |
|---|
def simpleArraySum(ar):
return sum(ar)
ar_count = int(input())
ar = list(map(int, input().rstrip().split()))
result = simpleArraySum(ar)
print(result)
|
'''
Utilizar objetos como lista de funções
oo
varias classes, diferentes arquivos
Instanciar objetos, transformar num onjeto real
. para orientar
heranças
variavel.metodo(parametro)
self = this como no java
override
Exercicio:
Criar softawe de gerenciamento bancario
Este sera capaz de criar clientes e contas
cada cliente possui nome, cpf, idade
Cada conta possui um cliente, limite, saldo, -= saca, depositar e consultar saldo
''' |
def read_input(file_name):
with open(file_name, mode="r") as input_f:
file_content = input_f.read()
list_of_initial_state = file_content.strip().split(',')
list_of_initial_state = list(map(int, list_of_initial_state))
return list_of_initial_state
def simulate_lanternfish(list_of_initial_state, number_of_days):
print("Initial state: ")
print(list_of_initial_state)
for day in range(1, number_of_days + 1):
print(f"After {day} days: ")
new_lanternfish_counter = 0
for i in range(len(list_of_initial_state)):
if list_of_initial_state[i] > 0:
list_of_initial_state[i] -= 1
else:
list_of_initial_state[i] = 6
new_lanternfish_counter += 1
new_lanternfish_list = [8 for x in range(new_lanternfish_counter)]
list_of_initial_state += new_lanternfish_list
# print(list_of_initial_state)
print(len(list_of_initial_state))
return list_of_initial_state
def simulate_lanternfish_better(list_of_initial_state, number_of_days):
population = [0] * 9
for lanternfish in list_of_initial_state:
population[lanternfish] += 1
for day in range(number_of_days):
next_cycle_population = population[0]
for i in range(0, 8):
population[i] = population[i + 1]
population[6] += next_cycle_population
population[8] = next_cycle_population
sum_of_population = 0
for i in range(0, 9):
sum_of_population += population[i]
return sum_of_population
if __name__ == '__main__':
initial_state = read_input("input_day06")
# initial_state = read_input("input_day06_small")
final_state = simulate_lanternfish_better(initial_state, 256)
print(final_state)
|
# cd drone/starlark/samples
# drone script --source pipeline.py --stdout
load('docker.py', 'docker')
def build(version):
return {
'name': 'build',
'image': 'golang:%s' % version,
'commands': [
'go build',
'go test',
]
}
def main(ctx):
if ctx['build']['message'].find('[skip build]'):
return {
'kind': 'pipeline',
'name': 'publish_only',
'steps': [
docker('octocat/hello-world'),
],
}
return {
'kind': 'pipeline',
'name': 'build_and_publish',
'steps': [
build('1.11'),
build('1.12'),
docker('octocat/hello-world'),
],
}
|
#!/usr/bin/env python
# WARNING: This is till work in progress
#
# Load into gdb with 'source ../tools/gdb-prettyprint.py'
# Make sure to also apply 'set print pretty on' to get nice structure printouts
class String:
def __init__(self, val):
self.val = val
def to_string (self):
length = int(self.val['length'])
data = self.val['data']
if int(data) == 0:
return "UA_STRING_NULL"
inferior = gdb.selected_inferior()
text = inferior.read_memory(data, length).tobytes().decode(errors='replace')
return "\"%s\"" % text
class LocalizedText:
def __init__(self, val):
self.val = val
def to_string (self):
return "UA_LocalizedText(%s, %s)" % (self.val['locale'], self.val['text'])
class QualifiedName:
def __init__(self, val):
self.val = val
def to_string (self):
return "UA_QualifiedName(%s, %s)" % (int(self.val['namespaceIndex']), self.val['name'])
class Guid:
def __init__(self, val):
self.val = val
def to_string (self):
return "UA_Guid()"
class NodeId:
def __init__(self, val):
self.val = val
def to_string (self):
return "UA_NodeId()"
class Variant:
def __init__(self, val):
self.val = val
def to_string (self):
return "UA_Variant()"
def lookup_type (val):
if str(val.type) == 'UA_String':
return String(val)
if str(val.type) == 'UA_LocalizedText':
return LocalizedText(val)
if str(val.type) == 'UA_QualifiedName':
return QualifiedName(val)
if str(val.type) == 'UA_Guid':
return Guid(val)
if str(val.type) == 'UA_NodeId':
return NodeId(val)
if str(val.type) == 'UA_Variant':
return Variant(val)
return None
gdb.pretty_printers.append (lookup_type)
|
class State:
def __init__(self, name=None, transitions=None):
self.name = name
self.transitions = {k: v for k, v in transitions}
class StateMachine:
def __init__(self, states=None, initial_state=None):
self.state_mapping = {state.name: state for state in states}
self.initial_state = initial_state
self.current_state = initial_state
def transition(self, action):
if self.current_state.transitions.get(action):
self.current_state = self.state_mapping[self.current_state.transitions.get(action)]
|
'''
Circular Primes
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.
There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.
How many circular primes are there below one million?
'''
def je_prastevilo(n):
if n <= 2:
return n == 2
elif n % 2 == 0:
return False
else: #vsa liha ostanejo
d = 3
while d ** 2 <= n:
if n % d == 0:
return False
d += 2
return True
def zamakni(x):
'''da prvo števko na konec'''
niz = str(x)
zlepek = niz[1:] + niz[0]
return zlepek
def je_krozno_prastevilo(n):
'''true, če je, false, če ni'''
if not je_prastevilo(n):
return False
x = zamakni(n) #x je string zdej
while int(x) != n:
if not je_prastevilo(int(x)):
return False
else:
x = zamakni(x)
return True
def koliko_je_kroznih_prastevil_manjsih_od(n):
rezultat = 0
for x in range(n):
if je_krozno_prastevilo(x):
rezultat += 1
return rezultat
print(koliko_je_kroznih_prastevil_manjsih_od(10**6))
#100 13
#1000 25
#10 000 33
#100 000 43
#1 000 000 55 JA!
|
class BaseException(Exception): ...
class ATomlConfigError(BaseException):
pass
|
def main():
"""
Finds how many outer bags you can use
Made for AoC 2020 Day 7: https://adventofcode.com/2020/day/7
"""
part_1_test_input = '''light red bags contain 1 bright white bag, 2 muted yellow bags.
dark orange bags contain 3 bright white bags, 4 muted yellow bags.
bright white bags contain 1 shiny gold bag.
muted yellow bags contain 2 shiny gold bags, 9 faded blue bags.
shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags.
dark olive bags contain 3 faded blue bags, 4 dotted black bags.
vibrant plum bags contain 5 faded blue bags, 6 dotted black bags.
faded blue bags contain no other bags.
dotted black bags contain no other bags.'''
part_1_real_input = '''striped white bags contain 4 drab silver bags.
drab silver bags contain no other bags.
pale plum bags contain 1 dark black bag.
muted gold bags contain 1 wavy red bag, 3 mirrored violet bags, 5 bright gold bags, 5 plaid white bags.
muted teal bags contain 2 pale beige bags, 5 clear beige bags, 2 dotted gold bags, 4 posh cyan bags.
posh coral bags contain 1 light silver bag, 2 dull blue bags, 3 dim fuchsia bags, 2 dotted magenta bags.
faded black bags contain 4 light silver bags.
muted lavender bags contain 1 pale gold bag.
clear fuchsia bags contain 1 dull gray bag, 2 shiny indigo bags, 3 posh olive bags, 5 vibrant plum bags.
shiny olive bags contain 1 dotted gold bag, 5 bright violet bags.
vibrant lavender bags contain 3 dotted aqua bags, 4 pale chartreuse bags, 5 mirrored blue bags.
pale fuchsia bags contain 5 pale crimson bags, 2 dull teal bags.
clear lavender bags contain 5 shiny fuchsia bags, 5 wavy teal bags.
light chartreuse bags contain 5 mirrored yellow bags, 3 bright maroon bags.
mirrored white bags contain 1 bright gray bag, 4 plaid blue bags.
dark teal bags contain 4 bright maroon bags, 5 plaid bronze bags, 1 dark brown bag.
wavy yellow bags contain 4 dim silver bags, 1 striped tomato bag, 5 clear chartreuse bags.
dark turquoise bags contain 4 clear plum bags.
posh gray bags contain 2 faded purple bags, 2 faded orange bags.
wavy tomato bags contain 1 dark purple bag.
vibrant gray bags contain 3 muted gray bags, 1 dark fuchsia bag, 5 posh white bags, 5 posh tomato bags.
light crimson bags contain 2 dotted chartreuse bags.
dull gray bags contain 4 muted brown bags, 2 shiny blue bags, 4 dim crimson bags.
drab red bags contain 2 bright cyan bags, 1 pale brown bag.
dotted salmon bags contain 5 mirrored indigo bags.
vibrant green bags contain 2 dark coral bags.
light magenta bags contain 4 clear bronze bags, 4 dull teal bags, 4 posh salmon bags.
vibrant purple bags contain 4 posh plum bags, 2 bright gray bags.
posh lime bags contain 3 plaid yellow bags, 4 posh salmon bags.
bright white bags contain 4 dull aqua bags, 1 shiny silver bag.
faded blue bags contain 5 muted cyan bags, 2 mirrored coral bags.
dim green bags contain 2 posh lavender bags.
faded gray bags contain 2 dark gold bags, 1 drab turquoise bag.
wavy black bags contain 4 dim fuchsia bags, 1 muted orange bag, 4 drab salmon bags.
plaid plum bags contain 5 dotted tomato bags, 1 shiny beige bag.
bright tan bags contain 2 posh salmon bags.
wavy gold bags contain 1 faded olive bag, 5 vibrant black bags, 3 dull orange bags.
dull fuchsia bags contain 1 faded crimson bag, 5 vibrant white bags.
shiny maroon bags contain 5 dull lavender bags, 1 dim white bag.
wavy white bags contain 5 light teal bags, 4 dim salmon bags, 3 dotted red bags, 5 dark red bags.
dim cyan bags contain 1 muted orange bag.
muted cyan bags contain 4 dull turquoise bags, 5 posh gray bags, 5 clear turquoise bags, 1 shiny plum bag.
posh violet bags contain 5 plaid crimson bags, 5 muted purple bags, 1 wavy beige bag, 2 mirrored orange bags.
faded purple bags contain 3 plaid blue bags, 1 dull lavender bag, 1 muted orange bag, 2 dotted tomato bags.
wavy beige bags contain 1 dotted beige bag.
dim black bags contain 1 wavy blue bag, 1 plaid black bag, 3 pale lavender bags, 2 light violet bags.
dotted lavender bags contain 1 plaid blue bag, 5 dim crimson bags.
dark yellow bags contain 3 posh green bags.
wavy salmon bags contain 1 clear aqua bag, 3 mirrored crimson bags, 3 pale magenta bags, 2 dull teal bags.
clear silver bags contain 3 faded tan bags, 5 faded aqua bags, 1 clear tomato bag.
vibrant bronze bags contain 1 faded maroon bag, 4 plaid indigo bags, 2 bright purple bags, 5 dim violet bags.
pale brown bags contain 1 dull lavender bag, 2 clear turquoise bags.
faded salmon bags contain 1 pale silver bag.
dark gray bags contain 2 pale teal bags.
posh red bags contain 3 faded black bags, 2 dull red bags.
dim indigo bags contain 3 bright green bags, 2 dotted tomato bags, 5 bright magenta bags.
dull maroon bags contain 5 light green bags.
wavy teal bags contain 5 faded tan bags, 4 clear orange bags.
pale chartreuse bags contain 5 bright blue bags, 3 light indigo bags, 3 shiny white bags, 3 wavy bronze bags.
mirrored gray bags contain 4 vibrant tomato bags, 1 dark red bag, 5 drab silver bags, 3 posh magenta bags.
dark lavender bags contain 4 dotted white bags, 5 vibrant chartreuse bags, 2 dim teal bags.
shiny turquoise bags contain 3 dim lime bags, 5 bright cyan bags, 2 pale green bags.
shiny indigo bags contain 2 dark fuchsia bags, 4 posh chartreuse bags.
pale crimson bags contain 5 mirrored silver bags, 2 posh black bags.
light salmon bags contain 2 vibrant orange bags, 2 dotted red bags.
plaid orange bags contain 1 dotted turquoise bag, 4 vibrant brown bags.
dim maroon bags contain 5 shiny gold bags, 4 mirrored maroon bags.
muted green bags contain 1 plaid plum bag.
faded indigo bags contain 3 faded purple bags, 4 vibrant indigo bags, 1 light coral bag.
dull blue bags contain 5 dull salmon bags, 2 wavy magenta bags.
vibrant black bags contain 1 light coral bag, 5 vibrant cyan bags, 3 dim magenta bags.
striped lime bags contain 1 striped maroon bag, 2 vibrant brown bags.
drab brown bags contain 1 faded olive bag, 5 dotted beige bags.
dark plum bags contain 5 faded brown bags.
clear olive bags contain 3 dull aqua bags, 5 drab yellow bags.
wavy crimson bags contain 2 posh plum bags, 2 dull aqua bags, 5 shiny teal bags, 2 vibrant purple bags.
mirrored olive bags contain 2 wavy gold bags.
dim crimson bags contain no other bags.
faded plum bags contain 1 plaid indigo bag.
light maroon bags contain 3 vibrant orange bags, 2 clear olive bags, 3 clear brown bags, 1 pale black bag.
posh white bags contain 3 dull green bags, 3 clear brown bags.
drab black bags contain 2 shiny turquoise bags.
light purple bags contain 2 pale black bags, 5 light silver bags, 1 drab coral bag.
pale yellow bags contain 2 vibrant orange bags, 5 posh black bags, 2 vibrant tomato bags, 3 dotted lavender bags.
dull cyan bags contain 5 wavy beige bags, 1 dull yellow bag, 3 drab lime bags, 3 drab chartreuse bags.
drab lavender bags contain 2 plaid black bags, 4 dotted gray bags, 1 dim silver bag, 2 shiny gold bags.
striped brown bags contain 5 light maroon bags, 3 light red bags, 3 clear indigo bags.
drab tomato bags contain 2 light black bags, 2 clear salmon bags.
dotted red bags contain 4 dim salmon bags, 5 striped indigo bags.
vibrant teal bags contain 5 bright black bags, 1 dark purple bag, 2 bright turquoise bags.
striped teal bags contain 4 mirrored silver bags.
dull beige bags contain 4 clear olive bags, 4 light teal bags, 3 bright plum bags, 4 dotted lavender bags.
light violet bags contain 2 dull lavender bags, 4 bright gray bags, 5 vibrant orange bags, 3 wavy magenta bags.
dim brown bags contain 2 clear plum bags, 2 shiny teal bags, 2 posh salmon bags.
striped magenta bags contain 4 posh turquoise bags, 3 pale cyan bags, 3 faded indigo bags.
bright orange bags contain 4 plaid gray bags, 4 dark black bags, 4 faded red bags, 4 bright black bags.
muted olive bags contain 2 dotted crimson bags, 4 faded lavender bags, 2 vibrant gray bags.
plaid teal bags contain 2 light yellow bags, 4 drab cyan bags, 3 light green bags.
faded fuchsia bags contain 1 posh silver bag, 4 drab chartreuse bags, 4 drab teal bags.
dim silver bags contain 1 pale turquoise bag.
bright lime bags contain 1 striped silver bag, 5 muted teal bags, 1 shiny tan bag, 1 dark silver bag.
dotted green bags contain 3 posh green bags, 1 drab yellow bag.
drab purple bags contain 5 bright violet bags, 1 posh tomato bag.
dull bronze bags contain 4 mirrored black bags.
striped tomato bags contain 1 posh gray bag, 2 posh magenta bags.
bright crimson bags contain 2 light olive bags, 4 clear tan bags, 3 drab fuchsia bags.
bright turquoise bags contain 4 pale teal bags, 3 drab silver bags.
shiny lavender bags contain 2 striped lime bags, 2 plaid tomato bags, 1 faded orange bag, 5 wavy magenta bags.
light tomato bags contain 5 dotted olive bags.
wavy magenta bags contain no other bags.
vibrant fuchsia bags contain 5 posh brown bags, 5 plaid indigo bags.
dark tomato bags contain 3 shiny plum bags.
pale bronze bags contain 5 plaid black bags, 5 vibrant brown bags, 2 dim lime bags, 4 muted bronze bags.
striped fuchsia bags contain 3 muted brown bags, 2 pale chartreuse bags, 1 dim magenta bag.
dark brown bags contain 4 clear bronze bags.
posh teal bags contain 5 dotted plum bags, 2 drab gray bags, 3 dull fuchsia bags.
wavy turquoise bags contain 1 dull lavender bag.
striped maroon bags contain 4 muted yellow bags, 4 clear orange bags, 4 vibrant orange bags.
shiny green bags contain 3 muted brown bags, 1 vibrant black bag, 4 wavy cyan bags, 3 posh brown bags.
plaid salmon bags contain 4 mirrored indigo bags, 2 wavy white bags, 5 mirrored bronze bags, 3 light coral bags.
dotted magenta bags contain 2 light olive bags, 2 dark red bags, 4 clear green bags, 3 dim plum bags.
light orange bags contain 5 dark plum bags, 3 bright maroon bags, 2 dotted lime bags.
clear brown bags contain 3 dim white bags, 2 posh magenta bags.
vibrant turquoise bags contain 2 striped yellow bags, 1 mirrored crimson bag.
muted coral bags contain 4 wavy gold bags, 2 dim tan bags, 1 shiny green bag.
plaid crimson bags contain 1 dull aqua bag.
vibrant plum bags contain 4 striped tomato bags, 1 striped turquoise bag.
dark coral bags contain 5 posh black bags, 1 shiny beige bag, 3 pale brown bags.
mirrored brown bags contain 1 clear blue bag, 1 dull indigo bag.
bright blue bags contain 2 light violet bags, 1 dotted tomato bag.
drab cyan bags contain 2 dim turquoise bags, 5 clear violet bags.
dotted coral bags contain 3 dotted aqua bags.
shiny yellow bags contain 1 wavy cyan bag.
shiny red bags contain 5 shiny beige bags, 3 dotted lime bags, 5 dotted plum bags.
muted lime bags contain 3 dark turquoise bags, 3 bright chartreuse bags.
pale gray bags contain 5 dotted coral bags, 4 wavy teal bags, 2 clear aqua bags.
pale blue bags contain 5 dull salmon bags, 3 posh bronze bags, 2 vibrant tomato bags.
dim turquoise bags contain 4 posh aqua bags, 2 dark turquoise bags.
pale turquoise bags contain 5 vibrant brown bags, 2 shiny maroon bags.
dim gray bags contain 2 faded tomato bags, 2 faded indigo bags.
clear aqua bags contain 1 light turquoise bag, 3 dotted turquoise bags.
faded turquoise bags contain 5 muted lime bags.
clear plum bags contain 2 plaid indigo bags, 5 drab yellow bags.
vibrant white bags contain 2 bright violet bags, 4 dark plum bags, 1 dim plum bag, 4 plaid indigo bags.
dark orange bags contain 3 posh purple bags, 5 clear orange bags, 1 dim white bag.
light olive bags contain 3 drab green bags.
muted salmon bags contain 4 muted cyan bags.
clear maroon bags contain 2 muted yellow bags, 5 plaid crimson bags, 1 clear turquoise bag.
wavy orange bags contain 4 vibrant blue bags, 4 posh brown bags, 2 pale turquoise bags, 5 shiny orange bags.
dotted gold bags contain 3 posh magenta bags, 1 faded crimson bag, 3 dotted olive bags, 3 plaid olive bags.
dull purple bags contain 5 drab salmon bags, 4 dim lavender bags.
light bronze bags contain 2 wavy indigo bags.
muted turquoise bags contain 5 clear turquoise bags, 4 plaid violet bags, 4 clear orange bags, 2 posh maroon bags.
mirrored blue bags contain 4 clear chartreuse bags.
drab tan bags contain 3 striped violet bags, 2 bright silver bags, 2 dark bronze bags, 1 mirrored black bag.
dark maroon bags contain 1 vibrant orange bag.
drab yellow bags contain 1 vibrant blue bag, 2 dim violet bags.
light cyan bags contain 4 posh beige bags.
vibrant salmon bags contain 3 wavy gold bags.
muted orange bags contain 3 dotted tomato bags, 4 vibrant tomato bags, 5 dull lavender bags.
dull turquoise bags contain 1 wavy white bag.
dotted indigo bags contain 3 wavy bronze bags.
dark red bags contain 4 wavy bronze bags, 5 wavy turquoise bags.
light coral bags contain 4 clear tan bags, 2 vibrant beige bags, 1 dull lavender bag, 5 shiny white bags.
mirrored turquoise bags contain 5 clear fuchsia bags, 3 mirrored black bags, 4 plaid tan bags.
mirrored yellow bags contain 4 pale turquoise bags, 2 wavy orange bags, 3 drab coral bags, 4 dim chartreuse bags.
dotted fuchsia bags contain 4 dim bronze bags, 4 striped indigo bags.
dotted purple bags contain 5 posh maroon bags, 1 dim yellow bag.
clear coral bags contain 5 dark olive bags, 2 wavy bronze bags, 3 light red bags.
mirrored teal bags contain 3 drab yellow bags.
faded green bags contain 2 dark purple bags.
light lime bags contain 4 bright chartreuse bags, 5 clear tomato bags, 2 bright green bags, 2 faded teal bags.
bright yellow bags contain 4 dull purple bags, 3 faded beige bags.
bright maroon bags contain 2 vibrant blue bags, 5 bright violet bags, 5 plaid indigo bags, 3 vibrant orange bags.
faded red bags contain 5 pale brown bags, 4 striped tomato bags, 2 bright green bags.
muted maroon bags contain 1 dark tan bag, 5 drab teal bags, 4 dull maroon bags.
plaid coral bags contain 5 bright blue bags, 1 dotted indigo bag.
dotted brown bags contain 1 dull beige bag, 2 bright indigo bags, 2 striped chartreuse bags, 1 muted silver bag.
wavy coral bags contain 2 clear cyan bags, 2 muted teal bags, 1 faded red bag, 2 mirrored silver bags.
faded coral bags contain 3 bright green bags, 1 bright cyan bag, 3 plaid blue bags, 5 wavy lavender bags.
dim gold bags contain 5 dim teal bags, 1 vibrant tomato bag, 5 pale chartreuse bags, 3 bright indigo bags.
bright salmon bags contain 5 plaid chartreuse bags, 5 light tan bags, 5 vibrant maroon bags.
wavy violet bags contain 4 bright green bags.
mirrored lavender bags contain 5 drab plum bags, 2 drab turquoise bags, 2 dark magenta bags.
faded aqua bags contain 3 faded teal bags, 1 dark red bag.
muted yellow bags contain 1 mirrored silver bag, 1 striped white bag, 3 mirrored gold bags, 1 muted gray bag.
pale coral bags contain 2 striped gray bags, 2 clear beige bags.
mirrored cyan bags contain 1 pale beige bag, 4 dim crimson bags.
dotted aqua bags contain 4 dim crimson bags, 3 vibrant beige bags.
dark white bags contain 4 dim maroon bags, 1 light olive bag, 3 dull fuchsia bags, 4 mirrored maroon bags.
dotted chartreuse bags contain 5 clear tan bags, 2 clear white bags, 2 dark coral bags, 4 faded brown bags.
mirrored red bags contain 5 faded violet bags, 2 dark chartreuse bags.
drab maroon bags contain 3 bright violet bags.
dark violet bags contain 5 dark turquoise bags, 1 muted blue bag, 4 plaid bronze bags.
dull silver bags contain 4 dotted lime bags, 3 dotted silver bags, 4 dull red bags, 3 pale white bags.
striped lavender bags contain 5 drab silver bags.
light yellow bags contain 3 posh plum bags, 3 bright olive bags, 4 wavy crimson bags.
posh chartreuse bags contain 2 bright violet bags.
pale green bags contain 5 shiny lime bags, 3 faded teal bags, 5 posh gray bags, 1 posh chartreuse bag.
shiny lime bags contain 1 dull beige bag, 4 light aqua bags, 4 dotted tomato bags.
plaid tan bags contain 1 mirrored chartreuse bag.
drab coral bags contain 5 posh gray bags, 2 dull black bags.
drab salmon bags contain 4 drab yellow bags, 3 mirrored green bags.
faded yellow bags contain 2 mirrored beige bags, 1 bright turquoise bag, 1 vibrant black bag.
bright tomato bags contain 4 clear brown bags.
muted beige bags contain 1 clear turquoise bag.
striped black bags contain 1 plaid chartreuse bag.
bright cyan bags contain 5 clear tomato bags.
striped coral bags contain 2 muted red bags.
posh bronze bags contain 5 striped yellow bags.
mirrored maroon bags contain 4 vibrant tomato bags, 5 bright green bags, 4 vibrant maroon bags, 4 striped violet bags.
dotted turquoise bags contain 1 posh beige bag, 5 muted silver bags.
bright purple bags contain 5 drab silver bags, 5 shiny blue bags, 2 plaid bronze bags, 4 faded magenta bags.
posh plum bags contain 5 striped white bags, 2 pale brown bags, 1 wavy turquoise bag.
dark crimson bags contain 1 dull black bag, 2 dull yellow bags, 1 posh white bag, 3 dotted lime bags.
plaid bronze bags contain 5 striped indigo bags, 5 light indigo bags, 4 wavy magenta bags, 3 vibrant blue bags.
clear red bags contain 4 posh silver bags, 1 dim aqua bag.
striped salmon bags contain 3 bright violet bags, 4 faded olive bags, 5 dim turquoise bags.
dim bronze bags contain no other bags.
wavy brown bags contain 4 vibrant turquoise bags.
wavy maroon bags contain 1 mirrored bronze bag, 2 posh fuchsia bags, 1 mirrored indigo bag.
mirrored salmon bags contain 2 faded lavender bags.
dark aqua bags contain 4 faded teal bags, 1 dim tomato bag.
pale violet bags contain 5 clear blue bags, 3 plaid blue bags, 5 dim teal bags, 2 pale black bags.
mirrored crimson bags contain 2 posh magenta bags, 2 dotted aqua bags, 1 dim bronze bag.
bright indigo bags contain 4 bright violet bags.
muted violet bags contain 4 mirrored maroon bags, 2 dull red bags, 4 plaid tomato bags, 1 pale yellow bag.
shiny gold bags contain 3 vibrant blue bags, 5 plaid blue bags, 2 dark red bags, 1 dull green bag.
clear green bags contain 4 dotted lavender bags.
dark indigo bags contain 2 light lime bags, 3 wavy brown bags.
muted fuchsia bags contain 3 plaid green bags.
bright silver bags contain 4 dim tomato bags, 3 clear olive bags, 1 dull teal bag.
plaid purple bags contain 4 dark silver bags, 1 vibrant crimson bag, 4 dark black bags, 3 faded magenta bags.
clear chartreuse bags contain 4 posh plum bags.
plaid tomato bags contain 2 wavy aqua bags, 3 striped indigo bags, 1 wavy magenta bag.
posh cyan bags contain 3 drab green bags, 3 bright chartreuse bags, 3 muted gray bags, 2 light black bags.
posh turquoise bags contain 5 wavy teal bags, 3 light tan bags, 1 dull gold bag.
plaid olive bags contain 2 dim chartreuse bags.
shiny orange bags contain 4 pale brown bags, 3 dim salmon bags.
clear gray bags contain 4 bright salmon bags, 5 vibrant crimson bags.
shiny brown bags contain 1 bright gold bag, 3 clear tomato bags.
muted aqua bags contain 2 mirrored indigo bags, 1 dim tan bag.
plaid red bags contain 1 clear plum bag.
muted bronze bags contain 4 clear white bags, 3 dotted plum bags.
plaid blue bags contain 2 dull lavender bags, 5 wavy magenta bags, 1 light indigo bag.
shiny salmon bags contain 2 dotted black bags, 1 light magenta bag.
shiny cyan bags contain 5 faded violet bags, 3 mirrored bronze bags, 4 dark maroon bags, 2 wavy lavender bags.
drab magenta bags contain 2 light blue bags, 1 wavy orange bag, 5 posh chartreuse bags.
dim violet bags contain 5 dark red bags, 4 light violet bags, 2 dotted fuchsia bags, 2 plaid tomato bags.
faded crimson bags contain 3 clear silver bags, 1 vibrant beige bag.
plaid fuchsia bags contain 3 plaid red bags, 4 drab purple bags, 4 clear lime bags, 3 dim turquoise bags.
dull green bags contain 5 dotted beige bags, 4 drab silver bags, 4 posh magenta bags, 1 muted orange bag.
wavy indigo bags contain 2 pale tan bags.
plaid lavender bags contain 1 dark black bag.
clear bronze bags contain 3 pale teal bags.
clear blue bags contain 2 light teal bags, 5 dotted olive bags, 3 bright indigo bags.
posh aqua bags contain 2 light violet bags, 2 dull salmon bags, 1 vibrant violet bag.
dark gold bags contain 2 striped maroon bags.
vibrant chartreuse bags contain 3 wavy silver bags.
dark magenta bags contain 1 clear silver bag.
dim red bags contain 3 wavy indigo bags, 2 muted teal bags.
muted silver bags contain 5 pale crimson bags, 2 dotted tomato bags.
mirrored tan bags contain 1 pale salmon bag.
dull violet bags contain 2 dull black bags.
striped beige bags contain 4 dark maroon bags, 2 wavy orange bags.
striped turquoise bags contain 3 light indigo bags, 5 bright maroon bags, 1 light teal bag.
pale gold bags contain 5 dotted teal bags.
wavy olive bags contain 3 dotted fuchsia bags.
clear violet bags contain 1 dotted lavender bag, 5 bright tan bags, 5 dim violet bags, 5 drab salmon bags.
pale maroon bags contain 4 drab red bags, 1 wavy yellow bag, 1 muted green bag, 1 striped fuchsia bag.
drab bronze bags contain 4 light gray bags, 3 posh magenta bags, 1 dull yellow bag.
vibrant gold bags contain 4 dull violet bags, 3 clear white bags, 5 wavy chartreuse bags, 4 pale turquoise bags.
clear beige bags contain 4 plaid blue bags, 3 shiny plum bags, 1 light silver bag.
faded silver bags contain 5 drab turquoise bags, 4 plaid green bags, 4 posh yellow bags, 1 plaid blue bag.
light brown bags contain 1 dark red bag, 1 dotted gray bag.
shiny violet bags contain 5 posh cyan bags, 5 vibrant plum bags, 5 mirrored chartreuse bags, 4 plaid green bags.
dark bronze bags contain 4 bright gold bags, 2 striped maroon bags, 4 dark aqua bags, 5 pale chartreuse bags.
dull black bags contain 2 vibrant tomato bags, 1 vibrant blue bag, 3 pale yellow bags.
dotted beige bags contain 5 dotted tomato bags, 1 striped indigo bag.
clear indigo bags contain 3 dark violet bags.
bright coral bags contain 1 dark indigo bag.
drab turquoise bags contain 5 drab plum bags, 3 pale magenta bags, 5 drab red bags, 4 dull olive bags.
shiny fuchsia bags contain 2 dull lavender bags, 5 striped tomato bags.
dull indigo bags contain 3 pale turquoise bags, 3 faded tomato bags, 5 dim magenta bags, 3 drab indigo bags.
dim aqua bags contain 4 faded brown bags, 1 mirrored lime bag.
muted purple bags contain 3 dim salmon bags, 4 light violet bags, 2 striped turquoise bags, 2 shiny teal bags.
dotted black bags contain 3 dotted cyan bags, 4 wavy magenta bags, 4 posh chartreuse bags.
drab violet bags contain 4 dark gray bags, 5 dull chartreuse bags, 4 plaid gray bags.
plaid green bags contain 3 dark red bags, 1 wavy crimson bag, 4 light coral bags, 4 striped indigo bags.
faded brown bags contain 3 dark orange bags.
light teal bags contain 3 striped indigo bags, 4 dim bronze bags.
plaid black bags contain 2 mirrored crimson bags, 5 dim silver bags, 4 posh purple bags.
shiny blue bags contain 2 plaid green bags, 4 plaid crimson bags, 2 faded plum bags.
plaid lime bags contain 2 striped maroon bags.
pale lavender bags contain 2 mirrored indigo bags, 1 pale green bag, 5 dim chartreuse bags, 3 pale white bags.
drab chartreuse bags contain 1 bright salmon bag, 4 vibrant brown bags, 1 muted violet bag.
light indigo bags contain no other bags.
plaid violet bags contain 2 dim white bags, 4 faded lavender bags.
drab gold bags contain 5 dotted aqua bags, 3 muted beige bags, 4 faded black bags, 5 dark red bags.
mirrored bronze bags contain 2 plaid blue bags, 1 light orange bag.
dim olive bags contain 1 striped silver bag.
plaid white bags contain 5 pale turquoise bags, 4 mirrored orange bags, 2 vibrant aqua bags.
wavy purple bags contain 3 dark silver bags, 1 dull white bag, 3 dotted magenta bags, 2 dim salmon bags.
clear orange bags contain 5 striped indigo bags, 1 wavy bronze bag, 4 vibrant blue bags.
plaid gray bags contain 1 dull aqua bag, 3 dull olive bags, 3 posh black bags.
vibrant violet bags contain 2 vibrant maroon bags.
pale olive bags contain 2 vibrant fuchsia bags.
muted brown bags contain 5 pale teal bags, 2 light brown bags, 4 light tomato bags.
posh lavender bags contain 4 bright indigo bags, 1 striped indigo bag, 5 dark purple bags.
dotted blue bags contain 4 muted salmon bags, 3 mirrored red bags, 5 pale white bags, 3 clear red bags.
dim purple bags contain 4 muted cyan bags.
bright fuchsia bags contain 5 muted black bags.
vibrant lime bags contain 3 posh purple bags, 1 drab aqua bag.
wavy green bags contain 3 drab red bags, 2 faded brown bags, 2 wavy cyan bags.
dull lime bags contain 3 bright salmon bags, 4 posh crimson bags, 1 drab salmon bag, 4 pale yellow bags.
mirrored aqua bags contain 4 striped violet bags, 1 striped indigo bag, 2 striped tomato bags.
striped tan bags contain 4 light blue bags, 4 dull beige bags.
drab green bags contain 5 muted silver bags, 1 vibrant orange bag, 2 striped indigo bags, 4 striped tomato bags.
dotted orange bags contain 5 mirrored white bags, 5 muted orange bags, 2 drab tomato bags, 2 dull white bags.
dim tomato bags contain 2 dull lavender bags.
dull magenta bags contain 3 faded brown bags, 5 faded teal bags.
faded maroon bags contain 4 posh brown bags, 2 dotted aqua bags.
plaid cyan bags contain 4 faded crimson bags, 4 light chartreuse bags, 1 light crimson bag, 1 posh fuchsia bag.
dim salmon bags contain 1 dotted olive bag, 4 light indigo bags.
faded chartreuse bags contain 4 bright gold bags, 4 clear silver bags.
light plum bags contain 2 dotted chartreuse bags, 1 drab white bag.
posh silver bags contain 3 mirrored black bags, 4 dull blue bags.
dull salmon bags contain 4 dim white bags, 5 clear tomato bags, 2 mirrored maroon bags.
light green bags contain 4 plaid chartreuse bags, 5 vibrant aqua bags.
posh indigo bags contain 2 dull olive bags, 2 dotted lime bags, 1 drab red bag.
dark blue bags contain 5 dotted green bags, 3 wavy crimson bags, 4 clear silver bags.
bright black bags contain 5 posh bronze bags, 3 bright cyan bags, 5 muted black bags.
bright lavender bags contain 1 shiny indigo bag, 1 dim yellow bag, 1 wavy yellow bag.
faded white bags contain 1 dotted black bag, 5 wavy red bags.
muted black bags contain 1 mirrored aqua bag, 4 dark red bags, 5 dull yellow bags.
light turquoise bags contain 3 shiny plum bags.
vibrant coral bags contain 2 shiny orange bags, 4 bright olive bags.
vibrant aqua bags contain 2 wavy crimson bags, 2 muted orange bags.
dotted tan bags contain 1 light indigo bag, 2 dim magenta bags.
posh yellow bags contain 4 faded lavender bags.
pale lime bags contain 4 mirrored orange bags, 3 dull gray bags, 1 muted magenta bag.
drab white bags contain 2 faded tan bags, 3 wavy aqua bags.
shiny tomato bags contain 4 dim coral bags, 3 dotted lime bags.
wavy plum bags contain 1 bright orange bag.
dull crimson bags contain 2 pale silver bags, 1 light beige bag, 4 wavy violet bags.
dotted violet bags contain 4 light indigo bags, 1 dark black bag, 3 pale green bags.
dark salmon bags contain 5 light tan bags, 4 dim chartreuse bags, 5 faded green bags, 3 light brown bags.
dull brown bags contain 5 mirrored aqua bags, 5 dim magenta bags, 4 light brown bags, 5 plaid black bags.
shiny chartreuse bags contain 5 wavy yellow bags, 3 faded aqua bags, 1 bright fuchsia bag, 5 drab plum bags.
muted red bags contain 3 drab white bags, 5 dim beige bags, 4 bright olive bags.
posh blue bags contain 1 dotted beige bag, 1 vibrant cyan bag, 4 vibrant brown bags, 2 clear turquoise bags.
wavy bronze bags contain 4 wavy turquoise bags, 4 dim bronze bags, 3 shiny beige bags, 2 dull lavender bags.
posh beige bags contain 3 muted gray bags, 4 light salmon bags, 5 striped turquoise bags.
vibrant red bags contain 5 muted blue bags.
dark olive bags contain 5 dark maroon bags.
dotted gray bags contain 3 wavy magenta bags.
vibrant cyan bags contain 5 dotted lavender bags, 3 vibrant orange bags.
dark chartreuse bags contain 3 pale white bags, 1 dull lavender bag.
faded lime bags contain 4 clear green bags, 3 shiny plum bags, 2 light green bags.
vibrant blue bags contain 1 wavy turquoise bag, 4 dim salmon bags.
dull tan bags contain 3 dim chartreuse bags, 1 plaid tomato bag, 4 dark brown bags.
muted gray bags contain 4 clear tan bags, 3 wavy aqua bags, 5 dim white bags.
clear yellow bags contain 1 drab white bag, 5 dark salmon bags, 2 dull yellow bags.
clear tomato bags contain 2 dotted gray bags, 5 vibrant beige bags, 1 bright maroon bag, 2 drab green bags.
shiny tan bags contain 5 posh lavender bags, 5 pale yellow bags.
dark black bags contain 4 muted purple bags, 5 light gray bags, 5 drab red bags.
striped plum bags contain 3 dull red bags, 1 dark tomato bag, 4 dark yellow bags, 5 plaid cyan bags.
light gray bags contain 3 plaid chartreuse bags.
light aqua bags contain 4 wavy magenta bags, 3 light black bags.
vibrant brown bags contain 1 bright blue bag, 1 posh black bag.
posh tomato bags contain 5 wavy magenta bags.
dotted bronze bags contain 4 mirrored chartreuse bags.
mirrored violet bags contain 2 clear maroon bags, 1 light red bag, 4 mirrored gray bags.
dark purple bags contain 5 bright blue bags, 3 plaid blue bags.
faded beige bags contain 4 plaid bronze bags, 5 vibrant turquoise bags, 3 pale orange bags, 5 mirrored aqua bags.
mirrored green bags contain 1 dotted fuchsia bag, 5 light indigo bags, 3 shiny beige bags.
striped violet bags contain 5 drab silver bags, 2 dim crimson bags, 3 plaid blue bags.
mirrored tomato bags contain 5 light lavender bags.
posh purple bags contain 3 pale orange bags.
dim blue bags contain 5 dotted plum bags, 1 light orange bag, 4 dim maroon bags.
dark cyan bags contain 4 vibrant white bags, 4 dull white bags, 1 posh purple bag.
drab beige bags contain 5 dull purple bags.
vibrant olive bags contain 5 light silver bags.
plaid beige bags contain 3 muted silver bags, 4 vibrant orange bags.
wavy silver bags contain 2 dim crimson bags, 4 shiny maroon bags, 4 pale indigo bags.
posh crimson bags contain 2 light violet bags, 4 pale coral bags, 3 plaid bronze bags.
vibrant crimson bags contain 3 dull red bags.
dotted olive bags contain no other bags.
mirrored beige bags contain 2 plaid gray bags, 5 mirrored yellow bags.
bright brown bags contain 2 faded aqua bags, 1 dim tomato bag, 5 posh magenta bags.
bright magenta bags contain 2 posh gray bags, 3 dim salmon bags.
clear magenta bags contain 2 dim cyan bags, 3 clear red bags, 1 dull fuchsia bag, 4 wavy coral bags.
clear lime bags contain 5 dull green bags, 2 shiny bronze bags, 2 faded orange bags, 1 bright beige bag.
muted tan bags contain 4 vibrant maroon bags, 3 vibrant black bags, 5 shiny maroon bags, 5 vibrant turquoise bags.
pale beige bags contain 3 light tomato bags.
dark fuchsia bags contain 2 faded brown bags, 3 dotted lavender bags, 4 shiny teal bags, 2 bright blue bags.
dim magenta bags contain 4 posh chartreuse bags.
bright aqua bags contain 5 drab violet bags.
striped crimson bags contain 2 bright green bags.
dull chartreuse bags contain 4 plaid bronze bags, 2 shiny gray bags, 4 dull lavender bags.
wavy chartreuse bags contain 1 vibrant tomato bag, 1 dim tomato bag, 3 pale green bags, 1 posh plum bag.
dotted white bags contain 1 dark teal bag, 4 dotted violet bags, 5 bright beige bags, 3 dim silver bags.
mirrored purple bags contain 1 posh green bag.
faded bronze bags contain 4 dotted indigo bags.
faded lavender bags contain 3 muted purple bags.
clear turquoise bags contain 4 muted orange bags, 1 striped violet bag, 5 clear tan bags, 5 dim white bags.
shiny plum bags contain 4 dim crimson bags.
wavy fuchsia bags contain 3 dotted brown bags, 5 dark magenta bags, 2 dark bronze bags.
faded olive bags contain 5 plaid indigo bags.
mirrored orange bags contain 4 striped violet bags, 2 light violet bags, 4 shiny orange bags.
pale indigo bags contain 3 shiny indigo bags.
faded tan bags contain 3 shiny maroon bags, 5 posh aqua bags, 1 striped violet bag, 2 dim white bags.
bright chartreuse bags contain 1 posh black bag, 5 bright gray bags, 3 plaid chartreuse bags.
drab blue bags contain 1 pale violet bag, 4 vibrant green bags.
posh tan bags contain 4 shiny lime bags.
plaid maroon bags contain 2 dotted black bags.
dull coral bags contain 4 posh coral bags, 1 dotted silver bag, 5 drab beige bags, 1 plaid red bag.
striped yellow bags contain 1 plaid tomato bag, 1 dotted lavender bag.
muted magenta bags contain 4 muted black bags.
dotted cyan bags contain 1 vibrant tomato bag, 3 light indigo bags, 1 wavy turquoise bag.
dim lavender bags contain 1 muted black bag, 4 pale white bags, 2 mirrored coral bags, 5 pale brown bags.
bright gold bags contain 5 vibrant green bags.
light white bags contain 2 striped lime bags, 2 muted lime bags, 5 muted brown bags, 4 bright green bags.
wavy lavender bags contain 2 vibrant purple bags, 5 posh white bags.
clear black bags contain 2 posh turquoise bags, 3 dotted orange bags, 3 faded teal bags.
muted crimson bags contain 1 pale violet bag, 5 drab lavender bags.
posh green bags contain 4 vibrant beige bags, 5 dark purple bags, 3 dim salmon bags, 3 light black bags.
vibrant silver bags contain 3 posh coral bags, 4 posh white bags.
dim coral bags contain 2 posh violet bags, 1 dark cyan bag, 3 shiny green bags, 3 vibrant cyan bags.
striped red bags contain 5 muted olive bags, 4 wavy teal bags, 3 shiny gray bags, 1 mirrored coral bag.
bright violet bags contain 3 shiny beige bags, 1 wavy magenta bag, 5 light indigo bags.
vibrant magenta bags contain 4 striped salmon bags, 1 light tan bag.
faded gold bags contain 5 light tomato bags, 1 wavy black bag, 4 faded maroon bags.
muted plum bags contain 1 vibrant brown bag, 2 muted cyan bags, 4 muted salmon bags.
plaid gold bags contain 5 shiny beige bags, 3 faded fuchsia bags, 5 vibrant cyan bags, 5 shiny gold bags.
striped indigo bags contain no other bags.
wavy gray bags contain 2 plaid indigo bags, 3 clear tomato bags, 4 dull blue bags.
plaid silver bags contain 5 clear salmon bags, 5 faded lime bags, 4 shiny tan bags, 5 mirrored chartreuse bags.
plaid yellow bags contain 4 shiny chartreuse bags, 1 light lime bag, 2 dull green bags.
plaid turquoise bags contain 3 dotted aqua bags, 3 posh magenta bags.
striped olive bags contain 2 faded aqua bags, 5 dotted orange bags, 5 dull turquoise bags, 1 pale violet bag.
faded teal bags contain 3 striped indigo bags.
dull red bags contain 1 mirrored gray bag, 4 drab coral bags, 2 bright plum bags, 1 dull green bag.
dull gold bags contain 5 bright blue bags.
shiny magenta bags contain 1 light white bag.
striped green bags contain 1 clear blue bag.
dull teal bags contain 3 dark purple bags, 4 dim lime bags, 5 clear chartreuse bags.
faded magenta bags contain 4 shiny gray bags, 5 pale crimson bags, 5 light coral bags, 2 pale white bags.
pale tomato bags contain 4 dull black bags, 1 posh chartreuse bag, 1 faded cyan bag.
muted blue bags contain 5 striped white bags, 1 faded orange bag.
light blue bags contain 4 posh white bags.
plaid chartreuse bags contain 2 bright gray bags.
dull aqua bags contain 5 clear tan bags, 5 dotted red bags, 5 vibrant tomato bags.
light lavender bags contain 5 clear fuchsia bags, 1 striped olive bag.
bright green bags contain 4 vibrant violet bags, 2 vibrant maroon bags.
light beige bags contain 1 striped maroon bag.
drab indigo bags contain 4 posh tomato bags, 5 faded brown bags.
dotted yellow bags contain 3 wavy violet bags, 4 bright violet bags, 4 vibrant lime bags, 1 pale beige bag.
striped gold bags contain 2 light indigo bags, 3 dull red bags, 5 vibrant beige bags.
muted indigo bags contain 5 bright purple bags, 1 pale plum bag, 5 wavy black bags.
dark lime bags contain 2 faded blue bags.
shiny white bags contain 4 clear tan bags, 3 pale yellow bags, 5 plaid tomato bags, 4 wavy turquoise bags.
vibrant maroon bags contain 4 dark red bags, 2 dull aqua bags, 5 wavy aqua bags.
drab teal bags contain 3 shiny indigo bags.
bright plum bags contain 2 plaid chartreuse bags.
vibrant yellow bags contain 3 posh purple bags.
posh salmon bags contain 4 dim plum bags, 1 pale yellow bag, 2 shiny gold bags.
shiny black bags contain 3 dim magenta bags.
bright gray bags contain no other bags.
dull orange bags contain 3 dotted purple bags.
pale purple bags contain 2 bright cyan bags, 2 drab teal bags, 2 dotted gold bags, 4 mirrored fuchsia bags.
dull yellow bags contain 3 posh gray bags.
muted tomato bags contain 3 faded orange bags.
drab olive bags contain 4 dim maroon bags, 1 bright turquoise bag, 3 shiny indigo bags, 5 vibrant lavender bags.
clear salmon bags contain 2 dim chartreuse bags, 2 shiny black bags, 5 dotted indigo bags, 3 dotted aqua bags.
posh black bags contain 2 wavy turquoise bags, 2 shiny plum bags, 2 mirrored gold bags.
light gold bags contain 5 shiny tomato bags, 4 light cyan bags.
shiny coral bags contain 3 faded silver bags.
plaid magenta bags contain 1 vibrant black bag, 2 bright blue bags.
dotted teal bags contain 4 faded olive bags, 5 vibrant brown bags, 3 clear salmon bags.
striped purple bags contain 5 shiny bronze bags.
dim tan bags contain 2 light tan bags, 1 dotted gold bag, 3 shiny white bags.
light silver bags contain 5 dotted cyan bags, 4 dotted aqua bags.
dull white bags contain 5 striped turquoise bags.
plaid aqua bags contain 3 dim bronze bags, 5 dull brown bags, 3 faded plum bags, 2 mirrored crimson bags.
dotted silver bags contain 1 faded teal bag.
dull olive bags contain 1 dark turquoise bag, 3 muted orange bags.
clear purple bags contain 3 drab salmon bags.
mirrored plum bags contain 1 vibrant lavender bag.
bright beige bags contain 4 plaid magenta bags, 1 dull turquoise bag, 4 dim white bags, 1 light aqua bag.
pale red bags contain 1 muted lavender bag, 2 vibrant teal bags, 4 plaid cyan bags, 5 dull orange bags.
drab orange bags contain 3 bright plum bags, 5 vibrant chartreuse bags.
mirrored gold bags contain 2 wavy magenta bags.
posh maroon bags contain 3 dotted lime bags, 2 muted black bags, 3 faded green bags.
clear white bags contain 4 pale black bags.
pale silver bags contain 2 dim coral bags, 2 dull lavender bags, 2 dark teal bags, 3 wavy green bags.
vibrant tomato bags contain 5 dull lavender bags.
striped orange bags contain 5 shiny salmon bags, 1 pale gold bag, 4 mirrored gray bags, 1 plaid black bag.
dim beige bags contain 5 dim salmon bags, 2 striped yellow bags, 5 shiny orange bags, 5 light salmon bags.
clear gold bags contain 2 dim salmon bags, 4 vibrant cyan bags.
dim teal bags contain 3 light indigo bags, 3 pale green bags, 5 muted bronze bags.
shiny silver bags contain 3 drab red bags, 1 pale magenta bag, 3 plaid blue bags, 4 pale white bags.
dark beige bags contain 4 posh black bags, 1 dark maroon bag.
bright bronze bags contain 4 mirrored yellow bags, 1 vibrant salmon bag, 2 mirrored teal bags, 1 shiny beige bag.
dotted maroon bags contain 1 clear tomato bag.
bright olive bags contain 3 striped tomato bags, 3 plaid indigo bags, 3 posh magenta bags.
faded tomato bags contain 5 bright violet bags.
mirrored magenta bags contain 3 wavy coral bags, 4 dull tan bags, 3 wavy chartreuse bags.
striped aqua bags contain 3 drab teal bags, 3 drab crimson bags, 5 plaid gold bags, 2 vibrant aqua bags.
clear crimson bags contain 5 striped chartreuse bags, 5 vibrant blue bags.
striped blue bags contain 4 dull red bags, 3 vibrant white bags, 4 posh black bags.
posh olive bags contain 5 muted cyan bags.
plaid indigo bags contain 5 dotted fuchsia bags, 2 plaid chartreuse bags, 3 vibrant blue bags.
mirrored lime bags contain 2 dotted lavender bags, 2 wavy bronze bags.
wavy blue bags contain 5 mirrored green bags, 5 faded tomato bags, 1 posh turquoise bag.
light fuchsia bags contain 3 faded tomato bags, 5 muted beige bags, 2 faded beige bags, 4 wavy indigo bags.
dull plum bags contain 4 dark blue bags, 5 shiny maroon bags, 3 pale gray bags, 5 drab lime bags.
drab fuchsia bags contain 3 dark maroon bags.
pale teal bags contain 4 vibrant blue bags, 1 bright green bag, 3 dim crimson bags, 1 posh salmon bag.
dull tomato bags contain 3 dim maroon bags, 4 plaid gray bags, 5 striped gold bags, 5 striped white bags.
pale orange bags contain 4 drab yellow bags.
wavy aqua bags contain 1 dim bronze bag.
dim chartreuse bags contain 2 bright violet bags.
dotted crimson bags contain 5 vibrant orange bags, 4 wavy magenta bags.
faded cyan bags contain 3 mirrored blue bags, 3 shiny fuchsia bags, 4 bright indigo bags.
pale salmon bags contain 2 pale cyan bags, 2 muted lime bags, 2 vibrant plum bags.
drab lime bags contain 2 drab yellow bags, 2 light magenta bags, 3 dotted fuchsia bags.
shiny bronze bags contain 1 posh lavender bag.
dim fuchsia bags contain 5 dotted gold bags, 5 vibrant indigo bags, 4 shiny teal bags, 2 dotted silver bags.
dark green bags contain 2 shiny blue bags.
bright red bags contain 2 pale brown bags, 3 plaid blue bags, 4 drab bronze bags, 3 dim yellow bags.
clear teal bags contain 2 drab white bags, 3 muted beige bags.
pale aqua bags contain 4 light tan bags.
dull lavender bags contain 1 dim bronze bag, 5 dim crimson bags, 1 dotted olive bag.
dotted plum bags contain 1 light black bag.
shiny teal bags contain 3 light indigo bags.
dotted lime bags contain 1 shiny gold bag, 3 plaid crimson bags.
dark tan bags contain 5 faded tan bags.
vibrant indigo bags contain 3 shiny fuchsia bags.
light tan bags contain 4 pale yellow bags, 1 pale crimson bag, 3 light gray bags.
drab plum bags contain 2 shiny turquoise bags, 2 vibrant yellow bags, 4 muted brown bags, 2 drab lavender bags.
dim white bags contain 5 dark red bags, 5 dotted olive bags.
light red bags contain 2 vibrant indigo bags, 1 wavy salmon bag, 3 dull brown bags.
mirrored fuchsia bags contain 5 dotted tomato bags.
mirrored indigo bags contain 5 pale lime bags, 5 light magenta bags, 4 light gray bags, 2 dull red bags.
dim yellow bags contain 2 muted beige bags, 2 plaid olive bags, 3 faded aqua bags.
shiny gray bags contain 1 drab yellow bag, 3 shiny lavender bags, 1 posh white bag.
faded violet bags contain 2 bright olive bags, 5 clear gray bags, 2 dark orange bags, 1 pale magenta bag.
mirrored black bags contain 4 clear blue bags.
drab aqua bags contain 1 vibrant crimson bag, 4 clear fuchsia bags.
pale black bags contain 5 pale turquoise bags, 4 striped yellow bags, 4 dotted beige bags.
wavy cyan bags contain 1 vibrant brown bag.
dark silver bags contain 3 light tomato bags, 5 dotted lavender bags, 3 bright turquoise bags.
faded orange bags contain 3 clear turquoise bags, 3 mirrored gold bags, 2 plaid bronze bags, 2 dotted fuchsia bags.
drab crimson bags contain 5 clear blue bags.
posh magenta bags contain 1 bright violet bag, 2 dotted beige bags, 2 bright gray bags.
posh brown bags contain 3 dim tomato bags, 1 dim chartreuse bag, 5 shiny orange bags.
drab gray bags contain 3 striped violet bags.
pale cyan bags contain 5 dotted aqua bags, 3 striped tomato bags.
wavy tan bags contain 3 pale indigo bags.
plaid brown bags contain 2 dotted indigo bags, 1 dull indigo bag, 2 light brown bags.
vibrant beige bags contain 1 shiny teal bag, 3 vibrant cyan bags, 2 posh gray bags, 3 striped tomato bags.
shiny aqua bags contain 2 vibrant black bags, 2 muted coral bags, 4 vibrant coral bags.
mirrored silver bags contain 3 drab silver bags, 1 clear turquoise bag.
pale tan bags contain 3 pale magenta bags.
striped cyan bags contain 5 drab tomato bags.
mirrored coral bags contain 1 mirrored crimson bag, 1 bright maroon bag.
pale white bags contain 4 shiny beige bags, 1 shiny maroon bag, 5 dim bronze bags.
shiny beige bags contain 3 mirrored gold bags.
mirrored chartreuse bags contain 1 dotted tomato bag, 2 bright cyan bags.
wavy red bags contain 1 posh lavender bag, 1 vibrant blue bag, 3 muted brown bags.
muted chartreuse bags contain 3 dim lavender bags, 4 pale plum bags, 4 light magenta bags.
shiny purple bags contain 4 muted green bags, 5 light white bags, 2 faded tan bags, 5 light beige bags.
clear tan bags contain 3 dotted red bags, 1 striped violet bag, 4 plaid chartreuse bags.
bright teal bags contain 1 faded black bag, 3 faded maroon bags.
posh orange bags contain 5 light gold bags, 3 posh aqua bags.
striped gray bags contain 2 bright plum bags, 2 shiny gray bags.
dim lime bags contain 1 plaid blue bag.
posh fuchsia bags contain 1 dull indigo bag, 2 plaid blue bags.
dotted tomato bags contain no other bags.
dim plum bags contain 1 dim chartreuse bag.
dim orange bags contain 2 muted magenta bags, 5 faded aqua bags.
posh gold bags contain 5 light maroon bags, 4 dark turquoise bags, 1 posh white bag, 5 wavy beige bags.
striped bronze bags contain 1 dark magenta bag.
wavy lime bags contain 4 mirrored lavender bags, 3 pale bronze bags, 1 dull white bag.
pale magenta bags contain 2 dim crimson bags, 4 plaid plum bags, 5 muted silver bags, 2 dim yellow bags.
striped chartreuse bags contain 5 light black bags, 3 bright fuchsia bags, 4 pale black bags.
vibrant tan bags contain 2 dim tan bags.
shiny crimson bags contain 5 pale beige bags, 3 clear purple bags, 2 pale violet bags, 4 dotted chartreuse bags.
vibrant orange bags contain no other bags.
striped silver bags contain 5 clear orange bags, 2 dotted fuchsia bags.
clear cyan bags contain 5 muted gray bags, 3 wavy aqua bags.
light black bags contain 1 striped yellow bag.
muted white bags contain 3 muted tomato bags, 5 light black bags, 4 pale black bags, 5 shiny gold bags.'''
test_bag_rules: dict = create_rules_dict(part_1_test_input)
real_bag_rules: dict = create_rules_dict(part_1_real_input)
part_1_test_result = find_outer_bag_possibilities("shiny gold", test_bag_rules)
part_1_real_result = find_outer_bag_possibilities("shiny gold", real_bag_rules)
print(f"Amount of possible outer bags (test): {part_1_test_result}")
print(f"Amount of possible outer bags (real): {part_1_real_result}")
def create_rules_dict(raw_rules_input: str) -> dict:
"""
Creates dict with rules from raw str input
:param raw_rules_input: String of written rules
:type raw_rules_input: str
:return: Dictionary with processed rules
:rtype: dict
"""
bag_rules: dict = {}
for rule_row in raw_rules_input.split(".\n"):
is_color: bool = True
rules_for_color: str = ""
for rule_part in rule_row.split(" bags contain "):
try:
if is_color:
rules_for_color = rule_part
bag_rules[rules_for_color] = {}
else:
for bag_rule in rule_part.split(", "):
cleaned_bag_rule = bag_rule.split()[:-1]
if cleaned_bag_rule[0] != "no":
bag_amount = cleaned_bag_rule[0]
bag_color = cleaned_bag_rule[1] + " " + cleaned_bag_rule[2]
bag_rules[rules_for_color][bag_color] = bag_amount
is_color = not is_color
except ValueError:
pass
return bag_rules
def find_outer_bag_possibilities(bag_color: str, bag_rules: dict) -> int:
"""
Finds possible outer bags, based on rules and given bag color
:param bag_color: String describing chosen color
:param bag_rules: Dictionary of rules
:type bag_color: str
:type bag_rules: dict
:return: Number of all possible outer bag colors
:rtype: int
"""
allowed_outer_bags: list = []
for rule in bag_rules:
if bag_color in can_hold_bags(rule, bag_rules):
if rule not in allowed_outer_bags:
allowed_outer_bags.append(rule)
else:
for color in can_hold_bags(rule, bag_rules):
if bag_color in can_hold_bags(color, bag_rules):
if rule not in allowed_outer_bags:
allowed_outer_bags.append(rule)
return len(allowed_outer_bags)
def can_hold_bags(rule: str, bag_rules: dict) -> dict:
"""
Returns a dict of all bags that can be held by given bag color
:param rule: Color of a given bag
:param bag_rules: Dictionary of rules
:type rule: str
:type bag_rules: dict
:return:
"""
return bag_rules[rule]
if __name__ == '__main__':
main()
|
n1 = str(input('digite seu nome completo: ')).strip()
n2 = n1.split()
print('Seu primeiro nome é {}'.format(n2[0]))
print('seu ultimo nome é {}'.format(n2[len(n2)-1]))
|
{
'includes': [
'config.gypi',
],
'targets': [
{
'target_name': 'socksd',
'type': 'executable',
'sources': [
'src/main.c',
'src/Client.c',
'src/Logger.c'
],
'libraries': [
#'-luv',
],
'configurations': {
'Debug':{},
'Release':{},
},
},
],
}
|
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def levelOrder(self, root: TreeNode) -> [[int]]:
queue = [root]
res = []
if not root:
return []
while queue:
templist = []
templen = len(queue)
for i in range(templen):
temp = queue.pop(0)
templist.append(temp.val)
if temp.left:
queue.append(temp.left)
if temp.right:
queue.append(temp.right)
res.append(templist)
return res
|
# THIS FILE IS GENERATED FROM PYWAVELETS SETUP.PY
short_version = '1.1.0'
version = '1.1.0'
full_version = '1.1.0.dev0+20ab3c1'
git_revision = '20ab3c1ded9b457c2cb54cb7bbac65479d5c4a00'
release = False
if not release:
version = full_version
|
# coding: utf-8
'''
Class: VerificaMetadados
description: realizar a verificação de artigos produzidos observando existência de metadados de autor e referências bibliográficas
author: Adriano dos Santos Vieira <adriano.vieira@dataprev.gov.br>
character encoding: UTF-8
@params: (opcional) file_name = nome de arquivo markdown a ser verificado
'''
class VerificaMetadados:
def __init__(self, file_name=''):
self.__has_dados_autor= False
self.__has_dados_referencias = False
if len(file_name) > 0:
self.__file_name = file_name
self.verificaMetadados(self.__file_name)
else:
self.__file_name = ''
def hasDadosAutor(self):
return self.__has_dados_autor
def hasDadosReferencias(self):
return self.__has_dados_referencias
# @params: file_name = nome de arquivo markdown a ser verificado
def verificaMetadados(self, file_name=''):
self.__has_dados_autor= False
self.__has_dados_referencias = False
if (len(file_name) == 0) and (len(self.__file_name) > 0):
file_name = self.__file_name
__has_autor_group = False
__has_autor_abstract = False
__has_referencias_group = False
__has_referencias_id = False
with open(file_name) as file:
while True: # loop para ler conteudo do arquivo
line = file.readline()
if not line:
break
# verifica metadados de autor
if (line.find('author:') == 0):
__has_autor_group = True
if (line.find('abstract:') == 0):
__has_autor_abstract = True
# verifica metadados de referencias
if (line.find('references:') == 0):
__has_referencias_group = True
if (line.find('- id:') == 0):
__has_referencias_id = True
file.close()
# pelo menos dois campos de cada grupo de metadados devem existir
if (__has_autor_group) and (__has_autor_abstract):
self.__has_dados_autor= True
if (__has_referencias_group) and (__has_referencias_id):
self.__has_dados_referencias = True
|
'''
estrutura de laço
As listas são essenciais para intender a estrutura de laço
com esta estrutura e que vamos percorrer estas listas, cada uma de uma vez
while
for
'''
lista_nomes = ['Carlos', 'Marcelo', 'João', 'Julia']
#cont = range(0, 20, 2)
'''
range(comecar, ate, step)
'''
print('Comecei a processar!')
for nomes in lista_nomes:
print(nomes)
for itens in range(0, 10, 2):
print(itens)
for itens in range(len(lista_nomes)):
print(lista_nomes[itens])
lista_nomes.append('OI')
print(lista_nomes)
print('Acabei de processar...')
#while, sempre true
i = 0
print('Entrei no while ;)')
while i < 10:
print('i é menor que 10', i)
if i == 8:
print('Cheguei à', i, 'preciso sair....')
break
i += 1
print('Sai do while ;(')
qtd_pessoas = []
qtd = int(input('Entre com a quantidade de pessoas para a festa: '))
i = 0
while i < qtd:
print(i, 'º Pessoa\n')
nome = input('Nome:')
qtd_pessoas.append(nome)
i += 1
print('Pessoas relacionadas: ', qtd_pessoas)
'''
para cada nome dentro de lista_nomes
mostre nomes
1 verifica cada nomes dentro de lista_nomes
me mostra 1 nome.
1 em cada linha
python não existe i++
''' |
class Pessoa():
# atributo de classe
olhos = 2
def __init__(self, *filhos, nome=None, idade=35):
self.nome = nome
self.idade = idade
self.filhos = list(filhos)
def cumprimentar(self):
return f'Olá, {id(self)}'
if __name__ == "__main__":
joao = Pessoa(nome='João Victor', idade=15)
denison = Pessoa(joao, nome='Dênison Fábio', idade=36)
print(Pessoa.cumprimentar(denison))
print(id(denison))
print(denison.cumprimentar())
print(denison.nome)
print(denison.idade)
for filho in denison.filhos:
print(f'nome do filho: {filho.nome}')
denison.sobrenome = 'Oliveira'
del denison.filhos
denison.olhos = 1
del denison.olhos
print(denison.__dict__)
print(joao.__dict__)
Pessoa.olhos = 3
print(Pessoa.olhos)
print(joao.olhos)
print(denison.olhos)
print(id(Pessoa.olhos), id(denison.olhos), id(joao.olhos))
|
def change(s, prog, version):
temp=s.split("\n")
temp=temp[0:2]+temp[3:-1]
temp[0]='Program: '+prog
temp[1]="Author: g964"
if not valid_number(temp[2].split(": ")[1]): return 'ERROR: VERSION or PHONE'
temp[2]="Phone: +1-503-555-0090"
temp[3]="Date: 2019-01-01"
if not valid_version(temp[4].split(": ")[1]): return 'ERROR: VERSION or PHONE'
temp[4]=temp[4] if temp[4].split(": ")[1]=="2.0" else "Version: "+version
return " ".join(temp)
def valid_number(phone):
check=phone.split("-")
if len(check)!=4 or phone[0]!="+": return False
return False if not (check[0][1]=="1" and len(check[0])==2 and len(check[1])==3 and len(check[2])==3 and len(check[3])==4) else True
def valid_version(ver):
return False if ((ver[0] or ver[-1]) not in "1234567890" or ver.count(".")==0 or ver.count(".")>=2) else True |
'''answer=input()
list1=[]
i3=0
for i in range(len(answer.split('\n'))):
list1.append(answer.split(' ')[i])
for i2 in range(5):
number,base=list1[i3],int(list1[i3+1])
i3=i3+2
print(sum([int((number+"0"*(base-len(number)%base))[i*base:(i+1)*base]) for i in range(len(number+"0"*(base-len(number)%base))//base)]))
'''
numbers= []
for i in range(0,5):
raw=input().split(" ")
num,length,total=raw[0],int(raw[1]),0
num+=("0"*(length-(len(num)%length)))
for j in range(int(len(num)/length)):
total+= int(num[j*length:(j+1)*length])
numbers.append(total)
for i in range(0,5):
print(numbers[i]) |
# -*- coding:utf-8; -*-
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def reverseKGroup(self, head, k):
preHead = ListNode(-1)
preHead.next = head
start, end, count = preHead, start.next, 0
while end:
count += 1
if count % k == 0: # 这里比较巧妙
start = self.reverse(start, end.next) # k个节点反转
end = start.next # 这里需要注意
else:
end = end.next
return preHead.next
def reverse(self, start, end):
# (start,end)之间是可能要被反转的链表?为什么?因为要保证前后的联系
first = start.next # 保存将来反转后的最后一个元素,对接end
pre, curr = start, start.next
while curr != end: # end对应单链表中的null
tmp = curr.next
curr.next = pre
pre = curr
curr = tmp
start.next = pre
first.next = curr
return first # 返回下一个start位置
if __name__ == "__main__":
def printList(head):
p = head
while p:
print(p.val)
p = p.next
nums = [1, 2, 3, 4, 5]
head = ListNode(0)
p = head
for i in range(len(nums)):
n = ListNode(nums[i])
p.next = n
p = n
printList(head.next)
s = Solution()
printList(s.reverseKGroup(head.next, 2))
|
def central_suppression_method(valuein: int, rc: str = "5", upper: int = 5000000000) -> str:
"""
Suppresses and rounds values using the central suppression method.
If value is 0 then it will remain as 0.
If value is 1-7 it will be suppressed and appear as 5.
All other values will be rounded to the nearest 5.
Parameters
----------
valuein : int
Metric value
rc : str
Replacement character if value needs suppressing
upper : int
Upper limit for suppression of numbers (5 billion)
Returns
-------
out : str
Suppressed value (5), 0 or rounded valuein if greater than 7
Examples
--------
>>> central_suppression_method(3)
'5'
>>> central_suppression_method(24)
'25'
>>> central_suppression_method(0)
'0'
"""
base = 5
if not isinstance(valuein, int):
raise ValueError("The input: {} is not an integer.".format(valuein))
if valuein < 0:
raise ValueError("The input: {} is less than 0.".format(valuein))
elif valuein == 0:
valueout = str(valuein)
elif valuein >= 1 and valuein <= 7:
valueout = rc
elif valuein > 7 and valuein <= upper:
valueout = str(base * round(valuein / base))
else:
raise ValueError("The input: {} is greater than: {}.".format(valuein, upper))
return valueout
|
n = int(input("Digite a última potencia:"))
i = 0
while i <= n:
print(2**i)
i = i + 1 |
cc = 0
s = 0
for c in range(0, 501, 3):
if c % 2 != 0:
s = c + s
cc = cc + 1
print('O total de soma de todos os {} números ímpares multiplos de 3 entre 1 e 500 é {}'.format(cc, s))
|
class DocManagerBase:
@staticmethod
def apply_update(doc, update_spec):
"""Apply an update operation to a document."""
if "$set" not in update_spec and "$unset" not in update_spec:
# update spec contains the new document in its entirety
return update_spec
# Helper to cast a key for a list or dict, or raise ValueError
def _convert_or_raise(container, key):
if isinstance(container, dict):
return key
elif isinstance(container, list):
return int(key)
else:
raise ValueError
# Helper to retrieve (and/or create)
# a dot-separated path within a document.
def _retrieve_path(container, path, create=False):
looking_at = container
for part in path:
if isinstance(looking_at, dict):
if create and part not in looking_at:
looking_at[part] = {}
looking_at = looking_at[part]
elif isinstance(looking_at, list):
index = int(part)
# Do we need to create additional space in the array?
if create and len(looking_at) <= index:
# Fill buckets with None up to the index we need.
looking_at.extend([None] * (index - len(looking_at)))
# Bucket we need gets the empty dictionary.
looking_at.append({})
looking_at = looking_at[index]
else:
raise ValueError
return looking_at
def _set_field(doc, to_set, value):
if "." in to_set:
path = to_set.split(".")
where = _retrieve_path(doc, path[:-1], create=True)
index = _convert_or_raise(where, path[-1])
wl = len(where)
if isinstance(where, list) and index >= wl:
where.extend([None] * (index + 1 - wl))
where[index] = value
else:
doc[to_set] = value
def _unset_field(doc, to_unset):
try:
if "." in to_unset:
path = to_unset.split(".")
where = _retrieve_path(doc, path[:-1])
index_or_key = _convert_or_raise(where, path[-1])
if isinstance(where, list):
# Unset an array element sets it to null.
where[index_or_key] = None
else:
# Unset field removes it entirely.
del where[index_or_key]
else:
del doc[to_unset]
except (KeyError, IndexError, ValueError):
raise
# wholesale document replacement
try:
# $set
for to_set in update_spec.get("$set", []):
value = update_spec["$set"][to_set]
_set_field(doc, to_set, value)
# $unset
for to_unset in update_spec.get("$unset", []):
_unset_field(doc, to_unset)
except (KeyError, ValueError, AttributeError, IndexError):
raise
return doc
def index(self, doc, namespace, timestamp):
"""Index document"""
raise NotImplementedError()
def update(self, doc, namespace, timestamp):
"""Update document"""
raise NotImplementedError()
def delete(self, doc_id, namespace, timestamp):
"""Delete document by doc_id"""
raise NotImplementedError()
def handle_command(self, command_doc, namespace, timestamp):
"""Handle a command."""
raise NotImplementedError()
def bulk_index(self, docs, namespace):
""""""
raise NotImplementedError()
def commit(self):
"""Send bulk buffer to Elasticsearch, then refresh."""
raise NotImplementedError()
def stop(self):
"""Stop auto committer"""
raise NotImplementedError()
def search(self):
""""""
raise NotImplementedError()
|
class electronics():
tools = []
age = 0
years_of_experience = 0
languages = []
department = ""
alex = electronics()
alex.tools = ["spice", "eagle"]
alex.age = 27
alex.years_of_experience = 3
alex.languages.append("english")
alex.department = "electronics"
print(alex.tools, alex.age, alex.years_of_experience, alex.department, alex.languages)
ali = electronics()
ali.tools = ["spice", "eagle"]
ali.age = 27
ali.years_of_experience = 3
ali.languages.append("english")
ali.department = "electronics"
ali.languages = []
print(ali.tools, ali.age, ali.years_of_experience, ali.department, ali.languages)
print("\nali:\n", ali.languages, "\nalex:\n", alex.languages)
# _________________________________________________________________________________________
print("_" * 80)
class electrical():
age = 0
years_of_experience = 0
tools = []
languages = []
department = []
at = electrical()
at.age = 20
at.years_of_experience = 0
at.tools.append("spice")
at.languages.append("english")
at.department.append("cs")
print(at.age, at.years_of_experience, at.tools, at.languages, at.department)
bok = electrical()
bok.age = 27
bok.years_of_experience = 3
bok.tools.append("xcode")
bok.languages.append("french")
bok.department.append("electroncis")
print(bok.age, bok.years_of_experience, bok.tools, bok.languages, bok.department)
bok.age = 300
at.age = 122
print(bok.age, at.age)
# _________________________________________________________________________________________
print("_" * 80)
class new():
def __init__(self):
self.age = 0
def __index__(self):
self.years_of_experience = 0
deneme = new()
deneme.age = 200
deneme.years_of_experience = 100
naber = new()
naber.age = 50
naber.years_of_experience = 10
print(deneme.age, deneme.years_of_experience, naber.age, naber.years_of_experience)
# _________________________________________________________________________________________
print("_" * 80)
class VeriBilimi():
calisanlar = []
def __init__(self):
self.bildigi_diller = []
self.bolum = ""
veli = VeriBilimi()
print("veli.bildigi_diller\t", veli.bildigi_diller)
veli.bildigi_diller.append("pythonobject")
print("veli.bildigi_diller\t", veli.bildigi_diller)
ali = VeriBilimi()
print("ali.bildigi_diller\t", ali.bildigi_diller)
ali.bildigi_diller.append("c")
print("ali.bildigi_diller\t", ali.bildigi_diller)
class newClass():
def __init__(self):
self.bildigi_diller = []
self.bolum = ""
def dil_ekle(self, new_dil):
self.bildigi_diller.append(new_dil)
def bolum_ekle(self, new_bolum):
self.bolum = new_bolum
ali = newClass()
print("\nali.newClass()\nali.bildigi.diller\t", ali.bildigi_diller)
ali.dil_ekle("python")
print("\nali.dil_ekle(\"python\")\n", "ali.bildigi_diller\t", ali.bildigi_diller)
#______________________________________________________________________________
print("_" * 90)
class Employees():
def __init__(self, firstName="n/a", middleName="n/a", lastName="n/a", age=0, gender="n/a"):
self.firstName = firstName
self.middleName = middleName
self.lastName = lastName
self.age = age
self.gender = gender
class DataScience(Employees):
def __init__(self, programming="n/a", languages="n/a", projects="n/a"):
self.programming = programming
self.languages = languages
self.projects = projects
class marketing(Employees):
def __init__(self, communication="n/a", storytelling="n/a", charisma="n/a"):
self.communication = communication
self.storytelling = storytelling
self.charisma = charisma
alex = DataScience()
alex.programming = "python"
alex.firstName = "alex"
alex.lastName = "mercan"
print("alex :\n", alex.firstName, "\n", alex.lastName, "\n", alex.programming) |
toepic = [60000, 150000, 47619]
tounique = [18000, 35000, 19608]
tolegendry = [3000, 10000, 4975]
# red, black, addtional
upgrade_table = [toepic, tounique, tolegendry]
# upgrade_table[Source Rank.value][Cube.value] returns threshold. range(0, 100000)
|
# 工序操作模拟类
class Operation:
def __init__(self, id_operation, id_machine, duration):
self.__id_operation = id_operation
self.__duration = duration
self.__id_machine = id_machine
self.__time = None
self.__is_pending = False
self.__place_of_arrival = None
# toString 方法
def __str__(self):
output = "操作" + str(self.__id_operation) + " [由CNC机器" + str(
self.__id_machine) + "#处理] 耗时" + str(self.__duration) + "(单位时间)"
if not (self.__time is None):
output += ", 此操作作业开始于 " + str(self.__time)
return output
# 操作ID
@property
def id_operation(self):
return self.__id_operation
# 是否完成
def is_done(self, t):
return not (self.__time is None) and self.__time + self.__duration <= t
# 是否等待
@property
def is_pending(self):
return self.__is_pending
# 设置等待状态
@is_pending.setter
def is_pending(self, value):
self.__is_pending = value
# 返回将被分配用于处理此操作的CNC机器ID
@property
def place_of_arrival(self):
return self.__place_of_arrival
# 设置用于处理此操作的CNC机器ID
@place_of_arrival.setter
def place_of_arrival(self, value):
self.__place_of_arrival = value
# 对应CNC机器ID
@property
def id_machine(self):
return self.__id_machine
# 操作耗时
@property
def duration(self):
return self.__duration
# 获取操作开始时间
@property
def time(self):
return self.__time
# 设置操作开始时间
@time.setter
def time(self, value):
if value < 0:
raise ValueError("[错误] 起始时间不可小于零")
self.__time = value
|
class ListGol(object):
"""
Game of Life implemented via lists
:param board: the initial state of the board
:type board: :py:class:`gksol.boards.PaddedBoard` or List[List[int]]
.. describe:: gol[n]
Return the ``n``'th row of the board as a list-like view.
"""
def __init__(self, board):
self._board = board
self.height = len(board)
self.width = len(board[0]) if board else 0
def advance(self):
"""Advance the board to the next generation"""
# most of the board will be empty, so efficiently initialize to that
next_board = [[0] * self.width for _ in range(self.height)]
for w in range(self.width):
for h in range(self.height):
neighbours = self._neighbours(h,w)
if neighbours == 3:
next_board[h][w] = 1
elif neighbours >= 2:
next_board[h][w] = self._board[h][w]
else:
next_board[h][w] = 0
self._board = next_board
def _neighbours(self, h, w):
if h == 0:
h_indizes = (0, 1)
elif h == self.height - 1:
h_indizes = (h - 1, h)
else:
h_indizes = (h - 1, h, h + 1)
if w == 0:
w_indizes = (0, 1)
elif w == self.width - 1:
w_indizes = (w - 1, w)
else:
w_indizes = (w - 1, w, w + 1)
return sum(
self._board[i][j]
for i in h_indizes
for j in w_indizes
if i != h or j != w
)
def __getitem__(self, item):
return self._board[item]
def __iter__(self):
yield from self._board
def get_matrix(self):
"""Return the game board as a nested list"""
return [line[:] for line in self._board]
GOL = ListGol
|
class Meter():
def __init__(
self,
):
self.reset()
def reset(
self,
):
self.max = None
self.min = None
self.avg = None
self.sum = 0
self.cnt = 0
def update(
self,
val,
):
self.sum += val
self.cnt += 1
if self.max is None or self.max < val:
self.max = val
if self.min is None or self.min > val:
self.min = val
self.avg = self.sum / self.cnt
|
# -*- coding: utf-8 -*-
# 冒泡排序
def bubble_sort(arrlist):
if len(arrlist) <= 1:
return arrlist
for i in range(1, len(arrlist)-1):
flag = False #设置置换标识
for j in range(0, len(arrlist) - i - 1):
if arrlist[j] > arrlist[j+1]:
arrlist[j], arrlist[j+1] = arrlist[j+1], arrlist[j]
flag = True
if not flag:
print(flag)
break #如果第一趟循环没有发生置换,直接退出
if __name__ == "__main__":
mylist = [1, 2, 3, 4, 5, 6, 7]
bubble_sort(mylist)
for i in range(len(mylist)):
print(mylist[i])
|
# calories calculator
print("Today's date?")
date = input()
print("Breakfast calories?")
breakfast = int(input())
print("Lunch calories?")
lunch = int(input())
print("Dinner calories?")
dinner = int(input())
print("Snack calories?")
snack = int(input())
print("Calorie content for " + date + ": "+ str(breakfast + lunch + dinner + snack)) |
# -*- coding: utf-8 -*-
file = open("deneme.txt","r",encoding="utf-8")
for i in file:
print(i,end="")
a = file.read()
print(a)
print(file.readline())
print(file.readlines())
file.close()
|
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution(object):
def sortList(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
def merge(l1, l2):
if not l1:
return l2
if not l2:
return l1
if l1.val < l2.val:
l1.next = merge(l1.next, l2)
return l1
else:
l2.next = merge(l1, l2.next)
return l2
if not head or not head.next:
return head
slow = head
fast = head
pre = head
while fast and fast.next:
pre = slow
slow = slow.next
fast = fast.next.next
pre.next = None
return merge(self.sortList(head), self.sortList(slow)) |
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'ALL AND ASC BOOLEAN BOUND BY BYTE COLON COMA CONSTANT CONTAINS DATATYPE DATETIME DECIMAL DESC DISTINCT DIV DOUBLE EQUALS FILTER FLOAT GREATER GREATEREQ ID INT INTEGER ISBLANK ISIRI ISLITERAL ISURI LANG LANGMATCHES LCASE LESS LESSEQ LIMIT LKEY LONG LPAR MINUS NEG NEGATIVEINT NEQUALS NONNEGINT NONPOSINT NUMBER OFFSET OPTIONAL OR ORDER PLUS POINT POSITIVEINT PREFIX REGEX RKEY RPAR SAMETERM SELECT SHORT STR STRING TIMES UCASE UNION UNSIGNEDBYTE UNSIGNEDINT UNSIGNEDLONG UNSIGNEDSHORT UPPERCASE URI VARIABLE WHERE\n parse_sparql : prefix_list query order_by limit offset\n \n prefix_list : prefix prefix_list\n \n prefix_list : empty\n \n empty :\n \n prefix : PREFIX ID COLON URI\n \n uri : ID COLON ID\n \n uri : ID COLON URI\n \n uri : URI\n \n order_by : ORDER BY var_order_list desc_var\n \n order_by : empty\n \n var_order_list : empty\n \n var_order_list : var_order_list desc_var\n \n desc_var : DESC LPAR VARIABLE RPAR\n \n desc_var : VARIABLE\n \n desc_var : ASC LPAR VARIABLE RPAR\n \n desc_var : unary_func LPAR desc_var RPAR\n \n limit : LIMIT NUMBER\n \n limit : empty\n \n offset : OFFSET NUMBER\n \n offset : empty\n \n query : SELECT distinct var_list WHERE LKEY group_graph_pattern RKEY\n \n query : SELECT distinct ALL WHERE LKEY group_graph_pattern RKEY\n \n distinct : DISTINCT\n \n distinct : empty\n \n group_graph_pattern : union_block\n \n union_block : pjoin_block rest_union_block POINT pjoin_block\n \n union_block : pjoin_block rest_union_block pjoin_block\n \n union_block : pjoin_block rest_union_block\n \n pjoin_block : LKEY join_block RKEY\n \n pjoin_block : join_block\n \n pjoin_block : empty\n \n rest_union_block : empty\n \n rest_union_block : UNION LKEY join_block rest_union_block RKEY rest_union_block\n \n join_block : LKEY union_block RKEY rest_join_block\n \n join_block : bgp rest_join_block\n \n rest_join_block : empty\n \n rest_join_block : POINT bgp rest_join_block\n \n rest_join_block : bgp rest_join_block\n \n bgp : LKEY bgp UNION bgp rest_union_block RKEY\n \n bgp : bgp UNION bgp rest_union_block\n \n bgp : triple\n \n bgp : FILTER LPAR expression RPAR\n \n bgp : FILTER express_rel\n \n bgp : OPTIONAL LKEY group_graph_pattern RKEY\n \n bgp : LKEY join_block RKEY\n \n expression : express_rel LOGOP expression\n \n expression : express_rel\n \n expression : LPAR expression RPAR\n \n express_rel : express_arg RELOP express_rel\n \n express_rel : express_arg\n \n express_rel : LPAR express_rel RPAR\n \n express_rel : NEG LPAR expression RPAR\n \n express_rel : NEG express_rel\n \n express_arg : uri\n \n express_arg : VARIABLE\n \n express_arg : CONSTANT\n \n express_arg : NUMBER\n \n express_arg : NUMBER POINT NUMBER\n \n express_arg : REGEX LPAR express_arg COMA pattern_arg regex_flag\n \n regex_flag : RPAR\n \n regex_flag : COMA pattern_arg RPAR\n \n pattern_arg : CONSTANT\n \n express_arg : binary_func LPAR express_arg COMA express_arg RPAR\n \n express_arg : unary_func LPAR express_arg RPAR\n \n express_arg : UNARYOP express_arg\n \n express_arg : express_arg ARITOP express_arg\n \n express_arg : LPAR express_arg RPAR\n \n express_arg : express_arg RELOP express_arg\n \n ARITOP : PLUS\n \n ARITOP : MINUS\n \n ARITOP : TIMES\n \n ARITOP : DIV\n \n UNARYOP : PLUS\n \n UNARYOP : MINUS\n \n LOGOP : AND\n \n LOGOP : OR\n \n RELOP : EQUALS\n \n RELOP : LESS\n \n RELOP : LESSEQ\n \n RELOP : GREATER\n \n RELOP : GREATEREQ\n \n RELOP : NEQUALS\n \n binary_func : REGEX\n \n binary_func : SAMETERM\n \n binary_func : LANGMATCHES\n \n binary_func : CONSTANT\n \n binary_func : CONTAINS\n \n unary_func : BOUND\n \n unary_func : ISIRI\n \n unary_func : ISURI\n \n unary_func : ISBLANK\n \n unary_func : ISLITERAL\n \n unary_func : LANG\n \n unary_func : DATATYPE\n \n unary_func : STR\n \n unary_func : UPPERCASE\n \n unary_func : DOUBLE\n | INTEGER\n | DECIMAL\n | FLOAT\n | STRING\n | BOOLEAN\n | DATETIME\n | NONPOSINT\n | NEGATIVEINT\n | LONG\n | INT\n | SHORT\n | BYTE\n | NONNEGINT\n | UNSIGNEDLONG\n | UNSIGNEDINT\n | UNSIGNEDSHORT\n | UNSIGNEDBYTE\n | POSITIVEINT\n \n unary_func : ID COLON ID\n \n unary_func : uri\n \n unary_func : UCASE\n \n unary_func : LCASE\n \n var_list : var_list VARIABLE\n \n var_list : VARIABLE\n \n triple : subject predicate object\n \n predicate : ID\n \n predicate : uri\n \n predicate : VARIABLE\n \n subject : uri\n \n subject : VARIABLE\n \n object : uri\n \n object : VARIABLE\n \n object : CONSTANT\n '
_lr_action_items = {'LPAR':([35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,57,59,60,61,63,64,65,66,67,68,69,70,71,72,92,95,96,119,120,121,124,125,127,128,129,130,133,134,135,136,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,213,215,224,],[-105,-108,-90,-93,-113,-114,-94,-96,-112,-119,-106,-91,75,-92,-98,-101,-99,-8,-103,-95,-109,-115,77,-110,-118,-117,-107,-97,-100,-88,-89,-102,78,-104,-111,119,-6,-7,161,-86,165,-74,168,-84,-73,-85,181,183,-87,-117,185,161,161,183,208,-78,-77,-70,-81,-79,-69,183,-72,-71,-82,-80,183,183,183,-75,161,-76,208,-6,183,183,]),'SHORT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,36,-11,-14,-12,36,36,36,36,-74,-73,36,-15,-13,-16,36,36,36,36,-78,-77,-70,-81,-79,-69,36,-72,-71,-82,-80,36,36,36,-75,36,-76,36,36,36,]),'CONSTANT':([52,92,96,99,100,101,102,119,121,124,128,133,160,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,226,239,],[-8,120,-7,141,-124,-125,-123,120,120,-74,-73,120,-6,120,120,120,120,-78,-77,-70,-81,-79,-69,120,-72,-71,-82,-80,120,120,120,-75,120,-76,120,120,120,233,233,]),'LESS':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,170,-54,170,170,-67,-58,170,170,170,170,-6,170,170,170,-64,170,-63,-59,-60,-61,]),'NEG':([92,119,121,161,165,169,170,171,173,174,179,180,200,201,203,208,],[121,121,121,121,121,121,-78,-77,-81,-79,-82,-80,-75,121,-76,121,]),'NEQUALS':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,179,-54,179,179,-67,-58,179,179,179,179,-6,179,179,179,-64,179,-63,-59,-60,-61,]),'NUMBER':([18,26,92,119,121,124,128,133,161,165,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[25,34,122,122,122,-74,-73,122,122,122,206,122,122,-78,-77,-70,-81,-79,-69,122,-72,-71,-82,-80,122,122,122,-75,122,-76,122,122,122,]),'BOUND':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,67,-11,-14,-12,67,67,67,67,-74,-73,67,-15,-13,-16,67,67,67,67,-78,-77,-70,-81,-79,-69,67,-72,-71,-82,-80,67,67,67,-75,67,-76,67,67,67,]),'COMA':([52,96,120,122,123,135,184,199,206,207,211,212,213,227,228,233,234,236,237,238,241,],[-8,-7,-56,-57,-55,-54,-65,-67,-58,224,-66,226,-6,-68,-64,-62,239,-63,-59,-60,-61,]),'PREFIX':([0,3,17,],[1,1,-5,]),'ISURI':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,37,-11,-14,-12,37,37,37,37,-74,-73,37,-15,-13,-16,37,37,37,37,-78,-77,-70,-81,-79,-69,37,-72,-71,-82,-80,37,37,37,-75,37,-76,37,37,37,]),'LIMIT':([8,11,13,55,62,110,137,138,139,140,],[-4,18,-10,-14,-9,-22,-21,-15,-13,-16,]),'DIV':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,177,-54,177,177,-67,-58,177,177,177,177,-6,177,177,177,-64,177,-63,-59,-60,-61,]),'MINUS':([52,92,96,119,120,121,122,123,124,126,128,133,135,161,162,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,184,185,199,200,201,203,206,207,208,209,211,212,213,214,215,216,224,227,228,232,236,237,238,241,],[-8,124,-7,124,-56,124,-57,-55,-74,172,-73,124,-54,124,172,124,124,124,-78,-77,-70,-81,-79,-69,124,-72,-71,-82,-80,124,124,172,124,-67,-75,124,-76,-58,172,124,172,172,172,-6,172,124,172,124,172,-64,172,-63,-59,-60,-61,]),'ISBLANK':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,46,-11,-14,-12,46,46,46,46,-74,-73,46,-15,-13,-16,46,46,46,46,-78,-77,-70,-81,-79,-69,46,-72,-71,-82,-80,46,46,46,-75,46,-76,46,46,46,]),'SELECT':([0,3,4,5,7,17,],[-4,-4,9,-3,-2,-5,]),'LKEY':([31,33,52,73,74,80,82,83,84,86,87,88,96,103,104,105,106,107,108,109,111,112,113,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,166,184,186,187,188,189,190,191,193,195,196,197,199,202,204,206,209,210,211,213,217,219,223,227,228,230,231,235,236,237,238,241,],[73,74,-8,88,88,-41,106,-30,109,-4,-31,116,-7,106,106,-36,149,106,-35,88,152,88,-32,-30,158,106,-56,-57,-55,-50,-43,-54,-130,-122,-128,-129,-38,106,106,158,-4,193,88,106,-29,-30,158,106,-6,-53,-65,-37,-45,-30,217,-40,-44,158,-34,-29,-4,-67,-51,-42,-58,-50,-49,-66,-6,193,-40,-52,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'LANG':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,38,-11,-14,-12,38,38,38,38,-74,-73,38,-15,-13,-16,38,38,38,38,-78,-77,-70,-81,-79,-69,38,-72,-71,-82,-80,38,38,38,-75,38,-76,38,38,38,]),'ASC':([21,29,30,55,62,78,138,139,140,],[-4,47,-11,-14,-12,47,-15,-13,-16,]),'UNSIGNEDBYTE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,40,-11,-14,-12,40,40,40,40,-74,-73,40,-15,-13,-16,40,40,40,40,-78,-77,-70,-81,-79,-69,40,-72,-71,-82,-80,40,40,40,-75,40,-76,40,40,40,]),'TIMES':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,178,-54,178,178,-67,-58,178,178,178,178,-6,178,178,178,-64,178,-63,-59,-60,-61,]),'POINT':([52,73,74,80,82,83,86,87,88,96,103,105,108,109,112,113,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,149,150,155,156,157,158,160,166,184,186,187,188,190,191,193,195,196,197,199,202,204,206,209,210,211,213,219,223,227,228,230,231,235,236,237,238,241,],[-8,-4,-4,-41,104,-30,-4,-31,-4,-7,104,-36,-35,-4,153,-32,-30,-4,104,-56,167,-55,-50,-43,-54,-130,-122,-128,-129,-38,104,104,-4,-4,104,-29,-30,-4,-6,-53,-65,-37,-45,-30,-40,-44,-4,-34,-29,-4,-67,-51,-42,-58,-50,-49,-66,-6,-40,-52,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'DISTINCT':([9,],[15,]),'UPPERCASE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,42,-11,-14,-12,42,42,42,42,-74,-73,42,-15,-13,-16,42,42,42,42,-78,-77,-70,-81,-79,-69,42,-72,-71,-82,-80,42,42,42,-75,42,-76,42,42,42,]),'UNSIGNEDINT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,43,-11,-14,-12,43,43,43,43,-74,-73,43,-15,-13,-16,43,43,43,43,-78,-77,-70,-81,-79,-69,43,-72,-71,-82,-80,43,43,43,-75,43,-76,43,43,43,]),'SAMETERM':([92,119,121,124,128,133,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[127,127,127,-74,-73,127,127,127,127,127,-78,-77,-70,-81,-79,-69,127,-72,-71,-82,-80,127,127,127,-75,127,-76,127,127,127,]),'LCASE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,44,-11,-14,-12,44,44,44,44,-74,-73,44,-15,-13,-16,44,44,44,44,-78,-77,-70,-81,-79,-69,44,-72,-71,-82,-80,44,44,44,-75,44,-76,44,44,44,]),'LONG':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,45,-11,-14,-12,45,45,45,45,-74,-73,45,-15,-13,-16,45,45,45,45,-78,-77,-70,-81,-79,-69,45,-72,-71,-82,-80,45,45,45,-75,45,-76,45,45,45,]),'ORDER':([8,110,137,],[12,-22,-21,]),'UNSIGNEDSHORT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,39,-11,-14,-12,39,39,39,39,-74,-73,39,-15,-13,-16,39,39,39,39,-78,-77,-70,-81,-79,-69,39,-72,-71,-82,-80,39,39,39,-75,39,-76,39,39,39,]),'GREATEREQ':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,173,-54,173,173,-67,-58,173,173,173,173,-6,173,173,173,-64,173,-63,-59,-60,-61,]),'LESSEQ':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,174,-54,174,174,-67,-58,174,174,174,174,-6,174,174,174,-64,174,-63,-59,-60,-61,]),'COLON':([6,58,90,102,131,],[10,76,118,118,182,]),'LANGMATCHES':([92,119,121,124,128,133,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[129,129,129,-74,-73,129,129,129,129,129,-78,-77,-70,-81,-79,-69,129,-72,-71,-82,-80,129,129,129,-75,129,-76,129,129,129,]),'ISLITERAL':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,48,-11,-14,-12,48,48,48,48,-74,-73,48,-15,-13,-16,48,48,48,48,-78,-77,-70,-81,-79,-69,48,-72,-71,-82,-80,48,48,48,-75,48,-76,48,48,48,]),'OPTIONAL':([52,73,74,80,82,83,86,87,88,96,103,104,105,106,107,108,109,112,113,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,166,184,186,187,188,189,190,191,193,195,196,197,199,202,204,206,209,210,211,213,217,219,223,227,228,230,231,235,236,237,238,241,],[-8,84,84,-41,84,-30,-4,-31,84,-7,84,84,-36,84,84,-35,84,84,-32,-30,84,84,-56,-57,-55,-50,-43,-54,-130,-122,-128,-129,-38,84,84,84,-4,84,84,84,-29,-30,84,84,-6,-53,-65,-37,-45,-30,84,-40,-44,84,-34,-29,-4,-67,-51,-42,-58,-50,-49,-66,-6,84,-40,-52,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'$end':([2,8,11,13,19,20,25,27,28,34,55,62,110,137,138,139,140,],[0,-4,-4,-10,-4,-18,-17,-1,-20,-19,-14,-9,-22,-21,-15,-13,-16,]),'PLUS':([52,92,96,119,120,121,122,123,124,126,128,133,135,161,162,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,184,185,199,200,201,203,206,207,208,209,211,212,213,214,215,216,224,227,228,232,236,237,238,241,],[-8,128,-7,128,-56,128,-57,-55,-74,175,-73,128,-54,128,175,128,128,128,-78,-77,-70,-81,-79,-69,128,-72,-71,-82,-80,128,128,175,128,-67,-75,128,-76,-58,175,128,175,175,175,-6,175,128,175,128,175,-64,175,-63,-59,-60,-61,]),'CONTAINS':([92,119,121,124,128,133,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[134,134,134,-74,-73,134,134,134,134,134,-78,-77,-70,-81,-79,-69,134,-72,-71,-82,-80,134,134,134,-75,134,-76,134,134,134,]),'RPAR':([52,55,94,96,97,98,120,122,123,126,135,138,139,140,162,163,164,166,184,198,199,202,205,206,209,210,211,213,214,216,220,221,222,223,225,227,228,232,233,234,236,237,238,240,241,],[-8,-14,138,-7,139,140,-56,-57,-55,-50,-54,-15,-13,-16,199,202,204,-53,-65,220,-67,-51,223,-58,-50,-49,-66,-6,199,228,-48,-47,-46,-52,202,-68,-64,236,-62,238,-63,-59,-60,241,-61,]),'STRING':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,50,-11,-14,-12,50,50,50,50,-74,-73,50,-15,-13,-16,50,50,50,50,-78,-77,-70,-81,-79,-69,50,-72,-71,-82,-80,50,50,50,-75,50,-76,50,50,50,]),'UNION':([52,73,74,80,82,83,86,87,88,96,103,105,108,109,113,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,149,150,155,156,157,158,160,166,184,186,187,188,190,191,192,193,195,196,197,199,202,204,206,209,210,211,213,219,223,227,228,229,230,231,235,236,237,238,241,],[-8,-4,-4,-41,107,-30,111,-31,-4,-7,107,-36,-35,-4,-32,-30,-4,159,-56,-57,-55,-50,-43,-54,-130,-122,-128,-129,-38,107,159,-4,189,-4,-29,-30,-4,-6,-53,-65,-37,-45,-30,-40,-44,111,-4,-34,-29,189,-67,-51,-42,-58,-50,-49,-66,-6,-40,-52,-68,-64,111,111,-39,-33,-63,-59,-60,-61,]),'DECIMAL':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,51,-11,-14,-12,51,51,51,51,-74,-73,51,-15,-13,-16,51,51,51,51,-78,-77,-70,-81,-79,-69,51,-72,-71,-82,-80,51,51,51,-75,51,-76,51,51,51,]),'RKEY':([52,73,74,79,80,82,83,85,86,87,88,93,96,103,105,108,109,112,113,114,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,148,149,150,151,153,154,155,156,157,158,160,166,184,186,187,188,190,191,192,193,194,195,196,197,199,202,204,206,209,210,211,213,218,219,223,227,228,229,230,231,235,236,237,238,241,],[-8,-4,-4,-25,-41,-4,-30,110,-4,-31,-4,137,-7,-4,-36,-35,-4,-4,-32,155,156,-4,-4,-56,-57,-55,-50,-43,-54,-130,-122,-128,-129,-38,-4,-4,187,-4,-4,191,-4,-27,-4,-29,196,-4,-6,-53,-65,-37,-45,187,-40,-44,-4,-4,-26,-34,-29,-4,-67,-51,-42,-58,-50,-49,-66,-6,230,231,-52,-68,-64,187,-4,-39,-33,-63,-59,-60,-61,]),'URI':([10,21,29,30,52,55,62,73,74,76,78,80,81,82,83,86,87,88,89,91,92,96,99,100,101,102,103,104,105,106,107,108,109,112,113,115,116,117,118,119,120,121,122,123,124,126,128,132,133,135,138,139,140,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,161,165,166,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,193,195,196,197,199,200,201,202,203,204,206,208,209,210,211,213,215,217,219,223,224,227,228,230,231,235,236,237,238,241,],[17,-4,52,-11,-8,-14,-12,52,52,96,52,-41,52,52,-30,-4,-31,52,-127,-126,52,-7,52,-124,-125,-123,52,52,-36,52,52,-35,52,52,-32,-30,52,52,96,52,-56,52,-57,-55,-74,-50,-73,-43,52,-54,-15,-13,-16,-130,-122,-128,-129,-38,52,52,52,-4,52,52,52,-29,-30,52,52,-6,52,52,-53,52,52,-78,-77,-70,-81,-79,-69,52,-72,-71,-82,-80,52,96,52,-65,52,-37,-45,-30,52,-40,-44,52,-34,-29,-4,-67,-75,52,-51,-76,-42,-58,52,-50,-49,-66,-6,52,52,-40,-52,52,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'DATETIME':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,53,-11,-14,-12,53,53,53,53,-74,-73,53,-15,-13,-16,53,53,53,53,-78,-77,-70,-81,-79,-69,53,-72,-71,-82,-80,53,53,53,-75,53,-76,53,53,53,]),'EQUALS':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,171,-54,171,171,-67,-58,171,171,171,171,-6,171,171,171,-64,171,-63,-59,-60,-61,]),'REGEX':([92,119,121,124,128,133,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[130,130,130,-74,-73,130,130,130,130,130,-78,-77,-70,-81,-79,-69,130,-72,-71,-82,-80,130,130,130,-75,130,-76,130,130,130,]),'STR':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,54,-11,-14,-12,54,54,54,54,-74,-73,54,-15,-13,-16,54,54,54,54,-78,-77,-70,-81,-79,-69,54,-72,-71,-82,-80,54,54,54,-75,54,-76,54,54,54,]),'OFFSET':([8,11,13,19,20,25,55,62,110,137,138,139,140,],[-4,-4,-10,26,-18,-17,-14,-9,-22,-21,-15,-13,-16,]),'VARIABLE':([9,14,15,16,21,23,24,29,30,32,52,55,62,73,74,75,77,78,80,81,82,83,86,87,88,89,91,92,96,99,100,101,102,103,104,105,106,107,108,109,112,113,115,116,117,119,120,121,122,123,124,126,128,132,133,135,138,139,140,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,161,165,166,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,184,185,186,187,188,189,190,191,193,195,196,197,199,200,201,202,203,204,206,208,209,210,211,213,215,217,219,223,224,227,228,230,231,235,236,237,238,241,],[-4,23,-23,-24,-4,-121,32,55,-11,-120,-8,-14,-12,89,89,94,97,55,-41,101,89,-30,-4,-31,89,-127,-126,123,-7,144,-124,-125,-123,89,89,-36,89,89,-35,89,89,-32,-30,89,89,123,-56,123,-57,-55,-74,-50,-73,-43,123,-54,-15,-13,-16,-130,-122,-128,-129,-38,89,89,89,-4,89,89,89,-29,-30,89,89,-6,123,123,-53,123,123,-78,-77,-70,-81,-79,-69,123,-72,-71,-82,-80,123,123,-65,123,-37,-45,-30,89,-40,-44,89,-34,-29,-4,-67,-75,123,-51,-76,-42,-58,123,-50,-49,-66,-6,123,89,-40,-52,123,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'BYTE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,56,-11,-14,-12,56,56,56,56,-74,-73,56,-15,-13,-16,56,56,56,56,-78,-77,-70,-81,-79,-69,56,-72,-71,-82,-80,56,56,56,-75,56,-76,56,56,56,]),'POSITIVEINT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,57,-11,-14,-12,57,57,57,57,-74,-73,57,-15,-13,-16,57,57,57,57,-78,-77,-70,-81,-79,-69,57,-72,-71,-82,-80,57,57,57,-75,57,-76,57,57,57,]),'BY':([12,],[21,]),'ID':([1,21,29,30,52,55,62,73,74,76,78,80,81,82,83,86,87,88,89,91,92,96,99,100,101,102,103,104,105,106,107,108,109,112,113,115,116,117,118,119,120,121,122,123,124,126,128,132,133,135,138,139,140,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,161,165,166,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,193,195,196,197,199,200,201,202,203,204,206,208,209,210,211,213,215,217,219,223,224,227,228,230,231,235,236,237,238,241,],[6,-4,58,-11,-8,-14,-12,90,90,95,58,-41,102,90,-30,-4,-31,90,-127,-126,131,-7,90,-124,-125,-123,90,90,-36,90,90,-35,90,90,-32,-30,90,90,160,131,-56,131,-57,-55,-74,-50,-73,-43,131,-54,-15,-13,-16,-130,-122,-128,-129,-38,90,90,90,-4,90,90,90,-29,-30,90,90,-6,131,131,-53,131,131,-78,-77,-70,-81,-79,-69,131,-72,-71,-82,-80,131,213,131,-65,131,-37,-45,-30,90,-40,-44,90,-34,-29,-4,-67,-75,131,-51,-76,-42,-58,131,-50,-49,-66,-6,131,90,-40,-52,131,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'DESC':([21,29,30,55,62,78,138,139,140,],[-4,59,-11,-14,-12,59,-15,-13,-16,]),'AND':([52,96,120,122,123,126,135,162,163,166,184,199,202,206,209,210,211,213,221,223,227,228,236,237,238,241,],[-8,-7,-56,-57,-55,-50,-54,-50,200,-53,-65,-67,-51,-58,-50,-49,-66,-6,200,-52,-68,-64,-63,-59,-60,-61,]),'OR':([52,96,120,122,123,126,135,162,163,166,184,199,202,206,209,210,211,213,221,223,227,228,236,237,238,241,],[-8,-7,-56,-57,-55,-50,-54,-50,203,-53,-65,-67,-51,-58,-50,-49,-66,-6,203,-52,-68,-64,-63,-59,-60,-61,]),'ALL':([9,14,15,16,],[-4,22,-23,-24,]),'NEGATIVEINT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,35,-11,-14,-12,35,35,35,35,-74,-73,35,-15,-13,-16,35,35,35,35,-78,-77,-70,-81,-79,-69,35,-72,-71,-82,-80,35,35,35,-75,35,-76,35,35,35,]),'UCASE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,61,-11,-14,-12,61,61,61,61,-74,-73,61,-15,-13,-16,61,61,61,61,-78,-77,-70,-81,-79,-69,61,-72,-71,-82,-80,61,61,61,-75,61,-76,61,61,61,]),'GREATER':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,180,-54,180,180,-67,-58,180,180,180,180,-6,180,180,180,-64,180,-63,-59,-60,-61,]),'INT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,64,-11,-14,-12,64,64,64,64,-74,-73,64,-15,-13,-16,64,64,64,64,-78,-77,-70,-81,-79,-69,64,-72,-71,-82,-80,64,64,64,-75,64,-76,64,64,64,]),'INTEGER':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,49,-11,-14,-12,49,49,49,49,-74,-73,49,-15,-13,-16,49,49,49,49,-78,-77,-70,-81,-79,-69,49,-72,-71,-82,-80,49,49,49,-75,49,-76,49,49,49,]),'FLOAT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,66,-11,-14,-12,66,66,66,66,-74,-73,66,-15,-13,-16,66,66,66,66,-78,-77,-70,-81,-79,-69,66,-72,-71,-82,-80,66,66,66,-75,66,-76,66,66,66,]),'NONNEGINT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,60,-11,-14,-12,60,60,60,60,-74,-73,60,-15,-13,-16,60,60,60,60,-78,-77,-70,-81,-79,-69,60,-72,-71,-82,-80,60,60,60,-75,60,-76,60,60,60,]),'ISIRI':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,68,-11,-14,-12,68,68,68,68,-74,-73,68,-15,-13,-16,68,68,68,68,-78,-77,-70,-81,-79,-69,68,-72,-71,-82,-80,68,68,68,-75,68,-76,68,68,68,]),'WHERE':([22,23,24,32,],[31,-121,33,-120,]),'DATATYPE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,41,-11,-14,-12,41,41,41,41,-74,-73,41,-15,-13,-16,41,41,41,41,-78,-77,-70,-81,-79,-69,41,-72,-71,-82,-80,41,41,41,-75,41,-76,41,41,41,]),'BOOLEAN':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,69,-11,-14,-12,69,69,69,69,-74,-73,69,-15,-13,-16,69,69,69,69,-78,-77,-70,-81,-79,-69,69,-72,-71,-82,-80,69,69,69,-75,69,-76,69,69,69,]),'FILTER':([52,73,74,80,82,83,86,87,88,96,103,104,105,106,107,108,109,112,113,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,166,184,186,187,188,189,190,191,193,195,196,197,199,202,204,206,209,210,211,213,217,219,223,227,228,230,231,235,236,237,238,241,],[-8,92,92,-41,92,-30,-4,-31,92,-7,92,92,-36,92,92,-35,92,92,-32,-30,92,92,-56,-57,-55,-50,-43,-54,-130,-122,-128,-129,-38,92,92,92,-4,92,92,92,-29,-30,92,92,-6,-53,-65,-37,-45,-30,92,-40,-44,92,-34,-29,-4,-67,-51,-42,-58,-50,-49,-66,-6,92,-40,-52,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'DOUBLE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,65,-11,-14,-12,65,65,65,65,-74,-73,65,-15,-13,-16,65,65,65,65,-78,-77,-70,-81,-79,-69,65,-72,-71,-82,-80,65,65,65,-75,65,-76,65,65,65,]),'NONPOSINT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,71,-11,-14,-12,71,71,71,71,-74,-73,71,-15,-13,-16,71,71,71,71,-78,-77,-70,-81,-79,-69,71,-72,-71,-82,-80,71,71,71,-75,71,-76,71,71,71,]),'UNSIGNEDLONG':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,72,-11,-14,-12,72,72,72,72,-74,-73,72,-15,-13,-16,72,72,72,72,-78,-77,-70,-81,-79,-69,72,-72,-71,-82,-80,72,72,72,-75,72,-76,72,72,72,]),}
_lr_action = {}
for _k, _v in _lr_action_items.items():
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_action: _lr_action[_x] = {}
_lr_action[_x][_k] = _y
del _lr_action_items
_lr_goto_items = {'LOGOP':([163,221,],[201,201,]),'regex_flag':([234,],[237,]),'parse_sparql':([0,],[2,]),'rest_union_block':([86,150,192,197,229,230,],[112,190,218,219,218,235,]),'prefix':([0,3,],[3,3,]),'triple':([73,74,82,88,103,104,106,107,109,112,116,117,146,147,149,152,153,155,158,159,189,193,217,],[80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,]),'union_block':([73,74,88,109,116,149,158,193,],[79,79,114,79,114,114,114,114,]),'query':([4,],[8,]),'var_list':([14,],[24,]),'subject':([73,74,82,88,103,104,106,107,109,112,116,117,146,147,149,152,153,155,158,159,189,193,217,],[81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,]),'binary_func':([92,119,121,133,161,165,168,169,176,181,183,185,201,208,215,224,],[125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,]),'order_by':([8,],[11,]),'distinct':([9,],[14,]),'express_arg':([92,119,121,133,161,165,168,169,176,181,183,185,201,208,215,224,],[126,162,126,184,162,162,207,209,211,212,214,216,126,162,227,232,]),'group_graph_pattern':([73,74,109,],[85,93,151,]),'pjoin_block':([73,74,88,109,112,116,149,153,158,193,],[86,86,86,86,154,86,86,194,86,86,]),'var_order_list':([21,],[29,]),'prefix_list':([0,3,],[4,7,]),'empty':([0,3,8,9,11,19,21,73,74,82,86,88,103,109,112,116,117,146,147,149,150,153,155,158,192,193,197,229,230,],[5,5,13,16,20,28,30,87,87,105,113,87,105,87,87,87,105,105,105,87,113,87,105,87,113,87,113,113,113,]),'ARITOP':([126,162,184,207,209,211,212,214,216,227,232,],[176,176,176,176,176,176,176,176,176,176,176,]),'predicate':([81,],[99,]),'RELOP':([126,162,184,207,209,211,212,214,216,227,232,],[169,169,215,215,169,215,215,215,215,215,215,]),'object':([99,],[142,]),'rest_join_block':([82,103,117,146,147,155,],[108,145,108,186,108,195,]),'pattern_arg':([226,239,],[234,240,]),'offset':([19,],[27,]),'join_block':([73,74,88,106,109,112,116,149,152,153,158,193,217,],[83,83,115,148,83,83,157,188,192,83,157,188,229,]),'express_rel':([92,119,121,161,165,169,201,208,],[132,163,166,163,163,210,221,225,]),'desc_var':([29,78,],[62,98,]),'UNARYOP':([92,119,121,133,161,165,168,169,176,181,183,185,201,208,215,224,],[133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,]),'uri':([29,73,74,78,81,82,88,92,99,103,104,106,107,109,112,116,117,119,121,133,146,147,149,152,153,155,158,159,161,165,168,169,176,181,183,185,189,193,201,208,215,217,224,],[63,91,91,63,100,91,91,135,143,91,91,91,91,91,91,91,91,135,135,135,91,91,91,91,91,91,91,91,135,135,135,135,135,135,135,135,91,91,135,135,135,91,135,]),'bgp':([73,74,82,88,103,104,106,107,109,112,116,117,146,147,149,152,153,155,158,159,189,193,217,],[82,82,103,117,103,146,147,150,82,82,147,103,103,103,147,82,82,103,147,197,150,147,117,]),'limit':([11,],[19,]),'unary_func':([29,78,92,119,121,133,161,165,168,169,176,181,183,185,201,208,215,224,],[70,70,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,]),'expression':([119,161,165,201,],[164,198,205,222,]),}
_lr_goto = {}
for _k, _v in _lr_goto_items.items():
for _x, _y in zip(_v[0], _v[1]):
if not _x in _lr_goto: _lr_goto[_x] = {}
_lr_goto[_x][_k] = _y
del _lr_goto_items
_lr_productions = [
("S' -> parse_sparql","S'",1,None,None,None),
('parse_sparql -> prefix_list query order_by limit offset','parse_sparql',5,'p_parse_sparql','sparql_parser.py',168),
('prefix_list -> prefix prefix_list','prefix_list',2,'p_prefix_list','sparql_parser.py',176),
('prefix_list -> empty','prefix_list',1,'p_empty_prefix_list','sparql_parser.py',184),
('empty -> <empty>','empty',0,'p_empty','sparql_parser.py',192),
('prefix -> PREFIX ID COLON URI','prefix',4,'p_prefix','sparql_parser.py',199),
('uri -> ID COLON ID','uri',3,'p_uri_0','sparql_parser.py',206),
('uri -> ID COLON URI','uri',3,'p_uri_1','sparql_parser.py',219),
('uri -> URI','uri',1,'p_uri_2','sparql_parser.py',226),
('order_by -> ORDER BY var_order_list desc_var','order_by',4,'p_order_by_0','sparql_parser.py',233),
('order_by -> empty','order_by',1,'p_order_by_1','sparql_parser.py',240),
('var_order_list -> empty','var_order_list',1,'p_var_order_list_0','sparql_parser.py',247),
('var_order_list -> var_order_list desc_var','var_order_list',2,'p_var_order_list_1','sparql_parser.py',254),
('desc_var -> DESC LPAR VARIABLE RPAR','desc_var',4,'p_desc_var_0','sparql_parser.py',261),
('desc_var -> VARIABLE','desc_var',1,'p_desc_var_1','sparql_parser.py',268),
('desc_var -> ASC LPAR VARIABLE RPAR','desc_var',4,'p_desc_var_2','sparql_parser.py',275),
('desc_var -> unary_func LPAR desc_var RPAR','desc_var',4,'p_desc_var_3','sparql_parser.py',282),
('limit -> LIMIT NUMBER','limit',2,'p_limit_0','sparql_parser.py',289),
('limit -> empty','limit',1,'p_limit_1','sparql_parser.py',296),
('offset -> OFFSET NUMBER','offset',2,'p_offset_0','sparql_parser.py',303),
('offset -> empty','offset',1,'p_offset_1','sparql_parser.py',310),
('query -> SELECT distinct var_list WHERE LKEY group_graph_pattern RKEY','query',7,'p_query_0','sparql_parser.py',317),
('query -> SELECT distinct ALL WHERE LKEY group_graph_pattern RKEY','query',7,'p_query_1','sparql_parser.py',324),
('distinct -> DISTINCT','distinct',1,'p_distinct_0','sparql_parser.py',331),
('distinct -> empty','distinct',1,'p_distinct_1','sparql_parser.py',338),
('group_graph_pattern -> union_block','group_graph_pattern',1,'p_ggp_0','sparql_parser.py',345),
('union_block -> pjoin_block rest_union_block POINT pjoin_block','union_block',4,'p_union_block_0','sparql_parser.py',352),
('union_block -> pjoin_block rest_union_block pjoin_block','union_block',3,'p_union_block_1','sparql_parser.py',361),
('union_block -> pjoin_block rest_union_block','union_block',2,'p_union_block_2','sparql_parser.py',373),
('pjoin_block -> LKEY join_block RKEY','pjoin_block',3,'p_ppjoin_block_0','sparql_parser.py',380),
('pjoin_block -> join_block','pjoin_block',1,'p_ppjoin_block_1','sparql_parser.py',387),
('pjoin_block -> empty','pjoin_block',1,'p_ppjoin_block_2','sparql_parser.py',394),
('rest_union_block -> empty','rest_union_block',1,'p_rest_union_block_0','sparql_parser.py',401),
('rest_union_block -> UNION LKEY join_block rest_union_block RKEY rest_union_block','rest_union_block',6,'p_rest_union_block_1','sparql_parser.py',408),
('join_block -> LKEY union_block RKEY rest_join_block','join_block',4,'p_join_block_0','sparql_parser.py',415),
('join_block -> bgp rest_join_block','join_block',2,'p_join_block_1','sparql_parser.py',427),
('rest_join_block -> empty','rest_join_block',1,'p_rest_join_block_0','sparql_parser.py',434),
('rest_join_block -> POINT bgp rest_join_block','rest_join_block',3,'p_rest_join_block_1','sparql_parser.py',441),
('rest_join_block -> bgp rest_join_block','rest_join_block',2,'p_rest_join_block_2','sparql_parser.py',448),
('bgp -> LKEY bgp UNION bgp rest_union_block RKEY','bgp',6,'p_bgp_0','sparql_parser.py',455),
('bgp -> bgp UNION bgp rest_union_block','bgp',4,'p_bgp_01','sparql_parser.py',463),
('bgp -> triple','bgp',1,'p_bgp_1','sparql_parser.py',471),
('bgp -> FILTER LPAR expression RPAR','bgp',4,'p_bgp_2','sparql_parser.py',478),
('bgp -> FILTER express_rel','bgp',2,'p_bgp_3','sparql_parser.py',485),
('bgp -> OPTIONAL LKEY group_graph_pattern RKEY','bgp',4,'p_bgp_4','sparql_parser.py',492),
('bgp -> LKEY join_block RKEY','bgp',3,'p_bgp_6','sparql_parser.py',506),
('expression -> express_rel LOGOP expression','expression',3,'p_expression_0','sparql_parser.py',516),
('expression -> express_rel','expression',1,'p_expression_1','sparql_parser.py',523),
('expression -> LPAR expression RPAR','expression',3,'p_expression_2','sparql_parser.py',530),
('express_rel -> express_arg RELOP express_rel','express_rel',3,'p_express_rel_0','sparql_parser.py',537),
('express_rel -> express_arg','express_rel',1,'p_express_rel_1','sparql_parser.py',544),
('express_rel -> LPAR express_rel RPAR','express_rel',3,'p_express_rel_2','sparql_parser.py',551),
('express_rel -> NEG LPAR expression RPAR','express_rel',4,'p_express_rel_3','sparql_parser.py',558),
('express_rel -> NEG express_rel','express_rel',2,'p_express_rel_4','sparql_parser.py',565),
('express_arg -> uri','express_arg',1,'p_express_arg_0','sparql_parser.py',572),
('express_arg -> VARIABLE','express_arg',1,'p_express_arg_1','sparql_parser.py',579),
('express_arg -> CONSTANT','express_arg',1,'p_express_arg_2','sparql_parser.py',586),
('express_arg -> NUMBER','express_arg',1,'p_express_arg_3','sparql_parser.py',593),
('express_arg -> NUMBER POINT NUMBER','express_arg',3,'p_express_arg_03','sparql_parser.py',600),
('express_arg -> REGEX LPAR express_arg COMA pattern_arg regex_flag','express_arg',6,'p_express_arg_4','sparql_parser.py',608),
('regex_flag -> RPAR','regex_flag',1,'p_regex_flags_0','sparql_parser.py',615),
('regex_flag -> COMA pattern_arg RPAR','regex_flag',3,'p_regex_flags_1','sparql_parser.py',622),
('pattern_arg -> CONSTANT','pattern_arg',1,'p_pattern_arg_0','sparql_parser.py',629),
('express_arg -> binary_func LPAR express_arg COMA express_arg RPAR','express_arg',6,'p_express_arg_5','sparql_parser.py',636),
('express_arg -> unary_func LPAR express_arg RPAR','express_arg',4,'p_express_arg_6','sparql_parser.py',643),
('express_arg -> UNARYOP express_arg','express_arg',2,'p_express_arg_7','sparql_parser.py',650),
('express_arg -> express_arg ARITOP express_arg','express_arg',3,'p_express_arg_8','sparql_parser.py',657),
('express_arg -> LPAR express_arg RPAR','express_arg',3,'p_express_arg_9','sparql_parser.py',664),
('express_arg -> express_arg RELOP express_arg','express_arg',3,'p_express_arg_10','sparql_parser.py',671),
('ARITOP -> PLUS','ARITOP',1,'p_arit_op_0','sparql_parser.py',678),
('ARITOP -> MINUS','ARITOP',1,'p_arit_op_1','sparql_parser.py',685),
('ARITOP -> TIMES','ARITOP',1,'p_arit_op_2','sparql_parser.py',692),
('ARITOP -> DIV','ARITOP',1,'p_arit_op_3','sparql_parser.py',699),
('UNARYOP -> PLUS','UNARYOP',1,'p_unaryarit_op_1','sparql_parser.py',706),
('UNARYOP -> MINUS','UNARYOP',1,'p_unaryarit_op_2','sparql_parser.py',713),
('LOGOP -> AND','LOGOP',1,'p_logical_op_0','sparql_parser.py',720),
('LOGOP -> OR','LOGOP',1,'p_logical_op_1','sparql_parser.py',727),
('RELOP -> EQUALS','RELOP',1,'p_relational_op_0','sparql_parser.py',734),
('RELOP -> LESS','RELOP',1,'p_relational_op_1','sparql_parser.py',741),
('RELOP -> LESSEQ','RELOP',1,'p_relational_op_2','sparql_parser.py',748),
('RELOP -> GREATER','RELOP',1,'p_relational_op_3','sparql_parser.py',755),
('RELOP -> GREATEREQ','RELOP',1,'p_relational_op_4','sparql_parser.py',762),
('RELOP -> NEQUALS','RELOP',1,'p_relational_op_5','sparql_parser.py',769),
('binary_func -> REGEX','binary_func',1,'p_binary_0','sparql_parser.py',776),
('binary_func -> SAMETERM','binary_func',1,'p_binary_1','sparql_parser.py',783),
('binary_func -> LANGMATCHES','binary_func',1,'p_binary_2','sparql_parser.py',790),
('binary_func -> CONSTANT','binary_func',1,'p_binary_3','sparql_parser.py',797),
('binary_func -> CONTAINS','binary_func',1,'p_binary_4','sparql_parser.py',804),
('unary_func -> BOUND','unary_func',1,'p_unary_0','sparql_parser.py',811),
('unary_func -> ISIRI','unary_func',1,'p_unary_1','sparql_parser.py',818),
('unary_func -> ISURI','unary_func',1,'p_unary_2','sparql_parser.py',825),
('unary_func -> ISBLANK','unary_func',1,'p_unary_3','sparql_parser.py',832),
('unary_func -> ISLITERAL','unary_func',1,'p_unary_4','sparql_parser.py',839),
('unary_func -> LANG','unary_func',1,'p_unary_5','sparql_parser.py',846),
('unary_func -> DATATYPE','unary_func',1,'p_unary_6','sparql_parser.py',853),
('unary_func -> STR','unary_func',1,'p_unary_7','sparql_parser.py',860),
('unary_func -> UPPERCASE','unary_func',1,'p_unary_8','sparql_parser.py',867),
('unary_func -> DOUBLE','unary_func',1,'p_unary_9','sparql_parser.py',874),
('unary_func -> INTEGER','unary_func',1,'p_unary_9','sparql_parser.py',875),
('unary_func -> DECIMAL','unary_func',1,'p_unary_9','sparql_parser.py',876),
('unary_func -> FLOAT','unary_func',1,'p_unary_9','sparql_parser.py',877),
('unary_func -> STRING','unary_func',1,'p_unary_9','sparql_parser.py',878),
('unary_func -> BOOLEAN','unary_func',1,'p_unary_9','sparql_parser.py',879),
('unary_func -> DATETIME','unary_func',1,'p_unary_9','sparql_parser.py',880),
('unary_func -> NONPOSINT','unary_func',1,'p_unary_9','sparql_parser.py',881),
('unary_func -> NEGATIVEINT','unary_func',1,'p_unary_9','sparql_parser.py',882),
('unary_func -> LONG','unary_func',1,'p_unary_9','sparql_parser.py',883),
('unary_func -> INT','unary_func',1,'p_unary_9','sparql_parser.py',884),
('unary_func -> SHORT','unary_func',1,'p_unary_9','sparql_parser.py',885),
('unary_func -> BYTE','unary_func',1,'p_unary_9','sparql_parser.py',886),
('unary_func -> NONNEGINT','unary_func',1,'p_unary_9','sparql_parser.py',887),
('unary_func -> UNSIGNEDLONG','unary_func',1,'p_unary_9','sparql_parser.py',888),
('unary_func -> UNSIGNEDINT','unary_func',1,'p_unary_9','sparql_parser.py',889),
('unary_func -> UNSIGNEDSHORT','unary_func',1,'p_unary_9','sparql_parser.py',890),
('unary_func -> UNSIGNEDBYTE','unary_func',1,'p_unary_9','sparql_parser.py',891),
('unary_func -> POSITIVEINT','unary_func',1,'p_unary_9','sparql_parser.py',892),
('unary_func -> ID COLON ID','unary_func',3,'p_unary_10','sparql_parser.py',899),
('unary_func -> uri','unary_func',1,'p_unary_11','sparql_parser.py',906),
('unary_func -> UCASE','unary_func',1,'p_unary_12','sparql_parser.py',913),
('unary_func -> LCASE','unary_func',1,'p_unary_13','sparql_parser.py',920),
('var_list -> var_list VARIABLE','var_list',2,'p_var_list','sparql_parser.py',927),
('var_list -> VARIABLE','var_list',1,'p_single_var_list','sparql_parser.py',934),
('triple -> subject predicate object','triple',3,'p_triple_0','sparql_parser.py',941),
('predicate -> ID','predicate',1,'p_predicate_rdftype','sparql_parser.py',948),
('predicate -> uri','predicate',1,'p_predicate_uri','sparql_parser.py',962),
('predicate -> VARIABLE','predicate',1,'p_predicate_var','sparql_parser.py',969),
('subject -> uri','subject',1,'p_subject_uri','sparql_parser.py',976),
('subject -> VARIABLE','subject',1,'p_subject_variable','sparql_parser.py',983),
('object -> uri','object',1,'p_object_uri','sparql_parser.py',991),
('object -> VARIABLE','object',1,'p_object_variable','sparql_parser.py',998),
('object -> CONSTANT','object',1,'p_object_constant','sparql_parser.py',1005),
]
|
# region order
afr = 'Africa and Middle East'
lam = 'Central and South America'
chn = 'East Asia'
oecd = 'North America, Europe, Russia, Central Asia, and Pacific OECD'
asia = 'South and South East Asia, Other Pacific'
# new region values from Zig
r10sas = 'Southern Asia'
r10eur = 'Europe'
r10afr = 'Africa'
r10sea = 'South-East Asia and Developing Pacific'
r10lam = 'Latin America and Caribbean'
r10era = 'Eurasia'
r10apd = 'Asia-Pacific Developed'
r10mea = 'Middle East'
r10nam = 'North America'
r10eas = 'Eastern Asia' |
def is_leap_year(year):
leap = False
if(year % 4 == 0):
leap = True
if(year % 100 == 0):
leap = False
if(year % 400 == 0):
leap = True
return leap |
#
# PySNMP MIB module HUAWEI-ATM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-ATM-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:42:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint")
AtmVpIdentifier, AtmVcIdentifier = mibBuilder.importSymbols("ATM-TC-MIB", "AtmVpIdentifier", "AtmVcIdentifier")
hwDatacomm, = mibBuilder.importSymbols("HUAWEI-MIB", "hwDatacomm")
InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
ObjectIdentity, iso, Unsigned32, Counter64, Bits, TimeTicks, Counter32, NotificationType, ModuleIdentity, IpAddress, Integer32, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "iso", "Unsigned32", "Counter64", "Bits", "TimeTicks", "Counter32", "NotificationType", "ModuleIdentity", "IpAddress", "Integer32", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier")
TextualConvention, DisplayString, RowStatus, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus", "TruthValue")
hwAtmMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156))
if mibBuilder.loadTexts: hwAtmMIB.setLastUpdated('200710172230Z')
if mibBuilder.loadTexts: hwAtmMIB.setOrganization('Huawei Technologies co.,Ltd.')
if mibBuilder.loadTexts: hwAtmMIB.setContactInfo('VRP Team Huawei Technologies co.,Ltd. Huawei Bld.,NO.3 Xinxi Rd., Shang-Di Information Industry Base, Hai-Dian District Beijing P.R. China http://www.huawei.com Zip:100085 ')
if mibBuilder.loadTexts: hwAtmMIB.setDescription('This MIB is mainly used to configure the ATM OC-3/STM-1 and ATM OC-12/STM-4 interface, IPoA, IPoEoA, PVC service type, OAM F5 loopback, parameters of the VP limit, and mapping between the peer VPI and the local VPI.')
hwAtmObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1))
hwAtmTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 1), )
if mibBuilder.loadTexts: hwAtmTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmTable.setDescription('This table is used to configure the parameters of the ATM interface.')
hwAtmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 1, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmIfIndex"))
if mibBuilder.loadTexts: hwAtmEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmEntry.setDescription('This table is used to configure the parameters of the ATM interface.')
hwAtmIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 1, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: hwAtmIfIndex.setStatus('current')
if mibBuilder.loadTexts: hwAtmIfIndex.setDescription('Indicates the interface index.')
hwAtmIfType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("oc3OrStm1", 1), ("oc12OrStm4", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwAtmIfType.setStatus('current')
if mibBuilder.loadTexts: hwAtmIfType.setDescription('Indicates the interface type.')
hwAtmClock = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("master", 1), ("slave", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwAtmClock.setStatus('current')
if mibBuilder.loadTexts: hwAtmClock.setDescription('Master clock: uses the internal clock signal. Slave clock: uses the line clock signal.')
hwAtmFrameFormat = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("sdh", 1), ("sonet", 2))).clone('sdh')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwAtmFrameFormat.setStatus('current')
if mibBuilder.loadTexts: hwAtmFrameFormat.setDescription('For the optical interface STM-1/STM-4, the frame format on the ATM interface is SDH; for the OC-3/OC-12 interface, the frame format is SONET. The default frame format is SDH.')
hwAtmScramble = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 1, 1, 14), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwAtmScramble.setStatus('current')
if mibBuilder.loadTexts: hwAtmScramble.setDescription('By default, the scramble function is enabled. The scramble function takes effect only on payload rather than cell header. true: enables the scramble function. false: disables the scramble function.')
hwAtmLoopback = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 255))).clone(namedValues=NamedValues(("local", 1), ("remote", 2), ("payload", 3), ("none", 255))).clone('none')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwAtmLoopback.setStatus('current')
if mibBuilder.loadTexts: hwAtmLoopback.setDescription('Enable the loopback function of the channel. local: enables the local loopback on the interface. remote: enables the remote loopback on the interface. payload: enables the remote payload loopback on the interface. By default, all loopback functions are disabled.')
hwAtmMapPvpTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 2), )
if mibBuilder.loadTexts: hwAtmMapPvpTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvpTable.setDescription('This table is used to configure the mapping between the peer VPI and the local VPI.')
hwAtmMapPvpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 2, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmMapPvpIfIndex"), (0, "HUAWEI-ATM-MIB", "hwAtmMapPvpVplVpi"))
if mibBuilder.loadTexts: hwAtmMapPvpEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvpEntry.setDescription('This table is used to configure the mapping between the peer VPI and the local VPI.')
hwAtmMapPvpIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 2, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: hwAtmMapPvpIfIndex.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvpIfIndex.setDescription('Indicates the interface index.')
hwAtmMapPvpVplVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 2, 1, 2), AtmVpIdentifier())
if mibBuilder.loadTexts: hwAtmMapPvpVplVpi.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvpVplVpi.setDescription('Indicates the local VPI value. The value is an integer ranging from 0 to 255.')
hwAtmMapPvpRemoteVplVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 2, 1, 11), AtmVpIdentifier()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmMapPvpRemoteVplVpi.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvpRemoteVplVpi.setDescription('Indicates the peer VPI value. The value is an integer ranging from 0 to 255.')
hwAtmMapPvpRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 2, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmMapPvpRowStatus.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvpRowStatus.setDescription('This variable is used to create or delete an object.')
hwAtmMapPvcTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 3), )
if mibBuilder.loadTexts: hwAtmMapPvcTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvcTable.setDescription('This table is used to configure the mapping between the peer VPI/VCI and the local VPI/VCI.')
hwAtmMapPvcEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 3, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmVclIfIndex"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVpi"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVci"))
if mibBuilder.loadTexts: hwAtmMapPvcEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvcEntry.setDescription('This table is used to configure the mapping between the peer VPI/VCI and the local VPI/VCI.')
hwAtmMapPvcRemoteVclVci = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 3, 1, 11), AtmVcIdentifier()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmMapPvcRemoteVclVci.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvcRemoteVclVci.setDescription('Indicates the peer VCI value. VCI is short for Virtual Channel Identifier. The VCI value ranges from 0 to 2047. Generally, the values from 0 to 31 are reserved for specail use.')
hwAtmMapPvcRemoteVclVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 3, 1, 12), AtmVpIdentifier()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmMapPvcRemoteVclVpi.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvcRemoteVclVpi.setDescription('Indicates the peer VPI value. The value is an integer ranging from 0 to 255.')
hwAtmMapPvcRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 3, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmMapPvcRowStatus.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvcRowStatus.setDescription('This variable is used to create or delete an object.')
hwAtmServiceTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 4), )
if mibBuilder.loadTexts: hwAtmServiceTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmServiceTable.setDescription('This table is used to configure the service type and related parameters for the PVC.')
hwAtmServiceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 4, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmServiceName"))
if mibBuilder.loadTexts: hwAtmServiceEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmServiceEntry.setDescription('This table is used to configure the service type for the PVC.')
hwAtmServiceName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 4, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31)))
if mibBuilder.loadTexts: hwAtmServiceName.setStatus('current')
if mibBuilder.loadTexts: hwAtmServiceName.setDescription('Indicates the name of the service type. The name is a string of 1 to 31 characters.')
hwAtmServiceType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 4, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("cbr", 1), ("vbrNrt", 2), ("vbrRt", 3), ("ubr", 4), ("ubrPlus", 5))).clone('ubr')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmServiceType.setStatus('current')
if mibBuilder.loadTexts: hwAtmServiceType.setDescription('Set the service type for the PVC as required.')
hwAtmServiceOutputPcr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 4, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(64, 149760), )).clone(149760)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmServiceOutputPcr.setStatus('current')
if mibBuilder.loadTexts: hwAtmServiceOutputPcr.setDescription('Indicates the peak output rate of the ATM cell. When hwPvcServiceTableType is ubr, the peak output rate is 0.')
hwAtmServiceOutputScr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 4, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(64, 149760), )).clone(149760)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmServiceOutputScr.setStatus('current')
if mibBuilder.loadTexts: hwAtmServiceOutputScr.setDescription('Indicates the peak output rate of the ATM cell. When hwPvcServiceTableType is cbr or ubr, the peak output rate is 0.')
hwAtmServiceOutputMbs = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 4, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 512), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmServiceOutputMbs.setStatus('current')
if mibBuilder.loadTexts: hwAtmServiceOutputMbs.setDescription('Indicates the peak output rate of the ATM cell. When hwPvcServiceTableType is cbr or ubr, the peak output rate is 0.')
hwAtmServiceCbrCdvtValue = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 4, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10000)).clone(500)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmServiceCbrCdvtValue.setStatus('current')
if mibBuilder.loadTexts: hwAtmServiceCbrCdvtValue.setDescription('Indicates the limit of the ATM cell delay variation. When hwPvcServiceTableType is cbr, the variable is valid. For other service types, the variable is 0.')
hwAtmServiceOutputMcr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 4, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(64, 149760), )).clone(149760)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmServiceOutputMcr.setStatus('current')
if mibBuilder.loadTexts: hwAtmServiceOutputMcr.setDescription('Indicates the mini width guarantee bit rate of the ATM cell. When hwPvcServiceTableType is ubr, the peak output rate is 0.')
hwAtmServiceRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 4, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmServiceRowStatus.setStatus('current')
if mibBuilder.loadTexts: hwAtmServiceRowStatus.setDescription('This variable is used to create or delete an object.')
hwAtmPvcServiceTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 5), )
if mibBuilder.loadTexts: hwAtmPvcServiceTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcServiceTable.setDescription('This table is used to configure the service type for the PVC.')
hwAtmPvcServiceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 5, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmVclIfIndex"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVpi"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVci"))
if mibBuilder.loadTexts: hwAtmPvcServiceEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcServiceEntry.setDescription('This table is used to configure the service type for the PVC.')
hwAtmPvcServiceName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 5, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcServiceName.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcServiceName.setDescription('Indicates the name of the service type. The name is a string of 1 to 31 characters.')
hwAtmPvcTransmittalDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 5, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("input", 1), ("output", 2)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcTransmittalDirection.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcTransmittalDirection.setDescription('Indicates the input or output tpye of the service type.')
hwAtmPvcServiceRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 5, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcServiceRowStatus.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcServiceRowStatus.setDescription('This variable is used to create or delete an object.')
hwAtmIfConfTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 11), )
if mibBuilder.loadTexts: hwAtmIfConfTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmIfConfTable.setDescription('Indicates the configuration of the ATM interface.')
hwAtmIfConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 11, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmIfConfIfIndex"))
if mibBuilder.loadTexts: hwAtmIfConfEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmIfConfEntry.setDescription('Indicates the configuration of the ATM interface.')
hwAtmIfConfIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 11, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: hwAtmIfConfIfIndex.setStatus('current')
if mibBuilder.loadTexts: hwAtmIfConfIfIndex.setDescription('Indicates the interface index.')
hwAtmIfConfMaxVccs = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 11, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2048))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwAtmIfConfMaxVccs.setStatus('current')
if mibBuilder.loadTexts: hwAtmIfConfMaxVccs.setDescription('Indicates the maximum number of the PVCs.')
hwAtmIfConfOperVccs = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 11, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwAtmIfConfOperVccs.setStatus('current')
if mibBuilder.loadTexts: hwAtmIfConfOperVccs.setDescription('Indicates the number of the configured PVCs.')
hwAtmIfConfIntfType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 11, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("uni", 1), ("nni", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwAtmIfConfIntfType.setStatus('current')
if mibBuilder.loadTexts: hwAtmIfConfIntfType.setDescription('This object indicates the type of the serial interface with the ATM protocol.')
hwAtmVplTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 12), )
if mibBuilder.loadTexts: hwAtmVplTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmVplTable.setDescription('Indicates the configuration of the ATM PVP.')
hwAtmVplEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 12, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmVplIfIndex"), (0, "HUAWEI-ATM-MIB", "hwAtmVplVpi"))
if mibBuilder.loadTexts: hwAtmVplEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmVplEntry.setDescription('Indicates the configuration of the ATM PVP.')
hwAtmVplIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 12, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: hwAtmVplIfIndex.setStatus('current')
if mibBuilder.loadTexts: hwAtmVplIfIndex.setDescription('Indicates the interface index.')
hwAtmVplVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 12, 1, 2), AtmVpIdentifier())
if mibBuilder.loadTexts: hwAtmVplVpi.setStatus('current')
if mibBuilder.loadTexts: hwAtmVplVpi.setDescription('VPI.')
hwAtmVplRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 12, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmVplRowStatus.setStatus('current')
if mibBuilder.loadTexts: hwAtmVplRowStatus.setDescription('Indicates the status of the row.')
hwAtmVclTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 13), )
if mibBuilder.loadTexts: hwAtmVclTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmVclTable.setDescription('Indicates the configuration of the ATM PVC.')
hwAtmVclEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 13, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmVclIfIndex"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVpi"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVci"))
if mibBuilder.loadTexts: hwAtmVclEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmVclEntry.setDescription('Indicates the configuration of the ATM PVC.')
hwAtmVclIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 13, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: hwAtmVclIfIndex.setStatus('current')
if mibBuilder.loadTexts: hwAtmVclIfIndex.setDescription('Indicates the interface index.')
hwAtmVclVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 13, 1, 2), AtmVpIdentifier())
if mibBuilder.loadTexts: hwAtmVclVpi.setStatus('current')
if mibBuilder.loadTexts: hwAtmVclVpi.setDescription('VPI.')
hwAtmVclVci = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 13, 1, 3), AtmVcIdentifier())
if mibBuilder.loadTexts: hwAtmVclVci.setStatus('current')
if mibBuilder.loadTexts: hwAtmVclVci.setDescription('VCI.')
hwAtmVclName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 13, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmVclName.setStatus('current')
if mibBuilder.loadTexts: hwAtmVclName.setDescription('Indicates the name of the PVC.')
hwAtmVccAal5EncapsType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 13, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("aal5Snap", 1), ("aal5Mux", 2), ("aal5MuxNonstandard", 3), ("aal5Nlpid", 4))).clone()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmVccAal5EncapsType.setStatus('current')
if mibBuilder.loadTexts: hwAtmVccAal5EncapsType.setDescription('Indicates the encapsulation mode of AAL5.')
hwAtmVclRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 13, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmVclRowStatus.setStatus('current')
if mibBuilder.loadTexts: hwAtmVclRowStatus.setDescription('Indicates the status of the row.')
hwAtmPvcIpoaTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 14), )
if mibBuilder.loadTexts: hwAtmPvcIpoaTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcIpoaTable.setDescription('This table is used to configure the IPoA mapping on the PVC.')
hwAtmPvcIpoaEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 14, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmVclIfIndex"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVpi"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVci"), (0, "HUAWEI-ATM-MIB", "hwAtmPvcIpoaType"), (0, "HUAWEI-ATM-MIB", "hwAtmPvcIpoaIpAddress"))
if mibBuilder.loadTexts: hwAtmPvcIpoaEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcIpoaEntry.setDescription('This table is used to configure the IPoA mapping on the PVC.')
hwAtmPvcIpoaType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 14, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ip", 1), ("default", 2), ("inarp", 3))))
if mibBuilder.loadTexts: hwAtmPvcIpoaType.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcIpoaType.setDescription('Indicates the type of the PVC IPoA mapping. ip: sets the peer IP address and mask that are mapped to the PVC. default: configures a mapping with default route attributes. If no mapping of the next hop address of a packet can be found, the packet is sent over the PVC if the PVC is configured with default mapping. inarp: configures InARP on the PVC.')
hwAtmPvcIpoaIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 14, 1, 4), IpAddress())
if mibBuilder.loadTexts: hwAtmPvcIpoaIpAddress.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcIpoaIpAddress.setDescription('Indicates the peer IP address mapped to the PVC.')
hwAtmPvcIpoaIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 14, 1, 11), IpAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcIpoaIpMask.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcIpoaIpMask.setDescription('Indicates the IP address mask. The IP address mask is an optional parameter.')
hwAtmPvcIpoaInarpInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 14, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 600), )).clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcIpoaInarpInterval.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcIpoaInarpInterval.setDescription('Indicates the interval for sending InARP packets. The parameter is optional. The value ranges from 1 to 600 in seconds. If the type of the PVC IPoA mapping is IP or default, the value is 0. The default value is 1.')
hwAtmPvcIpoaBroadcast = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 14, 1, 13), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcIpoaBroadcast.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcIpoaBroadcast.setDescription('If a mapping with this attribute is configured on the PVC, broadcast packets on the interface where the PVC resides will be sent over the PVC.')
hwAtmPvcIpoaRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 14, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcIpoaRowStatus.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcIpoaRowStatus.setDescription('RowStatus.')
hwAtmPvcBridgeTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 15), )
if mibBuilder.loadTexts: hwAtmPvcBridgeTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcBridgeTable.setDescription('This table is used to configure the IPoEoA mapping and PPPoEoA mapping on the PVC.')
hwAtmPvcBridgeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 15, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmVclIfIndex"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVpi"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVci"))
if mibBuilder.loadTexts: hwAtmPvcBridgeEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcBridgeEntry.setDescription('This table is used to configure the IPoEoA mapping and PPPoEoA mapping on the PVC.')
hwAtmPvcBridgeDstIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 15, 1, 11), InterfaceIndex()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcBridgeDstIfIndex.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcBridgeDstIfIndex.setDescription('Indicates the index of the VE interface.')
hwAtmPvcBridgeRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 15, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcBridgeRowStatus.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcBridgeRowStatus.setDescription('RowStatus.')
hwAtmPvcOamLoopbackTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 17), )
if mibBuilder.loadTexts: hwAtmPvcOamLoopbackTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcOamLoopbackTable.setDescription('This table is used to configure OAM F5 Loopback, enable the sending of OAM F5 Loopback cells, and configure the parameters of the retransmission check or modify the parameters of the retransmission check.')
hwAtmPvcOAMLoopbackEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 17, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmVclIfIndex"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVpi"), (0, "HUAWEI-ATM-MIB", "hwAtmVclVci"))
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackEntry.setDescription('This table is used to configure OAM F5 Loopback.')
hwAtmPvcOAMLoopbackFrequency = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 17, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 600))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackFrequency.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackFrequency.setDescription('Indicates the interval for sending OAM F5 Loopback cells.')
hwAtmPvcOAMLoopbackUpCount = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 17, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 600)).clone(3)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackUpCount.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackUpCount.setDescription('Indicates the number of continuous OAM F5 Loopback cells that must be received before the PVC turns Up.')
hwAtmPvcOAMLoopbackDownCount = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 17, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 600)).clone(5)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackDownCount.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackDownCount.setDescription('Indicates the number of continuous OAM F5 Loopback cells that are not received before the PVC turns Down.')
hwAtmPvcOAMLoopbackRetryFrequency = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 17, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackRetryFrequency.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackRetryFrequency.setDescription('Indicates the interval for sending cells during OAM F5 Loopback retransmission verification before the PVC status changes.')
hwAtmPvcOAMLoopbackRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 17, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackRowStatus.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackRowStatus.setDescription('RowStatus')
hwAtmPvpLimitTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 18), )
if mibBuilder.loadTexts: hwAtmPvpLimitTable.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvpLimitTable.setDescription('This table is used to configure the VP limit. To monitor the VP, configure related VP parameters.')
hwAtmPvpLimitEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 18, 1), ).setIndexNames((0, "HUAWEI-ATM-MIB", "hwAtmPvpLimitIfIndex"), (0, "HUAWEI-ATM-MIB", "hwAtmPvpLimitVpi"))
if mibBuilder.loadTexts: hwAtmPvpLimitEntry.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvpLimitEntry.setDescription('This table is used to configure the VP limit.')
hwAtmPvpLimitIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 18, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: hwAtmPvpLimitIfIndex.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvpLimitIfIndex.setDescription('Indicates the interface index.')
hwAtmPvpLimitVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 18, 1, 2), AtmVpIdentifier())
if mibBuilder.loadTexts: hwAtmPvpLimitVpi.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvpLimitVpi.setDescription('VPI.')
hwAtmPvpLimitPeakRate = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 18, 1, 11), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvpLimitPeakRate.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvpLimitPeakRate.setDescription('VCI.')
hwAtmPvpLimitRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 1, 18, 1, 51), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hwAtmPvpLimitRowStatus.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvpLimitRowStatus.setDescription('RowStatus. ')
hwAtmConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11))
hwAtmCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 1))
hwAtmCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 1, 1)).setObjects(("HUAWEI-ATM-MIB", "hwAtmObjectGroup"), ("HUAWEI-ATM-MIB", "hwAtmMapPvpObjectGroup"), ("HUAWEI-ATM-MIB", "hwAtmMapPvcObjectGroup"), ("HUAWEI-ATM-MIB", "hwAtmPvcIpoaObjectGroup"), ("HUAWEI-ATM-MIB", "hwAtmPvcBridgeObjectGroup"), ("HUAWEI-ATM-MIB", "hwAtmPvcServiceObjectGroup"), ("HUAWEI-ATM-MIB", "hwAtmPvcOAMLoopbackObjectGroup"), ("HUAWEI-ATM-MIB", "hwAtmPvpLimitObjectGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmCompliance = hwAtmCompliance.setStatus('current')
if mibBuilder.loadTexts: hwAtmCompliance.setDescription('The compliance statement for systems supporting the HUAWEI-ATM-MIB.')
hwAtmGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2))
hwAtmObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 1)).setObjects(("HUAWEI-ATM-MIB", "hwAtmIfType"), ("HUAWEI-ATM-MIB", "hwAtmClock"), ("HUAWEI-ATM-MIB", "hwAtmFrameFormat"), ("HUAWEI-ATM-MIB", "hwAtmScramble"), ("HUAWEI-ATM-MIB", "hwAtmLoopback"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmObjectGroup = hwAtmObjectGroup.setStatus('current')
if mibBuilder.loadTexts: hwAtmObjectGroup.setDescription('The Atm attribute group.')
hwAtmIfConf = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 2)).setObjects(("HUAWEI-ATM-MIB", "hwAtmIfConfMaxVccs"), ("HUAWEI-ATM-MIB", "hwAtmIfConfOperVccs"), ("HUAWEI-ATM-MIB", "hwAtmIfConfIntfType"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmIfConf = hwAtmIfConf.setStatus('current')
if mibBuilder.loadTexts: hwAtmIfConf.setDescription('Description.')
hwAtmVplObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 3)).setObjects(("HUAWEI-ATM-MIB", "hwAtmPvcBridgeDstIfIndex"), ("HUAWEI-ATM-MIB", "hwAtmPvcBridgeRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmVplObjectGroup = hwAtmVplObjectGroup.setStatus('current')
if mibBuilder.loadTexts: hwAtmVplObjectGroup.setDescription('The Atm Pvc Bridge attribute group.')
hwAtmVclObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 4)).setObjects(("HUAWEI-ATM-MIB", "hwAtmVclName"), ("HUAWEI-ATM-MIB", "hwAtmVccAal5EncapsType"), ("HUAWEI-ATM-MIB", "hwAtmVclRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmVclObjectGroup = hwAtmVclObjectGroup.setStatus('current')
if mibBuilder.loadTexts: hwAtmVclObjectGroup.setDescription('Description.')
hwAtmMapPvpObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 5)).setObjects(("HUAWEI-ATM-MIB", "hwAtmMapPvpRemoteVplVpi"), ("HUAWEI-ATM-MIB", "hwAtmMapPvpRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmMapPvpObjectGroup = hwAtmMapPvpObjectGroup.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvpObjectGroup.setDescription('The Atm Map Pvp attribute group.')
hwAtmMapPvcObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 6)).setObjects(("HUAWEI-ATM-MIB", "hwAtmMapPvcRemoteVclVpi"), ("HUAWEI-ATM-MIB", "hwAtmMapPvcRemoteVclVci"), ("HUAWEI-ATM-MIB", "hwAtmMapPvcRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmMapPvcObjectGroup = hwAtmMapPvcObjectGroup.setStatus('current')
if mibBuilder.loadTexts: hwAtmMapPvcObjectGroup.setDescription('The Atm Map Pvc attribute group.')
hwAtmServiceObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 7)).setObjects(("HUAWEI-ATM-MIB", "hwAtmServiceType"), ("HUAWEI-ATM-MIB", "hwAtmServiceOutputPcr"), ("HUAWEI-ATM-MIB", "hwAtmServiceOutputScr"), ("HUAWEI-ATM-MIB", "hwAtmServiceOutputMbs"), ("HUAWEI-ATM-MIB", "hwAtmServiceCbrCdvtValue"), ("HUAWEI-ATM-MIB", "hwAtmServiceOutputMcr"), ("HUAWEI-ATM-MIB", "hwAtmServiceRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmServiceObjectGroup = hwAtmServiceObjectGroup.setStatus('current')
if mibBuilder.loadTexts: hwAtmServiceObjectGroup.setDescription('The Atm Service attribute group.')
hwAtmPvcServiceObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 8)).setObjects(("HUAWEI-ATM-MIB", "hwAtmPvcServiceName"), ("HUAWEI-ATM-MIB", "hwAtmPvcTransmittalDirection"), ("HUAWEI-ATM-MIB", "hwAtmPvcServiceRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmPvcServiceObjectGroup = hwAtmPvcServiceObjectGroup.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcServiceObjectGroup.setDescription('The Atm Pvc Service attribute group.')
hwAtmPvcIpoaObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 9)).setObjects(("HUAWEI-ATM-MIB", "hwAtmPvcIpoaIpMask"), ("HUAWEI-ATM-MIB", "hwAtmPvcIpoaInarpInterval"), ("HUAWEI-ATM-MIB", "hwAtmPvcIpoaBroadcast"), ("HUAWEI-ATM-MIB", "hwAtmPvcIpoaRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmPvcIpoaObjectGroup = hwAtmPvcIpoaObjectGroup.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcIpoaObjectGroup.setDescription('The Atm Pvc IPOA attribute group.')
hwAtmPvcBridgeObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 10)).setObjects(("HUAWEI-ATM-MIB", "hwAtmVplRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmPvcBridgeObjectGroup = hwAtmPvcBridgeObjectGroup.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcBridgeObjectGroup.setDescription('The Atm Pvl attribute group.')
hwAtmPvcOAMLoopbackObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 11)).setObjects(("HUAWEI-ATM-MIB", "hwAtmPvcOAMLoopbackFrequency"), ("HUAWEI-ATM-MIB", "hwAtmPvcOAMLoopbackUpCount"), ("HUAWEI-ATM-MIB", "hwAtmPvcOAMLoopbackDownCount"), ("HUAWEI-ATM-MIB", "hwAtmPvcOAMLoopbackRetryFrequency"), ("HUAWEI-ATM-MIB", "hwAtmPvcOAMLoopbackRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmPvcOAMLoopbackObjectGroup = hwAtmPvcOAMLoopbackObjectGroup.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvcOAMLoopbackObjectGroup.setDescription('The Port attribute group.')
hwAtmPvpLimitObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 156, 11, 2, 12)).setObjects(("HUAWEI-ATM-MIB", "hwAtmPvpLimitPeakRate"), ("HUAWEI-ATM-MIB", "hwAtmPvpLimitRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hwAtmPvpLimitObjectGroup = hwAtmPvpLimitObjectGroup.setStatus('current')
if mibBuilder.loadTexts: hwAtmPvpLimitObjectGroup.setDescription('The Port attribute group.')
mibBuilder.exportSymbols("HUAWEI-ATM-MIB", hwAtmPvcBridgeDstIfIndex=hwAtmPvcBridgeDstIfIndex, hwAtmPvcOAMLoopbackObjectGroup=hwAtmPvcOAMLoopbackObjectGroup, hwAtmIfConfMaxVccs=hwAtmIfConfMaxVccs, hwAtmCompliance=hwAtmCompliance, hwAtmServiceObjectGroup=hwAtmServiceObjectGroup, hwAtmIfConfEntry=hwAtmIfConfEntry, hwAtmClock=hwAtmClock, hwAtmVclName=hwAtmVclName, hwAtmIfConfIfIndex=hwAtmIfConfIfIndex, hwAtmVplVpi=hwAtmVplVpi, hwAtmVclEntry=hwAtmVclEntry, hwAtmLoopback=hwAtmLoopback, hwAtmPvcOAMLoopbackDownCount=hwAtmPvcOAMLoopbackDownCount, hwAtmPvcBridgeEntry=hwAtmPvcBridgeEntry, hwAtmPvcServiceRowStatus=hwAtmPvcServiceRowStatus, hwAtmMapPvpRemoteVplVpi=hwAtmMapPvpRemoteVplVpi, hwAtmPvcServiceEntry=hwAtmPvcServiceEntry, hwAtmPvcServiceTable=hwAtmPvcServiceTable, hwAtmPvcIpoaEntry=hwAtmPvcIpoaEntry, hwAtmVclVci=hwAtmVclVci, hwAtmPvpLimitIfIndex=hwAtmPvpLimitIfIndex, hwAtmPvpLimitTable=hwAtmPvpLimitTable, hwAtmCompliances=hwAtmCompliances, hwAtmEntry=hwAtmEntry, hwAtmMapPvcObjectGroup=hwAtmMapPvcObjectGroup, hwAtmServiceTable=hwAtmServiceTable, hwAtmPvcBridgeRowStatus=hwAtmPvcBridgeRowStatus, hwAtmPvcOAMLoopbackRetryFrequency=hwAtmPvcOAMLoopbackRetryFrequency, hwAtmServiceName=hwAtmServiceName, hwAtmPvcIpoaInarpInterval=hwAtmPvcIpoaInarpInterval, hwAtmVccAal5EncapsType=hwAtmVccAal5EncapsType, hwAtmServiceType=hwAtmServiceType, hwAtmIfIndex=hwAtmIfIndex, hwAtmPvcIpoaIpAddress=hwAtmPvcIpoaIpAddress, hwAtmGroups=hwAtmGroups, hwAtmMapPvcRowStatus=hwAtmMapPvcRowStatus, hwAtmPvcTransmittalDirection=hwAtmPvcTransmittalDirection, hwAtmPvpLimitEntry=hwAtmPvpLimitEntry, hwAtmMapPvcRemoteVclVci=hwAtmMapPvcRemoteVclVci, hwAtmMIB=hwAtmMIB, hwAtmVclTable=hwAtmVclTable, hwAtmMapPvpIfIndex=hwAtmMapPvpIfIndex, hwAtmPvpLimitRowStatus=hwAtmPvpLimitRowStatus, hwAtmConformance=hwAtmConformance, hwAtmVclVpi=hwAtmVclVpi, hwAtmObjectGroup=hwAtmObjectGroup, hwAtmVplIfIndex=hwAtmVplIfIndex, hwAtmVclIfIndex=hwAtmVclIfIndex, hwAtmVclRowStatus=hwAtmVclRowStatus, PYSNMP_MODULE_ID=hwAtmMIB, hwAtmPvcOamLoopbackTable=hwAtmPvcOamLoopbackTable, hwAtmMapPvcRemoteVclVpi=hwAtmMapPvcRemoteVclVpi, hwAtmIfType=hwAtmIfType, hwAtmScramble=hwAtmScramble, hwAtmMapPvcEntry=hwAtmMapPvcEntry, hwAtmMapPvpTable=hwAtmMapPvpTable, hwAtmPvcOAMLoopbackEntry=hwAtmPvcOAMLoopbackEntry, hwAtmMapPvpEntry=hwAtmMapPvpEntry, hwAtmPvcBridgeObjectGroup=hwAtmPvcBridgeObjectGroup, hwAtmServiceOutputMcr=hwAtmServiceOutputMcr, hwAtmPvcServiceName=hwAtmPvcServiceName, hwAtmIfConfIntfType=hwAtmIfConfIntfType, hwAtmVplRowStatus=hwAtmVplRowStatus, hwAtmObjects=hwAtmObjects, hwAtmVplEntry=hwAtmVplEntry, hwAtmPvpLimitPeakRate=hwAtmPvpLimitPeakRate, hwAtmPvcIpoaObjectGroup=hwAtmPvcIpoaObjectGroup, hwAtmTable=hwAtmTable, hwAtmPvcServiceObjectGroup=hwAtmPvcServiceObjectGroup, hwAtmIfConf=hwAtmIfConf, hwAtmVplTable=hwAtmVplTable, hwAtmPvpLimitVpi=hwAtmPvpLimitVpi, hwAtmIfConfTable=hwAtmIfConfTable, hwAtmPvcOAMLoopbackUpCount=hwAtmPvcOAMLoopbackUpCount, hwAtmPvcOAMLoopbackRowStatus=hwAtmPvcOAMLoopbackRowStatus, hwAtmPvcBridgeTable=hwAtmPvcBridgeTable, hwAtmPvcIpoaRowStatus=hwAtmPvcIpoaRowStatus, hwAtmIfConfOperVccs=hwAtmIfConfOperVccs, hwAtmPvcOAMLoopbackFrequency=hwAtmPvcOAMLoopbackFrequency, hwAtmPvpLimitObjectGroup=hwAtmPvpLimitObjectGroup, hwAtmMapPvpVplVpi=hwAtmMapPvpVplVpi, hwAtmPvcIpoaType=hwAtmPvcIpoaType, hwAtmServiceOutputMbs=hwAtmServiceOutputMbs, hwAtmFrameFormat=hwAtmFrameFormat, hwAtmMapPvcTable=hwAtmMapPvcTable, hwAtmServiceOutputScr=hwAtmServiceOutputScr, hwAtmServiceOutputPcr=hwAtmServiceOutputPcr, hwAtmMapPvpObjectGroup=hwAtmMapPvpObjectGroup, hwAtmMapPvpRowStatus=hwAtmMapPvpRowStatus, hwAtmServiceEntry=hwAtmServiceEntry, hwAtmServiceCbrCdvtValue=hwAtmServiceCbrCdvtValue, hwAtmPvcIpoaTable=hwAtmPvcIpoaTable, hwAtmPvcIpoaBroadcast=hwAtmPvcIpoaBroadcast, hwAtmVclObjectGroup=hwAtmVclObjectGroup, hwAtmPvcIpoaIpMask=hwAtmPvcIpoaIpMask, hwAtmVplObjectGroup=hwAtmVplObjectGroup, hwAtmServiceRowStatus=hwAtmServiceRowStatus)
|
"""
[2015-08-10] Challenge #227 [Easy] Square Spirals
https://www.reddit.com/r/dailyprogrammer/comments/3ggli3/20150810_challenge_227_easy_square_spirals/
# [](#EasyIcon) __(Easy)__: Square Spirals
Take a square grid, and put a cross on the center point, like this:
+ + + + +
+ + + + +
+ + X + +
+ + + + +
+ + + + +
The grid is 5-by-5, and the cross indicates point 1. Let's call the top-left corner location (1, 1), so the center
point is at location (3, 3). Now, place another cross to the right, and trace the path:
+ + + + +
+ + + + +
+ + X-X +
+ + + + +
+ + + + +
This second point (point 2) is now at location (4, 3). If you continually move around anticlockwise as much as you can
from this point, you will form a square spiral, as this diagram shows the beginning of:
+ + + + +
+ X-X-X .
| | .
+ X X-X .
| |
+ X-X-X-X
+ + + + +
Your challenge today is to do two things: convert a point number to its location on the spiral, and vice versa.
# Formal Inputs and Outputs
## Input Specification
On the first line, you'll be given a number **S**. This is the size of the spiral. If **S** equals 5, then the grid is
a 5-by-5 grid, as shown in the demonstration above. **S** will always be an odd number.
You will then be given one of two inputs on the next line:
* You'll be given a single number **N** - this is the point number of a point on the spiral.
* You'll be given two numbers **X** and **Y** (on the same line, separated by a space) - this is the location of a
point on the spiral.
## Output Description
If you're given the point number of a point, work out its location. If you're given a location, find out its point
number.
# Sample Inputs and Outputs
## Example 1
(Where is 8 on this spiral?)
5-4-3
| |
6 1-2
|
7-8-9
### Input
3
8
### Output
(2, 3)
## Example 2
This corresponds to the top-left point (1, 1) in [this 7-by-7
grid](https://upload.wikimedia.org/wikipedia/commons/thumb/1/1d/Ulam_spiral_howto_all_numbers.svg/811px-Ulam_spiral_howto_all_numbers.svg.png)
### Input
7
1 1
### Output
37
## Example 3
### Input
11
50
### Output
(10, 9)
## Example 4
### Input
9
6 8
### Output
47
If your solution can't solve the next two inputs before the heat death of the universe, don't worry.
## Example 5
Let's test how fast your solution is!
### Input
1024716039
557614022
### Output
(512353188, 512346213)
## Example 6
:D
### Input
234653477
11777272 289722
### Output
54790653381545607
# Finally
Got any cool challenge ideas? Submit them to /r/DailyProgrammer_Ideas!
"""
def main():
pass
if __name__ == "__main__":
main()
|
# -*- coding: utf-8 -*-
class IntegrationInterface(object):
properties = []
name = ""
title = ""
description = ""
url = ""
allow_multiple = False
can_notify_people = False
can_notify_group = False
can_sync_people = False
def __init__(self, integration):
self._properties = integration.properties or {}
self.integration = integration
def get_service_user(self, notification):
return notification.person.service_users.filter_by(
service=self.name
).first()
def fetch_people(self):
raise NotImplementedError()
def notify_person(self, notification, delivery):
raise NotImplementedError()
def notify_group(self, notification, delivery):
raise NotImplementedError()
@classmethod
def fields(self):
return []
def __getattr__(self, attr):
if attr in self.properties:
return self._properties.get(attr, None)
|
# Faça um programa que mostre a tabuada de vários números, um de cada vez, para cada valor digitado pelo usuário. O
# programa será interrompido quando o número solicitado for negativo.
separador = ('—' * 60)
while True:
print(separador)
n = int(input('Quer ver a tabuada de qual valor? [número negativo para sair]: '))
if n >= 0:
for c in range(1, 11):
print(f'{n} x {c} = {n*c}')
else:
break
print(separador)
print(f'PROGRAMA ENCERRADO')
print(separador)
|
n = int(input())
ansl = {}
for _ in range(n):
s = input()
if s in ansl:
ansl[s] += 1
else:
ansl[s] = 1
ans = ""
max_vote = 0
for k in ansl:
if max_vote < ansl[k]:
max_vote = ansl[k]
ans = k
print(ans)
|
def convert_sample_to_shot_dialKG(sample,with_knowledge):
prefix = "Dialogue:\n"
assert len(sample["dialogue"]) == len(sample["KG"])
for turn, meta in zip(sample["dialogue"],sample["KG"]):
prefix += f"User: {turn[0]}" +"\n"
if with_knowledge and len(meta)>0:
prefix += f"KG: {meta[0]}" +"\n"
if turn[1] == "":
prefix += f"Assistant:"
return prefix
else:
prefix += f"Assistant: {turn[1]}" +"\n"
return prefix
def convert_sample_to_shot_dialKG_interact(sample,with_knowledge):
prefix = "Dialogue:\n"
assert len(sample["dialogue"]) == len(sample["KG"])
for turn, meta in zip(sample["dialogue"],sample["KG"]):
prefix += f"User: {turn[0]}" +"\n"
if with_knowledge and len(meta)>0:
prefix += f"KG: {meta[0]}" +"\n"
if turn[1] == "":
prefix += f"Assistant:"
return prefix
else:
prefix += f"Assistant: {turn[1]}" +"\n"
return prefix
|
MAXZOOMLEVEL = 32
RESAMPLING_METHODS = (
'average',
'near',
'bilinear',
'cubic',
'cubicspline',
'lanczos',
'antialias'
)
PROFILES = ('mercator', 'geodetic', 'raster')
|
# -*- coding: utf-8 -*-
r"""Testing code for the (Python) optimal_learning library.
Testing is done via the Testify package:
https://github.com/Yelp/Testify
This package includes:
* Test cases/test setup files
* Tests for classes and utils in :mod:`moe.optimal_learning.python`
* Tests for classes and functions in :mod:`moe.optimal_learning.python.python_version`
* Tests for classes and functions in :mod:`moe.optimal_learning.python.cpp_wrappers`
**Files in this package**
* :mod:`moe.tests.optimal_learning.python.optimal_learning_test_case`: base test case for optimal_learning tests with some extra asserts for checking relative differences of floats (scalar, vector)
* :mod:`moe.tests.optimal_learning.python.gaussian_process_test_case`: test case for tests that manipulate GPs, includes extra
logic to construct random gaussian process priors; meant to provide
a well-behaved source of random data to unit tests.
* :mod:`moe.tests.optimal_learning.python.gaussian_process_test_utils`: utilities for constructing a random domain, covariance, and GaussianProcess
* :mod:`moe.tests.optimal_learning.python.geometry_utils_test`: tests for :mod:`moe.optimal_learning.python.geometry_utils`
**Subpackages**
* :mod:`moe.tests.optimal_learning.python.python_version`: tests for the Python implementation of optimal_learning. These include some manual checks, ping tests,
and some high level integration tests. Python testing is currently relatively sparse; we rely heavily on
the C++ comparison.
* :mod:`moe.tests.optimal_learning.python.cpp_wrappers`: tests that check the equivalence of the C++ implementation and the Python implementation of
optimal_learning (where applicable). Also runs the C++ unit tests.
"""
|
DUMP_10K_FILE = "/home/agustin/Desktop/Recuperacion/colecciones/dump10k/dump10k.txt"
INDEX_FILES_PATH = "output/"
BIN_INVERTED_INDEX_FILENAME = "inverted_index.bin"
BIN_VOCABULARY_FILENAME = "vocabulary.bin"
BIN_SKIPS_FILENAME = "skips.bin"
METADATA_FILE = "metadata.json"
K_SKIPS = 3
|
class DISPPARAMS(object):
""" Use System.Runtime.InteropServices.ComTypes.DISPPARAMS instead. """
cArgs = None
cNamedArgs = None
rgdispidNamedArgs = None
rgvarg = None
|
course = 'Python "Programming"'
print(course)
course = "Python \"Programming\"" # use this to be maintain consistency
course = "Python \\Programming\"" # Python \Programming"
print(course)
|
n = int(input())
prev_dst = prev_t = 0
for _ in range(n):
t, x, y = map(int, input().split())
dst = x + y
ddst = abs(dst - prev_dst)
dt = t - prev_t
if t % 2 != dst % 2 or ddst > dt:
print('No')
exit()
prev_t, prev_dst = t, dst
print('Yes')
|
class Customer:
def __init__(self):
self.id = "",
self.name = "",
self.phone = "",
self.email = "",
self.username = "",
self.address_line_1 = "",
self.address_line_2 = "",
self.city = "",
self.country = ""
|
counter = 0;
with open("./Resources/01. Odd Lines/Input.txt", 'r') as lines:
read_line = None
while read_line != "":
read_line = lines.readline()
counter += 1
if counter % 2 == 0:
with open("./Resources/01. Odd Lines/Output.txt", 'a') as odd_lines:
odd_lines.write(read_line)
print(odd_lines)
|
def func(i):
if i % 2 == 0:
i = i+1
return i
else:
x = func(i-1)
print('Value of X is ',x)
return func(x)
func(399) |
# key is age, chance is contents
def getdeathchance(agent):
deathchance = 0.0
if agent.taxon == "savannah":
if agent.sex == 'm':
deathchance = SavannahLifeTable.male_death_chance[agent.age]
else:
deathchance = SavannahLifeTable.female_death_chance[agent.age]
if agent.taxon == "hamadryas":
if agent.sex == 'm':
deathchance = HamadryasLifeTable.male_death_chance[agent.age]
else:
deathchance = HamadryasLifeTable.female_death_chance[agent.age]
# print deathchance
return deathchance
def getbirthchance(agent):
birthchance = 0.0
if agent.taxon == "savannah":
birthchance = SavannahLifeTable.birth_chance[agent.age]
if agent.taxon == "hamadryas":
birthchance = HamadryasLifeTable.birth_chance[agent.age]
return birthchance
class SavannahLifeTable:
male_death_chance = {
0: 0,
0.5: 0.10875,
1: 0.10875,
1.5: 0.0439,
2: 0.0439,
2.5: 0.03315,
3: 0.03315,
3.5: 0.04165,
4: 0.04165,
4.5: 0.0206,
5: 0.0206,
5.5: 0.02865,
6: 0.02865,
6.5: 0.0346375,
7: 0.0346375,
7.5: 0.0346375,
8: 0.0346375,
8.5: 0.0346375,
9: 0.0346375,
9.5: 0.0346375,
10: 0.0346375,
10.5: 0.0685625,
11: 0.0685625,
11.5: 0.0685625,
12: 0.0685625,
12.5: 0.0685625,
13: 0.0685625,
13.5: 0.0685625,
14: 0.0685625,
14.5: 0.140825,
15: 0.140825,
15.5: 0.140825,
16: 0.140825,
16.5: 0.140825,
17: 0.140825,
17.5: 0.140825,
18: 0.140825,
18.5: 0.125,
19: 0.125,
19.5: 0.335,
20: 0.335,
20.5: 1,
21: 1
}
female_death_chance = {
0: 0,
0.5: 0.1031,
1: 0.1031,
1.5: 0.0558,
2: 0.0558,
2.5: 0.0317,
3: 0.0317,
3.5: 0.0156,
4: 0.0156,
4.5: 0.02355,
5: 0.02355,
5.5: 0.027125,
6: 0.027125,
6.5: 0.027125,
7: 0.027125,
7.5: 0.027125,
8: 0.027125,
8.5: 0.027125,
9: 0.027125,
9.5: 0.0436875,
10: 0.0436875,
10.5: 0.0436875,
11: 0.0436875,
11.5: 0.0436875,
12: 0.0436875,
12.5: 0.0436875,
13: 0.0436875,
13.5: 0.0691,
14: 0.0691,
14.5: 0.0691,
15: 0.0691,
15.5: 0.0691,
16: 0.0691,
16.5: 0.0691,
17: 0.0691,
17.5: 0.141125,
18: 0.141125,
18.5: 0.141125,
19: 0.141125,
19.5: 0.141125,
20: 0.141125,
20.5: 0.141125,
21: 0.141125,
21.5: 0.2552875,
22: 0.2552875,
22.5: 0.2552875,
23: 0.2552875,
23.5: 0.2552875,
24: 0.2552875,
24.5: 0.2552875,
25: 1,
25.5: 1
}
birth_chance = {
0: 0,
0.5: 0,
1: 0,
1.5: 0,
2: 0,
2.5: 0,
3: 0,
3.5: 0,
4: 0,
4.5: 0,
5: 0.85,
5.5: 0.85,
6: 0.85,
6.5: 0.85,
7: 0.85,
7.5: 0.9,
8: 0.9,
8.5: 0.9,
9: 0.9,
9.5: 0.9,
10: 0.9,
10.5: 0.85,
11: 0.85,
11.5: 0.85,
12: 0.85,
12.5: 0.8,
13: 0.8,
13.5: 0.8,
14: 0.8,
14.5: 0.8,
15: 0.8,
15.5: 0.75,
16: 0.75,
16.5: 0.75,
17: 0.75,
17.5: 0.75,
18: 0.75,
18.5: 0.75,
19: 0.75,
19.5: 0.75,
20: 0.75,
20.5: 0.6,
21: 0.6,
21.5: 0.6,
22: 0.6,
22.5: 0.6,
23: 0.6,
23.5: 0.6,
24: 0.6,
24.5: 0.6,
25: 0
}
class HamadryasLifeTable:
male_death_chance = {
0: 0,
0.5: 0.10875,
1: 0.10875,
1.5: 0.0439,
2: 0.0439,
2.5: 0.03315,
3: 0.03315,
3.5: 0.04165,
4: 0.04165,
4.5: 0.0206,
5: 0.0206,
5.5: 0.02865,
6: 0.02865,
6.5: 0.0346375,
7: 0.0346375,
7.5: 0.0346375,
8: 0.0346375,
8.5: 0.0346375,
9: 0.0346375,
9.5: 0.0346375,
10: 0.0346375,
10.5: 0.0685625,
11: 0.0685625,
11.5: 0.0685625,
12: 0.0685625,
12.5: 0.0685625,
13: 0.0685625,
13.5: 0.0685625,
14: 0.0685625,
14.5: 0.140825,
15: 0.140825,
15.5: 0.140825,
16: 0.140825,
16.5: 0.140825,
17: 0.140825,
17.5: 0.140825,
18: 0.140825,
18.5: 0.125,
19: 0.125,
19.5: 0.335,
20: 0.335,
20.5: 1
}
female_death_chance = {
0: 0,
0.5: 0.1031,
1: 0.1031,
1.5: 0.0558,
2: 0.0558,
2.5: 0.0317,
3: 0.0317,
3.5: 0.0156,
4: 0.0156,
4.5: 0.02355,
5: 0.02355,
5.5: 0.027125,
6: 0.027125,
6.5: 0.027125,
7: 0.027125,
7.5: 0.027125,
8: 0.027125,
8.5: 0.027125,
9: 0.027125,
9.5: 0.0436875,
10: 0.0436875,
10.5: 0.0436875,
11: 0.0436875,
11.5: 0.0436875,
12: 0.0436875,
12.5: 0.0436875,
13: 0.0436875,
13.5: 0.0691,
14: 0.0691,
14.5: 0.0691,
15: 0.0691,
15.5: 0.0691,
16: 0.0691,
16.5: 0.0691,
17: 0.0691,
17.5: 0.141125,
18: 0.141125,
18.5: 0.141125,
19: 0.141125,
19.5: 0.141125,
20: 0.141125,
20.5: 0.141125,
21: 0.141125,
21.5: 0.2552875,
22: 0.2552875,
22.5: 0.2552875,
23: 0.2552875,
23.5: 0.2552875,
24: 0.2552875,
24.5: 0.2552875,
25: 1
}
birth_chance = {
0: 0,
0.5: 0,
1: 0,
1.5: 0,
2: 0,
2.5: 0,
3: 0,
3.5: 0,
4: 0,
4.5: 0,
5: 0.85,
5.5: 0.85,
6: 0.85,
6.5: 0.85,
7: 0.85,
7.5: 0.9,
8: 0.9,
8.5: 0.9,
9: 0.9,
9.5: 0.9,
10: 0.9,
10.5: 0.85,
11: 0.85,
11.5: 0.85,
12: 0.85,
12.5: 0.8,
13: 0.8,
13.5: 0.8,
14: 0.8,
14.5: 0.8,
15: 0.8,
15.5: 0.75,
16: 0.75,
16.5: 0.75,
17: 0.75,
17.5: 0.75,
18: 0.75,
18.5: 0.75,
19: 0.75,
19.5: 0.75,
20: 0.75,
20.5: 0.6,
21: 0.6,
21.5: 0.6,
22: 0.6,
22.5: 0.6,
23: 0.6,
23.5: 0.6,
24: 0.6,
24.5: 0.6,
25: 0
}
|
"""Azure Provisioning Device Internal
This package provides internal classes for use within the Azure Provisioning Device SDK.
"""
|
#o programa escreve o fatorial de um número
#na linha 3 a variável "numero" pede ao usuário para inserir um valor de tipo primitivo int
numero = int(input('Digite um numero: '))
#a variável "cont" recebe o valor da variável "numero"
cont = numero
#"fatorial" recebe o valor inteiro 1
fatorial = 1
#na linha 8 é mostrado na tela o valor da variável numero que o usuário digitou
print('{}! = '.format(numero), end='')
#na linha 11 inicia a estrutura de repetição "while" enquanto a variável "cont" for maior que zero
while cont > 0:
#toda vez que houver uma repetição, fatorial irá multiplicar o valor da variável cont
fatorial = fatorial * cont
#a linha seguinte do código irá mostrar o valor da multiplicação
print(cont, end='')
#a linha seguinte aos comentários é uma estrutura de condição.
#Se "cont" for maior que 1, então deve-se mostrar "X"
if cont > 1:
print(' X ', end='')
#Caso contrário, isso é, se "cont" for igual ou menor que 1,
#deve ser mostrado a string " = " na tela
else:
print(' = ', end='')
#Na linha 26 do código a cada repetição cont subtrai um inteiro
#Isso irá ocorrer até o valor de cont ser igual a 0, que é quando a estrutura de repetição para
cont = cont - 1
#Ao final da repetição, o valor final de fatorial, que
# é derivado das multiplicações durante a repetição, será finalmente mostrado
print(fatorial) |
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# 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.
'''
BSD 3-Clause License
Copyright (c) Soumith Chintala 2016,
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://spdx.org/licenses/BSD-3-Clause.html
#
# 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.
'''
|
grocery = ["Harpic", "Vim bar", "deo", "Bhindi", "Lollypop",56]
#print(grocery[5])
#numbers = [2,7,5,11,3]
#print(numbers[2])
#print(numbers.sort()) sorting done
#print(numbers[1:4]) #slicing returning list but will not change original list.
#print(numbers)
#print(numbers[::3])
#print(numbers[::-1]) #don't take more than -1(-2,-3...)
grocery.pop["Harpic"]
|
def get_pic_upload_to(instance, filename):
return "static/profile/{}/pic/{}".format(instance.user, filename)
def get_aadhar_upload_to(instance, filename):
instance.filename = filename
return "static/profile/{}/aadhar/{}".format(instance.user, filename)
def get_passbook_upload_to(instance, filename):
instance.filename = filename
return "static/profile/{}/passbook/{}".format(instance.user, filename) |
# -*- coding: UTF-8 -*-
class DSException(Exception):
pass
class DSRequestException(DSException):
pass
class DSCommandFailedException(DSException):
pass
|
def pluralize(s):
last_char = s[-1]
if last_char == 'y':
pluralized = s[:-1] + 'ies'
elif last_char == 's':
pluralized = s
else:
pluralized = s + 's'
return pluralized
|
#Write a function that concatenates two lists. [a,b,c], [1,2,3] → [a,b,c,1,2,3]
def concatenates(list_1,list_2):
return list_2 + list_1
list_3 = ['a','b','c']
list_4 = [1,2,3]
print(concatenates(list_3,list_4)) |
#
# PySNMP MIB module SWAPCOM-SCC (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SWAPCOM-SCC
# Produced by pysmi-0.3.4 at Wed May 1 15:12:56 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Integer32, ObjectIdentity, Counter32, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, Counter64, NotificationType, MibIdentifier, iso, ModuleIdentity, enterprises, Unsigned32, Bits, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "ObjectIdentity", "Counter32", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "Counter64", "NotificationType", "MibIdentifier", "iso", "ModuleIdentity", "enterprises", "Unsigned32", "Bits", "TimeTicks")
MacAddress, TimeInterval, TextualConvention, DateAndTime, DisplayString, TruthValue, StorageType, TestAndIncr, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "TimeInterval", "TextualConvention", "DateAndTime", "DisplayString", "TruthValue", "StorageType", "TestAndIncr", "RowStatus")
swapcom = ModuleIdentity((1, 3, 6, 1, 4, 1, 11308))
swapcom.setRevisions(('1970-01-01 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: swapcom.setRevisionsDescriptions(('Revision Description',))
if mibBuilder.loadTexts: swapcom.setLastUpdated('2007381648Z')
if mibBuilder.loadTexts: swapcom.setOrganization('Organization name')
if mibBuilder.loadTexts: swapcom.setContactInfo('Contact information')
if mibBuilder.loadTexts: swapcom.setDescription('Description')
org = MibIdentifier((1, 3))
dod = MibIdentifier((1, 3, 6))
internet = MibIdentifier((1, 3, 6, 1))
private = MibIdentifier((1, 3, 6, 1, 4))
enterprises = MibIdentifier((1, 3, 6, 1, 4, 1))
scc = MibIdentifier((1, 3, 6, 1, 4, 1, 11308, 3))
platform = MibIdentifier((1, 3, 6, 1, 4, 1, 11308, 3, 1))
platformPlatformId = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 1, 1), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: platformPlatformId.setStatus('current')
if mibBuilder.loadTexts: platformPlatformId.setDescription('Identifier of the local platform')
platformPlatformStatus = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: platformPlatformStatus.setStatus('current')
if mibBuilder.loadTexts: platformPlatformStatus.setDescription('Status of local platform (0=Initializing / 1=Platform initialized / 2=Domains initialized / 3=Platform started and ready')
versionTable = MibTable((1, 3, 6, 1, 4, 1, 11308, 3, 2), )
if mibBuilder.loadTexts: versionTable.setStatus('current')
if mibBuilder.loadTexts: versionTable.setDescription('Components version')
versionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11308, 3, 2, 1), ).setIndexNames((0, "SWAPCOM-SCC", "versionProductName"))
if mibBuilder.loadTexts: versionEntry.setStatus('current')
if mibBuilder.loadTexts: versionEntry.setDescription('The entry for versionTable')
versionProductName = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 2, 1, 1), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: versionProductName.setStatus('current')
if mibBuilder.loadTexts: versionProductName.setDescription('Name of the component')
versionProductVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 2, 1, 2), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: versionProductVersion.setStatus('current')
if mibBuilder.loadTexts: versionProductVersion.setDescription('Version of the component, follows the standard SWAPCOM versioning')
versionBuildNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 2, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: versionBuildNumber.setStatus('current')
if mibBuilder.loadTexts: versionBuildNumber.setDescription('Component build number')
versionBuildDate = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 2, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: versionBuildDate.setStatus('current')
if mibBuilder.loadTexts: versionBuildDate.setDescription('Component build date')
transactionManager = MibIdentifier((1, 3, 6, 1, 4, 1, 11308, 3, 3))
transactionManagerLongTransactionThreshold = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 3, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: transactionManagerLongTransactionThreshold.setStatus('current')
if mibBuilder.loadTexts: transactionManagerLongTransactionThreshold.setDescription('Threshold duration for long transaction detection')
transactionManagerActiveTransactionCurrentCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 3, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: transactionManagerActiveTransactionCurrentCount.setStatus('current')
if mibBuilder.loadTexts: transactionManagerActiveTransactionCurrentCount.setDescription('Number of current active transaction')
transactionManagerActiveTransactionMinCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 3, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: transactionManagerActiveTransactionMinCount.setStatus('current')
if mibBuilder.loadTexts: transactionManagerActiveTransactionMinCount.setDescription('Minimum number of active transaction')
transactionManagerActiveTransactionMaxCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 3, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: transactionManagerActiveTransactionMaxCount.setStatus('current')
if mibBuilder.loadTexts: transactionManagerActiveTransactionMaxCount.setDescription('Maximum number of active transaction')
transactionManagerCommittedTransactionCumulativeCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 3, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: transactionManagerCommittedTransactionCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: transactionManagerCommittedTransactionCumulativeCount.setDescription('Number of transaction committed')
transactionManagerRolledbackTransactionCumulativeCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 3, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: transactionManagerRolledbackTransactionCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: transactionManagerRolledbackTransactionCumulativeCount.setDescription('Number of transaction rollbacked')
transactionManagerTransactionCumulativeTime = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 3, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: transactionManagerTransactionCumulativeTime.setStatus('current')
if mibBuilder.loadTexts: transactionManagerTransactionCumulativeTime.setDescription('Cumulative transaction time')
transactionManagerTransactionMinTime = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 3, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: transactionManagerTransactionMinTime.setStatus('current')
if mibBuilder.loadTexts: transactionManagerTransactionMinTime.setDescription('Minimum transaction duration time')
transactionManagerTransactionMaxTime = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 3, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: transactionManagerTransactionMaxTime.setStatus('current')
if mibBuilder.loadTexts: transactionManagerTransactionMaxTime.setDescription('Maximum transaction duration time')
transactionManagerTransactionManagerLastError = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 3, 10), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: transactionManagerTransactionManagerLastError.setStatus('current')
if mibBuilder.loadTexts: transactionManagerTransactionManagerLastError.setDescription('Last error message that occured in the transaction manager')
lockManager = MibIdentifier((1, 3, 6, 1, 4, 1, 11308, 3, 4))
lockManagerLockedItemCumulativeCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 4, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: lockManagerLockedItemCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: lockManagerLockedItemCumulativeCount.setDescription('Number of lock acquired')
lockManagerLockedItemCurrentCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 4, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: lockManagerLockedItemCurrentCount.setStatus('current')
if mibBuilder.loadTexts: lockManagerLockedItemCurrentCount.setDescription('Number of currenty locked objects')
lockManagerLockedItemMinCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 4, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: lockManagerLockedItemMinCount.setStatus('current')
if mibBuilder.loadTexts: lockManagerLockedItemMinCount.setDescription('Minimum number of locked objects')
lockManagerLockedItemMaxCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 4, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: lockManagerLockedItemMaxCount.setStatus('current')
if mibBuilder.loadTexts: lockManagerLockedItemMaxCount.setDescription('Maximum number of locked objects')
lockManagerLockRejectedOnDeadlockCumulativeCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 4, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: lockManagerLockRejectedOnDeadlockCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: lockManagerLockRejectedOnDeadlockCumulativeCount.setDescription('Number of lock rejected on deadlock')
lockManagerLockRejectedOnTimeoutCumulativeCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 4, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: lockManagerLockRejectedOnTimeoutCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: lockManagerLockRejectedOnTimeoutCumulativeCount.setDescription('Number of lock rejected on timeout')
lockManagerBlockedTransactionCurrentCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 4, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: lockManagerBlockedTransactionCurrentCount.setStatus('current')
if mibBuilder.loadTexts: lockManagerBlockedTransactionCurrentCount.setDescription('Number of currently blocked transaction in lockmanager')
lockManagerBlockedTransactionMinCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 4, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: lockManagerBlockedTransactionMinCount.setStatus('current')
if mibBuilder.loadTexts: lockManagerBlockedTransactionMinCount.setDescription('Minimum number of blocked transaction in lockmanager')
lockManagerBlockedTransactionMaxCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 4, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: lockManagerBlockedTransactionMaxCount.setStatus('current')
if mibBuilder.loadTexts: lockManagerBlockedTransactionMaxCount.setDescription('Maximum number of blocked transaction in lockmanager')
schedulerTaskTable = MibTable((1, 3, 6, 1, 4, 1, 11308, 3, 5), )
if mibBuilder.loadTexts: schedulerTaskTable.setStatus('current')
if mibBuilder.loadTexts: schedulerTaskTable.setDescription('Status of tasks registered in the scheduler')
schedulerTaskEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11308, 3, 5, 1), ).setIndexNames((0, "SWAPCOM-SCC", "schedulerTaskName"))
if mibBuilder.loadTexts: schedulerTaskEntry.setStatus('current')
if mibBuilder.loadTexts: schedulerTaskEntry.setDescription('The entry for schedulerTaskTable')
schedulerTaskName = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 5, 1, 1), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: schedulerTaskName.setStatus('current')
if mibBuilder.loadTexts: schedulerTaskName.setDescription('Name of the task')
schedulerTaskRunning = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 5, 1, 2), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: schedulerTaskRunning.setStatus('current')
if mibBuilder.loadTexts: schedulerTaskRunning.setDescription('Indicate if the task is currenlty being executed')
schedulerTaskExecutionCumulativeCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 5, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: schedulerTaskExecutionCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: schedulerTaskExecutionCumulativeCount.setDescription('Number of executions succesfully done')
schedulerTaskExecutionCumulativeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 5, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: schedulerTaskExecutionCumulativeTime.setStatus('current')
if mibBuilder.loadTexts: schedulerTaskExecutionCumulativeTime.setDescription('Cumulative processing time (success and failure)')
schedulerTaskExecutionMinTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 5, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: schedulerTaskExecutionMinTime.setStatus('current')
if mibBuilder.loadTexts: schedulerTaskExecutionMinTime.setDescription('Minimum processing time of the task')
schedulerTaskExecutionMaxTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 5, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: schedulerTaskExecutionMaxTime.setStatus('current')
if mibBuilder.loadTexts: schedulerTaskExecutionMaxTime.setDescription('Maximum processing time of the task')
schedulerTaskExecutionRetryCurrentCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 5, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: schedulerTaskExecutionRetryCurrentCount.setStatus('current')
if mibBuilder.loadTexts: schedulerTaskExecutionRetryCurrentCount.setDescription('Number of execution failure')
schedulerTaskExecutionLastError = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 5, 1, 8), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: schedulerTaskExecutionLastError.setStatus('current')
if mibBuilder.loadTexts: schedulerTaskExecutionLastError.setDescription('Message of the last execution failure')
alarmProbeTable = MibTable((1, 3, 6, 1, 4, 1, 11308, 3, 12), )
if mibBuilder.loadTexts: alarmProbeTable.setStatus('current')
if mibBuilder.loadTexts: alarmProbeTable.setDescription('Alarm probes status of the platform')
alarmProbeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11308, 3, 12, 1), ).setIndexNames((0, "SWAPCOM-SCC", "alarmProbeAlertType"), (0, "SWAPCOM-SCC", "alarmProbeAlertSource"))
if mibBuilder.loadTexts: alarmProbeEntry.setStatus('current')
if mibBuilder.loadTexts: alarmProbeEntry.setDescription('The entry for alarmProbeTable')
alarmProbeAlertType = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 12, 1, 1), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alarmProbeAlertType.setStatus('current')
if mibBuilder.loadTexts: alarmProbeAlertType.setDescription('Type of the probe alarm')
alarmProbeAlertSource = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 12, 1, 2), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alarmProbeAlertSource.setStatus('current')
if mibBuilder.loadTexts: alarmProbeAlertSource.setDescription('Source of the probe alarm')
alarmProbeSeverity = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 12, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alarmProbeSeverity.setStatus('current')
if mibBuilder.loadTexts: alarmProbeSeverity.setDescription('Current severity of the probe')
alarmProbeLastSeverityChange = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 12, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alarmProbeLastSeverityChange.setStatus('current')
if mibBuilder.loadTexts: alarmProbeLastSeverityChange.setDescription('Date of the last severity value change')
remotePlatformTable = MibTable((1, 3, 6, 1, 4, 1, 11308, 3, 21), )
if mibBuilder.loadTexts: remotePlatformTable.setStatus('current')
if mibBuilder.loadTexts: remotePlatformTable.setDescription('Remote platform connected to this one')
remotePlatformEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11308, 3, 21, 1), ).setIndexNames((0, "SWAPCOM-SCC", "remotePlatformPlatformId"))
if mibBuilder.loadTexts: remotePlatformEntry.setStatus('current')
if mibBuilder.loadTexts: remotePlatformEntry.setDescription('The entry for remotePlatformTable')
remotePlatformPlatformId = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 21, 1, 1), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: remotePlatformPlatformId.setStatus('current')
if mibBuilder.loadTexts: remotePlatformPlatformId.setDescription('Identifier of the remote platform')
remotePlatformPlatformProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 21, 1, 2), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: remotePlatformPlatformProtocol.setStatus('current')
if mibBuilder.loadTexts: remotePlatformPlatformProtocol.setDescription('Protocol used to communicate with the remote platform')
remotePlatformRemotePlatformStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 21, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: remotePlatformRemotePlatformStatus.setStatus('current')
if mibBuilder.loadTexts: remotePlatformRemotePlatformStatus.setDescription('Status of the remote platform connection (-2=unknown / -1=down / 3=up)')
asynchronousEventQueueTable = MibTable((1, 3, 6, 1, 4, 1, 11308, 3, 22), )
if mibBuilder.loadTexts: asynchronousEventQueueTable.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueTable.setDescription('Asynchronous event queues status')
asynchronousEventQueueEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1), ).setIndexNames((0, "SWAPCOM-SCC", "asynchronousEventQueuePlatformId"))
if mibBuilder.loadTexts: asynchronousEventQueueEntry.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueEntry.setDescription('The entry for asynchronousEventQueueTable')
asynchronousEventQueuePlatformId = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1, 1), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asynchronousEventQueuePlatformId.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueuePlatformId.setDescription('Identifier of the platform events queue')
asynchronousEventQueueInsertedEventCumulativeCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asynchronousEventQueueInsertedEventCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueInsertedEventCumulativeCount.setDescription('Number of generated asynchronous events')
asynchronousEventQueueWaitingEventCurrentCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asynchronousEventQueueWaitingEventCurrentCount.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueWaitingEventCurrentCount.setDescription('Number of events that are pending in the send queue')
asynchronousEventQueueWaitingEventMinCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asynchronousEventQueueWaitingEventMinCount.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueWaitingEventMinCount.setDescription('Minimum number of events pending in the send queue')
asynchronousEventQueueWaitingEventMaxCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asynchronousEventQueueWaitingEventMaxCount.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueWaitingEventMaxCount.setDescription('Maximum number of events pending in the send queue')
asynchronousEventQueueProcessedEventCumulativeCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asynchronousEventQueueProcessedEventCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueProcessedEventCumulativeCount.setDescription('Number of successfully sent asynchronous events')
asynchronousEventQueueEventProcessingCumulativeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asynchronousEventQueueEventProcessingCumulativeTime.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueEventProcessingCumulativeTime.setDescription('Cumulated time of event processing')
asynchronousEventQueueEventProcessingMinTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asynchronousEventQueueEventProcessingMinTime.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueEventProcessingMinTime.setDescription('Minimum event processing time')
asynchronousEventQueueEventProcessingMaxTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asynchronousEventQueueEventProcessingMaxTime.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueEventProcessingMaxTime.setDescription('Maximum event processing time')
asynchronousEventQueueFailedEventCumulativeCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asynchronousEventQueueFailedEventCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueFailedEventCumulativeCount.setDescription("Number of asynchronous events in the 'failed' queue")
asynchronousEventQueueFailedEventLastError = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 22, 1, 11), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asynchronousEventQueueFailedEventLastError.setStatus('current')
if mibBuilder.loadTexts: asynchronousEventQueueFailedEventLastError.setDescription('Last error message of events process failure')
slsConnection = MibIdentifier((1, 3, 6, 1, 4, 1, 11308, 3, 23))
slsConnectionConnected = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 23, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slsConnectionConnected.setStatus('current')
if mibBuilder.loadTexts: slsConnectionConnected.setDescription('Indicate if the platform is connected to the SLS')
slsConnectionLicenseCheckSuccessCumulativeCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 23, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slsConnectionLicenseCheckSuccessCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: slsConnectionLicenseCheckSuccessCumulativeCount.setDescription('Number of successfull license check')
slsConnectionLicenseCheckFailedCumulativeCount = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 23, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slsConnectionLicenseCheckFailedCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: slsConnectionLicenseCheckFailedCumulativeCount.setDescription('Number of failed license check')
slsConnectionLicenseCheckLastError = MibScalar((1, 3, 6, 1, 4, 1, 11308, 3, 23, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: slsConnectionLicenseCheckLastError.setStatus('current')
if mibBuilder.loadTexts: slsConnectionLicenseCheckLastError.setDescription('Last error message that occured in the SLS connection')
sqlPoolXATable = MibTable((1, 3, 6, 1, 4, 1, 11308, 3, 24), )
if mibBuilder.loadTexts: sqlPoolXATable.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXATable.setDescription('SQLPool status and properties')
sqlPoolXAEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1), ).setIndexNames((0, "SWAPCOM-SCC", "sqlPoolXAName"))
if mibBuilder.loadTexts: sqlPoolXAEntry.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXAEntry.setDescription('The entry for sqlPoolXATable')
sqlPoolXAName = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 1), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXAName.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXAName.setDescription('Name of the connection pool')
sqlPoolXASqlPlatformName = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 2), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXASqlPlatformName.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXASqlPlatformName.setDescription('Detected database type')
sqlPoolXADatabaseName = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 3), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXADatabaseName.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXADatabaseName.setDescription('Raw database name')
sqlPoolXADriverName = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 4), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXADriverName.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXADriverName.setDescription('Name of the JDBC driver')
sqlPoolXADriverClassName = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 5), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXADriverClassName.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXADriverClassName.setDescription('Name of the JDBC driver class')
sqlPoolXAMaximumSize = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXAMaximumSize.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXAMaximumSize.setDescription('Maximum size of connection pool')
sqlPoolXAMaximumIdleTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXAMaximumIdleTime.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXAMaximumIdleTime.setDescription('Maximum life duration of a connection in the pool')
sqlPoolXAMaximumWaitTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXAMaximumWaitTime.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXAMaximumWaitTime.setDescription('Maximum waiting time for getting a connection when the pool is exhausted')
sqlPoolXACheckIsClosedInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACheckIsClosedInterval.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACheckIsClosedInterval.setDescription('Minimum time between two connection checking')
sqlPoolXACreateConnectionSuccessCumulativeCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACreateConnectionSuccessCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACreateConnectionSuccessCumulativeCount.setDescription('Number of connections succesfully created')
sqlPoolXACreateConnectionFailureCumulativeCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACreateConnectionFailureCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACreateConnectionFailureCumulativeCount.setDescription('Number of connection creation failure')
sqlPoolXACreateConnectionLastError = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 12), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACreateConnectionLastError.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACreateConnectionLastError.setDescription('Last exception message during checkout failure')
sqlPoolXAConnectionCurrentCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXAConnectionCurrentCount.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXAConnectionCurrentCount.setDescription('Current size of the connection pool')
sqlPoolXAConnectionMinCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXAConnectionMinCount.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXAConnectionMinCount.setDescription('Minimum size reached by the connection pool')
sqlPoolXAConnectionMaxCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 15), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXAConnectionMaxCount.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXAConnectionMaxCount.setDescription('Maximum size reached by the connection pool')
sqlPoolXACheckedOutConnectionCurrentCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionCurrentCount.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionCurrentCount.setDescription('Current number of connection that are checked out from the pool')
sqlPoolXACheckedOutConnectionMinCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 17), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionMinCount.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionMinCount.setDescription('Minimum number of simultaneous checked out connections reached by the pool')
sqlPoolXACheckedOutConnectionMaxCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 18), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionMaxCount.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionMaxCount.setDescription('Maximum number of simultaneous checked out connections reached by the pool')
sqlPoolXACheckedOutConnectionCumulativeCount = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 19), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionCumulativeCount.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionCumulativeCount.setDescription('Number of checkout performed from pool')
sqlPoolXACheckedOutConnectionCumulativeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 20), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionCumulativeTime.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionCumulativeTime.setDescription('Cumulation of time that the connections are checked out from the pool')
sqlPoolXACheckedOutConnectionMinTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 21), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionMinTime.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionMinTime.setDescription('Minimum time that a connection has been checked out from the pool')
sqlPoolXACheckedOutConnectionMaxTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 22), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionMaxTime.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionMaxTime.setDescription('Maximum time that a connection has been checked out from the pool')
sqlPoolXACheckedOutConnectionAverageTime = MibTableColumn((1, 3, 6, 1, 4, 1, 11308, 3, 24, 1, 23), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionAverageTime.setStatus('current')
if mibBuilder.loadTexts: sqlPoolXACheckedOutConnectionAverageTime.setDescription('Connection checkedout average time (equals to CheckedOutConnectionCumulativeTime divided by CheckedOutConnectionCumulativeCount')
mibBuilder.exportSymbols("SWAPCOM-SCC", lockManagerLockRejectedOnTimeoutCumulativeCount=lockManagerLockRejectedOnTimeoutCumulativeCount, versionProductName=versionProductName, transactionManagerTransactionCumulativeTime=transactionManagerTransactionCumulativeTime, sqlPoolXAConnectionMaxCount=sqlPoolXAConnectionMaxCount, lockManagerLockRejectedOnDeadlockCumulativeCount=lockManagerLockRejectedOnDeadlockCumulativeCount, org=org, asynchronousEventQueueFailedEventLastError=asynchronousEventQueueFailedEventLastError, lockManagerLockedItemMinCount=lockManagerLockedItemMinCount, sqlPoolXAConnectionMinCount=sqlPoolXAConnectionMinCount, lockManagerLockedItemMaxCount=lockManagerLockedItemMaxCount, schedulerTaskEntry=schedulerTaskEntry, asynchronousEventQueueFailedEventCumulativeCount=asynchronousEventQueueFailedEventCumulativeCount, sqlPoolXAMaximumWaitTime=sqlPoolXAMaximumWaitTime, alarmProbeAlertType=alarmProbeAlertType, internet=internet, sqlPoolXADatabaseName=sqlPoolXADatabaseName, dod=dod, sqlPoolXACheckedOutConnectionCurrentCount=sqlPoolXACheckedOutConnectionCurrentCount, sqlPoolXADriverClassName=sqlPoolXADriverClassName, schedulerTaskExecutionCumulativeCount=schedulerTaskExecutionCumulativeCount, transactionManagerActiveTransactionCurrentCount=transactionManagerActiveTransactionCurrentCount, sqlPoolXACreateConnectionFailureCumulativeCount=sqlPoolXACreateConnectionFailureCumulativeCount, platformPlatformId=platformPlatformId, remotePlatformPlatformProtocol=remotePlatformPlatformProtocol, schedulerTaskExecutionLastError=schedulerTaskExecutionLastError, transactionManagerRolledbackTransactionCumulativeCount=transactionManagerRolledbackTransactionCumulativeCount, sqlPoolXASqlPlatformName=sqlPoolXASqlPlatformName, lockManagerBlockedTransactionCurrentCount=lockManagerBlockedTransactionCurrentCount, remotePlatformPlatformId=remotePlatformPlatformId, alarmProbeAlertSource=alarmProbeAlertSource, schedulerTaskExecutionMaxTime=schedulerTaskExecutionMaxTime, slsConnectionConnected=slsConnectionConnected, transactionManagerTransactionManagerLastError=transactionManagerTransactionManagerLastError, versionBuildDate=versionBuildDate, asynchronousEventQueueWaitingEventMaxCount=asynchronousEventQueueWaitingEventMaxCount, swapcom=swapcom, alarmProbeLastSeverityChange=alarmProbeLastSeverityChange, sqlPoolXACheckIsClosedInterval=sqlPoolXACheckIsClosedInterval, asynchronousEventQueueEventProcessingCumulativeTime=asynchronousEventQueueEventProcessingCumulativeTime, PYSNMP_MODULE_ID=swapcom, slsConnectionLicenseCheckLastError=slsConnectionLicenseCheckLastError, private=private, lockManager=lockManager, remotePlatformTable=remotePlatformTable, sqlPoolXACheckedOutConnectionAverageTime=sqlPoolXACheckedOutConnectionAverageTime, sqlPoolXACheckedOutConnectionCumulativeTime=sqlPoolXACheckedOutConnectionCumulativeTime, sqlPoolXACheckedOutConnectionMaxTime=sqlPoolXACheckedOutConnectionMaxTime, lockManagerBlockedTransactionMinCount=lockManagerBlockedTransactionMinCount, asynchronousEventQueueWaitingEventMinCount=asynchronousEventQueueWaitingEventMinCount, lockManagerBlockedTransactionMaxCount=lockManagerBlockedTransactionMaxCount, schedulerTaskTable=schedulerTaskTable, sqlPoolXAConnectionCurrentCount=sqlPoolXAConnectionCurrentCount, transactionManager=transactionManager, schedulerTaskName=schedulerTaskName, sqlPoolXAEntry=sqlPoolXAEntry, remotePlatformRemotePlatformStatus=remotePlatformRemotePlatformStatus, alarmProbeEntry=alarmProbeEntry, sqlPoolXACreateConnectionLastError=sqlPoolXACreateConnectionLastError, sqlPoolXACheckedOutConnectionMinCount=sqlPoolXACheckedOutConnectionMinCount, slsConnection=slsConnection, sqlPoolXAName=sqlPoolXAName, sqlPoolXAMaximumIdleTime=sqlPoolXAMaximumIdleTime, transactionManagerTransactionMinTime=transactionManagerTransactionMinTime, sqlPoolXACreateConnectionSuccessCumulativeCount=sqlPoolXACreateConnectionSuccessCumulativeCount, versionProductVersion=versionProductVersion, alarmProbeTable=alarmProbeTable, asynchronousEventQueueWaitingEventCurrentCount=asynchronousEventQueueWaitingEventCurrentCount, asynchronousEventQueueEntry=asynchronousEventQueueEntry, remotePlatformEntry=remotePlatformEntry, asynchronousEventQueuePlatformId=asynchronousEventQueuePlatformId, sqlPoolXACheckedOutConnectionMaxCount=sqlPoolXACheckedOutConnectionMaxCount, schedulerTaskRunning=schedulerTaskRunning, asynchronousEventQueueTable=asynchronousEventQueueTable, transactionManagerActiveTransactionMaxCount=transactionManagerActiveTransactionMaxCount, alarmProbeSeverity=alarmProbeSeverity, versionTable=versionTable, versionEntry=versionEntry, sqlPoolXAMaximumSize=sqlPoolXAMaximumSize, schedulerTaskExecutionMinTime=schedulerTaskExecutionMinTime, asynchronousEventQueueInsertedEventCumulativeCount=asynchronousEventQueueInsertedEventCumulativeCount, schedulerTaskExecutionRetryCurrentCount=schedulerTaskExecutionRetryCurrentCount, schedulerTaskExecutionCumulativeTime=schedulerTaskExecutionCumulativeTime, lockManagerLockedItemCumulativeCount=lockManagerLockedItemCumulativeCount, sqlPoolXACheckedOutConnectionMinTime=sqlPoolXACheckedOutConnectionMinTime, slsConnectionLicenseCheckFailedCumulativeCount=slsConnectionLicenseCheckFailedCumulativeCount, transactionManagerLongTransactionThreshold=transactionManagerLongTransactionThreshold, versionBuildNumber=versionBuildNumber, enterprises=enterprises, sqlPoolXADriverName=sqlPoolXADriverName, scc=scc, transactionManagerCommittedTransactionCumulativeCount=transactionManagerCommittedTransactionCumulativeCount, platform=platform, platformPlatformStatus=platformPlatformStatus, asynchronousEventQueueEventProcessingMinTime=asynchronousEventQueueEventProcessingMinTime, transactionManagerActiveTransactionMinCount=transactionManagerActiveTransactionMinCount, lockManagerLockedItemCurrentCount=lockManagerLockedItemCurrentCount, asynchronousEventQueueEventProcessingMaxTime=asynchronousEventQueueEventProcessingMaxTime, slsConnectionLicenseCheckSuccessCumulativeCount=slsConnectionLicenseCheckSuccessCumulativeCount, sqlPoolXACheckedOutConnectionCumulativeCount=sqlPoolXACheckedOutConnectionCumulativeCount, transactionManagerTransactionMaxTime=transactionManagerTransactionMaxTime, asynchronousEventQueueProcessedEventCumulativeCount=asynchronousEventQueueProcessedEventCumulativeCount, sqlPoolXATable=sqlPoolXATable)
|
"""
icons for the developer
"""
class Icons:
python = "🐍"
document="📃"
dot = "•"
right_arrow = "→"
check_mark = "✔️"
x = "✘"
lock = "🔒"
please_cloud = "🙏"
hexagon = "⬢"
rocket = "🚀"
sattelite = "🛰"
wrench = "🔧"
manjaro = ""
github = ""
horizontal_bar = "▬"
symbol = "ஜ"
|
#!/usr/bin/env python
#-------------------------------------------------------------------------------
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def hasCycle(self, head):
"""
:type head: ListNode
:rtype: bool
"""
# We know a linkedList has a cycle if and only if it encounters an element again
if head is not None:
slow = head
fast = head
while fast and fast.next:
slow, fast = slow.next, fast.next.next
if slow is fast:
return True
return False
#-------------------------------------------------------------------------------
# Testing
|
DISCRETE = 0
CONTINUOUS = 1
INITIAL = 0
INTERMEDIATE = 1
FINAL = 2
|
# python3
def read_input():
return (input().rstrip(), input().rstrip())
def print_occurrences(output):
print(' '.join(map(str, output)))
def PolyHash(s, prime, multiplier):
hash = 0
for c in reversed(s):
hash = (hash * multiplier + ord(c)) % prime
return hash
def PrecomputeHashes(text, len_pattern, prime, multiplier):
H = [None] * (len(text) - len_pattern + 1)
S = text[len(text) - len_pattern:]
H[len(text) - len_pattern] = PolyHash(S, prime, multiplier)
y = 1
for i in range(len_pattern):
y = (y * multiplier) % prime
for i in range(len(text) - len_pattern - 1, -1, -1):
H[i] = (multiplier * H[i + 1] + ord(text[i]) -
y * ord(text[i + len_pattern])) % prime
return H
def get_occurrences(pattern, text):
result = []
prime = 1610612741
multiplier = 263
p_hash = PolyHash(pattern, prime, multiplier)
H = PrecomputeHashes(text, len(pattern), prime, multiplier)
for i in range(len(text) - len(pattern) + 1):
if (p_hash == H[i]) and (text[i:i + len(pattern)] == pattern):
result.append(i)
return result
if __name__ == '__main__':
print_occurrences(get_occurrences(*read_input()))
|
#!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'LiteSpeed (LiteSpeed Technologies)'
def is_waf(self):
schema1 = [
self.matchHeader(('Server', 'LiteSpeed')),
self.matchStatus(403)
]
schema2 = [
self.matchContent(r'Proudly powered by litespeed web server'),
self.matchContent(r'www\.litespeedtech\.com/error\-page')
]
if all(i for i in schema1):
return True
if any(i for i in schema2):
return True
return False |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 28 16:26:55 2022
@author: leoda
"""
precedence = {
'+': 1,
'-': 1,
'*': 2,
'/': 2,
'^': 3,
None: 0
}
symbols = ['+', '-', '*', '/', '^']
all_allowed = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '.', ')', '(']
all_allowed.extend(symbols)
# evaluates a simple expression
def evaluate_simple(x, y, symbol):
value = None
if symbol == '+':
value = x + y
elif symbol == '-':
value = x - y
elif symbol == '*':
value = x * y
elif symbol == '/':
value = x / y
elif symbol == '^':
value = x ** y
return value
# evaluates the equation in polish notation by recursion, equation is an array
def evaluate_in_polish(equation):
# can't have even length or length 0 as there is one more number than symbol
if equation is None or len(equation) % 2 == 0:
return None
# works by replacing elements by result until there is one left, the answer
while len(equation) > 1:
# find the first symbol element
counter = 2
while equation[counter] not in symbols:
counter += 1
# once found first symbol, evaluate its expression
result = evaluate_simple(equation[counter - 2], equation[counter - 1], equation[counter])
# replaces operands and operator with answer
equation.pop(counter - 2)
equation.pop(counter - 2)
equation[counter - 2] = result
return equation[0]
# allows either the use of integers or floating point numbers
def to_polish(equation, type_number):
# initialising data, in_polish is list in RPN, lower is used to extract numbers
# stack_symbols is all symbols of lower precedence, i is used to iterate
in_polish = []
lower = 0
stack_symbols = []
i = 0
end_bracket = False
while i < len(equation) - 1:
if equation[i] == '(':
# lower is first place after the bracket
i += 1
lower = i
# finds opening bracket corresponding to opening bracket,end just after it
brackets = 0
while brackets < 1:
# hasn't found a second bracket, returns nothing
if i >= len(equation):
print('Index out of range, wasnt correct bracketing!')
return None
if equation[i] == '(': brackets -= 1
if equation[i] == ')': brackets += 1
i += 1
# Show what was in the brackets
# print('bracket encountered: '+equation[lower:i-1])
# adds the stuff in the brackets in RPN in right order and reinitialises lower
in_polish.extend(to_polish(equation[lower:i - 1], type_number))
lower = i
# last encountered was bracketed
end_bracket = True
elif equation[i] in symbols:
# find number and makes sure it is correct
# add number to the list if last wasn't bracket
if not end_bracket:
try:
number = type_number(equation[lower:i])
in_polish.append(number)
except ValueError:
print('Not a correct number between symbols before end!')
return None
# reinitialise end_bracket and calculate precedence of symbol
end_bracket = False
precede = precedence[equation[i]]
# for all symbols which are already if they have same precedence or higher
# they need to be added to the list
for j in range(len(stack_symbols)):
if precedence[stack_symbols[len(stack_symbols) - j - 1]] >= precede:
in_polish.append(stack_symbols.pop())
else:
break
# add the symbol next at the top of the stack of symbols so popped first
stack_symbols.append(equation[i])
# adjust i and lower
i += 1
lower = i
else:
i += 1
# print(in_polish)
# if last symbol wasn't a bracket add the number
if not end_bracket:
try:
number = type_number(equation[lower:])
in_polish.append(number)
except:
print('Not a correct number between symbols in end!')
return None
# adds the rest of the symbols which were on the stack fo lower precedence
for j in range(len(stack_symbols)):
in_polish.append(stack_symbols.pop())
return in_polish
def evaluate(equation, type_number):
for j in equation:
if j not in all_allowed:
print('Symbols used not allowed')
return None
return evaluate_in_polish(to_polish(equation, type_number))
def evaluate_int(equation):
return evaluate(equation, int)
def evaluate_float(equation):
return evaluate(equation, float)
def main():
equation2 = '3*(9-6)^2'
# print(evaluate_int(equation2))
answer = None
in_polish = None
while answer == None:
equation2 = input('What is your equation: ')
in_polish = to_polish(equation2, int)
print(in_polish)
answer = evaluate_in_polish(in_polish)
print('Evaluated ' + equation2 + ' gives: ' + str(answer))
main()
|
# -*- coding: utf-8 -*-
#####################################################################################################################
# #
# Домашнее задание к уроку 1 #
# #
# Задание №6 #
# По введенным пользователем длинам трех отрезков определить, можно-ли составить из этих отрезков треугольник. #
# Если да, определить, будет-ли треугольник разносторонним, равнобедренным, или равносторонним. #
# #
# MIT License #
# Copyright (c) 2020 Michael Nikitenko #
# #
#####################################################################################################################
def input_numbers():
"""
Спрашивает у пользователя три числа и приводит введённые пользователем строки к числовому формату,
проводит проверку типов и возвращает список длин отрезков и результат проверки типов введенных пользователем данных
:return: list Список чисел; bool False - пользователь ввёл текст или околесицу
"""
numbers = []
numbers.append(input('Введите длину первого отрезка: '))
numbers.append(input('Введите длину второго отрезка: '))
numbers.append(input('Введите длину третьего отрезка: '))
res = []
for nbr in numbers:
try:
res.append(int(nbr))
except ValueError:
try:
res.append(float(nbr))
except ValueError:
return False
return sorted(res)
def check_triangle(sides):
"""
Принимает список из трех чисел, либо булевое False (если пользователь ввел неверные данные). Вычисляет существует
ли треугольник с данными длинами сторон, определяет его тип и возвращает строку с информацией о треугольнике.
:param sides: list Список с длинами трех отрезков or bool False в случае неверного ввода
:return: str Информация о том какой треугольник можно построить из данных длин отрезков.
"""
if sides == False:
return 'Вы ввели неверное(ые) значение(я). Необходимо ввести целые числа и/или десятичные дроби'
res = 'Данный треугольник '
if sides[0] + sides[1] > sides[2]:
res = res + 'cуществует'
if sides[0] == sides[1] and sides[1] == sides[2]:
res = res + ' и является раВносторонним'
elif sides[0] == sides[1] or sides[1] == sides[2]:
res = res + ' и является равнобедренным'
else:
res = res + ' и является раЗносторонним'
if sides[0]**2 + sides[1]**2 == sides[2]**2:
res = res + ', а так же прямоугольным.'
else:
res = res + 'не существует'
return res
if __name__ == '__main__':
print('Lesson 1 task 6')
sides = input_numbers()
print(check_triangle(sides)) |
#!/usr/bin/env python3
"""
global user-defined variables
"""
data_folder: str = 'data'
raw_data_folder: str = f'{data_folder}/raw_data'
clean_data_folder: str = f'{data_folder}/clean_data'
models_folder = f'{data_folder}/models'
text_vectorization_folder = f'{models_folder}/vectorization'
output_folder: str = 'output'
rnn_folder = f'{models_folder}/rnn'
rnn_file_name = 'cp.ckpt'
sentences_key: str = 'sentences'
random_state: int = 0
unknown_token: str = '[UNK]'
|
'''(Binary Search Special Trick Unknown length [M]): Given a sorted array whose
length is not known, perform binary search for a target T. Do the search in O(log(n)) time.'''
def binarySearchOverRange(arr, T, low, high):
while low <= high:
mid = low + (high - low) // 2
if arr[mid] == T:
return mid
elif arr[mid] < T:
low = mid + 1
else:
high = mid - 1
return -1
def binarySearchForLastIndex(arr, low, high):
while low <= high:
mid = low + (high - low) // 2
try:
temp = arr[mid]
except Exception as e:
# mid is out of bounds, go to lower half
high = mid - 1
continue
try:
temp = arr[mid + 1]
except Exception as e:
# mid + 1 is out of bounds, mid is last index
return mid
# both mid and mid + 1 are inside array, mid is not last index
low = mid + 1
# this does not have end of the array
return -1
def findWithUnknownLength(arr, T):
# 1,2,4,8,16,32
high = 1
lastIndex = -1
# consider putting a sanity limit here, don't go more
# than index 1 million.
while True:
try:
temp = arr[high]
except Exception as e:
lastIndex = binarySearchForLastIndex(arr, high // 2, high)
break
high *= 2
return binarySearchOverRange(arr, T, 0, lastIndex)
print(findWithUnknownLength([1,2,5,6,9,10], 5))
# Output: 2 -> lets imagine out input is unknown :)
# Time: O(logn) Space: O(1)
|
def lengthOfLongestSubstring(self, s: str) -> int:
valueMap = dict()
pointer = 0
maxLen = 0
for i in range(len(s)):
char = s[i]
if char in valueMap and pointer <= valueMap[char]:
pointer = valueMap[char] + 1
valueMap[char] = i
diff = i - pointer + 1
maxLen = max(diff, maxLen)
return maxLen |
"""
Verificação de CPF. Desenvolva um programa que solicite a digitação de um número de CPF no formato xxx.xxx.xxx-xx
e indique se é um número válido ou inválido através da validação dos dígitos verificadores edos caracteres de formatação.
"""
def ValidaCpf(cpf):
valido = bool(True)
if len(cpf) != 14:
return False
try:
if int(cpf[0:3]) > 1000 and int(cpf[0:2]) >= 0:
valido = False
print('a')
if int(cpf[4:7]) > 1000 and int(cpf[0:2]) >= 0:
print('b')
valido = False
if int(cpf[8:11]) > 1000 and int(cpf[0:2]) >= 0:
print('c')
valido = False
if int(cpf[12:]) > 99 and int(cpf[12]) >= 0:
print('d')
valido = False
if cpf[3] != '.' or cpf[7] != '.' or cpf[11] != '-':
valido = False
except:
return False
return valido
CPF = str()
while ValidaCpf(CPF) == False:
print(f'cpf invalido!')
CPF = str(input('Digite seu cpf[xxx-xxx-xxx-xx]: ' ))
print(f'cpf aceito!') |
# Singly-linked lists are already defined with this interface:
class ListNode(object):
def __init__(self, x):
self.value = x
self.next = None
def condense_linked_list(node):
# Reference the current node's value
current = node
# List to store the values
condensed_list = []
# Loop through the list
while current:
# If the current value is already in the list
if current.value in condensed_list:
# Delete it
current.value = None
# Otherwise, append the current value to the list
else:
condensed_list.append(current.value)
# Move to the next node
current = current.next
return condensed_list
|
class Trie:
''' 字典树,一次构建,多次查询:
优化过程: 使用list 代替 dict, 理论上来说更加节约内存!
'''
def __init__(self):
"""
Initialize your data structure here.
"""
self.sub_tree = [None] * 26 # 用list的话, indx : ord(s) - ord('a'), 实际运行来看使用list 并没有优化到内存,可能和题目的测试用例有关,用例少的话,确实使用 dict 还划算一些
self.isEnd = False
def insert(self, word: str) -> None:
"""
Inserts a word into the trie.
"""
node = self
for c in word:
idx = ord(c) - ord('a')
if node.sub_tree[idx] == None:
node.sub_tree[idx] = Trie()
node = node.sub_tree[idx]
node.isEnd = True
def search(self, word: str) -> bool:
"""
Returns if the word is in the trie.
"""
node = self
for c in word:
idx = ord(c) - ord('a')
if node.sub_tree[idx] != None:
node = node.sub_tree[idx]
else: return False
return node.isEnd
def startsWith(self, prefix: str) -> bool:
"""
Returns if there is any word in the trie that starts with the given prefix.
"""
node = self
for c in prefix:
idx = ord(c) - ord('a')
if node.sub_tree[idx] != None:
node = node.sub_tree[idx]
else: return False
return True
# Your Trie object will be instantiated and called as such:
# obj = Trie()
# obj.insert(word)
# param_2 = obj.search(word)
# param_3 = obj.startsWith(prefix) |
print("Anand K S")
print("AM.EN.U4CSE19106")
print("S1 CSE B")
print("Marvel rockz")
|
ct = "eae4a5b1aad7964ec9f1f0bff0229cf1a11b22b11bfefecc9922aaf4bff0dd3c88"
ct = bytes.fromhex(ct)
flag = ""
initialize = 0
for i in range(len(ct)):
for val in range(256):
if (initialize ^ (val<<2)^val)&0xff == ct[i]:
flag += chr(val)
initialize ^= (val<<2)^val
initialize >>=8
break
print(flag)
#batpwn{Ch00se_y0uR_pR3fix_w1selY}
|
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
# Yelp Key
ID = "Enter Your Yelp ID Here"
ykey = "Enter your Yelp API Key Here"
|
"""#CLASSES, MÉTODOS E SELF"""
"""
1 -Classes são abstrações e descrevem como os dados serão representados e manipulados.
Em Python, todos os tipos nativos também são classes. Por exemplo, o tipo int é uma classe do Python,
que permite representar números inteiros e realizar operações como soma, subtração, multiplicação, etc.,
com objetos inteiros
2- Método __init__: É um método, que por definição,
é executada sempre que instanciamos(Criamos) um objeto.
E método é o mesmo que função, mas função interna de uma classe, que só existe e atua nos seus objetos.
Ela só é vista fora do escopo do objeto se o programador desejar.
3- SELF: É esse parametro onde em cada objeto, específica e unicamente, que os métodos
vão atuar, e é por isso que o método self é necessário em cada método de uma classe.
Pode criar 1 trilhão de objetos de uma mesma classe. Mas o self se refere aquele objeto
específico, ok ?"""
class Carro:
portas = 3
def __init__(self):
print("Carro criado")
def exibePortas(self):
return self.portas
veloster = Carro()
print("Numero de portas:", veloster.exibePortas())
|
class Solution:
def subtractProductAndSum(self, n: int) -> int:
n = str(n)
s = 0
p = 1
for c in n:
c = int(c)
s += c
p *= c
return p - s
|
#!/usr/bin/env python3
# Dictionaries map a value to a key, hence a value can be
# called using the key.
# 1. They ar3333i3ie mutable, ie. they can be changed.
# 3. They are surrounded by curly {} brackets.
# 3. They are indexed using square [] brackets.
# 4. Key and Value pairs are separated by columns ":"
# 5. Each pair of key/value pairs are separated by commas ",".
# 6. Dicts return values not in any order.
# 7. collections.OrderedDict() gives an ordered dictionary.
# Create a dict
mydict1 = {}
# Add values to the dict.
mydict1["host1"] = "A.B.C.D"
mydict1["host2"] = "E.F.G.H"
print(mydict1)
# Remove values
del mydict1["host2"]
print(mydict1)
# Check if a key exists in a dict.
"host2" in mydict1
"host1" in mydict1
# Add elements to the dictionary
mydict1["host3"] = "I.J.K.L"
mydict1["host4"] = "M.N.O.P"
print(mydict1)
# Check the length of the dictionary
print(len(mydict1))
print(mydict1.keys())
released = {
"IPhone": 2007,
"IPhone 3G": 2008,
"IPhone 3GS": 2009,
"IPhone 4": 2010,
"IPhone 4S": 2011,
"IPhone 5": 2012,
"IPhone 5s": 2013,
"IPhone SE": 2016,
}
for i, j in released.items():
print("{0} was released in {1}".format(i, j))
# Change a value for a specific key
print("Changing the value for a key")
released["IPhone"] = 2006
released["IPhone"] += 1
print(released["IPhone"])
released["IPhone"] -= 1
print(released["IPhone"])
|
class RequestError(Exception):
def __init__(self, message: str, code: int):
super(RequestError, self).__init__(message)
self.code = code
|
# this is the default configuration file for cage interfaces
#
# request_timeout is conceptually the most far reaching parameter
# here, it is one of the guarantees for the entire cage - that it
# responds within that time, even though the response is a failure
#
# thread_count limits the number of threads in the cage's main
# processing thread pool, thus effectively the number of requests
# being processed concurrently, no matter which interface they
# arrived from; this behaviour of processing stuff with pools of
# worker threads while putting the excessive work on queue is one
# of the design principles of Pythomnic3k
#
# log_level can be changed at runtime to temporarily increase logging
# verbosity (set to "DEBUG") to see wtf is going on
config = dict \
(
interfaces = ("performance", "rpc", "retry"), # tuple containing names of interfaces to start
request_timeout = 10.0, # global request timeout for this cage
thread_count = 10, # interfaces worker thread pool size
sweep_period = 15.0, # time between scanning all pools for expired objects
log_level = "INFO", # one of "ERROR", "WARNING", "LOG", "INFO", "DEBUG", "NOISE"
)
# DO NOT TOUCH BELOW THIS LINE
__all__ = [ "get", "copy" ]
get = lambda key, default = None: pmnc.config.get_(config, {}, key, default)
copy = lambda: pmnc.config.copy_(config, {})
# EOF
|
"""
Build targets for default implementations of tf/core/platform libraries.
"""
# This is a temporary hack to mimic the presence of a BUILD file under
# tensorflow/core/platform/default. This is part of a large refactoring
# of BUILD rules under tensorflow/core/platform. We will remove this file
# and add real BUILD files under tensorflow/core/platform/default and
# tensorflow/core/platform/windows after the refactoring is complete.
TF_PLATFORM_LIBRARIES = {
"context": {
"name": "context_impl",
"hdrs": ["//tensorflow/core/platform:context.h"],
"textual_hdrs": ["//tensorflow/core/platform:default/context.h"],
"deps": [
"//tensorflow/core/platform",
],
"visibility": ["//visibility:private"],
},
"cord": {
"name": "cord_impl",
"hdrs": ["//tensorflow/core/platform:default/cord.h"],
"visibility": ["//visibility:private"],
},
}
def tf_instantiate_platform_libraries(names = []):
for name in names:
native.cc_library(**TF_PLATFORM_LIBRARIES[name])
|
def cyclical(length=100, relative_min=0.1):
'''Also known as triangular, https://arxiv.org/pdf/1506.01186.pdf'''
half = length / 2
def _cyclical(step, multiplier):
return (
step,
multiplier * (
relative_min + (1 - relative_min) * abs(
((step - 1) % length - half)
/ (half - 1)
)
)
)
return _cyclical
|
L = int(input())
C = int(input())
t2 = (((L - 1) + (C - 1)) * 2)
t1 = (L * C) + ((L - 1) * (C - 1))
print(f"{t1}\n{t2}") |
class usuario ():
"Clase que representa una persona."
def __init__(self, dni, nombre, apellido):
"Constructor de Persona"
self.dni = dni
self.nombre = nombre
self.apellido = apellido
def carritoCompras(self,carrito):
self.carrito=carrito
return
def __str__(self):
return f"{self.dni}{self.nombre}{self.apellido}" |
class AlreadyInDatabase(Exception):
pass
class MissingUnit(Exception):
pass |
name0_1_0_0_0_0_0 = None
name0_1_0_0_0_0_1 = None
name0_1_0_0_0_0_2 = None
name0_1_0_0_0_0_3 = None
name0_1_0_0_0_0_4 = None |
#
# MIT License
#
# brutemind framework for python
# Copyright (C) 2018 Michael Lin, Valeriy Garnaga
#
# 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.
class Data(object):
DATA_URL = "http://fremont1.cto911.com/esdoc/data/"
def __init__(self, inputTrainCsvZipUrl, outputTrainCsvZipUrl, inputTestCsvZipUrl, outputTestCsvZipUrl, zipPassword=None, refreshData=True):
self.inputTrainCsvZipUrl = inputTrainCsvZipUrl
self.outputTrainCsvZipUrl = outputTrainCsvZipUrl
self.inputTestCsvZipUrl = inputTestCsvZipUrl
self.outputTestCsvZipUrl = outputTestCsvZipUrl
self.zipPassword = zipPassword
self.refreshData = refreshData
def load_valuation(refresh_data=True):
inputTrainCsvZipUrl = '{}valuation_train_inputs.zip'.format(Data.DATA_URL)
outputTrainCsvZipUrl = '{}valuation_train_outputs.zip'.format(Data.DATA_URL)
inputTestCsvZipUrl = None
outputTestCsvZipUrl = None
return Data(inputTrainCsvZipUrl, outputTrainCsvZipUrl, inputTestCsvZipUrl, outputTestCsvZipUrl, refresh_data)
def load_iris(refresh_data=True):
inputTrainCsvZipUrl = '{}iris_train_inputs.zip'.format(Data.DATA_URL)
outputTrainCsvZipUrl = '{}iris_train_outputs.zip'.format(Data.DATA_URL)
inputTestCsvZipUrl = None
outputTestCsvZipUrl = None
return Data(inputTrainCsvZipUrl, outputTrainCsvZipUrl, inputTestCsvZipUrl, outputTestCsvZipUrl, refresh_data)
def load_diabetes(refresh_data=True):
inputTrainCsvZipUrl = '{}diabetes_train_inputs.zip'.format(Data.DATA_URL)
outputTrainCsvZipUrl = '{}diabetes_train_outputs.zip'.format(Data.DATA_URL)
inputTestCsvZipUrl = None
outputTestCsvZipUrl = None
return Data(inputTrainCsvZipUrl, outputTrainCsvZipUrl, inputTestCsvZipUrl, outputTestCsvZipUrl, refresh_data)
def load_mnist(refresh_data=True):
inputTrainCsvZipUrl = '{}mnist_train_inputs.zip'.format(Data.DATA_URL)
outputTrainCsvZipUrl = '{}mnist_train_outputs.zip'.format(Data.DATA_URL)
inputTestCsvZipUrl = '{}mnist_test_inputs.zip'.format(Data.DATA_URL)
outputTestCsvZipUrl = '{}mnist_test_outputs.zip'.format(Data.DATA_URL)
return Data(inputTrainCsvZipUrl, outputTrainCsvZipUrl, inputTestCsvZipUrl, outputTestCsvZipUrl, refresh_data)
|
class BinHeap(object):
def __init__(self):
self.size = 0
self.heapList = [0]
def __str__(self):
return '[ ' + ' '.join(str(i) for i in self.heapList[1:]) + ' ]'
def _percolateUp(self, i):
while i // 2 > 0:
if self.heapList[i] < self.heapList[i // 2]:
tmp = self.heapList[i // 2]
self.heapList[i // 2] = self.heapList[i]
self.heapList[i] = tmp
i //= 2
def _percolateDown(self, i):
while i * 2 <= self.size:
minC_idx = self._getMinChildIndex(i)
if self.heapList[i] > self.heapList[minC_idx]:
tmp = self.heapList[i]
self.heapList[i] = self.heapList[minC_idx]
self.heapList[minC_idx] = tmp
i = minC_idx
def _getMinChildIndex(self, i):
if i * 2 == self.size:
return i * 2
else:
if self.heapList[i * 2] < self.heapList[i * 2 + 1]:
return i * 2
else:
return i * 2 + 1
def insert(self, value):
self.heapList.append(value)
self.size += 1
self._percolateUp(self.size)
def delMin(self):
vmin = self.heapList[1]
self.heapList[1] = self.heapList[self.size]
self.heapList.pop()
self.size -= 1
self._percolateDown(1)
return vmin
def build_from_list(self, aList):
"""
One can build a heap by just inserting items one at a time.
This process is at O(log_n) ops. Since inserting an item in
middle of a list will cause O(n) ops, thus the whole process
will finally cost O(n*log_n).
However if start building a heap with an entire list, that will
end up with O(n) ops.
"""
i = len(aList) // 2
self.heapList = [0] + aList
self.size = len(aList)
while i > 0:
self._percolateDown(i)
i -= 1
if __name__ == '__main__':
bh = BinHeap()
print(bh)
bh.insert(17)
bh.insert(14)
bh.insert(9)
bh.insert(5)
print(bh)
bh = BinHeap()
bh.build_from_list([14, 9, 17, 5, 18, 21, 3])
print(bh)
bh.delMin()
print('del Min:', bh)
bh.delMin()
print('del Min:', bh)
bh.delMin()
print('del Min:', bh)
|
# Định nghĩa một hàm:
def sayHello(name):
# Kiểm tra nếu name là rỗng (empty) hoặc null.
if not name:
print("Hello every body!")
# Nếu name không rỗng và không null.
else:
print("Hello " + name)
# Gọi hàm, truyền tham số vào hàm.
sayHello("")
sayHello("Python")
sayHello("Java") |
class Solution:
def arrangeCoins(self, n: int) -> int:
res =1
while res*(res+1)<=2*n:
res +=1
res-=1
return res
|
#
# PySNMP MIB module Unisphere-Data-MPLS-CONF (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Unisphere-Data-MPLS-CONF
# Produced by pysmi-0.3.4 at Mon Apr 29 21:24:50 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint")
AgentCapabilities, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "AgentCapabilities", "NotificationGroup", "ModuleCompliance")
ObjectIdentity, MibIdentifier, Unsigned32, TimeTicks, Counter32, Integer32, Bits, Counter64, NotificationType, ModuleIdentity, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "MibIdentifier", "Unsigned32", "TimeTicks", "Counter32", "Integer32", "Bits", "Counter64", "NotificationType", "ModuleIdentity", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "IpAddress")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
usDataAgents, = mibBuilder.importSymbols("Unisphere-Data-Agents", "usDataAgents")
usdMplsMinorLayerConfGroup, usdMplsExplicitPathConfGroup, usdMplsTunnelProfileConfGroup, usdMplsLsrGlobalConfGroup, usdMplsMajorLayerConfGroup = mibBuilder.importSymbols("Unisphere-Data-MPLS-MIB", "usdMplsMinorLayerConfGroup", "usdMplsExplicitPathConfGroup", "usdMplsTunnelProfileConfGroup", "usdMplsLsrGlobalConfGroup", "usdMplsMajorLayerConfGroup")
usdMplsAgent = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 5, 2, 51))
usdMplsAgent.setRevisions(('2001-12-05 21:41',))
if mibBuilder.loadTexts: usdMplsAgent.setLastUpdated('200112052141Z')
if mibBuilder.loadTexts: usdMplsAgent.setOrganization('Unisphere Networks, Inc.')
usdMplsAgentV1 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 51, 1))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdMplsAgentV1 = usdMplsAgentV1.setProductRelease('Version 1 of the MultiProtocol Label Switching (MPLS) component of the\n Unisphere Routing Switch SNMP agent. This version of the MPLS component\n is supported in the Unisphere RX 4.0 and subsequent system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdMplsAgentV1 = usdMplsAgentV1.setStatus('current')
mibBuilder.exportSymbols("Unisphere-Data-MPLS-CONF", usdMplsAgentV1=usdMplsAgentV1, PYSNMP_MODULE_ID=usdMplsAgent, usdMplsAgent=usdMplsAgent)
|
DOUBLE_QUOTE = '[”|"]'
SINGLE_QUOTE = "[’|']"
SETS = r'(?:(\d+)\s*x\s*)?'
REPEATS = r'(\d+)\s*x\s*'
DISTANCE = r'(\d+)\s*'
PACE_OR_INTENSITY = r'\((.*?)\)\s*'
RECOVERY_BETWEEN_REPETITIONS_AND_OR_SETS = \
r'(?:\[(.*?)(?:\s*&\s*(.*?))?\]\s*)?'
RECOVERY_BETWEEN_SETS = r'(?:\[(.*?)\])?'
GROUPED_SETS_REGEX = r'(\d+)\s*x\s*\{(.*?)\}\s*\[(.*?)\]'
SETS_REGEX = SETS + r'(\d+\s*x\s*.*)'
REPETITION_REGEX = (
REPEATS +
DISTANCE +
PACE_OR_INTENSITY +
RECOVERY_BETWEEN_REPETITIONS_AND_OR_SETS +
RECOVERY_BETWEEN_SETS)
|
# 1 задача
for i in range(1,6):
print(i, i*0)
#2 задача
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
g = int(input())
h = int(input())
i = int(input())
j = int(input())
summm = 0
if a==5:
summm += 1
if b==5:
summm += 1
if c==5:
summm += 1
if d==5:
summm += 1
if e==5:
summm += 1
if f==5:
summm += 1
if g==5:
summm += 1
if h==5:
summm += 1
if i==5:
summm += 1
if j==5:
summm += 1
print("сумма пятерок", summm)
#задача 3
# sum = 0
# for i in range(1,101):
# sum+=i
# print(sum)
# задача 4
umnoj = 1
for i in range(1,11):
umnoj *= i
print("произведение равно", umnoj)
#задача 5
# integer_number = 2129
#
# #print(integer_number%10,integer_number//10)
#
# while integer_number>0:
# print(integer_number%10)
# integer_number = integer_number//10
#задача 6, 7
n = int(input())
mult = 1
summ = 0
while n > 0:
if n%10!= 0:
mult = mult*(n%10)
summ = summ + n%10
n = n//10
print ("сумма цифр числа равна", summ)
print ("произведение цифр числа равна", mult)
#задача 8
integer_number = 213413
while integer_number>0:
if integer_number%10 == 5:
print('Yes')
break
integer_number = integer_number//10
else: print('No')
# задача 9
a = int(input())
m = a%10
a = a//10
while a > 0:
if a%10 > m:
m = a%10
a = a//10
print("максимальная цифра числа", m)
#10 задача
n=int(input())
k=0
while n!=0:
d=n%10
if d==5:
k +=1
n=n//10
print("количество единиц в числе", k)
|
'''
Devita é o príncipe dos Calsadins. Juntamente com Pana, eles vão atrás de Tataroko, o nome de nascimento de Kogu, para tentar dominar o mundo. Ele possui um rastreador que mede o nível de energia de qualquer ser vivo. Todos os seres com o nível menor ou igual a 8000, ele considera como se fosse um inseto. Quando passa deste valor, que foi o caso de Kogu, ele se espanta e grita “Mais de 8000”. Baseado nisso, utilize a mesma tecnologia e analise o nível de energia dos seres vivos.
Entrada
A entrada é composta por vários casos de teste. A primeira linha contém um número inteiro C relativo ao número de casos de teste. Em seguida, haverá C linhas, com um número inteiro N (100 <= N <= 100000) relativo ao nível de energia de um ser vivo.
Saída
Para cada valor lido, imprima o texto correspondente.
'''
C = int(input())
for i in range(C):
N = int(input())
if N <= 8000:
print('Inseto!')
else:
print('Mais de 8000!')
|
'''
Descripttion:
version:
Author: HuSharp
Date: 2021-02-07 09:09:55
LastEditors: HuSharp
LastEditTime: 2021-02-08 10:17:11
@Email: 8211180515@csu.edu.cn
'''
def remove(n, digit):
'''
>>> remove(231, 3)
21
>>> remove(243123, 2)
4313
'''
kept, digits = 0, 0 # digits 记录当前位数
while n > 0:
n, last = n // 10, n % 10
if last != digit:
kept += last * (10 ** digits)
digits += 1
return kept
def cal_sum(*args):
ax = 0
for x in args:
ax += x
return ax
def lazy_sum(*args):
def sum():
ax = 0
for x in args:
ax += x
return ax
return sum
def count():
'''
>>> f1()
9
>>> f2()
9
>>> f3()
9
'''
fs = []
for i in range(1, 4):
def f():
return i * i
fs.append(f)
return fs
# test:
f1, f2, f3 = count()
# 因此 返回闭包时牢记一点:
# 返回函数不要引用任何循环变量,或者后续会发生变化的变量。
def count_2():
'''
>>> f1()
1
>>> f2()
4
>>> f3()
9
'''
def f(j):
def g():
return j * j
return g
# 若是这样,那么返回的则不是函数
# def m(j):
# return j * j
fs = []
for i in range(1, 4):
fs.append(f(i)) # f(i)立刻被执行,因此i的当前值被传入f()
return fs
#********************************************
# 利用闭包返回一个计数器函数,每次调用它返回递增整数:
def createCounter():
lst = []
def counter():
lst.append(0)
return len(lst)
return counter
# 测试:
counterA = createCounter()
print(counterA(), counterA(), counterA(), counterA(), counterA()) # 1 2 3 4 5
counterB = createCounter()
if [counterB(), counterB(), counterB(), counterB()] == [1, 2, 3, 4]:
print('测试通过!')
else:
print('测试失败!')
#********************************
# 装饰器
def trace1(fn):
def wrapped(x):
print('->', fn, '(', x, ')')
return fn(x)
return wrapped
@trace1
def triple(x):
return 3 * x
# 等价 triple = trace1(triple)
|
# coding=utf-8
class App:
TESTING = True
SQLALCHEMY_DATABASE_URI = 'mysql://lvye_pay:p@55word@127.0.0.1:3306/lvye_pay'
SQLALCHEMY_ECHO = True
class Biz:
VALID_NETLOCS = ['test_pay.lvye.com:5100']
HOST_URL = 'http://test_pay.lvye.com:5100'
CHECKOUT_URL = 'http://dev_pay.lvye.com:5102/checkout/{sn}'
TEST_CHANNELS = {'zyt_sample'}
|
# 1
grafo = [
{
"vertice": 'a',
"arestas": ['c', 'd', 'f']
},
{
"vertice": 'b',
"arestas": ['d', 'e']
},
{
"vertice": 'c',
"arestas": ['a', 'f']
},
{
"vertice": 'd',
"arestas": ['a', 'b', 'e', 'f']
},
{
"vertice": 'e',
"arestas": ['b', 'd']
},
{
"vertice": 'f',
"arestas": ['a', 'c', 'd']
},
{
"vertice": 'g',
"arestas": []
}
]
for i in grafo:
print(i)
|
thinkers = ['Plato','PlayDo','Gumby']
while True:
try:
thinker = thinkers.pop()
print(thinker)
except IndexError as e:
print("We tried to pop too many thinkers")
print(e)
break |
# Time Complexity : O(n) ; Space Complexity : O(n)
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode:
nodes = set()
while headA:
nodes.add(headA)
headA = headA.next
while headB:
if headB in nodes:
return headB
headB = headB.next
return None
# Time Complexity : O(2n) ; Space Complexity : O(1)
# Constant Space
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode:
lena,lenb = 0,0
tempa,tempb = headA,headB
while tempa:
lena += 1
tempa = tempa.next
while tempb:
lenb += 1
tempb = tempb.next
if lena>lenb:
for i in range(lena-lenb):
headA = headA.next
elif lena<lenb:
for i in range(lenb-lena):
headB = headB.next
while headA and headB:
if headA == headB:
return headA
headA = headA.next
headB = headB.next
return None
# Time Complexity : O(2n) ; Space Complexity : O(1) ; TRICKY
# Constant Space
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode:
lena,lenb = 0,0
if headA == None or headB == None:
return None
A_pointer = headA
B_pointer = headB
while A_pointer != B_pointer:
A_pointer = headB if A_pointer == None else A_pointer.next
B_pointer = headA if B_pointer == None else B_pointer.next
return A_pointer
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.